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/discord.js
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/** A single leased Discord Gateway connection, hosted by the ordinary worker. */
|
|
2
|
+
import { randomBytes } from "node:crypto";
|
|
3
|
+
import { setTimeout as sleep } from "node:timers/promises";
|
|
4
|
+
import { Client, GatewayIntentBits, Partials } from "discord.js";
|
|
5
|
+
import { loadDiscordCredentials, discordApi, object, discordId, } from "./discord-api.js";
|
|
6
|
+
import { ChatState, chatHash } from "./chat-delivery-state.js";
|
|
7
|
+
import { receiveDiscord, processDiscordEvent, deliverDiscordPart, planDiscordNotifications, planDiscordRooms, } from "./discord-chat.js";
|
|
8
|
+
export function discordReadyMatches(raw, identity) {
|
|
9
|
+
const packet = object(raw);
|
|
10
|
+
return (object(packet.application).id === identity.app &&
|
|
11
|
+
object(packet.user).id === identity.bot &&
|
|
12
|
+
object(packet.user).bot === true);
|
|
13
|
+
}
|
|
14
|
+
export async function followDiscord(options) {
|
|
15
|
+
const owner = randomBytes(16).toString("hex"), state = new ChatState(options.store, "discord");
|
|
16
|
+
const pause = async (ms) => {
|
|
17
|
+
try {
|
|
18
|
+
await sleep(ms, undefined, { signal: options.signal });
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
/* shutdown */
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
while (!options.signal.aborted) {
|
|
25
|
+
const credentials = loadDiscordCredentials(options.dir);
|
|
26
|
+
if (!credentials ||
|
|
27
|
+
!state.lease(credentials.installation, owner, new Date())) {
|
|
28
|
+
await pause(2000);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
let alive = true, connected = false, validated = false;
|
|
32
|
+
const same = () => {
|
|
33
|
+
const current = loadDiscordCredentials(options.dir);
|
|
34
|
+
return (alive &&
|
|
35
|
+
!options.signal.aborted &&
|
|
36
|
+
current?.installation === credentials.installation &&
|
|
37
|
+
current.botToken === credentials.botToken &&
|
|
38
|
+
state.owns(credentials.installation, owner));
|
|
39
|
+
};
|
|
40
|
+
const problem = (message) => state
|
|
41
|
+
.prepare("UPDATE chat_runtime SET problem=? WHERE installation=? AND owner=?")
|
|
42
|
+
.run(message, credentials.installation, owner);
|
|
43
|
+
const api = discordApi(credentials.botToken);
|
|
44
|
+
const client = new Client({
|
|
45
|
+
// Guild messages and their content are needed for rooms; the Message
|
|
46
|
+
// Content intent must be enabled for the app in Discord's developer portal.
|
|
47
|
+
intents: [GatewayIntentBits.DirectMessages, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent],
|
|
48
|
+
partials: [Partials.Channel],
|
|
49
|
+
allowedMentions: { parse: [], repliedUser: false },
|
|
50
|
+
rest: { timeout: 15_000, retries: 2 },
|
|
51
|
+
});
|
|
52
|
+
const stop = () => {
|
|
53
|
+
alive = false;
|
|
54
|
+
connected = false;
|
|
55
|
+
void client.destroy().catch(() => { });
|
|
56
|
+
};
|
|
57
|
+
options.signal.addEventListener("abort", stop, { once: true });
|
|
58
|
+
const heartbeat = setInterval(() => {
|
|
59
|
+
if (!same() || !state.lease(credentials.installation, owner, new Date()))
|
|
60
|
+
stop();
|
|
61
|
+
}, 10_000);
|
|
62
|
+
const online = () => {
|
|
63
|
+
if (!same() || !validated)
|
|
64
|
+
return;
|
|
65
|
+
connected = true;
|
|
66
|
+
state
|
|
67
|
+
.prepare("UPDATE chat_runtime SET connected=?,problem=NULL WHERE installation=? AND owner=?")
|
|
68
|
+
.run(new Date().toISOString(), credentials.installation, owner);
|
|
69
|
+
};
|
|
70
|
+
client.on("shardReady", online);
|
|
71
|
+
client.on("shardResume", online);
|
|
72
|
+
client.on("shardDisconnect", () => {
|
|
73
|
+
connected = false;
|
|
74
|
+
problem("Discord is disconnected; saved replies will retry.");
|
|
75
|
+
});
|
|
76
|
+
client.on("shardReconnecting", () => {
|
|
77
|
+
connected = false;
|
|
78
|
+
problem("Reconnecting to Discord…");
|
|
79
|
+
});
|
|
80
|
+
client.on("error", () => problem("Discord connection failed. Check the bot token and reconnect."));
|
|
81
|
+
client.on("shardError", () => problem("Discord connection failed. Saved replies will retry."));
|
|
82
|
+
// Never subscribe a logger to raw payloads, SDK debug output or interaction tokens.
|
|
83
|
+
client.on("raw", (packet) => {
|
|
84
|
+
if (!same())
|
|
85
|
+
return;
|
|
86
|
+
if (packet.t === "READY") {
|
|
87
|
+
validated = discordReadyMatches(packet.d, credentials);
|
|
88
|
+
if (!validated) {
|
|
89
|
+
problem("Discord returned a different app identity. Disconnect and reconnect the intended app.");
|
|
90
|
+
stop();
|
|
91
|
+
}
|
|
92
|
+
else
|
|
93
|
+
online();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (!validated)
|
|
97
|
+
return;
|
|
98
|
+
const body = object(packet.d);
|
|
99
|
+
try {
|
|
100
|
+
const saved = receiveDiscord(state, credentials, packet.t, body, new Date());
|
|
101
|
+
if (packet.t === "INTERACTION_CREATE" &&
|
|
102
|
+
body.type === 3 &&
|
|
103
|
+
body.application_id === credentials.app &&
|
|
104
|
+
discordId(body.id) &&
|
|
105
|
+
typeof body.token === "string" &&
|
|
106
|
+
/^[A-Za-z0-9._-]{1,300}$/.test(body.token)) {
|
|
107
|
+
const repeated = state.event(chatHash(`${credentials.installation}:interaction:${body.id}`)) !== null;
|
|
108
|
+
// Immediate acknowledgement; model work and approvals are handled from the durable queue.
|
|
109
|
+
void api("POST", `/interactions/${body.id}/${body.token}/callback`, saved || repeated
|
|
110
|
+
? { type: 6 }
|
|
111
|
+
: {
|
|
112
|
+
type: 4,
|
|
113
|
+
data: {
|
|
114
|
+
content: "This button is unavailable. Use your paired direct message or ask for the current state.",
|
|
115
|
+
flags: 64,
|
|
116
|
+
allowed_mentions: { parse: [] },
|
|
117
|
+
},
|
|
118
|
+
}).catch(() => problem("Discord did not acknowledge the button. Its saved result will appear in the conversation."));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
problem("An incoming Discord message could not be saved. Send it again after reconnecting.");
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
const chat = {
|
|
126
|
+
...options,
|
|
127
|
+
identity: credentials,
|
|
128
|
+
owner,
|
|
129
|
+
api,
|
|
130
|
+
current: same,
|
|
131
|
+
canNotify: options.notifications,
|
|
132
|
+
};
|
|
133
|
+
try {
|
|
134
|
+
await client.login(credentials.botToken);
|
|
135
|
+
while (same()) {
|
|
136
|
+
const retry = state
|
|
137
|
+
.prepare("SELECT retry_at FROM chat_runtime WHERE installation=?")
|
|
138
|
+
.get(credentials.installation)?.retry_at;
|
|
139
|
+
if (!connected ||
|
|
140
|
+
(typeof retry === "string" && retry > new Date().toISOString())) {
|
|
141
|
+
await pause(1000);
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
await processDiscordEvent(chat);
|
|
145
|
+
if (same())
|
|
146
|
+
await planDiscordRooms(chat);
|
|
147
|
+
if (same())
|
|
148
|
+
await deliverDiscordPart(chat);
|
|
149
|
+
if (same() && options.notifications())
|
|
150
|
+
await planDiscordNotifications(chat);
|
|
151
|
+
await pause(1000);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
if (alive)
|
|
156
|
+
problem("Discord is unavailable. Retrying shortly.");
|
|
157
|
+
}
|
|
158
|
+
finally {
|
|
159
|
+
clearInterval(heartbeat);
|
|
160
|
+
alive = false;
|
|
161
|
+
options.signal.removeEventListener("abort", stop);
|
|
162
|
+
await client.destroy().catch(() => { });
|
|
163
|
+
state
|
|
164
|
+
.prepare("UPDATE chat_runtime SET owner=NULL,lease_until=NULL,connected=NULL WHERE installation=? AND owner=?")
|
|
165
|
+
.run(credentials.installation, owner);
|
|
166
|
+
}
|
|
167
|
+
await pause(5000);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading the state of repositories.
|
|
3
|
+
*
|
|
4
|
+
* Every git invocation here is a read, and every one is prefixed with
|
|
5
|
+
* `--no-optional-locks` — Toolroll scans repositories the operator may be
|
|
6
|
+
* working in right now, and a discovery pass must never contend for the index
|
|
7
|
+
* lock with their editor.
|
|
8
|
+
*
|
|
9
|
+
* Nothing raises. A repository that cannot be read comes back as a snapshot
|
|
10
|
+
* carrying a named problem, because the alternative is a scan of forty repos
|
|
11
|
+
* ending on the one that is broken.
|
|
12
|
+
*
|
|
13
|
+
* The reads are deliberately unequal in cost, and that shapes the module.
|
|
14
|
+
* Listing refs, worktrees and the remote is O(refs) and lands in tens of
|
|
15
|
+
* milliseconds. Computing ahead/behind walks history per branch — measured at
|
|
16
|
+
* 22s on a cold 304MB repo — so it is bounded and degrades to a branch list
|
|
17
|
+
* without it. Reading the working tree is O(working tree), measured at over
|
|
18
|
+
* two minutes, so it does not happen at all unless asked for.
|
|
19
|
+
*/
|
|
20
|
+
import { type ExecResult, type RunOptions } from "./exec.js";
|
|
21
|
+
import { type Branch, type Worktree } from "./git.js";
|
|
22
|
+
import { type ScanOptions } from "./scan.js";
|
|
23
|
+
export type RepoSnapshot = {
|
|
24
|
+
path: string;
|
|
25
|
+
name: string;
|
|
26
|
+
/** Current branch, or null in detached HEAD. */
|
|
27
|
+
head: string | null;
|
|
28
|
+
remoteUrl: string | null;
|
|
29
|
+
branches: Branch[];
|
|
30
|
+
worktrees: Worktree[];
|
|
31
|
+
/** Uncommitted files, or null when the working tree was not read. */
|
|
32
|
+
dirtyFiles: number | null;
|
|
33
|
+
/**
|
|
34
|
+
* Whether ahead/behind could be computed. False means every branch carries a
|
|
35
|
+
* zeroed track, which is absence of data and not evidence of being in sync —
|
|
36
|
+
* a distinction the report has to respect or it hides the whole repository.
|
|
37
|
+
*/
|
|
38
|
+
hasTracking: boolean;
|
|
39
|
+
/** What could not be read, in words. Never silently dropped. */
|
|
40
|
+
problems: string[];
|
|
41
|
+
};
|
|
42
|
+
export type Runner = (file: string, args: readonly string[], options?: RunOptions) => Promise<ExecResult>;
|
|
43
|
+
export type InspectOptions = {
|
|
44
|
+
runner?: Runner;
|
|
45
|
+
/** Read the working tree for uncommitted changes. Off by default: see above. */
|
|
46
|
+
dirty?: boolean;
|
|
47
|
+
};
|
|
48
|
+
export type DiscoverOptions = InspectOptions & {
|
|
49
|
+
scan?: ScanOptions;
|
|
50
|
+
concurrency?: number;
|
|
51
|
+
};
|
|
52
|
+
/** Enough to keep git busy without turning a laptop fan on. */
|
|
53
|
+
export declare const DEFAULT_CONCURRENCY = 8;
|
|
54
|
+
/** Ref reads land in tens of milliseconds; seconds here means something is wrong. */
|
|
55
|
+
export declare const REF_TIMEOUT_MS = 5000;
|
|
56
|
+
/**
|
|
57
|
+
* Ahead/behind is worth waiting for, since it is the signal itself. Ten
|
|
58
|
+
* seconds because a 59MB repo with 18 branches and no commit-graph measured
|
|
59
|
+
* 7.5s cold — just over a five second bound, which is the worst place for a
|
|
60
|
+
* limit to sit.
|
|
61
|
+
*/
|
|
62
|
+
export declare const TRACK_TIMEOUT_MS = 10000;
|
|
63
|
+
/** The working tree is unbounded, so the bound has to be ours. */
|
|
64
|
+
export declare const STATUS_TIMEOUT_MS = 10000;
|
|
65
|
+
export declare function inspectRepo(path: string, options?: InspectOptions): Promise<RepoSnapshot>;
|
|
66
|
+
/**
|
|
67
|
+
* Inspect known repositories, skipping the walk entirely. Enrolled paths are
|
|
68
|
+
* already the answer to "which repositories" — searching for them again would
|
|
69
|
+
* be the tool distrusting a list the operator wrote down.
|
|
70
|
+
*/
|
|
71
|
+
export declare function inspectAll(paths: readonly string[], options?: InspectOptions & {
|
|
72
|
+
concurrency?: number;
|
|
73
|
+
}): Promise<RepoSnapshot[]>;
|
|
74
|
+
/** Every repository at or below `roots`, inspected with bounded concurrency. */
|
|
75
|
+
export declare function discover(roots: readonly string[], options?: DiscoverOptions): Promise<RepoSnapshot[]>;
|
package/dist/discover.js
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading the state of repositories.
|
|
3
|
+
*
|
|
4
|
+
* Every git invocation here is a read, and every one is prefixed with
|
|
5
|
+
* `--no-optional-locks` — Toolroll scans repositories the operator may be
|
|
6
|
+
* working in right now, and a discovery pass must never contend for the index
|
|
7
|
+
* lock with their editor.
|
|
8
|
+
*
|
|
9
|
+
* Nothing raises. A repository that cannot be read comes back as a snapshot
|
|
10
|
+
* carrying a named problem, because the alternative is a scan of forty repos
|
|
11
|
+
* ending on the one that is broken.
|
|
12
|
+
*
|
|
13
|
+
* The reads are deliberately unequal in cost, and that shapes the module.
|
|
14
|
+
* Listing refs, worktrees and the remote is O(refs) and lands in tens of
|
|
15
|
+
* milliseconds. Computing ahead/behind walks history per branch — measured at
|
|
16
|
+
* 22s on a cold 304MB repo — so it is bounded and degrades to a branch list
|
|
17
|
+
* without it. Reading the working tree is O(working tree), measured at over
|
|
18
|
+
* two minutes, so it does not happen at all unless asked for.
|
|
19
|
+
*/
|
|
20
|
+
import { basename } from "node:path";
|
|
21
|
+
import { run } from "./exec.js";
|
|
22
|
+
import { parseWorktrees, parseBranches } from "./git.js";
|
|
23
|
+
import { findRepos } from "./scan.js";
|
|
24
|
+
/** Enough to keep git busy without turning a laptop fan on. */
|
|
25
|
+
export const DEFAULT_CONCURRENCY = 8;
|
|
26
|
+
/** Ref reads land in tens of milliseconds; seconds here means something is wrong. */
|
|
27
|
+
export const REF_TIMEOUT_MS = 5_000;
|
|
28
|
+
/**
|
|
29
|
+
* Ahead/behind is worth waiting for, since it is the signal itself. Ten
|
|
30
|
+
* seconds because a 59MB repo with 18 branches and no commit-graph measured
|
|
31
|
+
* 7.5s cold — just over a five second bound, which is the worst place for a
|
|
32
|
+
* limit to sit.
|
|
33
|
+
*/
|
|
34
|
+
export const TRACK_TIMEOUT_MS = 10_000;
|
|
35
|
+
/** The working tree is unbounded, so the bound has to be ours. */
|
|
36
|
+
export const STATUS_TIMEOUT_MS = 10_000;
|
|
37
|
+
const GIT = "git";
|
|
38
|
+
/** Read-only, and refuses to take the index lock it would otherwise want. */
|
|
39
|
+
const READ_ONLY = ["--no-optional-locks"];
|
|
40
|
+
const HEADS = "refs/heads";
|
|
41
|
+
const BRANCH_FORMAT = "--format=%(refname:short)%09%(upstream:track)%09%(committerdate:iso8601-strict)";
|
|
42
|
+
/** The same three columns with the expensive one left empty. */
|
|
43
|
+
const BRANCH_FORMAT_CHEAP = "--format=%(refname:short)%09%09%(committerdate:iso8601-strict)";
|
|
44
|
+
export async function inspectRepo(path, options = {}) {
|
|
45
|
+
const { runner = run, dirty = false } = options;
|
|
46
|
+
const git = (args, timeoutMs = REF_TIMEOUT_MS) => runner(GIT, [...READ_ONLY, ...args], { cwd: path, timeoutMs });
|
|
47
|
+
const [worktrees, branchRead, head, remote, status] = await Promise.all([
|
|
48
|
+
git(["worktree", "list", "--porcelain"]),
|
|
49
|
+
readBranches(git),
|
|
50
|
+
git(["symbolic-ref", "--quiet", "--short", "HEAD"]),
|
|
51
|
+
git(["remote", "get-url", "origin"]),
|
|
52
|
+
dirty ? git(["status", "--porcelain"], STATUS_TIMEOUT_MS) : null,
|
|
53
|
+
]);
|
|
54
|
+
// One missing binary is one problem, not five identical ones.
|
|
55
|
+
if (worktrees.notFound) {
|
|
56
|
+
return { ...emptySnapshot(path), problems: ["git is not installed"] };
|
|
57
|
+
}
|
|
58
|
+
const branches = branchRead.result;
|
|
59
|
+
const problems = [
|
|
60
|
+
describeProblem("read worktrees", worktrees),
|
|
61
|
+
describeProblem("read branches", branches),
|
|
62
|
+
branchRead.degraded
|
|
63
|
+
? `ahead/behind skipped: it took over ${TRACK_TIMEOUT_MS / 1000}s to compute here`
|
|
64
|
+
: null,
|
|
65
|
+
status === null ? null : describeProblem("read the working tree", status),
|
|
66
|
+
].filter((problem) => problem !== null);
|
|
67
|
+
return {
|
|
68
|
+
path,
|
|
69
|
+
name: basename(path),
|
|
70
|
+
// A failed symbolic-ref means detached HEAD, which is a state and not a fault.
|
|
71
|
+
head: head.code === 0 ? head.stdout.trim() : null,
|
|
72
|
+
// A repo with no origin is ordinary; reporting it as an error would be noise.
|
|
73
|
+
remoteUrl: remote.code === 0 ? remote.stdout.trim() : null,
|
|
74
|
+
branches: branches.code === 0 ? parseBranches(branches.stdout) : [],
|
|
75
|
+
worktrees: worktrees.code === 0 ? parseWorktrees(worktrees.stdout) : [],
|
|
76
|
+
dirtyFiles: status !== null && status.code === 0 ? countLines(status.stdout) : null,
|
|
77
|
+
hasTracking: branches.code === 0 && !branchRead.degraded,
|
|
78
|
+
problems,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Ahead/behind is the whole point of the report, so it is tried first — but a
|
|
83
|
+
* branch list without it beats a timeout with nothing in it.
|
|
84
|
+
*/
|
|
85
|
+
async function readBranches(git) {
|
|
86
|
+
const rich = await git(["for-each-ref", BRANCH_FORMAT, HEADS], TRACK_TIMEOUT_MS);
|
|
87
|
+
if (!rich.timedOut)
|
|
88
|
+
return { result: rich, degraded: false };
|
|
89
|
+
const cheap = await git(["for-each-ref", BRANCH_FORMAT_CHEAP, HEADS], REF_TIMEOUT_MS);
|
|
90
|
+
return { result: cheap, degraded: cheap.code === 0 };
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Inspect known repositories, skipping the walk entirely. Enrolled paths are
|
|
94
|
+
* already the answer to "which repositories" — searching for them again would
|
|
95
|
+
* be the tool distrusting a list the operator wrote down.
|
|
96
|
+
*/
|
|
97
|
+
export async function inspectAll(paths, options = {}) {
|
|
98
|
+
const { runner = run, dirty = false, concurrency = DEFAULT_CONCURRENCY } = options;
|
|
99
|
+
return mapWithConcurrency(paths, concurrency, path => inspectRepo(path, { runner, dirty }));
|
|
100
|
+
}
|
|
101
|
+
/** Every repository at or below `roots`, inspected with bounded concurrency. */
|
|
102
|
+
export async function discover(roots, options = {}) {
|
|
103
|
+
const { scan, ...rest } = options;
|
|
104
|
+
return inspectAll(await findRepos(roots, scan), rest);
|
|
105
|
+
}
|
|
106
|
+
function emptySnapshot(path) {
|
|
107
|
+
return {
|
|
108
|
+
path,
|
|
109
|
+
name: basename(path),
|
|
110
|
+
head: null,
|
|
111
|
+
remoteUrl: null,
|
|
112
|
+
branches: [],
|
|
113
|
+
worktrees: [],
|
|
114
|
+
dirtyFiles: null,
|
|
115
|
+
hasTracking: false,
|
|
116
|
+
problems: [],
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function describeProblem(action, result) {
|
|
120
|
+
if (result.code === 0)
|
|
121
|
+
return null;
|
|
122
|
+
if (result.timedOut)
|
|
123
|
+
return `could not ${action}: timed out`;
|
|
124
|
+
return `could not ${action}: ${firstLine(result.stderr)}`;
|
|
125
|
+
}
|
|
126
|
+
function firstLine(text) {
|
|
127
|
+
const [line = ""] = text.trim().split("\n");
|
|
128
|
+
return line;
|
|
129
|
+
}
|
|
130
|
+
function countLines(text) {
|
|
131
|
+
return text.split("\n").filter(line => line.trim() !== "").length;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Results stay in input order regardless of completion order, so the output of
|
|
135
|
+
* a scan does not depend on which repository happened to answer first.
|
|
136
|
+
*/
|
|
137
|
+
async function mapWithConcurrency(items, limit, worker) {
|
|
138
|
+
const results = new Array(items.length);
|
|
139
|
+
let next = 0;
|
|
140
|
+
const consume = async () => {
|
|
141
|
+
while (next < items.length) {
|
|
142
|
+
const index = next++;
|
|
143
|
+
const item = items[index];
|
|
144
|
+
results[index] = await worker(item);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const lanes = Math.max(1, Math.min(limit, items.length));
|
|
148
|
+
await Promise.all(Array.from({ length: lanes }, consume));
|
|
149
|
+
return results;
|
|
150
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
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 { type ChatSnapshot, type ReviewRequestOrigin, type ReviewRetryState, type Store, type TaskState } from "./store.js";
|
|
10
|
+
export declare const DEFAULT_MAX_OPEN_DECISIONS = 5;
|
|
11
|
+
export type TaskReadinessBlocker = {
|
|
12
|
+
code: "unknown-task";
|
|
13
|
+
message: string;
|
|
14
|
+
} | {
|
|
15
|
+
code: "state";
|
|
16
|
+
state: TaskState;
|
|
17
|
+
message: string;
|
|
18
|
+
} | {
|
|
19
|
+
code: "hold";
|
|
20
|
+
ownerKind: string;
|
|
21
|
+
until: string | null;
|
|
22
|
+
message: string;
|
|
23
|
+
} | {
|
|
24
|
+
code: "dependency";
|
|
25
|
+
blockerId: string;
|
|
26
|
+
blockerState: TaskState;
|
|
27
|
+
message: string;
|
|
28
|
+
};
|
|
29
|
+
export type DispatchAction = "open-result" | "retry-task" | "place-task" | "write-scope" | "select-agent" | "approve-scope" | "answer-decision" | "unhold" | "inspect-hold" | "repair-dependency" | "repair-capability" | "start-worker"
|
|
30
|
+
/** v50: ask for the bounded explicit review retry (`task review <run>`
|
|
31
|
+
* or the console's Retry review). */
|
|
32
|
+
| "retry-review"
|
|
33
|
+
/** v52: resume the exact stopped attempt (`task resume <id> --run <n>`
|
|
34
|
+
* or the console's Resume). */
|
|
35
|
+
| "resume-run";
|
|
36
|
+
export type DispatchDiagnosisCode = "updating" | "complete" | "needs-verification" | "proof-refuted" | "review-pending" | "reviewing" | "review-failed"
|
|
37
|
+
/** v50: every root review attempt ended without a review; nothing retries. */
|
|
38
|
+
| "review-exhausted" | "cancelled" | "failed" | "running" | "vanished-run" | "retry-scheduled" | "waiting-decision" | "waiting-incident" | "held"
|
|
39
|
+
/** v52: an operator stopped one exact attempt; only resuming it lifts the pause. */
|
|
40
|
+
| "stopped" | "waiting-dependency" | "terminal-dependency" | "needs-project" | "needs-scope" | "needs-agent-profile" | "needs-approval" | "missing-requirement" | "no-worker-registered" | "no-worker-online" | "worker-at-capacity" | "provider-quota" | "planning-ready" | "planner-source" | "scouting-ready" | "ready";
|
|
41
|
+
export type DispatchDiagnosis = {
|
|
42
|
+
/** The four-state Never Stuck contract. */
|
|
43
|
+
condition: "running" | "retrying" | "waiting" | "terminal";
|
|
44
|
+
code: DispatchDiagnosisCode;
|
|
45
|
+
summary: string;
|
|
46
|
+
detail: string;
|
|
47
|
+
action: DispatchAction | null;
|
|
48
|
+
/** When the machine already knows the next automatic wake. */
|
|
49
|
+
nextAt: string | null;
|
|
50
|
+
/** The phase an eventual claim would dispatch. */
|
|
51
|
+
role: "builder" | "planner" | "scout" | null;
|
|
52
|
+
blockerTaskId: string | null;
|
|
53
|
+
/** v50: the finished build's bounded review-retry status — null until a
|
|
54
|
+
* review was ever asked for, and on every task that is not done. */
|
|
55
|
+
review: ReviewDispatchView | null;
|
|
56
|
+
};
|
|
57
|
+
/** The typed review-retry facts a dispatch reader gets (v50): the source
|
|
58
|
+
* build, the projection's state word, how many root attempts ran and how
|
|
59
|
+
* many explicit retries remain, and the latest attempt's recorded reason. */
|
|
60
|
+
export type ReviewDispatchView = {
|
|
61
|
+
sourceRun: number;
|
|
62
|
+
state: ReviewRetryState["state"];
|
|
63
|
+
/** The attempt running, queued, or most recently ended (1..cap); null before any. */
|
|
64
|
+
attempt: number | null;
|
|
65
|
+
cap: number;
|
|
66
|
+
retriesUsed: number;
|
|
67
|
+
retriesRemaining: number;
|
|
68
|
+
/** The most recently ended root attempt's run id and stored reason. */
|
|
69
|
+
latestRun: number | null;
|
|
70
|
+
latestReason: string | null;
|
|
71
|
+
interrupted: boolean;
|
|
72
|
+
/** The open ask, when one is queued: who asked and how it was produced
|
|
73
|
+
* (explicit-only retries: a retry is always an operator's ask; an
|
|
74
|
+
* automatic producer queues attempt 1 only). */
|
|
75
|
+
queued: {
|
|
76
|
+
requestedBy: string;
|
|
77
|
+
origin: ReviewRequestOrigin;
|
|
78
|
+
} | null;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Task state, active holds, and unfinished dependencies in the exact order
|
|
82
|
+
* acquireIfReady checks them. The claim path calls this while holding its
|
|
83
|
+
* write transaction; read surfaces call it only as a snapshot.
|
|
84
|
+
*/
|
|
85
|
+
export declare function taskReadinessBlocker(store: Store, taskRef: number, now: Date): TaskReadinessBlocker | null;
|
|
86
|
+
/** The exact live approval predicate used by both the scheduler survey and
|
|
87
|
+
* the atomic claim. Mode-backed approvals count only while their signer and
|
|
88
|
+
* mode still stand. */
|
|
89
|
+
export declare function scopeApprovedForDispatch(store: Store, taskRef: number, now: Date): boolean;
|
|
90
|
+
/** The phase the ordinary dispatch loop would choose before it resolves an
|
|
91
|
+
* agent. Attended authorization is deliberately outside this ordinary path. */
|
|
92
|
+
export declare function dispatchRoleFor(store: Store, taskRef: number, now: Date): "builder" | "planner" | "scout";
|
|
93
|
+
/** The first requirement this task fails, in words, or null. */
|
|
94
|
+
export declare function missingCapability(store: Store, taskRef: number, dispatchRepo: string | null, now: Date): string | null;
|
|
95
|
+
/** The read-side lifecycle answer. It changes nothing and grants nothing. */
|
|
96
|
+
export declare function diagnoseTaskDispatch(store: Store, taskId: string, now: Date): DispatchDiagnosis | null;
|
|
97
|
+
export declare function diagnosisIsDispatchable(diagnosis: DispatchDiagnosis | null): boolean;
|
|
98
|
+
/** Attach the same lifecycle answer to the bounded fleet snapshot used by
|
|
99
|
+
* both direct chat and the long-running mate. */
|
|
100
|
+
export declare function withDispatchDiagnoses(store: Store, snapshot: ChatSnapshot, now: Date): ChatSnapshot;
|