@openagt/dashboard 0.8.0 → 0.10.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/README.md +14 -17
- package/dist/agent-view.d.ts +3 -3
- package/dist/bridge-browser.d.ts +4 -4
- package/dist/bridge-browser.d.ts.map +1 -1
- package/dist/bridge-browser.js +8 -8
- package/dist/bridge-browser.js.map +1 -1
- package/dist/built-in.d.ts +45 -14
- package/dist/built-in.d.ts.map +1 -1
- package/dist/built-in.js +122 -27
- package/dist/built-in.js.map +1 -1
- package/dist/chrome-extension/background.js +11 -11
- package/dist/chrome-extension/content.js +37 -37
- package/dist/chrome-extension/driver-plan.js +1 -1
- package/dist/chrome-extension/fingerprint.js +1 -1
- package/dist/chrome-extension/manifest.json +3 -3
- package/dist/chrome-extension/options.html +4 -4
- package/dist/chrome-extension/options.js +4 -4
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +7 -7
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +2 -2
- package/dist/cloud-run-state.d.ts +1 -1
- package/dist/cloud-scratch-refs.js +7 -7
- package/dist/cloud-scratch-refs.js.map +1 -1
- package/dist/cloud-work.js +2 -2
- package/dist/daemon-runtime.d.ts +5 -4
- package/dist/daemon-runtime.d.ts.map +1 -1
- package/dist/daemon-runtime.js +59 -10
- package/dist/daemon-runtime.js.map +1 -1
- package/dist/daemon-services.d.ts +4 -3
- package/dist/daemon-services.d.ts.map +1 -1
- package/dist/daemon-services.js +14 -8
- package/dist/daemon-services.js.map +1 -1
- package/dist/daemon-tick.js +1 -1
- package/dist/daemon.d.ts +1 -12
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +9 -32
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard/agent-handoff.d.ts +4 -4
- package/dist/dashboard/agent-handoff.js +7 -7
- package/dist/dashboard/agent-handoff.js.map +1 -1
- package/dist/dashboard/bridge-endpoints.d.ts +3 -3
- package/dist/dashboard/bridge-endpoints.js +3 -3
- package/dist/dashboard/content-type.js +1 -1
- package/dist/dashboard/docs.d.ts +1 -1
- package/dist/dashboard/docs.js +1 -1
- package/dist/dashboard/git-status.d.ts +1 -1
- package/dist/dashboard/index.d.ts +1 -1
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/interventions.d.ts +2 -2
- package/dist/dashboard/open-in-app.d.ts +3 -3
- package/dist/dashboard/open-in-app.js +4 -4
- package/dist/dashboard/open-questions.d.ts +2 -2
- package/dist/dashboard/projects.d.ts +6 -5
- package/dist/dashboard/projects.d.ts.map +1 -1
- package/dist/dashboard/projects.js.map +1 -1
- package/dist/dashboard/pull-requests.d.ts +5 -5
- package/dist/dashboard/pull-requests.d.ts.map +1 -1
- package/dist/dashboard/pull-requests.js +2 -2
- package/dist/dashboard/pull-requests.js.map +1 -1
- package/dist/dashboard/relay-endpoints.d.ts +3 -3
- package/dist/dashboard/relay-endpoints.js +1 -1
- package/dist/dashboard/remote-run.d.ts +5 -5
- package/dist/dashboard/remote-run.js +3 -3
- package/dist/dashboard/rpc-serve.d.ts +7 -4
- package/dist/dashboard/rpc-serve.d.ts.map +1 -1
- package/dist/dashboard/rpc-serve.js.map +1 -1
- package/dist/dashboard/run-inbox.d.ts +2 -2
- package/dist/dashboard/run-inbox.js +4 -4
- package/dist/dashboard/run-inbox.js.map +1 -1
- package/dist/dashboard/server.d.ts +6 -4
- package/dist/dashboard/server.d.ts.map +1 -1
- package/dist/dashboard/server.js +3 -2
- package/dist/dashboard/server.js.map +1 -1
- package/dist/dashboard/start-branch.d.ts +32 -0
- package/dist/dashboard/start-branch.d.ts.map +1 -0
- package/dist/dashboard/start-branch.js +47 -0
- package/dist/dashboard/start-branch.js.map +1 -0
- package/dist/dashboard/static.js +1 -1
- package/dist/dashboard/types.d.ts +29 -3
- package/dist/dashboard/types.d.ts.map +1 -1
- package/dist/dashboard/web-start-endpoints.d.ts +1 -1
- package/dist/dashboard/web-start-endpoints.d.ts.map +1 -1
- package/dist/dashboard/web-start-endpoints.js +1 -1
- package/dist/dashboard/web-start-endpoints.js.map +1 -1
- package/dist/dashboard-bundle/assets/main-Q7JMdMJI.css +2 -0
- package/dist/dashboard-bundle/assets/main-fDZWGOub.js +140 -0
- package/dist/dashboard-bundle/assets/{module-jASZmfSB.js → module-gKz-ZvkG.js} +4 -4
- package/dist/dashboard-bundle/host/module.js +1 -1
- package/dist/dashboard-bundle/index.html +6 -6
- package/dist/dashboard-rpc/context.d.ts +2 -0
- package/dist/dashboard-rpc/context.d.ts.map +1 -1
- package/dist/dashboard-rpc/context.js +4 -0
- package/dist/dashboard-rpc/context.js.map +1 -1
- package/dist/dashboard-rpc/control.d.ts +1 -1
- package/dist/dashboard-rpc/control.js +3 -3
- package/dist/dashboard-rpc/control.js.map +1 -1
- package/dist/dashboard-rpc/events.d.ts +3 -3
- package/dist/dashboard-rpc/index.d.ts +2 -1
- package/dist/dashboard-rpc/index.d.ts.map +1 -1
- package/dist/dashboard-rpc/index.js +4 -2
- package/dist/dashboard-rpc/index.js.map +1 -1
- package/dist/dashboard-rpc/modules.d.ts +8 -6
- package/dist/dashboard-rpc/modules.d.ts.map +1 -1
- package/dist/dashboard-rpc/modules.js +8 -6
- package/dist/dashboard-rpc/modules.js.map +1 -1
- package/dist/dashboard-rpc/preferences.d.ts +2 -2
- package/dist/dashboard-rpc/preferences.d.ts.map +1 -1
- package/dist/dashboard-rpc/preferences.js +2 -2
- package/dist/dashboard-rpc/preferences.js.map +1 -1
- package/dist/dashboard-rpc/projects.d.ts +29 -3
- package/dist/dashboard-rpc/projects.d.ts.map +1 -1
- package/dist/dashboard-rpc/projects.js +57 -8
- package/dist/dashboard-rpc/projects.js.map +1 -1
- package/dist/dashboard-rpc/reads.d.ts +3 -3
- package/dist/dashboard-rpc/reads.js +1 -1
- package/dist/dashboard-rpc/skills.d.ts +80 -0
- package/dist/dashboard-rpc/skills.d.ts.map +1 -0
- package/dist/dashboard-rpc/skills.js +84 -0
- package/dist/dashboard-rpc/skills.js.map +1 -0
- package/dist/dashboard-rpc/test-context.d.ts.map +1 -1
- package/dist/dashboard-rpc/test-context.js +4 -3
- package/dist/dashboard-rpc/test-context.js.map +1 -1
- package/dist/event-stream.d.ts +1 -1
- package/dist/event-stream.js +1 -1
- package/dist/events.d.ts +8 -8
- package/dist/events.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/install.d.ts +9 -7
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +28 -14
- package/dist/install.js.map +1 -1
- package/dist/module-server.d.ts +1 -1
- package/dist/module-types/dashboard/components/ui/switch.d.ts +7 -0
- package/dist/module-types/dashboard/lib/route.d.ts +2 -1
- package/dist/module-types/dashboard/lib/use-modules.d.ts +4 -3
- package/dist/module-types/dashboard/module/index.d.ts +6 -5
- package/dist/module-types/src/agent-view.d.ts +3 -3
- package/dist/module-types/src/bridge-browser.d.ts +4 -4
- package/dist/module-types/src/built-in.d.ts +45 -14
- package/dist/module-types/src/client.d.ts +1 -1
- package/dist/module-types/src/cloud-run-state.d.ts +1 -1
- package/dist/module-types/src/dashboard/agent-handoff.d.ts +4 -4
- package/dist/module-types/src/dashboard/bridge-endpoints.d.ts +3 -3
- package/dist/module-types/src/dashboard/docs.d.ts +1 -1
- package/dist/module-types/src/dashboard/git-status.d.ts +1 -1
- package/dist/module-types/src/dashboard/interventions.d.ts +2 -2
- package/dist/module-types/src/dashboard/open-in-app.d.ts +3 -3
- package/dist/module-types/src/dashboard/open-questions.d.ts +2 -2
- package/dist/module-types/src/dashboard/projects.d.ts +6 -5
- package/dist/module-types/src/dashboard/pull-requests.d.ts +5 -5
- package/dist/module-types/src/dashboard/remote-run.d.ts +5 -5
- package/dist/module-types/src/dashboard/rpc-serve.d.ts +7 -4
- package/dist/module-types/src/dashboard/run-inbox.d.ts +2 -2
- package/dist/module-types/src/dashboard/start-branch.d.ts +31 -0
- package/dist/module-types/src/dashboard/types.d.ts +29 -3
- package/dist/module-types/src/dashboard-rpc/context.d.ts +2 -0
- package/dist/module-types/src/dashboard-rpc/control.d.ts +1 -1
- package/dist/module-types/src/dashboard-rpc/events.d.ts +3 -3
- package/dist/module-types/src/dashboard-rpc/index.d.ts +2 -1
- package/dist/module-types/src/dashboard-rpc/modules.d.ts +8 -6
- package/dist/module-types/src/dashboard-rpc/preferences.d.ts +2 -2
- package/dist/module-types/src/dashboard-rpc/projects.d.ts +29 -3
- package/dist/module-types/src/dashboard-rpc/reads.d.ts +3 -3
- package/dist/module-types/src/dashboard-rpc/skills.d.ts +79 -0
- package/dist/module-types/src/event-stream.d.ts +1 -1
- package/dist/module-types/src/events.d.ts +8 -8
- package/dist/module-types/src/index.d.ts +3 -2
- package/dist/module-types/src/open-choices.d.ts +2 -2
- package/dist/module-types/src/openagent-dir.d.ts +8 -0
- package/dist/module-types/src/openagent-gitignore.d.ts +11 -0
- package/dist/module-types/src/project-commands.d.ts +5 -1
- package/dist/module-types/src/project-errors.d.ts +11 -7
- package/dist/module-types/src/project-hooks.d.ts +12 -9
- package/dist/module-types/src/project-modules.d.ts +9 -7
- package/dist/module-types/src/project-presets.d.ts +4 -4
- package/dist/module-types/src/project.d.ts +6 -6
- package/dist/module-types/src/publish-levels.d.ts +4 -4
- package/dist/module-types/src/quota-boundary.d.ts +2 -2
- package/dist/module-types/src/registry.d.ts +13 -7
- package/dist/module-types/src/store/agent-checkout.d.ts +1 -1
- package/dist/module-types/src/store/agent-store.d.ts +6 -6
- package/dist/module-types/src/store/branches.d.ts +8 -8
- package/dist/module-types/src/store/git-host.d.ts +8 -8
- package/dist/module-types/src/store/provided.d.ts +3 -3
- package/dist/module-types/src/store/queue.d.ts +9 -9
- package/dist/module-types/src/store/repository.d.ts +2 -2
- package/dist/module-types/src/store/run-record.d.ts +10 -10
- package/dist/module-types/src/store/runs.d.ts +7 -7
- package/dist/module-types/src/store/tickets.d.ts +8 -8
- package/dist/module-types/src/terminal.d.ts +3 -3
- package/dist/open-choices.d.ts +2 -2
- package/dist/openagent-dir.d.ts +9 -0
- package/dist/openagent-dir.d.ts.map +1 -0
- package/dist/openagent-dir.js +9 -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.js +2 -2
- package/dist/pick-directory.js.map +1 -1
- package/dist/project-commands.d.ts +5 -1
- package/dist/project-commands.d.ts.map +1 -1
- package/dist/project-commands.js +1 -1
- package/dist/project-commands.js.map +1 -1
- package/dist/project-errors.d.ts +11 -7
- package/dist/project-errors.d.ts.map +1 -1
- package/dist/project-errors.js +10 -8
- package/dist/project-errors.js.map +1 -1
- package/dist/project-hooks.d.ts +12 -9
- package/dist/project-hooks.d.ts.map +1 -1
- package/dist/project-hooks.js +17 -14
- package/dist/project-hooks.js.map +1 -1
- package/dist/project-modules.d.ts +9 -7
- package/dist/project-modules.d.ts.map +1 -1
- package/dist/project-modules.js +7 -13
- package/dist/project-modules.js.map +1 -1
- package/dist/project-presets.d.ts +4 -4
- package/dist/project-presets.d.ts.map +1 -1
- package/dist/project-presets.js +9 -9
- package/dist/project-presets.js.map +1 -1
- package/dist/project.d.ts +6 -6
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +6 -7
- package/dist/project.js.map +1 -1
- package/dist/publish-levels.d.ts +4 -4
- package/dist/publish-levels.d.ts.map +1 -1
- package/dist/publish-levels.js +7 -5
- package/dist/publish-levels.js.map +1 -1
- package/dist/quota-boundary.d.ts +2 -2
- package/dist/quota-boundary.js +2 -2
- package/dist/registry.d.ts +13 -7
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +19 -3
- package/dist/registry.js.map +1 -1
- 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/store/agent-checkout.d.ts +1 -1
- package/dist/store/agent-checkout.js +3 -3
- package/dist/store/agent-checkout.js.map +1 -1
- package/dist/store/agent-store.d.ts +6 -6
- package/dist/store/agent-store.js +8 -8
- package/dist/store/agent-store.js.map +1 -1
- package/dist/store/branches.d.ts +8 -8
- package/dist/store/branches.d.ts.map +1 -1
- package/dist/store/branches.js +2 -2
- package/dist/store/branches.js.map +1 -1
- package/dist/store/git-host.d.ts +8 -8
- package/dist/store/git-host.d.ts.map +1 -1
- package/dist/store/git-host.js +3 -3
- package/dist/store/git-host.js.map +1 -1
- package/dist/store/provided.d.ts +3 -3
- package/dist/store/provided.d.ts.map +1 -1
- package/dist/store/provided.js +3 -3
- package/dist/store/provided.js.map +1 -1
- package/dist/store/queue.d.ts +9 -9
- package/dist/store/queue.d.ts.map +1 -1
- package/dist/store/queue.js +2 -2
- package/dist/store/queue.js.map +1 -1
- package/dist/store/repository.d.ts +2 -2
- package/dist/store/run-record.d.ts +10 -10
- package/dist/store/run-record.d.ts.map +1 -1
- package/dist/store/run-record.js +7 -7
- package/dist/store/run-record.js.map +1 -1
- package/dist/store/runs.d.ts +7 -7
- package/dist/store/runs.d.ts.map +1 -1
- package/dist/store/runs.js +3 -3
- package/dist/store/runs.js.map +1 -1
- package/dist/store/test-branches.d.ts +0 -8
- package/dist/store/test-branches.d.ts.map +1 -1
- package/dist/store/test-branches.js +0 -24
- package/dist/store/test-branches.js.map +1 -1
- package/dist/store/tickets.d.ts +8 -8
- package/dist/store/tickets.d.ts.map +1 -1
- package/dist/store/tickets.js +2 -2
- package/dist/store/tickets.js.map +1 -1
- package/dist/terminal.d.ts +3 -3
- package/dist/terminal.js +3 -3
- package/package.json +23 -20
- package/dist/agent-archive.d.ts +0 -35
- package/dist/agent-archive.d.ts.map +0 -1
- package/dist/agent-archive.js +0 -67
- package/dist/agent-archive.js.map +0 -1
- package/dist/agent-commit.d.ts +0 -140
- package/dist/agent-commit.d.ts.map +0 -1
- package/dist/agent-commit.js +0 -254
- package/dist/agent-commit.js.map +0 -1
- package/dist/agent-driver.d.ts +0 -28
- package/dist/agent-driver.d.ts.map +0 -1
- package/dist/agent-driver.js +0 -18
- package/dist/agent-driver.js.map +0 -1
- package/dist/agent-location.d.ts +0 -11
- package/dist/agent-location.d.ts.map +0 -1
- package/dist/agent-location.js +0 -10
- package/dist/agent-location.js.map +0 -1
- package/dist/agent-messages.d.ts +0 -55
- package/dist/agent-messages.d.ts.map +0 -1
- package/dist/agent-messages.js +0 -73
- package/dist/agent-messages.js.map +0 -1
- package/dist/agent-names.d.ts +0 -24
- package/dist/agent-names.d.ts.map +0 -1
- package/dist/agent-names.js +0 -33
- package/dist/agent-names.js.map +0 -1
- package/dist/agent-options.d.ts +0 -45
- package/dist/agent-options.d.ts.map +0 -1
- package/dist/agent-options.js +0 -83
- package/dist/agent-options.js.map +0 -1
- package/dist/agent-spec.d.ts +0 -56
- package/dist/agent-spec.d.ts.map +0 -1
- package/dist/agent-spec.js +0 -56
- package/dist/agent-spec.js.map +0 -1
- package/dist/agent-telemetry.d.ts +0 -88
- package/dist/agent-telemetry.d.ts.map +0 -1
- package/dist/agent-telemetry.js +0 -97
- package/dist/agent-telemetry.js.map +0 -1
- package/dist/agent.d.ts +0 -113
- package/dist/agent.d.ts.map +0 -1
- package/dist/agent.js +0 -168
- package/dist/agent.js.map +0 -1
- package/dist/archived-agent-patch.d.ts +0 -14
- package/dist/archived-agent-patch.d.ts.map +0 -1
- package/dist/archived-agent-patch.js +0 -22
- package/dist/archived-agent-patch.js.map +0 -1
- package/dist/auto-pm.d.ts +0 -538
- package/dist/auto-pm.d.ts.map +0 -1
- package/dist/auto-pm.js +0 -707
- package/dist/auto-pm.js.map +0 -1
- package/dist/await-gate.d.ts +0 -184
- package/dist/await-gate.d.ts.map +0 -1
- package/dist/await-gate.js +0 -252
- package/dist/await-gate.js.map +0 -1
- package/dist/branch-links-pass.d.ts +0 -15
- package/dist/branch-links-pass.d.ts.map +0 -1
- package/dist/branch-links-pass.js +0 -13
- package/dist/branch-links-pass.js.map +0 -1
- package/dist/branch-links.d.ts +0 -53
- package/dist/branch-links.d.ts.map +0 -1
- package/dist/branch-links.js +0 -94
- package/dist/branch-links.js.map +0 -1
- package/dist/branch-names.d.ts +0 -57
- package/dist/branch-names.d.ts.map +0 -1
- package/dist/branch-names.js +0 -72
- package/dist/branch-names.js.map +0 -1
- package/dist/ci-watch.d.ts +0 -123
- package/dist/ci-watch.d.ts.map +0 -1
- package/dist/ci-watch.js +0 -228
- package/dist/ci-watch.js.map +0 -1
- package/dist/claude-trust.d.ts +0 -16
- package/dist/claude-trust.d.ts.map +0 -1
- package/dist/claude-trust.js +0 -72
- package/dist/claude-trust.js.map +0 -1
- package/dist/cli-exec.d.ts +0 -36
- package/dist/cli-exec.d.ts.map +0 -1
- package/dist/cli-exec.js +0 -44
- package/dist/cli-exec.js.map +0 -1
- package/dist/closing-keywords.d.ts +0 -28
- package/dist/closing-keywords.d.ts.map +0 -1
- package/dist/closing-keywords.js +0 -49
- package/dist/closing-keywords.js.map +0 -1
- package/dist/config-layers.d.ts +0 -62
- package/dist/config-layers.d.ts.map +0 -1
- package/dist/config-layers.js +0 -70
- package/dist/config-layers.js.map +0 -1
- package/dist/config.d.ts +0 -54
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -78
- package/dist/config.js.map +0 -1
- package/dist/consumption-guard.d.ts +0 -53
- package/dist/consumption-guard.d.ts.map +0 -1
- package/dist/consumption-guard.js +0 -69
- package/dist/consumption-guard.js.map +0 -1
- package/dist/control.d.ts +0 -75
- package/dist/control.d.ts.map +0 -1
- package/dist/control.js +0 -68
- package/dist/control.js.map +0 -1
- package/dist/conversation-commit.d.ts +0 -166
- package/dist/conversation-commit.d.ts.map +0 -1
- package/dist/conversation-commit.js +0 -309
- package/dist/conversation-commit.js.map +0 -1
- package/dist/conversations.d.ts +0 -93
- package/dist/conversations.d.ts.map +0 -1
- package/dist/conversations.js +0 -176
- package/dist/conversations.js.map +0 -1
- package/dist/daemon-writes.d.ts +0 -33
- package/dist/daemon-writes.d.ts.map +0 -1
- package/dist/daemon-writes.js +0 -45
- package/dist/daemon-writes.js.map +0 -1
- package/dist/dashboard/agent-tree.d.ts +0 -106
- package/dist/dashboard/agent-tree.d.ts.map +0 -1
- package/dist/dashboard/agent-tree.js +0 -180
- package/dist/dashboard/agent-tree.js.map +0 -1
- package/dist/dashboard/browser-proxy.d.ts +0 -41
- package/dist/dashboard/browser-proxy.d.ts.map +0 -1
- package/dist/dashboard/browser-proxy.js +0 -96
- package/dist/dashboard/browser-proxy.js.map +0 -1
- package/dist/dashboard/discord-webhook.d.ts +0 -17
- package/dist/dashboard/discord-webhook.d.ts.map +0 -1
- package/dist/dashboard/discord-webhook.js +0 -36
- package/dist/dashboard/discord-webhook.js.map +0 -1
- package/dist/dashboard/file-diff.d.ts +0 -67
- package/dist/dashboard/file-diff.d.ts.map +0 -1
- package/dist/dashboard/file-diff.js +0 -132
- package/dist/dashboard/file-diff.js.map +0 -1
- package/dist/dashboard/file-read.d.ts +0 -42
- package/dist/dashboard/file-read.d.ts.map +0 -1
- package/dist/dashboard/file-read.js +0 -69
- package/dist/dashboard/file-read.js.map +0 -1
- package/dist/dashboard/file-status.d.ts +0 -21
- package/dist/dashboard/file-status.d.ts.map +0 -1
- package/dist/dashboard/file-status.js +0 -37
- package/dist/dashboard/file-status.js.map +0 -1
- package/dist/dashboard/gh.d.ts +0 -131
- package/dist/dashboard/gh.d.ts.map +0 -1
- package/dist/dashboard/gh.js +0 -150
- package/dist/dashboard/gh.js.map +0 -1
- package/dist/dashboard/github.d.ts +0 -11
- package/dist/dashboard/github.d.ts.map +0 -1
- package/dist/dashboard/github.js +0 -33
- package/dist/dashboard/github.js.map +0 -1
- package/dist/dashboard/run-handoff.d.ts +0 -311
- package/dist/dashboard/run-handoff.d.ts.map +0 -1
- package/dist/dashboard/run-handoff.js +0 -485
- package/dist/dashboard/run-handoff.js.map +0 -1
- package/dist/dashboard/scheduler-state.d.ts +0 -73
- package/dist/dashboard/scheduler-state.d.ts.map +0 -1
- package/dist/dashboard/scheduler-state.js +0 -120
- package/dist/dashboard/scheduler-state.js.map +0 -1
- package/dist/dashboard/subagent-settings.d.ts +0 -26
- package/dist/dashboard/subagent-settings.d.ts.map +0 -1
- package/dist/dashboard/subagent-settings.js +0 -52
- package/dist/dashboard/subagent-settings.js.map +0 -1
- package/dist/dashboard/telefunc-serve.d.ts +0 -118
- package/dist/dashboard/telefunc-serve.d.ts.map +0 -1
- package/dist/dashboard/telefunc-serve.js +0 -108
- package/dist/dashboard/telefunc-serve.js.map +0 -1
- package/dist/dashboard/tickets.d.ts +0 -29
- package/dist/dashboard/tickets.d.ts.map +0 -1
- package/dist/dashboard/tickets.js +0 -38
- package/dist/dashboard/tickets.js.map +0 -1
- package/dist/dashboard/widget-serve.d.ts +0 -15
- package/dist/dashboard/widget-serve.d.ts.map +0 -1
- package/dist/dashboard/widget-serve.js +0 -45
- package/dist/dashboard/widget-serve.js.map +0 -1
- package/dist/dashboard-bundle/assets/main-B3HghPQy.css +0 -2
- package/dist/dashboard-bundle/assets/main-om0WOAku.js +0 -140
- package/dist/dashboard-client/assets/chunks/chunk-BF9pJudf.js +0 -4
- package/dist/dashboard-client/assets/entries/entry-client-routing.CT1e9F0o.js +0 -1
- package/dist/dashboard-client/assets/entries/pages_index.CkW5JQ8X.js +0 -428
- package/dist/dashboard-client/assets/static/layouts_tailwind-00e65532.8OjKGAbA.css +0 -2
- package/dist/dashboard-client/index.html +0 -27
- package/dist/dashboard-client/index.pageContext.json +0 -1
- package/dist/dashboard-client/logo-animated.svg +0 -34
- package/dist/dashboard-client/logo.svg +0 -16
- package/dist/dashboard-rpc/control.telefunc.d.ts +0 -176
- package/dist/dashboard-rpc/control.telefunc.d.ts.map +0 -1
- package/dist/dashboard-rpc/control.telefunc.js +0 -373
- package/dist/dashboard-rpc/control.telefunc.js.map +0 -1
- package/dist/dashboard-rpc/devices.telefunc.d.ts +0 -9
- package/dist/dashboard-rpc/devices.telefunc.d.ts.map +0 -1
- package/dist/dashboard-rpc/devices.telefunc.js +0 -12
- package/dist/dashboard-rpc/devices.telefunc.js.map +0 -1
- package/dist/dashboard-rpc/events.telefunc.d.ts +0 -36
- package/dist/dashboard-rpc/events.telefunc.d.ts.map +0 -1
- package/dist/dashboard-rpc/events.telefunc.js +0 -70
- package/dist/dashboard-rpc/events.telefunc.js.map +0 -1
- package/dist/dashboard-rpc/preferences.telefunc.d.ts +0 -97
- package/dist/dashboard-rpc/preferences.telefunc.d.ts.map +0 -1
- package/dist/dashboard-rpc/preferences.telefunc.js +0 -157
- package/dist/dashboard-rpc/preferences.telefunc.js.map +0 -1
- package/dist/dashboard-rpc/projects.telefunc.d.ts +0 -56
- package/dist/dashboard-rpc/projects.telefunc.d.ts.map +0 -1
- package/dist/dashboard-rpc/projects.telefunc.js +0 -96
- package/dist/dashboard-rpc/projects.telefunc.js.map +0 -1
- package/dist/dashboard-rpc/quota.telefunc.d.ts +0 -40
- package/dist/dashboard-rpc/quota.telefunc.d.ts.map +0 -1
- package/dist/dashboard-rpc/quota.telefunc.js +0 -84
- package/dist/dashboard-rpc/quota.telefunc.js.map +0 -1
- package/dist/dashboard-rpc/reads.telefunc.d.ts +0 -197
- package/dist/dashboard-rpc/reads.telefunc.d.ts.map +0 -1
- package/dist/dashboard-rpc/reads.telefunc.js +0 -403
- package/dist/dashboard-rpc/reads.telefunc.js.map +0 -1
- package/dist/dashboard-rpc/register.d.ts +0 -18
- package/dist/dashboard-rpc/register.d.ts.map +0 -1
- package/dist/dashboard-rpc/register.js +0 -66
- package/dist/dashboard-rpc/register.js.map +0 -1
- package/dist/dashboard-rpc/relay-run.d.ts +0 -9
- package/dist/dashboard-rpc/relay-run.d.ts.map +0 -1
- package/dist/dashboard-rpc/relay-run.js +0 -21
- package/dist/dashboard-rpc/relay-run.js.map +0 -1
- package/dist/dashboard-rpc/stream-channel.d.ts +0 -23
- package/dist/dashboard-rpc/stream-channel.d.ts.map +0 -1
- package/dist/dashboard-rpc/stream-channel.js +0 -52
- package/dist/dashboard-rpc/stream-channel.js.map +0 -1
- package/dist/dashboard-rpc/subagents.d.ts +0 -12
- package/dist/dashboard-rpc/subagents.d.ts.map +0 -1
- package/dist/dashboard-rpc/subagents.js +0 -13
- package/dist/dashboard-rpc/subagents.js.map +0 -1
- package/dist/dashboard-rpc/widgets.d.ts +0 -33
- package/dist/dashboard-rpc/widgets.d.ts.map +0 -1
- package/dist/dashboard-rpc/widgets.js +0 -54
- package/dist/dashboard-rpc/widgets.js.map +0 -1
- package/dist/data-branch.d.ts +0 -120
- package/dist/data-branch.d.ts.map +0 -1
- package/dist/data-branch.js +0 -319
- package/dist/data-branch.js.map +0 -1
- package/dist/discord/bot.d.ts +0 -61
- package/dist/discord/bot.d.ts.map +0 -1
- package/dist/discord/bot.js +0 -94
- package/dist/discord/bot.js.map +0 -1
- package/dist/discord/gateway.d.ts +0 -137
- package/dist/discord/gateway.d.ts.map +0 -1
- package/dist/discord/gateway.js +0 -315
- package/dist/discord/gateway.js.map +0 -1
- package/dist/discord/live-run.d.ts +0 -31
- package/dist/discord/live-run.d.ts.map +0 -1
- package/dist/discord/live-run.js +0 -57
- package/dist/discord/live-run.js.map +0 -1
- package/dist/discord/reply-mirror.d.ts +0 -83
- package/dist/discord/reply-mirror.d.ts.map +0 -1
- package/dist/discord/reply-mirror.js +0 -84
- package/dist/discord/reply-mirror.js.map +0 -1
- package/dist/discord/rest.d.ts +0 -20
- package/dist/discord/rest.d.ts.map +0 -1
- package/dist/discord/rest.js +0 -41
- package/dist/discord/rest.js.map +0 -1
- package/dist/discord/routing.d.ts +0 -81
- package/dist/discord/routing.d.ts.map +0 -1
- package/dist/discord/routing.js +0 -91
- package/dist/discord/routing.js.map +0 -1
- package/dist/discord-credentials-store.d.ts +0 -14
- package/dist/discord-credentials-store.d.ts.map +0 -1
- package/dist/discord-credentials-store.js +0 -53
- package/dist/discord-credentials-store.js.map +0 -1
- package/dist/discord-credentials.d.ts +0 -80
- package/dist/discord-credentials.d.ts.map +0 -1
- package/dist/discord-credentials.js +0 -55
- package/dist/discord-credentials.js.map +0 -1
- package/dist/driver/actions-zip.d.ts +0 -2
- package/dist/driver/actions-zip.d.ts.map +0 -1
- package/dist/driver/actions-zip.js +0 -70
- package/dist/driver/actions-zip.js.map +0 -1
- package/dist/driver/actions.d.ts +0 -130
- package/dist/driver/actions.d.ts.map +0 -1
- package/dist/driver/actions.js +0 -261
- package/dist/driver/actions.js.map +0 -1
- package/dist/driver/agent-cli.d.ts +0 -57
- package/dist/driver/agent-cli.d.ts.map +0 -1
- package/dist/driver/agent-cli.js +0 -134
- package/dist/driver/agent-cli.js.map +0 -1
- package/dist/driver/child-registry.d.ts +0 -25
- package/dist/driver/child-registry.d.ts.map +0 -1
- package/dist/driver/child-registry.js +0 -53
- package/dist/driver/child-registry.js.map +0 -1
- package/dist/driver/claude-code-quota.d.ts +0 -40
- package/dist/driver/claude-code-quota.d.ts.map +0 -1
- package/dist/driver/claude-code-quota.js +0 -144
- package/dist/driver/claude-code-quota.js.map +0 -1
- package/dist/driver/claude-code.d.ts +0 -104
- package/dist/driver/claude-code.d.ts.map +0 -1
- package/dist/driver/claude-code.js +0 -314
- package/dist/driver/claude-code.js.map +0 -1
- package/dist/driver/cli-session.d.ts +0 -57
- package/dist/driver/cli-session.d.ts.map +0 -1
- package/dist/driver/cli-session.js +0 -134
- package/dist/driver/cli-session.js.map +0 -1
- package/dist/driver/cloud.d.ts +0 -109
- package/dist/driver/cloud.d.ts.map +0 -1
- package/dist/driver/cloud.js +0 -232
- package/dist/driver/cloud.js.map +0 -1
- package/dist/driver/codex.d.ts +0 -99
- package/dist/driver/codex.d.ts.map +0 -1
- package/dist/driver/codex.js +0 -190
- package/dist/driver/codex.js.map +0 -1
- package/dist/driver/fake.d.ts +0 -54
- package/dist/driver/fake.d.ts.map +0 -1
- package/dist/driver/fake.js +0 -73
- package/dist/driver/fake.js.map +0 -1
- package/dist/driver/index.d.ts +0 -10
- package/dist/driver/index.d.ts.map +0 -1
- package/dist/driver/index.js +0 -14
- package/dist/driver/index.js.map +0 -1
- package/dist/driver/session-support.d.ts +0 -14
- package/dist/driver/session-support.d.ts.map +0 -1
- package/dist/driver/session-support.js +0 -37
- package/dist/driver/session-support.js.map +0 -1
- package/dist/driver/types.d.ts +0 -310
- package/dist/driver/types.d.ts.map +0 -1
- package/dist/driver/types.js +0 -5
- package/dist/driver/types.js.map +0 -1
- package/dist/driver-cli.d.ts +0 -61
- package/dist/driver-cli.d.ts.map +0 -1
- package/dist/driver-cli.js +0 -66
- package/dist/driver-cli.js.map +0 -1
- package/dist/fake-script.d.ts +0 -15
- package/dist/fake-script.d.ts.map +0 -1
- package/dist/fake-script.js +0 -58
- package/dist/fake-script.js.map +0 -1
- package/dist/framework-dir.d.ts +0 -11
- package/dist/framework-dir.d.ts.map +0 -1
- package/dist/framework-dir.js +0 -11
- package/dist/framework-dir.js.map +0 -1
- package/dist/framework-gitignore.d.ts +0 -12
- package/dist/framework-gitignore.d.ts.map +0 -1
- package/dist/framework-gitignore.js +0 -19
- package/dist/framework-gitignore.js.map +0 -1
- package/dist/gate-keepalive.d.ts +0 -47
- package/dist/gate-keepalive.d.ts.map +0 -1
- package/dist/gate-keepalive.js +0 -62
- package/dist/gate-keepalive.js.map +0 -1
- package/dist/git-exclude.d.ts +0 -11
- package/dist/git-exclude.d.ts.map +0 -1
- package/dist/git-exclude.js +0 -23
- package/dist/git-exclude.js.map +0 -1
- package/dist/handoff-level.d.ts +0 -56
- package/dist/handoff-level.d.ts.map +0 -1
- package/dist/handoff-level.js +0 -62
- package/dist/handoff-level.js.map +0 -1
- package/dist/host-exec.d.ts +0 -21
- package/dist/host-exec.d.ts.map +0 -1
- package/dist/host-exec.js +0 -30
- package/dist/host-exec.js.map +0 -1
- package/dist/layout.d.ts +0 -41
- package/dist/layout.d.ts.map +0 -1
- package/dist/layout.js +0 -69
- package/dist/layout.js.map +0 -1
- package/dist/logs.d.ts +0 -73
- package/dist/logs.d.ts.map +0 -1
- package/dist/logs.js +0 -218
- package/dist/logs.js.map +0 -1
- package/dist/maintenance.d.ts +0 -90
- package/dist/maintenance.d.ts.map +0 -1
- package/dist/maintenance.js +0 -141
- package/dist/maintenance.js.map +0 -1
- package/dist/merged-worktrees.d.ts +0 -74
- package/dist/merged-worktrees.d.ts.map +0 -1
- package/dist/merged-worktrees.js +0 -84
- package/dist/merged-worktrees.js.map +0 -1
- package/dist/module-types/src/dashboard/agent-tree.d.ts +0 -105
- package/dist/module-types/src/dashboard/file-diff.d.ts +0 -66
- package/dist/module-types/src/dashboard/file-read.d.ts +0 -41
- package/dist/module-types/src/dashboard/file-status.d.ts +0 -20
- package/dist/module-types/src/dashboard/scheduler-state.d.ts +0 -72
- package/dist/module-types/src/dashboard/subagent-settings.d.ts +0 -25
- package/dist/module-types/src/dashboard-rpc/subagents.d.ts +0 -11
- package/dist/module-types/src/framework-dir.d.ts +0 -10
- package/dist/module-types/src/framework-gitignore.d.ts +0 -11
- package/dist/module-types/src/subagent-settings.d.ts +0 -26
- package/dist/on-before-mergeable-prompt.d.ts +0 -32
- package/dist/on-before-mergeable-prompt.d.ts.map +0 -1
- package/dist/on-before-mergeable-prompt.js +0 -26
- package/dist/on-before-mergeable-prompt.js.map +0 -1
- package/dist/planned-quick-wins.d.ts +0 -102
- package/dist/planned-quick-wins.d.ts.map +0 -1
- package/dist/planned-quick-wins.js +0 -171
- package/dist/planned-quick-wins.js.map +0 -1
- package/dist/preflight.d.ts +0 -77
- package/dist/preflight.d.ts.map +0 -1
- package/dist/preflight.js +0 -91
- package/dist/preflight.js.map +0 -1
- package/dist/preset-catalog.d.ts +0 -98
- package/dist/preset-catalog.d.ts.map +0 -1
- package/dist/preset-catalog.js +0 -129
- package/dist/preset-catalog.js.map +0 -1
- package/dist/preset-prompt.d.ts +0 -81
- package/dist/preset-prompt.d.ts.map +0 -1
- package/dist/preset-prompt.js +0 -51
- package/dist/preset-prompt.js.map +0 -1
- package/dist/preset-registry.d.ts +0 -32
- package/dist/preset-registry.d.ts.map +0 -1
- package/dist/preset-registry.js +0 -35
- package/dist/preset-registry.js.map +0 -1
- package/dist/presets.d.ts +0 -20
- package/dist/presets.d.ts.map +0 -1
- package/dist/presets.js +0 -33
- package/dist/presets.js.map +0 -1
- package/dist/preview-runtime.d.ts +0 -33
- package/dist/preview-runtime.d.ts.map +0 -1
- package/dist/preview-runtime.js +0 -96
- package/dist/preview-runtime.js.map +0 -1
- package/dist/preview.d.ts +0 -78
- package/dist/preview.d.ts.map +0 -1
- package/dist/preview.js +0 -301
- package/dist/preview.js.map +0 -1
- package/dist/project-widgets.d.ts +0 -46
- package/dist/project-widgets.d.ts.map +0 -1
- package/dist/project-widgets.js +0 -93
- package/dist/project-widgets.js.map +0 -1
- package/dist/prompt-run.d.ts +0 -104
- package/dist/prompt-run.d.ts.map +0 -1
- package/dist/prompt-run.js +0 -112
- package/dist/prompt-run.js.map +0 -1
- package/dist/prompt-template.d.ts +0 -16
- package/dist/prompt-template.d.ts.map +0 -1
- package/dist/prompt-template.js +0 -56
- package/dist/prompt-template.js.map +0 -1
- package/dist/prompts.generated.d.ts +0 -53
- package/dist/prompts.generated.d.ts.map +0 -1
- package/dist/prompts.generated.js +0 -55
- package/dist/prompts.generated.js.map +0 -1
- package/dist/queue-promote.d.ts +0 -70
- package/dist/queue-promote.d.ts.map +0 -1
- package/dist/queue-promote.js +0 -118
- package/dist/queue-promote.js.map +0 -1
- package/dist/relay.d.ts +0 -84
- package/dist/relay.d.ts.map +0 -1
- package/dist/relay.js +0 -199
- package/dist/relay.js.map +0 -1
- package/dist/repos-directory.d.ts +0 -19
- package/dist/repos-directory.d.ts.map +0 -1
- package/dist/repos-directory.js +0 -23
- package/dist/repos-directory.js.map +0 -1
- package/dist/retired-project-settings.d.ts +0 -43
- package/dist/retired-project-settings.d.ts.map +0 -1
- package/dist/retired-project-settings.js +0 -125
- package/dist/retired-project-settings.js.map +0 -1
- package/dist/routine-locks.d.ts +0 -53
- package/dist/routine-locks.d.ts.map +0 -1
- package/dist/routine-locks.js +0 -125
- package/dist/routine-locks.js.map +0 -1
- package/dist/run-driver.d.ts +0 -26
- package/dist/run-driver.d.ts.map +0 -1
- package/dist/run-driver.js +0 -17
- package/dist/run-driver.js.map +0 -1
- package/dist/run-locks.d.ts +0 -3
- package/dist/run-locks.d.ts.map +0 -1
- package/dist/run-locks.js +0 -39
- package/dist/run-locks.js.map +0 -1
- package/dist/run-messages.d.ts +0 -64
- package/dist/run-messages.d.ts.map +0 -1
- package/dist/run-messages.js +0 -76
- package/dist/run-messages.js.map +0 -1
- package/dist/run-options.d.ts +0 -53
- package/dist/run-options.d.ts.map +0 -1
- package/dist/run-options.js +0 -110
- package/dist/run-options.js.map +0 -1
- package/dist/run-telemetry.d.ts +0 -115
- package/dist/run-telemetry.d.ts.map +0 -1
- package/dist/run-telemetry.js +0 -137
- package/dist/run-telemetry.js.map +0 -1
- package/dist/run-view.d.ts +0 -109
- package/dist/run-view.d.ts.map +0 -1
- package/dist/run-view.js +0 -118
- package/dist/run-view.js.map +0 -1
- package/dist/run.d.ts +0 -261
- package/dist/run.d.ts.map +0 -1
- package/dist/run.js +0 -420
- package/dist/run.js.map +0 -1
- package/dist/runtime-keys.d.ts +0 -17
- package/dist/runtime-keys.d.ts.map +0 -1
- package/dist/runtime-keys.js +0 -17
- package/dist/runtime-keys.js.map +0 -1
- package/dist/sandbox.d.ts +0 -27
- package/dist/sandbox.d.ts.map +0 -1
- package/dist/sandbox.js +0 -63
- package/dist/sandbox.js.map +0 -1
- package/dist/session-link.d.ts +0 -19
- package/dist/session-link.d.ts.map +0 -1
- package/dist/session-link.js +0 -26
- package/dist/session-link.js.map +0 -1
- package/dist/sessions.d.ts +0 -77
- package/dist/sessions.d.ts.map +0 -1
- package/dist/sessions.js +0 -146
- package/dist/sessions.js.map +0 -1
- package/dist/spike-locks.d.ts +0 -75
- package/dist/spike-locks.d.ts.map +0 -1
- package/dist/spike-locks.js +0 -208
- package/dist/spike-locks.js.map +0 -1
- package/dist/stale-branch.d.ts +0 -21
- package/dist/stale-branch.d.ts.map +0 -1
- package/dist/stale-branch.js +0 -32
- package/dist/stale-branch.js.map +0 -1
- package/dist/steps.d.ts +0 -9
- package/dist/steps.d.ts.map +0 -1
- package/dist/steps.js +0 -13
- package/dist/steps.js.map +0 -1
- package/dist/store/forge.d.ts +0 -110
- package/dist/store/forge.d.ts.map +0 -1
- package/dist/store/forge.js +0 -97
- package/dist/store/forge.js.map +0 -1
- package/dist/store/run-checkout.d.ts +0 -33
- package/dist/store/run-checkout.d.ts.map +0 -1
- package/dist/store/run-checkout.js +0 -59
- package/dist/store/run-checkout.js.map +0 -1
- package/dist/store/run-store.d.ts +0 -501
- package/dist/store/run-store.d.ts.map +0 -1
- package/dist/store/run-store.js +0 -806
- package/dist/store/run-store.js.map +0 -1
- package/dist/store/suspend.d.ts +0 -38
- package/dist/store/suspend.d.ts.map +0 -1
- package/dist/store/suspend.js +0 -45
- package/dist/store/suspend.js.map +0 -1
- package/dist/store/worktree-deps.d.ts +0 -30
- package/dist/store/worktree-deps.d.ts.map +0 -1
- package/dist/store/worktree-deps.js +0 -115
- package/dist/store/worktree-deps.js.map +0 -1
- package/dist/store/worktree.d.ts +0 -194
- package/dist/store/worktree.d.ts.map +0 -1
- package/dist/store/worktree.js +0 -331
- package/dist/store/worktree.js.map +0 -1
- package/dist/subagent-settings.d.ts +0 -27
- package/dist/subagent-settings.d.ts.map +0 -1
- package/dist/subagent-settings.js +0 -35
- package/dist/subagent-settings.js.map +0 -1
- package/dist/system-prompt-file.d.ts +0 -18
- package/dist/system-prompt-file.d.ts.map +0 -1
- package/dist/system-prompt-file.js +0 -28
- package/dist/system-prompt-file.js.map +0 -1
- package/dist/system-prompt.d.ts +0 -148
- package/dist/system-prompt.d.ts.map +0 -1
- package/dist/system-prompt.js +0 -170
- package/dist/system-prompt.js.map +0 -1
- package/dist/target-driver.d.ts +0 -28
- package/dist/target-driver.d.ts.map +0 -1
- package/dist/target-driver.js +0 -18
- package/dist/target-driver.js.map +0 -1
- package/dist/ticket-locks.d.ts +0 -61
- package/dist/ticket-locks.d.ts.map +0 -1
- package/dist/ticket-locks.js +0 -137
- package/dist/ticket-locks.js.map +0 -1
- package/dist/tickets-file.d.ts +0 -7
- package/dist/tickets-file.d.ts.map +0 -1
- package/dist/tickets-file.js +0 -21
- package/dist/tickets-file.js.map +0 -1
- package/dist/tickets.d.ts +0 -18
- package/dist/tickets.d.ts.map +0 -1
- package/dist/tickets.js +0 -23
- package/dist/tickets.js.map +0 -1
- package/dist/todo-loop.d.ts +0 -110
- package/dist/todo-loop.d.ts.map +0 -1
- package/dist/todo-loop.js +0 -175
- package/dist/todo-loop.js.map +0 -1
- package/dist/turn-gate.d.ts +0 -144
- package/dist/turn-gate.d.ts.map +0 -1
- package/dist/turn-gate.js +0 -217
- package/dist/turn-gate.js.map +0 -1
- package/dist/usage.d.ts +0 -32
- package/dist/usage.d.ts.map +0 -1
- package/dist/usage.js +0 -46
- package/dist/usage.js.map +0 -1
- package/dist/widget-types/dashboard/components/LinkActions.d.ts +0 -26
- package/dist/widget-types/dashboard/components/Markdown.d.ts +0 -4
- package/dist/widget-types/dashboard/components/StartAgentButton.d.ts +0 -39
- package/dist/widget-types/dashboard/components/ui/badge.d.ts +0 -2
- package/dist/widget-types/dashboard/components/ui/button.d.ts +0 -10
- package/dist/widget-types/dashboard/components/ui/card.d.ts +0 -5
- package/dist/widget-types/dashboard/components/ui/checkbox.d.ts +0 -7
- package/dist/widget-types/dashboard/components/ui/dropdown-menu.d.ts +0 -16
- package/dist/widget-types/dashboard/components/ui/input.d.ts +0 -2
- package/dist/widget-types/dashboard/components/ui/option-label.d.ts +0 -4
- package/dist/widget-types/dashboard/components/ui/popover.d.ts +0 -8
- package/dist/widget-types/dashboard/components/ui/scroll-area.d.ts +0 -10
- package/dist/widget-types/dashboard/components/ui/separator.d.ts +0 -3
- package/dist/widget-types/dashboard/components/ui/skeleton.d.ts +0 -2
- package/dist/widget-types/dashboard/components/ui/slider.d.ts +0 -9
- package/dist/widget-types/dashboard/components/ui/tooltip.d.ts +0 -11
- package/dist/widget-types/dashboard/lib/draft-handoff.d.ts +0 -15
- package/dist/widget-types/dashboard/lib/format-date.d.ts +0 -51
- package/dist/widget-types/dashboard/lib/host-services.d.ts +0 -12
- package/dist/widget-types/dashboard/lib/route.d.ts +0 -24
- package/dist/widget-types/dashboard/lib/rpc.d.ts +0 -31
- package/dist/widget-types/dashboard/lib/use-action.d.ts +0 -25
- package/dist/widget-types/dashboard/lib/use-async.d.ts +0 -39
- package/dist/widget-types/dashboard/lib/use-widgets.d.ts +0 -42
- package/dist/widget-types/dashboard/lib/utils.d.ts +0 -3
- package/dist/widget-types/dashboard/rpc/widgets.d.ts +0 -4
- package/dist/widget-types/dashboard/widget/index.d.ts +0 -207
- package/dist/widget-types/src/agent-id.d.ts +0 -12
- package/dist/widget-types/src/agent-locks.d.ts +0 -2
- package/dist/widget-types/src/agent-view.d.ts +0 -38
- package/dist/widget-types/src/bridge-browser.d.ts +0 -216
- package/dist/widget-types/src/browser-stream.d.ts +0 -19
- package/dist/widget-types/src/browser.d.ts +0 -15
- package/dist/widget-types/src/cli-exec.d.ts +0 -35
- package/dist/widget-types/src/cloud-run-state.d.ts +0 -26
- package/dist/widget-types/src/dashboard/activity.d.ts +0 -40
- package/dist/widget-types/src/dashboard/agent-handoff.d.ts +0 -211
- package/dist/widget-types/src/dashboard/agent-tree.d.ts +0 -105
- package/dist/widget-types/src/dashboard/bridge-endpoints.d.ts +0 -157
- package/dist/widget-types/src/dashboard/bridge-question.d.ts +0 -32
- package/dist/widget-types/src/dashboard/bridge-store.d.ts +0 -178
- package/dist/widget-types/src/dashboard/cache.d.ts +0 -46
- package/dist/widget-types/src/dashboard/content-type.d.ts +0 -2
- package/dist/widget-types/src/dashboard/dashboard.d.ts +0 -37
- package/dist/widget-types/src/dashboard/discord-webhook.d.ts +0 -16
- package/dist/widget-types/src/dashboard/docs.d.ts +0 -38
- package/dist/widget-types/src/dashboard/file-diff.d.ts +0 -66
- package/dist/widget-types/src/dashboard/file-read.d.ts +0 -41
- package/dist/widget-types/src/dashboard/file-status.d.ts +0 -20
- package/dist/widget-types/src/dashboard/gh.d.ts +0 -130
- package/dist/widget-types/src/dashboard/git-status.d.ts +0 -32
- package/dist/widget-types/src/dashboard/github.d.ts +0 -10
- package/dist/widget-types/src/dashboard/http.d.ts +0 -28
- package/dist/widget-types/src/dashboard/interventions.d.ts +0 -66
- package/dist/widget-types/src/dashboard/keys.d.ts +0 -30
- package/dist/widget-types/src/dashboard/models.d.ts +0 -24
- package/dist/widget-types/src/dashboard/open-in-app.d.ts +0 -42
- package/dist/widget-types/src/dashboard/open-questions.d.ts +0 -52
- package/dist/widget-types/src/dashboard/overview.d.ts +0 -77
- package/dist/widget-types/src/dashboard/projects.d.ts +0 -89
- package/dist/widget-types/src/dashboard/pull-requests.d.ts +0 -126
- package/dist/widget-types/src/dashboard/queue.d.ts +0 -16
- package/dist/widget-types/src/dashboard/quota.d.ts +0 -59
- package/dist/widget-types/src/dashboard/remote-run.d.ts +0 -94
- package/dist/widget-types/src/dashboard/rpc-serve.d.ts +0 -102
- package/dist/widget-types/src/dashboard/run-inbox.d.ts +0 -30
- package/dist/widget-types/src/dashboard/scheduler-state.d.ts +0 -64
- package/dist/widget-types/src/dashboard/tickets.d.ts +0 -28
- package/dist/widget-types/src/dashboard/types.d.ts +0 -99
- package/dist/widget-types/src/dashboard/widget-serve.d.ts +0 -14
- package/dist/widget-types/src/dashboard-rpc/context.d.ts +0 -53
- package/dist/widget-types/src/dashboard-rpc/control.d.ts +0 -108
- package/dist/widget-types/src/dashboard-rpc/devices.d.ts +0 -8
- package/dist/widget-types/src/dashboard-rpc/events-tail.d.ts +0 -53
- package/dist/widget-types/src/dashboard-rpc/events.d.ts +0 -29
- package/dist/widget-types/src/dashboard-rpc/index.d.ts +0 -28
- package/dist/widget-types/src/dashboard-rpc/models.d.ts +0 -3
- package/dist/widget-types/src/dashboard-rpc/preferences.d.ts +0 -40
- package/dist/widget-types/src/dashboard-rpc/projects.d.ts +0 -54
- package/dist/widget-types/src/dashboard-rpc/quota.d.ts +0 -26
- package/dist/widget-types/src/dashboard-rpc/reads.d.ts +0 -227
- package/dist/widget-types/src/dashboard-rpc/relay-agent.d.ts +0 -8
- package/dist/widget-types/src/dashboard-rpc/stream-forward.d.ts +0 -16
- package/dist/widget-types/src/dashboard-rpc/widgets.d.ts +0 -32
- package/dist/widget-types/src/discord-credentials.d.ts +0 -79
- package/dist/widget-types/src/driver-names.d.ts +0 -21
- package/dist/widget-types/src/error-message.d.ts +0 -7
- package/dist/widget-types/src/event-stream.d.ts +0 -32
- package/dist/widget-types/src/events.d.ts +0 -235
- package/dist/widget-types/src/framework-dir.d.ts +0 -10
- package/dist/widget-types/src/framework-gitignore.d.ts +0 -11
- package/dist/widget-types/src/index.d.ts +0 -42
- package/dist/widget-types/src/jsonl-tail.d.ts +0 -54
- package/dist/widget-types/src/loopback-host.d.ts +0 -19
- package/dist/widget-types/src/node-fs.d.ts +0 -32
- package/dist/widget-types/src/open-choices.d.ts +0 -14
- package/dist/widget-types/src/pick-directory.d.ts +0 -29
- package/dist/widget-types/src/preference-defaults.d.ts +0 -53
- package/dist/widget-types/src/project-commands.d.ts +0 -23
- package/dist/widget-types/src/project-errors.d.ts +0 -43
- package/dist/widget-types/src/project-hooks.d.ts +0 -133
- package/dist/widget-types/src/project-presets.d.ts +0 -29
- package/dist/widget-types/src/project-widgets.d.ts +0 -45
- package/dist/widget-types/src/project.d.ts +0 -28
- package/dist/widget-types/src/quota-boundary.d.ts +0 -115
- package/dist/widget-types/src/quota-poller.d.ts +0 -82
- package/dist/widget-types/src/registry.d.ts +0 -210
- package/dist/widget-types/src/store/agent-checkout.d.ts +0 -46
- package/dist/widget-types/src/store/agent-store.d.ts +0 -237
- package/dist/widget-types/src/store/branches.d.ts +0 -133
- package/dist/widget-types/src/store/forge.d.ts +0 -109
- package/dist/widget-types/src/store/git-host.d.ts +0 -111
- package/dist/widget-types/src/store/index.d.ts +0 -9
- package/dist/widget-types/src/store/provided.d.ts +0 -16
- package/dist/widget-types/src/store/queue.d.ts +0 -45
- package/dist/widget-types/src/store/run-record.d.ts +0 -21
- package/dist/widget-types/src/store/runs.d.ts +0 -101
- package/dist/widget-types/src/store/tickets.d.ts +0 -72
- package/dist/widget-types/src/tickets.d.ts +0 -17
- package/dist/widget-types/src/worktrees.d.ts +0 -89
- package/dist/widget.css +0 -50
package/dist/auto-pm.js
DELETED
|
@@ -1,707 +0,0 @@
|
|
|
1
|
-
import { presets } from './preset-catalog.js';
|
|
2
|
-
import { DEFAULT_AUTO_PM_CONCURRENCY } from './preference-defaults.js';
|
|
3
|
-
import { agentIdFromStartedAt } from './agent-id.js';
|
|
4
|
-
/**
|
|
5
|
-
* Auto PM (#685): spend leftover subscription quota on product management instead of
|
|
6
|
-
* letting it expire. While the account is still under its quota boundary (#879) and nobody
|
|
7
|
-
* is at the keyboard, the daemon runs the cycle by itself: it starts an agent on the queued work
|
|
8
|
-
* whenever the `agent-data` branch moved (#1774), and once a run finds nothing queued it refills
|
|
9
|
-
* the queue — triaging tickets, then spiking and planning the ones that have neither yet.
|
|
10
|
-
*
|
|
11
|
-
* The daemon reads no queue and names no skill (#1774). It watches one thing, the head of the
|
|
12
|
-
* `agent-data` branch, and reacts to the commits it did not write itself: someone queued an entry,
|
|
13
|
-
* an agent claimed or closed a ticket. The agent started for that reads the skills in its checkout
|
|
14
|
-
* and takes one queued task; its own commits move the branch again, so the daemon fires again as
|
|
15
|
-
* the run ends, and the chain drains the queue by itself. A run that finds nothing writes nothing,
|
|
16
|
-
* and the chain stops. One heartbeat a day is the belt.
|
|
17
|
-
*
|
|
18
|
-
* The whole feature is one policy question ("is now a good time to spend tokens on our
|
|
19
|
-
* own roadmap?"), so that question lives here as a pure function and the daemon only
|
|
20
|
-
* supplies the readings. #298 is the parent idea (background jobs / "max out the usage"),
|
|
21
|
-
* and #879 defines the boundary this reads.
|
|
22
|
-
*/
|
|
23
|
-
/** How often the daemon looks at the branch and re-asks {@link autoPmDecision}: right after each data pull. */
|
|
24
|
-
export const DEFAULT_AUTO_PM_INTERVAL_MS = 60 * 1000;
|
|
25
|
-
/**
|
|
26
|
-
* How long a project is left alone after the rotation starts an agent for it. The rotation
|
|
27
|
-
* invents work on an idle project, and this is what paces it. A move of the branch is never
|
|
28
|
-
* paced: someone, or an agent, asked for that run.
|
|
29
|
-
*/
|
|
30
|
-
const DEFAULT_AUTO_PM_COOLDOWN_MS = 30 * 60 * 1000;
|
|
31
|
-
/**
|
|
32
|
-
* The belt (#1774): a run on the queued work once a day even when nothing moved, so a branch the
|
|
33
|
-
* daemon missed a move on — a range git could not walk, a restart between a push and the look —
|
|
34
|
-
* is looked at by an agent within a day.
|
|
35
|
-
*/
|
|
36
|
-
export const DEFAULT_AUTO_PM_HEARTBEAT_MS = 24 * 60 * 60 * 1000;
|
|
37
|
-
/**
|
|
38
|
-
* Whether the budget allows spending unasked.
|
|
39
|
-
*
|
|
40
|
-
* The gate is the quota boundary (#879): the pro-rated share of the week's allowance elapsed so
|
|
41
|
-
* far, rising continuously with the clock (#960 Edit), so auto PM spends up to that line and
|
|
42
|
-
* stands down at it. Work the user asks for is free to cross it and borrow against the days still
|
|
43
|
-
* to come; work nobody asked for is exactly what the line is there to stop.
|
|
44
|
-
*
|
|
45
|
-
* **It fails closed on a quota it cannot read, and that is the opposite of the per-agent guard.**
|
|
46
|
-
* #519 settled that an unreadable quota must never *stop* the user's own work, so
|
|
47
|
-
* `startConsumptionGuard` fails open. Quietly burning a subscription on work nobody asked for
|
|
48
|
-
* is a far worse failure than skipping a tick.
|
|
49
|
-
*
|
|
50
|
-
* Reading the account's own week also means a restarted daemon is not blind: the figure is
|
|
51
|
-
* absolute and complete, unlike the delta meter this replaced, which reported zero consumed
|
|
52
|
-
* after a restart however much the account had spent (#848).
|
|
53
|
-
*/
|
|
54
|
-
export function quotaHeadroom(quota) {
|
|
55
|
-
if (!quota)
|
|
56
|
-
return { start: false, reason: 'the quota could not be read, so there is no way to tell what is spare' };
|
|
57
|
-
const reached = quota.reached;
|
|
58
|
-
if (reached) {
|
|
59
|
-
// Name the line it actually stopped at (#960). With the slider moved, saying "the week's 43%"
|
|
60
|
-
// when the agent stopped at 63% would send someone looking for a bug that is a setting.
|
|
61
|
-
// The offset is rounded to one decimal for the sentence: a dragged slider stores integers,
|
|
62
|
-
// but the half-day default (#960 Edit) is 100/14 and fifteen digits of it would say less.
|
|
63
|
-
const { limit, boundary } = quota;
|
|
64
|
-
const offsetText = `${limit.offset > 0 ? '+' : ''}${Math.round(limit.offset * 10) / 10}`;
|
|
65
|
-
const line = limit.offset === 0
|
|
66
|
-
? `the week's ${Math.round(boundary.percent)}%`
|
|
67
|
-
: `your ${Math.round(limit.percent)}% limit (${offsetText} on the week's ${Math.round(boundary.percent)}%)`;
|
|
68
|
-
return {
|
|
69
|
-
start: false,
|
|
70
|
-
reason: `${reached.label} is ${Math.round(reached.percentUsed)}% used, at or past day ${boundary.day} of ${line}`,
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
return { start: true };
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Whether to start an agent for one project right now. Every condition is a reason to
|
|
77
|
-
* *not* spend the user's quota, checked cheapest first so the common "someone is working"
|
|
78
|
-
* case never reaches the meter.
|
|
79
|
-
*/
|
|
80
|
-
export function autoPmDecision(input) {
|
|
81
|
-
if (!input.enabled)
|
|
82
|
-
return { start: false, reason: 'auto PM is off' };
|
|
83
|
-
const concurrency = Math.max(1, Math.floor(input.concurrency ?? DEFAULT_AUTO_PM_CONCURRENCY));
|
|
84
|
-
if (input.activeAgents >= concurrency) {
|
|
85
|
-
// The cap is named, for the same reason the quota refusal names its line (#960): with the
|
|
86
|
-
// setting raised or lowered, "already going" on its own reads as a bug rather than a setting.
|
|
87
|
-
// At one — what this was before #1204 — the old wording is kept exactly.
|
|
88
|
-
// Which runs, when the reading says (#1646): the one time this wording mattered, the runs it
|
|
89
|
-
// counted were nowhere on the dashboard, and a number could not be questioned.
|
|
90
|
-
const named = input.running?.length ? ` (${input.running.join(', ')})` : '';
|
|
91
|
-
const going = `${input.activeAgents} run${input.activeAgents === 1 ? ' is' : 's are'} already going${named}`;
|
|
92
|
-
return { start: false, reason: concurrency === 1 ? going : `${going}, and the routine keeps at most ${concurrency} at once` };
|
|
93
|
-
}
|
|
94
|
-
const cooldownMs = input.cooldownMs ?? DEFAULT_AUTO_PM_COOLDOWN_MS;
|
|
95
|
-
if (!input.onDemand && input.sinceLastStartMs !== undefined && input.sinceLastStartMs < cooldownMs) {
|
|
96
|
-
return { start: false, reason: 'a run was started for this project a moment ago' };
|
|
97
|
-
}
|
|
98
|
-
return quotaHeadroom(input.quota);
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* The ids a batch is born with (#1748): one per assignment, minted from the sweep's clock the way
|
|
102
|
-
* a start mints them — a millisecond apart, so a batch minted in one tick stays distinct. The
|
|
103
|
-
* lock names the id, the pinned prompt does not have to: `tickets show` names the holder.
|
|
104
|
-
*/
|
|
105
|
-
function mintAgentIds(now, count) {
|
|
106
|
-
return Array.from({ length: count }, (_, i) => agentIdFromStartedAt(new Date(now + i).toISOString()));
|
|
107
|
-
}
|
|
108
|
-
/** An entry as a log line can carry it: one line, bounded. */
|
|
109
|
-
function entryPreview(entry) {
|
|
110
|
-
const flat = entry.replace(/\s+/g, ' ').trim();
|
|
111
|
-
return flat.length > 80 ? `${flat.slice(0, 80)}…` : flat;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* A fan-out job pinned to one locked ticket (#1327).
|
|
115
|
-
*
|
|
116
|
-
* The stock prompt covers every ticket that has no plan or claim yet, and with a batch going out
|
|
117
|
-
* that instruction is a collision: every agent forks the same checkout and would pick the same
|
|
118
|
-
* most-important ticket. The pin is *appended* to the stock prompt rather than spliced into it,
|
|
119
|
-
* so the verdict rules the preset carries keep riding along verbatim and a rewritten preset (the
|
|
120
|
-
* maintainer owns its wording) cannot silently lose the pin.
|
|
121
|
-
*
|
|
122
|
-
* The agent is also told which claim is its own: its ticket's `.lock.md` already exists with the
|
|
123
|
-
* `CLAIMED:` line the daemon pushed (#1420), and finding anything else there means the
|
|
124
|
-
* assignment is stale — another agent's claim, or work that landed meanwhile — so it stops. It
|
|
125
|
-
* is told to delete the lock in the same data-branch commit as the plan (#1582), because nothing
|
|
126
|
-
* else releases it: #1420 removed the staleness timer, so a forgotten lock stands until a human
|
|
127
|
-
* clicks it away.
|
|
128
|
-
*/
|
|
129
|
-
export function pinnedPlanJob(job, assignment) {
|
|
130
|
-
const { ticket, agentId } = assignment;
|
|
131
|
-
const stem = ticket.replace(/\.md$/, '');
|
|
132
|
-
return {
|
|
133
|
-
...job,
|
|
134
|
-
ticket,
|
|
135
|
-
claim: assignment,
|
|
136
|
-
prompt: [
|
|
137
|
-
job.prompt.trimEnd(),
|
|
138
|
-
'',
|
|
139
|
-
`You are one agent of a concurrent batch, so the scope above narrows: plan exactly one ticket, \`tickets/${ticket}\`, and no other.`,
|
|
140
|
-
'',
|
|
141
|
-
`The ticket is already claimed for you (use the \`tickets\` skill): \`tickets show ${ticket}\` names you as its holder. Write the plan with \`tickets put ${stem}.plan.md\`, then lift your claim with \`tickets release ${ticket}\` — the plan is a write to the \`agent-data\` branch, not a PR. If the ticket is not claimed, is claimed by someone else, or already has a plan, it is not yours — stop and do nothing.`,
|
|
142
|
-
].join('\n'),
|
|
143
|
-
describe: `planning "${entryPreview(ticket)}"`,
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* The default cycle: bring the tickets across from GitHub (#1208), triage the quick ones (#891),
|
|
148
|
-
* then the significant-but-agreed ones (#892), and only then make more plans (#685). Planning is
|
|
149
|
-
* the most expensive turn and the one whose output the earlier jobs consume, so it runs last.
|
|
150
|
-
*
|
|
151
|
-
* Importing leads because it is the only job that can add a ticket none of the others have seen
|
|
152
|
-
* (#1334): a routine that triages and plans a set nothing ever refills eventually has nothing
|
|
153
|
-
* left to do, and a new issue would wait for a human to press the button. It is safe to repeat --
|
|
154
|
-
* the preset resumes from `tickets/meta.json`'s `lastImportedAt` and reconciles, so a firing with
|
|
155
|
-
* nothing changed since the last one is a no-op rather than a re-import.
|
|
156
|
-
*
|
|
157
|
-
* This rotation is what #891/#892 mean by "with a cron job regularly firing this preset". No
|
|
158
|
-
* separate scheduler is involved and none is needed: the rotation fires after every run that found
|
|
159
|
-
* nothing queued, which is exactly when the queue wants refilling. That is the opposite of
|
|
160
|
-
* the maintenance sweep (#882), which is paced by a calendar because it looks at static history and
|
|
161
|
-
* would otherwise never come due — hence its own {@link AUTO_PM_MAINTENANCE_JOB} outside the cycle.
|
|
162
|
-
*
|
|
163
|
-
* The presets that end in `<AWAIT>` (Research, Suggest tickets to work on) are deliberately not
|
|
164
|
-
* here: firing one with nobody at the keyboard would park an agent against a human who will never
|
|
165
|
-
* answer.
|
|
166
|
-
*
|
|
167
|
-
* Each triage prompt pins its own session name, so a triage always lands on the same branch. What
|
|
168
|
-
* keeps a rotation from triaging twice is the routine lock (`routine-locks.ts`), taken before the
|
|
169
|
-
* agent starts: a firing that finds the lock held stands down without spending an agent, and the
|
|
170
|
-
* rotation advances past it rather than retrying a job that is already running.
|
|
171
|
-
*/
|
|
172
|
-
export const AUTO_PM_JOBS = [
|
|
173
|
-
{
|
|
174
|
-
name: presets.updateTickets.name,
|
|
175
|
-
prompt: presets.updateTickets.render(),
|
|
176
|
-
label: presets.updateTickets.label,
|
|
177
|
-
tooltip: presets.updateTickets.tooltip,
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
name: presets.triageQuick.name,
|
|
181
|
-
prompt: presets.triageQuick.render(),
|
|
182
|
-
label: presets.triageQuick.label,
|
|
183
|
-
tooltip: presets.triageQuick.tooltip,
|
|
184
|
-
lock: presets.triageQuick.name,
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
name: presets.triageConsensual.name,
|
|
188
|
-
prompt: presets.triageConsensual.render(),
|
|
189
|
-
label: presets.triageConsensual.label,
|
|
190
|
-
tooltip: presets.triageConsensual.tooltip,
|
|
191
|
-
lock: presets.triageConsensual.name,
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
name: presets.planTickets.name,
|
|
195
|
-
prompt: presets.planTickets.render(),
|
|
196
|
-
label: presets.planTickets.label,
|
|
197
|
-
tooltip: presets.planTickets.tooltip,
|
|
198
|
-
fansOut: true,
|
|
199
|
-
},
|
|
200
|
-
];
|
|
201
|
-
/**
|
|
202
|
-
* The command skill the daemon fires on the queued work (#1774): `work-queue`, a skill file the
|
|
203
|
-
* project tracks under `.claude/skills/<command>`, marked so that only a person or the daemon
|
|
204
|
-
* invokes it. Its prompt is the slash command; the agent's harness expands it. The daemon ships
|
|
205
|
-
* no skill file, links none into a checkout and depends on no skill package.
|
|
206
|
-
*/
|
|
207
|
-
export const WORK_QUEUE_SKILL_NAME = 'work-queue';
|
|
208
|
-
/**
|
|
209
|
-
* The job for the queued work (#1774): one agent, told nothing but `/work-queue`, takes one
|
|
210
|
-
* queued task off the queue by composing the skills in its checkout. Outside the rotation on
|
|
211
|
-
* purpose — the rotation is about what to *make* when there is nothing to do, and this is the
|
|
212
|
-
* thing to do. Its label and tooltip are written here: the routine is a skill file, not a preset.
|
|
213
|
-
*/
|
|
214
|
-
export const AUTO_PM_WORK_JOB = {
|
|
215
|
-
name: WORK_QUEUE_SKILL_NAME,
|
|
216
|
-
prompt: `/${WORK_QUEUE_SKILL_NAME}`,
|
|
217
|
-
label: 'Work the queue',
|
|
218
|
-
tooltip: 'Work one queued task off the agent queue, unattended.',
|
|
219
|
-
works: true,
|
|
220
|
-
autoMerge: true,
|
|
221
|
-
};
|
|
222
|
-
/**
|
|
223
|
-
* The periodic codebase-wide sweep (#882): fire the [Maintenance] preset (#881) so a repo that
|
|
224
|
-
* adopted The Framework late gets its pre-existing history looked at.
|
|
225
|
-
*
|
|
226
|
-
* Outside the rotation, like {@link AUTO_PM_WORK_JOB} and for the same kind of reason: the
|
|
227
|
-
* rotation is "what to make next" and cycles on every run that found nothing queued, while this is
|
|
228
|
-
* paced by a calendar and must not advance or be advanced by the cycle. It takes precedence over
|
|
229
|
-
* the rotation when due, because the entries it queues are what the rotation would otherwise be
|
|
230
|
-
* inventing work instead of.
|
|
231
|
-
*
|
|
232
|
-
* The prompt renders at module load with no session, so `tf.params.what` falls back to its
|
|
233
|
-
* default of the entire codebase, which is exactly this job's scope.
|
|
234
|
-
*/
|
|
235
|
-
export const AUTO_PM_MAINTENANCE_JOB = {
|
|
236
|
-
name: presets.maintenance.name,
|
|
237
|
-
prompt: presets.maintenance.render(),
|
|
238
|
-
describe: 'sweeping the codebase for maintenance work',
|
|
239
|
-
label: presets.maintenance.label,
|
|
240
|
-
tooltip: presets.maintenance.tooltip,
|
|
241
|
-
};
|
|
242
|
-
/**
|
|
243
|
-
* Every routine the sweep can fire, in the order a surface should list them (#1159).
|
|
244
|
-
*
|
|
245
|
-
* Derived from the three constants above rather than written out again, so the list the dashboard
|
|
246
|
-
* shows and the jobs the daemon actually runs cannot drift. The order is the sweep's own precedence
|
|
247
|
-
* (#855/#882 read the other way round): the queued work comes first because it is what happens
|
|
248
|
-
* whenever the branch moved, the rotation is what happens when a run found nothing, and the
|
|
249
|
-
* calendar-paced maintenance sweep is the exception outside both.
|
|
250
|
-
*/
|
|
251
|
-
export const AUTO_PM_ROUTINES = [
|
|
252
|
-
AUTO_PM_WORK_JOB,
|
|
253
|
-
...AUTO_PM_JOBS,
|
|
254
|
-
AUTO_PM_MAINTENANCE_JOB,
|
|
255
|
-
];
|
|
256
|
-
/** The sentence a start is reported as: the log line and the outcome message say the same thing. */
|
|
257
|
-
const doing = (job) => job.describe ?? job.label ?? job.name;
|
|
258
|
-
/**
|
|
259
|
-
* Start the auto-PM sweep (#685): every {@link DEFAULT_AUTO_PM_INTERVAL_MS}, look at each
|
|
260
|
-
* project's `agent-data` branch, ask {@link autoPmDecision}, and start an agent for the projects
|
|
261
|
-
* that say yes.
|
|
262
|
-
*
|
|
263
|
-
* Ticks never overlap — a sweep reads a live-agent map that its own `start` calls mutate,
|
|
264
|
-
* so a second sweep running over the first would decide against a stale picture.
|
|
265
|
-
*
|
|
266
|
-
* Nothing here survives the daemon: per #519 a Ctrl+C that stops everything is the feature,
|
|
267
|
-
* not a gap, so this loop is deliberately not restartable from outside the process.
|
|
268
|
-
*/
|
|
269
|
-
export function startAutoPm(deps) {
|
|
270
|
-
const now = deps.now ?? (() => Date.now());
|
|
271
|
-
const intervalMs = deps.intervalMs ?? DEFAULT_AUTO_PM_INTERVAL_MS;
|
|
272
|
-
const heartbeatMs = deps.heartbeatMs ?? DEFAULT_AUTO_PM_HEARTBEAT_MS;
|
|
273
|
-
const startedAt = now();
|
|
274
|
-
// What the last sweep decided, for `report()`. Undefined only in the moment before the
|
|
275
|
-
// start-up sweep below lands.
|
|
276
|
-
let lastSweep;
|
|
277
|
-
// When the rotation last started an agent per project: what the cooldown is measured from.
|
|
278
|
-
const lastStart = new Map();
|
|
279
|
-
// The head of each project's `agent-data` branch as this loop last saw it (#1774). Seeded on the
|
|
280
|
-
// first look and never fired on: a daemon that just started knows nothing about what moved
|
|
281
|
-
// while it was down, and the heartbeat is the belt for that.
|
|
282
|
-
const seen = new Map();
|
|
283
|
-
// Projects whose branch moved by a commit no daemon wrote since the last start on the queued
|
|
284
|
-
// work. Consumed by that start, and by nothing else: a rotation start leaves it standing.
|
|
285
|
-
const moved = new Set();
|
|
286
|
-
// Projects owed a rotation turn (#1774): the last run this loop started there ended without
|
|
287
|
-
// moving the branch — it found nothing queued — so the queue wants refilling. Also every project
|
|
288
|
-
// on its first look, which is the rotation's start-up turn a daemon has always taken.
|
|
289
|
-
const rotationDue = new Set();
|
|
290
|
-
// When the queued work was last started per project, for the daily heartbeat. Seeded at the
|
|
291
|
-
// first look, so the first heartbeat is a day after the daemon started.
|
|
292
|
-
const lastWork = new Map();
|
|
293
|
-
const pending = new Map();
|
|
294
|
-
// Tickets whose plan agent ended with nothing to hand off (#1583). Releasing such a claim
|
|
295
|
-
// re-opens the work, and a job that deterministically ends commitless would otherwise respawn
|
|
296
|
-
// every cooldown, forever, burning a quota run per cycle. One attempt per daemon lifetime: a
|
|
297
|
-
// restart forgets the set, which allows one more try rather than forbidding the work for good —
|
|
298
|
-
// a human retires or fixes the ticket in between.
|
|
299
|
-
const endedDry = new Map();
|
|
300
|
-
// Where each project is in the job cycle. Per project, not global: two repos idle at once
|
|
301
|
-
// should each work through the rotation, not take alternate halves of it.
|
|
302
|
-
const nextJob = new Map();
|
|
303
|
-
// Projects this loop has swept at least once, for the one-time boot release above.
|
|
304
|
-
const swept = new Set();
|
|
305
|
-
// The last sentence said per project, so a stand-down that holds for a day is logged once, not
|
|
306
|
-
// once a minute: the loop looks every minute now (#1774), and the log is a person's to read.
|
|
307
|
-
const lastSaid = new Map();
|
|
308
|
-
let sweeping = false;
|
|
309
|
-
let stopped = false;
|
|
310
|
-
const tick = async (opts) => {
|
|
311
|
-
if (stopped || sweeping)
|
|
312
|
-
return;
|
|
313
|
-
sweeping = true;
|
|
314
|
-
let enabled = false;
|
|
315
|
-
const outcomes = [];
|
|
316
|
-
// Every branch that logs also records, so the panel says exactly what the log says. A start
|
|
317
|
-
// is always logged; a stand-down only when it is news.
|
|
318
|
-
const note = (project, started, message) => {
|
|
319
|
-
outcomes.push({ projectId: project.id, path: project.path, started, message });
|
|
320
|
-
if (started) {
|
|
321
|
-
lastSaid.delete(project.id);
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
if (lastSaid.get(project.id) === message)
|
|
325
|
-
return;
|
|
326
|
-
lastSaid.set(project.id, message);
|
|
327
|
-
deps.log(`[framework] auto PM: standing down for ${project.path} — ${message}`);
|
|
328
|
-
};
|
|
329
|
-
try {
|
|
330
|
-
// The preference is the cheapest gate and the one the user flips most, so it is read
|
|
331
|
-
// once per sweep rather than per project. An on-demand sweep outranks it — the click is
|
|
332
|
-
// the consent the preference exists to record — but still reads it, so the report says
|
|
333
|
-
// where the box stood.
|
|
334
|
-
enabled = await deps.enabled().catch(() => false);
|
|
335
|
-
if (!enabled && !opts?.onDemand)
|
|
336
|
-
return;
|
|
337
|
-
const all = await deps.projects().catch(() => []);
|
|
338
|
-
// A Run now fired from a card names the project its picker shows; the scheduled sweep names
|
|
339
|
-
// none and visits them all. An id matching nothing leaves an empty list, which stands the
|
|
340
|
-
// sweep down rather than silently widening it to every project.
|
|
341
|
-
const projects = opts?.projectId ? all.filter(project => project.id === opts.projectId) : all;
|
|
342
|
-
if (!projects.length)
|
|
343
|
-
return;
|
|
344
|
-
// Read beside the master switch and for the same reason (#1209): it is the same preference
|
|
345
|
-
// file, and a routine switched off mid-sweep should not fire for the projects still to come.
|
|
346
|
-
const optedOut = new Set(await deps.optedOut?.().catch(() => []) ?? []);
|
|
347
|
-
const wanted = (job) => (job && !optedOut.has(job.name) ? job : undefined);
|
|
348
|
-
// The rotation, minus what is switched off. Filtered rather than skipped at the index, so
|
|
349
|
-
// the cycle stays a cycle: with two of four off, the remaining two alternate instead of
|
|
350
|
-
// every other tick landing on a job that cannot run.
|
|
351
|
-
const rotation = deps.jobs.filter(job => !optedOut.has(job.name));
|
|
352
|
-
// How many agents each project may keep going (#1204). Read beside the opt-outs and for the
|
|
353
|
-
// same reason: it is the same preference file, re-read so the setting takes effect
|
|
354
|
-
// mid-schedule. Floored at one, since zero agents is the master switch's job.
|
|
355
|
-
const concurrency = Math.max(1, Math.floor((await deps.concurrency?.().catch(() => undefined)) ?? DEFAULT_AUTO_PM_CONCURRENCY));
|
|
356
|
-
for (const project of projects) {
|
|
357
|
-
// A previous daemon's routine locks go on this project's first sweep (#1659): their runs
|
|
358
|
-
// are not in `pending`, so nothing below would ever release them.
|
|
359
|
-
if (!swept.has(project.id)) {
|
|
360
|
-
swept.add(project.id);
|
|
361
|
-
await deps.releaseDeadLocks?.(project).catch(() => undefined);
|
|
362
|
-
}
|
|
363
|
-
// The one reading this loop acts on (#1774): the branch's head, against the head it last
|
|
364
|
-
// saw. The first look only remembers it — and owes the rotation its start-up turn, which
|
|
365
|
-
// a daemon has always taken. A later look that finds a commit no daemon wrote is a move.
|
|
366
|
-
const head = await deps.dataHead(project).catch(() => undefined);
|
|
367
|
-
if (head === undefined) {
|
|
368
|
-
note(project, false, 'the agent-data branch could not be read, so there is no way to tell whether anything moved');
|
|
369
|
-
continue;
|
|
370
|
-
}
|
|
371
|
-
const was = seen.get(project.id);
|
|
372
|
-
if (was === undefined) {
|
|
373
|
-
seen.set(project.id, head);
|
|
374
|
-
rotationDue.add(project.id);
|
|
375
|
-
lastWork.set(project.id, now());
|
|
376
|
-
}
|
|
377
|
-
else if (head !== was) {
|
|
378
|
-
seen.set(project.id, head);
|
|
379
|
-
if ((await deps.foreignCommits(project, was, head).catch(() => 0)) > 0)
|
|
380
|
-
moved.add(project.id);
|
|
381
|
-
}
|
|
382
|
-
// Close out the runs a previous sweep started before deciding: a finished routine's lock
|
|
383
|
-
// is released, a claim its agent abandoned is freed, and a run that ended without moving
|
|
384
|
-
// the branch earns the rotation its turn.
|
|
385
|
-
const outstanding = pending.get(project.id) ?? [];
|
|
386
|
-
if (outstanding.length) {
|
|
387
|
-
const stillPending = [];
|
|
388
|
-
for (const agent of outstanding) {
|
|
389
|
-
const outcome = await deps.settled(project, agent).catch(() => ({ settled: false }));
|
|
390
|
-
if (!outcome.settled) {
|
|
391
|
-
stillPending.push(agent);
|
|
392
|
-
continue;
|
|
393
|
-
}
|
|
394
|
-
// The run ended cleanly but its epilogue has not reported yet — `end` lands before
|
|
395
|
-
// the handoff event does — and the ending is the one fact the release keys off, so a
|
|
396
|
-
// claim-carrying agent caught in that gap is held a couple more sweeps rather than
|
|
397
|
-
// settled blind. Bounded, so a process that died mid-epilogue cannot hold its claim
|
|
398
|
-
// forever; past the bound it settles unread, which is the pre-#1583 behavior.
|
|
399
|
-
if (agent.claim && outcome.handoffPending && (agent.waits ?? 0) < 2) {
|
|
400
|
-
stillPending.push({ ...agent, waits: (agent.waits ?? 0) + 1 });
|
|
401
|
-
continue;
|
|
402
|
-
}
|
|
403
|
-
// A settled run that ended with nothing to hand off is never opening the PR that
|
|
404
|
-
// lifts the lock it was started under (#1583), so the claim minted for it is freed —
|
|
405
|
-
// the one dead claim the sweep can *know* is dead, rather than guess by a timer. A
|
|
406
|
-
// release that could not land is retried next sweep, bounded like the hold above.
|
|
407
|
-
if (agent.claim && outcome.handoffSkip === 'no-commits' && deps.releaseLock) {
|
|
408
|
-
// Remembered before the release, not after: respawning the same work is the hazard
|
|
409
|
-
// whether or not the release lands.
|
|
410
|
-
const dry = endedDry.get(project.id) ?? new Set();
|
|
411
|
-
dry.add(agent.claim.ticket);
|
|
412
|
-
endedDry.set(project.id, dry);
|
|
413
|
-
const ok = await deps.releaseLock(project, agent.claim).catch(() => false);
|
|
414
|
-
if (!ok && (agent.waits ?? 0) < 2) {
|
|
415
|
-
stillPending.push({ ...agent, waits: (agent.waits ?? 0) + 1 });
|
|
416
|
-
continue;
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
// A routine's lock lifts with its run, whatever the ending (#1659): no PR of the
|
|
420
|
-
// agent's is ever going to. Retried next sweep when the release could not land.
|
|
421
|
-
if (agent.lock && deps.releaseRoutine && !(await deps.releaseRoutine(project, agent.lock).catch(() => false))) {
|
|
422
|
-
if ((agent.waits ?? 0) < 2)
|
|
423
|
-
stillPending.push({ ...agent, waits: (agent.waits ?? 0) + 1 });
|
|
424
|
-
continue;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
if (stillPending.length)
|
|
428
|
-
pending.set(project.id, stillPending);
|
|
429
|
-
else
|
|
430
|
-
pending.delete(project.id);
|
|
431
|
-
// The chain's end (#1774): every run this loop started has ended, and none of them
|
|
432
|
-
// moved the branch — the last one found nothing queued. The queue wants refilling, so
|
|
433
|
-
// the rotation gets the next turn. While a run is still going its commits may yet
|
|
434
|
-
// arrive, so the judgement waits for it.
|
|
435
|
-
if (!stillPending.length && !moved.has(project.id))
|
|
436
|
-
rotationDue.add(project.id);
|
|
437
|
-
}
|
|
438
|
-
// Per project, because the model the work would run on is (#1619). It costs no reading:
|
|
439
|
-
// the meter is polled elsewhere and this only measures the last one against the boundary.
|
|
440
|
-
const quota = await deps.quota(project).catch(() => undefined);
|
|
441
|
-
const running = deps.activeAgents(project);
|
|
442
|
-
const activeAgents = running.length;
|
|
443
|
-
const workJob = wanted(deps.workJob ?? AUTO_PM_WORK_JOB);
|
|
444
|
-
// The planning routine this click asked for, read off the *enabled* rotation so an
|
|
445
|
-
// unticked box stands the click down instead of firing a routine the card shows as off.
|
|
446
|
-
// `fansOut` rather than a name, for the same no-name-matching reason the job carries the
|
|
447
|
-
// property at all.
|
|
448
|
-
const planJob = opts?.only === 'plan' ? rotation.find(item => item.fansOut) : undefined;
|
|
449
|
-
if (opts?.only === 'plan' && !planJob) {
|
|
450
|
-
note(project, false, 'the planning routine is switched off');
|
|
451
|
-
continue;
|
|
452
|
-
}
|
|
453
|
-
// The locked routine this click asked for (#1643/#1659), by the lock it declares rather
|
|
454
|
-
// than its name, and read off the enabled rotation for the same reason the plan click is.
|
|
455
|
-
// A lock no enabled job holds is told apart: the routine the catalog shows is switched
|
|
456
|
-
// off, which is a setting the user can undo, or nothing holds that lock at all, which is
|
|
457
|
-
// a dashboard older than its daemon.
|
|
458
|
-
const lock = typeof opts?.only === 'object' ? opts.only.lock : undefined;
|
|
459
|
-
const lockedJob = lock === undefined ? undefined : rotation.find(item => item.lock === lock);
|
|
460
|
-
if (lock !== undefined && !lockedJob) {
|
|
461
|
-
const off = deps.jobs.find(item => item.lock === lock);
|
|
462
|
-
note(project, false, off ? `${off.label ?? off.name} is switched off` : `no routine holds the ${lock} lock`);
|
|
463
|
-
continue;
|
|
464
|
-
}
|
|
465
|
-
// The queued-work row's Run now (#1204/#1774): the click asks for an agent on the queue,
|
|
466
|
-
// and gets that or the reason not.
|
|
467
|
-
if (opts?.only === 'work' && !workJob) {
|
|
468
|
-
note(project, false, 'the routine that works the queue is switched off');
|
|
469
|
-
continue;
|
|
470
|
-
}
|
|
471
|
-
// The one routine the click named, when it named one: it takes the tick outright below.
|
|
472
|
-
const named = planJob ?? lockedJob ?? (opts?.only === 'work' ? workJob : undefined);
|
|
473
|
-
/**
|
|
474
|
-
* What this tick does (#1774). The queued work, when the branch moved by a commit no
|
|
475
|
-
* daemon wrote, or when the daily heartbeat is due; else the rotation, when a run found
|
|
476
|
-
* nothing queued (or on the first look, or on a click); else nothing. With the queued-work
|
|
477
|
-
* routine switched off, a move is the rotation's turn instead: #1209 means "do not work
|
|
478
|
-
* the queue", and the rotation does not work it — triage and planning put entries on it.
|
|
479
|
-
* Standing down there would make every inventing routine unreachable for as long as the
|
|
480
|
-
* queue had anything on it (#1432).
|
|
481
|
-
*/
|
|
482
|
-
const heartbeat = now() - (lastWork.get(project.id) ?? now()) >= heartbeatMs;
|
|
483
|
-
const asked = moved.has(project.id) || heartbeat;
|
|
484
|
-
if (asked && !workJob)
|
|
485
|
-
rotationDue.add(project.id);
|
|
486
|
-
const work = named === undefined && asked && workJob !== undefined;
|
|
487
|
-
if (!named && !work && !rotationDue.has(project.id) && !opts?.onDemand) {
|
|
488
|
-
note(project, false, 'nothing moved on the agent-data branch since the last run');
|
|
489
|
-
continue;
|
|
490
|
-
}
|
|
491
|
-
// The rotation is paced by the cooldown; a move of the branch and a click are asks, and
|
|
492
|
-
// the queued work is never paced (#1774): the daemon fires again as the run ends.
|
|
493
|
-
const since = lastStart.get(project.id);
|
|
494
|
-
const decision = autoPmDecision({
|
|
495
|
-
enabled: true,
|
|
496
|
-
activeAgents,
|
|
497
|
-
running,
|
|
498
|
-
concurrency,
|
|
499
|
-
quota,
|
|
500
|
-
...(!work && !named && since !== undefined ? { sinceLastStartMs: now() - since } : {}),
|
|
501
|
-
...(deps.cooldownMs !== undefined ? { cooldownMs: deps.cooldownMs } : {}),
|
|
502
|
-
...(opts?.onDemand ? { onDemand: true } : {}),
|
|
503
|
-
});
|
|
504
|
-
if (!decision.start) {
|
|
505
|
-
note(project, false, decision.reason);
|
|
506
|
-
continue;
|
|
507
|
-
}
|
|
508
|
-
const index = nextJob.get(project.id) ?? 0;
|
|
509
|
-
// A due codebase sweep (#882) outranks the rotation: the rotation invents work, and the
|
|
510
|
-
// sweep is a standing instruction to go find some. Only ever on a rotation turn -- a
|
|
511
|
-
// project whose branch moved has plenty to do, and the sweep would only add more.
|
|
512
|
-
//
|
|
513
|
-
// Asked before the schedule is read, so a switched-off sweep costs no disk read and,
|
|
514
|
-
// more importantly, leaves its calendar untouched: it must come due normally once it is
|
|
515
|
-
// switched back on, rather than having been silently ticked past while it was off.
|
|
516
|
-
const maintenanceJob = wanted(deps.maintenanceJob ?? AUTO_PM_MAINTENANCE_JOB);
|
|
517
|
-
// Never on a click that named a routine: that click takes the tick outright below, so the
|
|
518
|
-
// sweep does not run — and a schedule stamped for a sweep that never ran postpones the
|
|
519
|
-
// real one a whole interval. Asked first, so such a click also costs no schedule read.
|
|
520
|
-
const sweep = !named &&
|
|
521
|
-
!work &&
|
|
522
|
-
maintenanceJob !== undefined &&
|
|
523
|
-
(await deps.maintenanceDue?.(project).catch(() => false)) === true;
|
|
524
|
-
// The routine a click named outranks both the calendar and the rotation index: it asked for
|
|
525
|
-
// that one, so neither a due codebase sweep nor whose turn it is may take its tick.
|
|
526
|
-
const job = named ?? (work ? workJob : sweep ? maintenanceJob : rotation[index % rotation.length]);
|
|
527
|
-
if (!job) {
|
|
528
|
-
// Told apart on purpose: a rotation emptied by the checkboxes is a setting the user can
|
|
529
|
-
// see and undo, and reads nothing like a daemon wired without jobs at all.
|
|
530
|
-
note(project, false, deps.jobs.length ? 'every routine that makes new work is switched off' : 'there is no job to run');
|
|
531
|
-
continue;
|
|
532
|
-
}
|
|
533
|
-
// What to start this tick. The queued work is one agent per move (#1774): the agent's own
|
|
534
|
-
// claim moves the branch again, and a cap with room starts the next one alongside it. A
|
|
535
|
-
// rotation job that declares {@link AutoPmJob.fansOut} fans out (#1327): a pinned plan
|
|
536
|
-
// agent writes one ticket's *own* sibling files, so several agents do disjoint work and
|
|
537
|
-
// land disjoint edits. Every other rotation job rewrites the whole queue document from
|
|
538
|
-
// the same fork point, so two at once would revert each other's promotion; those stay one
|
|
539
|
-
// per tick.
|
|
540
|
-
const batch = [job];
|
|
541
|
-
if (!job.works && job.fansOut && deps.planCandidates && deps.lockPlans) {
|
|
542
|
-
// The fan-out for a rotation job that writes per-ticket files (#1327). Both seams or
|
|
543
|
-
// neither: candidates without locks would fan out unguarded, which is exactly the
|
|
544
|
-
// double-work the locks exist to prevent — so a loop wired without them keeps the
|
|
545
|
-
// stock single agent already in the batch.
|
|
546
|
-
//
|
|
547
|
-
// A ticket an agent still in flight was pinned to is not offered again. The durable
|
|
548
|
-
// half is the lock files themselves: the claim is on disk and pushed, so no meta lookup
|
|
549
|
-
// is needed here.
|
|
550
|
-
const pinned = new Set((pending.get(project.id) ?? []).flatMap(agent => (agent.ticket !== undefined ? [agent.ticket] : [])));
|
|
551
|
-
const candidates = ((await deps.planCandidates(project).catch(() => [])) ?? []).filter(
|
|
552
|
-
// A ticket whose plan agent already ended with nothing to hand off (#1583) is skipped:
|
|
553
|
-
// its released claim respawns the same commitless run forever.
|
|
554
|
-
ticket => !pinned.has(ticket) && !endedDry.get(project.id)?.has(ticket));
|
|
555
|
-
if (!candidates.length) {
|
|
556
|
-
// Nothing left to plan is this job's work being done, not a refusal: the rotation
|
|
557
|
-
// advances, so the next tick tries the next job instead of re-asking forever. A click
|
|
558
|
-
// that named this routine advances nothing — it did not come from the cycle.
|
|
559
|
-
if (!named)
|
|
560
|
-
nextJob.set(project.id, index + 1);
|
|
561
|
-
note(project, false, 'every open ticket already has a plan, or an agent on the way to one');
|
|
562
|
-
continue;
|
|
563
|
-
}
|
|
564
|
-
// Ids are minted here, before the claim (#1748): the lock names the agent that is
|
|
565
|
-
// about to start, and the start is given the same id. From the clock, so a test with
|
|
566
|
-
// an injected clock can predict them.
|
|
567
|
-
const picked = candidates.slice(0, concurrency - activeAgents);
|
|
568
|
-
const ids = mintAgentIds(now(), picked.length);
|
|
569
|
-
const assignments = picked.map((ticket, i) => ({ ticket, agentId: ids[i] }));
|
|
570
|
-
const locked = await deps.lockPlans(project, assignments).catch(() => []);
|
|
571
|
-
if (locked.length) {
|
|
572
|
-
batch.length = 0;
|
|
573
|
-
batch.push(...locked.map(assignment => pinnedPlanJob(job, assignment)));
|
|
574
|
-
}
|
|
575
|
-
// Nothing locked falls through with the stock single job: one unpinned agent is the
|
|
576
|
-
// pre-#1327 behavior, and safe without a lock.
|
|
577
|
-
}
|
|
578
|
-
// Re-checked here because everything above is awaited: an agent spawned past a `stop()` is
|
|
579
|
-
// missing from the live-agent map the daemon has by then cleared, so nothing suspends or
|
|
580
|
-
// terminates it (#983). Break, not continue: stopping is a verdict on the whole sweep.
|
|
581
|
-
if (stopped)
|
|
582
|
-
break;
|
|
583
|
-
// The rotation's cooldown is armed before the first spawn and once for the whole batch:
|
|
584
|
-
// starting is slow, and a tick that overlapped the spawns would otherwise see too few live
|
|
585
|
-
// agents and top up past the cap. The queued work arms nothing: its next start needs a
|
|
586
|
-
// move of the branch, which is a better guard than a clock.
|
|
587
|
-
if (!job.works)
|
|
588
|
-
lastStart.set(project.id, now());
|
|
589
|
-
const started = [];
|
|
590
|
-
let standDown;
|
|
591
|
-
for (const item of batch) {
|
|
592
|
-
// Re-checked per spawn, for the reason (#983) above: a stop mid-batch must not spawn the rest.
|
|
593
|
-
if (stopped)
|
|
594
|
-
break;
|
|
595
|
-
// A locked routine is taken before its run starts (#1659): an alive lock — another
|
|
596
|
-
// machine's triage, or this one's still going — stands the job down here, with no
|
|
597
|
-
// agent started to find out. Said as its own reason, since nothing was refused.
|
|
598
|
-
if (item.lock && deps.lockRoutine) {
|
|
599
|
-
const taken = await deps.lockRoutine(project, item.lock).catch(() => ({ ok: false, reason: 'the routine lock could not be taken' }));
|
|
600
|
-
if (!taken.ok) {
|
|
601
|
-
standDown = taken.reason;
|
|
602
|
-
break;
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
deps.log(`[framework] auto PM: ${doing(item)} in ${project.path}`);
|
|
606
|
-
const agentId = await deps.start(project, item).catch(() => undefined);
|
|
607
|
-
if (!agentId) {
|
|
608
|
-
// The batch ends at the first refusal: whatever refused this start is not going to take
|
|
609
|
-
// the next one a moment later, and a refused job must be retried rather than skipped.
|
|
610
|
-
deps.log(`[framework] auto PM: could not start a run in ${project.path}`);
|
|
611
|
-
// The lock just taken for it goes back: no run will ever release it.
|
|
612
|
-
if (item.lock)
|
|
613
|
-
await deps.releaseRoutine?.(project, item.lock).catch(() => false);
|
|
614
|
-
break;
|
|
615
|
-
}
|
|
616
|
-
started.push(item);
|
|
617
|
-
// Held until a later tick settles it: the ticket it plans stays pinned meanwhile.
|
|
618
|
-
pending.set(project.id, [
|
|
619
|
-
...(pending.get(project.id) ?? []),
|
|
620
|
-
{
|
|
621
|
-
agentId,
|
|
622
|
-
...(item.ticket !== undefined ? { ticket: item.ticket } : {}),
|
|
623
|
-
...(item.claim !== undefined ? { claim: item.claim } : {}),
|
|
624
|
-
...(item.lock !== undefined ? { lock: item.lock } : {}),
|
|
625
|
-
},
|
|
626
|
-
]);
|
|
627
|
-
}
|
|
628
|
-
// A claim whose agent never started is dead on arrival (#1583): the batch's locks were
|
|
629
|
-
// committed and pushed before the first spawn, so a refused start — or a stop mid-batch —
|
|
630
|
-
// would strand the claims of every item the loop never reached, with no run that could
|
|
631
|
-
// ever settle them free. Released here, not left for the settle loop: these never enter
|
|
632
|
-
// `pending`.
|
|
633
|
-
for (const item of batch) {
|
|
634
|
-
if (item.claim && !started.includes(item))
|
|
635
|
-
await deps.releaseLock?.(project, item.claim).catch(() => false);
|
|
636
|
-
}
|
|
637
|
-
if (started.length) {
|
|
638
|
-
if (job.works) {
|
|
639
|
-
// The move is spent (#1774): the next start on the queued work needs the branch to
|
|
640
|
-
// move again — which the agent's own commits do, as the run ends. The rotation's turn
|
|
641
|
-
// is spent too: whether the queue wants refilling is for this run to find out.
|
|
642
|
-
moved.delete(project.id);
|
|
643
|
-
rotationDue.delete(project.id);
|
|
644
|
-
lastWork.set(project.id, now());
|
|
645
|
-
}
|
|
646
|
-
else {
|
|
647
|
-
// Advanced only on a start that took, so a refused job is retried rather than skipped.
|
|
648
|
-
//
|
|
649
|
-
// A sweep does not advance it, and stamps its own schedule instead: it is paced
|
|
650
|
-
// by the calendar, not the cycle, so borrowing this tick must not cost the rotation its
|
|
651
|
-
// turn. Stamped after the start took for the same reason the rotation is -- a sweep the
|
|
652
|
-
// daemon refused should be retried next tick, not postponed a whole interval.
|
|
653
|
-
// A click that named a routine does not advance it either, for the reason a sweep does
|
|
654
|
-
// not: it borrows the tick for that routine, so the rotation keeps the turn it was on.
|
|
655
|
-
if (sweep)
|
|
656
|
-
await deps.recordMaintenance?.(project).catch(() => { });
|
|
657
|
-
else if (!named)
|
|
658
|
-
nextJob.set(project.id, index + 1);
|
|
659
|
-
// The turn the rotation was owed is taken; the next is earned by a run that finds
|
|
660
|
-
// nothing queued, never by a rotation run's own ending.
|
|
661
|
-
rotationDue.delete(project.id);
|
|
662
|
-
}
|
|
663
|
-
// One line per project however many agents went out, and a single start keeps the old
|
|
664
|
-
// wording exactly.
|
|
665
|
-
const described = started.map(item => doing(item)).join('; ');
|
|
666
|
-
// A fan-out that came out short says what it was short by (#1646): a batch of two under
|
|
667
|
-
// a cap of three, with the panel showing nothing running, used to be unexplainable.
|
|
668
|
-
const alongside = running.length ? ` alongside ${running.length} already going (${running.join(', ')})` : '';
|
|
669
|
-
note(project, true, started.length === 1 ? `${described}${alongside}` : `started ${started.length} agents${alongside}: ${described}`);
|
|
670
|
-
}
|
|
671
|
-
else if (!stopped) {
|
|
672
|
-
// Nothing took, so the cooldown armed above is given back: a batch that started nothing
|
|
673
|
-
// spent nothing, and holding it would strand the project for a whole cooldown.
|
|
674
|
-
lastStart.delete(project.id);
|
|
675
|
-
note(project, false, standDown ?? 'the daemon could not start a run');
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
finally {
|
|
680
|
-
sweeping = false;
|
|
681
|
-
// Recorded even when the sweep returned early, so "switched off" and "on, and standing
|
|
682
|
-
// down for a reason" are distinguishable from the dashboard (#1161).
|
|
683
|
-
lastSweep = { enabled, sweptAt: now(), outcomes };
|
|
684
|
-
}
|
|
685
|
-
};
|
|
686
|
-
// No timer of its own (E4): the daemon's one clock calls `tick` every Nth turn. `intervalMs`
|
|
687
|
-
// stays as the *declared* cadence — the clock runs this at that multiple, and `nextSweepAt`
|
|
688
|
-
// below is what the usage panel reads to say when the next sweep is due.
|
|
689
|
-
/** When the sweep is next due, counted from the anchor so an out-of-band {@link tick} cannot skew it. */
|
|
690
|
-
const nextSweepAt = () => startedAt + (Math.floor(Math.max(0, now() - startedAt) / intervalMs) + 1) * intervalMs;
|
|
691
|
-
// The first sweep is the caller's to fire (see `startBackgroundServices`), not this
|
|
692
|
-
// constructor's: `tick` marks the loop busy synchronously, so a sweep started here would make
|
|
693
|
-
// the very next `tick()` a no-op — and every test that constructs a loop and ticks it would be
|
|
694
|
-
// asserting against a sweep it never awaited.
|
|
695
|
-
return {
|
|
696
|
-
tick,
|
|
697
|
-
report: () => ({
|
|
698
|
-
...(lastSweep ? { enabled: lastSweep.enabled, sweptAt: lastSweep.sweptAt } : {}),
|
|
699
|
-
nextSweepAt: nextSweepAt(),
|
|
700
|
-
outcomes: lastSweep?.outcomes ?? [],
|
|
701
|
-
}),
|
|
702
|
-
stop: () => {
|
|
703
|
-
stopped = true;
|
|
704
|
-
},
|
|
705
|
-
};
|
|
706
|
-
}
|
|
707
|
-
//# sourceMappingURL=auto-pm.js.map
|