@openagt/dashboard 0.0.0-stage → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +125 -2
- package/dist/agent-id.d.ts +13 -0
- package/dist/agent-id.d.ts.map +1 -0
- package/dist/agent-id.js +20 -0
- package/dist/agent-id.js.map +1 -0
- package/dist/agent-locks.d.ts +3 -0
- package/dist/agent-locks.d.ts.map +1 -0
- package/dist/agent-locks.js +40 -0
- package/dist/agent-locks.js.map +1 -0
- package/dist/agent-view.d.ts +39 -0
- package/dist/agent-view.d.ts.map +1 -0
- package/dist/agent-view.js +45 -0
- package/dist/agent-view.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +11 -0
- package/dist/bin.js.map +1 -0
- package/dist/branch-name.d.ts +8 -0
- package/dist/branch-name.d.ts.map +1 -0
- package/dist/branch-name.js +20 -0
- package/dist/branch-name.js.map +1 -0
- package/dist/bridge-browser.d.ts +217 -0
- package/dist/bridge-browser.d.ts.map +1 -0
- package/dist/bridge-browser.js +520 -0
- package/dist/bridge-browser.js.map +1 -0
- package/dist/browser-stream.d.ts +20 -0
- package/dist/browser-stream.d.ts.map +1 -0
- package/dist/browser-stream.js +51 -0
- package/dist/browser-stream.js.map +1 -0
- package/dist/browser.d.ts +16 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +38 -0
- package/dist/browser.js.map +1 -0
- package/dist/built-in.d.ts +38 -0
- package/dist/built-in.d.ts.map +1 -0
- package/dist/built-in.js +119 -0
- package/dist/built-in.js.map +1 -0
- package/dist/chrome-extension/background.js +532 -0
- package/dist/chrome-extension/content.js +1475 -0
- package/dist/chrome-extension/driver-plan.js +41 -0
- package/dist/chrome-extension/fingerprint.js +43 -0
- package/dist/chrome-extension/manifest.json +31 -0
- package/dist/chrome-extension/options.html +48 -0
- package/dist/chrome-extension/options.js +122 -0
- package/dist/cli.d.ts +43 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +186 -0
- package/dist/cli.js.map +1 -0
- package/dist/client.d.ts +16 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +30 -0
- package/dist/client.js.map +1 -0
- package/dist/cloud-run-state.d.ts +27 -0
- package/dist/cloud-run-state.d.ts.map +1 -0
- package/dist/cloud-run-state.js +36 -0
- package/dist/cloud-run-state.js.map +1 -0
- package/dist/cloud-scratch-refs.d.ts +85 -0
- package/dist/cloud-scratch-refs.d.ts.map +1 -0
- package/dist/cloud-scratch-refs.js +275 -0
- package/dist/cloud-scratch-refs.js.map +1 -0
- package/dist/cloud-work.d.ts +66 -0
- package/dist/cloud-work.d.ts.map +1 -0
- package/dist/cloud-work.js +204 -0
- package/dist/cloud-work.js.map +1 -0
- package/dist/daemon-runtime.d.ts +42 -0
- package/dist/daemon-runtime.d.ts.map +1 -0
- package/dist/daemon-runtime.js +183 -0
- package/dist/daemon-runtime.js.map +1 -0
- package/dist/daemon-services.d.ts +37 -0
- package/dist/daemon-services.d.ts.map +1 -0
- package/dist/daemon-services.js +126 -0
- package/dist/daemon-services.js.map +1 -0
- package/dist/daemon-tick.d.ts +68 -0
- package/dist/daemon-tick.d.ts.map +1 -0
- package/dist/daemon-tick.js +97 -0
- package/dist/daemon-tick.js.map +1 -0
- package/dist/daemon.d.ts +65 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +202 -0
- package/dist/daemon.js.map +1 -0
- package/dist/dashboard/activity.d.ts +41 -0
- package/dist/dashboard/activity.d.ts.map +1 -0
- package/dist/dashboard/activity.js +56 -0
- package/dist/dashboard/activity.js.map +1 -0
- package/dist/dashboard/agent-handoff.d.ts +244 -0
- package/dist/dashboard/agent-handoff.d.ts.map +1 -0
- package/dist/dashboard/agent-handoff.js +310 -0
- package/dist/dashboard/agent-handoff.js.map +1 -0
- package/dist/dashboard/bridge-endpoints.d.ts +158 -0
- package/dist/dashboard/bridge-endpoints.d.ts.map +1 -0
- package/dist/dashboard/bridge-endpoints.js +382 -0
- package/dist/dashboard/bridge-endpoints.js.map +1 -0
- package/dist/dashboard/bridge-question.d.ts +33 -0
- package/dist/dashboard/bridge-question.d.ts.map +1 -0
- package/dist/dashboard/bridge-question.js +20 -0
- package/dist/dashboard/bridge-question.js.map +1 -0
- package/dist/dashboard/bridge-sessions.d.ts +25 -0
- package/dist/dashboard/bridge-sessions.d.ts.map +1 -0
- package/dist/dashboard/bridge-sessions.js +46 -0
- package/dist/dashboard/bridge-sessions.js.map +1 -0
- package/dist/dashboard/bridge-starts.d.ts +61 -0
- package/dist/dashboard/bridge-starts.d.ts.map +1 -0
- package/dist/dashboard/bridge-starts.js +94 -0
- package/dist/dashboard/bridge-starts.js.map +1 -0
- package/dist/dashboard/bridge-store.d.ts +179 -0
- package/dist/dashboard/bridge-store.d.ts.map +1 -0
- package/dist/dashboard/bridge-store.js +262 -0
- package/dist/dashboard/bridge-store.js.map +1 -0
- package/dist/dashboard/bundle.d.ts +12 -0
- package/dist/dashboard/bundle.d.ts.map +1 -0
- package/dist/dashboard/bundle.js +22 -0
- package/dist/dashboard/bundle.js.map +1 -0
- package/dist/dashboard/cache.d.ts +47 -0
- package/dist/dashboard/cache.d.ts.map +1 -0
- package/dist/dashboard/cache.js +87 -0
- package/dist/dashboard/cache.js.map +1 -0
- package/dist/dashboard/content-type.d.ts +3 -0
- package/dist/dashboard/content-type.d.ts.map +1 -0
- package/dist/dashboard/content-type.js +31 -0
- package/dist/dashboard/content-type.js.map +1 -0
- package/dist/dashboard/dashboard.d.ts +38 -0
- package/dist/dashboard/dashboard.d.ts.map +1 -0
- package/dist/dashboard/dashboard.js +42 -0
- package/dist/dashboard/dashboard.js.map +1 -0
- package/dist/dashboard/docs.d.ts +39 -0
- package/dist/dashboard/docs.d.ts.map +1 -0
- package/dist/dashboard/docs.js +59 -0
- package/dist/dashboard/docs.js.map +1 -0
- package/dist/dashboard/git-status.d.ts +44 -0
- package/dist/dashboard/git-status.d.ts.map +1 -0
- package/dist/dashboard/git-status.js +37 -0
- package/dist/dashboard/git-status.js.map +1 -0
- package/dist/dashboard/http.d.ts +29 -0
- package/dist/dashboard/http.d.ts.map +1 -0
- package/dist/dashboard/http.js +74 -0
- package/dist/dashboard/http.js.map +1 -0
- package/dist/dashboard/index.d.ts +24 -0
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.js +23 -0
- package/dist/dashboard/index.js.map +1 -0
- package/dist/dashboard/interventions.d.ts +67 -0
- package/dist/dashboard/interventions.d.ts.map +1 -0
- package/dist/dashboard/interventions.js +169 -0
- package/dist/dashboard/interventions.js.map +1 -0
- package/dist/dashboard/keyed-watcher.d.ts +29 -0
- package/dist/dashboard/keyed-watcher.d.ts.map +1 -0
- package/dist/dashboard/keyed-watcher.js +42 -0
- package/dist/dashboard/keyed-watcher.js.map +1 -0
- package/dist/dashboard/keys.d.ts +31 -0
- package/dist/dashboard/keys.d.ts.map +1 -0
- package/dist/dashboard/keys.js +37 -0
- package/dist/dashboard/keys.js.map +1 -0
- package/dist/dashboard/models.d.ts +25 -0
- package/dist/dashboard/models.d.ts.map +1 -0
- package/dist/dashboard/models.js +30 -0
- package/dist/dashboard/models.js.map +1 -0
- package/dist/dashboard/module-host.d.ts +44 -0
- package/dist/dashboard/module-host.d.ts.map +1 -0
- package/dist/dashboard/module-host.js +91 -0
- package/dist/dashboard/module-host.js.map +1 -0
- package/dist/dashboard/module-serve.d.ts +15 -0
- package/dist/dashboard/module-serve.d.ts.map +1 -0
- package/dist/dashboard/module-serve.js +45 -0
- package/dist/dashboard/module-serve.js.map +1 -0
- package/dist/dashboard/open-in-app.d.ts +43 -0
- package/dist/dashboard/open-in-app.d.ts.map +1 -0
- package/dist/dashboard/open-in-app.js +98 -0
- package/dist/dashboard/open-in-app.js.map +1 -0
- package/dist/dashboard/open-questions.d.ts +45 -0
- package/dist/dashboard/open-questions.d.ts.map +1 -0
- package/dist/dashboard/open-questions.js +62 -0
- package/dist/dashboard/open-questions.js.map +1 -0
- package/dist/dashboard/overview.d.ts +78 -0
- package/dist/dashboard/overview.d.ts.map +1 -0
- package/dist/dashboard/overview.js +87 -0
- package/dist/dashboard/overview.js.map +1 -0
- package/dist/dashboard/projects.d.ts +101 -0
- package/dist/dashboard/projects.d.ts.map +1 -0
- package/dist/dashboard/projects.js +63 -0
- package/dist/dashboard/projects.js.map +1 -0
- package/dist/dashboard/pull-requests.d.ts +127 -0
- package/dist/dashboard/pull-requests.d.ts.map +1 -0
- package/dist/dashboard/pull-requests.js +137 -0
- package/dist/dashboard/pull-requests.js.map +1 -0
- package/dist/dashboard/queue.d.ts +17 -0
- package/dist/dashboard/queue.d.ts.map +1 -0
- package/dist/dashboard/queue.js +19 -0
- package/dist/dashboard/queue.js.map +1 -0
- package/dist/dashboard/quota.d.ts +53 -0
- package/dist/dashboard/quota.d.ts.map +1 -0
- package/dist/dashboard/quota.js +42 -0
- package/dist/dashboard/quota.js.map +1 -0
- package/dist/dashboard/relay-endpoints.d.ts +32 -0
- package/dist/dashboard/relay-endpoints.d.ts.map +1 -0
- package/dist/dashboard/relay-endpoints.js +115 -0
- package/dist/dashboard/relay-endpoints.js.map +1 -0
- package/dist/dashboard/remote-run.d.ts +95 -0
- package/dist/dashboard/remote-run.d.ts.map +1 -0
- package/dist/dashboard/remote-run.js +235 -0
- package/dist/dashboard/remote-run.js.map +1 -0
- package/dist/dashboard/rpc-serve.d.ts +106 -0
- package/dist/dashboard/rpc-serve.d.ts.map +1 -0
- package/dist/dashboard/rpc-serve.js +180 -0
- package/dist/dashboard/rpc-serve.js.map +1 -0
- package/dist/dashboard/run-inbox.d.ts +31 -0
- package/dist/dashboard/run-inbox.d.ts.map +1 -0
- package/dist/dashboard/run-inbox.js +51 -0
- package/dist/dashboard/run-inbox.js.map +1 -0
- package/dist/dashboard/server.d.ts +105 -0
- package/dist/dashboard/server.d.ts.map +1 -0
- package/dist/dashboard/server.js +231 -0
- package/dist/dashboard/server.js.map +1 -0
- package/dist/dashboard/static.d.ts +9 -0
- package/dist/dashboard/static.d.ts.map +1 -0
- package/dist/dashboard/static.js +54 -0
- package/dist/dashboard/static.js.map +1 -0
- package/dist/dashboard/types.d.ts +135 -0
- package/dist/dashboard/types.d.ts.map +1 -0
- package/dist/dashboard/types.js +2 -0
- package/dist/dashboard/types.js.map +1 -0
- package/dist/dashboard/web-start-endpoints.d.ts +32 -0
- package/dist/dashboard/web-start-endpoints.d.ts.map +1 -0
- package/dist/dashboard/web-start-endpoints.js +75 -0
- package/dist/dashboard/web-start-endpoints.js.map +1 -0
- package/dist/dashboard-bundle/assets/client-CbBRB9m4.js +9 -0
- package/dist/dashboard-bundle/assets/jsx-runtime-By8HlURe.js +1 -0
- package/dist/dashboard-bundle/assets/main-B98UOA3_.js +140 -0
- package/dist/dashboard-bundle/assets/main-ByRjbCiA.css +2 -0
- package/dist/dashboard-bundle/assets/module-v213KWfH.js +21 -0
- package/dist/dashboard-bundle/assets/react-CZI7_Jkm.js +1 -0
- package/dist/dashboard-bundle/assets/react-dom-cJyBB_A4.js +1 -0
- package/dist/dashboard-bundle/assets/rolldown-runtime-QTnfLwEv.js +1 -0
- package/dist/dashboard-bundle/host/module.js +1 -0
- package/dist/dashboard-bundle/host/react-dom-client.js +1 -0
- package/dist/dashboard-bundle/host/react-dom.js +1 -0
- package/dist/dashboard-bundle/host/react-jsx-runtime.js +1 -0
- package/dist/dashboard-bundle/host/react.js +1 -0
- package/dist/dashboard-bundle/index.html +42 -0
- package/dist/dashboard-bundle/logo-animated.svg +34 -0
- package/dist/dashboard-bundle/logo.svg +16 -0
- package/dist/dashboard-rpc/context.d.ts +56 -0
- package/dist/dashboard-rpc/context.d.ts.map +1 -0
- package/dist/dashboard-rpc/context.js +106 -0
- package/dist/dashboard-rpc/context.js.map +1 -0
- package/dist/dashboard-rpc/control.d.ts +124 -0
- package/dist/dashboard-rpc/control.d.ts.map +1 -0
- package/dist/dashboard-rpc/control.js +284 -0
- package/dist/dashboard-rpc/control.js.map +1 -0
- package/dist/dashboard-rpc/devices.d.ts +9 -0
- package/dist/dashboard-rpc/devices.d.ts.map +1 -0
- package/dist/dashboard-rpc/devices.js +12 -0
- package/dist/dashboard-rpc/devices.js.map +1 -0
- package/dist/dashboard-rpc/events-tail.d.ts +68 -0
- package/dist/dashboard-rpc/events-tail.d.ts.map +1 -0
- package/dist/dashboard-rpc/events-tail.js +257 -0
- package/dist/dashboard-rpc/events-tail.js.map +1 -0
- package/dist/dashboard-rpc/events.d.ts +39 -0
- package/dist/dashboard-rpc/events.d.ts.map +1 -0
- package/dist/dashboard-rpc/events.js +47 -0
- package/dist/dashboard-rpc/events.js.map +1 -0
- package/dist/dashboard-rpc/index.d.ts +29 -0
- package/dist/dashboard-rpc/index.d.ts.map +1 -0
- package/dist/dashboard-rpc/index.js +40 -0
- package/dist/dashboard-rpc/index.js.map +1 -0
- package/dist/dashboard-rpc/models.d.ts +4 -0
- package/dist/dashboard-rpc/models.d.ts.map +1 -0
- package/dist/dashboard-rpc/models.js +8 -0
- package/dist/dashboard-rpc/models.js.map +1 -0
- package/dist/dashboard-rpc/modules.d.ts +45 -0
- package/dist/dashboard-rpc/modules.d.ts.map +1 -0
- package/dist/dashboard-rpc/modules.js +79 -0
- package/dist/dashboard-rpc/modules.js.map +1 -0
- package/dist/dashboard-rpc/preferences.d.ts +41 -0
- package/dist/dashboard-rpc/preferences.d.ts.map +1 -0
- package/dist/dashboard-rpc/preferences.js +65 -0
- package/dist/dashboard-rpc/preferences.js.map +1 -0
- package/dist/dashboard-rpc/projects.d.ts +85 -0
- package/dist/dashboard-rpc/projects.d.ts.map +1 -0
- package/dist/dashboard-rpc/projects.js +129 -0
- package/dist/dashboard-rpc/projects.js.map +1 -0
- package/dist/dashboard-rpc/quota.d.ts +4 -0
- package/dist/dashboard-rpc/quota.d.ts.map +1 -0
- package/dist/dashboard-rpc/quota.js +15 -0
- package/dist/dashboard-rpc/quota.js.map +1 -0
- package/dist/dashboard-rpc/reads.d.ts +185 -0
- package/dist/dashboard-rpc/reads.d.ts.map +1 -0
- package/dist/dashboard-rpc/reads.js +370 -0
- package/dist/dashboard-rpc/reads.js.map +1 -0
- package/dist/dashboard-rpc/relay-agent.d.ts +9 -0
- package/dist/dashboard-rpc/relay-agent.d.ts.map +1 -0
- package/dist/dashboard-rpc/relay-agent.js +21 -0
- package/dist/dashboard-rpc/relay-agent.js.map +1 -0
- package/dist/dashboard-rpc/relay-dispatch.d.ts +9 -0
- package/dist/dashboard-rpc/relay-dispatch.d.ts.map +1 -0
- package/dist/dashboard-rpc/relay-dispatch.js +24 -0
- package/dist/dashboard-rpc/relay-dispatch.js.map +1 -0
- package/dist/dashboard-rpc/stream-forward.d.ts +17 -0
- package/dist/dashboard-rpc/stream-forward.d.ts.map +1 -0
- package/dist/dashboard-rpc/stream-forward.js +38 -0
- package/dist/dashboard-rpc/stream-forward.js.map +1 -0
- package/dist/dashboard-rpc/test-context.d.ts +23 -0
- package/dist/dashboard-rpc/test-context.d.ts.map +1 -0
- package/dist/dashboard-rpc/test-context.js +43 -0
- package/dist/dashboard-rpc/test-context.js.map +1 -0
- package/dist/driver-names.d.ts +22 -0
- package/dist/driver-names.d.ts.map +1 -0
- package/dist/driver-names.js +29 -0
- package/dist/driver-names.js.map +1 -0
- package/dist/error-message.d.ts +8 -0
- package/dist/error-message.d.ts.map +1 -0
- package/dist/error-message.js +10 -0
- package/dist/error-message.js.map +1 -0
- package/dist/event-stream.d.ts +33 -0
- package/dist/event-stream.d.ts.map +1 -0
- package/dist/event-stream.js +104 -0
- package/dist/event-stream.js.map +1 -0
- package/dist/events.d.ts +236 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +5 -0
- package/dist/events.js.map +1 -0
- package/dist/format-bytes.d.ts +3 -0
- package/dist/format-bytes.d.ts.map +1 -0
- package/dist/format-bytes.js +18 -0
- package/dist/format-bytes.js.map +1 -0
- package/dist/has-remote.d.ts +8 -0
- package/dist/has-remote.d.ts.map +1 -0
- package/dist/has-remote.js +10 -0
- package/dist/has-remote.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/install.d.ts +31 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +54 -0
- package/dist/install.js.map +1 -0
- package/dist/jsonl-tail.d.ts +59 -0
- package/dist/jsonl-tail.d.ts.map +1 -0
- package/dist/jsonl-tail.js +152 -0
- package/dist/jsonl-tail.js.map +1 -0
- package/dist/loopback-host.d.ts +20 -0
- package/dist/loopback-host.d.ts.map +1 -0
- package/dist/loopback-host.js +31 -0
- package/dist/loopback-host.js.map +1 -0
- package/dist/module-server.d.ts +56 -0
- package/dist/module-types/dashboard/components/DiffStat.d.ts +6 -0
- package/dist/module-types/dashboard/components/DriverModelMenu.d.ts +23 -0
- package/dist/module-types/dashboard/components/LinkActions.d.ts +26 -0
- package/dist/module-types/dashboard/components/Markdown.d.ts +4 -0
- package/dist/module-types/dashboard/components/SettingsRows.d.ts +37 -0
- package/dist/module-types/dashboard/components/StartAgentButton.d.ts +39 -0
- package/dist/module-types/dashboard/components/ui/badge.d.ts +2 -0
- package/dist/module-types/dashboard/components/ui/button.d.ts +10 -0
- package/dist/module-types/dashboard/components/ui/card.d.ts +5 -0
- package/dist/module-types/dashboard/components/ui/checkbox.d.ts +7 -0
- package/dist/module-types/dashboard/components/ui/dropdown-menu.d.ts +16 -0
- package/dist/module-types/dashboard/components/ui/input.d.ts +2 -0
- package/dist/module-types/dashboard/components/ui/option-label.d.ts +4 -0
- package/dist/module-types/dashboard/components/ui/popover.d.ts +8 -0
- package/dist/module-types/dashboard/components/ui/scroll-area.d.ts +10 -0
- package/dist/module-types/dashboard/components/ui/separator.d.ts +3 -0
- package/dist/module-types/dashboard/components/ui/skeleton.d.ts +2 -0
- package/dist/module-types/dashboard/components/ui/slider.d.ts +9 -0
- package/dist/module-types/dashboard/components/ui/tooltip.d.ts +11 -0
- package/dist/module-types/dashboard/lib/agent-settings.d.ts +2 -0
- package/dist/module-types/dashboard/lib/draft-handoff.d.ts +15 -0
- package/dist/module-types/dashboard/lib/format-date.d.ts +51 -0
- package/dist/module-types/dashboard/lib/host-services.d.ts +12 -0
- package/dist/module-types/dashboard/lib/models.d.ts +24 -0
- package/dist/module-types/dashboard/lib/route.d.ts +38 -0
- package/dist/module-types/dashboard/lib/rpc.d.ts +31 -0
- package/dist/module-types/dashboard/lib/use-action.d.ts +25 -0
- package/dist/module-types/dashboard/lib/use-async.d.ts +45 -0
- package/dist/module-types/dashboard/lib/use-modules.d.ts +79 -0
- package/dist/module-types/dashboard/lib/utils.d.ts +3 -0
- package/dist/module-types/dashboard/module/index.d.ts +335 -0
- package/dist/module-types/dashboard/rpc/models.d.ts +2 -0
- package/dist/module-types/dashboard/rpc/modules.d.ts +5 -0
- package/dist/module-types/src/agent-id.d.ts +12 -0
- package/dist/module-types/src/agent-locks.d.ts +2 -0
- package/dist/module-types/src/agent-view.d.ts +38 -0
- package/dist/module-types/src/bridge-browser.d.ts +216 -0
- package/dist/module-types/src/browser-stream.d.ts +19 -0
- package/dist/module-types/src/browser.d.ts +15 -0
- package/dist/module-types/src/built-in.d.ts +37 -0
- package/dist/module-types/src/client.d.ts +15 -0
- package/dist/module-types/src/cloud-run-state.d.ts +26 -0
- package/dist/module-types/src/dashboard/activity.d.ts +40 -0
- package/dist/module-types/src/dashboard/agent-handoff.d.ts +243 -0
- package/dist/module-types/src/dashboard/bridge-endpoints.d.ts +157 -0
- package/dist/module-types/src/dashboard/bridge-question.d.ts +32 -0
- package/dist/module-types/src/dashboard/bridge-store.d.ts +178 -0
- package/dist/module-types/src/dashboard/cache.d.ts +46 -0
- package/dist/module-types/src/dashboard/content-type.d.ts +2 -0
- package/dist/module-types/src/dashboard/dashboard.d.ts +37 -0
- package/dist/module-types/src/dashboard/docs.d.ts +38 -0
- package/dist/module-types/src/dashboard/git-status.d.ts +43 -0
- package/dist/module-types/src/dashboard/http.d.ts +28 -0
- package/dist/module-types/src/dashboard/interventions.d.ts +66 -0
- package/dist/module-types/src/dashboard/keyed-watcher.d.ts +28 -0
- package/dist/module-types/src/dashboard/keys.d.ts +30 -0
- package/dist/module-types/src/dashboard/models.d.ts +24 -0
- package/dist/module-types/src/dashboard/module-host.d.ts +43 -0
- package/dist/module-types/src/dashboard/module-serve.d.ts +14 -0
- package/dist/module-types/src/dashboard/open-in-app.d.ts +42 -0
- package/dist/module-types/src/dashboard/open-questions.d.ts +44 -0
- package/dist/module-types/src/dashboard/overview.d.ts +77 -0
- package/dist/module-types/src/dashboard/projects.d.ts +100 -0
- package/dist/module-types/src/dashboard/pull-requests.d.ts +126 -0
- package/dist/module-types/src/dashboard/queue.d.ts +16 -0
- package/dist/module-types/src/dashboard/quota.d.ts +52 -0
- package/dist/module-types/src/dashboard/remote-run.d.ts +94 -0
- package/dist/module-types/src/dashboard/rpc-serve.d.ts +105 -0
- package/dist/module-types/src/dashboard/run-inbox.d.ts +30 -0
- package/dist/module-types/src/dashboard/types.d.ts +134 -0
- package/dist/module-types/src/dashboard-rpc/context.d.ts +55 -0
- package/dist/module-types/src/dashboard-rpc/control.d.ts +123 -0
- package/dist/module-types/src/dashboard-rpc/devices.d.ts +8 -0
- package/dist/module-types/src/dashboard-rpc/events-tail.d.ts +67 -0
- package/dist/module-types/src/dashboard-rpc/events.d.ts +38 -0
- package/dist/module-types/src/dashboard-rpc/index.d.ts +28 -0
- package/dist/module-types/src/dashboard-rpc/models.d.ts +3 -0
- package/dist/module-types/src/dashboard-rpc/modules.d.ts +44 -0
- package/dist/module-types/src/dashboard-rpc/preferences.d.ts +40 -0
- package/dist/module-types/src/dashboard-rpc/projects.d.ts +84 -0
- package/dist/module-types/src/dashboard-rpc/quota.d.ts +3 -0
- package/dist/module-types/src/dashboard-rpc/reads.d.ts +184 -0
- package/dist/module-types/src/dashboard-rpc/relay-agent.d.ts +8 -0
- package/dist/module-types/src/dashboard-rpc/stream-forward.d.ts +16 -0
- package/dist/module-types/src/driver-names.d.ts +21 -0
- package/dist/module-types/src/error-message.d.ts +7 -0
- package/dist/module-types/src/event-stream.d.ts +32 -0
- package/dist/module-types/src/events.d.ts +235 -0
- package/dist/module-types/src/format-bytes.d.ts +2 -0
- package/dist/module-types/src/has-remote.d.ts +7 -0
- package/dist/module-types/src/index.d.ts +41 -0
- package/dist/module-types/src/jsonl-tail.d.ts +58 -0
- package/dist/module-types/src/loopback-host.d.ts +19 -0
- package/dist/module-types/src/node-fs.d.ts +32 -0
- package/dist/module-types/src/open-choices.d.ts +14 -0
- package/dist/module-types/src/openagent-dir.d.ts +10 -0
- package/dist/module-types/src/openagent-gitignore.d.ts +11 -0
- package/dist/module-types/src/pick-directory.d.ts +29 -0
- package/dist/module-types/src/preference-defaults.d.ts +42 -0
- package/dist/module-types/src/project-commands.d.ts +23 -0
- package/dist/module-types/src/project-errors.d.ts +59 -0
- package/dist/module-types/src/project-hooks.d.ts +129 -0
- package/dist/module-types/src/project-modules.d.ts +49 -0
- package/dist/module-types/src/project-presets.d.ts +29 -0
- package/dist/module-types/src/project.d.ts +28 -0
- package/dist/module-types/src/publish-levels.d.ts +32 -0
- package/dist/module-types/src/quota-boundary.d.ts +64 -0
- package/dist/module-types/src/quota-poller.d.ts +82 -0
- package/dist/module-types/src/registry.d.ts +226 -0
- package/dist/module-types/src/store/agent-checkout.d.ts +53 -0
- package/dist/module-types/src/store/agent-store.d.ts +266 -0
- package/dist/module-types/src/store/branches.d.ts +163 -0
- package/dist/module-types/src/store/git-host.d.ts +113 -0
- package/dist/module-types/src/store/index.d.ts +9 -0
- package/dist/module-types/src/store/provided.d.ts +16 -0
- package/dist/module-types/src/store/queue.d.ts +45 -0
- package/dist/module-types/src/store/repository.d.ts +32 -0
- package/dist/module-types/src/store/run-record.d.ts +21 -0
- package/dist/module-types/src/store/runs.d.ts +107 -0
- package/dist/module-types/src/store/tickets.d.ts +72 -0
- package/dist/module-types/src/terminal.d.ts +3 -0
- package/dist/module-types/src/worktrees.d.ts +89 -0
- package/dist/module.css +50 -0
- package/dist/node-fs.d.ts +33 -0
- package/dist/node-fs.d.ts.map +1 -0
- package/dist/node-fs.js +57 -0
- package/dist/node-fs.js.map +1 -0
- package/dist/open-choices.d.ts +15 -0
- package/dist/open-choices.d.ts.map +1 -0
- package/dist/open-choices.js +31 -0
- package/dist/open-choices.js.map +1 -0
- package/dist/openagent-dir.d.ts +11 -0
- package/dist/openagent-dir.d.ts.map +1 -0
- package/dist/openagent-dir.js +11 -0
- package/dist/openagent-dir.js.map +1 -0
- package/dist/openagent-gitignore.d.ts +12 -0
- package/dist/openagent-gitignore.d.ts.map +1 -0
- package/dist/openagent-gitignore.js +19 -0
- package/dist/openagent-gitignore.js.map +1 -0
- package/dist/pick-directory.d.ts +30 -0
- package/dist/pick-directory.d.ts.map +1 -0
- package/dist/pick-directory.js +102 -0
- package/dist/pick-directory.js.map +1 -0
- package/dist/preference-defaults.d.ts +43 -0
- package/dist/preference-defaults.d.ts.map +1 -0
- package/dist/preference-defaults.js +34 -0
- package/dist/preference-defaults.js.map +1 -0
- package/dist/project-commands.d.ts +24 -0
- package/dist/project-commands.d.ts.map +1 -0
- package/dist/project-commands.js +57 -0
- package/dist/project-commands.js.map +1 -0
- package/dist/project-errors.d.ts +60 -0
- package/dist/project-errors.d.ts.map +1 -0
- package/dist/project-errors.js +51 -0
- package/dist/project-errors.js.map +1 -0
- package/dist/project-hooks.d.ts +130 -0
- package/dist/project-hooks.d.ts.map +1 -0
- package/dist/project-hooks.js +232 -0
- package/dist/project-hooks.js.map +1 -0
- package/dist/project-modules.d.ts +50 -0
- package/dist/project-modules.d.ts.map +1 -0
- package/dist/project-modules.js +110 -0
- package/dist/project-modules.js.map +1 -0
- package/dist/project-pass.d.ts +32 -0
- package/dist/project-pass.d.ts.map +1 -0
- package/dist/project-pass.js +45 -0
- package/dist/project-pass.js.map +1 -0
- package/dist/project-presets.d.ts +30 -0
- package/dist/project-presets.d.ts.map +1 -0
- package/dist/project-presets.js +74 -0
- package/dist/project-presets.js.map +1 -0
- package/dist/project.d.ts +29 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +41 -0
- package/dist/project.js.map +1 -0
- package/dist/publish-levels.d.ts +33 -0
- package/dist/publish-levels.d.ts.map +1 -0
- package/dist/publish-levels.js +53 -0
- package/dist/publish-levels.js.map +1 -0
- package/dist/quota-boundary.d.ts +65 -0
- package/dist/quota-boundary.d.ts.map +1 -0
- package/dist/quota-boundary.js +135 -0
- package/dist/quota-boundary.js.map +1 -0
- package/dist/quota-poller.d.ts +83 -0
- package/dist/quota-poller.d.ts.map +1 -0
- package/dist/quota-poller.js +118 -0
- package/dist/quota-poller.js.map +1 -0
- package/dist/registry.d.ts +227 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +364 -0
- package/dist/registry.js.map +1 -0
- package/dist/remove-files.d.ts +24 -0
- package/dist/remove-files.d.ts.map +1 -0
- package/dist/remove-files.js +98 -0
- package/dist/remove-files.js.map +1 -0
- package/dist/request-path.d.ts +10 -0
- package/dist/request-path.d.ts.map +1 -0
- package/dist/request-path.js +16 -0
- package/dist/request-path.js.map +1 -0
- package/dist/store/agent-checkout.d.ts +54 -0
- package/dist/store/agent-checkout.d.ts.map +1 -0
- package/dist/store/agent-checkout.js +61 -0
- package/dist/store/agent-checkout.js.map +1 -0
- package/dist/store/agent-store.d.ts +267 -0
- package/dist/store/agent-store.d.ts.map +1 -0
- package/dist/store/agent-store.js +190 -0
- package/dist/store/agent-store.js.map +1 -0
- package/dist/store/branches.d.ts +164 -0
- package/dist/store/branches.d.ts.map +1 -0
- package/dist/store/branches.js +187 -0
- package/dist/store/branches.js.map +1 -0
- package/dist/store/git-host.d.ts +114 -0
- package/dist/store/git-host.d.ts.map +1 -0
- package/dist/store/git-host.js +103 -0
- package/dist/store/git-host.js.map +1 -0
- package/dist/store/index.d.ts +10 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +10 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/provided.d.ts +17 -0
- package/dist/store/provided.d.ts.map +1 -0
- package/dist/store/provided.js +37 -0
- package/dist/store/provided.js.map +1 -0
- package/dist/store/queue.d.ts +46 -0
- package/dist/store/queue.d.ts.map +1 -0
- package/dist/store/queue.js +61 -0
- package/dist/store/queue.js.map +1 -0
- package/dist/store/repository.d.ts +33 -0
- package/dist/store/repository.d.ts.map +1 -0
- package/dist/store/repository.js +25 -0
- package/dist/store/repository.js.map +1 -0
- package/dist/store/run-record.d.ts +22 -0
- package/dist/store/run-record.d.ts.map +1 -0
- package/dist/store/run-record.js +108 -0
- package/dist/store/run-record.js.map +1 -0
- package/dist/store/runs.d.ts +108 -0
- package/dist/store/runs.d.ts.map +1 -0
- package/dist/store/runs.js +146 -0
- package/dist/store/runs.js.map +1 -0
- package/dist/store/test-branches.d.ts +18 -0
- package/dist/store/test-branches.d.ts.map +1 -0
- package/dist/store/test-branches.js +59 -0
- package/dist/store/test-branches.js.map +1 -0
- package/dist/store/test-runs.d.ts +15 -0
- package/dist/store/test-runs.d.ts.map +1 -0
- package/dist/store/test-runs.js +37 -0
- package/dist/store/test-runs.js.map +1 -0
- package/dist/store/tickets.d.ts +73 -0
- package/dist/store/tickets.d.ts.map +1 -0
- package/dist/store/tickets.js +67 -0
- package/dist/store/tickets.js.map +1 -0
- package/dist/terminal.d.ts +4 -0
- package/dist/terminal.d.ts.map +1 -0
- package/dist/terminal.js +97 -0
- package/dist/terminal.js.map +1 -0
- package/dist/update-check.d.ts +44 -0
- package/dist/update-check.d.ts.map +1 -0
- package/dist/update-check.js +71 -0
- package/dist/update-check.js.map +1 -0
- package/dist/worktrees.d.ts +90 -0
- package/dist/worktrees.d.ts.map +1 -0
- package/dist/worktrees.js +123 -0
- package/dist/worktrees.js.map +1 -0
- package/package.json +103 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Suleiman Shahbari
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,126 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @openagt/dashboard
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**OpenAgent** — autonomous AI programming: humans make the important decisions
|
|
4
|
+
while coding agents run unattended.
|
|
5
|
+
|
|
6
|
+
You register your repos. From then on, agents work on them: each agent gets a throwaway
|
|
7
|
+
checkout of the repo, does its work, and hands the result off as a pull request. Your own
|
|
8
|
+
checkout is never touched.
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm i -g @openagt/dashboard
|
|
12
|
+
|
|
13
|
+
cd ~/code/my-repo
|
|
14
|
+
openagent # serves the dashboard at http://127.0.0.1:4200
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## The CLI is four options and no verbs
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
openagent Serve the dashboard in the foreground. Ctrl+C closes it; the
|
|
21
|
+
agents it started go on to their own end.
|
|
22
|
+
|
|
23
|
+
--port <n> Dashboard port (default: 4200).
|
|
24
|
+
--host <addr> Bind address (default: 127.0.0.1). A non-loopback address
|
|
25
|
+
exposes the dashboard to your network and generates a shared
|
|
26
|
+
token; the printed URL carries it, and any request without it
|
|
27
|
+
gets 401. Exposing the daemon to the network is a security
|
|
28
|
+
decision.
|
|
29
|
+
-h, --help Show this help.
|
|
30
|
+
-v, --version Print the version.
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Everything else is the dashboard. It is the product's user interface, and where an agent's
|
|
34
|
+
prompt, its coding agent and its model are chosen. There is no option that begins an agent:
|
|
35
|
+
the command cannot start one at all.
|
|
36
|
+
|
|
37
|
+
## How it works
|
|
38
|
+
|
|
39
|
+
OpenAgent runs no coding agent and makes no model call. Starting an agent is running
|
|
40
|
+
**one shell line the project itself names** — its `start` hook, in the project's own
|
|
41
|
+
`.openagent/hooks.yml`:
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
start: agent-runner run --detach "$PROMPT" ${DRIVER:+--driver "$DRIVER"} ${MODEL:+--model "$MODEL"} ${THEN:+--then "$THEN"} ${PUBLISH:+--publish "$PUBLISH"} ${BASE:+--base "$BASE"}
|
|
45
|
+
resume: agent-runner run --detach --resume "$RUN_ID" ${TEXT:+"$TEXT"} ${ANSWER:+--answer "$ANSWER"}
|
|
46
|
+
check: agent-runner check ${DRIVER:+--driver "$DRIVER"}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The line is given the prompt and the user's picks in its environment, and answers one JSON
|
|
50
|
+
document whose `id` names the agent it began. From there the agent belongs to whatever that
|
|
51
|
+
line started. Adding a project writes these three lines into the file, so a new project, an
|
|
52
|
+
empty folder included, starts an agent with nothing typed by hand. They are a default: a line
|
|
53
|
+
already there is kept, and any of them can be changed or deleted. A line finds its tools in the
|
|
54
|
+
project's installed packages first, then in the dashboard's built-in ones, which bring `agent-runner`;
|
|
55
|
+
nothing is downloaded to run a line. A project with no `start` line cannot start an agent from
|
|
56
|
+
the dashboard, and the dashboard says so. `npx agent-scheduler init`, run in the project, writes
|
|
57
|
+
the scheduler's `open` and `close` lines (they start it when the dashboard opens and stop it
|
|
58
|
+
when it closes), keeping any line already there. The file's keys are `open`, `close`, `start`, `resume` and `check`; any other key
|
|
59
|
+
is refused and the whole file ignored.
|
|
60
|
+
|
|
61
|
+
The launcher's **Post-merge cleanup** box, shown where the project has the
|
|
62
|
+
`post-merge-cleanup` command, puts `/post-merge-cleanup` in `THEN`: once the agent ends done
|
|
63
|
+
with a pull request, agent-runner starts a fresh agent on its branch with that command and the
|
|
64
|
+
first agent's id, and holds the pull request's merge until that one is done. Its default is
|
|
65
|
+
Settings → Agent → Post-merge cleanup, which the box writes too.
|
|
66
|
+
|
|
67
|
+
The launcher's chip above the box says which branch the agent starts from: the project's
|
|
68
|
+
main branch, fetched first, or **My local branch**, the branch the project's folder is on,
|
|
69
|
+
with its commits that are not pushed (edits that are not committed are not carried). The
|
|
70
|
+
local pick puts the branch's name in `BASE`, and is saved per project. The chip is shown only
|
|
71
|
+
when the `start` line mentions `$BASE`: a project whose line was written before the chip
|
|
72
|
+
existed gets it by adding `${BASE:+--base "$BASE"}` to the line.
|
|
73
|
+
|
|
74
|
+
The `check` line is what the launcher runs before a Start, with the picked coding agent in
|
|
75
|
+
`DRIVER`: it answers one JSON document with `problems` (a coding agent not installed or logged
|
|
76
|
+
out: said in red) and `warnings` (said in amber), each line naming its own fix. A project
|
|
77
|
+
with no `check` line shows nothing there.
|
|
78
|
+
|
|
79
|
+
A package's own settings are no hook. The scheduler's (how far past the quota boundary it may
|
|
80
|
+
start unattended work, a switch and a publish pick per scheduled command) are the scheduler
|
|
81
|
+
package's own Settings section and Overview card, and the handle on the usage bar is its stop
|
|
82
|
+
line: its part of the dashboard reads them with `agent-scheduler status` and saves them with
|
|
83
|
+
`agent-scheduler offset`, `switch` and `publish`.
|
|
84
|
+
|
|
85
|
+
The dashboard is a **projection of the agent's own files**. The agent's tool keeps the
|
|
86
|
+
agent's card (`<id>.json`) and diary (`<id>.jsonl`) under `.openagent/` in the agent's
|
|
87
|
+
checkout, and copies both onto the project's `agent-data` branch when the agent ends.
|
|
88
|
+
Everything the dashboard shows — live, and months later — it reads from those two files.
|
|
89
|
+
|
|
90
|
+
Steering goes back the same way, never over a channel:
|
|
91
|
+
|
|
92
|
+
- **What you say to a working agent** becomes a line in its `inbox.jsonl`, which the agent's
|
|
93
|
+
tool reads when a turn ends.
|
|
94
|
+
- **What you say to an agent that has ended** — your words, or your answer to the question it
|
|
95
|
+
stopped on — runs the project's `resume` hook, which continues that same agent.
|
|
96
|
+
- **Stop** is a signal to the process the agent's card names.
|
|
97
|
+
|
|
98
|
+
So a working agent and a finished one render identically, and an agent on another machine
|
|
99
|
+
needs only its lines carried home.
|
|
100
|
+
|
|
101
|
+
- **One daemon per machine.** Running the CLI in any registered repo finds it. It serves
|
|
102
|
+
the dashboard, runs each project's hooks, and runs the background work — the notifications
|
|
103
|
+
and the cloud sweeps.
|
|
104
|
+
- **An agent is one task being worked**, in its own checkout on its own branch. You can watch
|
|
105
|
+
it, answer its questions, and say more to it — or not be there at all.
|
|
106
|
+
- **What you can ask for is your project's own commands**: its skills, read from
|
|
107
|
+
`.claude/skills/` and `.agents/skills/`, plus free text and the prompts you save.
|
|
108
|
+
OpenAgent ships no prompt text.
|
|
109
|
+
- **Work leaves as a pull request**, opened by the agent itself. An agent that committed
|
|
110
|
+
nothing publishes nothing.
|
|
111
|
+
|
|
112
|
+
## Layout
|
|
113
|
+
|
|
114
|
+
- `src/` — the CLI, the daemon, the hooks, the reading of a project's agents, and the server
|
|
115
|
+
side of the dashboard. Node only.
|
|
116
|
+
- `dashboard/` — the browser app: a Vite SPA the daemon serves as static files,
|
|
117
|
+
talking back over plain HTTP. See [its README](./dashboard/README.md).
|
|
118
|
+
|
|
119
|
+
A `LOGIC.md` sits beside every source file and directory, describing the business
|
|
120
|
+
logic it implements, in prose written to be read instead of the code.
|
|
121
|
+
[`LOGIC.md`](./LOGIC.md) at the package root is the place to start.
|
|
122
|
+
|
|
123
|
+
## Status
|
|
124
|
+
|
|
125
|
+
Pre-release, published from the `0.x` line. There are no users to keep compatible,
|
|
126
|
+
so the code prefers being clean over being backward-compatible.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An agent's id, derived from the moment it starts. Pure — no node imports — because the sweep
|
|
3
|
+
* that mints ids ahead of a claim (#1748) is reachable from the dashboard's browser bundle.
|
|
4
|
+
*/
|
|
5
|
+
/** Filesystem-safe, lexicographically-sortable agent id from an ISO start time. */
|
|
6
|
+
export declare function agentIdFromStartedAt(startedAt: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* The inverse of {@link agentIdFromStartedAt}, for a caller that has the id but not the meta
|
|
9
|
+
* (#1251): picking which PR is the agent's needs the start time to tell the agent's own PR from a
|
|
10
|
+
* predecessor's on the same branch name. Undefined for an id that is not one of ours.
|
|
11
|
+
*/
|
|
12
|
+
export declare function startedAtFromAgentId(id: string): string | undefined;
|
|
13
|
+
//# sourceMappingURL=agent-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-id.d.ts","sourceRoot":"","sources":["../src/agent-id.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,mFAAmF;AACnF,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAI9D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGnE"}
|
package/dist/agent-id.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An agent's id, derived from the moment it starts. Pure — no node imports — because the sweep
|
|
3
|
+
* that mints ids ahead of a claim (#1748) is reachable from the dashboard's browser bundle.
|
|
4
|
+
*/
|
|
5
|
+
/** Filesystem-safe, lexicographically-sortable agent id from an ISO start time. */
|
|
6
|
+
export function agentIdFromStartedAt(startedAt) {
|
|
7
|
+
// ISO is fixed-width, so replacing the `:`/`.` separators keeps lexical order
|
|
8
|
+
// in step with chronological order — the history list sorts by id alone.
|
|
9
|
+
return startedAt.replace(/[:.]/g, '-');
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The inverse of {@link agentIdFromStartedAt}, for a caller that has the id but not the meta
|
|
13
|
+
* (#1251): picking which PR is the agent's needs the start time to tell the agent's own PR from a
|
|
14
|
+
* predecessor's on the same branch name. Undefined for an id that is not one of ours.
|
|
15
|
+
*/
|
|
16
|
+
export function startedAtFromAgentId(id) {
|
|
17
|
+
const match = /^(\d{4}-\d{2}-\d{2}T\d{2})-(\d{2})-(\d{2})-(\d{3})Z$/.exec(id);
|
|
18
|
+
return match ? `${match[1]}:${match[2]}:${match[3]}.${match[4]}Z` : undefined;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=agent-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-id.js","sourceRoot":"","sources":["../src/agent-id.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,mFAAmF;AACnF,MAAM,UAAU,oBAAoB,CAAC,SAAiB;IACpD,8EAA8E;IAC9E,yEAAyE;IACzE,OAAO,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AACxC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,EAAU;IAC7C,MAAM,KAAK,GAAG,sDAAsD,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC7E,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAA;AAC/E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-locks.d.ts","sourceRoot":"","sources":["../src/agent-locks.ts"],"names":[],"mappings":"AAwBA,2EAA2E;AAC3E,wBAAsB,aAAa,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAgBzF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
/**
|
|
3
|
+
* Serialize the dashboard's own actions against one run's checkout.
|
|
4
|
+
*
|
|
5
|
+
* Two clicks on the same finished run (Open PR, and Remove or Delete of its checkout) each run
|
|
6
|
+
* their own git in that checkout. Unserialized they raced: the loser reported "could not commit
|
|
7
|
+
* the work this session left uncommitted", and a removal that lost kept a worktree it should have
|
|
8
|
+
* taken. Both actions are served inside the daemon's own process (the dashboard's RPCs are), so
|
|
9
|
+
* an in-process lock is the whole fix between them.
|
|
10
|
+
*
|
|
11
|
+
* It does NOT coordinate with the run's own tool (#1774), which is another process and reclaims
|
|
12
|
+
* the checkout itself when the run ends. What keeps those two apart is that the run has to have
|
|
13
|
+
* ended before the dashboard offers either action, and that the tool's own reclaim refuses a
|
|
14
|
+
* checkout it cannot take cleanly.
|
|
15
|
+
*
|
|
16
|
+
* Keyed by the checkout path, resolved, so the actions against one run contend on one key;
|
|
17
|
+
* actions against a run whose checkout is already gone key on the project root, where nothing
|
|
18
|
+
* contends. A waiter chains on the predecessor's *settlement* — a failed removal must not skip
|
|
19
|
+
* the action waiting behind it — and each caller still gets its own outcome (or failure) back
|
|
20
|
+
* untouched.
|
|
21
|
+
*/
|
|
22
|
+
const chains = new Map();
|
|
23
|
+
/** Run `fn` once every earlier holder of `checkout`'s lock has settled. */
|
|
24
|
+
export async function withAgentLock(checkout, fn) {
|
|
25
|
+
const key = resolve(checkout);
|
|
26
|
+
const prev = chains.get(key) ?? Promise.resolve();
|
|
27
|
+
const agent = prev.then(fn, fn);
|
|
28
|
+
// What the next waiter chains on: settlement, never rejection — one failed holder must not
|
|
29
|
+
// poison every later acquisition of the same key.
|
|
30
|
+
const settled = agent.then(() => { }, () => { });
|
|
31
|
+
chains.set(key, settled);
|
|
32
|
+
try {
|
|
33
|
+
return await agent;
|
|
34
|
+
}
|
|
35
|
+
finally {
|
|
36
|
+
if (chains.get(key) === settled)
|
|
37
|
+
chains.delete(key);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=agent-locks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-locks.js","sourceRoot":"","sources":["../src/agent-locks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,GAAG,IAAI,GAAG,EAA4B,CAAA;AAElD,2EAA2E;AAC3E,MAAM,CAAC,KAAK,UAAU,aAAa,CAAI,QAAgB,EAAE,EAAoB;IAC3E,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC7B,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAA;IACjD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;IAC/B,2FAA2F;IAC3F,kDAAkD;IAClD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CACxB,GAAG,EAAE,GAAE,CAAC,EACR,GAAG,EAAE,GAAE,CAAC,CACT,CAAA;IACD,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IACxB,IAAI,CAAC;QACH,OAAO,MAAM,KAAK,CAAA;IACpB,CAAC;YAAS,CAAC;QACT,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,OAAO;YAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IACrD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { OpenAgentEvent } from './events.js';
|
|
2
|
+
/** One error of a run: one the agent reported through an `error` block (#1500), or one its tool wrote in the diary. */
|
|
3
|
+
export interface AgentError {
|
|
4
|
+
/** What is wrong, in one line. */
|
|
5
|
+
headline: string;
|
|
6
|
+
/** What it ran and what that said, when the agent wrote any. */
|
|
7
|
+
detail?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Every error of the run (#1500), oldest first — the count the dashboard shows on the session, and
|
|
11
|
+
* the latest headline it shows beside it. Two sources: the `error` lines the run's tool writes in
|
|
12
|
+
* the diary when the coding agent or its transport fails (the message's first line is the
|
|
13
|
+
* headline, the rest the detail), and the `error` blocks of runs recorded before the daemon
|
|
14
|
+
* stopped running agents.
|
|
15
|
+
*
|
|
16
|
+
* A fold over the log rather than state of its own: an error is an event that happened, so the
|
|
17
|
+
* list only ever grows, and reopening a finished agent shows exactly what it showed while it ran.
|
|
18
|
+
*/
|
|
19
|
+
export declare function agentErrors(events: readonly OpenAgentEvent[]): AgentError[];
|
|
20
|
+
/** The wrapped agent session (#431): its id and a deep link, when one is known. */
|
|
21
|
+
export interface SessionInfo {
|
|
22
|
+
sessionId?: string;
|
|
23
|
+
sessionLink?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The directory the agent ran in (#1195), from the opening `session` event.
|
|
26
|
+
*
|
|
27
|
+
* Taken from the event rather than the filesystem on purpose: an agent that finishes cleanly has
|
|
28
|
+
* its worktree removed (`tearDownWorktree`), so the event is the only surviving record of where
|
|
29
|
+
* the session lived — and that path is exactly what `claude --resume` needs to find it again.
|
|
30
|
+
*/
|
|
31
|
+
workspace?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The session behind the agent (#431): the workspace from the opening `session`
|
|
35
|
+
* event, then the id and any deep link from the latest `session-update`. Null before the
|
|
36
|
+
* session opens. The link is what the old dashboard surfaced as "open session".
|
|
37
|
+
*/
|
|
38
|
+
export declare function sessionInfo(events: readonly OpenAgentEvent[]): SessionInfo | null;
|
|
39
|
+
//# sourceMappingURL=agent-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-view.d.ts","sourceRoot":"","sources":["../src/agent-view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAOjD,uHAAuH;AACvH,MAAM,WAAW,UAAU;IACzB,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,GAAG,UAAU,EAAE,CAY3E;AAED,mFAAmF;AACnF,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,GAAG,WAAW,GAAG,IAAI,CAajF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every error of the run (#1500), oldest first — the count the dashboard shows on the session, and
|
|
3
|
+
* the latest headline it shows beside it. Two sources: the `error` lines the run's tool writes in
|
|
4
|
+
* the diary when the coding agent or its transport fails (the message's first line is the
|
|
5
|
+
* headline, the rest the detail), and the `error` blocks of runs recorded before the daemon
|
|
6
|
+
* stopped running agents.
|
|
7
|
+
*
|
|
8
|
+
* A fold over the log rather than state of its own: an error is an event that happened, so the
|
|
9
|
+
* list only ever grows, and reopening a finished agent shows exactly what it showed while it ran.
|
|
10
|
+
*/
|
|
11
|
+
export function agentErrors(events) {
|
|
12
|
+
const errors = [];
|
|
13
|
+
for (const event of events) {
|
|
14
|
+
if (event.kind === 'error') {
|
|
15
|
+
errors.push({ headline: event.headline, ...(event.detail ? { detail: event.detail } : {}) });
|
|
16
|
+
}
|
|
17
|
+
else if (event.kind === 'driver' && event.event.type === 'error' && typeof event.event.message === 'string') {
|
|
18
|
+
const [headline = '', ...rest] = event.event.message.trim().split('\n');
|
|
19
|
+
const detail = rest.join('\n').trim();
|
|
20
|
+
errors.push({ headline: headline || 'error', ...(detail ? { detail } : {}) });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return errors;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The session behind the agent (#431): the workspace from the opening `session`
|
|
27
|
+
* event, then the id and any deep link from the latest `session-update`. Null before the
|
|
28
|
+
* session opens. The link is what the old dashboard surfaced as "open session".
|
|
29
|
+
*/
|
|
30
|
+
export function sessionInfo(events) {
|
|
31
|
+
let info = null;
|
|
32
|
+
for (const event of events) {
|
|
33
|
+
if (event.kind === 'session') {
|
|
34
|
+
info = {
|
|
35
|
+
workspace: event.workspace,
|
|
36
|
+
...(event.sessionLink ? { sessionLink: event.sessionLink } : {}),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
else if (event.kind === 'session-update') {
|
|
40
|
+
info = { ...(info ?? {}), sessionId: event.sessionId, ...(event.sessionLink ? { sessionLink: event.sessionLink } : {}) };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return info;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=agent-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-view.js","sourceRoot":"","sources":["../src/agent-view.ts"],"names":[],"mappings":"AAeA;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,MAAiC;IAC3D,MAAM,MAAM,GAAiB,EAAE,CAAA;IAC/B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC3B,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA;QAC9F,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC9G,MAAM,CAAC,QAAQ,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACvE,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAA;YACrC,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,QAAQ,IAAI,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA;QAC/E,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAgBD;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,MAAiC;IAC3D,IAAI,IAAI,GAAuB,IAAI,CAAA;IACnC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC7B,IAAI,GAAG;gBACL,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACjE,CAAA;QACH,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;YAC3C,IAAI,GAAG,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;QAC1H,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":""}
|
package/dist/bin.js
ADDED
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KAC1B,IAAI,CAAC,IAAI,CAAC,EAAE;IACX,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAA;AACzB,CAAC,CAAC;KACD,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IACtB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAClB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;AACtB,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether `value` names a branch the way git lets a branch be named (`git check-ref-format
|
|
3
|
+
* --branch`), told without running git. The branch a Start names to start from ends up on a
|
|
4
|
+
* command line, so a word that could be read there as an option (a leading `-`), or that git would
|
|
5
|
+
* read as something other than one branch (`a..b`, `x@{1}`, `HEAD`), is not a name.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isBranchName(value: unknown): value is string;
|
|
8
|
+
//# sourceMappingURL=branch-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-name.d.ts","sourceRoot":"","sources":["../src/branch-name.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAQ5D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether `value` names a branch the way git lets a branch be named (`git check-ref-format
|
|
3
|
+
* --branch`), told without running git. The branch a Start names to start from ends up on a
|
|
4
|
+
* command line, so a word that could be read there as an option (a leading `-`), or that git would
|
|
5
|
+
* read as something other than one branch (`a..b`, `x@{1}`, `HEAD`), is not a name.
|
|
6
|
+
*/
|
|
7
|
+
export function isBranchName(value) {
|
|
8
|
+
if (typeof value !== 'string' || value === '' || value.length > 255)
|
|
9
|
+
return false;
|
|
10
|
+
if (value === 'HEAD' || value === '@' || value.startsWith('-'))
|
|
11
|
+
return false;
|
|
12
|
+
// What git refuses anywhere in a ref: a space, a control character, and the characters its
|
|
13
|
+
// revision syntax uses.
|
|
14
|
+
if (/[\x00-\x20\x7f~^:?*[\\]/.test(value) || value.includes('..') || value.includes('@{'))
|
|
15
|
+
return false;
|
|
16
|
+
if (value.endsWith('.'))
|
|
17
|
+
return false;
|
|
18
|
+
return value.split('/').every(part => part !== '' && !part.startsWith('.') && !part.endsWith('.lock'));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=branch-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-name.js","sourceRoot":"","sources":["../src/branch-name.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,CAAC,MAAM,GAAG,GAAG;QAAE,OAAO,KAAK,CAAA;IACjF,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA;IAC5E,2FAA2F;IAC3F,wBAAwB;IACxB,IAAI,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAA;IACvG,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA;IACrC,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;AACxG,CAAC"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bridge browser (#1332): a Chrome for Testing the daemon launches and owns, with the Claude
|
|
3
|
+
* web bridge extension installed, signed in to claude.ai once by the user and kept minimized.
|
|
4
|
+
*
|
|
5
|
+
* The bridge's far end is a browser signed in to claude.ai. Until now that was the user's own
|
|
6
|
+
* Chrome with the extension loaded, so a web run could only start — and a parked question could
|
|
7
|
+
* only be noticed — while that Chrome happened to be open. The spike on #1332 settled what a
|
|
8
|
+
* browser nobody attends has to be: headed, because claude.ai's Cloudflare gate never clears a
|
|
9
|
+
* headless one; Chrome for Testing, because branded Chrome stopped loading unpacked extensions
|
|
10
|
+
* from the command line; and installed over CDP with developer mode on, because an extension
|
|
11
|
+
* loaded any other way is disabled the first time it reloads itself (#1712).
|
|
12
|
+
*
|
|
13
|
+
* Nothing here talks to claude.ai. The daemon launches the browser, hands the extension the
|
|
14
|
+
* bridge token, and from then on the extension's Driver tab does exactly what it does in the
|
|
15
|
+
* user's own Chrome — the daemon only keeps the window out of the way and brings it up when the
|
|
16
|
+
* user has to sign in.
|
|
17
|
+
*/
|
|
18
|
+
/** The directory holding the bridge browser's profile and binary, next to the registry file. */
|
|
19
|
+
export declare const BRIDGE_BROWSER_DIR = "openagent-browser";
|
|
20
|
+
/**
|
|
21
|
+
* Where the bridge browser lives: `$XDG_CONFIG_HOME/openagent-browser` when set, else the
|
|
22
|
+
* dotted `$HOME/.openagent-browser`. Beside the registry, so the same variable that isolates
|
|
23
|
+
* a test's registry isolates its browser, and a machine's real one is never touched from a test.
|
|
24
|
+
* The profile inside it is persistent on purpose: the user signs in once and the sign-in outlives
|
|
25
|
+
* every daemon restart.
|
|
26
|
+
*/
|
|
27
|
+
export declare function bridgeBrowserDir(env: NodeJS.ProcessEnv): string;
|
|
28
|
+
/**
|
|
29
|
+
* The launch flags. Headed (no `--headless`): claude.ai's bot gate rejects a headless browser
|
|
30
|
+
* outright, and a headed one whose window is minimized passes. The unsafe-extension-debugging
|
|
31
|
+
* flag is what lets `Extensions.loadUnpacked` install the extension over CDP. The keychain flags
|
|
32
|
+
* keep the cookie-encryption key out of the OS keychain (macOS asks for the login password on
|
|
33
|
+
* every launch otherwise, and Linux for the wallet) — the same choice Puppeteer makes; the profile
|
|
34
|
+
* directory's own permissions are what guard the sign-in.
|
|
35
|
+
*/
|
|
36
|
+
export declare function bridgeBrowserLaunchArgs(port: number, profileDir: string): string[];
|
|
37
|
+
/** Where the extension's files are, and whether that is a checkout, where they are edited in place. */
|
|
38
|
+
export interface BridgeExtensionSource {
|
|
39
|
+
dir: string;
|
|
40
|
+
checkout: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The extension's files (#1720): the checkout's `packages/chrome-extension` next to this package,
|
|
44
|
+
* so an edit there reaches the browser through the extension's self-reload; else the copy the
|
|
45
|
+
* build puts in `dist/chrome-extension`, which is what an installed package has. A folder counts
|
|
46
|
+
* only when its manifest names the bridge extension. Undefined when neither is there.
|
|
47
|
+
* `moduleUrl` is this file's URL; tests point it elsewhere.
|
|
48
|
+
*/
|
|
49
|
+
export declare function bridgeExtensionSource(moduleUrl?: string): BridgeExtensionSource | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* The process holding a profile's singleton lock, or undefined when nothing does. Chrome leaves
|
|
52
|
+
* the lock behind as a symlink whose target is `<host>-<pid>`; a daemon that died without closing
|
|
53
|
+
* its browser leaves that browser running, and a second Chrome on the same profile would hand its
|
|
54
|
+
* command line to the first and exit at once.
|
|
55
|
+
*/
|
|
56
|
+
export declare function profileLockOwner(profileDir: string, readLink?: (path: string) => Promise<string>): Promise<number | undefined>;
|
|
57
|
+
/** One page, worker or browser-internal target Chrome lists. */
|
|
58
|
+
export interface CdpTarget {
|
|
59
|
+
id: string;
|
|
60
|
+
type: string;
|
|
61
|
+
url: string;
|
|
62
|
+
webSocketDebuggerUrl?: string;
|
|
63
|
+
}
|
|
64
|
+
/** A session on one target: the calls go to that page or worker rather than to the browser. */
|
|
65
|
+
export interface CdpTargetSession {
|
|
66
|
+
send(method: string, params?: Record<string, unknown>): Promise<unknown>;
|
|
67
|
+
close(): void;
|
|
68
|
+
}
|
|
69
|
+
/** How the daemon talks to its browser. Injectable: the real one speaks WebSocket to Chrome. */
|
|
70
|
+
export interface BridgeBrowserCdp {
|
|
71
|
+
/** A browser-level call: installing the extension, opening and closing targets, window bounds. */
|
|
72
|
+
call(method: string, params?: Record<string, unknown>): Promise<unknown>;
|
|
73
|
+
/** Every target Chrome lists — pages, the extension's worker, browser-internal pages. */
|
|
74
|
+
targets(): Promise<CdpTarget[]>;
|
|
75
|
+
/** Attach to one target. */
|
|
76
|
+
attach(target: CdpTarget): Promise<CdpTargetSession>;
|
|
77
|
+
/** Drop the browser-level connection. The browser keeps running. */
|
|
78
|
+
close(): void;
|
|
79
|
+
}
|
|
80
|
+
/** The real connection: the browser socket from `/json/version`, targets from `/json/list`. */
|
|
81
|
+
export declare function connectBridgeBrowser(browserUrl: string): Promise<BridgeBrowserCdp>;
|
|
82
|
+
/** Install the extension from its directory. Chrome answers with the extension's id. */
|
|
83
|
+
export declare function installExtension(cdp: BridgeBrowserCdp, extensionDir: string): Promise<string>;
|
|
84
|
+
/**
|
|
85
|
+
* The developer-mode switch on Chrome's extensions page, flipped on if it is off. Chrome (137
|
|
86
|
+
* and later) disables an unpacked extension on reload while the mode is off, and the extension
|
|
87
|
+
* reloads itself whenever its files change (#1712), so without this the bridge would die on the
|
|
88
|
+
* first edit or pull. The profile remembers the setting, but writing the preference into the
|
|
89
|
+
* profile directly does nothing — the switch is the one way that works.
|
|
90
|
+
*/
|
|
91
|
+
export declare const DEVELOPER_MODE_ON = "(() => {\n const manager = document.querySelector('extensions-manager')?.shadowRoot\n const toggle = manager?.querySelector('extensions-toolbar')?.shadowRoot?.querySelector('#devMode')\n if (!toggle) return 'missing'\n if (!toggle.checked) toggle.click()\n return 'on'\n})()";
|
|
92
|
+
/** Open Chrome's extensions page in the background, switch developer mode on, close the page. */
|
|
93
|
+
export declare function enableDeveloperMode(cdp: BridgeBrowserCdp, sleep: (ms: number) => Promise<void>): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* What the extension is told, run inside its own worker: the daemon's address and the bridge
|
|
96
|
+
* token go into the storage its options page would have written, and the Driver tab is opened
|
|
97
|
+
* as the one pinned claude.ai/code tab — the shape the extension adopts as its Driver — in place
|
|
98
|
+
* of the blank page the browser started on. Opened here rather than left to the extension
|
|
99
|
+
* because the extension opens no Driver tab while the daemon lists no cloud session, and the user
|
|
100
|
+
* signs in on that tab before any session exists.
|
|
101
|
+
*/
|
|
102
|
+
export declare function seedExpression(daemonUrl: string, token: string): string;
|
|
103
|
+
/** Hand the freshly installed extension its daemon and token, in its service worker. */
|
|
104
|
+
export declare function seedExtension(cdp: BridgeBrowserCdp, extensionId: string, daemonUrl: string, token: string, sleep: (ms: number) => Promise<void>): Promise<void>;
|
|
105
|
+
/** The bridge browser once it runs. */
|
|
106
|
+
export interface BridgeBrowser {
|
|
107
|
+
extensionId: string;
|
|
108
|
+
/** The path the claude.ai tab is on (`/login` while signed out), or undefined without such a tab. */
|
|
109
|
+
page(): Promise<string | undefined>;
|
|
110
|
+
/** Restore the window and bring the browser to the front, for the user to sign in. */
|
|
111
|
+
show(): Promise<void>;
|
|
112
|
+
/** Minimize the window again. */
|
|
113
|
+
hide(): Promise<void>;
|
|
114
|
+
/** Called once if Chrome exits on its own — the user quit it, or it crashed. */
|
|
115
|
+
onExit(listener: (detail: string) => void): void;
|
|
116
|
+
/** Close the browser. Safe to call twice. */
|
|
117
|
+
close(): Promise<void>;
|
|
118
|
+
}
|
|
119
|
+
/** The Chrome process, as much of it as this module needs. */
|
|
120
|
+
export interface BridgeBrowserProcess {
|
|
121
|
+
pid?: number | undefined;
|
|
122
|
+
kill(signal?: NodeJS.Signals): unknown;
|
|
123
|
+
on(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): unknown;
|
|
124
|
+
on(event: 'error', listener: (err: Error) => void): unknown;
|
|
125
|
+
}
|
|
126
|
+
/** Everything the launch touches outside its own logic. Injectable so the sequence is testable without a Chrome. */
|
|
127
|
+
export interface BridgeBrowserDeps {
|
|
128
|
+
/** The Chrome for Testing binary, downloaded into `cacheDir` if none is there yet. */
|
|
129
|
+
binary(cacheDir: string, report: (detail: string) => void): Promise<string>;
|
|
130
|
+
/** The process holding the profile's lock, if any. */
|
|
131
|
+
lockOwner(profileDir: string): Promise<number | undefined>;
|
|
132
|
+
alive(pid: number): boolean;
|
|
133
|
+
kill(pid: number, signal: NodeJS.Signals): void;
|
|
134
|
+
port(): Promise<number>;
|
|
135
|
+
spawn(binary: string, args: string[]): BridgeBrowserProcess;
|
|
136
|
+
ready(browserUrl: string): Promise<boolean>;
|
|
137
|
+
connect(browserUrl: string): Promise<BridgeBrowserCdp>;
|
|
138
|
+
/** Bring the browser application to the front (macOS: activate the app bundle). */
|
|
139
|
+
activate(binary: string): void;
|
|
140
|
+
sleep(ms: number): Promise<void>;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* The Chrome for Testing binary in `cacheDir`, or the current stable one downloaded there (about
|
|
144
|
+
* 150 MB, once). Chrome for Testing rather than whatever Chrome the machine has: branded Chrome
|
|
145
|
+
* ignores an unpacked extension handed to it from outside, and the agent's own browser lookup
|
|
146
|
+
* would find exactly that.
|
|
147
|
+
*/
|
|
148
|
+
export declare function bridgeBrowserBinary(cacheDir: string, report: (detail: string) => void): Promise<string>;
|
|
149
|
+
/** macOS: the `.app` bundle the binary lives in, which `open` activates. Undefined elsewhere. */
|
|
150
|
+
export declare function appBundle(binary: string): string | undefined;
|
|
151
|
+
/** The real dependencies. */
|
|
152
|
+
export declare function bridgeBrowserDeps(): BridgeBrowserDeps;
|
|
153
|
+
/**
|
|
154
|
+
* Make sure nothing else holds the profile: a browser a dead daemon left behind is stopped,
|
|
155
|
+
* gently first. It is OpenAgent's own profile, so whatever holds it is OpenAgent's own
|
|
156
|
+
* leftover; nothing the user runs shares it.
|
|
157
|
+
*/
|
|
158
|
+
export declare function freeProfile(profileDir: string, deps: BridgeBrowserDeps): Promise<boolean>;
|
|
159
|
+
/** What a launch needs to know. */
|
|
160
|
+
export interface BridgeBrowserOptions {
|
|
161
|
+
/** Where the daemon listens — what the extension is told to call. */
|
|
162
|
+
daemonUrl: string;
|
|
163
|
+
/** The bridge token the extension presents on every call. */
|
|
164
|
+
token: string;
|
|
165
|
+
/** The bridge browser's directory: the profile and the binary live under it. */
|
|
166
|
+
dir: string;
|
|
167
|
+
/** The extension's files. Default: `bridgeExtensionSource()`. */
|
|
168
|
+
extension?: BridgeExtensionSource | undefined;
|
|
169
|
+
/** Progress, one line at a time, for the dashboard to show while the launch runs. */
|
|
170
|
+
report?: ((detail: string) => void) | undefined;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Launch the bridge browser and get it ready: binary, profile, extension, developer mode, token,
|
|
174
|
+
* Driver tab, minimized. Throws with the step that failed; the browser is closed again on a
|
|
175
|
+
* failure after the spawn, so a half-set-up browser is never left running.
|
|
176
|
+
*/
|
|
177
|
+
export declare function startBridgeBrowser(opts: BridgeBrowserOptions, deps?: BridgeBrowserDeps): Promise<BridgeBrowser>;
|
|
178
|
+
/** Where the bridge browser stands, for the dashboard. */
|
|
179
|
+
export type BridgeBrowserStatus = {
|
|
180
|
+
state: 'off';
|
|
181
|
+
} | {
|
|
182
|
+
state: 'starting';
|
|
183
|
+
detail: string;
|
|
184
|
+
}
|
|
185
|
+
/** `signIn`: the claude.ai tab is on the sign-in page, so a person has to sign in before anything is served. */
|
|
186
|
+
| {
|
|
187
|
+
state: 'running';
|
|
188
|
+
since: string;
|
|
189
|
+
visible: boolean;
|
|
190
|
+
signIn: boolean;
|
|
191
|
+
} | {
|
|
192
|
+
state: 'stopped';
|
|
193
|
+
detail: string;
|
|
194
|
+
};
|
|
195
|
+
/** What the dashboard can ask of the bridge browser. */
|
|
196
|
+
export type BridgeBrowserAction = 'show' | 'hide' | 'restart';
|
|
197
|
+
/** The daemon's handle on its bridge browser: one at a time, started and stopped from the preference and the dashboard. */
|
|
198
|
+
export interface BridgeBrowserOwner {
|
|
199
|
+
/** Where the browser stands; a running one is asked which page its claude.ai tab is on. */
|
|
200
|
+
status(): Promise<BridgeBrowserStatus>;
|
|
201
|
+
/** Launch it, unless it is running or on its way. Resolves once the launch is over, either way. */
|
|
202
|
+
start(): Promise<void>;
|
|
203
|
+
/** Close it, or cancel a launch under way. */
|
|
204
|
+
stop(): Promise<void>;
|
|
205
|
+
act(action: BridgeBrowserAction): Promise<void>;
|
|
206
|
+
}
|
|
207
|
+
/** How the owner launches a browser: the daemon's real launch, or a test's fake. */
|
|
208
|
+
export type BridgeBrowserLauncher = (report: (detail: string) => void) => Promise<BridgeBrowser>;
|
|
209
|
+
/**
|
|
210
|
+
* The one bridge browser a daemon runs. A launch is slow — the first one downloads Chrome — so
|
|
211
|
+
* the status carries the step it is on, and a stop that lands mid-launch closes the browser the
|
|
212
|
+
* launch then hands over rather than leaving it running unowned. A browser that exits on its own
|
|
213
|
+
* (the user quit it) is reported as stopped with the reason, and not relaunched: quitting it was
|
|
214
|
+
* an act, and the dashboard offers a restart.
|
|
215
|
+
*/
|
|
216
|
+
export declare function bridgeBrowserOwner(launch: BridgeBrowserLauncher, log?: (line: string) => void): BridgeBrowserOwner;
|
|
217
|
+
//# sourceMappingURL=bridge-browser.d.ts.map
|