@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,45 @@
|
|
|
1
|
+
import { type AgentMeta, type LiveAgent } from '../store/index.js';
|
|
2
|
+
import type { ChoiceRequest, OpenAgentEvent } from '../events.js';
|
|
3
|
+
import { type BridgeQuestion } from './bridge-question.js';
|
|
4
|
+
import type { ProjectSummary } from './projects.js';
|
|
5
|
+
/** One session's open question, as the hub lists it: who waits, on what, since when. */
|
|
6
|
+
export interface OpenQuestion {
|
|
7
|
+
projectId: string;
|
|
8
|
+
projectName: string;
|
|
9
|
+
agentId: string;
|
|
10
|
+
/** What the agent was asked to do: the row's title. */
|
|
11
|
+
intent?: string;
|
|
12
|
+
/** When the agent last spoke, ISO: what the longest-waiting-first order sorts on. */
|
|
13
|
+
updatedAt?: string;
|
|
14
|
+
/** The question; for one a Claude web session asked (#1237/#1554), built from what the browser bridge reported. */
|
|
15
|
+
choice: ChoiceRequest;
|
|
16
|
+
}
|
|
17
|
+
/** Injectable seams so {@link buildOpenQuestions} is unit-testable off disk. */
|
|
18
|
+
export interface OpenQuestionsDeps {
|
|
19
|
+
/** The reader of the runs that have a checkout (default {@link readLiveMetas}): a waiting run keeps its own. */
|
|
20
|
+
liveAgents?: (cwd: string) => Promise<LiveAgent[]>;
|
|
21
|
+
/** One run's events, by the project's path and the run's id (default {@link loadAgentEvents}). */
|
|
22
|
+
events?: (cwd: string, agentId: string) => Promise<OpenAgentEvent[] | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* The questions the browser bridge holds, minus those with an answer already on its way
|
|
25
|
+
* (default: the daemon's bridge store).
|
|
26
|
+
*/
|
|
27
|
+
bridged?: () => BridgeQuestion[];
|
|
28
|
+
/**
|
|
29
|
+
* Every agent of a project, archived included (default {@link readAllAgents}): a web agent is
|
|
30
|
+
* `done` at its hand-off (#1231) and its checkout may be long gone, so the live reader alone
|
|
31
|
+
* would never find the run a bridged question belongs to.
|
|
32
|
+
*/
|
|
33
|
+
agents?: (cwd: string) => Promise<AgentMeta[]>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Every project's parked questions, longest-waiting first (#1455): an agent that has been blocked
|
|
37
|
+
* on its human the longest is the one to unblock first.
|
|
38
|
+
*
|
|
39
|
+
* Forgiving throughout, like every cross-project rollup: an unreadable project, agent list or
|
|
40
|
+
* event log contributes nothing rather than failing the read. A waiting run whose diary shows no
|
|
41
|
+
* open question (log unreadable) is skipped — listing a question nobody can answer is worse than
|
|
42
|
+
* one row fewer.
|
|
43
|
+
*/
|
|
44
|
+
export declare function buildOpenQuestions(projects: ProjectSummary[], deps?: OpenQuestionsDeps): Promise<OpenQuestion[]>;
|
|
45
|
+
//# sourceMappingURL=open-questions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-questions.d.ts","sourceRoot":"","sources":["../../src/dashboard/open-questions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAEjH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AACjE,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AASnD,wFAAwF;AACxF,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mHAAmH;IACnH,MAAM,EAAE,aAAa,CAAA;CACtB;AAED,gFAAgF;AAChF,MAAM,WAAW,iBAAiB;IAChC,gHAAgH;IAChH,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,EAAE,CAAC,CAAA;IAClD,kGAAkG;IAClG,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,EAAE,GAAG,SAAS,CAAC,CAAA;IAChF;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,cAAc,EAAE,CAAA;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,EAAE,CAAC,CAAA;CAC/C;AAQD;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,cAAc,EAAE,EAC1B,IAAI,GAAE,iBAAsB,GAC3B,OAAO,CAAC,YAAY,EAAE,CAAC,CAqCzB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { loadAgentEvents, readAllAgents, readLiveMetas } from '../store/index.js';
|
|
2
|
+
import { pendingChoices } from '../open-choices.js';
|
|
3
|
+
import { bridgeChoiceRequest } from './bridge-question.js';
|
|
4
|
+
import { bridgeQuestions } from './bridge-store.js';
|
|
5
|
+
/** The bridge store's questions still waiting for a pick. */
|
|
6
|
+
function unansweredBridgeQuestions() {
|
|
7
|
+
const store = bridgeQuestions();
|
|
8
|
+
return store.list().filter(question => !store.pendingAnswer(question.sessionId));
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Every project's parked questions, longest-waiting first (#1455): an agent that has been blocked
|
|
12
|
+
* on its human the longest is the one to unblock first.
|
|
13
|
+
*
|
|
14
|
+
* Forgiving throughout, like every cross-project rollup: an unreadable project, agent list or
|
|
15
|
+
* event log contributes nothing rather than failing the read. A waiting run whose diary shows no
|
|
16
|
+
* open question (log unreadable) is skipped — listing a question nobody can answer is worse than
|
|
17
|
+
* one row fewer.
|
|
18
|
+
*/
|
|
19
|
+
export async function buildOpenQuestions(projects, deps = {}) {
|
|
20
|
+
const liveAgents = deps.liveAgents ?? readLiveMetas;
|
|
21
|
+
const events = deps.events ?? loadAgentEvents;
|
|
22
|
+
const agents = deps.agents ?? readAllAgents;
|
|
23
|
+
// One card per bridged question, whichever project claims it first: two checkouts of the same
|
|
24
|
+
// repository share their `agents-data` archive, so the web run behind a question shows up under each.
|
|
25
|
+
const bridged = (deps.bridged ?? unansweredBridgeQuestions)();
|
|
26
|
+
const claimed = new Set();
|
|
27
|
+
const items = [];
|
|
28
|
+
const card = (project, meta, choice, updatedAt) => ({
|
|
29
|
+
projectId: project.id,
|
|
30
|
+
projectName: project.name,
|
|
31
|
+
agentId: meta.id,
|
|
32
|
+
...(meta.intent ? { intent: meta.intent } : {}),
|
|
33
|
+
...(updatedAt ? { updatedAt } : {}),
|
|
34
|
+
choice,
|
|
35
|
+
});
|
|
36
|
+
for (const project of projects) {
|
|
37
|
+
for (const meta of await liveAgents(project.path).catch(() => [])) {
|
|
38
|
+
if (meta.status !== 'waiting')
|
|
39
|
+
continue;
|
|
40
|
+
const choice = pendingChoices((await events(project.path, meta.id).catch(() => undefined)) ?? []).at(-1);
|
|
41
|
+
if (!choice)
|
|
42
|
+
continue;
|
|
43
|
+
items.push(card(project, meta, choice, meta.updatedAt));
|
|
44
|
+
}
|
|
45
|
+
// A web agent's question lives in the bridge store, not its log (#1554): join it on the cloud
|
|
46
|
+
// session id its meta carries. The archive is read only while there is something to join.
|
|
47
|
+
if (!bridged.length)
|
|
48
|
+
continue;
|
|
49
|
+
for (const meta of await agents(project.path).catch(() => [])) {
|
|
50
|
+
if (meta.target !== 'web' || !meta.sessionId)
|
|
51
|
+
continue;
|
|
52
|
+
const question = bridged.find(q => q.sessionId === meta.sessionId && !claimed.has(q.sessionId));
|
|
53
|
+
if (!question)
|
|
54
|
+
continue;
|
|
55
|
+
claimed.add(question.sessionId);
|
|
56
|
+
// Parked since the bridge saw it, which is the wait that matters here — not the hand-off.
|
|
57
|
+
items.push(card(project, meta, bridgeChoiceRequest(question), question.receivedAt));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return items.sort((a, b) => (a.updatedAt ?? '').localeCompare(b.updatedAt ?? ''));
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=open-questions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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AAE,CAAC,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;YAC/F,IAAI,CAAC,QAAQ;gBAAE,SAAQ;YACvB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;YAC/B,0FAA0F;YAC1F,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAA;QACrF,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,CAAA;AACnF,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type LiveAgent, type AgentMeta, type AgentStatus } from '../store/index.js';
|
|
2
|
+
import type { ProjectSummary } from './projects.js';
|
|
3
|
+
import { type ProjectQueue } from './queue.js';
|
|
4
|
+
/** One project's in-flight run, surfaced in the Overview's "working now" list. */
|
|
5
|
+
export interface ActiveAgent {
|
|
6
|
+
projectId: string;
|
|
7
|
+
projectName: string;
|
|
8
|
+
/** Which run this is (#738): a project can have several in flight, one per worktree. */
|
|
9
|
+
agentId: string;
|
|
10
|
+
/** The agent's own checkout, so its git/file status is read from the worktree it edits (#738). */
|
|
11
|
+
cwd: string;
|
|
12
|
+
status: AgentStatus;
|
|
13
|
+
/** What the user asked to build (the agent's `scope` event). */
|
|
14
|
+
intent?: string;
|
|
15
|
+
scope?: string;
|
|
16
|
+
/** ISO timestamp of the agent's last event. */
|
|
17
|
+
updatedAt?: string;
|
|
18
|
+
/**
|
|
19
|
+
* A web run at work on its cloud side (#1668): in its session, or parked on a question the
|
|
20
|
+
* bridge reported. Its local half is over, so it is not a live agent — it is listed because the
|
|
21
|
+
* cloud side is the agent, and "no agents working" over a waiting cloud session was a lie.
|
|
22
|
+
*/
|
|
23
|
+
cloud?: 'in-cloud' | 'waiting';
|
|
24
|
+
/** The machine whose daemon started it (#1648), only when that is not this one. */
|
|
25
|
+
host?: string;
|
|
26
|
+
}
|
|
27
|
+
/** One recently active project, most-recent first. */
|
|
28
|
+
export interface RecentProject {
|
|
29
|
+
projectId: string;
|
|
30
|
+
projectName: string;
|
|
31
|
+
lastActivityAt?: string;
|
|
32
|
+
}
|
|
33
|
+
/** The cross-project Overview payload. */
|
|
34
|
+
export interface Overview {
|
|
35
|
+
/** Projects with a running agent, most-recently-updated first. */
|
|
36
|
+
active: ActiveAgent[];
|
|
37
|
+
/** Total open TODO items across every project. */
|
|
38
|
+
queueOpen: number;
|
|
39
|
+
/** The most recently active projects (capped). */
|
|
40
|
+
recent: RecentProject[];
|
|
41
|
+
}
|
|
42
|
+
/** One recent session, tagged with the project it belongs to, for the cross-project rail. */
|
|
43
|
+
export interface RecentAgent {
|
|
44
|
+
projectId: string;
|
|
45
|
+
projectName: string;
|
|
46
|
+
agent: AgentMeta;
|
|
47
|
+
}
|
|
48
|
+
/** Injectable reader so {@link buildRecentAgents} is unit-testable off disk. */
|
|
49
|
+
export interface RecentAgentsDeps {
|
|
50
|
+
agents?: (cwd: string) => Promise<AgentMeta[]>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Every project's sessions pooled and sorted newest-first (capped), so the shared sidebar (#shared-
|
|
54
|
+
* shell) can show recents on the home/Overview where no single project is selected. Each row carries
|
|
55
|
+
* the project it belongs to, so selecting it jumps into that project's session. Forgiving — a project
|
|
56
|
+
* whose agents cannot be read simply contributes nothing.
|
|
57
|
+
*/
|
|
58
|
+
export declare function buildRecentAgents(projects: ProjectSummary[], deps?: RecentAgentsDeps): Promise<RecentAgent[]>;
|
|
59
|
+
/** Injectable readers so {@link buildOverview} is unit-testable off disk. */
|
|
60
|
+
export interface OverviewDeps {
|
|
61
|
+
liveAgents?: (cwd: string) => Promise<LiveAgent[]>;
|
|
62
|
+
queue?: (projects: ProjectSummary[]) => Promise<ProjectQueue[]>;
|
|
63
|
+
/** Every run of a project, archived included (default {@link readAllAgents}): where the web runs are. */
|
|
64
|
+
agents?: (cwd: string) => Promise<AgentMeta[]>;
|
|
65
|
+
/** Whether the bridge holds a question for that cloud session (default: the daemon's bridge store). */
|
|
66
|
+
waiting?: (sessionId: string) => boolean;
|
|
67
|
+
now?: () => number;
|
|
68
|
+
/** This machine's hostname; `node:os` in production. */
|
|
69
|
+
host?: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Build the cross-project Overview: the running agents (every live agent of each project, one per
|
|
73
|
+
* worktree since #736), the total of open queue entries (from {@link collectQueue}), and the most
|
|
74
|
+
* recently active projects (by {@link ProjectSummary.lastActivityAt}). Forgiving — a project
|
|
75
|
+
* with no live run, or none running, simply contributes nothing to `active`.
|
|
76
|
+
*/
|
|
77
|
+
export declare function buildOverview(projects: ProjectSummary[], deps?: OverviewDeps): Promise<Overview>;
|
|
78
|
+
//# sourceMappingURL=overview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../src/dashboard/overview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAClH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAW5D,kFAAkF;AAClF,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,wFAAwF;IACxF,OAAO,EAAE,MAAM,CAAA;IACf,kGAAkG;IAClG,GAAG,E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AAK,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;IAC/D,yGAAyG;IACzG,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,EAAE,CAAC,CAAA;IAC9C,uGAAuG;IACvG,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAA;IACxC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;IAClB,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,cAAc,EAAE,EAAE,IAAI,GAAE,YAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAoD1G"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { readAllAgents, readLiveMetas } from '../store/index.js';
|
|
2
|
+
import { collectQueue } from './queue.js';
|
|
3
|
+
import { cloudRunState } from '../cloud-run-state.js';
|
|
4
|
+
import { bridgeQuestions } from './bridge-store.js';
|
|
5
|
+
import { hostname } from 'node:os';
|
|
6
|
+
/** How many recent projects the Overview surfaces. */
|
|
7
|
+
const RECENT_LIMIT = 5;
|
|
8
|
+
/** How many recent sessions the home rail pools across every project. */
|
|
9
|
+
const RECENT_RUNS_LIMIT = 30;
|
|
10
|
+
/**
|
|
11
|
+
* Every project's sessions pooled and sorted newest-first (capped), so the shared sidebar (#shared-
|
|
12
|
+
* shell) can show recents on the home/Overview where no single project is selected. Each row carries
|
|
13
|
+
* the project it belongs to, so selecting it jumps into that project's session. Forgiving — a project
|
|
14
|
+
* whose agents cannot be read simply contributes nothing.
|
|
15
|
+
*/
|
|
16
|
+
export async function buildRecentAgents(projects, deps = {}) {
|
|
17
|
+
const readAgents = deps.agents ?? readAllAgents;
|
|
18
|
+
const all = [];
|
|
19
|
+
for (const project of projects) {
|
|
20
|
+
for (const agent of await readAgents(project.path).catch(() => [])) {
|
|
21
|
+
all.push({ projectId: project.id, projectName: project.name, agent });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
all.sort((a, b) => (b.agent.startedAt ?? '').localeCompare(a.agent.startedAt ?? ''));
|
|
25
|
+
// One row per run (#1648): two checkouts of one repository share their archive, so every run
|
|
26
|
+
// was listed once per checkout; the first project to list it keeps it.
|
|
27
|
+
const seen = new Set();
|
|
28
|
+
return all.filter(row => !seen.has(row.agent.id) && seen.add(row.agent.id)).slice(0, RECENT_RUNS_LIMIT);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Build the cross-project Overview: the running agents (every live agent of each project, one per
|
|
32
|
+
* worktree since #736), the total of open queue entries (from {@link collectQueue}), and the most
|
|
33
|
+
* recently active projects (by {@link ProjectSummary.lastActivityAt}). Forgiving — a project
|
|
34
|
+
* with no live run, or none running, simply contributes nothing to `active`.
|
|
35
|
+
*/
|
|
36
|
+
export async function buildOverview(projects, deps = {}) {
|
|
37
|
+
const liveAgents = deps.liveAgents ?? readLiveMetas;
|
|
38
|
+
const queue = deps.queue ?? (p => collectQueue(p));
|
|
39
|
+
const agents = deps.agents ?? readAllAgents;
|
|
40
|
+
const waiting = deps.waiting ?? (sessionId => bridgeQuestions().waiting(sessionId));
|
|
41
|
+
const now = (deps.now ?? Date.now)();
|
|
42
|
+
const thisHost = deps.host ?? hostname();
|
|
43
|
+
const active = [];
|
|
44
|
+
// One entry per web run across projects: two checkouts of one repository share their archive,
|
|
45
|
+
// so the same run is in both projects' lists; the first project to list it keeps it.
|
|
46
|
+
const cloudSeen = new Set();
|
|
47
|
+
const entry = (project, meta, cwd) => ({
|
|
48
|
+
projectId: project.id,
|
|
49
|
+
projectName: project.name,
|
|
50
|
+
agentId: meta.id,
|
|
51
|
+
cwd,
|
|
52
|
+
status: meta.status,
|
|
53
|
+
...(meta.intent ? { intent: meta.intent } : {}),
|
|
54
|
+
...(meta.updatedAt ? { updatedAt: meta.updatedAt } : {}),
|
|
55
|
+
// Another machine's daemon started it (#1648): the shared data branch shows its runs here too.
|
|
56
|
+
...(meta.host !== undefined && meta.host !== thisHost ? { host: meta.host } : {}),
|
|
57
|
+
});
|
|
58
|
+
for (const project of projects) {
|
|
59
|
+
// Every live agent of the project (#738), not just the one that used to sit at its path.
|
|
60
|
+
for (const meta of await liveAgents(project.path).catch(() => [])) {
|
|
61
|
+
if (meta.status !== 'running')
|
|
62
|
+
continue;
|
|
63
|
+
active.push(entry(project, meta, meta.cwd));
|
|
64
|
+
}
|
|
65
|
+
// The web runs whose cloud side is still at work (#1668): their local half is over and their
|
|
66
|
+
// checkout may be gone, so they are read from the archive and keyed to the project's own path.
|
|
67
|
+
for (const meta of await agents(project.path).catch(() => [])) {
|
|
68
|
+
if (meta.target !== 'web' || cloudSeen.has(meta.id))
|
|
69
|
+
continue;
|
|
70
|
+
const state = cloudRunState({ ...meta, cloudWaiting: meta.sessionId !== undefined && waiting(meta.sessionId) }, now);
|
|
71
|
+
if (state !== 'in-cloud' && state !== 'waiting')
|
|
72
|
+
continue;
|
|
73
|
+
cloudSeen.add(meta.id);
|
|
74
|
+
active.push({ ...entry(project, meta, project.path), cloud: state });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
active.sort((a, b) => (b.updatedAt ?? '').localeCompare(a.updatedAt ?? ''));
|
|
78
|
+
const queues = await queue(projects);
|
|
79
|
+
const queueOpen = queues.reduce((sum, q) => sum + q.entries.length, 0);
|
|
80
|
+
const recent = projects
|
|
81
|
+
.filter(p => p.lastActivityAt)
|
|
82
|
+
.sort((a, b) => (b.lastActivityAt ?? '').localeCompare(a.lastActivityAt ?? ''))
|
|
83
|
+
.slice(0, RECENT_LIMIT)
|
|
84
|
+
.map(p => ({ projectId: p.id, projectName: p.name, lastActivityAt: p.lastActivityAt }));
|
|
85
|
+
return { active, queueOpen, recent };
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=overview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overview.js","sourceRoot":"","sources":["../../src/dashboard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AAM,EAAE,SAAS,EAAE,MAAM,EAAE,CAAA;AACtC,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type ProjectRecord } from '../registry.js';
|
|
2
|
+
import { type AgentMeta } from '../store/index.js';
|
|
3
|
+
import type { ProjectError, StaysLocal } from '../project-errors.js';
|
|
4
|
+
import { type GitHostFor } from '../store/git-host.js';
|
|
5
|
+
/**
|
|
6
|
+
* The multi-project read side (#392): projects the daemon serves come from the registry (#390),
|
|
7
|
+
* and every read resolves a project id to that project's path before running the per-cwd reader
|
|
8
|
+
* underneath. One daemon serves them all, running as many agents per project as their own
|
|
9
|
+
* concurrency allows (#736), each in its own checkout.
|
|
10
|
+
*/
|
|
11
|
+
/** One project's summary for the Projects sidebar (#314). */
|
|
12
|
+
export interface ProjectSummary {
|
|
13
|
+
/** Registry id (stable, URL-safe). */
|
|
14
|
+
id: string;
|
|
15
|
+
/** Absolute repo path. */
|
|
16
|
+
path: string;
|
|
17
|
+
/** Display name (the path's basename). */
|
|
18
|
+
name: string;
|
|
19
|
+
/** True when the repo still has its `.openagent/` marker. */
|
|
20
|
+
activated: boolean;
|
|
21
|
+
/** Whether one of the project's packages provides a git host; without one no pull request can be opened there. */
|
|
22
|
+
gitHost: boolean;
|
|
23
|
+
/** ISO timestamp of the project's newest activity: its most recent session. */
|
|
24
|
+
lastActivityAt?: string;
|
|
25
|
+
/**
|
|
26
|
+
* What the daemon's background jobs currently find wrong with the project (#1500), oldest
|
|
27
|
+
* first — absent when nothing is. Not part of the summary itself: the dashboard's project
|
|
28
|
+
* list attaches it from the daemon's error state.
|
|
29
|
+
*/
|
|
30
|
+
errors?: ProjectError[];
|
|
31
|
+
/**
|
|
32
|
+
* Why the project's data stays on this machine, as the daemon's last data sync found it: its
|
|
33
|
+
* repository has no remote, or the person keeps the agents' records here. Nothing is wrong.
|
|
34
|
+
* Absent for a project that shares them; attached like `errors`.
|
|
35
|
+
*/
|
|
36
|
+
local?: StaysLocal;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A projection over the registered projects, together with the projects it could actually see.
|
|
40
|
+
*
|
|
41
|
+
* A project whose sources cannot be read contributes no items — which is exactly what a project
|
|
42
|
+
* with nothing waiting contributes. `whole` is what tells the two apart (#1623). Only a caller
|
|
43
|
+
* that keeps a baseline of what it has already announced needs the distinction; the panels that
|
|
44
|
+
* simply render the list read `items` and ignore it.
|
|
45
|
+
*/
|
|
46
|
+
export interface ProjectionRead<T> {
|
|
47
|
+
/** What was found. Possibly only part of it, when some project could not be read. */
|
|
48
|
+
items: T[];
|
|
49
|
+
/** The ids of the projects every source answered for, so their share of `items` is all of it. */
|
|
50
|
+
whole: string[];
|
|
51
|
+
}
|
|
52
|
+
/** Injectable readers so {@link summarizeProject} is unit-testable off disk. */
|
|
53
|
+
export interface SummarizeDeps {
|
|
54
|
+
isActivated?: (path: string) => Promise<boolean>;
|
|
55
|
+
/** The project's runs (live + archived), newest-first. Defaults to {@link readAllAgents}. */
|
|
56
|
+
readAgents?: (path: string) => Promise<AgentMeta[]>;
|
|
57
|
+
/** The project's git host. Defaults to {@link projectGitHost}. */
|
|
58
|
+
gitHost?: GitHostFor;
|
|
59
|
+
}
|
|
60
|
+
/** A project's runs, live prepended to the archived history. Forgiving: a failed read is `[]`. */
|
|
61
|
+
/**
|
|
62
|
+
* Derive a {@link ProjectSummary} from a registry record: its display name, whether
|
|
63
|
+
* it is still activated, and its last activity. Forgiving: a failed read reads as an
|
|
64
|
+
* inactive project with no activity, never a throw.
|
|
65
|
+
*
|
|
66
|
+
* Activity is the sessions themselves (B3). It used to be the newest of those and the latest
|
|
67
|
+
* `LOGS.md` entry — a committed markdown re-narration of the same sessions, which could only ever
|
|
68
|
+
* be older than the agent it described.
|
|
69
|
+
*/
|
|
70
|
+
export declare function summarizeProject(record: ProjectRecord, deps?: SummarizeDeps): Promise<ProjectSummary>;
|
|
71
|
+
/**
|
|
72
|
+
* Reads the registry to serve the multi-project endpoints. The dashboard server
|
|
73
|
+
* holds one of these; the daemon uses the default (the real registry), tests pass
|
|
74
|
+
* a fake so the server is exercised without touching the user's registry.
|
|
75
|
+
*/
|
|
76
|
+
export interface ProjectsProvider {
|
|
77
|
+
/** Every registered project, summarized, for the projects read. */
|
|
78
|
+
list(): Promise<ProjectSummary[]>;
|
|
79
|
+
/** The absolute path for a registry id, or `undefined` when unknown. */
|
|
80
|
+
resolvePath(id: string): Promise<string | undefined>;
|
|
81
|
+
}
|
|
82
|
+
/** Injectable readers so {@link defaultProjectsProvider} is unit-testable off the user's registry. */
|
|
83
|
+
export interface ProviderDeps {
|
|
84
|
+
/** The registry's records. Defaults to {@link listProjects}, forgiving. */
|
|
85
|
+
listRecords?: () => Promise<ProjectRecord[]>;
|
|
86
|
+
/** Whether a project's directory is on disk. Defaults to a directory stat. */
|
|
87
|
+
isDirectory?: (path: string) => Promise<boolean>;
|
|
88
|
+
/** Defaults to {@link summarizeProject}. */
|
|
89
|
+
summarize?: (record: ProjectRecord) => Promise<ProjectSummary>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A {@link ProjectsProvider} backed by the global registry (#390).
|
|
93
|
+
*
|
|
94
|
+
* Only projects whose directory is still on disk are served (#1140): a repo the user renamed or
|
|
95
|
+
* deleted used to stay in the sidebar as a grey "not activated" entry with no files (#1142),
|
|
96
|
+
* indistinguishable from a repo that merely lost its marker, and with nothing to click to make it
|
|
97
|
+
* go away. The registry itself is left alone — the record is skipped, not pruned — so a directory
|
|
98
|
+
* that comes back (renamed back, a volume remounted) is a project again on the next read.
|
|
99
|
+
*/
|
|
100
|
+
export declare function defaultProjectsProvider(deps?: ProviderDeps): ProjectsProvider;
|
|
101
|
+
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/dashboard/projects.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAA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;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mEAAmE;IACnE,IAAI,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAA;IACjC,wEAAwE;IACxE,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CACrD;AAED,sGAAsG;AACtG,MAAM,WAAW,YAAY;IAC3B,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,aAAa,EAAE,CAAC,CAAA;IAC5C,8EAA8E;IAC9E,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IAChD,4CAA4C;IAC5C,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,cAAc,CAAC,CAAA;CAC/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,GAAE,YAAiB,GAAG,gBAAgB,CAiBjF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { basename } from 'node:path';
|
|
2
|
+
import { listProjects } from '../registry.js';
|
|
3
|
+
import { nodeFs } from '../node-fs.js';
|
|
4
|
+
import { isActivated } from '../project.js';
|
|
5
|
+
import { readAllAgents } from '../store/index.js';
|
|
6
|
+
import { projectGitHost } from '../store/git-host.js';
|
|
7
|
+
/** A project's runs, live prepended to the archived history. Forgiving: a failed read is `[]`. */
|
|
8
|
+
/**
|
|
9
|
+
* Derive a {@link ProjectSummary} from a registry record: its display name, whether
|
|
10
|
+
* it is still activated, and its last activity. Forgiving: a failed read reads as an
|
|
11
|
+
* inactive project with no activity, never a throw.
|
|
12
|
+
*
|
|
13
|
+
* Activity is the sessions themselves (B3). It used to be the newest of those and the latest
|
|
14
|
+
* `LOGS.md` entry — a committed markdown re-narration of the same sessions, which could only ever
|
|
15
|
+
* be older than the agent it described.
|
|
16
|
+
*/
|
|
17
|
+
export async function summarizeProject(record, deps = {}) {
|
|
18
|
+
const checkActivated = deps.isActivated ?? isActivated;
|
|
19
|
+
const loadAgents = deps.readAgents ?? readAllAgents;
|
|
20
|
+
const activated = await checkActivated(record.path).catch(() => false);
|
|
21
|
+
const agents = await loadAgents(record.path).catch(() => []);
|
|
22
|
+
// ISO timestamps sort chronologically.
|
|
23
|
+
const agentActivity = agents.map(r => r.updatedAt || r.startedAt).filter(Boolean);
|
|
24
|
+
const lastActivityAt = agentActivity.filter((a) => !!a).sort().at(-1);
|
|
25
|
+
const summary = {
|
|
26
|
+
id: record.id,
|
|
27
|
+
path: record.path,
|
|
28
|
+
name: basename(record.path),
|
|
29
|
+
activated,
|
|
30
|
+
gitHost: (await (deps.gitHost ?? projectGitHost)(record.path).catch(() => undefined)) !== undefined,
|
|
31
|
+
};
|
|
32
|
+
if (lastActivityAt)
|
|
33
|
+
summary.lastActivityAt = lastActivityAt;
|
|
34
|
+
return summary;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A {@link ProjectsProvider} backed by the global registry (#390).
|
|
38
|
+
*
|
|
39
|
+
* Only projects whose directory is still on disk are served (#1140): a repo the user renamed or
|
|
40
|
+
* deleted used to stay in the sidebar as a grey "not activated" entry with no files (#1142),
|
|
41
|
+
* indistinguishable from a repo that merely lost its marker, and with nothing to click to make it
|
|
42
|
+
* go away. The registry itself is left alone — the record is skipped, not pruned — so a directory
|
|
43
|
+
* that comes back (renamed back, a volume remounted) is a project again on the next read.
|
|
44
|
+
*/
|
|
45
|
+
export function defaultProjectsProvider(deps = {}) {
|
|
46
|
+
const listRecords = deps.listRecords ?? (() => listProjects().catch(() => []));
|
|
47
|
+
const isDirectory = deps.isDirectory ?? nodeFs().isDirectory;
|
|
48
|
+
const summarize = deps.summarize ?? (record => summarizeProject(record));
|
|
49
|
+
const present = async () => {
|
|
50
|
+
const records = await listRecords();
|
|
51
|
+
const kept = await Promise.all(records.map(async (record) => ((await isDirectory(record.path).catch(() => false)) ? record : undefined)));
|
|
52
|
+
return kept.filter((record) => record !== undefined);
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
async list() {
|
|
56
|
+
return Promise.all((await present()).map(summarize));
|
|
57
|
+
},
|
|
58
|
+
async resolvePath(id) {
|
|
59
|
+
return (await present()).find(record => record.id === id)?.path;
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/dashboard/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,YAAY,EAAsB,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAkB,MAAM,mBAAmB,CAAA;AAEjE,OAAO,EAAE,cAAc,EAAmB,MAAM,sBAAsB,CAAA;AA6DtE,kGAAkG;AAClG;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,MAAqB,EAAE,IAAI,GAAkB,EAAE;IACpF,MAAM,cAAc,GAAG,IAAI,CAAC,WAAW,IAAI,WAAW,CAAA;IACtD,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,aAAa,CAAA;IACnD,MAAM,SAAS,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAA;IACtE,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAiB,CAAC,CAAA;IAC3E,uCAAuC;IACvC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CA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C,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAC,MAAM,EAAC,EAAE,CAAC,CAAC,CAAC,MAAM,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;QACvI,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,EAA2B,EAAE,CAAC,MAAM,KAAK,SAAS,CAAC,CAAA;IAC/E,CAAC,CAAA;IACD,OAAO;QACL,KAAK,CAAC,IAAI;YACR,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAA;QACtD,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,EAAE;YAClB,OAAO,CAAC,MAAM,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,CAAA;QACjE,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { type GitHostFor, type GitHostRequest } from '../store/git-host.js';
|
|
2
|
+
import { type Cached } from './cache.js';
|
|
3
|
+
/**
|
|
4
|
+
* The pull requests the dashboard reads (#1820), in one place, all through the project's git host
|
|
5
|
+
* provider (`../store/git-host.ts`): a branch's request, a branch's whole request history, and the
|
|
6
|
+
* project's open requests. Reads only: opening and landing are `agent-handoff.ts`'s, through the
|
|
7
|
+
* same provider. OpenAgent runs no git host tool; a project with no git host package has no pull
|
|
8
|
+
* requests, and every read here answers "none" for it.
|
|
9
|
+
*
|
|
10
|
+
* The shapes are OpenAgent's own ({@link LinkedPr}, {@link OpenPr}), copied out of what the
|
|
11
|
+
* provider answers rather than passed through, so a field a provider adds cannot leak into what
|
|
12
|
+
* callers store.
|
|
13
|
+
*/
|
|
14
|
+
/** The PR opened for a branch, when there is one. */
|
|
15
|
+
export interface LinkedPr {
|
|
16
|
+
number: number;
|
|
17
|
+
url: string;
|
|
18
|
+
/** OPEN / MERGED / CLOSED, as the git host reports it; UNKNOWN for a recorded request no live read confirmed. */
|
|
19
|
+
state: string;
|
|
20
|
+
title: string;
|
|
21
|
+
/** ISO creation time, when the read included it: what tells one agent's PR from a predecessor's. */
|
|
22
|
+
createdAt?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The head commit the PR covers, when the read included it (#1512): what tells "the branch's
|
|
25
|
+
* PR already landed everything" from "the session kept working after its PR merged".
|
|
26
|
+
*/
|
|
27
|
+
headRefOid?: string;
|
|
28
|
+
/** The commit a merged PR landed as on the base branch, when the git host said. */
|
|
29
|
+
mergeCommit?: string;
|
|
30
|
+
}
|
|
31
|
+
/** An open PR on the interventions queue (#632). */
|
|
32
|
+
export interface OpenPr {
|
|
33
|
+
number: number;
|
|
34
|
+
title: string;
|
|
35
|
+
url: string;
|
|
36
|
+
/**
|
|
37
|
+
* Draft PRs are generally left off the queue: a draft is not asking for review.
|
|
38
|
+
*
|
|
39
|
+
* The exception is a draft OpenAgent opened for itself (#1102), which {@link headRefName}
|
|
40
|
+
* is what tells apart.
|
|
41
|
+
*/
|
|
42
|
+
isDraft: boolean;
|
|
43
|
+
/** The branch the PR is from, so a session's own PR can be recognised as ours (#1102). */
|
|
44
|
+
headRefName?: string;
|
|
45
|
+
createdAt?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A best-effort PR lookup, for a named branch or for the checkout's current branch. One type for
|
|
49
|
+
* both: the named-branch form is the general one, and "the current branch" is just omitting it.
|
|
50
|
+
*/
|
|
51
|
+
export type PrLookup = (cwd: string, branch?: string) => Promise<LinkedPr | undefined>;
|
|
52
|
+
/**
|
|
53
|
+
* The branch-addressed form, for a caller that always names one (#799): a finished session's
|
|
54
|
+
* worktree may be gone, so "the current branch" would silently be the project's, not the
|
|
55
|
+
* session's. Narrower than {@link PrLookup} on purpose, so that invariant is in the type.
|
|
56
|
+
*/
|
|
57
|
+
export type BranchPrLookup = (cwd: string, branch: string) => Promise<LinkedPr | undefined>;
|
|
58
|
+
/** Lists a checkout's open PRs; rejects when the git host could not answer. */
|
|
59
|
+
export type PrLister = (cwd: string) => Promise<OpenPr[]>;
|
|
60
|
+
/** A provider's request as OpenAgent keeps it: the state upper-cased, the head as the request's commit. */
|
|
61
|
+
export declare function linkedPrOf(request: GitHostRequest): LinkedPr;
|
|
62
|
+
/** A provider's open request as the interventions queue keeps it. */
|
|
63
|
+
export declare function openPrOf(request: GitHostRequest): OpenPr;
|
|
64
|
+
/**
|
|
65
|
+
* Every PR a branch name has ever had, newest first (#1251).
|
|
66
|
+
*
|
|
67
|
+
* The newest request for a head *in any state* is what a single view would answer, so a session
|
|
68
|
+
* whose prompt pins its branch name (`openagent/triage-quick`) inherits a predecessor's
|
|
69
|
+
* merged PR as its own. The list form keeps the whole history so {@link pickAgentPr} can decide
|
|
70
|
+
* which entry, if any, belongs to the agent asking. Resolves `[]` when the project has no git host or
|
|
71
|
+
* the git host could not answer — indistinguishable from "no PRs", which is what every caller would do
|
|
72
|
+
* with a failure anyway.
|
|
73
|
+
*/
|
|
74
|
+
export declare function prsForBranch(cwd: string, branch: string, gitHost?: GitHostFor): Promise<LinkedPr[]>;
|
|
75
|
+
/**
|
|
76
|
+
* {@link prsForBranch} for a caller about to *open* a PR (#1601): a listing the git host could not
|
|
77
|
+
* answer throws instead of reading as "no PRs", because "none" and "could not tell" must not look
|
|
78
|
+
* alike there — the difference is a second draft PR on a branch that already has one. A project
|
|
79
|
+
* with no git host has none, truthfully.
|
|
80
|
+
*/
|
|
81
|
+
export declare function prsForBranchOrThrow(cwd: string, branch: string, gitHost?: GitHostFor): Promise<LinkedPr[]>;
|
|
82
|
+
/** The newest PR of `branch`, in any state, or undefined when it has none or the git host cannot tell. */
|
|
83
|
+
export declare function prView(cwd: string, branch: string, gitHost?: GitHostFor): Promise<LinkedPr | undefined>;
|
|
84
|
+
/**
|
|
85
|
+
* The cached form of {@link prView} (#1028), and what the dashboard's panels use.
|
|
86
|
+
*
|
|
87
|
+
* A PR lookup costs a process where the git reads beside it cost ten milliseconds, and the answer
|
|
88
|
+
* changes about as often as someone opens a PR. Cached per checkout and branch, shared between
|
|
89
|
+
* the worktree bar and the handoff summary, and refreshed behind whoever asks. `pending` says the
|
|
90
|
+
* answer is not known yet rather than that there is no PR — the difference matters to a caller
|
|
91
|
+
* deciding whether to offer "Open PR". A read with no branch to ask about answers nothing at once.
|
|
92
|
+
*/
|
|
93
|
+
export declare function cachedPrView(cwd: string, branch?: string): Promise<Cached<LinkedPr | undefined>>;
|
|
94
|
+
/** Forget a branch's PR, after an action that changes whether it has one. */
|
|
95
|
+
export declare function forgetPr(cwd: string, branch?: string): void;
|
|
96
|
+
/** The cached form of {@link prsForBranch}, shared through the same read-through cache (#1028). */
|
|
97
|
+
export declare function cachedPrsForBranch(cwd: string, branch: string): Promise<Cached<LinkedPr[]>>;
|
|
98
|
+
/** Forget a branch's PR history, after an action that changes it (opening one). */
|
|
99
|
+
export declare function forgetBranchPrs(cwd: string, branch: string): void;
|
|
100
|
+
/**
|
|
101
|
+
* The PR that belongs to an agent, out of every PR its branch name has had (#1251/#1255).
|
|
102
|
+
*
|
|
103
|
+
* An OPEN PR always counts: a git host allows one open PR per head branch, so whatever is open on the
|
|
104
|
+
* run's branch is where its pushed commits land. A closed one counts only when it was created
|
|
105
|
+
* after the agent started (`since`, the agent's `startedAt`) — the oldest such entry, which is the one
|
|
106
|
+
* this agent's handoff opened. Anything older is a previous agent's PR wearing the same branch name,
|
|
107
|
+
* which is exactly what showed a merged two-day-old PR as a fresh session's own. Without `since`
|
|
108
|
+
* only an open PR is trusted.
|
|
109
|
+
*
|
|
110
|
+
* `order` exists for the one caller asking a different question (#1512). `'first'` answers
|
|
111
|
+
* identity — which PR did *this agent* open, so a later agent's must not be the answer. `'latest'`
|
|
112
|
+
* answers the handoff decision — which PR last saw the branch, so "did the session keep working
|
|
113
|
+
* past it" is readable off that PR's `headRefOid`; there the oldest entry would call work that a
|
|
114
|
+
* second PR already landed unlanded.
|
|
115
|
+
*/
|
|
116
|
+
export declare function pickAgentPr(prs: LinkedPr[], since?: string, order?: 'first' | 'latest'): LinkedPr | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* A project's open PRs, through its git host. Unlike the other reads here it *rejects* when the git host
|
|
119
|
+
* could not answer — no remote, not logged in, the git host unreachable — instead of resolving `[]`.
|
|
120
|
+
*
|
|
121
|
+
* "No PRs are open" and "I could not look" are different answers, and its caller keeps a baseline
|
|
122
|
+
* of what it has already announced (#1623): taking the second for the first makes the next
|
|
123
|
+
* successful read announce every already-open PR as new. The caller decides what a failure costs;
|
|
124
|
+
* it cannot decide what it never hears about. A project with no git host package has none open.
|
|
125
|
+
*/
|
|
126
|
+
export declare function openPrs(cwd: string, gitHost?: GitHostFor): Promise<OpenPr[]>;
|
|
127
|
+
//# sourceMappingURL=pull-requests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pull-requests.d.ts","sourceRoot":"","sources":["../../src/dashboard/pull-requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC3F,OAAO,EAA0B,KAAK,MAAM,EAAE,MAAM,YAAY,CAAA;AAEhE;;;;;;;;;;GAUG;AAEH,qDAAqD;AACrD,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,iHAAiH;IACjH,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,oGAAoG;IACpG,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mFAAmF;IACnF,WAAW,CAAC,E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