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
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
import { executeSharedAction, sharedActionPayload, sharedActionAllowsChallenge, sharedActionNeedsReview } from './chat-actions.js';
|
|
2
|
+
/**
|
|
3
|
+
* The confirm doors (mate arc §2, ruling 7; v3 §9): a pending proposal —
|
|
4
|
+
* the mate's, or a coordinator's over the gateway — becomes an act only
|
|
5
|
+
* here, as the operator's own act through the plane's existing
|
|
6
|
+
* primitives, in ONE transaction that re-proves everything the card was
|
|
7
|
+
* rendered under. The console and the CLI both call these; the HTTP edge
|
|
8
|
+
* adds csrf and the cookie, the CLI adds the password — neither adds
|
|
9
|
+
* authority the door does not check itself.
|
|
10
|
+
*
|
|
11
|
+
* The door's answer is typed and rendered on the card: `done` with the
|
|
12
|
+
* plain words of what happened, or `refused` with the reason the primitive
|
|
13
|
+
* gave. A stale proposal (the queue moved, the hold changed hands, the
|
|
14
|
+
* scope was rewritten, the decision answered) is a refusal, never a
|
|
15
|
+
* silent re-read.
|
|
16
|
+
*/
|
|
17
|
+
import { verifiedAuthor } from "./store.js";
|
|
18
|
+
import { isVerifiedApprover, reproveApprover } from "./principal.js";
|
|
19
|
+
import { TeamLeads } from './team-leads.js';
|
|
20
|
+
import { fileTaskProposal } from "./proposal.js";
|
|
21
|
+
import { proposeGuarded } from "./scope.js";
|
|
22
|
+
import { isRiskLevel, PHASES, riskTitle, specWords } from "./phase-routing.js";
|
|
23
|
+
import { isProviderId } from "./provider.js";
|
|
24
|
+
import { applyChatReview } from "./chat-review.js";
|
|
25
|
+
import { applyChatTaskAction } from "./chat-task-actions.js";
|
|
26
|
+
/** A coordinator proposal lives seven days (§9); the door refuses an older one whatever the sweep did (v3 review, finding 3). */
|
|
27
|
+
export const COORDINATOR_PROPOSAL_TTL_MS = 7 * 24 * 3_600_000;
|
|
28
|
+
function payloadString(payload, key) {
|
|
29
|
+
const value = payload[key];
|
|
30
|
+
return typeof value === "string" ? value : null;
|
|
31
|
+
}
|
|
32
|
+
function payloadNumber(payload, key) {
|
|
33
|
+
const value = payload[key];
|
|
34
|
+
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
35
|
+
}
|
|
36
|
+
function payloadStrings(payload, key) {
|
|
37
|
+
const value = payload[key];
|
|
38
|
+
return Array.isArray(value) ? value.filter((one) => typeof one === "string") : [];
|
|
39
|
+
}
|
|
40
|
+
function payloadPlanning(payload) {
|
|
41
|
+
const value = payload["planning"] ?? "auto";
|
|
42
|
+
return value === "auto" || value === "required" || value === "skip" ? value : null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Confirm one of the mate's proposals as `who`. The whole check-and-act
|
|
46
|
+
* is one transaction: brand and standing (re-proved inside); the
|
|
47
|
+
* proposal's thread is this approver's; a LIVE session minted by this
|
|
48
|
+
* generation under this ceiling; its turn answered; `pending →
|
|
49
|
+
* confirming` CAS; the primitive; `confirming → confirmed | refused`.
|
|
50
|
+
*/
|
|
51
|
+
const VIA_WORDS = {
|
|
52
|
+
web: "From the lead chat", cli: "From the command line", telegram: "From Telegram", slack: "From Slack", discord: "From Discord", teams: "From Teams",
|
|
53
|
+
};
|
|
54
|
+
const CARD_WORDS = {
|
|
55
|
+
task: "New task", next: "Queue priority", reserve: "Worker assignment", hold: "Pause work", unhold: "Resume work",
|
|
56
|
+
steer: "Guidance for the next attempt", scope: "Scope revision", answer: "Decision answer", repair: "Waiting task",
|
|
57
|
+
agents: "Agents change", task_action: "Task update", action: "Action",
|
|
58
|
+
};
|
|
59
|
+
/** A card about a task, confirmed anywhere but that task's own chat (the
|
|
60
|
+
* lead chat, a project chat, a phone), is recorded in the task's chat too,
|
|
61
|
+
* so each task keeps the whole story of what was asked of it. */
|
|
62
|
+
function recordInTaskChat(store, who, proposal, outcome, via, now) {
|
|
63
|
+
const target = typeof proposal.payload["task"] === "string" ? proposal.payload["task"] : proposal.kind === "task" ? outcome.taskId : null;
|
|
64
|
+
if (target === null)
|
|
65
|
+
return;
|
|
66
|
+
const root = store.taskFamilyOf(target, who.repos, false)?.root.id ?? target;
|
|
67
|
+
const source = store.getMateThread(proposal.thread);
|
|
68
|
+
if (source === null || (source.scope.kind === "task" && source.scope.key === root))
|
|
69
|
+
return;
|
|
70
|
+
const where = via !== "web" ? VIA_WORDS[via] : source.scope.kind === "project" ? "From the project chat" : VIA_WORDS.web;
|
|
71
|
+
const label = proposal.kind === "review" ? (proposal.payload["operation"] === "revise" ? "Changes to make" : "Note for later") : CARD_WORDS[proposal.kind] ?? "Action";
|
|
72
|
+
const said = outcome.said.charAt(0).toUpperCase() + outcome.said.slice(1);
|
|
73
|
+
const thread = store.openMateThread(who.name, who.ceilingDigest, now, { kind: "task", key: root }).thread;
|
|
74
|
+
store.appendMateMessage({ thread: thread.id, turn: null, role: "assistant", text: `${where} — ${label}: ${said}` }, now);
|
|
75
|
+
}
|
|
76
|
+
export function confirmMateProposal(store, who, proposalId, now, options) {
|
|
77
|
+
if (!isVerifiedApprover(who))
|
|
78
|
+
return { ok: false, kind: null, reason: "standing", said: "your approver standing changed — sign in again" };
|
|
79
|
+
const signals = [];
|
|
80
|
+
const defer = options.deferSignal ?? ((signal) => signals.push(signal));
|
|
81
|
+
const result = store.transact(() => {
|
|
82
|
+
if (!reproveApprover(store, who).ok)
|
|
83
|
+
return { ok: false, kind: null, reason: "standing", said: "your approver standing changed — sign in again" };
|
|
84
|
+
const proposal = store.getMateProposal(proposalId);
|
|
85
|
+
if (proposal === null)
|
|
86
|
+
return { ok: false, kind: null, reason: "not-yours", said: "no such proposal" };
|
|
87
|
+
const thread = store.getMateThread(proposal.thread);
|
|
88
|
+
const shared = thread !== null && store.handle.prepare("SELECT id,lead FROM team_conversation WHERE thread=?").get(thread.id);
|
|
89
|
+
if (thread === null || (shared ? !store.canUseTeamMateThread(who.name, who.generation, thread.id) : thread.approver !== who.name))
|
|
90
|
+
return { ok: false, kind: null, reason: "not-yours", said: "no such proposal" };
|
|
91
|
+
const session = shared ? store.teamMateSession(who.name, thread.id) : store.activeMateSession(who.name);
|
|
92
|
+
if (session === null || session.approverGeneration !== who.generation) {
|
|
93
|
+
return { ok: false, kind: proposal.kind, reason: "session-ended", said: "the mate session this was proposed in has ended — its cards cannot be confirmed" };
|
|
94
|
+
}
|
|
95
|
+
if (proposal.ceilingDigest !== who.ceilingDigest || session.ceilingDigest !== who.ceilingDigest) {
|
|
96
|
+
return { ok: false, kind: proposal.kind, reason: "ceiling-changed", said: "the admitted projects changed since this was proposed — it cannot be confirmed" };
|
|
97
|
+
}
|
|
98
|
+
const turn = store.getMateTurn(proposal.turn);
|
|
99
|
+
if (turn === null || turn.state !== "answered") {
|
|
100
|
+
return { ok: false, kind: proposal.kind, reason: "turn-not-answered", said: "this proposal's turn did not finish — it cannot be confirmed" };
|
|
101
|
+
}
|
|
102
|
+
if (proposal.kind === "cancel") {
|
|
103
|
+
return { ok: false, kind: proposal.kind, reason: "not-confirmable", said: "cancelling is armed on the task itself — open the task" };
|
|
104
|
+
}
|
|
105
|
+
if (proposal.kind === "control")
|
|
106
|
+
return { ok: false, kind: proposal.kind, reason: "not-confirmable", said: "Open the linked control to complete this action." };
|
|
107
|
+
if (proposal.kind === "action") {
|
|
108
|
+
if (proposal.state !== "pending")
|
|
109
|
+
return { ok: false, kind: proposal.kind, reason: "not-pending", said: "This proposal was already acted on." };
|
|
110
|
+
const action = sharedActionPayload(proposal.payload);
|
|
111
|
+
if (action === null)
|
|
112
|
+
return { ok: false, kind: proposal.kind, reason: "refused", said: "This action is incomplete." };
|
|
113
|
+
const challenged = options.via !== "web" && options.via !== "cli" && options.confirm === true && sharedActionAllowsChallenge(action);
|
|
114
|
+
if (sharedActionNeedsReview(action) && !challenged && (options.via !== "web" || options.actionReview === undefined || options.confirm !== true))
|
|
115
|
+
return { ok: false, kind: proposal.kind, reason: "needs-confirm", said: "Review this action in the secure confirmation screen." };
|
|
116
|
+
}
|
|
117
|
+
// An irreversible answer takes the explicit field BEFORE the CAS: a
|
|
118
|
+
// missing confirmation leaves the card pending, not refused.
|
|
119
|
+
const needsConfirm = proposal.kind === "answer" && proposal.payload["reversible"] === false && options.confirm !== true;
|
|
120
|
+
if (needsConfirm)
|
|
121
|
+
return { ok: false, kind: proposal.kind, reason: "needs-confirm", said: "an irreversible choice must be confirmed explicitly" };
|
|
122
|
+
if (!store.casMateProposal(proposalId, "pending", "confirming", who.name, null, now)) {
|
|
123
|
+
return { ok: false, kind: proposal.kind, reason: "not-pending", said: "this proposal was already acted on" };
|
|
124
|
+
}
|
|
125
|
+
const outcome = proposal.kind === "action"
|
|
126
|
+
? { ...executeSharedAction(store, who, proposal.id, sharedActionPayload(proposal.payload), now, { via: options.via, ...(options.evidenceRoot === undefined ? {} : { root: options.evidenceRoot }), ...(options.actionReview === undefined ? {} : { review: options.actionReview }), ...(options.confirm === undefined ? {} : { confirm: options.confirm }) }), kind: proposal.kind }
|
|
127
|
+
: executeProposal(store, who, proposal.kind, proposal.payload, now, { ...options, deferSignal: defer });
|
|
128
|
+
if (!outcome.ok && outcome.reason === "needs-confirm") {
|
|
129
|
+
store.casMateProposal(proposalId, "confirming", "pending", null, null, now);
|
|
130
|
+
return outcome;
|
|
131
|
+
}
|
|
132
|
+
// The recorded outcome names the surface that confirmed — the audit a
|
|
133
|
+
// card shows on every other surface afterwards.
|
|
134
|
+
store.casMateProposal(proposalId, "confirming", outcome.ok ? "confirmed" : "refused", who.name, { ...outcome, via: options.via }, now);
|
|
135
|
+
if (outcome.ok && !shared)
|
|
136
|
+
recordInTaskChat(store, who, proposal, outcome, options.via, now);
|
|
137
|
+
if (shared) {
|
|
138
|
+
if (outcome.ok && outcome.kind === 'task' && outcome.taskId)
|
|
139
|
+
new TeamLeads(store, () => store.handle.prepare('SELECT project FROM team_lead_project WHERE lead=?').all(shared['lead']).map(row => String(row['project']))).recordTaskOwner(outcome.taskId, String(shared['lead']), String(shared['id']), { name: who.name, generation: who.generation }, now);
|
|
140
|
+
store.handle.prepare('INSERT INTO team_event(lead,conversation,kind,actor,created_at) VALUES(?,?,?,?,?)').run(shared['lead'], shared['id'], 'proposal-changed', who.name, now.toISOString());
|
|
141
|
+
}
|
|
142
|
+
return outcome;
|
|
143
|
+
});
|
|
144
|
+
for (const signal of signals)
|
|
145
|
+
signal();
|
|
146
|
+
return result;
|
|
147
|
+
}
|
|
148
|
+
/** The operator declines the mate's card: `pending → dismissed`. */
|
|
149
|
+
export function dismissMateProposal(store, who, proposalId, now) {
|
|
150
|
+
if (!isVerifiedApprover(who))
|
|
151
|
+
return false;
|
|
152
|
+
return store.transact(() => {
|
|
153
|
+
if (!reproveApprover(store, who).ok)
|
|
154
|
+
return false;
|
|
155
|
+
const proposal = store.getMateProposal(proposalId);
|
|
156
|
+
const thread = proposal === null ? null : store.getMateThread(proposal.thread);
|
|
157
|
+
const shared = thread && store.handle.prepare('SELECT id,lead FROM team_conversation WHERE thread=?').get(thread.id);
|
|
158
|
+
if (proposal === null || thread === null || (shared ? !store.canUseTeamMateThread(who.name, who.generation, thread.id) : thread.approver !== who.name))
|
|
159
|
+
return false;
|
|
160
|
+
const changed = store.casMateProposal(proposalId, "pending", "dismissed", who.name, null, now);
|
|
161
|
+
if (changed && shared)
|
|
162
|
+
store.handle.prepare('INSERT INTO team_event(lead,conversation,kind,actor,created_at) VALUES(?,?,?,?,?)').run(shared['lead'], shared['id'], 'proposal-changed', who.name, now.toISOString());
|
|
163
|
+
return changed;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Confirm a coordinator's proposal (v3 §9) as `who`: any approver whose
|
|
168
|
+
* ceiling admits the row's repo. One transaction: standing re-proved
|
|
169
|
+
* inside; the repo inside this ceiling; `pending → confirming`; the shared
|
|
170
|
+
* executor; `confirming → confirmed | refused`. No mate session is
|
|
171
|
+
* involved — nothing here spends.
|
|
172
|
+
*/
|
|
173
|
+
export function confirmCoordinatorProposal(store, who, proposalId, now, options) {
|
|
174
|
+
if (!isVerifiedApprover(who))
|
|
175
|
+
return { ok: false, kind: null, reason: "standing", said: "your approver standing changed — sign in again" };
|
|
176
|
+
const signals = [];
|
|
177
|
+
const result = store.transact(() => {
|
|
178
|
+
if (!reproveApprover(store, who).ok)
|
|
179
|
+
return { ok: false, kind: null, reason: "standing", said: "your approver standing changed — sign in again" };
|
|
180
|
+
const proposal = store.getCoordinatorProposal(proposalId);
|
|
181
|
+
if (proposal === null || !who.repos.includes(proposal.repo))
|
|
182
|
+
return { ok: false, kind: null, reason: "not-yours", said: "no such proposal in your projects" };
|
|
183
|
+
if (Date.parse(proposal.createdAt) + COORDINATOR_PROPOSAL_TTL_MS <= now.getTime()) {
|
|
184
|
+
store.casCoordinatorProposal(proposalId, "pending", "expired", null, null, now);
|
|
185
|
+
return { ok: false, kind: proposal.kind, reason: "expired", said: "this proposal is older than seven days — it expired" };
|
|
186
|
+
}
|
|
187
|
+
if (proposal.kind === "cancel") {
|
|
188
|
+
return { ok: false, kind: proposal.kind, reason: "not-confirmable", said: "cancelling is armed on the task itself — open the task" };
|
|
189
|
+
}
|
|
190
|
+
const needsConfirm = proposal.kind === "answer" && proposal.payload["reversible"] === false && options.confirm !== true;
|
|
191
|
+
if (needsConfirm)
|
|
192
|
+
return { ok: false, kind: proposal.kind, reason: "needs-confirm", said: "an irreversible choice must be confirmed explicitly" };
|
|
193
|
+
if (!store.casCoordinatorProposal(proposalId, "pending", "confirming", who.name, null, now)) {
|
|
194
|
+
return { ok: false, kind: proposal.kind, reason: "not-pending", said: "this proposal was already acted on" };
|
|
195
|
+
}
|
|
196
|
+
const outcome = executeProposal(store, who, proposal.kind, proposal.payload, now, { ...options, scopeAuthor: "coordinator", deferSignal: signal => signals.push(signal) });
|
|
197
|
+
store.casCoordinatorProposal(proposalId, "confirming", outcome.ok ? "confirmed" : "refused", who.name, { ...outcome }, now);
|
|
198
|
+
return outcome;
|
|
199
|
+
});
|
|
200
|
+
for (const signal of signals)
|
|
201
|
+
signal();
|
|
202
|
+
return result;
|
|
203
|
+
}
|
|
204
|
+
export function dismissCoordinatorProposal(store, who, proposalId, now) {
|
|
205
|
+
if (!isVerifiedApprover(who))
|
|
206
|
+
return false;
|
|
207
|
+
return store.transact(() => {
|
|
208
|
+
if (!reproveApprover(store, who).ok)
|
|
209
|
+
return false;
|
|
210
|
+
const proposal = store.getCoordinatorProposal(proposalId);
|
|
211
|
+
if (proposal === null || !who.repos.includes(proposal.repo))
|
|
212
|
+
return false;
|
|
213
|
+
return store.casCoordinatorProposal(proposalId, "pending", "dismissed", who.name, null, now);
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
/** Which door renders a coordinator proposal for this reader: the repo must be admitted. */
|
|
217
|
+
export function coordinatorProposalVisible(who, proposal) {
|
|
218
|
+
return who.repos.includes(proposal.repo);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* The shared executor: one kind, one payload, the operator's own act
|
|
222
|
+
* through the primitive that owns it. Module-private (v3 review, finding
|
|
223
|
+
* 1): only the two doors above reach it, and it re-proves the brand and
|
|
224
|
+
* the standing itself — a structural caller executes nothing.
|
|
225
|
+
*/
|
|
226
|
+
function executeProposal(store, actor, kind, payload, now, options) {
|
|
227
|
+
if (!isVerifiedApprover(actor) || !reproveApprover(store, actor).ok)
|
|
228
|
+
return { ok: false, kind, reason: "standing", said: "your approver standing changed — sign in again" };
|
|
229
|
+
const taskId = payloadString(payload, "task");
|
|
230
|
+
const admitted = (repo) => repo !== null && actor.repos.includes(repo);
|
|
231
|
+
const refuse = (reason, said) => ({ ok: false, kind, reason, said });
|
|
232
|
+
if (kind === "task") {
|
|
233
|
+
const repo = payloadString(payload, "repo");
|
|
234
|
+
const title = payloadString(payload, "title");
|
|
235
|
+
const goal = payloadString(payload, "goal");
|
|
236
|
+
const planning = payloadPlanning(payload);
|
|
237
|
+
if (!admitted(repo) || title === null || goal === null)
|
|
238
|
+
return refuse("outside-ceiling", "that project is not one of yours");
|
|
239
|
+
if (planning === null)
|
|
240
|
+
return refuse("refused", "that proposal carries an invalid planning choice");
|
|
241
|
+
const filed = fileTaskProposal(store, {
|
|
242
|
+
title,
|
|
243
|
+
repo: repo,
|
|
244
|
+
goal,
|
|
245
|
+
outOfScope: payloadString(payload, "not"),
|
|
246
|
+
touches: payloadStrings(payload, "touches"),
|
|
247
|
+
acceptance: payload["acceptance"],
|
|
248
|
+
...(payload["report"] === true ? { deliverable: "report" } : {}),
|
|
249
|
+
planning,
|
|
250
|
+
filedVia: "mate", filedBy: { name: actor.name, kind: "person" },
|
|
251
|
+
proposedVia: "mate",
|
|
252
|
+
admittedRepos: [...actor.repos],
|
|
253
|
+
}, now);
|
|
254
|
+
if (!filed.ok)
|
|
255
|
+
return refuse("refused", `not filed: ${filed.message}`);
|
|
256
|
+
return {
|
|
257
|
+
ok: true,
|
|
258
|
+
kind,
|
|
259
|
+
said: filed.planning
|
|
260
|
+
? `filed ${filed.id} — the planner is reading the project before you approve anything`
|
|
261
|
+
: `filed ${filed.id} — review and approve its scope to start work`,
|
|
262
|
+
taskId: filed.id,
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
if (kind === "answer") {
|
|
266
|
+
const decisionId = payloadNumber(payload, "decision");
|
|
267
|
+
const option = payloadString(payload, "option");
|
|
268
|
+
const decision = decisionId === null ? null : store.getDecision(decisionId);
|
|
269
|
+
if (decision === null || option === null)
|
|
270
|
+
return refuse("unknown-decision", "no such decision");
|
|
271
|
+
const run = store.getRun(decision.run);
|
|
272
|
+
const ref = run === null ? null : store.refById(run.taskRef);
|
|
273
|
+
if (ref === null || !admitted(ref.repo))
|
|
274
|
+
return refuse("unknown-decision", "no such decision in your projects");
|
|
275
|
+
const chosen = decision.options.find(one => one.id === option);
|
|
276
|
+
if (chosen === undefined)
|
|
277
|
+
return refuse("stale", "that option no longer exists on the decision");
|
|
278
|
+
// The proposal contract is "open": a decision past its deadline — swept
|
|
279
|
+
// or not — is not answered through a card (v3 review, finding 7).
|
|
280
|
+
if (decision.state === "answered")
|
|
281
|
+
return refuse("already-answered", "already answered — somebody got there first");
|
|
282
|
+
if (decision.state !== "open" || (decision.deadline !== null && Date.parse(decision.deadline) <= now.getTime())) {
|
|
283
|
+
return refuse("stale", "this decision is no longer open — answer it on its own page if you still mean to");
|
|
284
|
+
}
|
|
285
|
+
if (!chosen.reversible && options.confirm !== true)
|
|
286
|
+
return refuse("needs-confirm", "an irreversible choice must be confirmed explicitly");
|
|
287
|
+
const answered = store.answerDecision({ id: decision.id, choice: chosen.id, by: actor.name, via: options.via }, now);
|
|
288
|
+
// The same choice landed first from somewhere else: the decision keeps
|
|
289
|
+
// its first answerer, and this card did not answer it (finding 5).
|
|
290
|
+
if (!answered.ok || answered.duplicate === true) {
|
|
291
|
+
return !answered.ok && answered.reason !== "already-answered"
|
|
292
|
+
? refuse("refused", `not answered: ${answered.reason}`)
|
|
293
|
+
: refuse("already-answered", "already answered — somebody got there first");
|
|
294
|
+
}
|
|
295
|
+
return { ok: true, kind, said: `decision #${decision.id} answered: ${chosen.label}`, taskId: ref.externalId };
|
|
296
|
+
}
|
|
297
|
+
if (taskId === null)
|
|
298
|
+
return refuse("unknown-task", "no such task");
|
|
299
|
+
const ref = store.lookupRef(taskId);
|
|
300
|
+
if (ref === null || !admitted(ref.repo))
|
|
301
|
+
return refuse("unknown-task", "no such task in your projects");
|
|
302
|
+
if (kind === "task_action") {
|
|
303
|
+
// An attended surface (the console, the paired phone) honours the
|
|
304
|
+
// operator's own automatic-approval mode; the CLI keeps its ceremony.
|
|
305
|
+
const result = applyChatTaskAction(store, actor, payload, now, options.via !== "cli", { held: options.held, deferSignal: options.deferSignal, via: options.via });
|
|
306
|
+
return result.ok ? { ok: true, kind, taskId: result.taskId, said: result.said } : refuse("stale", result.message);
|
|
307
|
+
}
|
|
308
|
+
if (kind === "review") {
|
|
309
|
+
if (options.evidenceRoot === undefined)
|
|
310
|
+
return refuse("refused", "The saved result is not available on this connection.");
|
|
311
|
+
const request = payload;
|
|
312
|
+
if (request.snapshot == null || request.snapshot.task !== taskId || (request.operation !== "note" && request.operation !== "revise"))
|
|
313
|
+
return refuse("refused", "This feedback card is incomplete. Ask again.");
|
|
314
|
+
const result = applyChatReview(store, actor, options.evidenceRoot, request, now, options.via !== "cli");
|
|
315
|
+
return result.ok ? { ok: true, kind, taskId: result.taskId, said: result.said } : refuse("stale", result.message);
|
|
316
|
+
}
|
|
317
|
+
// The place the proposer saw must be the place the task holds now
|
|
318
|
+
// (round-2 ruling 10; round-3 ruling 6): the revision alone misses a
|
|
319
|
+
// neighbour leaving the queue by a state change.
|
|
320
|
+
const placeUnchanged = () => {
|
|
321
|
+
const here = store.queuePosition(taskId);
|
|
322
|
+
const sawPosition = payloadNumber(payload, "position");
|
|
323
|
+
const sawColumn = payload["column"];
|
|
324
|
+
return here !== null && here.position === sawPosition && (here.column ?? null) === (typeof sawColumn === "string" ? sawColumn : null);
|
|
325
|
+
};
|
|
326
|
+
if (kind === "next") {
|
|
327
|
+
const sawRevision = payloadNumber(payload, "queueRevision");
|
|
328
|
+
if (sawRevision === null || sawRevision !== store.queueRevision() || !placeUnchanged())
|
|
329
|
+
return refuse("stale", "the queue moved since this was proposed — look again");
|
|
330
|
+
const moved = store.moveTaskNext(taskId, now);
|
|
331
|
+
if (!moved.ok)
|
|
332
|
+
return refuseFromReason(kind, moved.reason);
|
|
333
|
+
return { ok: true, kind, said: `${taskId} moved to the front of its column`, taskId };
|
|
334
|
+
}
|
|
335
|
+
if (kind === "reserve") {
|
|
336
|
+
const sawRevision = payloadNumber(payload, "queueRevision");
|
|
337
|
+
const worker = payload["worker"];
|
|
338
|
+
if (sawRevision === null || (worker !== null && typeof worker !== "string"))
|
|
339
|
+
return refuse("stale", "this proposal is missing what it saw");
|
|
340
|
+
if (!placeUnchanged())
|
|
341
|
+
return refuse("stale", "the queue moved since this was proposed — look again");
|
|
342
|
+
const moved = store.moveTask({ taskId, toRunner: worker, beforeTaskId: null, queueRevision: sawRevision }, now);
|
|
343
|
+
if (!moved.ok)
|
|
344
|
+
return refuseFromReason(kind, moved.reason);
|
|
345
|
+
return { ok: true, kind, said: worker === null ? `${taskId} released to the shared queue` : `${taskId} reserved for ${worker}`, taskId };
|
|
346
|
+
}
|
|
347
|
+
if (kind === "hold") {
|
|
348
|
+
const reason = payloadString(payload, "reason");
|
|
349
|
+
if (reason === null)
|
|
350
|
+
return refuse("refused", "this proposal carries no reason");
|
|
351
|
+
const standing = store.activeHolds(ref.id, now).find(one => one.ownerKind === "operator") ?? null;
|
|
352
|
+
const sawHold = payload["sawHold"];
|
|
353
|
+
if ((standing?.id ?? null) !== (typeof sawHold === "number" ? sawHold : null)) {
|
|
354
|
+
return refuse("stale", "the hold on this task changed since this was proposed — look again");
|
|
355
|
+
}
|
|
356
|
+
store.hold(ref.id, reason, null, now);
|
|
357
|
+
return { ok: true, kind, said: `${taskId} held: ${reason}`, taskId };
|
|
358
|
+
}
|
|
359
|
+
if (kind === "unhold") {
|
|
360
|
+
const holdId = payloadNumber(payload, "holdId");
|
|
361
|
+
const standing = store.activeHolds(ref.id, now).find(one => one.ownerKind === "operator") ?? null;
|
|
362
|
+
if (standing === null || standing.id !== holdId)
|
|
363
|
+
return refuse("stale", "that hold is no longer the one standing — look again");
|
|
364
|
+
store.unhold(ref.id);
|
|
365
|
+
return { ok: true, kind, said: `${taskId} released from its hold`, taskId };
|
|
366
|
+
}
|
|
367
|
+
if (kind === "steer") {
|
|
368
|
+
const note = payloadString(payload, "note");
|
|
369
|
+
if (note === null)
|
|
370
|
+
return refuse("refused", "this proposal carries no guidance");
|
|
371
|
+
const filed = store.fileSteerNote(taskId, verifiedAuthor(actor.name), note, now);
|
|
372
|
+
if (!filed.ok) {
|
|
373
|
+
const said = filed.reason === "contest-open"
|
|
374
|
+
? "agents are racing on this task — guidance can be added after the comparison finishes"
|
|
375
|
+
: filed.reason === "task-finished"
|
|
376
|
+
? "this task is finished — guidance has no next attempt to reach"
|
|
377
|
+
: filed.reason === "invalid-note"
|
|
378
|
+
? (filed.problem ?? "that guidance could not be saved")
|
|
379
|
+
: "no such task";
|
|
380
|
+
return refuse(filed.reason === "contest-open" ? "contest-open" : "refused", said);
|
|
381
|
+
}
|
|
382
|
+
const taskName = payloadString(payload, "taskTitle") ?? taskId;
|
|
383
|
+
return { ok: true, kind, said: `Guidance saved for ${taskName}'s next attempt`, taskId };
|
|
384
|
+
}
|
|
385
|
+
if (kind === "repair") {
|
|
386
|
+
const blocker = payloadString(payload, "blocker");
|
|
387
|
+
const operation = payloadString(payload, "operation");
|
|
388
|
+
const sawBlockerState = payloadString(payload, "sawBlockerState");
|
|
389
|
+
const taskName = payloadString(payload, "taskTitle") ?? taskId;
|
|
390
|
+
const blockerName = payloadString(payload, "blockerTitle") ?? blocker ?? "that task";
|
|
391
|
+
if (blocker === null || !store.blockers(taskId).includes(blocker)) {
|
|
392
|
+
return refuse("stale", "this task no longer waits for that work — look again");
|
|
393
|
+
}
|
|
394
|
+
const blockerTask = store.getTask(blocker);
|
|
395
|
+
if (blockerTask === null ||
|
|
396
|
+
blockerTask.state !== sawBlockerState ||
|
|
397
|
+
(blockerTask.state !== "failed" && blockerTask.state !== "cancelled")) {
|
|
398
|
+
return refuse("stale", "the task it was waiting for changed since this was proposed — look again");
|
|
399
|
+
}
|
|
400
|
+
if (store.openContestFor(ref.id) !== null) {
|
|
401
|
+
return refuse("contest-open", "a tournament is running on the dependent task — let it finish first");
|
|
402
|
+
}
|
|
403
|
+
if (operation === "retry") {
|
|
404
|
+
const blockerRef = store.lookupRef(blocker);
|
|
405
|
+
if (blockerTask.state !== "failed" || blockerRef === null || !admitted(blockerRef.repo)) {
|
|
406
|
+
return refuse("stale", "that failed task cannot be tried again from this conversation");
|
|
407
|
+
}
|
|
408
|
+
const retried = store.requeueTask(blocker, actor.name, now);
|
|
409
|
+
if (!retried.ok)
|
|
410
|
+
return refuseFromReason(kind, retried.reason);
|
|
411
|
+
return { ok: true, kind, said: `${blockerName} was queued again; ${taskName} will follow when it finishes`, taskId };
|
|
412
|
+
}
|
|
413
|
+
if (operation === "unlink") {
|
|
414
|
+
const removed = store.removeEdge(taskId, blocker);
|
|
415
|
+
if (!removed.ok)
|
|
416
|
+
return refuse("stale", "this task no longer waits for that work — look again");
|
|
417
|
+
return { ok: true, kind, said: `${taskName} can now continue without ${blockerName}`, taskId };
|
|
418
|
+
}
|
|
419
|
+
if (operation === "replace") {
|
|
420
|
+
const replacement = payloadString(payload, "replacement");
|
|
421
|
+
const replacementName = payloadString(payload, "replacementTitle") ?? replacement ?? "the selected task";
|
|
422
|
+
const replacementRef = replacement === null ? null : store.lookupRef(replacement);
|
|
423
|
+
const replacementTask = replacement === null ? null : store.getTask(replacement);
|
|
424
|
+
if (replacement === null ||
|
|
425
|
+
replacementRef === null ||
|
|
426
|
+
!admitted(replacementRef.repo) ||
|
|
427
|
+
replacementTask === null ||
|
|
428
|
+
(replacementTask.state !== "queued" && replacementTask.state !== "running")) {
|
|
429
|
+
return refuse("stale", "the selected task is no longer unfinished work in your projects — look again");
|
|
430
|
+
}
|
|
431
|
+
const replaced = store.replaceEdge(taskId, blocker, replacement);
|
|
432
|
+
if (!replaced.ok)
|
|
433
|
+
return refuse("stale", `this task could not wait for the selected work — ${replaced.reason}`);
|
|
434
|
+
return { ok: true, kind, said: `${taskName} will now wait for ${replacementName} instead of ${blockerName}`, taskId };
|
|
435
|
+
}
|
|
436
|
+
return refuse("refused", "this request does not say how the waiting task should continue");
|
|
437
|
+
}
|
|
438
|
+
if (kind === "agents") {
|
|
439
|
+
// THE AGENTS CHANGE (v48): the operator's own act through the ONE
|
|
440
|
+
// authenticated route-edit transaction — the same door the task page
|
|
441
|
+
// uses. Re-proved here, inside it: the actor's standing (the edit's
|
|
442
|
+
// own authenticate hook), the digest the card was drafted against
|
|
443
|
+
// (CAS — a scope rewritten meanwhile refuses), a live claim or open
|
|
444
|
+
// contest (refused inside the store), and — for an agent — that the
|
|
445
|
+
// pair is STILL one of the configured, role-valid choices right now.
|
|
446
|
+
// Nothing the mate wrote becomes authority: only a configured pair,
|
|
447
|
+
// recorded under the operator's name, ever reaches the route.
|
|
448
|
+
const risk = payload["risk"];
|
|
449
|
+
const phase = payload["phase"];
|
|
450
|
+
const clear = payload["clear"] === true;
|
|
451
|
+
const provider = payloadString(payload, "provider");
|
|
452
|
+
const model = payloadString(payload, "model");
|
|
453
|
+
if (risk !== undefined && !isRiskLevel(risk))
|
|
454
|
+
return refuse("refused", "this proposal carries an unknown risk level");
|
|
455
|
+
if (phase !== undefined && (typeof phase !== "string" || !PHASES.includes(phase)))
|
|
456
|
+
return refuse("refused", "this proposal names an unknown role");
|
|
457
|
+
if (risk === undefined && phase === undefined)
|
|
458
|
+
return refuse("refused", "this proposal changes nothing about the agents");
|
|
459
|
+
let override;
|
|
460
|
+
if (typeof phase === "string") {
|
|
461
|
+
if (clear) {
|
|
462
|
+
override = { phase: phase, clear: true };
|
|
463
|
+
}
|
|
464
|
+
else {
|
|
465
|
+
if (provider === null || model === null || !isProviderId(provider))
|
|
466
|
+
return refuse("refused", "this proposal names no exact agent");
|
|
467
|
+
override = { phase: phase, provider, model };
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
const edited = store.editTaskRoute(ref.id, {
|
|
471
|
+
by: actor.name,
|
|
472
|
+
authenticate: () => {
|
|
473
|
+
const standing = reproveApprover(store, actor);
|
|
474
|
+
return standing.ok ? { ok: true } : { ok: false, reason: `your approver standing changed (${standing.reason}) — sign in again` };
|
|
475
|
+
},
|
|
476
|
+
...(isRiskLevel(risk) ? { risk } : {}),
|
|
477
|
+
...(override === undefined ? {} : { override }),
|
|
478
|
+
expectDigest: payloadString(payload, "sawDigest"),
|
|
479
|
+
// The pair is re-proved against the role's configured choices
|
|
480
|
+
// INSIDE the edit transaction — a card drafted against an earlier
|
|
481
|
+
// configuration mutates nothing.
|
|
482
|
+
configured: true,
|
|
483
|
+
}, now);
|
|
484
|
+
if (!edited.ok) {
|
|
485
|
+
if (edited.reason === "not-configured")
|
|
486
|
+
return refuse("stale", `${specWords({ provider: provider, model: model })} is no longer one of the configured agents for that role — look again`);
|
|
487
|
+
if (edited.reason === "changed")
|
|
488
|
+
return refuse("stale", "the scope was rewritten since this was proposed — look again");
|
|
489
|
+
if (edited.reason === "live-claim")
|
|
490
|
+
return refuse("claimed", "this task is being built right now");
|
|
491
|
+
if (edited.reason === "contest-open")
|
|
492
|
+
return refuse("contest-open", "a tournament is running on this task — let it finish first");
|
|
493
|
+
if (edited.reason === "unauthenticated")
|
|
494
|
+
return refuse("standing", edited.detail);
|
|
495
|
+
if (edited.reason === "no-task")
|
|
496
|
+
return refuse("unknown-task", "no such task");
|
|
497
|
+
return refuse("refused", edited.detail);
|
|
498
|
+
}
|
|
499
|
+
// v102: changing how a task runs is authoring it — the requester rule then refuses this person too.
|
|
500
|
+
const routed = taskId === null ? null : store.getScope(taskId);
|
|
501
|
+
if (routed !== null && taskId !== null)
|
|
502
|
+
store.recordScopeAuthor(taskId, routed.digest, actor.name, now);
|
|
503
|
+
const taskName = payloadString(payload, "taskTitle") ?? taskId;
|
|
504
|
+
const roleWord = typeof phase === "string" ? { plan: "planner", build: "builder", repair: "repair", review: "reviewer" }[phase] ?? phase : null;
|
|
505
|
+
const changed = [
|
|
506
|
+
...(isRiskLevel(risk) ? [`risk is now ${riskTitle(risk).toLowerCase()}`] : []),
|
|
507
|
+
...(roleWord === null ? [] : clear ? [`the ${roleWord} choice was cleared — the recommendation stands again`] : [`the ${roleWord} is now ${specWords({ provider: provider, model: model })}`]),
|
|
508
|
+
];
|
|
509
|
+
return {
|
|
510
|
+
ok: true,
|
|
511
|
+
kind,
|
|
512
|
+
said: `Agents changed for ${taskName}: ${changed.join("; ")}${edited.staled ? " — the earlier approval no longer covers this task; approve it again" : ""}${edited.replanned ? " — a new plan was requested" : ""}`,
|
|
513
|
+
taskId,
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
if (kind === "scope") {
|
|
517
|
+
const goal = payloadString(payload, "goal");
|
|
518
|
+
if (goal === null)
|
|
519
|
+
return refuse("refused", "this proposal carries no goal");
|
|
520
|
+
const proposed = proposeGuarded(store, {
|
|
521
|
+
taskId, author: actor.name,
|
|
522
|
+
goal,
|
|
523
|
+
outOfScope: payloadString(payload, "not"),
|
|
524
|
+
touches: payloadStrings(payload, "touches"),
|
|
525
|
+
acceptance: payload["acceptance"],
|
|
526
|
+
sawDigest: payloadString(payload, "sawDigest"),
|
|
527
|
+
taskRef: ref.id,
|
|
528
|
+
proposedVia: options.scopeAuthor ?? "mate",
|
|
529
|
+
now,
|
|
530
|
+
});
|
|
531
|
+
if (!proposed.ok)
|
|
532
|
+
return refuseFromReason(kind, proposed.reason);
|
|
533
|
+
return { ok: true, kind, said: `${taskId}'s scope rewritten — approve it with your password on the task`, taskId };
|
|
534
|
+
}
|
|
535
|
+
return refuse("not-confirmable", "this kind of proposal has no door");
|
|
536
|
+
}
|
|
537
|
+
function refuseFromReason(kind, reason) {
|
|
538
|
+
const known = {
|
|
539
|
+
stale: { reason: "stale", said: "the queue moved since this was proposed — look again" },
|
|
540
|
+
changed: { reason: "stale", said: "the scope was rewritten since this was proposed — look again" },
|
|
541
|
+
claimed: { reason: "claimed", said: "this task is being built right now" },
|
|
542
|
+
"not-queued": { reason: "not-queued", said: "only queued work can move — this task is not waiting in the queue" },
|
|
543
|
+
"contest-open": { reason: "contest-open", said: "a tournament is running on this task — let it finish first" },
|
|
544
|
+
"unknown-task": { reason: "unknown-task", said: "no such task" },
|
|
545
|
+
};
|
|
546
|
+
const typed = known[reason];
|
|
547
|
+
return typed === undefined ? { ok: false, kind, reason: "refused", said: `refused: ${reason}` } : { ok: false, kind, ...typed };
|
|
548
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Live progress of one lead turn (chat streaming): what the lead is doing
|
|
2
|
+
* and the reply as it is written. Nothing here is durable or authoritative —
|
|
3
|
+
* the finished turn's saved message and cards remain the record. */
|
|
4
|
+
export type MateProgress = {
|
|
5
|
+
kind: "started";
|
|
6
|
+
turn: number;
|
|
7
|
+
} | {
|
|
8
|
+
kind: "step";
|
|
9
|
+
turn: number;
|
|
10
|
+
step: number;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "tool";
|
|
13
|
+
turn: number;
|
|
14
|
+
step: number;
|
|
15
|
+
label: string;
|
|
16
|
+
} | {
|
|
17
|
+
kind: "text";
|
|
18
|
+
turn: number;
|
|
19
|
+
step: number;
|
|
20
|
+
text: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function mateToolLabel(name: string): string;
|
|
23
|
+
/** The `text` of a structured answer still being written, when the answer
|
|
24
|
+
* opens with it (`{"text": "…`); null until then. Escapes are decoded, and
|
|
25
|
+
* an escape cut off at the end is left for the next chunk. */
|
|
26
|
+
export declare function partialAnswerText(partial: string): string | null;
|
|
27
|
+
/** A reader for `claude -p --output-format stream-json --include-partial-messages`:
|
|
28
|
+
* follows the structured-output block and reports its text as it grows. */
|
|
29
|
+
export declare function claudeStreamReader(onText: (text: string) => void, capBytes?: number): (chunk: string) => void;
|