toolroll 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1113 -0
- package/THIRD_PARTY_NOTICES.md +449 -0
- package/dist/accent-colors.d.ts +48 -0
- package/dist/accent-colors.js +122 -0
- package/dist/action-ledger.d.ts +26 -0
- package/dist/action-ledger.js +75 -0
- package/dist/agent-fence.d.ts +42 -0
- package/dist/agent-fence.js +183 -0
- package/dist/agentconfig.d.ts +216 -0
- package/dist/agentconfig.js +454 -0
- package/dist/api-tokens.d.ts +16 -0
- package/dist/api-tokens.js +27 -0
- package/dist/approval-policy.d.ts +69 -0
- package/dist/approval-policy.js +137 -0
- package/dist/approval-rules-ui.d.ts +25 -0
- package/dist/approval-rules-ui.js +39 -0
- package/dist/assignment-adapters.d.ts +180 -0
- package/dist/assignment-adapters.js +239 -0
- package/dist/assignment-brief.d.ts +71 -0
- package/dist/assignment-brief.js +129 -0
- package/dist/assignment-delivery.d.ts +56 -0
- package/dist/assignment-delivery.js +160 -0
- package/dist/assignment-presentation.d.ts +26 -0
- package/dist/assignment-presentation.js +80 -0
- package/dist/assignment-status.d.ts +62 -0
- package/dist/assignment-status.js +152 -0
- package/dist/assignment-ui.d.ts +71 -0
- package/dist/assignment-ui.js +103 -0
- package/dist/assignment.d.ts +222 -0
- package/dist/assignment.js +399 -0
- package/dist/attest.d.ts +56 -0
- package/dist/attest.js +153 -0
- package/dist/backend.d.ts +97 -0
- package/dist/backend.js +166 -0
- package/dist/backup-ui.d.ts +22 -0
- package/dist/backup-ui.js +59 -0
- package/dist/backup.d.ts +84 -0
- package/dist/backup.js +421 -0
- package/dist/beads.d.ts +34 -0
- package/dist/beads.js +135 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +22 -0
- package/dist/board.d.ts +150 -0
- package/dist/board.js +210 -0
- package/dist/boot-identity.d.ts +63 -0
- package/dist/boot-identity.js +99 -0
- package/dist/browser/THIRD_PARTY_NOTICES.txt +2295 -0
- package/dist/browser/workspace.css +4 -0
- package/dist/browser/workspace.js +225 -0
- package/dist/browser-crew.d.ts +11 -0
- package/dist/browser-crew.js +50 -0
- package/dist/browser-shell.d.ts +8 -0
- package/dist/browser-shell.js +60 -0
- package/dist/browser-workspace.d.ts +780 -0
- package/dist/browser-workspace.js +47 -0
- package/dist/budget-alerts.d.ts +19 -0
- package/dist/budget-alerts.js +46 -0
- package/dist/builder.d.ts +370 -0
- package/dist/builder.js +3262 -0
- package/dist/capscan.d.ts +35 -0
- package/dist/capscan.js +113 -0
- package/dist/chat-acceptance.d.ts +71 -0
- package/dist/chat-acceptance.js +120 -0
- package/dist/chat-actions.d.ts +265 -0
- package/dist/chat-actions.js +1273 -0
- package/dist/chat-channel.d.ts +109 -0
- package/dist/chat-channel.js +652 -0
- package/dist/chat-continuity.d.ts +32 -0
- package/dist/chat-continuity.js +317 -0
- package/dist/chat-controls.d.ts +113 -0
- package/dist/chat-controls.js +53 -0
- package/dist/chat-delivery-state.d.ts +159 -0
- package/dist/chat-delivery-state.js +309 -0
- package/dist/chat-delivery.d.ts +38 -0
- package/dist/chat-delivery.js +693 -0
- package/dist/chat-display.d.ts +1 -0
- package/dist/chat-display.js +18 -0
- package/dist/chat-evidence.d.ts +123 -0
- package/dist/chat-evidence.js +207 -0
- package/dist/chat-flow.d.ts +44 -0
- package/dist/chat-flow.js +215 -0
- package/dist/chat-inbox.d.ts +57 -0
- package/dist/chat-inbox.js +123 -0
- package/dist/chat-polish.d.ts +16 -0
- package/dist/chat-polish.js +135 -0
- package/dist/chat-review.d.ts +46 -0
- package/dist/chat-review.js +98 -0
- package/dist/chat-rooms.d.ts +123 -0
- package/dist/chat-rooms.js +216 -0
- package/dist/chat-task-actions.d.ts +44 -0
- package/dist/chat-task-actions.js +79 -0
- package/dist/check-progress.d.ts +51 -0
- package/dist/check-progress.js +290 -0
- package/dist/child-database.d.ts +12 -0
- package/dist/child-database.js +30 -0
- package/dist/claim.d.ts +688 -0
- package/dist/claim.js +1740 -0
- package/dist/cli.d.ts +137 -0
- package/dist/cli.js +1461 -0
- package/dist/codex-limits.d.ts +15 -0
- package/dist/codex-limits.js +145 -0
- package/dist/coding-context.d.ts +55 -0
- package/dist/coding-context.js +92 -0
- package/dist/coding-handoff.d.ts +57 -0
- package/dist/coding-handoff.js +277 -0
- package/dist/coding-provider.d.ts +72 -0
- package/dist/coding-provider.js +424 -0
- package/dist/coding-shipping-ui.d.ts +4 -0
- package/dist/coding-shipping-ui.js +12 -0
- package/dist/coding-types.d.ts +62 -0
- package/dist/coding-types.js +1 -0
- package/dist/coding-ui.d.ts +17 -0
- package/dist/coding-ui.js +364 -0
- package/dist/coding-update.d.ts +15 -0
- package/dist/coding-update.js +149 -0
- package/dist/coding-workspace.d.ts +124 -0
- package/dist/coding-workspace.js +768 -0
- package/dist/container-state.d.ts +5 -0
- package/dist/container-state.js +62 -0
- package/dist/containment.d.ts +197 -0
- package/dist/containment.js +559 -0
- package/dist/contest.d.ts +318 -0
- package/dist/contest.js +753 -0
- package/dist/control-setup.d.ts +35 -0
- package/dist/control-setup.js +40 -0
- package/dist/control-ui.d.ts +29 -0
- package/dist/control-ui.js +53 -0
- package/dist/controller-service.d.ts +1 -0
- package/dist/controller-service.js +19 -0
- package/dist/controller-supervisor.d.ts +30 -0
- package/dist/controller-supervisor.js +104 -0
- package/dist/converse.d.ts +304 -0
- package/dist/converse.js +849 -0
- package/dist/coordinator-proposals.d.ts +29 -0
- package/dist/coordinator-proposals.js +137 -0
- package/dist/coordinator.d.ts +186 -0
- package/dist/coordinator.js +447 -0
- package/dist/credentials-ui.d.ts +25 -0
- package/dist/credentials-ui.js +48 -0
- package/dist/daemon.d.ts +209 -0
- package/dist/daemon.js +604 -0
- package/dist/decision.d.ts +120 -0
- package/dist/decision.js +388 -0
- package/dist/demo.d.ts +55 -0
- package/dist/demo.js +992 -0
- package/dist/desktop-access.d.ts +28 -0
- package/dist/desktop-access.js +88 -0
- package/dist/desktop-bundle.d.ts +16 -0
- package/dist/desktop-bundle.js +74 -0
- package/dist/desktop-host.d.ts +54 -0
- package/dist/desktop-host.js +508 -0
- package/dist/desktop-update-gate.d.ts +12 -0
- package/dist/desktop-update-gate.js +91 -0
- package/dist/desktop-update-recovery.d.ts +14 -0
- package/dist/desktop-update-recovery.js +243 -0
- package/dist/desktop-update.d.ts +110 -0
- package/dist/desktop-update.js +740 -0
- package/dist/discord-api.d.ts +20 -0
- package/dist/discord-api.js +138 -0
- package/dist/discord-chat.d.ts +16 -0
- package/dist/discord-chat.js +381 -0
- package/dist/discord-settings.d.ts +7 -0
- package/dist/discord-settings.js +75 -0
- package/dist/discord.d.ts +10 -0
- package/dist/discord.js +169 -0
- package/dist/discover.d.ts +75 -0
- package/dist/discover.js +150 -0
- package/dist/dispatch.d.ts +100 -0
- package/dist/dispatch.js +311 -0
- package/dist/dispose.d.ts +161 -0
- package/dist/dispose.js +803 -0
- package/dist/email-settings.d.ts +34 -0
- package/dist/email-settings.js +50 -0
- package/dist/envelope.d.ts +47 -0
- package/dist/envelope.js +105 -0
- package/dist/evidence-pack.d.ts +185 -0
- package/dist/evidence-pack.js +258 -0
- package/dist/evidence.d.ts +345 -0
- package/dist/evidence.js +782 -0
- package/dist/exec.d.ts +285 -0
- package/dist/exec.js +1841 -0
- package/dist/exhaustion.d.ts +85 -0
- package/dist/exhaustion.js +141 -0
- package/dist/export-ui.d.ts +4 -0
- package/dist/export-ui.js +17 -0
- package/dist/export.d.ts +48 -0
- package/dist/export.js +305 -0
- package/dist/flow-actions.d.ts +77 -0
- package/dist/flow-actions.js +203 -0
- package/dist/flow-code.d.ts +50 -0
- package/dist/flow-code.js +159 -0
- package/dist/flow-draft.d.ts +38 -0
- package/dist/flow-draft.js +80 -0
- package/dist/flow-engine.d.ts +66 -0
- package/dist/flow-engine.js +416 -0
- package/dist/flow-insights.d.ts +95 -0
- package/dist/flow-insights.js +149 -0
- package/dist/flow-live.d.ts +24 -0
- package/dist/flow-live.js +150 -0
- package/dist/flow-people.d.ts +24 -0
- package/dist/flow-people.js +91 -0
- package/dist/flow-replies.d.ts +48 -0
- package/dist/flow-replies.js +113 -0
- package/dist/flow-scripts.d.ts +38 -0
- package/dist/flow-scripts.js +73 -0
- package/dist/flow-secrets.d.ts +13 -0
- package/dist/flow-secrets.js +45 -0
- package/dist/flow-sort.d.ts +82 -0
- package/dist/flow-sort.js +153 -0
- package/dist/flow-steps.d.ts +40 -0
- package/dist/flow-steps.js +408 -0
- package/dist/flow-triggers.d.ts +244 -0
- package/dist/flow-triggers.js +959 -0
- package/dist/flows-ui.d.ts +20 -0
- package/dist/flows-ui.js +175 -0
- package/dist/flows.d.ts +229 -0
- package/dist/flows.js +968 -0
- package/dist/fonts.d.ts +19 -0
- package/dist/fonts.js +19 -0
- package/dist/gaps.d.ts +35 -0
- package/dist/gaps.js +101 -0
- package/dist/gate-failure.d.ts +40 -0
- package/dist/gate-failure.js +66 -0
- package/dist/git.d.ts +54 -0
- package/dist/git.js +94 -0
- package/dist/google-mail.d.ts +58 -0
- package/dist/google-mail.js +151 -0
- package/dist/grant.d.ts +136 -0
- package/dist/grant.js +238 -0
- package/dist/graph.d.ts +164 -0
- package/dist/graph.js +383 -0
- package/dist/guides.d.ts +22 -0
- package/dist/guides.js +363 -0
- package/dist/held.d.ts +150 -0
- package/dist/held.js +799 -0
- package/dist/invoke.d.ts +112 -0
- package/dist/invoke.js +780 -0
- package/dist/issues.d.ts +41 -0
- package/dist/issues.js +131 -0
- package/dist/job-object-helper.ps1 +252 -0
- package/dist/jsonl-discriminants.d.ts +11 -0
- package/dist/jsonl-discriminants.js +93 -0
- package/dist/keys.d.ts +104 -0
- package/dist/keys.js +229 -0
- package/dist/kits-ui.d.ts +17 -0
- package/dist/kits-ui.js +46 -0
- package/dist/kits.d.ts +86 -0
- package/dist/kits.js +215 -0
- package/dist/knowledge-cli.d.ts +101 -0
- package/dist/knowledge-cli.js +92 -0
- package/dist/knowledge-ui.d.ts +24 -0
- package/dist/knowledge-ui.js +40 -0
- package/dist/lead-context.d.ts +8 -0
- package/dist/lead-context.js +56 -0
- package/dist/lead-follow.d.ts +22 -0
- package/dist/lead-follow.js +167 -0
- package/dist/lead-status.d.ts +75 -0
- package/dist/lead-status.js +285 -0
- package/dist/ledger-chain.d.ts +46 -0
- package/dist/ledger-chain.js +187 -0
- package/dist/ledger-csv.d.ts +4 -0
- package/dist/ledger-csv.js +11 -0
- package/dist/ledger-view.d.ts +24 -0
- package/dist/ledger-view.js +58 -0
- package/dist/limits-ui.d.ts +26 -0
- package/dist/limits-ui.js +67 -0
- package/dist/link.d.ts +72 -0
- package/dist/link.js +217 -0
- package/dist/live.d.ts +96 -0
- package/dist/live.js +366 -0
- package/dist/liveness.d.ts +30 -0
- package/dist/liveness.js +42 -0
- package/dist/log.d.ts +7 -0
- package/dist/log.js +25 -0
- package/dist/mailbox.d.ts +57 -0
- package/dist/mailbox.js +150 -0
- package/dist/maintenance.d.ts +11 -0
- package/dist/maintenance.js +35 -0
- package/dist/mate-cli.d.ts +52 -0
- package/dist/mate-cli.js +345 -0
- package/dist/mate-contract.d.ts +10 -0
- package/dist/mate-contract.js +30 -0
- package/dist/mate-doors.d.ts +69 -0
- package/dist/mate-doors.js +548 -0
- package/dist/mate-progress.d.ts +29 -0
- package/dist/mate-progress.js +121 -0
- package/dist/mate-tools.d.ts +94 -0
- package/dist/mate-tools.js +1878 -0
- package/dist/mate.d.ts +92 -0
- package/dist/mate.js +435 -0
- package/dist/mcp-connect.d.ts +103 -0
- package/dist/mcp-connect.js +252 -0
- package/dist/mcp.d.ts +27 -0
- package/dist/mcp.js +651 -0
- package/dist/memory-cli.d.ts +466 -0
- package/dist/memory-cli.js +111 -0
- package/dist/memory-pass.d.ts +160 -0
- package/dist/memory-pass.js +409 -0
- package/dist/metrics.d.ts +3 -0
- package/dist/metrics.js +56 -0
- package/dist/mobile-viewport.d.ts +3 -0
- package/dist/mobile-viewport.js +37 -0
- package/dist/model-catalog.d.ts +118 -0
- package/dist/model-catalog.js +376 -0
- package/dist/models-cli.d.ts +102 -0
- package/dist/models-cli.js +66 -0
- package/dist/models-ui.d.ts +34 -0
- package/dist/models-ui.js +68 -0
- package/dist/modes.d.ts +80 -0
- package/dist/modes.js +182 -0
- package/dist/monitoring-settings.d.ts +44 -0
- package/dist/monitoring-settings.js +173 -0
- package/dist/monitoring-ui.d.ts +20 -0
- package/dist/monitoring-ui.js +51 -0
- package/dist/monitoring.d.ts +34 -0
- package/dist/monitoring.js +221 -0
- package/dist/names.d.ts +67 -0
- package/dist/names.js +102 -0
- package/dist/observations.d.ts +40 -0
- package/dist/observations.js +211 -0
- package/dist/oidc.d.ts +71 -0
- package/dist/oidc.js +182 -0
- package/dist/onboard.d.ts +108 -0
- package/dist/onboard.js +325 -0
- package/dist/openrouter-models.d.ts +30 -0
- package/dist/openrouter-models.js +120 -0
- package/dist/operate.d.ts +118 -0
- package/dist/operate.js +11321 -0
- package/dist/peek-cli.d.ts +97 -0
- package/dist/peek-cli.js +215 -0
- package/dist/peek.d.ts +134 -0
- package/dist/peek.js +578 -0
- package/dist/phase-routing.d.ts +307 -0
- package/dist/phase-routing.js +658 -0
- package/dist/plan-auto.d.ts +14 -0
- package/dist/plan-auto.js +92 -0
- package/dist/plan.d.ts +186 -0
- package/dist/plan.js +401 -0
- package/dist/planner-source.d.ts +251 -0
- package/dist/planner-source.js +460 -0
- package/dist/planner.d.ts +75 -0
- package/dist/planner.js +992 -0
- package/dist/policy-ui.d.ts +20 -0
- package/dist/policy-ui.js +41 -0
- package/dist/policy.d.ts +111 -0
- package/dist/policy.js +231 -0
- package/dist/prepared-evidence.d.ts +16 -0
- package/dist/prepared-evidence.js +96 -0
- package/dist/pricing.d.ts +45 -0
- package/dist/pricing.js +77 -0
- package/dist/principal.d.ts +42 -0
- package/dist/principal.js +82 -0
- package/dist/probe.d.ts +46 -0
- package/dist/probe.js +79 -0
- package/dist/process-custody.d.ts +17 -0
- package/dist/process-custody.js +91 -0
- package/dist/process-liveness.d.ts +10 -0
- package/dist/process-liveness.js +81 -0
- package/dist/process-recovery-anchor.d.ts +75 -0
- package/dist/process-recovery-anchor.js +188 -0
- package/dist/process-recovery-coalition.d.ts +25 -0
- package/dist/process-recovery-coalition.js +105 -0
- package/dist/process-recovery-eligibility.d.ts +178 -0
- package/dist/process-recovery-eligibility.js +170 -0
- package/dist/process-recovery-native.d.ts +172 -0
- package/dist/process-recovery-native.js +592 -0
- package/dist/process-recovery-provenance.d.ts +163 -0
- package/dist/process-recovery-provenance.js +292 -0
- package/dist/process-recovery-services.d.ts +56 -0
- package/dist/process-recovery-services.js +191 -0
- package/dist/process-recovery-settlement.d.ts +32 -0
- package/dist/process-recovery-settlement.js +132 -0
- package/dist/process-recovery.d.ts +41 -0
- package/dist/process-recovery.js +91 -0
- package/dist/process-tree.d.ts +41 -0
- package/dist/process-tree.js +264 -0
- package/dist/project-access.d.ts +14 -0
- package/dist/project-access.js +34 -0
- package/dist/project-cli.d.ts +18 -0
- package/dist/project-cli.js +104 -0
- package/dist/project-delete-ui.d.ts +22 -0
- package/dist/project-delete-ui.js +48 -0
- package/dist/project-delete.d.ts +55 -0
- package/dist/project-delete.js +413 -0
- package/dist/project-knowledge.d.ts +111 -0
- package/dist/project-knowledge.js +241 -0
- package/dist/project-learning.d.ts +100 -0
- package/dist/project-learning.js +438 -0
- package/dist/project-memory.d.ts +81 -0
- package/dist/project-memory.js +264 -0
- package/dist/project-skills.d.ts +152 -0
- package/dist/project-skills.js +660 -0
- package/dist/project-tools.d.ts +219 -0
- package/dist/project-tools.js +796 -0
- package/dist/project.d.ts +61 -0
- package/dist/project.js +125 -0
- package/dist/prompt.d.ts +22 -0
- package/dist/prompt.js +72 -0
- package/dist/proof.d.ts +513 -0
- package/dist/proof.js +1140 -0
- package/dist/proposal.d.ts +82 -0
- package/dist/proposal.js +210 -0
- package/dist/provider-connection.d.ts +22 -0
- package/dist/provider-connection.js +98 -0
- package/dist/provider-limits.d.ts +35 -0
- package/dist/provider-limits.js +95 -0
- package/dist/provider.d.ts +279 -0
- package/dist/provider.js +935 -0
- package/dist/publish.d.ts +107 -0
- package/dist/publish.js +650 -0
- package/dist/pulls.d.ts +118 -0
- package/dist/pulls.js +240 -0
- package/dist/push.d.ts +95 -0
- package/dist/push.js +353 -0
- package/dist/quality.d.ts +8 -0
- package/dist/quality.js +6 -0
- package/dist/recipe-ui.d.ts +18 -0
- package/dist/recipe-ui.js +152 -0
- package/dist/recipes.d.ts +81 -0
- package/dist/recipes.js +332 -0
- package/dist/remote.d.ts +67 -0
- package/dist/remote.js +122 -0
- package/dist/render.d.ts +64 -0
- package/dist/render.js +587 -0
- package/dist/report-summary.d.ts +13 -0
- package/dist/report-summary.js +15 -0
- package/dist/repos.d.ts +65 -0
- package/dist/repos.js +277 -0
- package/dist/repository-context-ui.d.ts +2 -0
- package/dist/repository-context-ui.js +10 -0
- package/dist/repository-context.d.ts +67 -0
- package/dist/repository-context.js +376 -0
- package/dist/restart-certification.d.ts +134 -0
- package/dist/restart-certification.js +226 -0
- package/dist/result-actions.d.ts +28 -0
- package/dist/result-actions.js +270 -0
- package/dist/result-completion.d.ts +18 -0
- package/dist/result-completion.js +66 -0
- package/dist/result-review.d.ts +213 -0
- package/dist/result-review.js +430 -0
- package/dist/retention-ui.d.ts +12 -0
- package/dist/retention-ui.js +39 -0
- package/dist/retention.d.ts +72 -0
- package/dist/retention.js +288 -0
- package/dist/review-context.d.ts +243 -0
- package/dist/review-context.js +1043 -0
- package/dist/review-evidence.d.ts +33 -0
- package/dist/review-evidence.js +56 -0
- package/dist/reviewer.d.ts +97 -0
- package/dist/reviewer.js +202 -0
- package/dist/routine.d.ts +228 -0
- package/dist/routine.js +764 -0
- package/dist/runner.d.ts +266 -0
- package/dist/runner.js +399 -0
- package/dist/scan.d.ts +32 -0
- package/dist/scan.js +92 -0
- package/dist/scope.d.ts +695 -0
- package/dist/scope.js +1176 -0
- package/dist/scout-report.d.ts +42 -0
- package/dist/scout-report.js +108 -0
- package/dist/scout.d.ts +69 -0
- package/dist/scout.js +351 -0
- package/dist/serve.d.ts +313 -0
- package/dist/serve.js +21776 -0
- package/dist/session-brief.d.ts +8 -0
- package/dist/session-brief.js +24 -0
- package/dist/session-cli.d.ts +13 -0
- package/dist/session-cli.js +284 -0
- package/dist/session-contract.d.ts +183 -0
- package/dist/session-contract.js +122 -0
- package/dist/session-http.d.ts +19 -0
- package/dist/session-http.js +154 -0
- package/dist/session-server.d.ts +12 -0
- package/dist/session-server.js +37 -0
- package/dist/session-service.d.ts +22 -0
- package/dist/session-service.js +157 -0
- package/dist/setup-guide.d.ts +39 -0
- package/dist/setup-guide.js +93 -0
- package/dist/sign-in-guard.d.ts +45 -0
- package/dist/sign-in-guard.js +74 -0
- package/dist/skills-ui.d.ts +11 -0
- package/dist/skills-ui.js +58 -0
- package/dist/skills.d.ts +97 -0
- package/dist/skills.js +276 -0
- package/dist/slack-api.d.ts +55 -0
- package/dist/slack-api.js +229 -0
- package/dist/slack-chat.d.ts +28 -0
- package/dist/slack-chat.js +413 -0
- package/dist/slack-settings.d.ts +7 -0
- package/dist/slack-settings.js +75 -0
- package/dist/slack-state.d.ts +13 -0
- package/dist/slack-state.js +9 -0
- package/dist/slack.d.ts +13 -0
- package/dist/slack.js +167 -0
- package/dist/spend-ui.d.ts +28 -0
- package/dist/spend-ui.js +95 -0
- package/dist/spend.d.ts +142 -0
- package/dist/spend.js +313 -0
- package/dist/sqlite-runtime.d.ts +3 -0
- package/dist/sqlite-runtime.js +6 -0
- package/dist/sso-settings.d.ts +33 -0
- package/dist/sso-settings.js +103 -0
- package/dist/sso-ui.d.ts +22 -0
- package/dist/sso-ui.js +39 -0
- package/dist/storage.d.ts +15 -0
- package/dist/storage.js +84 -0
- package/dist/store.d.ts +7754 -0
- package/dist/store.js +23279 -0
- package/dist/structured-output.d.ts +58 -0
- package/dist/structured-output.js +103 -0
- package/dist/style-asset.d.ts +7 -0
- package/dist/style-asset.js +41 -0
- package/dist/subscription-chat.d.ts +46 -0
- package/dist/subscription-chat.js +275 -0
- package/dist/summary.d.ts +33 -0
- package/dist/summary.js +71 -0
- package/dist/supervisor.mjs +297 -0
- package/dist/surface.d.ts +63 -0
- package/dist/surface.js +352 -0
- package/dist/sync.d.ts +94 -0
- package/dist/sync.js +279 -0
- package/dist/task-composer.d.ts +13 -0
- package/dist/task-composer.js +52 -0
- package/dist/task-control.d.ts +165 -0
- package/dist/task-control.js +214 -0
- package/dist/task-outcome-cli.d.ts +10 -0
- package/dist/task-outcome-cli.js +92 -0
- package/dist/task-text.d.ts +30 -0
- package/dist/task-text.js +41 -0
- package/dist/team-cli.d.ts +15 -0
- package/dist/team-cli.js +618 -0
- package/dist/team-contract.d.ts +92 -0
- package/dist/team-contract.js +1 -0
- package/dist/team-http.d.ts +17 -0
- package/dist/team-http.js +144 -0
- package/dist/team-leads.d.ts +81 -0
- package/dist/team-leads.js +565 -0
- package/dist/team-runtime.d.ts +27 -0
- package/dist/team-runtime.js +264 -0
- package/dist/team-ui.d.ts +3 -0
- package/dist/team-ui.js +9 -0
- package/dist/team-updates.d.ts +8 -0
- package/dist/team-updates.js +57 -0
- package/dist/teammate-admin.d.ts +53 -0
- package/dist/teammate-admin.js +111 -0
- package/dist/teammate-desk.d.ts +60 -0
- package/dist/teammate-desk.js +154 -0
- package/dist/teammate-memory.d.ts +64 -0
- package/dist/teammate-memory.js +196 -0
- package/dist/teammate-question.d.ts +59 -0
- package/dist/teammate-question.js +175 -0
- package/dist/teammate-tools.d.ts +108 -0
- package/dist/teammate-tools.js +271 -0
- package/dist/teammate-week.d.ts +68 -0
- package/dist/teammate-week.js +132 -0
- package/dist/teammate-work.d.ts +76 -0
- package/dist/teammate-work.js +280 -0
- package/dist/teammates-ui.d.ts +20 -0
- package/dist/teammates-ui.js +166 -0
- package/dist/teammates.d.ts +180 -0
- package/dist/teammates.js +253 -0
- package/dist/teams-api.d.ts +33 -0
- package/dist/teams-api.js +204 -0
- package/dist/teams-chat.d.ts +26 -0
- package/dist/teams-chat.js +215 -0
- package/dist/teams-settings.d.ts +12 -0
- package/dist/teams-settings.js +57 -0
- package/dist/teams.d.ts +21 -0
- package/dist/teams.js +124 -0
- package/dist/telegram-flow.d.ts +49 -0
- package/dist/telegram-flow.js +110 -0
- package/dist/telegram-mate.d.ts +137 -0
- package/dist/telegram-mate.js +707 -0
- package/dist/telegram-progress.d.ts +14 -0
- package/dist/telegram-progress.js +129 -0
- package/dist/telegram-settings.d.ts +9 -0
- package/dist/telegram-settings.js +36 -0
- package/dist/telegram-status.d.ts +75 -0
- package/dist/telegram-status.js +265 -0
- package/dist/telegram-team.d.ts +85 -0
- package/dist/telegram-team.js +359 -0
- package/dist/telegram.d.ts +230 -0
- package/dist/telegram.js +1931 -0
- package/dist/templates.d.ts +65 -0
- package/dist/templates.js +118 -0
- package/dist/tool-launcher.d.ts +1 -0
- package/dist/tool-launcher.js +101 -0
- package/dist/tools-ui.d.ts +30 -0
- package/dist/tools-ui.js +40 -0
- package/dist/transitions-recipes.d.ts +1 -0
- package/dist/transitions-recipes.js +203 -0
- package/dist/tree-proof.d.ts +34 -0
- package/dist/tree-proof.js +58 -0
- package/dist/verification-evidence.d.ts +44 -0
- package/dist/verification-evidence.js +238 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +10 -0
- package/dist/webhooks.d.ts +91 -0
- package/dist/webhooks.js +283 -0
- package/dist/work-index.d.ts +68 -0
- package/dist/work-index.js +384 -0
- package/dist/work-summary.d.ts +57 -0
- package/dist/work-summary.js +116 -0
- package/dist/workspace-motion.d.ts +4 -0
- package/dist/workspace-motion.js +133 -0
- package/dist/workspace-revision.d.ts +19 -0
- package/dist/workspace-revision.js +92 -0
- package/dist/workspace-ui.d.ts +204 -0
- package/dist/workspace-ui.js +411 -0
- package/dist/worktree-notices.d.ts +13 -0
- package/dist/worktree-notices.js +17 -0
- package/dist/worktree.d.ts +249 -0
- package/dist/worktree.js +720 -0
- package/package.json +122 -0
- package/scripts/canary-assertions.mjs +42 -0
- package/scripts/crash-canary.mjs +253 -0
- package/scripts/fixtures/crash-process.mjs +74 -0
- package/scripts/fixtures/pilot-scenarios.mjs +85 -0
- package/scripts/fixtures/restart-service.mjs +27 -0
- package/scripts/launchd-certification.mjs +143 -0
- package/scripts/pilot.mjs +121 -0
- package/scripts/proof-preflight.mjs +140 -0
- package/scripts/provider-canary.mjs +379 -0
- package/scripts/recovery-canary.mjs +135 -0
- package/scripts/restart-certification.mjs +98 -0
package/dist/dispatch.js
ADDED
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One read-side answer to "will this task run?"
|
|
3
|
+
*
|
|
4
|
+
* The atomic claim remains the authority. This module owns the task-local
|
|
5
|
+
* predicates that claim re-proves under its write transaction, then layers
|
|
6
|
+
* fleet observations on top for people and agents reading the queue. A
|
|
7
|
+
* diagnosis can go stale; it can never grant a lease.
|
|
8
|
+
*/
|
|
9
|
+
import { isAlive } from "./runner.js";
|
|
10
|
+
import { updateAdmissionPaused, UPDATE_PAUSED } from "./desktop-update-gate.js";
|
|
11
|
+
import { approvalOf } from "./scope.js";
|
|
12
|
+
import { plannerSourceProblemOf } from "./planner-source.js";
|
|
13
|
+
import { REVIEW_TOKENS, resultStatusOf, reviewFactsOf } from "./workspace-ui.js";
|
|
14
|
+
import { BUILT_IN, parseCapabilityKey } from "./store.js";
|
|
15
|
+
export const DEFAULT_MAX_OPEN_DECISIONS = 5;
|
|
16
|
+
/**
|
|
17
|
+
* Task state, active holds, and unfinished dependencies in the exact order
|
|
18
|
+
* acquireIfReady checks them. The claim path calls this while holding its
|
|
19
|
+
* write transaction; read surfaces call it only as a snapshot.
|
|
20
|
+
*/
|
|
21
|
+
export function taskReadinessBlocker(store, taskRef, now) {
|
|
22
|
+
const db = store.handle;
|
|
23
|
+
const stamp = now.toISOString();
|
|
24
|
+
const task = db
|
|
25
|
+
.prepare(`SELECT task.id, task.state FROM task
|
|
26
|
+
JOIN task_ref ON task_ref.external_id = task.id AND task_ref.backend = ?
|
|
27
|
+
WHERE task_ref.id = ?`)
|
|
28
|
+
.get(BUILT_IN, taskRef);
|
|
29
|
+
if (task === undefined)
|
|
30
|
+
return { code: "unknown-task", message: "no such task" };
|
|
31
|
+
const state = String(task["state"]);
|
|
32
|
+
if (state !== "queued")
|
|
33
|
+
return { code: "state", state, message: `state is ${state}, not queued` };
|
|
34
|
+
const hold = db
|
|
35
|
+
.prepare(`SELECT owner_kind, until, reason FROM hold
|
|
36
|
+
WHERE task_ref = ? AND (until IS NULL OR until > ?)
|
|
37
|
+
ORDER BY held_at, id LIMIT 1`)
|
|
38
|
+
.get(taskRef, stamp);
|
|
39
|
+
if (hold !== undefined) {
|
|
40
|
+
return {
|
|
41
|
+
code: "hold",
|
|
42
|
+
ownerKind: String(hold["owner_kind"]),
|
|
43
|
+
until: hold["until"] === null || hold["until"] === undefined ? null : String(hold["until"]),
|
|
44
|
+
message: `held: ${String(hold["reason"])}`,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const blocker = db
|
|
48
|
+
.prepare(`SELECT blocker.id, blocker.state FROM task_edge
|
|
49
|
+
JOIN task AS blocker ON blocker.id = task_edge.blocker
|
|
50
|
+
WHERE task_edge.blocked = ? AND blocker.state <> 'done'
|
|
51
|
+
ORDER BY blocker.id LIMIT 1`)
|
|
52
|
+
.get(String(task["id"]));
|
|
53
|
+
if (blocker !== undefined) {
|
|
54
|
+
const blockerId = String(blocker["id"]);
|
|
55
|
+
return {
|
|
56
|
+
code: "dependency",
|
|
57
|
+
blockerId,
|
|
58
|
+
blockerState: String(blocker["state"]),
|
|
59
|
+
message: `waiting on ${blockerId}`,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
/** The exact live approval predicate used by both the scheduler survey and
|
|
65
|
+
* the atomic claim. Mode-backed approvals count only while their signer and
|
|
66
|
+
* mode still stand. */
|
|
67
|
+
// Recovery reads this same live predicate; a completed run does not grandfather
|
|
68
|
+
// a revoked signer or mode, and this query never creates dispatch authority.
|
|
69
|
+
export function scopeApprovedForDispatch(store, taskRef, now) {
|
|
70
|
+
const row = store.handle
|
|
71
|
+
.prepare(`SELECT 1 AS hit FROM task_scope
|
|
72
|
+
JOIN task_ref ON task_ref.id = ? AND task_scope.task_id = task_ref.external_id
|
|
73
|
+
WHERE task_scope.approved_digest = task_scope.digest AND task_scope.approved_at IS NOT NULL
|
|
74
|
+
AND (COALESCE(task_scope.approval_basis, 'password') <> 'mode'
|
|
75
|
+
OR EXISTS (SELECT 1 FROM operating_mode om
|
|
76
|
+
JOIN approver signer ON signer.name = om.signed_by
|
|
77
|
+
WHERE om.repo = task_ref.repo AND om.revoked_at IS NULL
|
|
78
|
+
AND om.absolute_expiry > ? AND om.digest = task_scope.mode_digest
|
|
79
|
+
AND signer.revoked_at IS NULL AND signer.role = 'approver'))`)
|
|
80
|
+
.get(taskRef, now.toISOString());
|
|
81
|
+
return row !== undefined;
|
|
82
|
+
}
|
|
83
|
+
/** The phase the ordinary dispatch loop would choose before it resolves an
|
|
84
|
+
* agent. Attended authorization is deliberately outside this ordinary path. */
|
|
85
|
+
export function dispatchRoleFor(store, taskRef, now) {
|
|
86
|
+
const ref = store.refForId(taskRef);
|
|
87
|
+
const approved = scopeApprovedForDispatch(store, taskRef, now);
|
|
88
|
+
if (ref?.plan === "requested" && !approved)
|
|
89
|
+
return "planner";
|
|
90
|
+
if (ref?.deliverable === "report" && approved)
|
|
91
|
+
return "scout";
|
|
92
|
+
return "builder";
|
|
93
|
+
}
|
|
94
|
+
/** The first requirement this task fails, in words, or null. */
|
|
95
|
+
export function missingCapability(store, taskRef, dispatchRepo, now) {
|
|
96
|
+
const db = store.handle;
|
|
97
|
+
const row = db.prepare("SELECT repo, capability_requirements FROM task_ref WHERE id = ?").get(taskRef);
|
|
98
|
+
if (row === undefined)
|
|
99
|
+
return "no such task reference";
|
|
100
|
+
let keys;
|
|
101
|
+
try {
|
|
102
|
+
keys = JSON.parse(String(row["capability_requirements"] ?? "[]"));
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
keys = [];
|
|
106
|
+
}
|
|
107
|
+
if (keys.length === 0)
|
|
108
|
+
return null;
|
|
109
|
+
const repo = row["repo"] === null || row["repo"] === undefined ? dispatchRepo : String(row["repo"]);
|
|
110
|
+
if (repo === null)
|
|
111
|
+
return `requires ${keys[0]} but is placed in no repository`;
|
|
112
|
+
const stamp = now.toISOString();
|
|
113
|
+
for (const key of keys) {
|
|
114
|
+
const parsed = parseCapabilityKey(key);
|
|
115
|
+
if (parsed === null)
|
|
116
|
+
return `requirement \`${key}\` is not a capability key`;
|
|
117
|
+
const found = db.prepare("SELECT status, expires_at FROM capability WHERE repo = ? AND kind = ? AND name = ?").get(repo, parsed.kind, parsed.name);
|
|
118
|
+
if (found === undefined)
|
|
119
|
+
return `needs ${key} — unrecorded for ${repo}`;
|
|
120
|
+
if (String(found["status"]) !== "verified")
|
|
121
|
+
return `needs ${key} — not verified`;
|
|
122
|
+
const expires = found["expires_at"];
|
|
123
|
+
if (expires !== null && String(expires) <= stamp)
|
|
124
|
+
return `needs ${key} — verification expired`;
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
function answer(code, condition, summary, detail, options = {}) {
|
|
129
|
+
return {
|
|
130
|
+
condition,
|
|
131
|
+
code,
|
|
132
|
+
summary,
|
|
133
|
+
detail,
|
|
134
|
+
action: options.action ?? null,
|
|
135
|
+
nextAt: options.nextAt ?? null,
|
|
136
|
+
role: options.role ?? null,
|
|
137
|
+
blockerTaskId: options.blockerTaskId ?? null,
|
|
138
|
+
review: options.review ?? null,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/** The review projection, shaped for readers (v50). */
|
|
142
|
+
function reviewViewOf(sourceRun, retry) {
|
|
143
|
+
const current = retry.live ?? (retry.state === "queued" ? null : retry.latest);
|
|
144
|
+
return {
|
|
145
|
+
sourceRun,
|
|
146
|
+
state: retry.state,
|
|
147
|
+
attempt: retry.state === "queued" ? retry.nextAttempt : current?.attempt ?? null,
|
|
148
|
+
cap: retry.cap,
|
|
149
|
+
retriesUsed: retry.retriesUsed,
|
|
150
|
+
retriesRemaining: retry.retriesRemaining,
|
|
151
|
+
latestRun: retry.latest?.runId ?? null,
|
|
152
|
+
latestReason: retry.latest?.reason ?? null,
|
|
153
|
+
interrupted: retry.latest !== null && (retry.latest.outcome === "interrupted" || retry.latest.reason === "interrupted"),
|
|
154
|
+
queued: retry.openRequest === null ? null : { requestedBy: retry.openRequest.requestedBy, origin: retry.openRequest.origin },
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function approvedProfile(scope) {
|
|
158
|
+
if (scope === null || scope.approvalKind === "chain")
|
|
159
|
+
return null;
|
|
160
|
+
return scope.approvedProfile ?? scope.profile ?? null;
|
|
161
|
+
}
|
|
162
|
+
/** The read-side lifecycle answer. It changes nothing and grants nothing. */
|
|
163
|
+
export function diagnoseTaskDispatch(store, taskId, now) {
|
|
164
|
+
const task = store.getTask(taskId);
|
|
165
|
+
const ref = store.lookupRef(taskId);
|
|
166
|
+
if (task === null || ref === null)
|
|
167
|
+
return null;
|
|
168
|
+
if (task.state === "done") {
|
|
169
|
+
const runs = store.runsFor(ref.id);
|
|
170
|
+
const result = runs.find(run => (run.role === "builder" || run.role === "scout") && (run.outcome === "built" || run.outcome === "no-change") && run.finishedAt !== null);
|
|
171
|
+
if (result?.role === "scout")
|
|
172
|
+
return answer("complete", "terminal", "Report ready", "The research report is ready to review.", { action: "open-result" });
|
|
173
|
+
const proof = result === undefined ? null : store.proofVerdictFor(result.id);
|
|
174
|
+
const accepted = result !== undefined && store.proofAcceptance(result.id) !== null;
|
|
175
|
+
// THE REVIEW STATUS (v50): read from the bounded retry projection — the
|
|
176
|
+
// open request and the NEWEST root attempt in ordinal order — so a
|
|
177
|
+
// queued retry is never hidden behind an older failed run, and every
|
|
178
|
+
// answer below names the attempt count and the one explicit next act.
|
|
179
|
+
const retry = result === undefined ? null : store.reviewRetryStateOf(result.id);
|
|
180
|
+
const review = result === undefined || retry === null || retry.state === "unrequested" ? null : reviewViewOf(result.id, retry);
|
|
181
|
+
// The words are the workspace's shared projection (package 1, review
|
|
182
|
+
// fixes): the same label and detail the Work rows, task page, focused
|
|
183
|
+
// chat, receipt, and review cockpit render for this exact result —
|
|
184
|
+
// a review in flight included. The codes stay the contract.
|
|
185
|
+
const reviewFacts = reviewFactsOf(retry, runner => {
|
|
186
|
+
const reviewer = store.getRunner(runner)?.runner;
|
|
187
|
+
return reviewer !== undefined && isAlive(reviewer, now);
|
|
188
|
+
});
|
|
189
|
+
// A no-change conclusion owes no proof beyond its handoff and sealed
|
|
190
|
+
// diff (the task page's own "attested floor"); with both on record it
|
|
191
|
+
// is complete, not verification-needed.
|
|
192
|
+
const noChangeRecord = result === undefined || result.outcome !== "no-change"
|
|
193
|
+
? undefined
|
|
194
|
+
: (() => { const kinds = new Set(store.artifactsFor(result.id).map(one => one.kind)); return kinds.has("handoff") && kinds.has("terminal-diff"); })();
|
|
195
|
+
const status = resultStatusOf(result === undefined
|
|
196
|
+
? null
|
|
197
|
+
: { runId: result.id, role: result.role, outcome: result.outcome, verdict: proof?.verdict ?? null, reasons: proof?.reasons ?? [], accepted, review: reviewFacts, ...(noChangeRecord === undefined ? {} : { recordComplete: noChangeRecord }) }, result === undefined ? null : store.publicationForRun(result.id));
|
|
198
|
+
if (REVIEW_TOKENS.has(status.token) && retry !== null && review !== null) {
|
|
199
|
+
const code = status.token;
|
|
200
|
+
return answer(code, code === "reviewing" ? "running" : "waiting", status.label, status.detail, { action: retry.state === "retryable" ? "retry-review" : "open-result", review });
|
|
201
|
+
}
|
|
202
|
+
if (!accepted && proof?.verdict === "refuted")
|
|
203
|
+
return answer("proof-refuted", "waiting", status.label, `${status.detail} Review the evidence to correct it, or record an explicit acceptance.`, { action: "open-result", review });
|
|
204
|
+
if (!accepted && proof?.verdict === "short")
|
|
205
|
+
return answer("needs-verification", "waiting", status.label, `${status.detail} Open the result for the exact criteria still needing verification.`, { action: "open-result", review });
|
|
206
|
+
if (!accepted && proof === null && noChangeRecord !== true)
|
|
207
|
+
return answer("needs-verification", "waiting", status.label, status.detail, { action: "open-result", review });
|
|
208
|
+
return answer("complete", "terminal", status.label, review?.state === "succeeded" && review.attempt !== null && review.attempt > 1
|
|
209
|
+
? `${status.detail} Its independent review succeeded on attempt ${review.attempt} of ${review.cap}.`
|
|
210
|
+
: status.detail, { action: "open-result", review });
|
|
211
|
+
}
|
|
212
|
+
if (task.state === "cancelled")
|
|
213
|
+
return answer("cancelled", "terminal", "Cancelled", "Nothing else will run for this task.");
|
|
214
|
+
if (task.state === "failed")
|
|
215
|
+
return answer("failed", "terminal", "Needs a retry", "The last attempt stopped; review its incident, then retry it.", { action: "retry-task" });
|
|
216
|
+
if (store.hasLiveClaim(ref.id, now))
|
|
217
|
+
return answer("running", "running", "Running now", "A worker owns the current live claim.");
|
|
218
|
+
if (task.state === "running")
|
|
219
|
+
return answer("vanished-run", "waiting", "Build vanished", "The task says running, but no current claim owns it; reconcile it before retrying.", { action: "retry-task" });
|
|
220
|
+
if (updateAdmissionPaused(store.raw()))
|
|
221
|
+
return answer("updating", "waiting", "Waiting for app update", UPDATE_PAUSED);
|
|
222
|
+
const local = taskReadinessBlocker(store, ref.id, now);
|
|
223
|
+
if (local?.code === "hold") {
|
|
224
|
+
if (local.ownerKind === "backoff") {
|
|
225
|
+
return answer("retry-scheduled", "retrying", "Retry scheduled", local.until === null ? "The failed attempt is backing off before retrying." : `The next attempt is eligible at ${local.until}.`, { nextAt: local.until });
|
|
226
|
+
}
|
|
227
|
+
if (local.ownerKind === "decision")
|
|
228
|
+
return answer("waiting-decision", "waiting", "Waiting on your answer", "An agent parked a question; answering it resumes the task.", { action: "answer-decision" });
|
|
229
|
+
if (local.ownerKind === "incident")
|
|
230
|
+
return answer("waiting-incident", "waiting", "Needs a retry", "An unresolved incident holds the next attempt.", { action: "retry-task" });
|
|
231
|
+
if (local.ownerKind === "stop")
|
|
232
|
+
return answer("stopped", "waiting", "Paused", `${local.message.replace(/^held:\s*/, "")}. The attempt's work is preserved; resuming that exact attempt lifts this pause.`, { action: "resume-run" });
|
|
233
|
+
return answer("held", "waiting", "On hold", local.message.replace(/^held:\s*/, ""), { action: local.ownerKind === "operator" ? "unhold" : "inspect-hold" });
|
|
234
|
+
}
|
|
235
|
+
if (local?.code === "dependency") {
|
|
236
|
+
const terminal = local.blockerState === "failed" || local.blockerState === "cancelled";
|
|
237
|
+
return terminal
|
|
238
|
+
? answer("terminal-dependency", "waiting", "A required task did not finish", `${local.blockerId} ${local.blockerState === "cancelled" ? "was cancelled" : "failed"} before it finished.`, { action: "repair-dependency", blockerTaskId: local.blockerId })
|
|
239
|
+
: answer("waiting-dependency", "waiting", "Waiting for another task", `${local.blockerId} must finish before this task can start.`, { blockerTaskId: local.blockerId });
|
|
240
|
+
}
|
|
241
|
+
const role = dispatchRoleFor(store, ref.id, now);
|
|
242
|
+
const scope = store.getScope(taskId);
|
|
243
|
+
if (ref.repo === null)
|
|
244
|
+
return answer("needs-project", "waiting", "Needs a project", "Place this task in a repository before a worker can claim it.", { action: "place-task", role });
|
|
245
|
+
if (role !== "planner") {
|
|
246
|
+
if (scope === null)
|
|
247
|
+
return answer("needs-scope", "waiting", "Needs a scope", "Write the success contract or ask the planner to draft it.", { action: "write-scope", role });
|
|
248
|
+
if (scope.profileState === "unresolved")
|
|
249
|
+
return answer("needs-agent-profile", "waiting", "Needs an agent profile", scope.unresolvedReason ?? "Choose an available provider and model.", { action: "select-agent", role });
|
|
250
|
+
if (!scopeApprovedForDispatch(store, ref.id, now) || !approvalOf(scope).approved) {
|
|
251
|
+
return answer("needs-approval", "waiting", "Needs your approval", "Review and sign the current scope before a worker can claim it.", { action: "approve-scope", role });
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
const gap = missingCapability(store, ref.id, ref.repo, now);
|
|
255
|
+
if (gap !== null)
|
|
256
|
+
return answer("missing-requirement", "waiting", "Missing a requirement", gap, { action: "repair-capability", role });
|
|
257
|
+
const all = store.listRunners().filter(one => one.retiredAt === null);
|
|
258
|
+
const bound = all.filter(one => one.repos.includes(ref.repo));
|
|
259
|
+
const eligible = ref.assignedRunner === null ? bound : bound.filter(one => one.name === ref.assignedRunner);
|
|
260
|
+
if (eligible.length === 0) {
|
|
261
|
+
const detail = ref.assignedRunner === null
|
|
262
|
+
? all.length === 0
|
|
263
|
+
? "This project has not been connected to a builder yet."
|
|
264
|
+
: "Your connected builders do not include this project yet."
|
|
265
|
+
: `This task is assigned to ${ref.assignedRunner}, but that builder is not connected to this project.`;
|
|
266
|
+
return answer("no-worker-registered", "waiting", "Builder not connected", detail, { action: "start-worker", role });
|
|
267
|
+
}
|
|
268
|
+
const alive = eligible.filter(one => isAlive(one, now));
|
|
269
|
+
if (alive.length === 0) {
|
|
270
|
+
return answer("no-worker-online", "waiting", "Builder disconnected", `${eligible.length === 1 ? "The builder for this project has" : "All builders for this project have"} stopped checking in. This task starts automatically when ${eligible.length === 1 ? "it reconnects" : "one reconnects"}.`, { action: "start-worker", role });
|
|
271
|
+
}
|
|
272
|
+
const available = alive.filter(one => store.liveClaimCount(one.name, now) < one.capacity);
|
|
273
|
+
if (available.length === 0)
|
|
274
|
+
return answer("worker-at-capacity", "retrying", "Waiting for worker capacity", "Every eligible worker is busy; this task starts when a slot is released.", { role });
|
|
275
|
+
const profile = approvedProfile(scope);
|
|
276
|
+
if (profile !== null) {
|
|
277
|
+
const exhausted = available.map(one => store.readQuotaState(one.name, profile.provider, profile.model, now)).filter(one => one?.state === "exhausted");
|
|
278
|
+
if (exhausted.length === available.length) {
|
|
279
|
+
const resets = exhausted.map(one => one?.resetAt ?? null).filter((one) => one !== null).sort();
|
|
280
|
+
const nextAt = resets[0] ?? null;
|
|
281
|
+
return answer("provider-quota", "retrying", "Provider quota exhausted", nextAt === null ? "The provider has not supplied a reset time; this needs operator attention." : `The next recorded reset is ${nextAt}.`, { action: nextAt === null ? "select-agent" : null, nextAt, role });
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
const openDecisions = store.countUnanswered();
|
|
285
|
+
if (openDecisions >= DEFAULT_MAX_OPEN_DECISIONS && (role === "planner" || ref.parkRate > 0)) {
|
|
286
|
+
return answer("waiting-decision", "waiting", "Decision queue is full", `${openDecisions} decisions already wait; answer some before this task may add another.`, { action: "answer-decision", role });
|
|
287
|
+
}
|
|
288
|
+
if (role === "planner") {
|
|
289
|
+
// The filed request's own gate (contract handoff, task 1): a request
|
|
290
|
+
// the planner could not be given whole is refused before spend, and
|
|
291
|
+
// this is where the task page says so.
|
|
292
|
+
const sourceProblem = plannerSourceProblemOf(store, taskId);
|
|
293
|
+
if (sourceProblem !== null)
|
|
294
|
+
return answer("planner-source", "waiting", "The filed request cannot be planned as filed", sourceProblem, { action: "write-scope", role });
|
|
295
|
+
return answer("planning-ready", "retrying", "Planner ready", "An eligible worker can draft the scope on the next pass.", { role });
|
|
296
|
+
}
|
|
297
|
+
if (role === "scout")
|
|
298
|
+
return answer("scouting-ready", "retrying", "Scout ready", "An eligible worker can produce the report on the next pass.", { role });
|
|
299
|
+
return answer("ready", "retrying", "Ready to run", "An eligible worker has capacity and every dispatch gate currently passes.", { role });
|
|
300
|
+
}
|
|
301
|
+
export function diagnosisIsDispatchable(diagnosis) {
|
|
302
|
+
return diagnosis?.code === "ready" || diagnosis?.code === "planning-ready" || diagnosis?.code === "scouting-ready";
|
|
303
|
+
}
|
|
304
|
+
/** Attach the same lifecycle answer to the bounded fleet snapshot used by
|
|
305
|
+
* both direct chat and the long-running mate. */
|
|
306
|
+
export function withDispatchDiagnoses(store, snapshot, now) {
|
|
307
|
+
return {
|
|
308
|
+
...snapshot,
|
|
309
|
+
tasks: snapshot.tasks.map(one => ({ ...one, dispatch: diagnoseTaskDispatch(store, one.id, now) })),
|
|
310
|
+
};
|
|
311
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { type FailureClass } from "./claim.js";
|
|
2
|
+
import type { BuildResult } from "./builder.js";
|
|
3
|
+
import type { Store } from "./store.js";
|
|
4
|
+
import { type ProofVerdict } from "./proof.js";
|
|
5
|
+
/**
|
|
6
|
+
* Which road is disposing. 'tick' = the unattended loop: full task
|
|
7
|
+
* completion, strikes, quota, publication. 'standalone' = the one-off
|
|
8
|
+
* `build` command: run records only — no task state, no strikes, no
|
|
9
|
+
* publication (its historical shape). The held road reuses 'tick' —
|
|
10
|
+
* an attended session is still the task's real attempt.
|
|
11
|
+
*/
|
|
12
|
+
export type DisposePolicy = "tick" | "standalone" | "continuation";
|
|
13
|
+
export type DisposeContext = {
|
|
14
|
+
store: Store;
|
|
15
|
+
policy: DisposePolicy;
|
|
16
|
+
/** The lease this attempt ran under; undefined only on the standalone road. */
|
|
17
|
+
leaseId: string | undefined;
|
|
18
|
+
runId: number;
|
|
19
|
+
taskId: string;
|
|
20
|
+
taskRef: number;
|
|
21
|
+
runner: string;
|
|
22
|
+
/** The canonical repo, for the publication grant lookup (tick policy). */
|
|
23
|
+
repo: string;
|
|
24
|
+
branch: string;
|
|
25
|
+
/** task_ref.origin — the publication selector consults it. */
|
|
26
|
+
origin: string;
|
|
27
|
+
provider: string;
|
|
28
|
+
model: string | null;
|
|
29
|
+
/** Where the attempt's tree lives — failure records name it. */
|
|
30
|
+
worktreePath: string;
|
|
31
|
+
/** The same evidence root the builder used. */
|
|
32
|
+
evidenceRoot?: string;
|
|
33
|
+
clock: () => Date;
|
|
34
|
+
};
|
|
35
|
+
export type Disposition = {
|
|
36
|
+
kind: "parked";
|
|
37
|
+
decisionId: number;
|
|
38
|
+
} | {
|
|
39
|
+
kind: "park-fenced";
|
|
40
|
+
} | {
|
|
41
|
+
kind: "disowned";
|
|
42
|
+
} | {
|
|
43
|
+
kind: "built";
|
|
44
|
+
committed: boolean;
|
|
45
|
+
noChange: boolean;
|
|
46
|
+
} | {
|
|
47
|
+
kind: "built-fenced";
|
|
48
|
+
} | {
|
|
49
|
+
kind: "skipped";
|
|
50
|
+
reason: "unapproved" | "scope-changed";
|
|
51
|
+
} | {
|
|
52
|
+
kind: "fenced";
|
|
53
|
+
} | {
|
|
54
|
+
kind: "malformed";
|
|
55
|
+
sealed: boolean;
|
|
56
|
+
} | {
|
|
57
|
+
kind: "failed";
|
|
58
|
+
failureClass: FailureClass;
|
|
59
|
+
disposition: string | null;
|
|
60
|
+
strikes: number | null;
|
|
61
|
+
sealed: boolean;
|
|
62
|
+
}
|
|
63
|
+
/** The standalone road's simple record: outcome written, nothing else. */
|
|
64
|
+
| {
|
|
65
|
+
kind: "recorded";
|
|
66
|
+
outcome: "failed" | "refused";
|
|
67
|
+
}
|
|
68
|
+
/** v52: an operator's stop won before terminal settlement — the attempt
|
|
69
|
+
* is sealed as interrupted with its work preserved, its own stop
|
|
70
|
+
* settled, no strike and no retry. `stopRun` names the exact stopped
|
|
71
|
+
* run (this one, or the owning ancestor whose stop it inherited). */
|
|
72
|
+
| {
|
|
73
|
+
kind: "stopped";
|
|
74
|
+
stopRun: number;
|
|
75
|
+
requeued: boolean;
|
|
76
|
+
} | {
|
|
77
|
+
kind: "invariant";
|
|
78
|
+
reason: string;
|
|
79
|
+
};
|
|
80
|
+
/** Compatibility for historical integrations: finished work is handed to the
|
|
81
|
+
* lead. No model review is requested and no signed history is rewritten. */
|
|
82
|
+
export declare function maybeRequestAutoReview(_store: Store, _repo: string, _runId: number, _committed: boolean, _noChange: boolean, _now: Date): void;
|
|
83
|
+
export declare function disposeBuildOutcome(context: DisposeContext, result: BuildResult): Disposition;
|
|
84
|
+
/**
|
|
85
|
+
* The stale-approval HOLD, shared by the post-build disposition above and
|
|
86
|
+
* the tick's pre-admission refusal (v48 integrity): a pre-routing row
|
|
87
|
+
* whose sealed profile no longer matches what would resolve is refused
|
|
88
|
+
* BEFORE any run row exists — held under the backoff the approval door
|
|
89
|
+
* lifts, paged once per approval — so the fail-closed admission never
|
|
90
|
+
* turns into a refusal every pass.
|
|
91
|
+
*/
|
|
92
|
+
export declare function holdStaleApproval(store: Store, args: {
|
|
93
|
+
taskRef: number;
|
|
94
|
+
taskId: string;
|
|
95
|
+
message: string;
|
|
96
|
+
}, now: Date): void;
|
|
97
|
+
/** The public, envelope-documented name for each stop — distinct from the
|
|
98
|
+
* store's own short `repair_chain.outcome` word (the DB enum is a
|
|
99
|
+
* different namespace; these are the CLI/console-facing reason tokens,
|
|
100
|
+
* registered in envelope.ts's DOCUMENTED_REASONS). */
|
|
101
|
+
export type RepairStopReason = "repair-attempts-spent" | "repair-no-progress" | "repair-refused-integrity";
|
|
102
|
+
/**
|
|
103
|
+
* The chain's happy exit (v40): the instant one of its own attempts
|
|
104
|
+
* reaches `verified` or `attested`, the chain is done. Checked at every
|
|
105
|
+
* completed build's own verdict-save point — not only after a review —
|
|
106
|
+
* since a review can never UPGRADE a verdict past what `adjudicate`
|
|
107
|
+
* already found (foldReview's monotonicity), so only the structural save
|
|
108
|
+
* can ever produce one of these two words.
|
|
109
|
+
*/
|
|
110
|
+
export declare function maybeSettleRepairChain(store: Store, taskId: string, verdict: ProofVerdict, now: Date): void;
|
|
111
|
+
/**
|
|
112
|
+
* Run the approved gate again on the SAME commit (v70): a new attempt whose
|
|
113
|
+
* prepared candidate is the last attempt's head. The machine checks the
|
|
114
|
+
* commit out (no agent), seals a fresh diff, receipt and proof, and the
|
|
115
|
+
* ordinary review follows. Used by `task regate` (an operator's yes) and by
|
|
116
|
+
* the automatic single rerun after a failure the change did not cause.
|
|
117
|
+
*/
|
|
118
|
+
export type RegateRefusal = "no-task" | "no-attempt" | "accepted-result" | "published" | "claimed" | "not-approved" | "not-rejected";
|
|
119
|
+
export declare function regateTask(store: Store, taskId: string, now: Date, approval: {
|
|
120
|
+
kind: "operator";
|
|
121
|
+
name: string;
|
|
122
|
+
token: string;
|
|
123
|
+
} | {
|
|
124
|
+
kind: "mode";
|
|
125
|
+
name: string;
|
|
126
|
+
modeDigest: string;
|
|
127
|
+
}): {
|
|
128
|
+
ok: true;
|
|
129
|
+
run: number;
|
|
130
|
+
head: string;
|
|
131
|
+
} | {
|
|
132
|
+
ok: false;
|
|
133
|
+
reason: RegateRefusal;
|
|
134
|
+
message: string;
|
|
135
|
+
};
|
|
136
|
+
export type RepairTrigger = {
|
|
137
|
+
kind: "drafted";
|
|
138
|
+
draftTaskId: string;
|
|
139
|
+
attempt: number;
|
|
140
|
+
approved: boolean;
|
|
141
|
+
} | {
|
|
142
|
+
kind: "stopped";
|
|
143
|
+
reason: RepairStopReason;
|
|
144
|
+
} | {
|
|
145
|
+
kind: "none";
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* An explicitly requested repair from saved check or historical review findings.
|
|
149
|
+
* Automatic calls are retired. Composes at
|
|
150
|
+
* most one durable revision draft naming exactly the unmet criterion ids,
|
|
151
|
+
* inheriting the source scope and rubric verbatim — or settles the chain
|
|
152
|
+
* at one of its four independent stops (integrity, no-progress, attempts
|
|
153
|
+
* cap; the fourth — existing spend/run rails — is the ordinary tick's own
|
|
154
|
+
* job once a mode-approved draft dispatches as a normal builder run).
|
|
155
|
+
*
|
|
156
|
+
* Never dispatches anything itself: a mode-authorized draft is
|
|
157
|
+
* auto-APPROVED here, but still builds through the ordinary tick, under
|
|
158
|
+
* the ordinary rails and strikes — this function only ever composes a
|
|
159
|
+
* task and, at most, one scope approval.
|
|
160
|
+
*/
|
|
161
|
+
export declare function maybeTriggerRepair(store: Store, repo: string, evidenceRoot: string, sourceRunId: number, verdict: ProofVerdict, now: Date, cause?: "review" | "verification", automatic?: boolean): RepairTrigger;
|