@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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-diff.d.ts","sourceRoot":"","sources":["../../src/dashboard/file-diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAkC,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAI7E,OAAO,EAAE,YAAY,EAAE,CAAA;AAUvB,6DAA6D;AAC7D,MAAM,WAAW,QAAQ;IACvB,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,aAAa,CAAA;IACrB,sFAAsF;IACtF,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,iDAAiD;IACjD,SAAS,EAAE,OAAO,CAAA;IAClB,4FAA4F;IAC5F,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,wFAAwF;AACxF,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,aAAa,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,2FAA2F;IAC3F,MAAM,EAAE,OAAO,CAAA;CAChB;AAoCD;;;;;;;;;;GAUG;AACH,wBAAsB,YAAY,CAChC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,aAAa,EACrB,GAAG,GAAE,SAA2B,EAChC,KAAK,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACnC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CA4B1B;AAGD,6CAA6C;AAC7C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,EAAE,CAUxD;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACvC,GAAG,GAAE,SAA2B,GAC/B,OAAO,CAAC,UAAU,EAAE,CAAC,CAqBvB"}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { nodeGitRunner } from '@gemstack/agent-data';
|
|
2
|
-
import { cutToPreview, readConfinedFile, safeRepoPath } from './file-read.js';
|
|
3
|
-
// `safeRepoPath` moved to file-read.js with #828, where the unchanged-file preview shares it.
|
|
4
|
-
// Re-exported so this stays the import site it has been.
|
|
5
|
-
export { safeRepoPath };
|
|
6
|
-
/** Drop git's `diff --git` / `index` / `mode` preamble, keeping the `---`/`+++`/hunk body. */
|
|
7
|
-
function hunksOnly(patch) {
|
|
8
|
-
const lines = patch.split('\n');
|
|
9
|
-
const start = lines.findIndex(line => line.startsWith('--- ') || line.startsWith('@@'));
|
|
10
|
-
return (start === -1 ? [] : lines.slice(start)).join('\n').trimEnd();
|
|
11
|
-
}
|
|
12
|
-
/** Count the +/- lines of a unified patch, ignoring the `---`/`+++` file headers. */
|
|
13
|
-
function countChanges(patch) {
|
|
14
|
-
let added = 0;
|
|
15
|
-
let removed = 0;
|
|
16
|
-
let inHunk = false;
|
|
17
|
-
for (const line of patch.split('\n')) {
|
|
18
|
-
if (line.startsWith('@@')) {
|
|
19
|
-
inHunk = true;
|
|
20
|
-
continue;
|
|
21
|
-
}
|
|
22
|
-
// The file headers only ever precede the first hunk. Past it a line opening the same way is
|
|
23
|
-
// content — a removed `---` separator reads `----`, a removed `-- comment` reads `--- comment`
|
|
24
|
-
// — and skipping those undercounted the file's own stats.
|
|
25
|
-
if (!inHunk && (line.startsWith('+++') || line.startsWith('---')))
|
|
26
|
-
continue;
|
|
27
|
-
if (line.startsWith('+'))
|
|
28
|
-
added++;
|
|
29
|
-
else if (line.startsWith('-'))
|
|
30
|
-
removed++;
|
|
31
|
-
}
|
|
32
|
-
return { added, removed };
|
|
33
|
-
}
|
|
34
|
-
/** An untracked file has no blob to diff against, so render its contents as all-added. */
|
|
35
|
-
function asAllAdded(text) {
|
|
36
|
-
const lines = text.split('\n');
|
|
37
|
-
if (lines[lines.length - 1] === '')
|
|
38
|
-
lines.pop(); // a trailing newline is not a line
|
|
39
|
-
return lines.map(line => `+${line}`).join('\n');
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* The diff for one changed file in the checkout at `cwd`, or, given a `range`, between two
|
|
43
|
-
* commits of the repository at `cwd` (a run's committed change, `agent-tree.ts`).
|
|
44
|
-
*
|
|
45
|
-
* Tracked files diff against `HEAD`, not the index, so a change the agent staged still shows;
|
|
46
|
-
* that also matches `git status --porcelain`, which is what dotted the file in the first place.
|
|
47
|
-
* An untracked file is rendered as all-added from its contents, since `git diff --no-index`
|
|
48
|
-
* exits non-zero on a difference and would read as a failure here.
|
|
49
|
-
*
|
|
50
|
-
* Returns null when the path is unsafe, unreadable, or has no diff to show.
|
|
51
|
-
*/
|
|
52
|
-
export async function readFileDiff(cwd, path, status, git = nodeGitRunner(), range) {
|
|
53
|
-
if (!safeRepoPath(path))
|
|
54
|
-
return null;
|
|
55
|
-
if (!range && status === 'untracked') {
|
|
56
|
-
const raw = await readConfinedFile(cwd, path);
|
|
57
|
-
if (!raw)
|
|
58
|
-
return null;
|
|
59
|
-
if (raw.includes(0))
|
|
60
|
-
return { path, status, patch: '', added: 0, removed: 0, truncated: false, binary: true };
|
|
61
|
-
const all = asAllAdded(raw.toString('utf8'));
|
|
62
|
-
const { body: patch, truncated } = cutToPreview(all);
|
|
63
|
-
// Every line of an untracked file is an addition, so it is counted rather than parsed — and
|
|
64
|
-
// counted over the whole file, not the cut preview: the Changes list reports the file's own
|
|
65
|
-
// size, which a long new file used to report as exactly the preview limit.
|
|
66
|
-
return { path, status, patch, added: all ? all.split('\n').length : 0, removed: 0, truncated, binary: false };
|
|
67
|
-
}
|
|
68
|
-
// `HEAD` is missing in a repo with no commits yet; the working-tree diff is the honest answer
|
|
69
|
-
// there rather than an error.
|
|
70
|
-
const raw = range
|
|
71
|
-
? await git(['diff', '--unified=3', range.from, range.to, '--', path], cwd).catch(() => '')
|
|
72
|
-
: await git(['diff', '--unified=3', 'HEAD', '--', path], cwd)
|
|
73
|
-
.catch(() => git(['diff', '--unified=3', '--', path], cwd))
|
|
74
|
-
.catch(() => '');
|
|
75
|
-
if (!raw.trim())
|
|
76
|
-
return null;
|
|
77
|
-
if (/^Binary files /m.test(raw))
|
|
78
|
-
return { path, status, patch: '', added: 0, removed: 0, truncated: false, binary: true };
|
|
79
|
-
const { body: patch, truncated } = cutToPreview(hunksOnly(raw));
|
|
80
|
-
if (!patch)
|
|
81
|
-
return null;
|
|
82
|
-
return { path, status, patch, ...countChanges(patch), truncated, binary: false };
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Parse `git diff --numstat` output: `added<TAB>removed<TAB>path`, with `-` for both counts
|
|
86
|
-
* on a binary file. The one parser for the grammar — it was written here and in run-handoff,
|
|
87
|
-
* and the copies had already drifted on a path containing a tab (this side rejoined it, the
|
|
88
|
-
* other dropped the line).
|
|
89
|
-
*/
|
|
90
|
-
export function parseNumstat(out) {
|
|
91
|
-
const entries = [];
|
|
92
|
-
for (const line of out.split('\n')) {
|
|
93
|
-
const [added, removed, ...rest] = line.split('\t');
|
|
94
|
-
const path = rest.join('\t');
|
|
95
|
-
if (!path || added === undefined || removed === undefined)
|
|
96
|
-
continue;
|
|
97
|
-
const binary = added === '-' || removed === '-';
|
|
98
|
-
entries.push({ path, added: binary ? 0 : Number(added) || 0, removed: binary ? 0 : Number(removed) || 0, binary });
|
|
99
|
-
}
|
|
100
|
-
return entries;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Every changed file in the checkout at `cwd`, with its line counts: the session's Changes list
|
|
104
|
-
* (#817). One `git status` plus one `git diff --numstat`, not a diff per file, so a session that
|
|
105
|
-
* touched forty files still costs two git calls.
|
|
106
|
-
*
|
|
107
|
-
* Untracked files have no numstat entry (they are not in the diff at all), so their added count
|
|
108
|
-
* is their line count, read from disk. Sorted by path, so the list does not reshuffle as a live
|
|
109
|
-
* session edits.
|
|
110
|
-
*/
|
|
111
|
-
export async function readFileChanges(cwd, statuses, git = nodeGitRunner()) {
|
|
112
|
-
const paths = Object.keys(statuses).filter(safeRepoPath);
|
|
113
|
-
if (paths.length === 0)
|
|
114
|
-
return [];
|
|
115
|
-
const numstat = await git(['diff', '--numstat', 'HEAD'], cwd)
|
|
116
|
-
.catch(() => git(['diff', '--numstat'], cwd))
|
|
117
|
-
.catch(() => '');
|
|
118
|
-
const counted = new Map(parseNumstat(numstat).map(entry => [entry.path, entry]));
|
|
119
|
-
const changes = await Promise.all(paths.map(async (path) => {
|
|
120
|
-
const status = statuses[path];
|
|
121
|
-
const known = counted.get(path);
|
|
122
|
-
if (known)
|
|
123
|
-
return { ...known, status };
|
|
124
|
-
if (status !== 'untracked')
|
|
125
|
-
return { path, status, added: 0, removed: 0, binary: false };
|
|
126
|
-
// An untracked file is not in any diff, so its whole content is the addition.
|
|
127
|
-
const diff = await readFileDiff(cwd, path, status, git).catch(() => null);
|
|
128
|
-
return { path, status, added: diff?.added ?? 0, removed: 0, binary: diff?.binary ?? false };
|
|
129
|
-
}));
|
|
130
|
-
return changes.sort((a, b) => a.path.localeCompare(b.path));
|
|
131
|
-
}
|
|
132
|
-
//# sourceMappingURL=file-diff.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-diff.js","sourceRoot":"","sources":["../../src/dashboard/file-diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,sBAAsB,CAAA;AAEpE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7E,8FAA8F;AAC9F,yDAAyD;AACzD,OAAO,EAAE,YAAY,EAAE,CAAA;AAmCvB,8FAA8F;AAC9F,SAAS,SAAS,CAAC,KAAa;IAC9B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAA;IACvF,OAAO,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAA;AACtE,CAAC;AAED,qFAAqF;AACrF,SAAS,YAAY,CAAC,KAAa;IACjC,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,OAAO,GAAG,CAAC,CAAA;IACf,IAAI,MAAM,GAAG,KAAK,CAAA;IAClB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,MAAM,GAAG,IAAI,CAAA;Y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,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;QACxF,8EAA8E;QAC9E,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;QACzE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,KAAK,EAAE,CAAA;IAC7F,CAAC,CAAC,CACH,CAAA;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;AAC7D,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/** Cap what a hover card renders, whether it is a patch or a file. */
|
|
2
|
-
export declare const MAX_PREVIEW_LINES = 500;
|
|
3
|
-
/** One unchanged file's contents for the tree's hover card (#828). */
|
|
4
|
-
export interface FileContent {
|
|
5
|
-
/** The repo-relative path asked for. */
|
|
6
|
-
path: string;
|
|
7
|
-
/** The file's text, cut at {@link MAX_PREVIEW_LINES}. Empty when binary. */
|
|
8
|
-
text: string;
|
|
9
|
-
/** The file was longer than the cap and was cut. */
|
|
10
|
-
truncated: boolean;
|
|
11
|
-
/** Not UTF-8 text, so there is nothing to render. */
|
|
12
|
-
binary: boolean;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Whether a client-supplied path may be read: repo-relative, no traversal, no absolute path, no
|
|
16
|
-
* leading `-` (git would read it as a flag), and never into `.git` (config and credentials live
|
|
17
|
-
* there). Rejecting is the whole contract; the caller resolves it against a checkout it chose.
|
|
18
|
-
*/
|
|
19
|
-
export declare function safeRepoPath(path: string): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Read a repo-relative file from `cwd`, or null when it is unsafe, outside the checkout, or
|
|
22
|
-
* unreadable.
|
|
23
|
-
*
|
|
24
|
-
* The confinement check is a `realpath` on both sides, not a string compare on the resolved path.
|
|
25
|
-
* `resolve` does not follow symlinks, so `src/link.txt -> /etc/passwd` resolves to a path that sits
|
|
26
|
-
* happily under `cwd` and passes a textual check while the read leaves the repo. `realpath` is what
|
|
27
|
-
* makes the containment real; it also normalizes the platform's own links (macOS `/tmp`), which is
|
|
28
|
-
* why `cwd` goes through it too rather than being compared raw.
|
|
29
|
-
*/
|
|
30
|
-
export declare function readConfinedFile(cwd: string, path: string): Promise<Buffer | null>;
|
|
31
|
-
/** Cut a body to {@link MAX_PREVIEW_LINES}, reporting whether anything was dropped. */
|
|
32
|
-
export declare function cutToPreview(body: string): {
|
|
33
|
-
body: string;
|
|
34
|
-
truncated: boolean;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* One unchanged file's contents (#828). Null when the path is unsafe, outside the checkout, or
|
|
38
|
-
* unreadable. A file git has not touched still reads from the resolved checkout, so a session's
|
|
39
|
-
* hover shows its worktree's copy rather than the project root's (#815).
|
|
40
|
-
*/
|
|
41
|
-
export declare function readFileContent(cwd: string, path: string): Promise<FileContent | null>;
|
|
42
|
-
//# sourceMappingURL=file-read.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-read.d.ts","sourceRoot":"","sources":["../../src/dashboard/file-read.ts"],"names":[],"mappings":"AAIA,sEAAsE;AACtE,eAAO,MAAM,iBAAiB,MAAM,CAAA;AAEpC,sEAAsE;AACtE,MAAM,WAAW,WAAW;IAC1B,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAA;IACZ,oDAAoD;IACpD,SAAS,EAAE,OAAO,CAAA;IAClB,qDAAqD;IACrD,MAAM,EAAE,OAAO,CAAA;CAChB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CASlD;AAED;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAUxF;AAED,uFAAuF;AACvF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAI/E;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAM5F"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
// Reading one file out of a checkout, for the panel's hover card: the diff of a changed file
|
|
2
|
-
// (#816, file-diff.ts) and the contents of an unchanged one (#828). Both take a path from the
|
|
3
|
-
// client, so the guard and the confined read live here, once, and every caller goes through them.
|
|
4
|
-
/** Cap what a hover card renders, whether it is a patch or a file. */
|
|
5
|
-
export const MAX_PREVIEW_LINES = 500;
|
|
6
|
-
/**
|
|
7
|
-
* Whether a client-supplied path may be read: repo-relative, no traversal, no absolute path, no
|
|
8
|
-
* leading `-` (git would read it as a flag), and never into `.git` (config and credentials live
|
|
9
|
-
* there). Rejecting is the whole contract; the caller resolves it against a checkout it chose.
|
|
10
|
-
*/
|
|
11
|
-
export function safeRepoPath(path) {
|
|
12
|
-
if (!path || path.length > 1024 || path.includes('\0'))
|
|
13
|
-
return false;
|
|
14
|
-
if (path.startsWith('/') || path.startsWith('-') || /^[a-zA-Z]:/.test(path))
|
|
15
|
-
return false;
|
|
16
|
-
const parts = path.split(/[\\/]/);
|
|
17
|
-
// Any `.git` segment, not just a leading one: a nested repo's `.git/config` holds credentials too.
|
|
18
|
-
// Compared case-insensitively, because macOS and Windows are: there `.GIT/config` opens the very
|
|
19
|
-
// file this refuses, and the path comes from the browser.
|
|
20
|
-
if (parts.some(part => part.toLowerCase() === '.git'))
|
|
21
|
-
return false;
|
|
22
|
-
return parts.every(part => part !== '' && part !== '.' && part !== '..');
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Read a repo-relative file from `cwd`, or null when it is unsafe, outside the checkout, or
|
|
26
|
-
* unreadable.
|
|
27
|
-
*
|
|
28
|
-
* The confinement check is a `realpath` on both sides, not a string compare on the resolved path.
|
|
29
|
-
* `resolve` does not follow symlinks, so `src/link.txt -> /etc/passwd` resolves to a path that sits
|
|
30
|
-
* happily under `cwd` and passes a textual check while the read leaves the repo. `realpath` is what
|
|
31
|
-
* makes the containment real; it also normalizes the platform's own links (macOS `/tmp`), which is
|
|
32
|
-
* why `cwd` goes through it too rather than being compared raw.
|
|
33
|
-
*/
|
|
34
|
-
export async function readConfinedFile(cwd, path) {
|
|
35
|
-
if (!safeRepoPath(path))
|
|
36
|
-
return null;
|
|
37
|
-
const { readFile, realpath } = await import('node:fs/promises');
|
|
38
|
-
const { resolve, sep } = await import('node:path');
|
|
39
|
-
const root = await realpath(resolve(cwd)).catch(() => null);
|
|
40
|
-
if (!root)
|
|
41
|
-
return null;
|
|
42
|
-
// A missing file has no realpath, so this also answers "not there" before the read.
|
|
43
|
-
const full = await realpath(resolve(cwd, path)).catch(() => null);
|
|
44
|
-
if (!full || !full.startsWith(root + sep))
|
|
45
|
-
return null;
|
|
46
|
-
return readFile(full).catch(() => null);
|
|
47
|
-
}
|
|
48
|
-
/** Cut a body to {@link MAX_PREVIEW_LINES}, reporting whether anything was dropped. */
|
|
49
|
-
export function cutToPreview(body) {
|
|
50
|
-
const lines = body.split('\n');
|
|
51
|
-
if (lines.length <= MAX_PREVIEW_LINES)
|
|
52
|
-
return { body, truncated: false };
|
|
53
|
-
return { body: lines.slice(0, MAX_PREVIEW_LINES).join('\n'), truncated: true };
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* One unchanged file's contents (#828). Null when the path is unsafe, outside the checkout, or
|
|
57
|
-
* unreadable. A file git has not touched still reads from the resolved checkout, so a session's
|
|
58
|
-
* hover shows its worktree's copy rather than the project root's (#815).
|
|
59
|
-
*/
|
|
60
|
-
export async function readFileContent(cwd, path) {
|
|
61
|
-
const raw = await readConfinedFile(cwd, path);
|
|
62
|
-
if (!raw)
|
|
63
|
-
return null;
|
|
64
|
-
if (raw.includes(0))
|
|
65
|
-
return { path, text: '', truncated: false, binary: true };
|
|
66
|
-
const { body, truncated } = cutToPreview(raw.toString('utf8').replace(/\n$/, ''));
|
|
67
|
-
return { path, text: body, truncated, binary: false };
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=file-read.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-read.js","sourceRoot":"","sources":["../../src/dashboard/file-read.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,8FAA8F;AAC9F,kGAAkG;AAElG,sEAAsE;AACtE,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;AAcpC;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAA;IACpE,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAA;IACzF,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACjC,mGAAmG;IACnG,iGAAiG;IACjG,0DAA0D;IAC1D,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,K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AAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;IACxE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAA;AAChF,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,GAAW,EAAE,IAAY;IAC7D,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC7C,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAA;IACrB,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;IAC9E,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAA;IACjF,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;AACvD,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type GitRunner } from '@gemstack/agent-data';
|
|
2
|
-
/**
|
|
3
|
-
* The tree's per-file git state. `added` is a file a commit created (a run's committed change,
|
|
4
|
-
* `agent-tree.ts`); the working tree's status here never says it, a new file there is `untracked`.
|
|
5
|
-
*/
|
|
6
|
-
export type FileGitStatus = 'untracked' | 'added' | 'modified' | 'deleted';
|
|
7
|
-
/** One `git status --porcelain` line: the two status columns and the path they are about. */
|
|
8
|
-
export interface PorcelainEntry {
|
|
9
|
-
code: string;
|
|
10
|
-
/** Repo-relative; a rename resolves to the new path. */
|
|
11
|
-
path: string;
|
|
12
|
-
}
|
|
13
|
-
/** Parse `git status --porcelain` output. Shared with the handoff's pending-files read (#1173). */
|
|
14
|
-
export declare function parsePorcelain(out: string): PorcelainEntry[];
|
|
15
|
-
/**
|
|
16
|
-
* Read each changed file's status from `git status --porcelain`, keyed by repo-relative path.
|
|
17
|
-
* `??` is untracked, a `D` in either column is deleted, anything else (M/A/R/C…) reads as
|
|
18
|
-
* modified. Renames map to the new path. Returns `{}` when the path is not a git repo.
|
|
19
|
-
*/
|
|
20
|
-
export declare function readFileStatuses(cwd: string, git?: GitRunner): Promise<Record<string, FileGitStatus>>;
|
|
21
|
-
//# sourceMappingURL=file-status.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-status.d.ts","sourceRoot":"","sources":["../../src/dashboard/file-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAKpE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;AAO1E,6FAA6F;AAC7F,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAA;CACb;AAED,mGAAmG;AACnG,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,EAAE,CAa5D;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,SAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAO5H"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { nodeGitRunner } from '@gemstack/agent-data';
|
|
2
|
-
/** Strip git's surrounding quotes from a path with special chars (basic; leaves escapes as-is). */
|
|
3
|
-
function unquotePath(path) {
|
|
4
|
-
return path.length >= 2 && path.startsWith('"') && path.endsWith('"') ? path.slice(1, -1) : path;
|
|
5
|
-
}
|
|
6
|
-
/** Parse `git status --porcelain` output. Shared with the handoff's pending-files read (#1173). */
|
|
7
|
-
export function parsePorcelain(out) {
|
|
8
|
-
const entries = [];
|
|
9
|
-
for (const line of out.split('\n')) {
|
|
10
|
-
if (line.length < 4)
|
|
11
|
-
continue;
|
|
12
|
-
const code = line.slice(0, 2);
|
|
13
|
-
let path = line.slice(3);
|
|
14
|
-
const arrow = path.indexOf(' -> ');
|
|
15
|
-
if (arrow !== -1)
|
|
16
|
-
path = path.slice(arrow + 4); // a rename: the new path is the one that exists
|
|
17
|
-
path = unquotePath(path);
|
|
18
|
-
if (!path)
|
|
19
|
-
continue;
|
|
20
|
-
entries.push({ code, path });
|
|
21
|
-
}
|
|
22
|
-
return entries;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Read each changed file's status from `git status --porcelain`, keyed by repo-relative path.
|
|
26
|
-
* `??` is untracked, a `D` in either column is deleted, anything else (M/A/R/C…) reads as
|
|
27
|
-
* modified. Renames map to the new path. Returns `{}` when the path is not a git repo.
|
|
28
|
-
*/
|
|
29
|
-
export async function readFileStatuses(cwd, git = nodeGitRunner()) {
|
|
30
|
-
const out = await git(['status', '--porcelain'], cwd).catch(() => '');
|
|
31
|
-
const map = {};
|
|
32
|
-
for (const { code, path } of parsePorcelain(out)) {
|
|
33
|
-
map[path] = code === '??' ? 'untracked' : code.includes('D') ? 'deleted' : 'modified';
|
|
34
|
-
}
|
|
35
|
-
return map;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=file-status.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-status.js","sourceRoot":"","sources":["../../src/dashboard/file-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,sBAAsB,CAAA;AAWpE,mGAAmG;AACnG,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,IAA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C7C,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAA;IACvF,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
package/dist/dashboard/gh.d.ts
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { type CliRunner } from '../cli-exec.js';
|
|
2
|
-
import { type Cached } from './cache.js';
|
|
3
|
-
/**
|
|
4
|
-
* The `gh` CLI, in one place: the JSON reads the dashboard makes of pull requests. Reads only:
|
|
5
|
-
* pushing, opening and merging are the project's branches provider's (`../store/branches.ts`).
|
|
6
|
-
*
|
|
7
|
-
* There were four separate `gh` adapters across three modules. Three were reads that each
|
|
8
|
-
* hand-rolled `execFile` + `JSON.parse` + a swallowed failure and each spelled the 8s timeout
|
|
9
|
-
* again, and two of those differed only in whether a branch positional was passed.
|
|
10
|
-
*/
|
|
11
|
-
/** Runs `gh`, resolving stdout and rejecting with the CLI's own stderr on failure. */
|
|
12
|
-
export type GhRunner = CliRunner;
|
|
13
|
-
/** A forgiving `gh --json` read: resolves `empty` when gh is missing/unauthed, or its output is not JSON. */
|
|
14
|
-
export declare function ghJson<T>(args: string[], cwd: string, empty: T, gh?: GhRunner): Promise<T>;
|
|
15
|
-
/** The PR opened for a branch, when there is one. */
|
|
16
|
-
export interface LinkedPr {
|
|
17
|
-
number: number;
|
|
18
|
-
url: string;
|
|
19
|
-
/** OPEN / MERGED / CLOSED (as gh reports it). */
|
|
20
|
-
state: string;
|
|
21
|
-
title: string;
|
|
22
|
-
/** ISO creation time, when the read included it: what tells one agent's PR from a predecessor's. */
|
|
23
|
-
createdAt?: string;
|
|
24
|
-
/**
|
|
25
|
-
* The head commit the PR covers, when the read included it (#1512): what tells "the branch's
|
|
26
|
-
* PR already landed everything" from "the session kept working after its PR merged".
|
|
27
|
-
*/
|
|
28
|
-
headRefOid?: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* A best-effort PR lookup, for a named branch or for the checkout's current branch. One type for
|
|
32
|
-
* both: the named-branch form is the general one, and "the current branch" is just omitting it.
|
|
33
|
-
*/
|
|
34
|
-
export type PrLookup = (cwd: string, branch?: string) => Promise<LinkedPr | undefined>;
|
|
35
|
-
/**
|
|
36
|
-
* The branch-addressed form, for a caller that always names one (#799): a finished session's
|
|
37
|
-
* worktree may be gone, so "the current branch" would silently be the project's, not the
|
|
38
|
-
* session's. Narrower than {@link PrLookup} on purpose, so that invariant is in the type.
|
|
39
|
-
*/
|
|
40
|
-
export type BranchPrLookup = (cwd: string, branch: string) => Promise<LinkedPr | undefined>;
|
|
41
|
-
/**
|
|
42
|
-
* The PR for `branch`, or for whatever branch `cwd` is on when none is named. Resolves undefined
|
|
43
|
-
* when gh is missing/unauthed or there is no PR.
|
|
44
|
-
*
|
|
45
|
-
* The named-branch form is what a finished session needs (#799): its worktree may be gone, so the
|
|
46
|
-
* checkout's current branch is the project's, not the session's. The fields are copied out rather
|
|
47
|
-
* than passed through, so a future `--json` addition cannot leak into what callers store.
|
|
48
|
-
*
|
|
49
|
-
* Every optional field {@link LinkedPr} declares must be both asked for and copied out here, or it
|
|
50
|
-
* is silently absent for every caller of this path. `createdAt` was once neither, and it is what
|
|
51
|
-
* tells an agent's own PR from a predecessor's on the same branch name ({@link pickAgentPr}).
|
|
52
|
-
*/
|
|
53
|
-
export declare function ghPrView(cwd: string, branch?: string, gh?: GhRunner): Promise<LinkedPr | undefined>;
|
|
54
|
-
/**
|
|
55
|
-
* The cached form of {@link ghPrView} (#1028), and what the dashboard's panels use.
|
|
56
|
-
*
|
|
57
|
-
* A PR lookup costs about 600ms where the git reads beside it cost ten, and the answer changes
|
|
58
|
-
* about as often as someone opens a PR. Cached per checkout and branch, shared between the
|
|
59
|
-
* worktree bar and the handoff summary, and refreshed behind whoever asks. `pending` says the
|
|
60
|
-
* answer is not known yet rather than that there is no PR — the difference matters to a caller
|
|
61
|
-
* deciding whether to offer "Open PR".
|
|
62
|
-
*/
|
|
63
|
-
export declare function cachedPrView(cwd: string, branch?: string): Promise<Cached<LinkedPr | undefined>>;
|
|
64
|
-
/** Forget a branch's PR, after an action that changes whether it has one. */
|
|
65
|
-
export declare function forgetPr(cwd: string, branch?: string): void;
|
|
66
|
-
/**
|
|
67
|
-
* Every PR a branch name has ever had, newest first (#1251).
|
|
68
|
-
*
|
|
69
|
-
* `gh pr view <branch>` answers with the newest PR for that head *in any state*, so a session
|
|
70
|
-
* whose prompt pins its branch name (`the-framework/triage-quick`) inherits a predecessor's
|
|
71
|
-
* merged PR as its own. The list form keeps the whole history so {@link pickAgentPr} can decide
|
|
72
|
-
* which entry, if any, belongs to the agent asking. Resolves `[]` when gh is missing/unauthed —
|
|
73
|
-
* indistinguishable from "no PRs", which is what every caller would do with a failure anyway.
|
|
74
|
-
*/
|
|
75
|
-
export declare function ghPrsForBranch(cwd: string, branch: string): Promise<LinkedPr[]>;
|
|
76
|
-
/**
|
|
77
|
-
* {@link ghPrsForBranch} for a caller about to *open* a PR (#1601): a listing that fails throws
|
|
78
|
-
* instead of reading as "no PRs", because "none" and "could not tell" must not look alike there —
|
|
79
|
-
* the difference is a second draft PR on a branch that already has one.
|
|
80
|
-
*/
|
|
81
|
-
export declare function ghPrsForBranchOrThrow(cwd: string, branch: string): Promise<LinkedPr[]>;
|
|
82
|
-
/** The cached form of {@link ghPrsForBranch}, shared through the same read-through cache (#1028). */
|
|
83
|
-
export declare function cachedPrsForBranch(cwd: string, branch: string): Promise<Cached<LinkedPr[]>>;
|
|
84
|
-
/** Forget a branch's PR history, after an action that changes it (opening one). */
|
|
85
|
-
export declare function forgetBranchPrs(cwd: string, branch: string): void;
|
|
86
|
-
/**
|
|
87
|
-
* The PR that belongs to an agent, out of every PR its branch name has had (#1251/#1255).
|
|
88
|
-
*
|
|
89
|
-
* An OPEN PR always counts: GitHub allows one open PR per head branch, so whatever is open on the
|
|
90
|
-
* run's branch is where its pushed commits land. A closed one counts only when it was created
|
|
91
|
-
* after the agent started (`since`, the agent's `startedAt`) — the oldest such entry, which is the one
|
|
92
|
-
* this agent's handoff opened. Anything older is a previous agent's PR wearing the same branch name,
|
|
93
|
-
* which is exactly what showed a merged two-day-old PR as a fresh session's own. Without `since`
|
|
94
|
-
* only an open PR is trusted.
|
|
95
|
-
*
|
|
96
|
-
* `order` exists for the one caller asking a different question (#1512). `'first'` answers
|
|
97
|
-
* identity — which PR did *this agent* open, so a later agent's must not be the answer. `'latest'`
|
|
98
|
-
* answers the handoff decision — which PR last saw the branch, so "did the session keep working
|
|
99
|
-
* past it" is readable off that PR's `headRefOid`; there the oldest entry would call work that a
|
|
100
|
-
* second PR already landed unlanded.
|
|
101
|
-
*/
|
|
102
|
-
export declare function pickAgentPr(prs: LinkedPr[], since?: string, order?: 'first' | 'latest'): LinkedPr | undefined;
|
|
103
|
-
/** An open PR on the interventions queue (#632). */
|
|
104
|
-
export interface OpenPr {
|
|
105
|
-
number: number;
|
|
106
|
-
title: string;
|
|
107
|
-
url: string;
|
|
108
|
-
/**
|
|
109
|
-
* Draft PRs are generally left off the queue: a draft is not asking for review.
|
|
110
|
-
*
|
|
111
|
-
* The exception is a draft the framework opened for itself (#1102), which {@link headRefName}
|
|
112
|
-
* is what tells apart.
|
|
113
|
-
*/
|
|
114
|
-
isDraft: boolean;
|
|
115
|
-
/** The branch the PR is from, so a session's own PR can be recognised as ours (#1102). */
|
|
116
|
-
headRefName?: string;
|
|
117
|
-
createdAt?: string;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* A checkout's open PRs. Unlike the other reads here it *rejects* when gh could not answer — no
|
|
121
|
-
* remote, not authenticated, GitHub unreachable — instead of resolving `[]`.
|
|
122
|
-
*
|
|
123
|
-
* "No PRs are open" and "I could not look" are different answers, and its caller keeps a baseline
|
|
124
|
-
* of what it has already announced (#1623): taking the second for the first makes the next
|
|
125
|
-
* successful read announce every already-open PR as new. The caller decides what a failure costs;
|
|
126
|
-
* it cannot decide what it never hears about.
|
|
127
|
-
*/
|
|
128
|
-
export declare function ghPrList(cwd: string, gh?: GhRunner): Promise<OpenPr[]>;
|
|
129
|
-
/** Lists a checkout's open PRs; rejects when there is no remote / gh is unavailable. */
|
|
130
|
-
export type PrLister = (cwd: string) => Promise<OpenPr[]>;
|
|
131
|
-
//# sourceMappingURL=gh.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gh.d.ts","sourceRoot":"","sources":["../../src/dashboard/gh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EAA0B,KAAK,MAAM,EAAE,MAAM,YAAY,CAAA;AAEhE;;;;;;;GAOG;AAEH,sFAAsF;AACtF,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAA;AAQhC,6GAA6G;AAC7G,wBAAsB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,GAAE,QAAiB,GAAG,OAAO,CAAC,CAAC,CAAC,CAMxG;AAED,qDAAqD;AACrD,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,oGAAoG;IACpG,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,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EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,GAAE,OAAO,GAAG,QAAkB,GAAG,QAAQ,GAAG,SAAS,CAQtH;AAED,oDAAoD;AACpD,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB,0FAA0F;IAC1F,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,GAAE,QAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAIpF;AAED,wFAAwF;AACxF,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA"}
|
package/dist/dashboard/gh.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { cliRunner } from '../cli-exec.js';
|
|
2
|
-
import { cachedRead, invalidate } from './cache.js';
|
|
3
|
-
/**
|
|
4
|
-
* Reads are capped short and never surface an error: every caller is a panel that renders
|
|
5
|
-
* whatever it got, and "gh is not installed" must cost a page load nothing.
|
|
6
|
-
*/
|
|
7
|
-
const readGh = cliRunner({ bin: 'gh', timeoutMs: 8_000 });
|
|
8
|
-
/** A forgiving `gh --json` read: resolves `empty` when gh is missing/unauthed, or its output is not JSON. */
|
|
9
|
-
export async function ghJson(args, cwd, empty, gh = readGh) {
|
|
10
|
-
try {
|
|
11
|
-
return JSON.parse(await gh(args, cwd));
|
|
12
|
-
}
|
|
13
|
-
catch {
|
|
14
|
-
return empty;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const PR_VIEW_FIELDS = 'number,url,state,title,createdAt,headRefOid';
|
|
18
|
-
/**
|
|
19
|
-
* The PR for `branch`, or for whatever branch `cwd` is on when none is named. Resolves undefined
|
|
20
|
-
* when gh is missing/unauthed or there is no PR.
|
|
21
|
-
*
|
|
22
|
-
* The named-branch form is what a finished session needs (#799): its worktree may be gone, so the
|
|
23
|
-
* checkout's current branch is the project's, not the session's. The fields are copied out rather
|
|
24
|
-
* than passed through, so a future `--json` addition cannot leak into what callers store.
|
|
25
|
-
*
|
|
26
|
-
* Every optional field {@link LinkedPr} declares must be both asked for and copied out here, or it
|
|
27
|
-
* is silently absent for every caller of this path. `createdAt` was once neither, and it is what
|
|
28
|
-
* tells an agent's own PR from a predecessor's on the same branch name ({@link pickAgentPr}).
|
|
29
|
-
*/
|
|
30
|
-
export async function ghPrView(cwd, branch, gh = readGh) {
|
|
31
|
-
const args = ['pr', 'view', ...(branch ? [branch] : []), '--json', PR_VIEW_FIELDS];
|
|
32
|
-
const pr = await ghJson(args, cwd, undefined, gh);
|
|
33
|
-
return pr
|
|
34
|
-
? {
|
|
35
|
-
number: pr.number,
|
|
36
|
-
url: pr.url,
|
|
37
|
-
state: pr.state,
|
|
38
|
-
title: pr.title,
|
|
39
|
-
...(pr.createdAt ? { createdAt: pr.createdAt } : {}),
|
|
40
|
-
...(pr.headRefOid ? { headRefOid: pr.headRefOid } : {}),
|
|
41
|
-
}
|
|
42
|
-
: undefined;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* The cached form of {@link ghPrView} (#1028), and what the dashboard's panels use.
|
|
46
|
-
*
|
|
47
|
-
* A PR lookup costs about 600ms where the git reads beside it cost ten, and the answer changes
|
|
48
|
-
* about as often as someone opens a PR. Cached per checkout and branch, shared between the
|
|
49
|
-
* worktree bar and the handoff summary, and refreshed behind whoever asks. `pending` says the
|
|
50
|
-
* answer is not known yet rather than that there is no PR — the difference matters to a caller
|
|
51
|
-
* deciding whether to offer "Open PR".
|
|
52
|
-
*/
|
|
53
|
-
export async function cachedPrView(cwd, branch) {
|
|
54
|
-
return cachedRead(prCacheKey(cwd, branch), () => ghPrView(cwd, branch));
|
|
55
|
-
}
|
|
56
|
-
/** Forget a branch's PR, after an action that changes whether it has one. */
|
|
57
|
-
export function forgetPr(cwd, branch) {
|
|
58
|
-
invalidate(prCacheKey(cwd, branch));
|
|
59
|
-
}
|
|
60
|
-
function prCacheKey(cwd, branch) {
|
|
61
|
-
return `pr\u0000${cwd}\u0000${branch ?? ''}`;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Every PR a branch name has ever had, newest first (#1251).
|
|
65
|
-
*
|
|
66
|
-
* `gh pr view <branch>` answers with the newest PR for that head *in any state*, so a session
|
|
67
|
-
* whose prompt pins its branch name (`the-framework/triage-quick`) inherits a predecessor's
|
|
68
|
-
* merged PR as its own. The list form keeps the whole history so {@link pickAgentPr} can decide
|
|
69
|
-
* which entry, if any, belongs to the agent asking. Resolves `[]` when gh is missing/unauthed —
|
|
70
|
-
* indistinguishable from "no PRs", which is what every caller would do with a failure anyway.
|
|
71
|
-
*/
|
|
72
|
-
export async function ghPrsForBranch(cwd, branch) {
|
|
73
|
-
return linkedPrs(await ghJson(prListArgs(branch), cwd, []));
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* {@link ghPrsForBranch} for a caller about to *open* a PR (#1601): a listing that fails throws
|
|
77
|
-
* instead of reading as "no PRs", because "none" and "could not tell" must not look alike there —
|
|
78
|
-
* the difference is a second draft PR on a branch that already has one.
|
|
79
|
-
*/
|
|
80
|
-
export async function ghPrsForBranchOrThrow(cwd, branch) {
|
|
81
|
-
return linkedPrs(JSON.parse(await readGh(prListArgs(branch), cwd)));
|
|
82
|
-
}
|
|
83
|
-
function prListArgs(branch) {
|
|
84
|
-
return ['pr', 'list', '--head', branch, '--state', 'all', '--limit', '20', '--json', 'number,url,state,title,createdAt,headRefOid'];
|
|
85
|
-
}
|
|
86
|
-
function linkedPrs(prs) {
|
|
87
|
-
return prs.map(pr => ({
|
|
88
|
-
number: pr.number,
|
|
89
|
-
url: pr.url,
|
|
90
|
-
state: pr.state,
|
|
91
|
-
title: pr.title,
|
|
92
|
-
...(pr.createdAt ? { createdAt: pr.createdAt } : {}),
|
|
93
|
-
...(pr.headRefOid ? { headRefOid: pr.headRefOid } : {}),
|
|
94
|
-
}));
|
|
95
|
-
}
|
|
96
|
-
/** The cached form of {@link ghPrsForBranch}, shared through the same read-through cache (#1028). */
|
|
97
|
-
export async function cachedPrsForBranch(cwd, branch) {
|
|
98
|
-
return cachedRead(branchPrsCacheKey(cwd, branch), () => ghPrsForBranch(cwd, branch));
|
|
99
|
-
}
|
|
100
|
-
/** Forget a branch's PR history, after an action that changes it (opening one). */
|
|
101
|
-
export function forgetBranchPrs(cwd, branch) {
|
|
102
|
-
invalidate(branchPrsCacheKey(cwd, branch));
|
|
103
|
-
}
|
|
104
|
-
/** Same unprintable separator idea as `prCacheKey`, spelled so paths cannot collide with it. */
|
|
105
|
-
const KEY_SEP = String.fromCharCode(0);
|
|
106
|
-
function branchPrsCacheKey(cwd, branch) {
|
|
107
|
-
return ['prs', cwd, branch].join(KEY_SEP);
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* The PR that belongs to an agent, out of every PR its branch name has had (#1251/#1255).
|
|
111
|
-
*
|
|
112
|
-
* An OPEN PR always counts: GitHub allows one open PR per head branch, so whatever is open on the
|
|
113
|
-
* run's branch is where its pushed commits land. A closed one counts only when it was created
|
|
114
|
-
* after the agent started (`since`, the agent's `startedAt`) — the oldest such entry, which is the one
|
|
115
|
-
* this agent's handoff opened. Anything older is a previous agent's PR wearing the same branch name,
|
|
116
|
-
* which is exactly what showed a merged two-day-old PR as a fresh session's own. Without `since`
|
|
117
|
-
* only an open PR is trusted.
|
|
118
|
-
*
|
|
119
|
-
* `order` exists for the one caller asking a different question (#1512). `'first'` answers
|
|
120
|
-
* identity — which PR did *this agent* open, so a later agent's must not be the answer. `'latest'`
|
|
121
|
-
* answers the handoff decision — which PR last saw the branch, so "did the session keep working
|
|
122
|
-
* past it" is readable off that PR's `headRefOid`; there the oldest entry would call work that a
|
|
123
|
-
* second PR already landed unlanded.
|
|
124
|
-
*/
|
|
125
|
-
export function pickAgentPr(prs, since, order = 'first') {
|
|
126
|
-
const open = prs.find(pr => pr.state === 'OPEN');
|
|
127
|
-
if (open)
|
|
128
|
-
return open;
|
|
129
|
-
if (!since)
|
|
130
|
-
return undefined;
|
|
131
|
-
const closed = prs
|
|
132
|
-
.filter(pr => pr.createdAt && pr.createdAt >= since)
|
|
133
|
-
.sort((a, b) => ((a.createdAt ?? '') < (b.createdAt ?? '') ? -1 : 1));
|
|
134
|
-
return order === 'latest' ? closed.at(-1) : closed[0];
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* A checkout's open PRs. Unlike the other reads here it *rejects* when gh could not answer — no
|
|
138
|
-
* remote, not authenticated, GitHub unreachable — instead of resolving `[]`.
|
|
139
|
-
*
|
|
140
|
-
* "No PRs are open" and "I could not look" are different answers, and its caller keeps a baseline
|
|
141
|
-
* of what it has already announced (#1623): taking the second for the first makes the next
|
|
142
|
-
* successful read announce every already-open PR as new. The caller decides what a failure costs;
|
|
143
|
-
* it cannot decide what it never hears about.
|
|
144
|
-
*/
|
|
145
|
-
export async function ghPrList(cwd, gh = readGh) {
|
|
146
|
-
const fields = 'number,title,url,isDraft,headRefName,createdAt';
|
|
147
|
-
const args = ['pr', 'list', '--state', 'open', '--limit', '50', '--json', fields];
|
|
148
|
-
return JSON.parse(await gh(args, cwd));
|
|
149
|
-
}
|
|
150
|
-
//# sourceMappingURL=gh.js.map
|