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,35 @@
|
|
|
1
|
+
import type { Store } from "./store.js";
|
|
2
|
+
export type SetupInputs = {
|
|
3
|
+
provider: string;
|
|
4
|
+
model: string;
|
|
5
|
+
command: string;
|
|
6
|
+
seconds: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function previewSetup(store: Store, repo: string, inputs: SetupInputs): {
|
|
9
|
+
provider?: never;
|
|
10
|
+
model?: never;
|
|
11
|
+
ok: false;
|
|
12
|
+
message: string;
|
|
13
|
+
fingerprint?: never;
|
|
14
|
+
command?: never;
|
|
15
|
+
seconds?: never;
|
|
16
|
+
} | {
|
|
17
|
+
message?: never;
|
|
18
|
+
ok: true;
|
|
19
|
+
fingerprint: string;
|
|
20
|
+
command: string;
|
|
21
|
+
seconds: number;
|
|
22
|
+
provider: import("./provider.js").ProviderId;
|
|
23
|
+
model: string;
|
|
24
|
+
};
|
|
25
|
+
export declare function approveSetup(store: Store, repo: string, inputs: SetupInputs, fingerprint: string, by: string, token: string, now: Date): {
|
|
26
|
+
provider?: never;
|
|
27
|
+
model?: never;
|
|
28
|
+
ok: false;
|
|
29
|
+
message: string;
|
|
30
|
+
fingerprint?: never;
|
|
31
|
+
command?: never;
|
|
32
|
+
seconds?: never;
|
|
33
|
+
} | {
|
|
34
|
+
ok: true;
|
|
35
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { hasDisguisedText } from "./decision.js";
|
|
3
|
+
import { authenticateApprover } from "./scope.js";
|
|
4
|
+
import { isProviderId, validateSpec } from "./provider.js";
|
|
5
|
+
export function previewSetup(store, repo, inputs) {
|
|
6
|
+
if (!isProviderId(inputs.provider))
|
|
7
|
+
return { ok: false, message: "Choose an installed provider." };
|
|
8
|
+
if (inputs.model.trim() === "__custom__")
|
|
9
|
+
return { ok: false, message: "Choose an exact model before reviewing setup." };
|
|
10
|
+
const spec = validateSpec({ provider: inputs.provider, model: inputs.model.trim() });
|
|
11
|
+
if (!spec.ok)
|
|
12
|
+
return { ok: false, message: spec.problem };
|
|
13
|
+
const command = inputs.command.trim();
|
|
14
|
+
if (command.length > 2000 || hasDisguisedText(command))
|
|
15
|
+
return { ok: false, message: "Use a setup command under 2000 characters without control characters." };
|
|
16
|
+
if (/([A-Za-z0-9_-]*(?:token|secret|password|passwd|apikey|api_key|authorization|bearer|credential)[A-Za-z0-9_-]*\s*[=:]\s*)(?![$"']?\$)\S+/i.test(command) || /\/\/[^\s/@]+:[^\s/@]+@/.test(command))
|
|
17
|
+
return { ok: false, message: "Remove literal credentials from the setup command." };
|
|
18
|
+
const seconds = Number(inputs.seconds);
|
|
19
|
+
if (!/^[1-9][0-9]*$/.test(inputs.seconds) || !Number.isInteger(seconds) || seconds < 1 || seconds > 3600)
|
|
20
|
+
return { ok: false, message: "Setup timeout must be 1–3600 seconds." };
|
|
21
|
+
const fingerprint = createHash("sha256").update(JSON.stringify({ repo, inputs, beforeSetup: store.liveWorktreeSetup(repo), beforeConfig: store.phaseConfig(repo, "build") })).digest("hex");
|
|
22
|
+
return { ok: true, fingerprint, command, seconds, provider: inputs.provider, model: inputs.model.trim() };
|
|
23
|
+
}
|
|
24
|
+
export function approveSetup(store, repo, inputs, fingerprint, by, token, now) {
|
|
25
|
+
return store.transact(() => {
|
|
26
|
+
if (!authenticateApprover(store, by, token, repo).ok)
|
|
27
|
+
return { ok: false, message: "Your operator credential is required." };
|
|
28
|
+
const preview = previewSetup(store, repo, inputs);
|
|
29
|
+
if (!preview.ok)
|
|
30
|
+
return preview;
|
|
31
|
+
if (preview.fingerprint !== fingerprint)
|
|
32
|
+
return { ok: false, message: "Setup changed. Review it again." };
|
|
33
|
+
store.setPhaseConfig(repo, "build", preview.provider, preview.model, by, now);
|
|
34
|
+
if (preview.command === "")
|
|
35
|
+
store.clearWorktreeSetup(repo, by, now);
|
|
36
|
+
else
|
|
37
|
+
store.setWorktreeSetup({ repo, command: preview.command, timeoutMs: preview.seconds * 1000, approvedBy: by }, now);
|
|
38
|
+
return { ok: true };
|
|
39
|
+
});
|
|
40
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Shared setup views over the existing project configuration and approval doors. */
|
|
2
|
+
import type { ProviderId } from "./provider.js";
|
|
3
|
+
import type { ProviderConnection } from "./provider-connection.js";
|
|
4
|
+
import { type ModelChoice } from "./setup-guide.js";
|
|
5
|
+
import type { SetupInputs } from "./control-setup.js";
|
|
6
|
+
import { type OpenRouterModels } from "./openrouter-models.js";
|
|
7
|
+
export declare function hiddenFields(values: Record<string, string>): string;
|
|
8
|
+
export declare function connectionWords(connection: ProviderConnection): string;
|
|
9
|
+
export declare function connectionHtml(provider: ProviderId, connection: ProviderConnection, task?: string): string;
|
|
10
|
+
export declare function controlSetupHtml(data: {
|
|
11
|
+
repo: string;
|
|
12
|
+
csrf: string;
|
|
13
|
+
provider: ProviderId;
|
|
14
|
+
inputs: SetupInputs;
|
|
15
|
+
models: ModelChoice[];
|
|
16
|
+
connection: ProviderConnection;
|
|
17
|
+
catalog: OpenRouterModels | null;
|
|
18
|
+
task?: string;
|
|
19
|
+
preparation: {
|
|
20
|
+
command: string;
|
|
21
|
+
label: string;
|
|
22
|
+
evidence: string;
|
|
23
|
+
} | null;
|
|
24
|
+
instructions: {
|
|
25
|
+
installed: boolean;
|
|
26
|
+
message?: string;
|
|
27
|
+
};
|
|
28
|
+
}): string;
|
|
29
|
+
export declare function setupPreviewHtml(inputs: SetupInputs, fields: Record<string, string>): string;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ASSISTANTS } from "./setup-guide.js";
|
|
2
|
+
import { openRouterPicker } from "./openrouter-models.js";
|
|
3
|
+
const escape = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4
|
+
export function hiddenFields(values) {
|
|
5
|
+
return Object.entries(values).map(([name, value]) => `<input type="hidden" name="${escape(name)}" value="${escape(value)}">`).join("");
|
|
6
|
+
}
|
|
7
|
+
export function connectionWords(connection) {
|
|
8
|
+
return {
|
|
9
|
+
connected: "Connected", "signed-out": "Not signed in", "not-installed": "CLI not installed",
|
|
10
|
+
unverified: "Not verified", "key-present": "API key saved · not verified", "key-works": "API key works", "key-refused": "API key refused", "missing-key": "API key needed",
|
|
11
|
+
}[connection.state];
|
|
12
|
+
}
|
|
13
|
+
export function connectionHtml(provider, connection, task = "") {
|
|
14
|
+
const query = new URLSearchParams({ provider, ...(task ? { task } : {}) });
|
|
15
|
+
return `<div class="card assistant-account"><p><strong>${escape(ASSISTANTS[provider].name)} · ${connectionWords(connection)}</strong></p>` +
|
|
16
|
+
`<p class="meta">${[connection.email, connection.plan, connection.method].filter(Boolean).map(one => escape(one)).join(" · ")}</p>` +
|
|
17
|
+
`<p class="meta">Checked ${escape(new Date(connection.checkedAt).toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit", timeZoneName: "short" }))} on the computer running this console. Sign-in does not prove model access or remaining quota.</p>` +
|
|
18
|
+
`<a class="button-link" href="/control/connection?${escape(query.toString())}">${connection.state === "connected" ? "Manage connection" : "Connect account"}</a> · ` +
|
|
19
|
+
`<a href="/control?${escape(query.toString())}&check-connection=1">Check again</a></div>`;
|
|
20
|
+
}
|
|
21
|
+
export function controlSetupHtml(data) {
|
|
22
|
+
const { provider, inputs, task = "" } = data;
|
|
23
|
+
const query = new URLSearchParams({ provider, ...(task ? { task } : {}) });
|
|
24
|
+
const model = data.catalog !== null
|
|
25
|
+
? openRouterPicker(data.catalog, inputs.model || null, `/control?${query}&refresh-models=1`)
|
|
26
|
+
: `<label>Model<input type="text" name="model" value="${escape(inputs.model)}" list="setup-models" required autocomplete="off" placeholder="Exact model id or supported alias"></label>` +
|
|
27
|
+
`<datalist id="setup-models">${data.models.map(one => `<option value="${escape(one.value)}">${escape(one.label)}</option>`).join("")}</datalist>`;
|
|
28
|
+
return `<h1>Project setup</h1><p>${escape(data.repo)}</p>` +
|
|
29
|
+
`<p class="meta">Choose the default builder for new tasks and the preparation command for this project.</p>` +
|
|
30
|
+
`<nav class="assistant-picker row" aria-label="Choose provider">${Object.keys(ASSISTANTS).map(id => `<a class="button-link" href="/control?${escape(new URLSearchParams({ provider: id, ...(task ? { task } : {}) }).toString())}"${id === provider ? ' aria-current="page"' : ""}>${ASSISTANTS[id].name}</a>`).join(" ")}</nav>` +
|
|
31
|
+
connectionHtml(provider, data.connection, task) +
|
|
32
|
+
`<form method="post" action="/control/setup-preview" class="card">${hiddenFields({ csrf: data.csrf, repo: data.repo, provider, task })}` + model +
|
|
33
|
+
`<details class="setup-advanced"><summary>Project preparation</summary>` +
|
|
34
|
+
(data.preparation === null ? "" : `<p class="meta">Suggested from ${escape(data.preparation.evidence)}: ${escape(data.preparation.label)} — <code>${escape(data.preparation.command)}</code>. Review before approving.</p>`) +
|
|
35
|
+
`<label>Preparation command<textarea name="command" rows="2" maxlength="2000">${escape(inputs.command)}</textarea></label>` +
|
|
36
|
+
`<label>Preparation timeout in seconds<input name="seconds" type="number" min="1" max="3600" value="${escape(inputs.seconds)}" required></label>` +
|
|
37
|
+
`<p class="meta">Preparation applies to subsequent runs, including already approved tasks. Saving setup does not execute it.</p></details>` +
|
|
38
|
+
`<button type="submit">Review project setup</button></form>` +
|
|
39
|
+
`<section class="card"><h2>Agent instructions</h2>` +
|
|
40
|
+
(data.instructions.message ? `<p>${escape(data.instructions.message)}</p>` : data.instructions.installed ? `<p>Current Toolroll instructions are installed.</p>` :
|
|
41
|
+
`<p>Give the agent the project's Toolroll handoff instructions.</p><form method="post" action="/control/instructions-preview">${hiddenFields({ csrf: data.csrf, repo: data.repo })}<button>Review instructions</button></form>`) +
|
|
42
|
+
`</section><p><a href="/fleet">Configure planning, repair, and review agents</a> · <a href="/tasks/new">Describe a task</a></p>`;
|
|
43
|
+
}
|
|
44
|
+
export function setupPreviewHtml(inputs, fields) {
|
|
45
|
+
return `<h1>Approve project setup</h1><div class="card"><p>${escape(fields.repo ?? "")}</p>` +
|
|
46
|
+
`<p><strong>Builder:</strong> ${escape(inputs.provider)} · ${escape(inputs.model)}</p>` +
|
|
47
|
+
`<p><strong>Preparation:</strong></p><pre class="recap">${escape(inputs.command || "No preparation command")}</pre>` +
|
|
48
|
+
`<p>Preparation timeout: ${escape(inputs.seconds)} seconds.</p>` +
|
|
49
|
+
`<p>The builder default applies to new tasks. Preparation applies to subsequent runs, including already approved tasks. Existing signed task settings and verification rules remain in force.</p>` +
|
|
50
|
+
`<form method="post" action="/control/setup-approve">${hiddenFields({ ...fields, ...inputs })}` +
|
|
51
|
+
`<label>Your password<input type="password" name="token" autocomplete="current-password" required></label>` +
|
|
52
|
+
`<button>Approve project setup</button></form></div>`;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Service entry for CLI controllers; the engine remains the watch child. */
|
|
2
|
+
import { superviseController } from "./controller-supervisor.js";
|
|
3
|
+
const [file, ...argv] = process.argv.slice(2);
|
|
4
|
+
if (!file)
|
|
5
|
+
throw new Error("Controller service needs an executable.");
|
|
6
|
+
const stopping = new AbortController();
|
|
7
|
+
const stop = () => stopping.abort();
|
|
8
|
+
process.on("SIGTERM", stop);
|
|
9
|
+
process.on("SIGINT", stop);
|
|
10
|
+
try {
|
|
11
|
+
await superviseController({ file, argv, signal: stopping.signal, onState: state => {
|
|
12
|
+
if (state.phase === "backoff")
|
|
13
|
+
process.stderr.write(`Controller exited (${state.exit?.signal ?? state.exit?.code ?? "unknown"}); restart in ${state.retryMs} ms.\n`);
|
|
14
|
+
} });
|
|
15
|
+
}
|
|
16
|
+
finally {
|
|
17
|
+
process.off("SIGTERM", stop);
|
|
18
|
+
process.off("SIGINT", stop);
|
|
19
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type ControllerState = {
|
|
2
|
+
phase: "starting" | "running" | "backoff" | "stopped";
|
|
3
|
+
generation: number;
|
|
4
|
+
controllerPid: number | null;
|
|
5
|
+
exit?: {
|
|
6
|
+
code: number | null;
|
|
7
|
+
signal: NodeJS.Signals | null;
|
|
8
|
+
};
|
|
9
|
+
retryMs?: number;
|
|
10
|
+
};
|
|
11
|
+
/** A service process supervises exactly one controller. It knows nothing
|
|
12
|
+
* about tasks, credentials, claims, or retries: those remain in `up`.
|
|
13
|
+
*
|
|
14
|
+
* This closes a Node-controller crash without depending on launchd starting
|
|
15
|
+
* another process. It does not claim to survive its own SIGKILL or bypass an
|
|
16
|
+
* OS policy that defers a LaunchAgent. Children share the service's process
|
|
17
|
+
* group so launchd can also clean up the controller when this process dies.
|
|
18
|
+
*/
|
|
19
|
+
export declare function superviseController(args: {
|
|
20
|
+
file: string;
|
|
21
|
+
argv: readonly string[];
|
|
22
|
+
signal: AbortSignal;
|
|
23
|
+
cwd?: string;
|
|
24
|
+
env?: NodeJS.ProcessEnv;
|
|
25
|
+
onState?: (state: ControllerState) => void;
|
|
26
|
+
retryMs?: number;
|
|
27
|
+
maxRetryMs?: number;
|
|
28
|
+
stableMs?: number;
|
|
29
|
+
shutdownMs?: number;
|
|
30
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { performance } from "node:perf_hooks";
|
|
3
|
+
import { stopProcessTree } from "./process-tree.js";
|
|
4
|
+
/** A service process supervises exactly one controller. It knows nothing
|
|
5
|
+
* about tasks, credentials, claims, or retries: those remain in `up`.
|
|
6
|
+
*
|
|
7
|
+
* This closes a Node-controller crash without depending on launchd starting
|
|
8
|
+
* another process. It does not claim to survive its own SIGKILL or bypass an
|
|
9
|
+
* OS policy that defers a LaunchAgent. Children share the service's process
|
|
10
|
+
* group so launchd can also clean up the controller when this process dies.
|
|
11
|
+
*/
|
|
12
|
+
export async function superviseController(args) {
|
|
13
|
+
const retryMs = args.retryMs ?? 1_000;
|
|
14
|
+
const maxRetryMs = args.maxRetryMs ?? 30_000;
|
|
15
|
+
const stableMs = args.stableMs ?? 30_000;
|
|
16
|
+
const shutdownMs = args.shutdownMs ?? 45_000;
|
|
17
|
+
for (const value of [retryMs, maxRetryMs, stableMs, shutdownMs]) {
|
|
18
|
+
if (!Number.isSafeInteger(value) || value < 1 || value > 2_147_483_647)
|
|
19
|
+
throw new Error("Invalid controller supervision interval.");
|
|
20
|
+
}
|
|
21
|
+
if (maxRetryMs < retryMs)
|
|
22
|
+
throw new Error("Controller restart ceiling must cover its initial delay.");
|
|
23
|
+
let generation = 0;
|
|
24
|
+
let failures = 0;
|
|
25
|
+
let child = null;
|
|
26
|
+
let escalation = null;
|
|
27
|
+
const emit = (state) => {
|
|
28
|
+
// Telemetry cannot interrupt a graceful stop or orphan the owned child.
|
|
29
|
+
try {
|
|
30
|
+
args.onState?.(state);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
process.stderr.write("Controller supervisor could not record its status.\n");
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const stop = () => {
|
|
37
|
+
const owned = child;
|
|
38
|
+
if (owned === null || owned.exitCode !== null || owned.signalCode !== null)
|
|
39
|
+
return;
|
|
40
|
+
owned.kill("SIGTERM");
|
|
41
|
+
if (escalation !== null)
|
|
42
|
+
return;
|
|
43
|
+
escalation = setTimeout(() => {
|
|
44
|
+
// Signals come only from the still-owned ChildProcess, never status PIDs.
|
|
45
|
+
if (owned.exitCode === null && owned.signalCode === null && !stopProcessTree(owned))
|
|
46
|
+
owned.kill("SIGKILL");
|
|
47
|
+
}, shutdownMs);
|
|
48
|
+
};
|
|
49
|
+
args.signal.addEventListener("abort", stop);
|
|
50
|
+
try {
|
|
51
|
+
while (!args.signal.aborted) {
|
|
52
|
+
generation++;
|
|
53
|
+
const started = performance.now();
|
|
54
|
+
emit({ phase: "starting", generation, controllerPid: null });
|
|
55
|
+
// The callback above can synchronously cancel before the OS spawn.
|
|
56
|
+
if (args.signal.aborted)
|
|
57
|
+
break;
|
|
58
|
+
const exited = await new Promise(done => {
|
|
59
|
+
const owned = spawn(args.file, [...args.argv], {
|
|
60
|
+
...(args.cwd === undefined ? {} : { cwd: args.cwd }),
|
|
61
|
+
...(args.env === undefined ? {} : { env: args.env }),
|
|
62
|
+
stdio: "inherit",
|
|
63
|
+
windowsHide: true,
|
|
64
|
+
});
|
|
65
|
+
child = owned;
|
|
66
|
+
owned.once("spawn", () => {
|
|
67
|
+
emit({ phase: "running", generation, controllerPid: owned.pid ?? null });
|
|
68
|
+
if (args.signal.aborted)
|
|
69
|
+
stop();
|
|
70
|
+
});
|
|
71
|
+
// `close` follows both a spawn error and ordinary exit; await it so
|
|
72
|
+
// the next generation cannot overlap the previous controller handle.
|
|
73
|
+
owned.once("error", () => { });
|
|
74
|
+
owned.once("close", (code, signal) => done({ code, signal }));
|
|
75
|
+
if (args.signal.aborted)
|
|
76
|
+
stop();
|
|
77
|
+
});
|
|
78
|
+
child = null;
|
|
79
|
+
if (escalation !== null) {
|
|
80
|
+
clearTimeout(escalation);
|
|
81
|
+
escalation = null;
|
|
82
|
+
}
|
|
83
|
+
if (args.signal.aborted)
|
|
84
|
+
break;
|
|
85
|
+
failures = performance.now() - started >= stableMs ? 0 : Math.min(failures + 1, 20);
|
|
86
|
+
const delay = Math.min(maxRetryMs, retryMs * 2 ** Math.max(0, failures - 1));
|
|
87
|
+
emit({ phase: "backoff", generation, controllerPid: null, exit: exited, retryMs: delay });
|
|
88
|
+
await new Promise(done => {
|
|
89
|
+
let timer;
|
|
90
|
+
const finish = () => { clearTimeout(timer); args.signal.removeEventListener("abort", finish); done(); };
|
|
91
|
+
timer = setTimeout(finish, delay);
|
|
92
|
+
args.signal.addEventListener("abort", finish, { once: true });
|
|
93
|
+
if (args.signal.aborted)
|
|
94
|
+
finish();
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
finally {
|
|
99
|
+
args.signal.removeEventListener("abort", stop);
|
|
100
|
+
if (escalation !== null)
|
|
101
|
+
clearTimeout(escalation);
|
|
102
|
+
emit({ phase: "stopped", generation, controllerPid: null });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The converse engine (fleet chat v3) — a DIRECT no-tool API call.
|
|
3
|
+
*
|
|
4
|
+
* Chat never spawns a provider CLI: the boundary that matters (no tools,
|
|
5
|
+
* no filesystem, no inherited instructions, no hooks) is established by
|
|
6
|
+
* constructing the HTTP request ourselves and sending no tool surface at
|
|
7
|
+
* all. Zero dependencies — Node's fetch.
|
|
8
|
+
*
|
|
9
|
+
* Two-layer parsing, per the Codex v3 review (change 2): the PROVIDER
|
|
10
|
+
* WRAPPER (Anthropic / OpenRouter response JSON) is stream-capped,
|
|
11
|
+
* fatally UTF-8 decoded, and strictly parsed first — status, content
|
|
12
|
+
* type, exactly one textual assistant block, usage present, tool calls
|
|
13
|
+
* rejected. Only then is the extracted assistant text parsed AGAIN,
|
|
14
|
+
* independently, as the versioned chat envelope with model-only DTOs.
|
|
15
|
+
* Any violation at either layer yields a typed refusal and NO model text
|
|
16
|
+
* reaches a page (transport failures render a static line only).
|
|
17
|
+
*
|
|
18
|
+
* Money, per change 4: prices are PINNED here, versioned, in integer
|
|
19
|
+
* micro-dollars per token, rounded up. A model without a pinned price
|
|
20
|
+
* cannot be spoken to — the reservation math would be fiction.
|
|
21
|
+
*/
|
|
22
|
+
import { type AcceptanceCriterion } from "./scope.js";
|
|
23
|
+
import type { ChatProviderId, DirectChatProviderId, SubscriptionChatProviderId } from "./store.js";
|
|
24
|
+
export declare const WRAPPER_CAP_BYTES = 262144;
|
|
25
|
+
export declare const ENVELOPE_CAP_BYTES = 65536;
|
|
26
|
+
export declare const REPLY_CAP_BYTES = 32768;
|
|
27
|
+
export declare const MAX_PROPOSALS = 3;
|
|
28
|
+
export declare const MAX_DEPTH = 6;
|
|
29
|
+
export declare const MAX_OUTPUT_TOKENS = 2048;
|
|
30
|
+
export declare const TURN_WALL_CLOCK_MS = 120000;
|
|
31
|
+
export declare const PRICE_VERSION = 1;
|
|
32
|
+
export declare function priceOf(model: string): {
|
|
33
|
+
inMicrousd: number;
|
|
34
|
+
outMicrousd: number;
|
|
35
|
+
} | null;
|
|
36
|
+
/** For the config error message: what CAN be configured today. */
|
|
37
|
+
export declare const PRICED_MODELS: readonly string[];
|
|
38
|
+
export type ModelPrice = {
|
|
39
|
+
inMicrousd: number;
|
|
40
|
+
outMicrousd: number;
|
|
41
|
+
};
|
|
42
|
+
export type CatalogModel = {
|
|
43
|
+
id: string;
|
|
44
|
+
price: ModelPrice;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* OpenRouter's own model catalog — the authority on what OpenRouter
|
|
48
|
+
* bills, read live so every selectable model arrives WITH the price the
|
|
49
|
+
* config will pin. Models with dynamic or unparseable pricing (the auto
|
|
50
|
+
* router advertises -1) are excluded rather than guessed: spend that
|
|
51
|
+
* cannot be bounded up front cannot be reserved, so it cannot run.
|
|
52
|
+
*/
|
|
53
|
+
export declare function fetchOpenRouterCatalog(key: string, fetcher?: typeof fetch, signal?: AbortSignal): Promise<{
|
|
54
|
+
ok: true;
|
|
55
|
+
models: CatalogModel[];
|
|
56
|
+
} | {
|
|
57
|
+
ok: false;
|
|
58
|
+
problem: string;
|
|
59
|
+
}>;
|
|
60
|
+
/** The price a configured chat actually runs on: the pin when present,
|
|
61
|
+
* the compiled table for pre-v13b rows, nothing otherwise. */
|
|
62
|
+
export declare function priceForConfig(config: {
|
|
63
|
+
model: string;
|
|
64
|
+
priceInMicrousd: number | null;
|
|
65
|
+
priceOutMicrousd: number | null;
|
|
66
|
+
}): ModelPrice | null;
|
|
67
|
+
export declare function worstCaseForPrice(price: ModelPrice, promptBytes: number): number;
|
|
68
|
+
export declare function settleForPrice(price: ModelPrice, tokensIn: number, tokensOut: number): number;
|
|
69
|
+
/** The worst a turn can cost, in integer micro-dollars: every prompt byte
|
|
70
|
+
* as a token-third (generous) plus the full output allowance. */
|
|
71
|
+
export declare function worstCaseMicrousd(model: string, promptBytes: number): number | null;
|
|
72
|
+
export declare function settleMicrousd(model: string, tokensIn: number, tokensOut: number): number | null;
|
|
73
|
+
export declare const DIRECT_CHAT_PROVIDERS: readonly DirectChatProviderId[];
|
|
74
|
+
export declare const SUBSCRIPTION_CHAT_PROVIDERS: readonly SubscriptionChatProviderId[];
|
|
75
|
+
export declare function isDirectChatProvider(provider: ChatProviderId): provider is DirectChatProviderId;
|
|
76
|
+
export declare function isSubscriptionChatProvider(provider: ChatProviderId): provider is SubscriptionChatProviderId;
|
|
77
|
+
export declare const CHAT_KEY_ENV: Record<DirectChatProviderId, string>;
|
|
78
|
+
/** Domain-separated, full-width, non-secret accounting identity for a
|
|
79
|
+
* credential (v3 open question 1: eight hex chars was refused). */
|
|
80
|
+
export declare function credentialKeyOf(provider: ChatProviderId, key: string): string;
|
|
81
|
+
/** Subscription usage has no API credential to fingerprint. The provider
|
|
82
|
+
* identity is sufficient because dollar latches do not apply to zero-cost
|
|
83
|
+
* ledger rows, while switching harnesses still invalidates a live session. */
|
|
84
|
+
export declare function subscriptionCredentialKey(provider: SubscriptionChatProviderId): string;
|
|
85
|
+
export declare function plausibleChatKey(provider: DirectChatProviderId, key: string): boolean;
|
|
86
|
+
export type StrictParse = {
|
|
87
|
+
ok: true;
|
|
88
|
+
value: unknown;
|
|
89
|
+
} | {
|
|
90
|
+
ok: false;
|
|
91
|
+
problem: string;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* JSON.parse with the two properties it lacks: duplicate keys REJECTED at
|
|
95
|
+
* every nesting level, and depth bounded. The scanner walks the text
|
|
96
|
+
* once; JSON.parse then supplies the value only if the scan held.
|
|
97
|
+
*/
|
|
98
|
+
export declare function strictJsonParse(bytes: Buffer, maxBytes: number, maxDepth?: number): StrictParse;
|
|
99
|
+
/** What the MODEL may say and nothing more (v3 change 3): opaque repoId,
|
|
100
|
+
* no provenance, no ceiling, no approval-shaped anything. */
|
|
101
|
+
export type ChatTaskDraft = {
|
|
102
|
+
kind: "task";
|
|
103
|
+
repoId: string;
|
|
104
|
+
title: string;
|
|
105
|
+
goal: string;
|
|
106
|
+
outOfScope: string | null;
|
|
107
|
+
touches: string[];
|
|
108
|
+
/** v39: the signed rubric — mandatory, like every other scope-producing
|
|
109
|
+
* road. The model drafts it; the operator still confirms with a
|
|
110
|
+
* password before it becomes a real, unapproved scope. */
|
|
111
|
+
acceptance: AcceptanceCriterion[];
|
|
112
|
+
};
|
|
113
|
+
export type ChatRoutineDraft = {
|
|
114
|
+
kind: "routine";
|
|
115
|
+
repoId: string;
|
|
116
|
+
name: string;
|
|
117
|
+
goal: string;
|
|
118
|
+
outOfScope: string | null;
|
|
119
|
+
touches: string[];
|
|
120
|
+
acceptance: AcceptanceCriterion[];
|
|
121
|
+
schedule: string;
|
|
122
|
+
};
|
|
123
|
+
export type ChatDraft = ChatTaskDraft | ChatRoutineDraft;
|
|
124
|
+
export type ParsedEnvelope = {
|
|
125
|
+
reply: string;
|
|
126
|
+
proposals: ChatDraft[];
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* The assistant envelope: exactly {chatEnvelope: 1, reply, proposals}.
|
|
130
|
+
* ANY violation — including one bad proposal — discards the whole batch;
|
|
131
|
+
* a bad proposal additionally keeps the (valid, escaped-elsewhere) reply,
|
|
132
|
+
* per the ruled atomicity: reply may render, proposals are all-or-nothing.
|
|
133
|
+
*/
|
|
134
|
+
export declare function parseAssistantEnvelope(text: string): {
|
|
135
|
+
ok: true;
|
|
136
|
+
envelope: ParsedEnvelope;
|
|
137
|
+
proposalsDiscarded: boolean;
|
|
138
|
+
} | {
|
|
139
|
+
ok: false;
|
|
140
|
+
problem: string;
|
|
141
|
+
};
|
|
142
|
+
export type ProviderAnswer = {
|
|
143
|
+
text: string;
|
|
144
|
+
tokensIn: number;
|
|
145
|
+
tokensOut: number;
|
|
146
|
+
/** OpenRouter reports the actual charge; settlement takes the HIGHER of
|
|
147
|
+
* this and the pinned math — the ledger never undercounts. */
|
|
148
|
+
reportedCostMicrousd: number | null;
|
|
149
|
+
};
|
|
150
|
+
/** Strict parse of the PROVIDER response body (layer one). */
|
|
151
|
+
/** A token count is a non-negative safe integer under a billion (mate arc,
|
|
152
|
+
* ruling 14): a negative, fractional, or absurd usage is a malformed reply,
|
|
153
|
+
* never a discount on the pinned settlement. */
|
|
154
|
+
export declare function tokenCount(value: number): boolean;
|
|
155
|
+
export declare const MATE_MAX_STEPS = 8;
|
|
156
|
+
export declare const MATE_MAX_CALLS_PER_STEP = 4;
|
|
157
|
+
/** A tool result, measured AS EMBEDDED — the JSON-encoded string, escapes included. */
|
|
158
|
+
export declare const MATE_TOOL_RESULT_CAP_BYTES = 16384;
|
|
159
|
+
/** A tool call, measured as the serialized `{id, name, args}` — the id counts. */
|
|
160
|
+
export declare const MATE_TOOL_CALL_CAP_BYTES = 2048;
|
|
161
|
+
export declare const MATE_TOOL_CALL_ID_CAP_BYTES = 64;
|
|
162
|
+
/** One step's assistant text; over it the reply is malformed (review finding 7). */
|
|
163
|
+
export declare const MATE_STEP_TEXT_CAP_BYTES = 8192;
|
|
164
|
+
/**
|
|
165
|
+
* The triangular worst case (mate arc, ruling 6; slice-1 review finding 7):
|
|
166
|
+
* request s carries the base prompt plus every earlier step's calls,
|
|
167
|
+
* results, and assistant text. Calls and results are measured as
|
|
168
|
+
* embedded and may be JSON-escaped ONCE more on the wire (OpenRouter
|
|
169
|
+
* serializes arguments twice; a result string re-escapes inside the
|
|
170
|
+
* body), so each is budgeted at twice its cap — escaping at most doubles
|
|
171
|
+
* a string. Each step may answer with the full output allowance.
|
|
172
|
+
*/
|
|
173
|
+
export declare function mateWorstCaseForPrice(price: ModelPrice, baseBytes: number, caps?: {
|
|
174
|
+
steps?: number;
|
|
175
|
+
callsPerStep?: number;
|
|
176
|
+
resultCap?: number;
|
|
177
|
+
callCap?: number;
|
|
178
|
+
textCap?: number;
|
|
179
|
+
}): number;
|
|
180
|
+
/** The bytes a tool result costs on the wire: its JSON string form. */
|
|
181
|
+
export declare function embeddedBytes(text: string): number;
|
|
182
|
+
export type MateToolSchema = {
|
|
183
|
+
name: string;
|
|
184
|
+
description: string;
|
|
185
|
+
inputSchema: Record<string, unknown>;
|
|
186
|
+
};
|
|
187
|
+
export type MateToolCall = {
|
|
188
|
+
id: string;
|
|
189
|
+
name: string;
|
|
190
|
+
args: Record<string, unknown>;
|
|
191
|
+
};
|
|
192
|
+
/** A provider answer with tool calls allowed: text, calls, usage. */
|
|
193
|
+
export type MateProviderAnswer = {
|
|
194
|
+
text: string;
|
|
195
|
+
calls: MateToolCall[];
|
|
196
|
+
tokensIn: number;
|
|
197
|
+
tokensOut: number;
|
|
198
|
+
reportedCostMicrousd: number | null;
|
|
199
|
+
};
|
|
200
|
+
/** One message of the mate's own history, provider-neutral. */
|
|
201
|
+
export type MateHistoryMessage = {
|
|
202
|
+
role: "operator";
|
|
203
|
+
text: string;
|
|
204
|
+
} | {
|
|
205
|
+
role: "assistant";
|
|
206
|
+
text: string;
|
|
207
|
+
calls: MateToolCall[];
|
|
208
|
+
} | {
|
|
209
|
+
role: "tool";
|
|
210
|
+
callId: string;
|
|
211
|
+
name: string;
|
|
212
|
+
result: string;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* The tool-capable wrapper parser (mate arc). Same caps and the same
|
|
216
|
+
* duplicate-key lexer as fleet chat's; tool calls are read, bounded (at
|
|
217
|
+
* most M per answer, each argument object under the call cap), and
|
|
218
|
+
* anything else about the shape is malformed.
|
|
219
|
+
*/
|
|
220
|
+
export declare function parseMateProviderWrapper(provider: DirectChatProviderId, bytes: Buffer): {
|
|
221
|
+
ok: true;
|
|
222
|
+
answer: MateProviderAnswer;
|
|
223
|
+
} | {
|
|
224
|
+
ok: false;
|
|
225
|
+
problem: string;
|
|
226
|
+
};
|
|
227
|
+
/** The mate's request: system contract, the data document as the first
|
|
228
|
+
* operator message, the history in provider-native shape, the tools. */
|
|
229
|
+
export declare function composeMateRequest(args: {
|
|
230
|
+
provider: DirectChatProviderId;
|
|
231
|
+
model: string;
|
|
232
|
+
key: string;
|
|
233
|
+
system: string;
|
|
234
|
+
dataDocument: string;
|
|
235
|
+
history: readonly MateHistoryMessage[];
|
|
236
|
+
tools: readonly MateToolSchema[];
|
|
237
|
+
}): {
|
|
238
|
+
url: string;
|
|
239
|
+
headers: Record<string, string>;
|
|
240
|
+
body: string;
|
|
241
|
+
};
|
|
242
|
+
/** The mate's network call: the same transport posture as fleet chat's, the tool-capable parser at the end. */
|
|
243
|
+
export declare function performMateRequest(request: {
|
|
244
|
+
url: string;
|
|
245
|
+
headers: Record<string, string>;
|
|
246
|
+
body: string;
|
|
247
|
+
}, provider: DirectChatProviderId, signal: AbortSignal, fetcher?: typeof fetch): Promise<{
|
|
248
|
+
ok: true;
|
|
249
|
+
answer: MateProviderAnswer;
|
|
250
|
+
} | {
|
|
251
|
+
ok: false;
|
|
252
|
+
problem: string;
|
|
253
|
+
}>;
|
|
254
|
+
export declare function parseProviderWrapper(provider: DirectChatProviderId, bytes: Buffer): {
|
|
255
|
+
ok: true;
|
|
256
|
+
answer: ProviderAnswer;
|
|
257
|
+
} | {
|
|
258
|
+
ok: false;
|
|
259
|
+
problem: string;
|
|
260
|
+
};
|
|
261
|
+
export declare const DATA_DOCUMENT_BUDGET_BYTES = 24576;
|
|
262
|
+
/**
|
|
263
|
+
* The snapshot, serialized for the model: repos as opaque ids only (no
|
|
264
|
+
* paths, no basenames — change 9), items shed WHOLE (never fields) until
|
|
265
|
+
* the byte budget holds, and every shed declared in-band so a trimmed
|
|
266
|
+
* list can never read as a complete one.
|
|
267
|
+
*/
|
|
268
|
+
export declare function buildDataDocument(snapshot: import("./store.js").ChatSnapshot, budgetBytes?: number): {
|
|
269
|
+
document: string;
|
|
270
|
+
shed: number;
|
|
271
|
+
};
|
|
272
|
+
export declare function composeRequest(args: {
|
|
273
|
+
provider: DirectChatProviderId;
|
|
274
|
+
model: string;
|
|
275
|
+
key: string;
|
|
276
|
+
dataDocument: string;
|
|
277
|
+
userMessage: string;
|
|
278
|
+
}): {
|
|
279
|
+
url: string;
|
|
280
|
+
headers: Record<string, string>;
|
|
281
|
+
body: string;
|
|
282
|
+
};
|
|
283
|
+
/** Read a response body with the cap enforced WHILE streaming (v2 new
|
|
284
|
+
* finding 8): one byte over the cap aborts the read, not the memory. */
|
|
285
|
+
export declare function readCappedBody(response: Response, cap: number): Promise<Buffer | null>;
|
|
286
|
+
/**
|
|
287
|
+
* The one network call a turn may make. The caller owns the CAS that
|
|
288
|
+
* makes it at-most-once; this owns the transport posture: no redirects,
|
|
289
|
+
* wall clock, streamed cap, wrapper strictness.
|
|
290
|
+
*/
|
|
291
|
+
export declare function performChatRequest(args: {
|
|
292
|
+
provider: DirectChatProviderId;
|
|
293
|
+
model: string;
|
|
294
|
+
key: string;
|
|
295
|
+
dataDocument: string;
|
|
296
|
+
userMessage: string;
|
|
297
|
+
signal: AbortSignal;
|
|
298
|
+
}, fetcher?: typeof fetch): Promise<{
|
|
299
|
+
ok: true;
|
|
300
|
+
answer: ProviderAnswer;
|
|
301
|
+
} | {
|
|
302
|
+
ok: false;
|
|
303
|
+
problem: string;
|
|
304
|
+
}>;
|