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,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project scripts (v84): a library of reusable steps that run with no AI.
|
|
3
|
+
* A script is named — "run-tests", "enrich-lead", "export-orders" — and
|
|
4
|
+
* made on a flow's Scripts panel or drafted by the lead in chat. v90: it is
|
|
5
|
+
* written in shell, Python or Node, or runs a file already in the project.
|
|
6
|
+
* Any flow in the project uses it by name from a "Run a script" zone (and a
|
|
7
|
+
* schedule can run one to make cards), so one script can be improved once
|
|
8
|
+
* for every flow, and the insights show how each script does across them.
|
|
9
|
+
* Each save is a new version; runs record which ran.
|
|
10
|
+
*/
|
|
11
|
+
import { createHash } from "node:crypto";
|
|
12
|
+
import { scanForSecrets } from "./evidence.js";
|
|
13
|
+
import { flowDefinitionOf } from "./flow-engine.js";
|
|
14
|
+
import { SCRIPT_LANGUAGES, SCRIPT_NAME } from "./flows.js";
|
|
15
|
+
/** A script as it would be saved, checked in plain words. Throws. */
|
|
16
|
+
export function validateScript(input) {
|
|
17
|
+
const name = typeof input.name === "string" ? input.name.trim().toLowerCase() : "";
|
|
18
|
+
if (!SCRIPT_NAME.test(name))
|
|
19
|
+
throw new Error("Name the script in lowercase letters, numbers and dashes, like run-tests.");
|
|
20
|
+
const about = typeof input.about === "string" ? input.about.replace(/\s+/g, " ").trim() : "";
|
|
21
|
+
if (about === "" || about.length > 160)
|
|
22
|
+
throw new Error("Say in one line what the script checks or does.");
|
|
23
|
+
const language = input.language === undefined || input.language === null || input.language === "" ? "shell" : input.language;
|
|
24
|
+
if (!SCRIPT_LANGUAGES.includes(language))
|
|
25
|
+
throw new Error("Choose the script's language: shell, Python or Node.");
|
|
26
|
+
const file = typeof input.file === "string" && input.file.trim() !== "" ? input.file.trim().replace(/^\.\//, "") : null;
|
|
27
|
+
if (file !== null && (file.length > 200 || file.startsWith("/") || file.split(/[\\/]/).includes("..") || !/^[A-Za-z0-9._/@+-]+$/.test(file)))
|
|
28
|
+
throw new Error("Give the file as a path inside the project, like scripts/enrich.py.");
|
|
29
|
+
const body = typeof input.body === "string" ? input.body.replace(/\r\n/g, "\n").trim() : "";
|
|
30
|
+
if (body === "" && file === null)
|
|
31
|
+
throw new Error("Write the script, or name a file in the project for it to run.");
|
|
32
|
+
if (body !== "" && file !== null)
|
|
33
|
+
throw new Error("A script either is written here or runs a file in the project, not both.");
|
|
34
|
+
if (body.length > 20_000)
|
|
35
|
+
throw new Error("Keep a script under 20,000 characters.");
|
|
36
|
+
if (/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/.test(body))
|
|
37
|
+
throw new Error("The script has hidden characters in it.");
|
|
38
|
+
if (scanForSecrets(`${about}\n${body}`).length > 0)
|
|
39
|
+
throw new Error("That looks like a key or password. Keep secrets out of scripts; read them from the environment on this computer.");
|
|
40
|
+
const minutes = typeof input.timeoutMinutes === "number" && Number.isFinite(input.timeoutMinutes) ? Math.round(input.timeoutMinutes) : typeof input.timeoutMinutes === "string" && input.timeoutMinutes.trim() !== "" ? Number(input.timeoutMinutes) : 15;
|
|
41
|
+
if (!Number.isInteger(minutes) || minutes < 1 || minutes > 60)
|
|
42
|
+
throw new Error("A script may run for 1 to 60 minutes.");
|
|
43
|
+
return { name, about, body, timeoutMinutes: minutes, language: language, file };
|
|
44
|
+
}
|
|
45
|
+
/** What a run is held to. A shell script written here keeps its v84 digest. */
|
|
46
|
+
export const scriptDigest = (draft) => createHash("sha256").update((draft.language ?? "shell") === "shell" && (draft.file ?? null) === null ? `${draft.body}\0${draft.timeoutMinutes}` : `${draft.body}\0${draft.timeoutMinutes}\0${draft.language}\0${draft.file ?? ""}`).digest("hex").slice(0, 32);
|
|
47
|
+
/** Save a script (a new version when it exists). */
|
|
48
|
+
export function saveScript(store, repo, input, actor, now) {
|
|
49
|
+
let draft;
|
|
50
|
+
try {
|
|
51
|
+
draft = validateScript(input);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
return { ok: false, message: error instanceof Error ? error.message : "That script isn't valid." };
|
|
55
|
+
}
|
|
56
|
+
const current = store.flowScript(repo, draft.name);
|
|
57
|
+
if (current !== null && current.digest === scriptDigest(draft) && current.about === draft.about)
|
|
58
|
+
return { ok: true, said: "No changes to save.", version: current.version };
|
|
59
|
+
const version = store.saveFlowScript({ repo, ...draft, digest: scriptDigest(draft), by: actor }, now);
|
|
60
|
+
return { ok: true, said: current === null ? `Saved the ${draft.name} script. Any flow in this project can run it.` : `Saved version ${version} of ${draft.name}. Every flow that runs it uses this version from now on.`, version };
|
|
61
|
+
}
|
|
62
|
+
/** The flows and zones in a project that run each script. */
|
|
63
|
+
export function scriptUses(store, repo) {
|
|
64
|
+
const uses = new Map();
|
|
65
|
+
for (const flow of store.listFlows([repo]))
|
|
66
|
+
for (const stage of flowDefinitionOf(flow)?.stages ?? [])
|
|
67
|
+
if (stage.kind === "check" && stage.script !== null)
|
|
68
|
+
uses.set(stage.script, [...uses.get(stage.script) ?? [], { flow: flow.id, flowName: flow.name, zone: stage.title }]);
|
|
69
|
+
return uses;
|
|
70
|
+
}
|
|
71
|
+
export function scriptWords(script) {
|
|
72
|
+
return `${script.name} (version ${script.version}, up to ${script.timeoutMinutes} min): ${script.about}`;
|
|
73
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const SECRET_NAME: RegExp;
|
|
2
|
+
/** Any saved secret's value that shows up in output, replaced (a web response, a tool's answer, a script's output). */
|
|
3
|
+
export declare const scrubSecrets: (text: string, secrets: Record<string, string>) => string;
|
|
4
|
+
export declare function readFlowSecrets(dir: string | null, repo: string): Record<string, string>;
|
|
5
|
+
export declare function flowSecretNames(dir: string | null, repo: string): string[];
|
|
6
|
+
/** Set (or, with an empty value, remove) one of a project's secrets. Names are CAPITALS_AND_UNDERSCORES. */
|
|
7
|
+
export declare function setFlowSecret(dir: string, repo: string, name: string, value: string): {
|
|
8
|
+
ok: true;
|
|
9
|
+
said: string;
|
|
10
|
+
} | {
|
|
11
|
+
ok: false;
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A project's flow secrets (v87; v90 for scripts too): named values kept in
|
|
3
|
+
* a 0600 file beside the database, one file per project. Web requests use
|
|
4
|
+
* them in headers ({{secret.NAME}}), and code steps get the ones they name as
|
|
5
|
+
* environment variables. Their values never reach a card, a log or a page.
|
|
6
|
+
* Its own module, with nothing but the file system, so triggers and the step
|
|
7
|
+
* runners can read it without an import cycle.
|
|
8
|
+
*/
|
|
9
|
+
import { createHash } from "node:crypto";
|
|
10
|
+
import { chmodSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
11
|
+
import { join } from "node:path";
|
|
12
|
+
export const SECRET_NAME = /^[A-Z][A-Z0-9_]{0,39}$/;
|
|
13
|
+
const secretsFile = (dir, repo) => join(dir, "flow-secrets", `${createHash("sha256").update(repo).digest("hex").slice(0, 24)}.json`);
|
|
14
|
+
/** Any saved secret's value that shows up in output, replaced (a web response, a tool's answer, a script's output). */
|
|
15
|
+
export const scrubSecrets = (text, secrets) => Object.values(secrets).filter(value => value.length >= 6).reduce((out, value) => out.split(value).join("[secret]"), text);
|
|
16
|
+
export function readFlowSecrets(dir, repo) {
|
|
17
|
+
if (dir === null)
|
|
18
|
+
return {};
|
|
19
|
+
try {
|
|
20
|
+
return JSON.parse(readFileSync(secretsFile(dir, repo), "utf8"));
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function flowSecretNames(dir, repo) {
|
|
27
|
+
return Object.keys(readFlowSecrets(dir, repo)).sort();
|
|
28
|
+
}
|
|
29
|
+
/** Set (or, with an empty value, remove) one of a project's secrets. Names are CAPITALS_AND_UNDERSCORES. */
|
|
30
|
+
export function setFlowSecret(dir, repo, name, value) {
|
|
31
|
+
if (!SECRET_NAME.test(name))
|
|
32
|
+
return { ok: false, message: "Name the secret in capitals, like API_TOKEN." };
|
|
33
|
+
const secrets = readFlowSecrets(dir, repo);
|
|
34
|
+
const trimmed = value.trim();
|
|
35
|
+
if (trimmed === "")
|
|
36
|
+
delete secrets[name];
|
|
37
|
+
else if (trimmed.length > 4000 || /[\r\n]/.test(trimmed))
|
|
38
|
+
return { ok: false, message: "That doesn't look like a secret: keep it to one line." };
|
|
39
|
+
else
|
|
40
|
+
secrets[name] = trimmed;
|
|
41
|
+
mkdirSync(join(dir, "flow-secrets"), { recursive: true, mode: 0o700 });
|
|
42
|
+
writeFileSync(secretsFile(dir, repo), JSON.stringify(secrets), { mode: 0o600 });
|
|
43
|
+
chmodSync(secretsFile(dir, repo), 0o600);
|
|
44
|
+
return { ok: true, said: trimmed === "" ? `Removed ${name}.` : `Saved ${name}. Only this project's web requests and scripts that name it get it.` };
|
|
45
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type FlowSort, type FlowStage } from "./flows.js";
|
|
2
|
+
export declare const JEV_URL = "https://openrouter.ai/api/alpha/decisions";
|
|
3
|
+
export declare const JEV_MODEL = "~typesafe/jev-latest";
|
|
4
|
+
export type SortNoteAnswer = {
|
|
5
|
+
id: string;
|
|
6
|
+
question: string;
|
|
7
|
+
kind: "score" | "yes-no";
|
|
8
|
+
answer: string;
|
|
9
|
+
sure: number;
|
|
10
|
+
};
|
|
11
|
+
/** What a sort step decided, kept on its run (decision_json) and shown on the card. */
|
|
12
|
+
export type SortDecision = {
|
|
13
|
+
model: string;
|
|
14
|
+
/** The answer as the zone names it, and how sure Jev was (0–1). */
|
|
15
|
+
answer: string;
|
|
16
|
+
sure: number;
|
|
17
|
+
sureAt: number;
|
|
18
|
+
/** Sure enough to act alone, and where the card went (null: it waited in the zone). */
|
|
19
|
+
confident: boolean;
|
|
20
|
+
to: string | null;
|
|
21
|
+
/** Every answer's chance, by name. */
|
|
22
|
+
chances: Record<string, number>;
|
|
23
|
+
notes: SortNoteAnswer[];
|
|
24
|
+
cost: number | null;
|
|
25
|
+
ms: number;
|
|
26
|
+
};
|
|
27
|
+
export type SortCard = {
|
|
28
|
+
title: string;
|
|
29
|
+
description: string | null;
|
|
30
|
+
note: string | null;
|
|
31
|
+
outputs: Record<string, string>;
|
|
32
|
+
source: {
|
|
33
|
+
label: string;
|
|
34
|
+
} | null;
|
|
35
|
+
};
|
|
36
|
+
type Question = {
|
|
37
|
+
type: "choice";
|
|
38
|
+
instructions: string;
|
|
39
|
+
criteria: Record<string, string>;
|
|
40
|
+
} | {
|
|
41
|
+
type: "score";
|
|
42
|
+
instructions: string;
|
|
43
|
+
criteria: string[];
|
|
44
|
+
} | {
|
|
45
|
+
type: "noul";
|
|
46
|
+
instructions: string;
|
|
47
|
+
};
|
|
48
|
+
export type JevRequest = {
|
|
49
|
+
model: string;
|
|
50
|
+
state: Record<string, string>;
|
|
51
|
+
questions: Record<string, Question>;
|
|
52
|
+
};
|
|
53
|
+
/** What Jev reads: the card, where it came from, the latest note and what earlier zones reported — bounded, keys blanked. */
|
|
54
|
+
export declare function sortState(card: SortCard, earlier: readonly {
|
|
55
|
+
id: string;
|
|
56
|
+
title: string;
|
|
57
|
+
}[]): Record<string, string>;
|
|
58
|
+
/** The one request for a card: the zone's question over its answers, plus what it also notes. */
|
|
59
|
+
export declare function sortRequest(sort: FlowSort, state: Record<string, string>): JevRequest;
|
|
60
|
+
export type JevAsked = {
|
|
61
|
+
ok: true;
|
|
62
|
+
body: Record<string, unknown>;
|
|
63
|
+
ms: number;
|
|
64
|
+
} | {
|
|
65
|
+
ok: false;
|
|
66
|
+
said: string;
|
|
67
|
+
};
|
|
68
|
+
/** Ask Jev through OpenRouter. Trouble reaching it (or a refused key, or no credit) is a reason to try again, in words. */
|
|
69
|
+
export declare function askJev(fetcher: typeof fetch, key: string, request: JevRequest): Promise<JevAsked>;
|
|
70
|
+
/** Jev's answers, read back against the zone's own options only; anything else is a problem, never a route. */
|
|
71
|
+
export declare function readJevAnswers(stage: FlowStage, body: Record<string, unknown>, ms: number): SortDecision | {
|
|
72
|
+
problem: string;
|
|
73
|
+
};
|
|
74
|
+
/** The decision in one line, as the card and later zones read it ({{stage.<id>}}). */
|
|
75
|
+
export declare function sortWords(decision: SortDecision): string;
|
|
76
|
+
/** The run's log: every answer's chance and each note, for the Insights run view. */
|
|
77
|
+
export declare function sortLog(stage: FlowStage, decision: SortDecision): string;
|
|
78
|
+
/** A kept decision, or null when there is none or it can't be read. */
|
|
79
|
+
export declare function parseSortDecision(json: string | null): SortDecision | null;
|
|
80
|
+
/** A card's chip on the canvas: the answer and how sure, and the first score's short level. */
|
|
81
|
+
export declare function sortChip(decision: SortDecision): string;
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sort steps (v85): Jev, TypeSafe's decision model, reached through
|
|
3
|
+
* OpenRouter's Decisions API with the operator's own OpenRouter key. One
|
|
4
|
+
* request per card: the card is the `state`; the zone's question is a
|
|
5
|
+
* choice over its answers, and each thing the zone also notes is a score
|
|
6
|
+
* or a yes/no question in the same request. Jev answers in well under a
|
|
7
|
+
* second, with how sure it is. It never writes text, so nothing it returns
|
|
8
|
+
* is instructions: an answer is only ever one of the zone's own options.
|
|
9
|
+
*/
|
|
10
|
+
import { redactSecretLines, scanForSecrets } from "./evidence.js";
|
|
11
|
+
import { sortKeyOf } from "./flows.js";
|
|
12
|
+
export const JEV_URL = "https://openrouter.ai/api/alpha/decisions";
|
|
13
|
+
export const JEV_MODEL = "~typesafe/jev-latest";
|
|
14
|
+
/** Jev reads up to 32,000 tokens; the card is kept well under that. */
|
|
15
|
+
const STATE_CHARS = 40_000;
|
|
16
|
+
const clip = (text, cap) => text.length <= cap ? text : `${text.slice(0, cap - 1)}…`;
|
|
17
|
+
/** Key-shaped lines never leave the machine. */
|
|
18
|
+
const blank = (text) => redactSecretLines(text, scanForSecrets(text));
|
|
19
|
+
/** What Jev reads: the card, where it came from, the latest note and what earlier zones reported — bounded, keys blanked. */
|
|
20
|
+
export function sortState(card, earlier) {
|
|
21
|
+
const state = { title: blank(clip(card.title, 500)) };
|
|
22
|
+
if (card.description !== null && card.description.trim() !== "")
|
|
23
|
+
state["details"] = blank(clip(card.description, 20_000));
|
|
24
|
+
if (card.source !== null)
|
|
25
|
+
state["came_from"] = clip(card.source.label, 200);
|
|
26
|
+
if (card.note !== null && card.note.trim() !== "")
|
|
27
|
+
state["latest_note"] = blank(clip(card.note, 2000));
|
|
28
|
+
let room = STATE_CHARS - Object.values(state).reduce((sum, one) => sum + one.length, 0);
|
|
29
|
+
for (const zone of earlier) {
|
|
30
|
+
const said = card.outputs[zone.id];
|
|
31
|
+
if (said === undefined || said.trim() === "" || room < 200)
|
|
32
|
+
continue;
|
|
33
|
+
const kept = blank(clip(said, Math.min(8000, room)));
|
|
34
|
+
state[`notes_from_${zone.id.replace(/-/g, "_")}`] = kept;
|
|
35
|
+
room -= kept.length;
|
|
36
|
+
}
|
|
37
|
+
return state;
|
|
38
|
+
}
|
|
39
|
+
/** The one request for a card: the zone's question over its answers, plus what it also notes. */
|
|
40
|
+
export function sortRequest(sort, state) {
|
|
41
|
+
const questions = {
|
|
42
|
+
route: { type: "choice", instructions: `${sort.question} Read the card's title and details.`, criteria: Object.fromEntries(sort.answers.map(one => [sortKeyOf(one.answer), one.means])) },
|
|
43
|
+
};
|
|
44
|
+
for (const note of sort.notes) {
|
|
45
|
+
questions[`note_${note.id.replace(/-/g, "_")}`] = note.kind === "score" && note.levels !== null
|
|
46
|
+
? { type: "score", instructions: note.question, criteria: note.levels }
|
|
47
|
+
: { type: "noul", instructions: note.question };
|
|
48
|
+
}
|
|
49
|
+
return { model: JEV_MODEL, state, questions };
|
|
50
|
+
}
|
|
51
|
+
/** Ask Jev through OpenRouter. Trouble reaching it (or a refused key, or no credit) is a reason to try again, in words. */
|
|
52
|
+
export async function askJev(fetcher, key, request) {
|
|
53
|
+
const started = Date.now();
|
|
54
|
+
let response;
|
|
55
|
+
try {
|
|
56
|
+
response = await fetcher(JEV_URL, {
|
|
57
|
+
method: "POST",
|
|
58
|
+
headers: { authorization: `Bearer ${key}`, "content-type": "application/json", "x-title": "Toolroll" },
|
|
59
|
+
body: JSON.stringify(request), signal: AbortSignal.timeout(20_000),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return { ok: false, said: "Couldn't reach OpenRouter." };
|
|
64
|
+
}
|
|
65
|
+
let body = {};
|
|
66
|
+
try {
|
|
67
|
+
body = await response.json();
|
|
68
|
+
}
|
|
69
|
+
catch { /* said below */ }
|
|
70
|
+
if (!response.ok) {
|
|
71
|
+
const error = body["error"];
|
|
72
|
+
const detail = typeof error?.message === "string" ? ` It said: ${clip(error.message.replace(/\s+/g, " "), 160)}` : "";
|
|
73
|
+
const said = response.status === 401 || response.status === 403 ? "OpenRouter didn't accept the key. Check it in Settings → AI providers."
|
|
74
|
+
: response.status === 402 ? "OpenRouter says the account is out of credit."
|
|
75
|
+
: response.status === 404 ? "OpenRouter couldn't find Jev for this key."
|
|
76
|
+
: response.status === 429 ? "OpenRouter asked us to slow down."
|
|
77
|
+
: `OpenRouter answered with an error (${response.status}).`;
|
|
78
|
+
return { ok: false, said: `${said}${detail}` };
|
|
79
|
+
}
|
|
80
|
+
return { ok: true, body, ms: Date.now() - started };
|
|
81
|
+
}
|
|
82
|
+
const shortLevel = (level) => level.split(":")[0].trim();
|
|
83
|
+
/** Jev's answers, read back against the zone's own options only; anything else is a problem, never a route. */
|
|
84
|
+
export function readJevAnswers(stage, body, ms) {
|
|
85
|
+
const sort = stage.sort;
|
|
86
|
+
const answers = body["answers"];
|
|
87
|
+
const route = answers?.["route"];
|
|
88
|
+
if (route === undefined || typeof route["choice"] !== "string")
|
|
89
|
+
return { problem: "Jev's answer didn't say which way to go." };
|
|
90
|
+
const picked = sort.answers.find(one => sortKeyOf(one.answer) === route["choice"]);
|
|
91
|
+
if (picked === undefined)
|
|
92
|
+
return { problem: "Jev picked an answer this zone doesn't have." };
|
|
93
|
+
const number = (value) => typeof value === "number" && Number.isFinite(value) ? Math.min(1, Math.max(0, value)) : 0;
|
|
94
|
+
const sure = number(route["confidence"]);
|
|
95
|
+
const probabilities = (route["probabilities"] ?? {});
|
|
96
|
+
const chances = Object.fromEntries(sort.answers.map(one => [one.answer, Math.round(number(probabilities[sortKeyOf(one.answer)]) * 100) / 100]));
|
|
97
|
+
const notes = [];
|
|
98
|
+
for (const note of sort.notes) {
|
|
99
|
+
const said = answers?.[`note_${note.id.replace(/-/g, "_")}`];
|
|
100
|
+
if (said === undefined)
|
|
101
|
+
continue;
|
|
102
|
+
if (note.kind === "score" && note.levels !== null && typeof said["score"] === "number") {
|
|
103
|
+
const level = note.levels[Math.min(note.levels.length - 1, Math.max(0, Math.round(said["score"])))];
|
|
104
|
+
notes.push({ id: note.id, question: note.question, kind: "score", answer: level, sure: Math.round(number(said["confidence"]) * 100) / 100 });
|
|
105
|
+
}
|
|
106
|
+
else if (typeof said["noul"] === "number") {
|
|
107
|
+
const yes = number(said["noul"]);
|
|
108
|
+
notes.push({ id: note.id, question: note.question, kind: "yes-no", answer: yes >= 0.5 ? "yes" : "no", sure: Math.round(Math.max(yes, 1 - yes) * 100) / 100 });
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const confident = sure >= sort.sureAt;
|
|
112
|
+
const usage = body["usage"];
|
|
113
|
+
return {
|
|
114
|
+
model: typeof body["model"] === "string" ? body["model"] : JEV_MODEL,
|
|
115
|
+
answer: picked.answer, sure: Math.round(sure * 100) / 100, sureAt: sort.sureAt,
|
|
116
|
+
confident, to: confident ? picked.to : stage.onFail, chances, notes,
|
|
117
|
+
cost: typeof usage?.cost === "number" ? usage.cost : null, ms,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const percent = (value) => `${Math.round(value * 100)}%`;
|
|
121
|
+
/** The decision in one line, as the card and later zones read it ({{stage.<id>}}). */
|
|
122
|
+
export function sortWords(decision) {
|
|
123
|
+
const lead = decision.confident ? `${decision.answer}, ${percent(decision.sure)} sure.` : `Not sure: ${percent(decision.sure)} ${decision.answer}.`;
|
|
124
|
+
const notes = decision.notes.map(one => one.kind === "score" ? `${one.question} ${shortLevel(one.answer)}.` : `${one.question} ${one.answer === "yes" ? "Yes" : "No"}.`);
|
|
125
|
+
return [lead, ...notes].join(" ");
|
|
126
|
+
}
|
|
127
|
+
/** The run's log: every answer's chance and each note, for the Insights run view. */
|
|
128
|
+
export function sortLog(stage, decision) {
|
|
129
|
+
const lines = [`Jev (${decision.model}) · ${decision.ms} ms${decision.cost === null ? "" : ` · $${decision.cost.toFixed(6)}`}`, "", stage.sort.question];
|
|
130
|
+
for (const [answer, chance] of Object.entries(decision.chances).sort((a, b) => b[1] - a[1]))
|
|
131
|
+
lines.push(` ${answer.padEnd(24)} ${percent(chance).padStart(4)}${answer === decision.answer ? " ← picked" : ""}`);
|
|
132
|
+
lines.push(` Sure: ${percent(decision.sure)} (acts alone from ${percent(decision.sureAt)})`);
|
|
133
|
+
for (const note of decision.notes)
|
|
134
|
+
lines.push("", note.question, ` ${note.answer} (${percent(note.sure)} sure)`);
|
|
135
|
+
return lines.join("\n");
|
|
136
|
+
}
|
|
137
|
+
/** A kept decision, or null when there is none or it can't be read. */
|
|
138
|
+
export function parseSortDecision(json) {
|
|
139
|
+
if (json === null)
|
|
140
|
+
return null;
|
|
141
|
+
try {
|
|
142
|
+
const value = JSON.parse(json);
|
|
143
|
+
return typeof value.answer === "string" && typeof value.sure === "number" ? value : null;
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/** A card's chip on the canvas: the answer and how sure, and the first score's short level. */
|
|
150
|
+
export function sortChip(decision) {
|
|
151
|
+
const score = decision.notes.find(one => one.kind === "score");
|
|
152
|
+
return [`${decision.answer} · ${percent(decision.sure)}`, ...(score === undefined ? [] : [shortLevel(score.answer)])].join(" · ");
|
|
153
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Runner } from "./backend.js";
|
|
2
|
+
import { type DraftRunner } from "./flow-draft.js";
|
|
3
|
+
import { type MailSender, type ToolCaller } from "./flow-actions.js";
|
|
4
|
+
import type { Store } from "./store.js";
|
|
5
|
+
import type { TurnRunner } from "./teammates.js";
|
|
6
|
+
import type { ToolLister } from "./teammate-tools.js";
|
|
7
|
+
export type StepIo = {
|
|
8
|
+
/** `gh` for GitHub; git and the check's shell, both without a model. */
|
|
9
|
+
gh: Runner;
|
|
10
|
+
git: Runner;
|
|
11
|
+
shell: Runner;
|
|
12
|
+
fetch: typeof fetch;
|
|
13
|
+
/** Beside the database: the Linear key. */
|
|
14
|
+
dir: string | null;
|
|
15
|
+
/** Where temporary copies of a card's work are made. */
|
|
16
|
+
scratch: string;
|
|
17
|
+
evidenceRoot?: string;
|
|
18
|
+
/** The branch a card with no result yet is checked against. */
|
|
19
|
+
base: string;
|
|
20
|
+
/** The operator's OpenRouter key, for sort steps (default: the one stored in Settings → AI providers). */
|
|
21
|
+
openRouterKey?: () => string | null;
|
|
22
|
+
/** Writes a draft (default: Claude through this computer's sign-in, no tools). */
|
|
23
|
+
draft?: DraftRunner;
|
|
24
|
+
/** Sends an email (default: the mail server in Settings → Email). */
|
|
25
|
+
mail?: MailSender;
|
|
26
|
+
/** Calls a project tool (default: starts its MCP server, like its Test button). */
|
|
27
|
+
callTool?: ToolCaller;
|
|
28
|
+
/** Where the project tools' secrets live (default: this computer's home). */
|
|
29
|
+
toolHome?: string;
|
|
30
|
+
/** Takes a teammate's turn (default: Claude through this computer's sign-in, answering in its fixed shape). */
|
|
31
|
+
teammate?: TurnRunner;
|
|
32
|
+
/** Lists what a project tool offers a teammate (default: starts its MCP server and asks). */
|
|
33
|
+
listTools?: ToolLister;
|
|
34
|
+
};
|
|
35
|
+
export type StepPass = {
|
|
36
|
+
ran: number;
|
|
37
|
+
problems: string[];
|
|
38
|
+
};
|
|
39
|
+
/** Run every due check and update in one project, then move each card on. */
|
|
40
|
+
export declare function runFlowSteps(store: Store, repo: string, now: Date, io: StepIo): Promise<StepPass>;
|