@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
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { sayToRun } from '../dashboard/run-inbox.js';
|
|
2
|
+
import { bridgeQuestions } from '../dashboard/bridge-store.js';
|
|
3
|
+
import { openInApp } from '../dashboard/open-in-app.js';
|
|
4
|
+
import { contextBridgeBrowser, contextPreferences, contextStartAgent, resolveProjectPath, resolveAgentPath } from './context.js';
|
|
5
|
+
import { relayOr } from './relay-agent.js';
|
|
6
|
+
import { hostname } from 'node:os';
|
|
7
|
+
import { findAgent, isPidAlive, isRunId, loadAgentEvents, projectRuns, readLiveMetas } from '../store/index.js';
|
|
8
|
+
import { withAgentLock } from '../agent-locks.js';
|
|
9
|
+
import { removeProjectWorktree, deleteProjectAgent } from '../worktrees.js';
|
|
10
|
+
import { mergeAgentPr, openAgentPullRequest, mergeAgentBranch, pushAgentBranch } from '../dashboard/agent-handoff.js';
|
|
11
|
+
import { pendingChoices } from '../open-choices.js';
|
|
12
|
+
import { createRepository } from '../store/repository.js';
|
|
13
|
+
import { providedDataChanged } from '../store/provided.js';
|
|
14
|
+
/**
|
|
15
|
+
* The key every action on one run locks under (`agent-locks.ts`): a Remove, a Delete and an Open
|
|
16
|
+
* PR on the same run each run their own git; serialized, whichever runs second finds the state
|
|
17
|
+
* the first one left and acts on that. The project and the run's id, not the checkout's path:
|
|
18
|
+
* the path is the branches provider's to know, and an Open PR on a run whose checkout is gone
|
|
19
|
+
* still locks the run.
|
|
20
|
+
*/
|
|
21
|
+
export function agentLockKey(cwd, agentId) {
|
|
22
|
+
return `${cwd}\0${agentId}`;
|
|
23
|
+
}
|
|
24
|
+
// The write side behind the dashboard (#405, #1774). The daemon runs no agent, so every write here
|
|
25
|
+
// reaches a run through what the run's tool reads: Start is the project's `start` hook line; what
|
|
26
|
+
// a person says to a run (their words, their answer to its question) is a line in the run's inbox
|
|
27
|
+
// file while the run works, and the project's `resume` hook line once it has ended; Stop is a
|
|
28
|
+
// signal to the pid the run's card names. OpenAgent names no tool in any of them.
|
|
29
|
+
/**
|
|
30
|
+
* Stop a live agent (the Stop button): SIGINT to the process the run's own card names, when it is
|
|
31
|
+
* this machine's and alive. The card is the file the dashboard shows the run from, and its pid is
|
|
32
|
+
* whoever runs the agent; OpenAgent names no tool. Nothing else: a run without a live pid
|
|
33
|
+
* here has nothing to stop.
|
|
34
|
+
*/
|
|
35
|
+
export async function sendStop(projectId, agentId) {
|
|
36
|
+
return relayOr(agentId, 'sendStop', [projectId, agentId], async () => {
|
|
37
|
+
const cwd = await resolveProjectPath(projectId);
|
|
38
|
+
if (!cwd || !agentId)
|
|
39
|
+
return;
|
|
40
|
+
const meta = (await readLiveMetas(cwd).catch(() => [])).find(agent => agent.id === agentId);
|
|
41
|
+
if (!meta || meta.status !== 'running' || meta.pid === undefined || meta.host !== hostname() || !isPidAlive(meta.pid))
|
|
42
|
+
return;
|
|
43
|
+
try {
|
|
44
|
+
process.kill(meta.pid, 'SIGINT');
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
// Gone between the probe and the signal.
|
|
48
|
+
}
|
|
49
|
+
}, undefined);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Answer the question a run stopped on (#304, #1774). `pick` is one option id, or the chosen
|
|
53
|
+
* subset of a multi-select; the answer handed to the run is the chosen labels, read off the
|
|
54
|
+
* question as the run's own diary holds it, so only what the agent offered can be answered.
|
|
55
|
+
*/
|
|
56
|
+
export async function sendChoice(projectId, id, pick, agentId) {
|
|
57
|
+
return relayOr(agentId, 'sendChoice', [projectId, id, pick, agentId], async () => {
|
|
58
|
+
const cwd = await resolveProjectPath(projectId);
|
|
59
|
+
if (!cwd || !agentId || !isRunId(agentId))
|
|
60
|
+
return { ok: false, error: 'unknown session' };
|
|
61
|
+
const question = pendingChoices((await loadAgentEvents(cwd, agentId).catch(() => undefined)) ?? []).find(choice => choice.id === id);
|
|
62
|
+
if (!question)
|
|
63
|
+
return { ok: false, error: 'that question is no longer open' };
|
|
64
|
+
const picked = [pick].flat();
|
|
65
|
+
const labels = question.options.filter(option => picked.includes(option.id)).map(option => option.label);
|
|
66
|
+
if (labels.length !== picked.length)
|
|
67
|
+
return { ok: false, error: 'every pick must be one of the question\'s options' };
|
|
68
|
+
if (!question.multi && labels.length !== 1)
|
|
69
|
+
return { ok: false, error: 'pick exactly one option' };
|
|
70
|
+
return sayToRun(cwd, agentId, { kind: 'answer', question: question.title, answer: labels.length ? labels.join(', ') : '(none)' });
|
|
71
|
+
}, { ok: false, error: 'could not reach the device' });
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Queue the user's pick for the question a Claude web session is parked on (#1237).
|
|
75
|
+
*
|
|
76
|
+
* Not a line for a run like {@link sendChoice}: a cloud agent has no run here to hand it to, so
|
|
77
|
+
* the pick goes to the bridge store, where the browser extension collects it, types
|
|
78
|
+
* it into the session's composer and submits. Only labels of the currently parked question are
|
|
79
|
+
* accepted — one, or a multi-select's subset — and the daemon composes the text typed from them,
|
|
80
|
+
* so this can never put arbitrary text in front of another product's agent. Local only, no
|
|
81
|
+
* relay: the bridge lives on the daemon the extension talks to.
|
|
82
|
+
*/
|
|
83
|
+
export async function sendBridgeAnswer(sessionId, labels) {
|
|
84
|
+
if (typeof sessionId !== 'string' || !/^session_[A-Za-z0-9]{1,128}$/.test(sessionId))
|
|
85
|
+
return { ok: false, error: 'unknown session' };
|
|
86
|
+
if (!Array.isArray(labels) || !labels.every(label => typeof label === 'string' && label.trim()))
|
|
87
|
+
return { ok: false, error: 'answer labels are required' };
|
|
88
|
+
const queued = bridgeQuestions().queueAnswer(sessionId, labels);
|
|
89
|
+
return typeof queued === 'string' ? { ok: false, error: queued } : { ok: true };
|
|
90
|
+
}
|
|
91
|
+
/** Withdraw a queued bridge answer (#1237). A no-op once the extension has delivered it. */
|
|
92
|
+
export async function sendBridgeAnswerCancel(sessionId) {
|
|
93
|
+
if (typeof sessionId !== 'string' || !/^session_[A-Za-z0-9]{1,128}$/.test(sessionId))
|
|
94
|
+
return;
|
|
95
|
+
bridgeQuestions().cancelAnswer(sessionId);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Say something to a run (#714, #1774): the person's own words, the next prompt of the same
|
|
99
|
+
* conversation. A run that is working takes them when its turn ends; an ended run is resumed
|
|
100
|
+
* with them. Empty messages are dropped.
|
|
101
|
+
*/
|
|
102
|
+
export async function sendMessage(projectId, text, agentId) {
|
|
103
|
+
const message = text.trim();
|
|
104
|
+
if (!message)
|
|
105
|
+
return { ok: true };
|
|
106
|
+
return relayOr(agentId, 'sendMessage', [projectId, text, agentId], async () => {
|
|
107
|
+
const cwd = await resolveProjectPath(projectId);
|
|
108
|
+
if (!cwd || !agentId || !isRunId(agentId))
|
|
109
|
+
return { ok: false, error: 'unknown session' };
|
|
110
|
+
return sayToRun(cwd, agentId, { kind: 'message', text: message });
|
|
111
|
+
}, { ok: false, error: 'could not reach the device' });
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Remove a retained worktree (#737). An agent that failed or was stopped keeps its checkout so you
|
|
115
|
+
* can inspect it; this is the explicit cleanup for one, since nothing removes them on a timer.
|
|
116
|
+
*
|
|
117
|
+
* The checks and the removal are {@link removeProjectWorktree}'s, shared with the CLI's removal
|
|
118
|
+
* path (#982) so the surfaces cannot drift again; this adds only the agent lock around them.
|
|
119
|
+
*/
|
|
120
|
+
export async function sendRemoveWorktree(projectId, agentId) {
|
|
121
|
+
return withWorktreeRemoval(projectId, agentId, cwd => removeProjectWorktree(cwd, agentId));
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Shared body of the two worktree-removing writes (#982/#1032): resolve the project and refuse
|
|
125
|
+
* when it has no local path. Only the removal action and its result shape differ.
|
|
126
|
+
*/
|
|
127
|
+
async function withWorktreeRemoval(projectId, agentId, remove) {
|
|
128
|
+
const cwd = await resolveProjectPath(projectId);
|
|
129
|
+
if (!cwd)
|
|
130
|
+
return { ok: false, error: 'this project has no local path on this server' };
|
|
131
|
+
// Under the agent lock: a Remove/Delete and an Open PR on the same finished run each run their
|
|
132
|
+
// own git in its checkout; serialized, whichever runs second finds the state the first one left
|
|
133
|
+
// and acts on that.
|
|
134
|
+
return withAgentLock(agentLockKey(cwd, agentId), () => remove(cwd));
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Delete a session (#1032): remove it from the dashboard, records and all — the sibling of
|
|
138
|
+
* {@link sendRemoveWorktree}, and the one destructive-of-history action, so its surface confirms
|
|
139
|
+
* first. The checks, the worktree removal and what it leaves behind (the branch and its
|
|
140
|
+
* commits) are all {@link deleteProjectAgent}'s; this adds only the agent lock around them.
|
|
141
|
+
*/
|
|
142
|
+
export async function sendDeleteAgent(projectId, agentId) {
|
|
143
|
+
return withWorktreeRemoval(projectId, agentId, cwd => deleteProjectAgent(cwd, agentId));
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Start a run in the project (#405, #1774): the project's own `start` hook line, reached through
|
|
147
|
+
* the daemon's wired `startAgent` (which relays to a connected device when the options name
|
|
148
|
+
* one). Answers the id of the run the hook began, or why there is none: a project without the
|
|
149
|
+
* line cannot start a run from here.
|
|
150
|
+
*/
|
|
151
|
+
export async function sendStart(projectId, prompt, options = {}) {
|
|
152
|
+
// Throws on an unwired context (D3): there is one host and it wires everything, so "not
|
|
153
|
+
// enabled on this server" stopped being a state a request can find.
|
|
154
|
+
const startAgent = contextStartAgent();
|
|
155
|
+
const text = prompt.trim();
|
|
156
|
+
if (!text)
|
|
157
|
+
return { ok: false, error: 'a non-empty prompt is required' };
|
|
158
|
+
return startAgent(text, options, projectId);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Open a project in the OS file manager or an editor (#490). Localhost-only: the daemon
|
|
162
|
+
* spawns a local command against the project's own registered path. A public host has no
|
|
163
|
+
* local path to resolve, so it returns an error rather than spawning anything.
|
|
164
|
+
*
|
|
165
|
+
* With a `agentId` it opens that session's own checkout instead (#798) — the whole point of
|
|
166
|
+
* opening it is to look at what the agent is doing, which is not in the project's tree.
|
|
167
|
+
*/
|
|
168
|
+
export async function sendOpenInApp(projectId, target, agentId) {
|
|
169
|
+
const cwd = agentId ? await resolveAgentPath(projectId, agentId) : await resolveProjectPath(projectId);
|
|
170
|
+
if (!cwd)
|
|
171
|
+
return { ok: false, error: 'this project has no local path on this server' };
|
|
172
|
+
// #727: honour the stored editor preference; absent falls back to $OPENAGENT_EDITOR, then `code`.
|
|
173
|
+
const editor = target === 'editor' ? (await contextPreferences()?.read().catch(() => ({})))?.editor : undefined;
|
|
174
|
+
return openInApp(cwd, target, undefined, editor);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The session's own branch, or undefined when the run/project is unknown. Shared by the two
|
|
178
|
+
* handoff actions so they address exactly what {@link onAgentHandoff} reports on.
|
|
179
|
+
*/
|
|
180
|
+
async function handoffTargetFor(projectId, agentId) {
|
|
181
|
+
const cwd = await resolveProjectPath(projectId);
|
|
182
|
+
if (!cwd || !isRunId(agentId))
|
|
183
|
+
return undefined;
|
|
184
|
+
const agent = await findAgent(cwd, agentId).catch(() => undefined);
|
|
185
|
+
// The branch is read from the project repo; the tree the agent edited is its own checkout (#453),
|
|
186
|
+
// and for a session that has not committed, that is the only place its work exists.
|
|
187
|
+
const checkout = (await resolveAgentPath(projectId, agentId)) ?? cwd;
|
|
188
|
+
return agent ? { cwd, agent, checkout } : undefined;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Open a PR for a finished session's branch (#799): the project's branches provider pushes it
|
|
192
|
+
* first if the remote lacks it (#1774).
|
|
193
|
+
*
|
|
194
|
+
* The title and body come from what the agent already recorded: the branch the agent named its
|
|
195
|
+
* work with and the intent the user asked for. Nothing new is invented and nothing extra is asked
|
|
196
|
+
* of the user, which is the point of "offer the next step rather than describe it".
|
|
197
|
+
*/
|
|
198
|
+
export async function sendOpenPullRequest(projectId, agentId, options = {}) {
|
|
199
|
+
return relayOr(agentId, 'sendOpenPullRequest', [projectId, agentId, options], async () => {
|
|
200
|
+
const target = await handoffTargetFor(projectId, agentId);
|
|
201
|
+
if (!target)
|
|
202
|
+
return { ok: false, error: 'unknown session' };
|
|
203
|
+
// Under the agent lock, so the provider's push inside `openAgentPullRequest` cannot race a
|
|
204
|
+
// Remove of the same checkout.
|
|
205
|
+
const opened = await withAgentLock(agentLockKey(target.cwd, agentId), () => openAgentPullRequest(target.cwd, target.agent, options.draft === true ? { draft: true } : {}));
|
|
206
|
+
// Record it on the finished run (E6), through the project's runs provider. The session's own
|
|
207
|
+
// process is gone by now, so there is no event stream to carry the fact — but it is the same
|
|
208
|
+
// fact, and every surface reads it from the same place either way rather than re-deriving it
|
|
209
|
+
// from branch names. No provider: there is no record to carry it, and the PR is still open.
|
|
210
|
+
if (opened.ok && opened.number !== undefined && opened.url) {
|
|
211
|
+
await (await projectRuns(target.cwd).catch(() => undefined))?.patch(agentId, { pr: { number: opened.number, url: opened.url } });
|
|
212
|
+
}
|
|
213
|
+
return opened;
|
|
214
|
+
}, { ok: false, error: 'could not reach the device' });
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* The user's Publish branch action (#1820): push a finished run's branch and open no pull request,
|
|
218
|
+
* the last step where the project has no git host package. Under the agent lock, as Open PR is, so the push cannot race a Remove.
|
|
219
|
+
*/
|
|
220
|
+
export async function sendPush(projectId, agentId) {
|
|
221
|
+
return relayOr(agentId, 'sendPush', [projectId, agentId], async () => {
|
|
222
|
+
const target = await handoffTargetFor(projectId, agentId);
|
|
223
|
+
if (!target)
|
|
224
|
+
return { ok: false, error: 'unknown session' };
|
|
225
|
+
if (target.agent.status === 'running')
|
|
226
|
+
return { ok: false, error: 'that session is still going' };
|
|
227
|
+
return withAgentLock(agentLockKey(target.cwd, agentId), () => pushAgentBranch(target.cwd, target.agent));
|
|
228
|
+
}, { ok: false, error: 'could not reach the device' });
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* The user's "Create a repository" action, for a project with no remote: the project's repository
|
|
232
|
+
* provider creates it private, sets it as the origin and pushes. The git host is looked up again
|
|
233
|
+
* afterwards: the project has a page there now.
|
|
234
|
+
*/
|
|
235
|
+
export async function sendCreateRepository(projectId) {
|
|
236
|
+
const cwd = await resolveProjectPath(projectId);
|
|
237
|
+
if (!cwd)
|
|
238
|
+
return { ok: false, error: 'this project has no local path on this server' };
|
|
239
|
+
const created = await createRepository(cwd);
|
|
240
|
+
if (created.ok)
|
|
241
|
+
providedDataChanged(cwd);
|
|
242
|
+
return created;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* The user's "Merge into main" action: merge a finished run's branch into the project's default
|
|
246
|
+
* branch on this machine, for a project with no remote to push to. Under the agent lock, as the
|
|
247
|
+
* push is, so the merge cannot race a Remove.
|
|
248
|
+
*/
|
|
249
|
+
export async function sendMergeBranch(projectId, agentId) {
|
|
250
|
+
return relayOr(agentId, 'sendMergeBranch', [projectId, agentId], async () => {
|
|
251
|
+
const target = await handoffTargetFor(projectId, agentId);
|
|
252
|
+
if (!target)
|
|
253
|
+
return { ok: false, error: 'unknown session' };
|
|
254
|
+
if (target.agent.status === 'running')
|
|
255
|
+
return { ok: false, error: 'that session is still going' };
|
|
256
|
+
return withAgentLock(agentLockKey(target.cwd, agentId), () => mergeAgentBranch(target.cwd, target.agent));
|
|
257
|
+
}, { ok: false, error: 'could not reach the device' });
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* The user's Merge action (#1391): merge a finished run's open pull request, directly. A run
|
|
261
|
+
* that is still working has no Merge: its agent is still writing its branch, and the button comes
|
|
262
|
+
* with the ended view.
|
|
263
|
+
*/
|
|
264
|
+
export async function sendMerge(projectId, agentId) {
|
|
265
|
+
return relayOr(agentId, 'sendMerge', [projectId, agentId], async () => {
|
|
266
|
+
const target = await handoffTargetFor(projectId, agentId);
|
|
267
|
+
if (!target)
|
|
268
|
+
return { ok: false, error: 'unknown session' };
|
|
269
|
+
if (target.agent.status === 'running')
|
|
270
|
+
return { ok: false, error: 'that session is still going' };
|
|
271
|
+
return mergeAgentPr(target.cwd, target.agent);
|
|
272
|
+
}, { ok: false, error: 'could not reach the device' });
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Ask the daemon's bridge browser to show its window (for the one-time sign-in), hide it again,
|
|
276
|
+
* or restart (#1332). Anything else is refused; a browser that is not running ignores show/hide.
|
|
277
|
+
*/
|
|
278
|
+
export async function sendBridgeBrowser(action) {
|
|
279
|
+
if (action !== 'show' && action !== 'hide' && action !== 'restart')
|
|
280
|
+
return { ok: false, error: 'unknown action' };
|
|
281
|
+
await contextBridgeBrowser().act(action);
|
|
282
|
+
return { ok: true };
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.js","sourceRoot":"","sources":["../../src/dashboard-rpc/control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,2BAA2B,CAAA;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAoC,MAAM,6BAA6B,CAAA;AACzF,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEhI,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAkB,MAAM,mBAAmB,CAAA;AAC/H,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,eAAe,EAAsB,MAAM,+BAA+B,CAAA;AACzI,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAA+B,MAAM,wBAAwB,C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E,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACjH,MAAM,oBAAoB,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACxC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;AACrB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** One device to health-check: its profile id plus the origin and token to reach it with. */
|
|
2
|
+
export interface DeviceCheck {
|
|
3
|
+
id: string;
|
|
4
|
+
url: string;
|
|
5
|
+
token: string;
|
|
6
|
+
}
|
|
7
|
+
/** Ping each saved device and map its id to whether it answered (#1072). Bad entries are dropped. */
|
|
8
|
+
export declare function checkDevices(devices: DeviceCheck[]): Promise<Record<string, boolean>>;
|
|
9
|
+
//# sourceMappingURL=devices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../src/dashboard-rpc/devices.ts"],"names":[],"mappings":"AAOA,6FAA6F;AAC7F,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd;AAOD,qGAAqG;AACrG,wBAAsB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAI3F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { pingRemote } from '../dashboard/remote-run.js';
|
|
2
|
+
function isDeviceCheck(value) {
|
|
3
|
+
const d = value;
|
|
4
|
+
return !!d && typeof d.id === 'string' && typeof d.url === 'string' && typeof d.token === 'string';
|
|
5
|
+
}
|
|
6
|
+
/** Ping each saved device and map its id to whether it answered (#1072). Bad entries are dropped. */
|
|
7
|
+
export async function checkDevices(devices) {
|
|
8
|
+
const valid = (Array.isArray(devices) ? devices : []).filter(isDeviceCheck);
|
|
9
|
+
const entries = await Promise.all(valid.map(async (d) => [d.id, await pingRemote({ url: d.url, token: d.token })]));
|
|
10
|
+
return Object.fromEntries(entries);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=devices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devices.js","sourceRoot":"","sources":["../../src/dashboard-rpc/devices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAcvD,SAAS,aAAa,CAAC,KAAc;IACnC,MAAM,CAAC,GAAG,KAAoC,CAAA;IAC9C,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAA;AACpG,CAAC;AAED,qGAAqG;AACrG,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAAsB;IACvD,MAAM,KAAK,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;IAC3E,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAU,CAAC,CAAC,CAAA;IAC1H,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;AACpC,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tail a JSONL log: read what is already in it, then follow appends. Each complete line is
|
|
3
|
+
* parsed and handed to `onEvent`; malformed lines are skipped. Returns a stop function that
|
|
4
|
+
* removes the watcher and the poll.
|
|
5
|
+
*
|
|
6
|
+
* The reading is {@link JsonlTailer} and the following is {@link followFile}. This used to be
|
|
7
|
+
* its own copy of both, which is how it ended up missing the tailer's same-length-rewrite
|
|
8
|
+
* detection (#567).
|
|
9
|
+
*
|
|
10
|
+
* `onReplayed` is told once the first pull — the replay of everything already logged — has
|
|
11
|
+
* been delivered (#1383). That boundary is what lets a reconnecting client buffer the replay
|
|
12
|
+
* and swap its feed atomically instead of blanking while history re-streams. The follower
|
|
13
|
+
* only starts after it, so no appended line can slip in ahead of the marker. Best-effort on
|
|
14
|
+
* a failed first read: the marker still fires (the poll retries the read), because a client
|
|
15
|
+
* waiting on it forever would freeze its feed.
|
|
16
|
+
*
|
|
17
|
+
* Kept transport-agnostic (a plain `onEvent` callback, not a stream) so the file
|
|
18
|
+
* side can be driven on its own; `events.ts` wires it to the SSE endpoint.
|
|
19
|
+
*/
|
|
20
|
+
export declare function tailEvents<T = unknown>(path: string, onEvent: (event: T) => void, onReplayed?: () => void): () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Reads the message a run is writing, from the live file beside its diary, for
|
|
23
|
+
* {@link tailAgentEvents}' `afterPull`: the file changes in the diary's directory, so the diary's
|
|
24
|
+
* watch reads it too. `send` gets the text when it changed, and `''` once the file is gone.
|
|
25
|
+
*/
|
|
26
|
+
export declare function partialReader(send: (text: string) => void): (diary: string) => Promise<void>;
|
|
27
|
+
/** Where a relocating tail reads now: a file it follows, a finished run's lines, whole, or nowhere yet (`pending`: ask again shortly). */
|
|
28
|
+
export type TailTarget<T> = {
|
|
29
|
+
file: string;
|
|
30
|
+
} | {
|
|
31
|
+
finished: T[];
|
|
32
|
+
} | {
|
|
33
|
+
pending: true;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Tail a run's diary across its relocations: the same read-then-follow as {@link tailEvents},
|
|
37
|
+
* but where the diary is is asked again whenever the tailed file is not there.
|
|
38
|
+
*
|
|
39
|
+
* A run's diary does not sit still. While the run works it is a file in the run's checkout; when
|
|
40
|
+
* the run ends its tool records it and reclaims the checkout, and from then on the diary is the
|
|
41
|
+
* finished run's, read whole from the project's runs provider. A fixed-path tail whose file was
|
|
42
|
+
* retired went silent *without the final lines* whenever the last `fs.watch` signal was lost —
|
|
43
|
+
* the 1s poll then found the file gone and had nothing to read, so the feed never learned the run
|
|
44
|
+
* ended. This tail treats a missing file as the question it is: it asks `resolve` where the diary
|
|
45
|
+
* is now (`resolveAgentDiary` answers the finished run once the checkout is gone, #1472). A new
|
|
46
|
+
* file retargets the same tailer and follows it. A finished run's lines are the same lines the
|
|
47
|
+
* file had, in the same order, so the ones past the count already delivered are sent and the tail
|
|
48
|
+
* ends: a finished diary does not grow. The same file, or no answer, means the diary has not
|
|
49
|
+
* moved, and the tail keeps waiting where it is. A diary that is nowhere yet (`pending`: the run
|
|
50
|
+
* was started a moment ago and its tool has not made the checkout, or it is being continued and
|
|
51
|
+
* its checkout is on its way back) is asked for again on the same cadence until it has a home,
|
|
52
|
+
* and only then followed; the replay boundary is reported once what that home holds has been
|
|
53
|
+
* delivered, not before: a feed that reconnects swaps what it shows for the replay at the
|
|
54
|
+
* boundary, and a boundary reported with nothing delivered emptied a chat that was full, for as
|
|
55
|
+
* long as the diary took to have a home. Asking even when the file was never seen matters for a
|
|
56
|
+
* short run (#1774): started, ended and reclaimed between two polls, its diary was only ever
|
|
57
|
+
* visible as a finished run.
|
|
58
|
+
*
|
|
59
|
+
* `onReplayed` keeps {@link tailEvents}' once-per-subscription contract: a relocation is not a
|
|
60
|
+
* new replay boundary, so it never fires twice.
|
|
61
|
+
*
|
|
62
|
+
* `afterPull` is told the diary's path after each read of it: the files beside the diary change
|
|
63
|
+
* with it, and a caller reads them there, on the same watch.
|
|
64
|
+
*/
|
|
65
|
+
export declare function tailAgentEvents<T = unknown>(resolve: (opts?: {
|
|
66
|
+
cached?: boolean;
|
|
67
|
+
}) => Promise<TailTarget<T> | undefined>, onEvent: (event: T) => void, onReplayed?: () => void, afterPull?: (diary: string) => Promise<void>): () => void;
|
|
68
|
+
//# sourceMappingURL=events-tail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-tail.d.ts","sourceRoot":"","sources":["../../src/dashboard-rpc/events-tail.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,UAAU,CAAC,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CActH;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAQ5F;AAED,0IAA0I;AAC1I,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,CAAC,EAAE,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,CAAA;AAWpF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,OAAO,EACzC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,EAC5E,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAC3B,UAAU,CAAC,EAAE,MAAM,IAAI,EACvB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAC3C,MAAM,IAAI,CA8JZ"}
|