@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,31 @@
|
|
|
1
|
+
import { type GitRunner } from '@openagt/agent-data';
|
|
2
|
+
import { type StoreFs } from './store/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Install/activate a repo for OpenAgent (#391): create the `.openagent/` marker and its
|
|
5
|
+
* ignore file. Nothing is committed on a branch that has a commit. Pure core over the same
|
|
6
|
+
* {@link GitRunner} + {@link StoreFs} seams as project.ts.
|
|
7
|
+
*/
|
|
8
|
+
/** The message of the empty commit an install gives a repository that has none. */
|
|
9
|
+
export declare const FIRST_COMMIT_MESSAGE = "[OpenAgent] first commit";
|
|
10
|
+
/** The outcome of {@link installProject}. Failures are values, never throws. */
|
|
11
|
+
export type InstallResult = {
|
|
12
|
+
ok: true;
|
|
13
|
+
alreadyActivated?: boolean;
|
|
14
|
+
initialized?: boolean;
|
|
15
|
+
} | {
|
|
16
|
+
ok: false;
|
|
17
|
+
error: string;
|
|
18
|
+
};
|
|
19
|
+
/** Injectable seams for {@link installProject}. */
|
|
20
|
+
export interface InstallDeps {
|
|
21
|
+
git?: GitRunner;
|
|
22
|
+
fs?: StoreFs;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Activate the repo at `cwd`: create `.openagent/` with its ignore file, which hides the whole
|
|
26
|
+
* directory from git, itself included, so the person's repository shows no change. A repo whose
|
|
27
|
+
* ignore file is already there is a no-op (`alreadyActivated`) — the ignore file is the
|
|
28
|
+
* activation marker. Forgiving: any git/fs failure surfaces as `{ ok: false, error }`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function installProject(cwd: string, deps?: InstallDeps): Promise<InstallResult>;
|
|
31
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAGnE,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAG5D;;;;GAIG;AAEH,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,6BAA6B,CAAA;AAK9D,gFAAgF;AAChF,MAAM,MAAM,aAAa,GACrB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GAC/D;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAEhC,mDAAmD;AACnD,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,SAAS,CAAA;IACf,EAAE,CAAC,EAAE,OAAO,CAAA;CACb;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,aAAa,CAAC,CAgChG"}
|
package/dist/install.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { nodeGitRunner } from '@openagt/agent-data';
|
|
3
|
+
import { OPENAGENT_DIR } from './openagent-dir.js';
|
|
4
|
+
import { openagentGitignore, gitignorePath } from './openagent-gitignore.js';
|
|
5
|
+
import { nodeStoreFs } from './store/index.js';
|
|
6
|
+
import { errorMessage } from './error-message.js';
|
|
7
|
+
/**
|
|
8
|
+
* Install/activate a repo for OpenAgent (#391): create the `.openagent/` marker and its
|
|
9
|
+
* ignore file. Nothing is committed on a branch that has a commit. Pure core over the same
|
|
10
|
+
* {@link GitRunner} + {@link StoreFs} seams as project.ts.
|
|
11
|
+
*/
|
|
12
|
+
/** The message of the empty commit an install gives a repository that has none. */
|
|
13
|
+
export const FIRST_COMMIT_MESSAGE = '[OpenAgent] first commit';
|
|
14
|
+
/** Git's tree with no file in it. */
|
|
15
|
+
const EMPTY_TREE = '4b825dc642cb6eb9a060e54bf8d69288fbee4904';
|
|
16
|
+
/**
|
|
17
|
+
* Activate the repo at `cwd`: create `.openagent/` with its ignore file, which hides the whole
|
|
18
|
+
* directory from git, itself included, so the person's repository shows no change. A repo whose
|
|
19
|
+
* ignore file is already there is a no-op (`alreadyActivated`) — the ignore file is the
|
|
20
|
+
* activation marker. Forgiving: any git/fs failure surfaces as `{ ok: false, error }`.
|
|
21
|
+
*/
|
|
22
|
+
export async function installProject(cwd, deps = {}) {
|
|
23
|
+
const git = deps.git ?? nodeGitRunner();
|
|
24
|
+
const fs = deps.fs ?? nodeStoreFs();
|
|
25
|
+
if (await fs.exists(gitignorePath(cwd)))
|
|
26
|
+
return { ok: true, alreadyActivated: true };
|
|
27
|
+
try {
|
|
28
|
+
// Auto-initialize a repo when the folder isn't one yet: OpenAgent treats
|
|
29
|
+
// git as the source of truth, so `git init` it for the user rather than erroring.
|
|
30
|
+
const insideRepo = await git(['rev-parse', '--is-inside-work-tree'], cwd)
|
|
31
|
+
.then(out => out.trim() === 'true')
|
|
32
|
+
.catch(() => false);
|
|
33
|
+
if (!insideRepo)
|
|
34
|
+
await git(['init'], cwd);
|
|
35
|
+
// A repository with no commit cannot give an agent's branch a start. Its first commit is
|
|
36
|
+
// made empty, straight from the empty tree: the index is not read, so a file the person has
|
|
37
|
+
// staged stays staged and none of theirs is committed. Before the marker below, so a commit
|
|
38
|
+
// that fails leaves a folder the next add tries again.
|
|
39
|
+
const hasCommit = await git(['rev-parse', '--verify', '--quiet', 'HEAD'], cwd).then(() => true, () => false);
|
|
40
|
+
if (!hasCommit) {
|
|
41
|
+
const first = (await git(['commit-tree', EMPTY_TREE, '-m', FIRST_COMMIT_MESSAGE], cwd)).trim();
|
|
42
|
+
await git(['update-ref', 'HEAD', first], cwd);
|
|
43
|
+
}
|
|
44
|
+
await fs.mkdir(join(cwd, OPENAGENT_DIR));
|
|
45
|
+
// Keep what lives under `.openagent/` (a run's live files, the hooks file) out of git
|
|
46
|
+
// (#313). The early return above established the file is absent.
|
|
47
|
+
await fs.write(gitignorePath(cwd), openagentGitignore());
|
|
48
|
+
return insideRepo ? { ok: true } : { ok: true, initialized: true };
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
return { ok: false, error: errorMessage(err) };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,aAAa,EAAkB,MAAM,qBAAqB,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC5E,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD;;;;GAIG;AAEH,mFAAmF;AACnF,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,CAAA;AAE9D,qCAAqC;AACrC,MAAM,UAAU,GAAG,0CAA0C,CAAA;AAa7D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAW,EAAE,IAAI,GAAgB,EAAE;IACtE,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,aAAa,EAAE,CAAA;IACvC,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,WAAW,EAAE,CAAA;IAEnC,IAAI,MAAM,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAA;IAEpF,IAAI,CAAC;QACH,yEAAyE;QACzE,kFAAkF;QAClF,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,CAAC,WAAW,EAAE,uBAAuB,CAAC,EAAE,GAAG,CAAC;aACtE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,MAAM,CAAC;aAClC,KAAK,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
|
|
2
|
+
* Tails an append-only JSONL log, calling `onLine` for each complete line as it
|
|
3
|
+
* is written. Reads only the bytes appended since the last {@link pull},
|
|
4
|
+
* buffering a torn trailing line until its newline arrives. A file that shrinks
|
|
5
|
+
* (a fresh agent truncated the log) resets to the start so the new content is
|
|
6
|
+
* picked up. The generic base behind the daemon's event tail and the agent's
|
|
7
|
+
* control tail (#344) — one tailer, two directions.
|
|
8
|
+
*/
|
|
9
|
+
export declare class JsonlTailer<T> {
|
|
10
|
+
private path;
|
|
11
|
+
private readonly onLine;
|
|
12
|
+
/** Told when the log is found rewritten, before its lines are read again from the top. */
|
|
13
|
+
private readonly onReset?;
|
|
14
|
+
private offset;
|
|
15
|
+
private partial;
|
|
16
|
+
private lastMtimeMs;
|
|
17
|
+
private adoptMtime;
|
|
18
|
+
constructor(path: string, onLine: (value: T) => void,
|
|
19
|
+
/** Told when the log is found rewritten, before its lines are read again from the top. */
|
|
20
|
+
onReset?: (() => void) | undefined);
|
|
21
|
+
/**
|
|
22
|
+
* Point the tailer at the log's new home, keeping the read offset. For a log that is
|
|
23
|
+
* *relocated with its content intact* — a run's diary is copied verbatim onto the data branch
|
|
24
|
+
* when the run ends and its checkout is reclaimed — the bytes already consumed are a prefix of
|
|
25
|
+
* the new file, so the next {@link pull} delivers exactly the lines the move would otherwise
|
|
26
|
+
* have swallowed, without replaying what was already delivered.
|
|
27
|
+
*
|
|
28
|
+
* The first pull after a retarget adopts the new home's mtime instead of running the
|
|
29
|
+
* same-length-rewrite check: the copy is younger than the original by construction, and a
|
|
30
|
+
* fully-consumed log would otherwise read as "rewritten to the same length" and replay
|
|
31
|
+
* every line it already delivered.
|
|
32
|
+
*/
|
|
33
|
+
retarget(path: string): void;
|
|
34
|
+
/** Read and dispatch any lines appended since the previous call. */
|
|
35
|
+
pull(): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
/** Options for {@link followFile}. */
|
|
38
|
+
export interface FollowFileOptions {
|
|
39
|
+
/** How often the backstop poll runs. */
|
|
40
|
+
pollMs: number;
|
|
41
|
+
/**
|
|
42
|
+
* Let the process exit with the tail still running (steering must never hold it open).
|
|
43
|
+
* Covers both handles this opens — the poll timer *and* the `fs.watch` — since either one
|
|
44
|
+
* on its own is enough to keep the event loop alive.
|
|
45
|
+
*/
|
|
46
|
+
unref?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Drive a {@link JsonlTailer} as the file grows: an `fs.watch` on `dir` for latency, plus a
|
|
50
|
+
* poll backstop because `fs.watch` is unreliable across platforms. Pulls are serialized (a
|
|
51
|
+
* pull already in flight swallows the next trigger) and stop for good once the returned
|
|
52
|
+
* function is called. Shared by the agent's control tail and the dashboard's event tail, which
|
|
53
|
+
* hand-rolled this separately and drifted apart.
|
|
54
|
+
*
|
|
55
|
+
* Nothing here may throw at the process: a failed pull and a watcher error are both survivable,
|
|
56
|
+
* and the poll alone is a complete tail (#996).
|
|
57
|
+
*/
|
|
58
|
+
export declare function followFile(dir: string, pull: () => Promise<void>, opts: FollowFileOptions): () => void;
|
|
59
|
+
//# sourceMappingURL=jsonl-tail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonl-tail.d.ts","sourceRoot":"","sources":["../src/jsonl-tail.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,qBAAa,WAAW,CAAC,CAAC;IAOtB,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,0FAA0F;IAC1F,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IAT3B,OAAO,CAAC,MAAM,CAAI;IAClB,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,WAAW,CAAI;IACvB,OAAO,CAAC,UAAU,CAAQ;IAE1B,YACU,IAAI,EAAE,MAAM,EACH,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI;IAC3C,0FAA0F;IACzE,OAAO,CAAC,GAAE,MAAM,IAAI,aAAA,EACnC;IAEJ;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAG3B;IAED,oEAAoE;IAC9D,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAwC1B;CACF;AAED,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,iBAAiB,GAAG,MAAM,IAAI,CA+CtG"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { watch } from 'node:fs';
|
|
2
|
+
import { open } from 'node:fs/promises';
|
|
3
|
+
/**
|
|
4
|
+
* Tails an append-only JSONL log, calling `onLine` for each complete line as it
|
|
5
|
+
* is written. Reads only the bytes appended since the last {@link pull},
|
|
6
|
+
* buffering a torn trailing line until its newline arrives. A file that shrinks
|
|
7
|
+
* (a fresh agent truncated the log) resets to the start so the new content is
|
|
8
|
+
* picked up. The generic base behind the daemon's event tail and the agent's
|
|
9
|
+
* control tail (#344) — one tailer, two directions.
|
|
10
|
+
*/
|
|
11
|
+
export class JsonlTailer {
|
|
12
|
+
path;
|
|
13
|
+
onLine;
|
|
14
|
+
onReset;
|
|
15
|
+
offset = 0;
|
|
16
|
+
partial = '';
|
|
17
|
+
lastMtimeMs = 0;
|
|
18
|
+
adoptMtime = false;
|
|
19
|
+
constructor(path, onLine,
|
|
20
|
+
/** Told when the log is found rewritten, before its lines are read again from the top. */
|
|
21
|
+
onReset) {
|
|
22
|
+
this.path = path;
|
|
23
|
+
this.onLine = onLine;
|
|
24
|
+
this.onReset = onReset;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Point the tailer at the log's new home, keeping the read offset. For a log that is
|
|
28
|
+
* *relocated with its content intact* — a run's diary is copied verbatim onto the data branch
|
|
29
|
+
* when the run ends and its checkout is reclaimed — the bytes already consumed are a prefix of
|
|
30
|
+
* the new file, so the next {@link pull} delivers exactly the lines the move would otherwise
|
|
31
|
+
* have swallowed, without replaying what was already delivered.
|
|
32
|
+
*
|
|
33
|
+
* The first pull after a retarget adopts the new home's mtime instead of running the
|
|
34
|
+
* same-length-rewrite check: the copy is younger than the original by construction, and a
|
|
35
|
+
* fully-consumed log would otherwise read as "rewritten to the same length" and replay
|
|
36
|
+
* every line it already delivered.
|
|
37
|
+
*/
|
|
38
|
+
retarget(path) {
|
|
39
|
+
this.path = path;
|
|
40
|
+
this.adoptMtime = true;
|
|
41
|
+
}
|
|
42
|
+
/** Read and dispatch any lines appended since the previous call. */
|
|
43
|
+
async pull() {
|
|
44
|
+
let fd;
|
|
45
|
+
try {
|
|
46
|
+
fd = await open(this.path, 'r');
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return; // not created yet (nothing has written)
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
const { size, mtimeMs } = await fd.stat();
|
|
53
|
+
// A fresh agent truncates the log in place (same inode). Detect it two ways: the
|
|
54
|
+
// file shrank below what we consumed, or it was rewritten to the same length
|
|
55
|
+
// (size unchanged but mtime advanced). Either way, re-read from the top.
|
|
56
|
+
// Suspended for the first read after a retarget, whose newer mtime is the copy's, not a rewrite's.
|
|
57
|
+
const rewritten = !this.adoptMtime && size === this.offset && this.offset > 0 && mtimeMs > this.lastMtimeMs;
|
|
58
|
+
if (size < this.offset || rewritten) {
|
|
59
|
+
this.offset = 0;
|
|
60
|
+
this.partial = '';
|
|
61
|
+
this.onReset?.();
|
|
62
|
+
}
|
|
63
|
+
this.lastMtimeMs = mtimeMs;
|
|
64
|
+
this.adoptMtime = false;
|
|
65
|
+
if (size === this.offset)
|
|
66
|
+
return;
|
|
67
|
+
const buf = Buffer.alloc(size - this.offset);
|
|
68
|
+
await fd.read(buf, 0, buf.length, this.offset);
|
|
69
|
+
this.offset = size;
|
|
70
|
+
this.partial += buf.toString('utf8');
|
|
71
|
+
const lines = this.partial.split('\n');
|
|
72
|
+
this.partial = lines.pop() ?? ''; // trailing fragment with no newline yet
|
|
73
|
+
for (const line of lines) {
|
|
74
|
+
const trimmed = line.trim();
|
|
75
|
+
if (!trimmed)
|
|
76
|
+
continue;
|
|
77
|
+
try {
|
|
78
|
+
this.onLine(JSON.parse(trimmed));
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
// a torn/half-written line — skip it; the log never rewrites history
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
await fd.close();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Drive a {@link JsonlTailer} as the file grows: an `fs.watch` on `dir` for latency, plus a
|
|
92
|
+
* poll backstop because `fs.watch` is unreliable across platforms. Pulls are serialized (a
|
|
93
|
+
* pull already in flight swallows the next trigger) and stop for good once the returned
|
|
94
|
+
* function is called. Shared by the agent's control tail and the dashboard's event tail, which
|
|
95
|
+
* hand-rolled this separately and drifted apart.
|
|
96
|
+
*
|
|
97
|
+
* Nothing here may throw at the process: a failed pull and a watcher error are both survivable,
|
|
98
|
+
* and the poll alone is a complete tail (#996).
|
|
99
|
+
*/
|
|
100
|
+
export function followFile(dir, pull, opts) {
|
|
101
|
+
let pulling = false;
|
|
102
|
+
let stopped = false;
|
|
103
|
+
const pump = async () => {
|
|
104
|
+
if (pulling || stopped)
|
|
105
|
+
return;
|
|
106
|
+
pulling = true;
|
|
107
|
+
try {
|
|
108
|
+
await pull();
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
// #996: every caller discards this promise, so a rejected read (EIO on a network mount,
|
|
112
|
+
// EISDIR, a log grown past kMaxLength) would be an unhandled rejection and kill the
|
|
113
|
+
// process. Swallowed rather than logged: the next tick retries, and a fault that persists
|
|
114
|
+
// would otherwise print once per poll forever.
|
|
115
|
+
}
|
|
116
|
+
finally {
|
|
117
|
+
pulling = false;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
let watcher;
|
|
121
|
+
try {
|
|
122
|
+
watcher = watch(dir, () => void pump());
|
|
123
|
+
// #996: an 'error' with no listener throws out of the emitter, which is the same process
|
|
124
|
+
// death. The watcher is spent once it errors (node closes the handle first), so drop it and
|
|
125
|
+
// let the poll below carry the tail on its own.
|
|
126
|
+
watcher.on('error', () => {
|
|
127
|
+
watcher?.close();
|
|
128
|
+
watcher = undefined;
|
|
129
|
+
});
|
|
130
|
+
// Unref the watcher, not just the poll below: an `fs.watch` handle refs the event loop on
|
|
131
|
+
// its own, so unrefing only the timer left `unref: true` a half-measure that still pinned the
|
|
132
|
+
// process open. That is what wedged an agent whose config check failed before its watcher had an
|
|
133
|
+
// owner to close it — the CLI returned, and the process then sat there forever with the agent
|
|
134
|
+
// recorded as `running`.
|
|
135
|
+
if (opts.unref)
|
|
136
|
+
watcher?.unref();
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
// dir may not be watchable everywhere; the poll backstop still covers it
|
|
140
|
+
}
|
|
141
|
+
const poll = setInterval(() => void pump(), opts.pollMs);
|
|
142
|
+
if (opts.unref)
|
|
143
|
+
poll.unref();
|
|
144
|
+
void pump(); // seed with whatever is already written
|
|
145
|
+
return () => {
|
|
146
|
+
stopped = true;
|
|
147
|
+
clearInterval(poll);
|
|
148
|
+
watcher?.close();
|
|
149
|
+
watcher = undefined;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=jsonl-tail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonl-tail.js","sourceRoot":"","sources":["../src/jsonl-tail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAkB,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,IAAI,EA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|
|
1
|
+
/**
|
|
2
|
+
* Loopback-address helpers, shared by the daemon (deciding whether a bind gates behind the
|
|
3
|
+
* token, #1051) and the RPC mount (rejecting a rebound `Host`). A leaf module on purpose:
|
|
4
|
+
* `daemon.ts` imports the dashboard, so the mount cannot import these back out of it.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* True when `host` is a loopback address the browser reaches without leaving the machine (#1051).
|
|
8
|
+
* A bind-all (`0.0.0.0`, `::`) or a routable address is not, and gates behind the shared token.
|
|
9
|
+
*
|
|
10
|
+
* The IPv4 check matches the whole `127.0.0.0/8` range but only as an address: a bare
|
|
11
|
+
* `startsWith('127.')` also accepts a *registrable name* like `127.evil.com`, which is exactly the
|
|
12
|
+
* rebound `Host` the DNS-rebinding guard exists to reject (it can resolve to `127.0.0.1`).
|
|
13
|
+
*/
|
|
14
|
+
export declare function isLoopbackHost(host: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The hostname a `Host` header names, with the port dropped. Keeps the bracketed IPv6 form
|
|
17
|
+
* (`[::1]:4200` → `[::1]`), which splitting on the first colon would mangle.
|
|
18
|
+
*/
|
|
19
|
+
export declare function hostnameFromHostHeader(header: string): string;
|
|
20
|
+
//# sourceMappingURL=loopback-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loopback-host.d.ts","sourceRoot":"","sources":["../src/loopback-host.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAO7D"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loopback-address helpers, shared by the daemon (deciding whether a bind gates behind the
|
|
3
|
+
* token, #1051) and the RPC mount (rejecting a rebound `Host`). A leaf module on purpose:
|
|
4
|
+
* `daemon.ts` imports the dashboard, so the mount cannot import these back out of it.
|
|
5
|
+
*/
|
|
6
|
+
/** The `127.0.0.0/8` loopback range, in dotted-quad form. */
|
|
7
|
+
const LOOPBACK_V4 = /^127(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}$/;
|
|
8
|
+
/**
|
|
9
|
+
* True when `host` is a loopback address the browser reaches without leaving the machine (#1051).
|
|
10
|
+
* A bind-all (`0.0.0.0`, `::`) or a routable address is not, and gates behind the shared token.
|
|
11
|
+
*
|
|
12
|
+
* The IPv4 check matches the whole `127.0.0.0/8` range but only as an address: a bare
|
|
13
|
+
* `startsWith('127.')` also accepts a *registrable name* like `127.evil.com`, which is exactly the
|
|
14
|
+
* rebound `Host` the DNS-rebinding guard exists to reject (it can resolve to `127.0.0.1`).
|
|
15
|
+
*/
|
|
16
|
+
export function isLoopbackHost(host) {
|
|
17
|
+
return host === 'localhost' || host === '::1' || host === '[::1]' || LOOPBACK_V4.test(host);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The hostname a `Host` header names, with the port dropped. Keeps the bracketed IPv6 form
|
|
21
|
+
* (`[::1]:4200` → `[::1]`), which splitting on the first colon would mangle.
|
|
22
|
+
*/
|
|
23
|
+
export function hostnameFromHostHeader(header) {
|
|
24
|
+
if (header.startsWith('[')) {
|
|
25
|
+
const close = header.indexOf(']');
|
|
26
|
+
return close === -1 ? header : header.slice(0, close + 1);
|
|
27
|
+
}
|
|
28
|
+
const colon = header.indexOf(':');
|
|
29
|
+
return colon === -1 ? header : header.slice(0, colon);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=loopback-host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loopback-host.js","sourceRoot":"","sources":["../src/loopback-host.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,6DAA6D;AAC7D,MAAM,WAAW,GAAG,mDAAmD,CAAA;AAEvE;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC7F,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAc;IACnD,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QACjC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAA;IAC3D,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACjC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;AACvD,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// `@openagt/dashboard/module-server`: what the daemon offers a module's server part.
|
|
2
|
+
//
|
|
3
|
+
// A module's server part is the file its package exports as `./server`. The daemon imports it once,
|
|
4
|
+
// in its own process, and calls one of its reads when the module's browser part asks for it
|
|
5
|
+
// (`host.read(name, input)` there). The server part imports nothing from OpenAgent at run time:
|
|
6
|
+
// these are types only, and its default export is a plain object that satisfies `ModuleServer`.
|
|
7
|
+
|
|
8
|
+
/** What the core knows about one run: facts, never a verdict about what the run's files are. */
|
|
9
|
+
export interface RunFacts {
|
|
10
|
+
/** The run's own checkout while it has one: an absolute path. */
|
|
11
|
+
checkout?: string
|
|
12
|
+
/** The run's record, when the project keeps one for it. */
|
|
13
|
+
record?: {
|
|
14
|
+
status?: string
|
|
15
|
+
/** The machine the run ran on. */
|
|
16
|
+
host?: string
|
|
17
|
+
/** The branch the run left its work on, by its last recorded name. */
|
|
18
|
+
branch?: string
|
|
19
|
+
pr?: { number: number }
|
|
20
|
+
/** The branch the run was told to start from, by its name; absent on a run that started from origin's default branch. */
|
|
21
|
+
base?: string
|
|
22
|
+
/** The commit the run's own work begins at, for a run that made its own branch: what its changes are measured from when the default branch cannot tell them. */
|
|
23
|
+
baseCommit?: string
|
|
24
|
+
/** The last commit of the run's work, once its main agent landed it: its branch is gone, and its work is read here. */
|
|
25
|
+
landed?: string
|
|
26
|
+
}
|
|
27
|
+
/** The run ended on this machine without a pull request and was not landed, so a branch it no longer has held nothing. */
|
|
28
|
+
changedNothing: boolean
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Where a pull request stands on the git host: still being asked, or answered (with its merge commit when merged, and the last commit of the branch it merged, when the git host says it). */
|
|
32
|
+
export type MergeLookup = { pending: true } | { pending: false; commit?: string; head?: string }
|
|
33
|
+
|
|
34
|
+
/** What a read is given: the project it reads, and what the core knows about the project's runs. */
|
|
35
|
+
export interface ModuleServerHost {
|
|
36
|
+
/** The project's folder: an absolute path. */
|
|
37
|
+
root: string
|
|
38
|
+
/** The facts about one run of the project, or undefined when the id names no run. */
|
|
39
|
+
run(agentId: string): Promise<RunFacts | undefined>
|
|
40
|
+
/** The commit pull request `number` of `branch` merged as, as the project's git host says. */
|
|
41
|
+
mergeCommit(branch: string, number: number): Promise<MergeLookup>
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* What a module's browser part sent with a read: JSON, bounded in size. `agentId`, when present,
|
|
46
|
+
* names the run the read is about; a run relayed to a connected device is read over there.
|
|
47
|
+
*/
|
|
48
|
+
export type ModuleReadInput = { agentId?: string } & Record<string, unknown>
|
|
49
|
+
|
|
50
|
+
/** One read of a module's server part: its answer must be JSON. */
|
|
51
|
+
export type ModuleRead = (host: ModuleServerHost, input: ModuleReadInput) => Promise<unknown>
|
|
52
|
+
|
|
53
|
+
/** What a module's `./server` file default-exports. */
|
|
54
|
+
export interface ModuleServer {
|
|
55
|
+
reads: Record<string, ModuleRead>
|
|
56
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ModelOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DriverOption {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
/** The driver's logo, shown on the trigger and beside its name (#656). */
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
/** The models this driver offers. Every entry is a real model id — none of them means "unset". */
|
|
12
|
+
models: ModelOption[];
|
|
13
|
+
/** Why {@link models} is empty, said in its place: the agent is still being asked, or could not say. */
|
|
14
|
+
modelsNote?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function DriverModelMenu({ drivers, driver, model, onChange, busy, }: {
|
|
17
|
+
drivers: DriverOption[];
|
|
18
|
+
driver: string;
|
|
19
|
+
model: string;
|
|
20
|
+
/** Set the driver and model together (a model is always picked within its driver). */
|
|
21
|
+
onChange: (driver: string, model: string) => void;
|
|
22
|
+
busy: boolean;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ModuleLink } from '../module/index.js';
|
|
3
|
+
import { type MountedLinkAction } from '../lib/use-modules.js';
|
|
4
|
+
import { type ButtonProps } from './ui/button.js';
|
|
5
|
+
/** The links one project's worth of a click acts on. */
|
|
6
|
+
export interface ProjectLinks {
|
|
7
|
+
projectId: string;
|
|
8
|
+
links: ModuleLink[];
|
|
9
|
+
}
|
|
10
|
+
/** The links a click acts on: known up front, or resolved at click time (a page that first reads what is already there). */
|
|
11
|
+
export type LinkTargets = ProjectLinks[] | (() => Promise<ProjectLinks[]>);
|
|
12
|
+
export declare function LinkActions({ projects, targets, resetKey, label, tooltip, disabled, size, variant, }: {
|
|
13
|
+
/** The projects the links belong to: an action shows when its package is in at least one of them. */
|
|
14
|
+
projects: readonly string[];
|
|
15
|
+
/** What a click acts on, grouped by project. */
|
|
16
|
+
targets: LinkTargets;
|
|
17
|
+
/** A done button rests until this changes: the identity of the set it acted on. Defaults to the projects. */
|
|
18
|
+
resetKey?: string;
|
|
19
|
+
/** The button's text for an action; the action's own label otherwise. */
|
|
20
|
+
label?: (action: MountedLinkAction) => string;
|
|
21
|
+
/** Shown on hover, the same for every action. */
|
|
22
|
+
tooltip?: ReactNode;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
size?: ButtonProps['size'];
|
|
25
|
+
variant?: ButtonProps['variant'];
|
|
26
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** One section of the Settings page: a titled card of rows. */
|
|
3
|
+
export declare function SettingsSection({ title, description, children }: {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
/** One setting: what it is and what it does on the left, its control on the right. */
|
|
9
|
+
export declare function SettingsRow({ label, description, control, dimmed, }: {
|
|
10
|
+
label: string;
|
|
11
|
+
description: string;
|
|
12
|
+
control: ReactNode;
|
|
13
|
+
/** A row the rules turned off: greyed, but still shown with its reason. */
|
|
14
|
+
dimmed?: boolean;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export interface SettingsOption {
|
|
17
|
+
value: string;
|
|
18
|
+
label: string;
|
|
19
|
+
/** A line in the list that says something rather than being a choice. */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* One setting picked from a list.
|
|
24
|
+
*
|
|
25
|
+
* A row with nothing to pick renders nothing at all (#1172). An empty `<select>` is a control that
|
|
26
|
+
* cannot be operated — it reads as broken rather than as "no choices here", which is exactly the
|
|
27
|
+
* paper cut this guard exists for. Every list on this page has a fixed first entry today ("Auto-detect",
|
|
28
|
+
* the agent's own default), so nothing hits it; it is here because the next list will be added
|
|
29
|
+
* without thinking about the empty case.
|
|
30
|
+
*/
|
|
31
|
+
export declare function SettingsSelectRow({ label, description, value, options, onChange, }: {
|
|
32
|
+
label: string;
|
|
33
|
+
description: string;
|
|
34
|
+
value: string;
|
|
35
|
+
options: SettingsOption[];
|
|
36
|
+
onChange: (next: string) => void;
|
|
37
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export declare function StartAgentButton({ icon, label, busyLabel, ariaLabel, menuAriaLabel, tooltip, tooltipClassName, prompt, configureDescription, onStart, onConfigure, busy, starting, disabled, variant, size, className, }: {
|
|
3
|
+
/** The primary half's icon; swapped for a spinner while this button's own start is in flight. */
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
/** The primary half's text. Omitted on the dense rows, which are icon-only — pass `ariaLabel` there. */
|
|
6
|
+
label?: string | undefined;
|
|
7
|
+
/** What the primary half reads while this button's own start is in flight. */
|
|
8
|
+
busyLabel?: string | undefined;
|
|
9
|
+
/** The primary half's accessible name. Required where there is no `label` to serve as one. */
|
|
10
|
+
ariaLabel?: string | undefined;
|
|
11
|
+
/** The chevron's accessible name — it has no text of its own, and "menu" would not say whose. */
|
|
12
|
+
menuAriaLabel: string;
|
|
13
|
+
/** What the primary half promises on hover: what it does, and what it is about to spend. */
|
|
14
|
+
tooltip: ReactNode;
|
|
15
|
+
tooltipClassName?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The prompt "Configure first, then run" hands the launcher. For a click that starts several
|
|
18
|
+
* agents, the one the launcher can actually send — `configureDescription` then says so.
|
|
19
|
+
*/
|
|
20
|
+
prompt: string;
|
|
21
|
+
/** The menu entry's second line: what this particular launcher trip is for. */
|
|
22
|
+
configureDescription: string;
|
|
23
|
+
onStart: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Open the launcher the prompt was stashed for — the project's own, since a draft is only
|
|
26
|
+
* rehydrated by the launcher of the project the reader lands on.
|
|
27
|
+
*/
|
|
28
|
+
onConfigure: () => void;
|
|
29
|
+
/** A start is in flight somewhere on this surface: the primary half is out until it settles. */
|
|
30
|
+
busy?: boolean | undefined;
|
|
31
|
+
/** *This* button's start is the one in flight, so only it reads as busy. */
|
|
32
|
+
starting?: boolean | undefined;
|
|
33
|
+
/** There is nothing to act on at all (no project picked): both halves are out. */
|
|
34
|
+
disabled?: boolean | undefined;
|
|
35
|
+
variant?: 'default' | 'outline' | 'ghost' | undefined;
|
|
36
|
+
size?: 'xs' | 'sm' | 'icon-sm' | undefined;
|
|
37
|
+
/** Styling the two halves share, so the pair reads as one control rather than two buttons. */
|
|
38
|
+
className?: string | undefined;
|
|
39
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import type { ButtonHTMLAttributes } from 'react';
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "ghost" | "outline" | null | undefined;
|
|
5
|
+
size?: "default" | "icon" | "icon-sm" | "sm" | "xs" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
}
|
|
9
|
+
export declare function Button({ className, variant, size, ...props }: ButtonProps): import("react").JSX.Element;
|
|
10
|
+
export { buttonVariants };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export declare function Card({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
3
|
+
export declare function CardHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
4
|
+
export declare function CardTitle({ className, ...props }: HTMLAttributes<HTMLHeadingElement>): import("react").JSX.Element;
|
|
5
|
+
export declare function CardContent({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import { Checkbox as CheckboxPrimitive } from '@base-ui-components/react/checkbox';
|
|
3
|
+
type CheckboxProps = Omit<ComponentProps<typeof CheckboxPrimitive.Root>, 'disabled'> & {
|
|
4
|
+
disabled?: boolean | undefined;
|
|
5
|
+
};
|
|
6
|
+
export declare function Checkbox({ className, disabled, ...props }: CheckboxProps): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Menu } from '@base-ui-components/react/menu';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
export declare const DropdownMenu: typeof Menu.Root;
|
|
4
|
+
export declare const DropdownMenuGroup: import("react").ForwardRefExoticComponent<import("@base-ui-components/react/menu").MenuGroupProps & import("react").RefAttributes<Element>>;
|
|
5
|
+
export declare const DropdownMenuSub: typeof Menu.SubmenuRoot;
|
|
6
|
+
export declare function DropdownMenuTrigger({ className, ...props }: ComponentProps<typeof Menu.Trigger>): import("react").JSX.Element;
|
|
7
|
+
export declare function DropdownMenuContent({ className, sideOffset, align, children, ...props }: ComponentProps<typeof Menu.Popup> & {
|
|
8
|
+
sideOffset?: number;
|
|
9
|
+
align?: 'start' | 'center' | 'end';
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
export declare function DropdownMenuItem({ className, ...props }: ComponentProps<typeof Menu.Item>): import("react").JSX.Element;
|
|
12
|
+
export declare function DropdownMenuCheckboxItem({ className, children, closeOnClick, ...props }: ComponentProps<typeof Menu.CheckboxItem>): import("react").JSX.Element;
|
|
13
|
+
export declare function DropdownMenuSubTrigger({ className, children, ...props }: ComponentProps<typeof Menu.SubmenuTrigger>): import("react").JSX.Element;
|
|
14
|
+
export declare function DropdownMenuSubContent({ className, children, ...props }: ComponentProps<typeof Menu.Popup>): import("react").JSX.Element;
|
|
15
|
+
export declare function DropdownMenuSeparator({ className, ...props }: ComponentProps<typeof Menu.Separator>): import("react").JSX.Element;
|
|
16
|
+
export declare function DropdownMenuLabel({ className, ...props }: ComponentProps<typeof Menu.GroupLabel>): import("react").JSX.Element;
|