@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,110 @@
|
|
|
1
|
+
import { realpath, stat } from 'node:fs/promises';
|
|
2
|
+
import { dirname, join, normalize, sep } from 'node:path';
|
|
3
|
+
import { packageBins, projectPackages, runPackageCommand } from '@openagt/agent-data';
|
|
4
|
+
import { builtInPackages } from './built-in.js';
|
|
5
|
+
/** The file an `exports[key]` entry names: a plain path, or the first of `conditions` it has. */
|
|
6
|
+
function exportedFile(exports, key, conditions) {
|
|
7
|
+
if (!exports || typeof exports !== 'object' || Array.isArray(exports))
|
|
8
|
+
return undefined;
|
|
9
|
+
const entry = exports[key];
|
|
10
|
+
if (typeof entry === 'string')
|
|
11
|
+
return entry;
|
|
12
|
+
if (!entry || typeof entry !== 'object' || Array.isArray(entry))
|
|
13
|
+
return undefined;
|
|
14
|
+
for (const condition of conditions) {
|
|
15
|
+
const target = entry[condition];
|
|
16
|
+
if (typeof target === 'string')
|
|
17
|
+
return target;
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
/** Whether `path` is `dir` itself or inside it; both already normalized. */
|
|
22
|
+
function within(dir, path) {
|
|
23
|
+
return path === dir || path.startsWith(dir + sep);
|
|
24
|
+
}
|
|
25
|
+
/** The file `target` names inside the package at `pkgDir`, symlinks resolved; undefined when it is no file there. */
|
|
26
|
+
async function fileInside(pkgDir, target) {
|
|
27
|
+
if (!target)
|
|
28
|
+
return undefined;
|
|
29
|
+
const file = await realpath(join(pkgDir, target)).catch(() => undefined);
|
|
30
|
+
if (!file || !within(pkgDir, file) || !(await stat(file).then(s => s.isFile()).catch(() => false)))
|
|
31
|
+
return undefined;
|
|
32
|
+
return file;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The modules a project has: each of its dependencies whose package.json exports `./dashboard` to
|
|
36
|
+
* a file that exists inside the package, plus the modules among OpenAgent's built-in packages (`built-in.ts`). A project that
|
|
37
|
+
* depends on a built-in module's package itself gets its own copy. Sorted by name.
|
|
38
|
+
*/
|
|
39
|
+
export async function readProjectModules(root) {
|
|
40
|
+
const modules = [];
|
|
41
|
+
for (const pkg of await projectPackages(root)) {
|
|
42
|
+
const module = await readModule(pkg);
|
|
43
|
+
if (module)
|
|
44
|
+
modules.push(module);
|
|
45
|
+
}
|
|
46
|
+
for (const pkg of await builtInPackages()) {
|
|
47
|
+
if (modules.some(module => module.package === pkg.name))
|
|
48
|
+
continue;
|
|
49
|
+
const module = await readModule(pkg);
|
|
50
|
+
if (module)
|
|
51
|
+
modules.push(module);
|
|
52
|
+
}
|
|
53
|
+
return modules.sort((a, b) => a.package.localeCompare(b.package));
|
|
54
|
+
}
|
|
55
|
+
async function readModule({ name, dir: pkgDir, manifest: pkg }) {
|
|
56
|
+
const file = await fileInside(pkgDir, exportedFile(pkg.exports, './dashboard', ['browser', 'import', 'default']));
|
|
57
|
+
if (!file)
|
|
58
|
+
return undefined;
|
|
59
|
+
const server = await fileInside(pkgDir, exportedFile(pkg.exports, './server', ['node', 'import', 'default']));
|
|
60
|
+
return {
|
|
61
|
+
package: name,
|
|
62
|
+
...(typeof pkg.version === 'string' ? { version: pkg.version } : {}),
|
|
63
|
+
dir: dirname(file),
|
|
64
|
+
entry: file.slice(dirname(file).length + 1),
|
|
65
|
+
bins: packageBins(name, pkg.bin, pkgDir),
|
|
66
|
+
...(server ? { server } : {}),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** The one module of this project that `name` names, or undefined. */
|
|
70
|
+
export async function findProjectModule(root, name) {
|
|
71
|
+
return (await readProjectModules(root)).find(module => module.package === name);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The file a module serves at `rel`, a path relative to its module's directory: its module, its
|
|
75
|
+
* stylesheet, a chunk. `undefined` for a path that leaves that directory (symlinks resolved) or
|
|
76
|
+
* names no file, so nothing else of the package, and nothing of the project, is ever served.
|
|
77
|
+
*/
|
|
78
|
+
export async function moduleFile(module, rel) {
|
|
79
|
+
if (!rel)
|
|
80
|
+
return undefined;
|
|
81
|
+
const candidate = await realpath(normalize(join(module.dir, rel))).catch(() => undefined);
|
|
82
|
+
if (!candidate || !within(module.dir, candidate))
|
|
83
|
+
return undefined;
|
|
84
|
+
return (await stat(candidate).then(s => s.isFile()).catch(() => false)) ? candidate : undefined;
|
|
85
|
+
}
|
|
86
|
+
/** How many arguments, and how long each, a module may pass: a command line, not a payload. */
|
|
87
|
+
const MAX_ARGS = 32;
|
|
88
|
+
const MAX_ARG_LENGTH = 4096;
|
|
89
|
+
/**
|
|
90
|
+
* Run one of a module package's own commands in the project, with the given arguments, and read
|
|
91
|
+
* its standard output as JSON. This is how a module reads its data: the same command an agent runs
|
|
92
|
+
* (`npx logs`), so the module and the agent see the same thing and OpenAgent knows neither.
|
|
93
|
+
*
|
|
94
|
+
* `command` picks one of the package's commands; a package with exactly one needs none. The
|
|
95
|
+
* command runs with Node (a package's commands are Node scripts), in the project root, never
|
|
96
|
+
* through a shell, bounded in time and output. Refused: a command the package does not have, too
|
|
97
|
+
* many or too long arguments. A command that exits non-zero answers its last stderr line; one that
|
|
98
|
+
* prints no JSON says so.
|
|
99
|
+
*/
|
|
100
|
+
export async function runModuleCommand(root, module, args, command) {
|
|
101
|
+
const names = Object.keys(module.bins);
|
|
102
|
+
const name = command ?? (names.length === 1 ? names[0] : undefined);
|
|
103
|
+
const bin = name !== undefined ? module.bins[name] : undefined;
|
|
104
|
+
if (bin === undefined)
|
|
105
|
+
return { ok: false, error: command !== undefined ? `${module.package} has no command ${command}` : `${module.package} has ${names.length === 0 ? 'no command' : 'several commands; name one'}` };
|
|
106
|
+
if (args.length > MAX_ARGS || args.some(arg => typeof arg !== 'string' || arg.length > MAX_ARG_LENGTH))
|
|
107
|
+
return { ok: false, error: 'too many or too long arguments' };
|
|
108
|
+
return runPackageCommand(root, { name: name, bin }, args);
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=project-modules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-modules.js","sourceRoot":"","sources":["../src/project-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;A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AAO,mBAAmB,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,QAAQ,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,4BAA4B,EAAE,EAAE,CAAA;IAClM,IAAI,IAAI,CAAC,MAAM,GAAG,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,GAAG,cAAc,CAAC;QACpG,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,gCAAgC,EAAE,CAAA;IAC/D,OAAO,iBAAiB,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAK,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC,CAAA;AAC5D,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shape every one of the daemon's background passes over the registered projects has (E4):
|
|
3
|
+
* no timer of its own, one turn per `tick()` call from the daemon's single clock, and a `stop()`
|
|
4
|
+
* that takes effect between projects.
|
|
5
|
+
*
|
|
6
|
+
* Two services walk the projects this way — the cloud scratch-ref sweep (#1547) and cloud work
|
|
7
|
+
* adoption (#1601). They differ only in what they do to one project; the walking, the overlap
|
|
8
|
+
* rule and the stop flag are written out once here.
|
|
9
|
+
*/
|
|
10
|
+
/** A running background pass, in the shape the daemon's services are wired as. */
|
|
11
|
+
export interface ProjectPass {
|
|
12
|
+
/** Run one pass now, awaiting it. Exposed for tests and for a caller that wants it on demand. */
|
|
13
|
+
tick: () => Promise<void>;
|
|
14
|
+
stop: () => void;
|
|
15
|
+
}
|
|
16
|
+
/** The registered projects a pass walks, as the daemon hands them over. */
|
|
17
|
+
export type ProjectsSource = () => Promise<readonly {
|
|
18
|
+
path: string;
|
|
19
|
+
}[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Walk every registered project once per `tick()`, calling `visit` with each project's path.
|
|
22
|
+
*
|
|
23
|
+
* Overlapping ticks join the pass already running rather than being dropped: awaiting `tick()`
|
|
24
|
+
* has to mean the pass finished, or an on-demand caller (and a test) gets a silent no-op whenever
|
|
25
|
+
* the clock's turn happens to be mid-flight. A stopped pass ticks as a no-op, and a `stop()`
|
|
26
|
+
* during a pass takes effect before the next project rather than mid-project.
|
|
27
|
+
*
|
|
28
|
+
* A `projects()` that rejects yields nothing to walk: a registry that cannot be read is this
|
|
29
|
+
* turn's problem, not the daemon's, and the next tick tries again.
|
|
30
|
+
*/
|
|
31
|
+
export declare function startProjectPass(projects: ProjectsSource, visit: (cwd: string) => Promise<void>): ProjectPass;
|
|
32
|
+
//# sourceMappingURL=project-pass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-pass.d.ts","sourceRoot":"","sources":["../src/project-pass.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,kFAAkF;AAClF,MAAM,WAAW,WAAW;IAC1B,iGAAiG;IACjG,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACzB,IAAI,EAAE,MAAM,IAAI,CAAA;CACjB;AAED,2EAA2E;AAC3E,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,CAAA;AAEvE;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,WAAW,CAuB7G"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shape every one of the daemon's background passes over the registered projects has (E4):
|
|
3
|
+
* no timer of its own, one turn per `tick()` call from the daemon's single clock, and a `stop()`
|
|
4
|
+
* that takes effect between projects.
|
|
5
|
+
*
|
|
6
|
+
* Two services walk the projects this way — the cloud scratch-ref sweep (#1547) and cloud work
|
|
7
|
+
* adoption (#1601). They differ only in what they do to one project; the walking, the overlap
|
|
8
|
+
* rule and the stop flag are written out once here.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Walk every registered project once per `tick()`, calling `visit` with each project's path.
|
|
12
|
+
*
|
|
13
|
+
* Overlapping ticks join the pass already running rather than being dropped: awaiting `tick()`
|
|
14
|
+
* has to mean the pass finished, or an on-demand caller (and a test) gets a silent no-op whenever
|
|
15
|
+
* the clock's turn happens to be mid-flight. A stopped pass ticks as a no-op, and a `stop()`
|
|
16
|
+
* during a pass takes effect before the next project rather than mid-project.
|
|
17
|
+
*
|
|
18
|
+
* A `projects()` that rejects yields nothing to walk: a registry that cannot be read is this
|
|
19
|
+
* turn's problem, not the daemon's, and the next tick tries again.
|
|
20
|
+
*/
|
|
21
|
+
export function startProjectPass(projects, visit) {
|
|
22
|
+
let stopped = false;
|
|
23
|
+
let inflight;
|
|
24
|
+
const passAll = async () => {
|
|
25
|
+
for (const project of await projects().catch(() => [])) {
|
|
26
|
+
if (stopped)
|
|
27
|
+
break;
|
|
28
|
+
await visit(project.path);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
tick: () => {
|
|
33
|
+
if (stopped)
|
|
34
|
+
return Promise.resolve();
|
|
35
|
+
inflight ??= passAll().finally(() => {
|
|
36
|
+
inflight = undefined;
|
|
37
|
+
});
|
|
38
|
+
return inflight;
|
|
39
|
+
},
|
|
40
|
+
stop: () => {
|
|
41
|
+
stopped = true;
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=project-pass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-pass.js","sourceRoot":"","sources":["../src/project-pass.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAwB,EAAE,KAAqC;IAC9F,IAAI,OAAO,GAAG,KAAK,CAAA;IACnB,IAAI,QAAmC,CAAA;IAEvC,MAAM,OAAO,GAAG,KAAK,IAAmB,EAAE;QACxC,KAAK,MAAM,OAAO,IAAI,MAAM,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;YACvD,IAAI,OAAO;gBAAE,MAAK;YAClB,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAC3B,CAAC;IACH,CAAC,CAAA;IAED,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,IAAI,OAAO;gBAAE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;YACrC,QAAQ,KAAK,OAAO,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE;gBAClC,QAAQ,GAAG,SAAS,CAAA;YACtB,CAAC,CAAC,CAAA;YACF,OAAO,QAAQ,CAAA;QACjB,CAAC;QACD,IAAI,EAAE,GAAG,EAAE;YACT,OAAO,GAAG,IAAI,CAAA;QAChB,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type CustomPreset } from './registry.js';
|
|
2
|
+
import { type StoreFs } from './store/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Project-scoped custom presets (#1025).
|
|
5
|
+
*
|
|
6
|
+
* The user tier (#626) saves a custom preset to the user's home file, so it follows the person
|
|
7
|
+
* across every project and stays private. The project tier saves it into the repo instead, so it
|
|
8
|
+
* travels with the code and everyone who clones the repo gets it — the "share your presets" half
|
|
9
|
+
* of the issue.
|
|
10
|
+
*
|
|
11
|
+
* The store is a plain JSON array of {@link CustomPreset}, the exact shape the user tier uses, so
|
|
12
|
+
* the dashboard renders both from one type and the same sanitizer guards both files.
|
|
13
|
+
*/
|
|
14
|
+
/** The committed file holding a project's shared custom presets, under `.openagent/`. */
|
|
15
|
+
export declare const PROJECT_PRESETS_FILE = ".openagent/custom-presets.json";
|
|
16
|
+
/**
|
|
17
|
+
* Read a project's shared custom presets. Forgiving like every other read here: a missing,
|
|
18
|
+
* unreadable or malformed file yields `[]`, never throws, and the same sanitizer that guards
|
|
19
|
+
* the home file drops any hand-edited or hostile entry.
|
|
20
|
+
*/
|
|
21
|
+
export declare function readProjectPresets(cwd: string, fs?: StoreFs): Promise<CustomPreset[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Write a project's shared custom presets, sanitizing first so the committed file is always
|
|
24
|
+
* well-formed. Also ensures `.openagent/.gitignore` un-ignores the file: the dir's ignore is
|
|
25
|
+
* `*` (nothing is tracked by default), so without a negation git would
|
|
26
|
+
* never see the presets and they could not be shared. Removing every preset writes an empty array
|
|
27
|
+
* rather than deleting the file, so the negation stays in place for the next save.
|
|
28
|
+
*/
|
|
29
|
+
export declare function writeProjectPresets(cwd: string, presets: CustomPreset[], fs?: StoreFs): Promise<void>;
|
|
30
|
+
//# sourceMappingURL=project-presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-presets.d.ts","sourceRoot":"","sources":["../src/project-presets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyB,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE5D;;;;;;;;;;GAUG;AAEH,yFAAyF;AACzF,eAAO,MAAM,oBAAoB,mCAAyC,CAAA;AAS1E;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,MAAM,EACX,EAAE,GAAE,OAAuB,GAC1B,OAAO,CAAC,YAAY,EAAE,CAAC,CAczB;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,YAAY,EAAE,EACvB,EAAE,GAAE,OAAuB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAKf"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { OPENAGENT_DIR } from './openagent-dir.js';
|
|
3
|
+
import { sanitizeCustomPresets } from './registry.js';
|
|
4
|
+
import { nodeStoreFs } from './store/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Project-scoped custom presets (#1025).
|
|
7
|
+
*
|
|
8
|
+
* The user tier (#626) saves a custom preset to the user's home file, so it follows the person
|
|
9
|
+
* across every project and stays private. The project tier saves it into the repo instead, so it
|
|
10
|
+
* travels with the code and everyone who clones the repo gets it — the "share your presets" half
|
|
11
|
+
* of the issue.
|
|
12
|
+
*
|
|
13
|
+
* The store is a plain JSON array of {@link CustomPreset}, the exact shape the user tier uses, so
|
|
14
|
+
* the dashboard renders both from one type and the same sanitizer guards both files.
|
|
15
|
+
*/
|
|
16
|
+
/** The committed file holding a project's shared custom presets, under `.openagent/`. */
|
|
17
|
+
export const PROJECT_PRESETS_FILE = `${OPENAGENT_DIR}/custom-presets.json`;
|
|
18
|
+
/** The `.openagent/.gitignore` line that un-ignores the presets file so git tracks it. */
|
|
19
|
+
const GITIGNORE_NEGATION = '!custom-presets.json';
|
|
20
|
+
function gitignorePath(cwd) {
|
|
21
|
+
return join(cwd, OPENAGENT_DIR, '.gitignore');
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Read a project's shared custom presets. Forgiving like every other read here: a missing,
|
|
25
|
+
* unreadable or malformed file yields `[]`, never throws, and the same sanitizer that guards
|
|
26
|
+
* the home file drops any hand-edited or hostile entry.
|
|
27
|
+
*/
|
|
28
|
+
export async function readProjectPresets(cwd, fs = nodeStoreFs()) {
|
|
29
|
+
let raw;
|
|
30
|
+
try {
|
|
31
|
+
raw = await fs.read(join(cwd, PROJECT_PRESETS_FILE));
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
let parsed;
|
|
37
|
+
try {
|
|
38
|
+
parsed = JSON.parse(raw);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
return sanitizeCustomPresets(parsed);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Write a project's shared custom presets, sanitizing first so the committed file is always
|
|
47
|
+
* well-formed. Also ensures `.openagent/.gitignore` un-ignores the file: the dir's ignore is
|
|
48
|
+
* `*` (nothing is tracked by default), so without a negation git would
|
|
49
|
+
* never see the presets and they could not be shared. Removing every preset writes an empty array
|
|
50
|
+
* rather than deleting the file, so the negation stays in place for the next save.
|
|
51
|
+
*/
|
|
52
|
+
export async function writeProjectPresets(cwd, presets, fs = nodeStoreFs()) {
|
|
53
|
+
await fs.mkdir(join(cwd, OPENAGENT_DIR));
|
|
54
|
+
await ensureGitignoreNegation(cwd, fs);
|
|
55
|
+
const sanitized = sanitizeCustomPresets(presets);
|
|
56
|
+
await fs.write(join(cwd, PROJECT_PRESETS_FILE), `${JSON.stringify(sanitized, null, 2)}\n`);
|
|
57
|
+
}
|
|
58
|
+
/** Append the un-ignore line to `.openagent/.gitignore` unless it is already there. */
|
|
59
|
+
async function ensureGitignoreNegation(cwd, fs) {
|
|
60
|
+
const path = gitignorePath(cwd);
|
|
61
|
+
let current = '';
|
|
62
|
+
try {
|
|
63
|
+
current = await fs.read(path);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
// No .gitignore yet (a pre-install dir): the negation only bites once the `*` ignore exists,
|
|
67
|
+
// so writing a bare negation is harmless and self-heals when install adds the rest.
|
|
68
|
+
}
|
|
69
|
+
if (current.split('\n').some(line => line.trim() === GITIGNORE_NEGATION))
|
|
70
|
+
return;
|
|
71
|
+
const prefix = current && !current.endsWith('\n') ? `${current}\n` : current;
|
|
72
|
+
await fs.write(path, `${prefix}${GITIGNORE_NEGATION}\n`);
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=project-presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-presets.js","sourceRoot":"","sources":["../src/project-presets.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,EAAE,EAAE,CAAC,CAAA;IACtC,MAAM,SAAS,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAA;IAChD,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,oBAAoB,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAA;AAC5F,CAAC;AAED,uFAAuF;AACvF,KAAK,UAAU,uBAAuB,CAAC,GAAW,EAAE,EAAW;IAC7D,MAAM,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;IAC/B,IAAI,OAAO,GAAG,EAAE,CAAA;IAChB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,6FAA6F;QAC7F,oFAAoF;IACtF,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,kBAAkB,CAAC;QAAE,OAAM;IAChF,MAAM,MAAM,GAAG,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAA;IAC5E,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,MAAM,GAAG,kBAAkB,IAAI,CAAC,CAAA;AAC1D,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type GitRunner } from '@openagt/agent-data';
|
|
2
|
+
/**
|
|
3
|
+
* Project-level repo helpers (#380): the activation marker check and a
|
|
4
|
+
* `git ls-files` crawl. Read-only
|
|
5
|
+
* building blocks for the sidebars (#314); activation/install (writing the
|
|
6
|
+
* marker) is a separate, deferred concern.
|
|
7
|
+
*/
|
|
8
|
+
/** Minimal fs seam so activation is unit-testable without touching disk. */
|
|
9
|
+
export interface ProjectFs {
|
|
10
|
+
/** True when `path` exists AND is a file. */
|
|
11
|
+
exists(path: string): Promise<boolean>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A repo is "activated"/installed for OpenAgent when it has the
|
|
15
|
+
* `.openagent/.gitignore` install writes — the same marker install's own
|
|
16
|
+
* no-op check reads (#1600), so a `.openagent/` directory something else
|
|
17
|
+
* created can never read as activated while the repo still lacks the ignore
|
|
18
|
+
* file that keeps OpenAgent state out of git. Read-only check; writing
|
|
19
|
+
* the marker is a separate, deferred concern.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isActivated(cwd: string, fs?: ProjectFs): Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* List every file git sees in the repo at `cwd`: tracked + untracked, honoring
|
|
24
|
+
* .gitignore. Uses `git ls-files -z --cached --others --exclude-standard` (the
|
|
25
|
+
* same approach Vike uses). Returns repo-relative paths, deduped and sorted.
|
|
26
|
+
* Forgiving: a non-repo / missing git / any failure yields `[]`, never throws.
|
|
27
|
+
*/
|
|
28
|
+
export declare function crawlRepoFiles(cwd: string, agent?: GitRunner): Promise<string[]>;
|
|
29
|
+
//# sourceMappingURL=project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAInE;;;;;GAKG;AAEH,4EAA4E;AAC5E,MAAM,WAAW,SAAS;IACxB,6CAA6C;IAC7C,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACvC;AAQD;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,GAAE,SAA2B,GAAG,OAAO,CAAC,OAAO,CAAC,CAEhG;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,GAAE,SAA2B,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAYvG"}
|
package/dist/project.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { nodeGitRunner } from '@openagt/agent-data';
|
|
2
|
+
import { nodeFs } from './node-fs.js';
|
|
3
|
+
import { gitignorePath } from './openagent-gitignore.js';
|
|
4
|
+
/** A {@link ProjectFs} backed by `node:fs/promises`. See {@link nodeFs}. */
|
|
5
|
+
function nodeProjectFs() {
|
|
6
|
+
const { exists } = nodeFs();
|
|
7
|
+
return { exists };
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A repo is "activated"/installed for OpenAgent when it has the
|
|
11
|
+
* `.openagent/.gitignore` install writes — the same marker install's own
|
|
12
|
+
* no-op check reads (#1600), so a `.openagent/` directory something else
|
|
13
|
+
* created can never read as activated while the repo still lacks the ignore
|
|
14
|
+
* file that keeps OpenAgent state out of git. Read-only check; writing
|
|
15
|
+
* the marker is a separate, deferred concern.
|
|
16
|
+
*/
|
|
17
|
+
export async function isActivated(cwd, fs = nodeProjectFs()) {
|
|
18
|
+
return fs.exists(gitignorePath(cwd));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* List every file git sees in the repo at `cwd`: tracked + untracked, honoring
|
|
22
|
+
* .gitignore. Uses `git ls-files -z --cached --others --exclude-standard` (the
|
|
23
|
+
* same approach Vike uses). Returns repo-relative paths, deduped and sorted.
|
|
24
|
+
* Forgiving: a non-repo / missing git / any failure yields `[]`, never throws.
|
|
25
|
+
*/
|
|
26
|
+
export async function crawlRepoFiles(cwd, agent = nodeGitRunner()) {
|
|
27
|
+
try {
|
|
28
|
+
const out = await agent(['ls-files', '-z', '--cached', '--others', '--exclude-standard'], cwd);
|
|
29
|
+
const files = new Set();
|
|
30
|
+
for (const entry of out.split('\0')) {
|
|
31
|
+
const trimmed = entry.trim();
|
|
32
|
+
if (trimmed)
|
|
33
|
+
files.add(trimmed);
|
|
34
|
+
}
|
|
35
|
+
return [...files].sort();
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,qBAAqB,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAexD,4EAA4E;AAC5E,SAAS,aAAa;IACpB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAA;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAA;AACnB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,GAAW,EAAE,EAAE,GAAc,aAAa,EAAE;IAC5E,OAAO,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAA;AACtC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAW,EAAE,KAAK,GAAc,aAAa,EAAE;IAClF,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,oBAAoB,CAAC,EAAE,GAAG,CAAC,CAAA;QAC9F,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAA;QAC/B,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;YAC5B,IAAI,OAAO;gBAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACjC,CAAC;QACD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAA;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How far a run takes its work when its agent finishes, node-free so every surface shares
|
|
3
|
+
* one copy: the registry's preference sanitizer, the daemon's Start and the dashboard bundle.
|
|
4
|
+
* The levels are the words a project's start hook is handed as `PUBLISH`, the ones
|
|
5
|
+
* `agent-runner run --publish` takes. The launcher's menu offers them after "Nothing", the pick
|
|
6
|
+
* that hands the hook no level: the run then commits and publishes nothing unless its prompt asks.
|
|
7
|
+
* Until a person picks, a run commits its work and pushes nothing: what leaves the machine is the
|
|
8
|
+
* person's to ask for.
|
|
9
|
+
*/
|
|
10
|
+
/** The levels a run can be started at, each going further than the one before. */
|
|
11
|
+
export declare const PUBLISH_LEVELS: readonly ['commit', 'branch', 'pr', 'merge'];
|
|
12
|
+
/** A level: commit the work, and from there push the branch, open its pull request, or open it set to merge once its checks pass. */
|
|
13
|
+
export type PublishLevel = (typeof PUBLISH_LEVELS)[number];
|
|
14
|
+
/** What the launcher's menu lists, in its order: nothing, then each level. */
|
|
15
|
+
export declare const PUBLISH_PICKS: readonly ["nothing", "commit", "branch", "pr", "merge"];
|
|
16
|
+
/** A pick of the launcher's menu. */
|
|
17
|
+
export type PublishPick = (typeof PUBLISH_PICKS)[number];
|
|
18
|
+
export declare const PUBLISH_LABELS: Readonly<Record<PublishPick, string>>;
|
|
19
|
+
export declare function isPublishPick(value: unknown): value is PublishPick;
|
|
20
|
+
/**
|
|
21
|
+
* The picks a project is offered: every one where it has a git host; without a git host no pull
|
|
22
|
+
* request can be opened, so the picks stop at the branch; without a remote nothing can be
|
|
23
|
+
* published at all, so they stop at the commit.
|
|
24
|
+
*/
|
|
25
|
+
export declare function offeredPublishPicks(gitHost: boolean, remote?: boolean): readonly PublishPick[];
|
|
26
|
+
/**
|
|
27
|
+
* The pick in force in this project. Until a person saves one it is Commit, which pushes nothing.
|
|
28
|
+
* A saved pick the project is not offered falls back to the furthest it goes with no pull request.
|
|
29
|
+
*/
|
|
30
|
+
export declare function publishPickIn(saved: PublishPick | undefined, gitHost: boolean, remote?: boolean): PublishPick;
|
|
31
|
+
/** The level a pick hands the start hook; none for Nothing. */
|
|
32
|
+
export declare function publishLevelOf(pick: PublishPick): PublishLevel | undefined;
|
|
33
|
+
//# sourceMappingURL=publish-levels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-levels.d.ts","sourceRoot":"","sources":["../src/publish-levels.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,kFAAkF;AAClF,eAAO,MAAM,cAAc,YAAI,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAU,CAAA;AAE1E,qIAAqI;AACrI,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAE1D,8EAA8E;AAC9E,eAAO,MAAM,aAAa,yDAA0C,CAAA;AAEpE,qCAAqC;AACrC,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA;AAExD,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAMhE,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAO,GAAG,SAAS,WAAW,EAAE,CAG3F;AAOD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAO,GAAG,WAAW,CAI1G;AAED,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,YAAY,GAAG,SAAS,CAE1E"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How far a run takes its work when its agent finishes, node-free so every surface shares
|
|
3
|
+
* one copy: the registry's preference sanitizer, the daemon's Start and the dashboard bundle.
|
|
4
|
+
* The levels are the words a project's start hook is handed as `PUBLISH`, the ones
|
|
5
|
+
* `agent-runner run --publish` takes. The launcher's menu offers them after "Nothing", the pick
|
|
6
|
+
* that hands the hook no level: the run then commits and publishes nothing unless its prompt asks.
|
|
7
|
+
* Until a person picks, a run commits its work and pushes nothing: what leaves the machine is the
|
|
8
|
+
* person's to ask for.
|
|
9
|
+
*/
|
|
10
|
+
/** The levels a run can be started at, each going further than the one before. */
|
|
11
|
+
export const PUBLISH_LEVELS = ['commit', 'branch', 'pr', 'merge'];
|
|
12
|
+
/** What the launcher's menu lists, in its order: nothing, then each level. */
|
|
13
|
+
export const PUBLISH_PICKS = ['nothing', ...PUBLISH_LEVELS];
|
|
14
|
+
export const PUBLISH_LABELS = {
|
|
15
|
+
nothing: 'Nothing',
|
|
16
|
+
commit: 'Commit',
|
|
17
|
+
branch: 'Publish branch',
|
|
18
|
+
pr: 'Open PR',
|
|
19
|
+
merge: 'Merge on green',
|
|
20
|
+
};
|
|
21
|
+
export function isPublishPick(value) {
|
|
22
|
+
return PUBLISH_PICKS.includes(value);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The picks a project is offered: every one where it has a git host; without a git host no pull
|
|
26
|
+
* request can be opened, so the picks stop at the branch; without a remote nothing can be
|
|
27
|
+
* published at all, so they stop at the commit.
|
|
28
|
+
*/
|
|
29
|
+
export function offeredPublishPicks(gitHost, remote = true) {
|
|
30
|
+
if (!remote)
|
|
31
|
+
return ['nothing', 'commit'];
|
|
32
|
+
return gitHost ? PUBLISH_PICKS : ['nothing', 'commit', 'branch'];
|
|
33
|
+
}
|
|
34
|
+
/** The furthest a project's run goes with no pull request: its branch pushed, or its work committed where there is no remote. */
|
|
35
|
+
function furthestWithoutRequest(remote) {
|
|
36
|
+
return remote ? 'branch' : 'commit';
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The pick in force in this project. Until a person saves one it is Commit, which pushes nothing.
|
|
40
|
+
* A saved pick the project is not offered falls back to the furthest it goes with no pull request.
|
|
41
|
+
*/
|
|
42
|
+
export function publishPickIn(saved, gitHost, remote = true) {
|
|
43
|
+
if (saved === undefined)
|
|
44
|
+
return 'commit';
|
|
45
|
+
if (offeredPublishPicks(gitHost, remote).includes(saved))
|
|
46
|
+
return saved;
|
|
47
|
+
return furthestWithoutRequest(remote);
|
|
48
|
+
}
|
|
49
|
+
/** The level a pick hands the start hook; none for Nothing. */
|
|
50
|
+
export function publishLevelOf(pick) {
|
|
51
|
+
return pick === 'nothing' ? undefined : pick;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=publish-levels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-levels.js","sourceRoot":"","sources":["../src/publish-levels.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,kFAAkF;AAClF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAU,CAAA;AAK1E,8EAA8E;AAC9E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,GAAG,cAAc,CAAU,CAAA;AAKpE,MAAM,CAAC,MAAM,cAAc,GAA0C;IACnE,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,gBAAgB;IACxB,EAAE,EAAE,SAAS;IACb,KAAK,EAAE,gBAAgB;CACxB,CAAA;AAED,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAQ,aAAoC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC9D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAgB,EAAE,MAAM,GAAG,IAAI;IACjE,IAAI,CAAC,MAAM;QAAE,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IACzC,OAAO,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;AAClE,CAAC;AAED,iIAAiI;AACjI,SAAS,sBAAsB,CAAC,MAAe;IAC7C,OAAO,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAA;AACrC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,KAA8B,EAAE,OAAgB,EAAE,MAAM,GAAG,IAAI;IAC3F,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAA;IACxC,IAAI,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IACtE,OAAO,sBAAsB,CAAC,MAAM,CAAC,CAAA;AACvC,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,cAAc,CAAC,IAAiB;IAC9C,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA;AAC9C,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The quota boundary (#879): how much of the account's week OpenAgent may
|
|
3
|
+
* have spent by now.
|
|
4
|
+
*
|
|
5
|
+
* The whole policy is one line — the boundary is the pro-rated share of the week's allowance that
|
|
6
|
+
* has elapsed, rising continuously with the clock rather than once a day (#960 Edit) — and it
|
|
7
|
+
* replaces the configurable limits of #519. There is nothing to configure: the boundary is derived
|
|
8
|
+
* from the account's own week, which the agent reports.
|
|
9
|
+
*
|
|
10
|
+
* Nothing is left on the floor: the boundary rises on its own and reaches the full allowance
|
|
11
|
+
* exactly as the week resets, so a quiet week still gets spent rather than expiring.
|
|
12
|
+
*
|
|
13
|
+
* OpenAgent only draws it. Whether work stops at it, or how far past it, is the business of
|
|
14
|
+
* whatever starts unattended work, which puts its own stop line on the usage bar.
|
|
15
|
+
*/
|
|
16
|
+
import type { DriverQuotaWindow } from '@openagt/agent-driver';
|
|
17
|
+
/** The quota week, in ms. */
|
|
18
|
+
export declare const QUOTA_WEEK_MS: number;
|
|
19
|
+
/** Where the boundary sits, and the week it is derived from. */
|
|
20
|
+
export interface QuotaBoundary {
|
|
21
|
+
/** When the current quota week began, epoch ms. */
|
|
22
|
+
startsAt: number;
|
|
23
|
+
/** When it resets, epoch ms. */
|
|
24
|
+
resetsAt: number;
|
|
25
|
+
/** Which day of the week we are on, 1-7. */
|
|
26
|
+
day: number;
|
|
27
|
+
/** The share of the week's allowance that may be spent by now, 0-100. */
|
|
28
|
+
percent: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Parse the agent's reset prose into an epoch.
|
|
32
|
+
*
|
|
33
|
+
* The agent prints no year (`Jul 25 at 7am (Asia/Jerusalem)`), which is why the
|
|
34
|
+
* driver keeps this as text. It is recoverable here because we know something
|
|
35
|
+
* the driver does not: a *weekly* window resets within seven days, so of the
|
|
36
|
+
* candidate years exactly one lands anywhere near now.
|
|
37
|
+
*
|
|
38
|
+
* `undefined` for anything that does not parse, which the callers treat as "we
|
|
39
|
+
* do not know where the week is" rather than as a boundary of zero.
|
|
40
|
+
*/
|
|
41
|
+
export declare function parseResetsAt(text: string, now: number): number | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Where the boundary sits, given when the week resets.
|
|
44
|
+
*
|
|
45
|
+
* `percent` is continuous — the plain elapsed share of the week (#960 Edit) — rather than a value
|
|
46
|
+
* that jumps once a day, so it always names the actual instant `now` falls on, on any axis that
|
|
47
|
+
* measures the week the same way. A stepped version once unlocked a whole day's allowance the
|
|
48
|
+
* moment a new day began (including the entire week's worth on the last day), which read as
|
|
49
|
+
* generous on paper but let a burst of spending land the instant the clock ticked over rather than
|
|
50
|
+
* pacing with it; continuous keeps the line honest about what has actually elapsed at the cost of
|
|
51
|
+
* that burst.
|
|
52
|
+
*
|
|
53
|
+
* `day` is 1-based and still names which day of the week `now` falls on — for callers that want to
|
|
54
|
+
* say "day 4 of 7" rather than a percentage — and steps at the exact second the week's own day
|
|
55
|
+
* rolls over, independently of `percent`.
|
|
56
|
+
*/
|
|
57
|
+
export declare function boundaryFromResetsAt(resetsAt: number, now: number): QuotaBoundary;
|
|
58
|
+
/**
|
|
59
|
+
* Where the boundary sits for the account's own week, as the agent reported it (#879).
|
|
60
|
+
*
|
|
61
|
+
* `undefined` when there is no reading of the week, or when its reset cannot be placed. That is
|
|
62
|
+
* "we do not know", never a boundary of zero.
|
|
63
|
+
*/
|
|
64
|
+
export declare function weekBoundary(windows: readonly DriverQuotaWindow[], now: number): QuotaBoundary | undefined;
|
|
65
|
+
//# sourceMappingURL=quota-boundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quota-boundary.d.ts","sourceRoot":"","sources":["../src/quota-boundary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAE9D,6BAA6B;AAC7B,eAAO,MAAM,aAAa,QAA0B,CAAA;AAQpD,gEAAgE;AAChE,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAA;IAChB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,4CAA4C;IAC5C,GAAG,EAAE,MAAM,CAAA;IACX,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAA;CAChB;AAuCD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA6B3E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,CAKjF;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAK1G"}
|