The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
import 'dart:async';
import 'dart:js_interop';
import 'package:web/web.dart' as web;
/// Tells each time the page comes back to the front: a tab left in the
/// background is where a release is missed longest, since a browser slows its
/// timers there.
Stream<void> pageShown() {
late final StreamController<void> controller;
late final JSFunction listener = ((web.Event _) {
if (web.document.visibilityState == 'visible') controller.add(null);
}).toJS;
controller = StreamController<void>.broadcast(
onListen: () => web.document.addEventListener('visibilitychange', listener),
onCancel: () =>
web.document.removeEventListener('visibilitychange', listener),
);
return controller.stream;
}