toolroll 0.9.133 → 0.9.135
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/CHANGELOG.md +66 -0
- package/dist/acp-agents.js +1 -1
- package/dist/acp-check-repo-schema.js +52 -0
- package/dist/acp-check.js +1 -1
- package/dist/acp-client.js +3 -3
- package/dist/acp-inspect.js +2 -1
- package/dist/acp-providers-schema.js +1 -1
- package/dist/agent-detect.js +1 -1
- package/dist/agent-fence.js +4 -4
- package/dist/agent-handoff.js +11 -0
- package/dist/agent-thread/acp-chat.js +1 -0
- package/dist/agent-thread/acp-turn.js +4 -0
- package/dist/agent-thread/chat-credential.js +1 -0
- package/dist/agent-thread/chat-home.js +1 -0
- package/dist/agent-thread/chat-spend.js +7 -0
- package/dist/agent-thread/chat-tools.js +1 -0
- package/dist/agent-thread/chat-turn.js +4 -0
- package/dist/agent-thread/custody.js +1 -1
- package/dist/agent-thread/direct-host.js +13 -8
- package/dist/agent-thread/fence.js +2 -2
- package/dist/agent-thread/gemini-chat.js +1 -0
- package/dist/agent-thread/git-workspace.js +3 -3
- package/dist/agent-thread/guards.js +1 -1
- package/dist/agent-thread/openrouter-chat.js +1 -0
- package/dist/agent-thread/providers.js +3 -3
- package/dist/agent-thread/ship.js +2 -2
- package/dist/agentconfig.js +1 -1
- package/dist/agents-live.js +2 -2
- package/dist/approval-decision.js +1 -0
- package/dist/approval-password.js +1 -1
- package/dist/approval-summary.js +1 -1
- package/dist/assignment.js +1 -1
- package/dist/attest.js +1 -1
- package/dist/batch-checks.js +2 -2
- package/dist/boot-identity.js +1 -1
- package/dist/bounded-spawn.js +2 -2
- package/dist/brief-fence.js +3 -1
- package/dist/browser/{chunk-agents-live-view.6fd2938ef96a85a4127cddb99dbc700b3201c58351d9f07dbcd8a2f7d7dfef22.js → chunk-agents-live-view.9f4367c89c6366769a567e729ac9181ccaa898bf3a168d3dc618f3cface887c7.js} +5 -5
- package/dist/browser/chunk-agents-live-view.9f4367c89c6366769a567e729ac9181ccaa898bf3a168d3dc618f3cface887c7.js.br +0 -0
- package/dist/browser/chunk-agents-live-view.9f4367c89c6366769a567e729ac9181ccaa898bf3a168d3dc618f3cface887c7.js.gz +0 -0
- package/dist/browser/chunk-bundle.ac5952c82c76e2efcdcf5a097c4fa235d6f1045dcc36d02ee921ff4be976a46a.js +2 -0
- package/dist/browser/chunk-bundle.ac5952c82c76e2efcdcf5a097c4fa235d6f1045dcc36d02ee921ff4be976a46a.js.br +0 -0
- package/dist/browser/chunk-bundle.ac5952c82c76e2efcdcf5a097c4fa235d6f1045dcc36d02ee921ff4be976a46a.js.gz +0 -0
- package/dist/browser/chunk-chat-parts.2a0b0b723508c5c48379f6a3d441f07a18c8b91ed64fd018962931c5ae43331e.js +4 -0
- package/dist/browser/chunk-chat-parts.2a0b0b723508c5c48379f6a3d441f07a18c8b91ed64fd018962931c5ae43331e.js.br +0 -0
- package/dist/browser/chunk-chat-parts.2a0b0b723508c5c48379f6a3d441f07a18c8b91ed64fd018962931c5ae43331e.js.gz +0 -0
- package/dist/browser/chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js +116 -0
- package/dist/browser/chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js.br +0 -0
- package/dist/browser/chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js.gz +0 -0
- package/dist/browser/{chunk-flow-view.71a0a3360292445ab70d67253bb9003163bbb7b1b03f14d1892cca83debd9b2c.js → chunk-flow-view.f5d74c7f072b739a7a0ed86ff35cafa7b8a041233372d1eeaab9eb941ddfc11e.js} +7 -7
- package/dist/browser/chunk-flow-view.f5d74c7f072b739a7a0ed86ff35cafa7b8a041233372d1eeaab9eb941ddfc11e.js.br +0 -0
- package/dist/browser/chunk-flow-view.f5d74c7f072b739a7a0ed86ff35cafa7b8a041233372d1eeaab9eb941ddfc11e.js.gz +0 -0
- package/dist/browser/chunk-flows-extra-view.01ebf93780b729363eda11ba21c764fe593bcd3e684aa833c9b86147f780fd41.js +4 -0
- package/dist/browser/chunk-flows-extra-view.01ebf93780b729363eda11ba21c764fe593bcd3e684aa833c9b86147f780fd41.js.br +0 -0
- package/dist/browser/chunk-flows-extra-view.01ebf93780b729363eda11ba21c764fe593bcd3e684aa833c9b86147f780fd41.js.gz +0 -0
- package/dist/browser/chunk-pages-bundle.e18059f0cb4fbb63e3698971d4c1830ad0945c3645235babc93010cd0b725c1d.js +6 -0
- package/dist/browser/chunk-pages-bundle.e18059f0cb4fbb63e3698971d4c1830ad0945c3645235babc93010cd0b725c1d.js.br +0 -0
- package/dist/browser/chunk-pages-bundle.e18059f0cb4fbb63e3698971d4c1830ad0945c3645235babc93010cd0b725c1d.js.gz +0 -0
- package/dist/browser/chunk-result-view.fc6a6494b316aa786807b7d17035c59defae1bfb0c03bf9c3795679b3a35dd77.js +2 -0
- package/dist/browser/chunk-result-view.fc6a6494b316aa786807b7d17035c59defae1bfb0c03bf9c3795679b3a35dd77.js.br +0 -0
- package/dist/browser/chunk-result-view.fc6a6494b316aa786807b7d17035c59defae1bfb0c03bf9c3795679b3a35dd77.js.gz +0 -0
- package/dist/browser/chunk-settings-view.6dd3a64ded7bd8c047650270918dfb455c9a514a5a40b84c7eb5f443f76fe66f.js +20 -0
- package/dist/browser/chunk-settings-view.6dd3a64ded7bd8c047650270918dfb455c9a514a5a40b84c7eb5f443f76fe66f.js.br +0 -0
- package/dist/browser/chunk-settings-view.6dd3a64ded7bd8c047650270918dfb455c9a514a5a40b84c7eb5f443f76fe66f.js.gz +0 -0
- package/dist/browser/chunk-shared.02c0b692de21a9bb80d1761aa887d8532431171945c02e663884c9f45b796753.js +3 -0
- package/dist/browser/chunk-shared.02c0b692de21a9bb80d1761aa887d8532431171945c02e663884c9f45b796753.js.br +0 -0
- package/dist/browser/chunk-shared.02c0b692de21a9bb80d1761aa887d8532431171945c02e663884c9f45b796753.js.gz +0 -0
- package/dist/browser/chunk-shared.0874336833f8101a63b169d8c2e55ca0f281e43e65d4bd6604555c791ea9dd87.js +2 -0
- package/dist/browser/chunk-shared.0874336833f8101a63b169d8c2e55ca0f281e43e65d4bd6604555c791ea9dd87.js.br +0 -0
- package/dist/browser/chunk-shared.0874336833f8101a63b169d8c2e55ca0f281e43e65d4bd6604555c791ea9dd87.js.gz +0 -0
- package/dist/browser/chunk-shared.2413dd78f32995fbca67f51ac8c21baf4727cd64f185ea739aa2a058e569b0ed.js +2 -0
- package/dist/browser/chunk-shared.2413dd78f32995fbca67f51ac8c21baf4727cd64f185ea739aa2a058e569b0ed.js.br +0 -0
- package/dist/browser/chunk-shared.2413dd78f32995fbca67f51ac8c21baf4727cd64f185ea739aa2a058e569b0ed.js.gz +0 -0
- package/dist/browser/chunk-shared.26bb0114998968cccb7bae5f6ffa8979ddecfafd8bc18bb6985760f6bcc030e6.js +5 -0
- package/dist/browser/chunk-shared.26bb0114998968cccb7bae5f6ffa8979ddecfafd8bc18bb6985760f6bcc030e6.js.br +0 -0
- package/dist/browser/chunk-shared.26bb0114998968cccb7bae5f6ffa8979ddecfafd8bc18bb6985760f6bcc030e6.js.gz +0 -0
- package/dist/browser/chunk-shared.6d0b8728b3e309886cfb6eaf596d3f20592939e521bb60bb090824f34da6b086.js +2 -0
- package/dist/browser/chunk-shared.6d0b8728b3e309886cfb6eaf596d3f20592939e521bb60bb090824f34da6b086.js.br +0 -0
- package/dist/browser/chunk-shared.6d0b8728b3e309886cfb6eaf596d3f20592939e521bb60bb090824f34da6b086.js.gz +0 -0
- package/dist/browser/chunk-shared.c3e5be1c5f441e94905a4bc2005d816d2a0b0e4108bae43e37ec274a911c6847.js +2 -0
- package/dist/browser/chunk-shared.c3e5be1c5f441e94905a4bc2005d816d2a0b0e4108bae43e37ec274a911c6847.js.br +0 -0
- package/dist/browser/chunk-shared.c3e5be1c5f441e94905a4bc2005d816d2a0b0e4108bae43e37ec274a911c6847.js.gz +0 -0
- package/dist/browser/chunk-shared.d1f25785c8c168cc75aa99c4be8ca56abfc5eafa3490f8817ff15e61cb901915.js +2 -0
- package/dist/browser/chunk-shared.d1f25785c8c168cc75aa99c4be8ca56abfc5eafa3490f8817ff15e61cb901915.js.br +0 -0
- package/dist/browser/chunk-shared.d1f25785c8c168cc75aa99c4be8ca56abfc5eafa3490f8817ff15e61cb901915.js.gz +0 -0
- package/dist/browser/chunk-shared.fd5f2699d3b0017797e5b5e1e1d92eb98818740ebf20a95364bbb7deea0c8242.js +4 -0
- package/dist/browser/chunk-shared.fd5f2699d3b0017797e5b5e1e1d92eb98818740ebf20a95364bbb7deea0c8242.js.br +0 -0
- package/dist/browser/chunk-shared.fd5f2699d3b0017797e5b5e1e1d92eb98818740ebf20a95364bbb7deea0c8242.js.gz +0 -0
- package/dist/browser/{chunk-sonner.da05d41088ec46a49ef6b86f4afa71fccd5462f1befa713ca930aa231e35349b.js → chunk-sonner.2472e1da55de10b11dc002c80a840966061e817c47793f5e216f1af6c6dbedff.js} +1 -1
- package/dist/browser/chunk-sonner.2472e1da55de10b11dc002c80a840966061e817c47793f5e216f1af6c6dbedff.js.br +0 -0
- package/dist/browser/chunk-sonner.2472e1da55de10b11dc002c80a840966061e817c47793f5e216f1af6c6dbedff.js.gz +0 -0
- package/dist/browser/chunk-task-view.bbeddc793a5e8a6d1f66b6cc5f0ce1da18414137e85c49ccd07be0e20f61ac12.js +2 -0
- package/dist/browser/chunk-task-view.bbeddc793a5e8a6d1f66b6cc5f0ce1da18414137e85c49ccd07be0e20f61ac12.js.br +0 -0
- package/dist/browser/chunk-task-view.bbeddc793a5e8a6d1f66b6cc5f0ce1da18414137e85c49ccd07be0e20f61ac12.js.gz +0 -0
- package/dist/browser/chunk-team-chat.c3255a5a1d94e39d559c07438c4690543602b1552b2c2bf57b8791d7f989141d.js +2 -0
- package/dist/browser/chunk-team-chat.c3255a5a1d94e39d559c07438c4690543602b1552b2c2bf57b8791d7f989141d.js.br +0 -0
- package/dist/browser/chunk-team-chat.c3255a5a1d94e39d559c07438c4690543602b1552b2c2bf57b8791d7f989141d.js.gz +0 -0
- package/dist/browser/manifest.json +204 -204
- package/dist/browser/{terminal.1ab49cbf9b9363f0f520b85e4125d40a302dffc10489e77b04ff1c620831eefe.js → terminal.18295f7cbf70d84b5564f3784b9630bec594fc558a7bf0303e34cde9b027eff9.js} +1 -1
- package/dist/browser/terminal.18295f7cbf70d84b5564f3784b9630bec594fc558a7bf0303e34cde9b027eff9.js.br +0 -0
- package/dist/browser/{terminal.1ab49cbf9b9363f0f520b85e4125d40a302dffc10489e77b04ff1c620831eefe.js.gz → terminal.18295f7cbf70d84b5564f3784b9630bec594fc558a7bf0303e34cde9b027eff9.js.gz} +0 -0
- package/dist/browser/workspace.3043c4a6df23ed1c0c8be3fb816fa9410a2ab99053eb54476f22a1735c03ca97.css +4 -0
- package/dist/browser/workspace.3043c4a6df23ed1c0c8be3fb816fa9410a2ab99053eb54476f22a1735c03ca97.css.br +0 -0
- package/dist/browser/workspace.3043c4a6df23ed1c0c8be3fb816fa9410a2ab99053eb54476f22a1735c03ca97.css.gz +0 -0
- package/dist/browser/{workspace.d6a38fe66b5ee0b74d8ea4b026148c285f664732511bc528c934309bbad1e5e4.js → workspace.aebb60d4e5ef4509a80cfaccf0af5f7246867ec7531a1734dd8e28c59594950e.js} +4 -4
- package/dist/browser/workspace.aebb60d4e5ef4509a80cfaccf0af5f7246867ec7531a1734dd8e28c59594950e.js.br +0 -0
- package/dist/browser/workspace.aebb60d4e5ef4509a80cfaccf0af5f7246867ec7531a1734dd8e28c59594950e.js.gz +0 -0
- package/dist/browser-open.js +1 -1
- package/dist/build-review.js +2 -2
- package/dist/builder-revision.js +4 -0
- package/dist/builder.js +31 -17
- package/dist/canvas-capture.js +2 -2
- package/dist/canvas-freshness.js +1 -1
- package/dist/central-recovery-stage.js +1 -1
- package/dist/chat-actions.js +11 -7
- package/dist/chat-channel.js +1 -1
- package/dist/chat-decide.js +8 -4
- package/dist/chat-review.js +1 -1
- package/dist/chat-terms.js +2 -2
- package/dist/check-levels.js +1 -1
- package/dist/cli-help.js +142 -13
- package/dist/cli.js +4 -3
- package/dist/companion/bonjour.js +1 -1
- package/dist/companion/daemon.js +1 -1
- package/dist/companion/passkey-gate.js +1 -1
- package/dist/companion/reads.js +1 -1
- package/dist/companion/store.js +1 -1
- package/dist/companion/webauthn.js +1 -1
- package/dist/companion/work.js +1 -1
- package/dist/container-state.js +2 -2
- package/dist/containment.js +2 -2
- package/dist/contracts/chat-actions.js +1 -1
- package/dist/contracts/console-api.js +1 -1
- package/dist/contracts/engine-api.js +1 -1
- package/dist/contracts/lead-tools.js +1 -1
- package/dist/contracts/project-memory.js +1 -1
- package/dist/contracts/provider.js +1 -1
- package/dist/controller-supervisor.js +2 -2
- package/dist/converse.js +1 -1
- package/dist/credential-broker.js +1 -1
- package/dist/decision.js +1 -1
- package/dist/demo.js +2 -2
- package/dist/dispatch.js +2 -2
- package/dist/dispose.js +1 -1
- package/dist/easy-start.js +2 -2
- package/dist/egress.js +1 -1
- package/dist/engine-chat.js +1 -1
- package/dist/engine-handoff.js +1 -1
- package/dist/engine-reads.js +3 -3
- package/dist/evals.js +2 -2
- package/dist/every-agent-schema.js +105 -0
- package/dist/evidence-pack.js +1 -1
- package/dist/evidence.js +1 -1
- package/dist/exec.js +5 -4
- package/dist/fallback.js +1 -1
- package/dist/fast-owner-schema.js +33 -0
- package/dist/fast-start.js +1 -1
- package/dist/flow-unattended.js +2 -2
- package/dist/git-identity.js +2 -2
- package/dist/github-import.js +1 -1
- package/dist/github-read.js +1 -1
- package/dist/handoff-relay.js +2 -0
- package/dist/install-mode.js +2 -3
- package/dist/invoke.js +9 -7
- package/dist/keys.js +1 -1
- package/dist/laptop-background.js +1 -1
- package/dist/lead-capabilities.js +1 -1
- package/dist/lead-cli.js +2 -2
- package/dist/lead-contract.js +1 -1
- package/dist/lead-debrief.js +7 -0
- package/dist/lead-doors.js +1 -1
- package/dist/lead-tools.js +5 -5
- package/dist/lead.js +2 -2
- package/dist/live-backup-change.js +2 -2
- package/dist/live-backup.js +2 -2
- package/dist/live-records.js +3 -3
- package/dist/live-terminal.js +4 -4
- package/dist/local-checks.js +1 -1
- package/dist/local-landing.js +22 -3
- package/dist/local-owner-acts.js +2 -2
- package/dist/local-owner.js +1 -1
- package/dist/machine-identity.js +1 -1
- package/dist/memory-pass.js +3 -3
- package/dist/model-catalog.js +8 -5
- package/dist/model-choices.js +3 -3
- package/dist/model-routing.js +1 -1
- package/dist/models-cli.js +2 -2
- package/dist/names.js +1 -1
- package/dist/needs-you.js +1 -1
- package/dist/onboard.js +1 -1
- package/dist/openrouter-key.js +2 -0
- package/dist/operate-commands.js +1 -1
- package/dist/operate-remote-arguments.js +1 -1
- package/dist/operate-remote.js +1 -1
- package/dist/operate.js +46 -19
- package/dist/orphan-sweep.js +1 -1
- package/dist/owner-mode.js +4 -0
- package/dist/panels.js +6 -0
- package/dist/peek-cli.js +2 -2
- package/dist/phase-routing.js +1 -1
- package/dist/pi-build.js +4 -0
- package/dist/pi-rpc.js +10 -0
- package/dist/pi-tools-extension.js +4 -0
- package/dist/plan-login.js +2 -2
- package/dist/plane-review.js +1 -1
- package/dist/planner-source.js +2 -2
- package/dist/planner.js +2 -2
- package/dist/plugin-bundle-source.js +1 -0
- package/dist/plugin-bundles-schema.js +43 -0
- package/dist/policy.js +1 -1
- package/dist/pre-run-phase.js +2 -0
- package/dist/presence-hold.js +1 -1
- package/dist/process-liveness.js +1 -1
- package/dist/process-tree.js +1 -1
- package/dist/project-knowledge.js +2 -2
- package/dist/project-learning.js +6 -5
- package/dist/project-memory.js +1 -1
- package/dist/project-skills.js +1 -1
- package/dist/project-tools.js +3 -3
- package/dist/prompt.js +1 -1
- package/dist/proposal.js +1 -1
- package/dist/protected-storage.js +2 -2
- package/dist/provider-auth.js +1 -1
- package/dist/provider-connection.js +2 -2
- package/dist/provider-home.js +1 -1
- package/dist/provider-limits.js +1 -1
- package/dist/provider.js +2 -2
- package/dist/public-access.js +1 -1
- package/dist/pull-request-flow.js +2 -2
- package/dist/read-executor.js +1 -1
- package/dist/release-adapters.js +2 -2
- package/dist/release-carry.js +3 -3
- package/dist/release-resume.js +2 -2
- package/dist/release-start.js +1 -0
- package/dist/reported-usage.js +1 -1
- package/dist/repository-context.js +1 -1
- package/dist/result-follow-ups.js +2 -2
- package/dist/result-projection.js +1 -1
- package/dist/review-switch.js +1 -1
- package/dist/route-change.js +25 -3
- package/dist/run-closeout.js +2 -2
- package/dist/runner.js +2 -2
- package/dist/sandbox-launch.js +2 -2
- package/dist/sandbox-runtime.js +1 -1
- package/dist/scope.js +1 -1
- package/dist/scout-browser.js +1 -1
- package/dist/scout.js +2 -2
- package/dist/serve.js +3 -3
- package/dist/server/chat-projection.js +1 -1
- package/dist/server/chat.js +3 -3
- package/dist/server/direct-chat.js +1 -1
- package/dist/server/engine-api.js +1 -1
- package/dist/server/handoff.js +1 -0
- package/dist/server/http.js +1 -1
- package/dist/server/live.js +1 -1
- package/dist/server/merge-ready-view.js +1 -1
- package/dist/server/one-time-secret.js +1 -1
- package/dist/server/panels.js +1 -0
- package/dist/server/people-tokens.js +1 -1
- package/dist/server/route-table.js +1 -1
- package/dist/server/runtime.js +1 -1
- package/dist/server/send-back-build.js +1 -1
- package/dist/server/settings-phone.js +1 -1
- package/dist/server/settings-section-table.js +1 -1
- package/dist/server/settings-sections.js +1 -1
- package/dist/server/settings.js +3 -2
- package/dist/server/task-overview.js +1 -0
- package/dist/server/task-view-data.js +3 -3
- package/dist/server/task-views.js +1 -1
- package/dist/server/tasks.js +6 -6
- package/dist/server/terminals.js +1 -1
- package/dist/settings-data.js +1 -1
- package/dist/settings-proofs.js +1 -1
- package/dist/setup-guide.js +1 -1
- package/dist/shared-deps.js +4 -4
- package/dist/sign-in-page.js +2 -2
- package/dist/skill-library.js +13 -22
- package/dist/skills-manifest.js +1 -1
- package/dist/spend-report.js +2 -1
- package/dist/spend.js +6 -4
- package/dist/ssr-workspace.js +89 -89
- package/dist/staged-runtimes.js +1 -1
- package/dist/status-probe.js +2 -2
- package/dist/stop-proof.js +2 -2
- package/dist/storage-sweep-child.js +2 -2
- package/dist/storage-sweep-process.js +1 -1
- package/dist/storage.js +2 -2
- package/dist/store-baseline.js +17 -79
- package/dist/store.js +24 -19
- package/dist/structured-json.js +1 -0
- package/dist/structured-output.js +1 -1
- package/dist/subscription-chat.js +16 -4
- package/dist/subscription-usage.js +3 -4
- package/dist/surface.js +1 -1
- package/dist/task-outcome-cli.js +5 -2
- package/dist/task-overview.js +1 -0
- package/dist/task-review-brief.js +1 -1
- package/dist/task-status.js +1 -1
- package/dist/teardown-git.js +4 -4
- package/dist/test-temp.js +1 -1
- package/dist/text-limits.js +1 -1
- package/dist/tool-broker.js +1 -1
- package/dist/toolroll-update.js +3 -3
- package/dist/trusted-path.js +1 -1
- package/dist/tui/darwin-arm64/toolroll-tui +0 -0
- package/dist/tui/darwin-x64/toolroll-tui +0 -0
- package/dist/tui/linux-arm64/toolroll-tui +0 -0
- package/dist/tui/linux-x64/toolroll-tui +0 -0
- package/dist/tui-contract.js +1 -1
- package/dist/tui-launch.js +2 -1
- package/dist/verification-evidence.js +1 -1
- package/dist/welcome-facts.js +1 -1
- package/dist/work-index.js +13 -5
- package/package.json +2 -1
- package/dist/browser/chunk-agents-live-view.6fd2938ef96a85a4127cddb99dbc700b3201c58351d9f07dbcd8a2f7d7dfef22.js.br +0 -0
- package/dist/browser/chunk-agents-live-view.6fd2938ef96a85a4127cddb99dbc700b3201c58351d9f07dbcd8a2f7d7dfef22.js.gz +0 -0
- package/dist/browser/chunk-bundle.77cfd5ccd851cf1fb8597d1d0eb12fc30913417f13b699d5b8ac61a4116274ef.js +0 -2
- package/dist/browser/chunk-bundle.77cfd5ccd851cf1fb8597d1d0eb12fc30913417f13b699d5b8ac61a4116274ef.js.br +0 -0
- package/dist/browser/chunk-bundle.77cfd5ccd851cf1fb8597d1d0eb12fc30913417f13b699d5b8ac61a4116274ef.js.gz +0 -0
- package/dist/browser/chunk-chat-parts.0e3997ddbeed8305b18353060e93f2a330d95ccb23b960f182dee211d205bb13.js +0 -4
- package/dist/browser/chunk-chat-parts.0e3997ddbeed8305b18353060e93f2a330d95ccb23b960f182dee211d205bb13.js.br +0 -0
- package/dist/browser/chunk-chat-parts.0e3997ddbeed8305b18353060e93f2a330d95ccb23b960f182dee211d205bb13.js.gz +0 -0
- package/dist/browser/chunk-core.23e919124df20f363902dc6e256d2408e103af285ebffbf0059fad7369c6ee8f.js +0 -116
- package/dist/browser/chunk-core.23e919124df20f363902dc6e256d2408e103af285ebffbf0059fad7369c6ee8f.js.br +0 -0
- package/dist/browser/chunk-core.23e919124df20f363902dc6e256d2408e103af285ebffbf0059fad7369c6ee8f.js.gz +0 -0
- package/dist/browser/chunk-flow-view.71a0a3360292445ab70d67253bb9003163bbb7b1b03f14d1892cca83debd9b2c.js.br +0 -0
- package/dist/browser/chunk-flow-view.71a0a3360292445ab70d67253bb9003163bbb7b1b03f14d1892cca83debd9b2c.js.gz +0 -0
- package/dist/browser/chunk-flows-extra-view.ebf20d864bea14592b61ce628afc066997e1f0a566abbfe6fc91f4db47245696.js +0 -4
- package/dist/browser/chunk-flows-extra-view.ebf20d864bea14592b61ce628afc066997e1f0a566abbfe6fc91f4db47245696.js.br +0 -0
- package/dist/browser/chunk-flows-extra-view.ebf20d864bea14592b61ce628afc066997e1f0a566abbfe6fc91f4db47245696.js.gz +0 -0
- package/dist/browser/chunk-pages-bundle.2fbb3d6de09f521a8ded75bd48b567d60bbfde351cae3492179714d76fc91ee5.js +0 -6
- package/dist/browser/chunk-pages-bundle.2fbb3d6de09f521a8ded75bd48b567d60bbfde351cae3492179714d76fc91ee5.js.br +0 -0
- package/dist/browser/chunk-pages-bundle.2fbb3d6de09f521a8ded75bd48b567d60bbfde351cae3492179714d76fc91ee5.js.gz +0 -0
- package/dist/browser/chunk-result-view.7527d4ed9c70c023b63821c87f8db00c374fddd8674f984cc7c03fae050e6ff0.js +0 -2
- package/dist/browser/chunk-result-view.7527d4ed9c70c023b63821c87f8db00c374fddd8674f984cc7c03fae050e6ff0.js.br +0 -0
- package/dist/browser/chunk-result-view.7527d4ed9c70c023b63821c87f8db00c374fddd8674f984cc7c03fae050e6ff0.js.gz +0 -0
- package/dist/browser/chunk-settings-view.129efb77f2d459e2254d17ab338dac474d14b86383fe024798dc61b9460d169c.js +0 -20
- package/dist/browser/chunk-settings-view.129efb77f2d459e2254d17ab338dac474d14b86383fe024798dc61b9460d169c.js.br +0 -0
- package/dist/browser/chunk-settings-view.129efb77f2d459e2254d17ab338dac474d14b86383fe024798dc61b9460d169c.js.gz +0 -0
- package/dist/browser/chunk-shared.01f5db9cab3e903447bac5a6484cbae518232a074542c5128a0ce8cac9fe5e7d.js +0 -3
- package/dist/browser/chunk-shared.01f5db9cab3e903447bac5a6484cbae518232a074542c5128a0ce8cac9fe5e7d.js.br +0 -0
- package/dist/browser/chunk-shared.01f5db9cab3e903447bac5a6484cbae518232a074542c5128a0ce8cac9fe5e7d.js.gz +0 -0
- package/dist/browser/chunk-shared.1cf4e4820f8c03a04d548d8b21b6169eda3354229b4feccdeb95534b3cc2ed09.js +0 -2
- package/dist/browser/chunk-shared.1cf4e4820f8c03a04d548d8b21b6169eda3354229b4feccdeb95534b3cc2ed09.js.br +0 -0
- package/dist/browser/chunk-shared.1cf4e4820f8c03a04d548d8b21b6169eda3354229b4feccdeb95534b3cc2ed09.js.gz +0 -0
- package/dist/browser/chunk-shared.408770b5e547bce6c67ad743638b8ef16381b092d71fc1a2b2b801cad9bd900f.js +0 -5
- package/dist/browser/chunk-shared.408770b5e547bce6c67ad743638b8ef16381b092d71fc1a2b2b801cad9bd900f.js.br +0 -0
- package/dist/browser/chunk-shared.408770b5e547bce6c67ad743638b8ef16381b092d71fc1a2b2b801cad9bd900f.js.gz +0 -0
- package/dist/browser/chunk-shared.47c9cc79ee85c5d6ebb9759b9d7f261ddd7aee78c7f70f2bc559d5b97444936d.js +0 -2
- package/dist/browser/chunk-shared.47c9cc79ee85c5d6ebb9759b9d7f261ddd7aee78c7f70f2bc559d5b97444936d.js.br +0 -0
- package/dist/browser/chunk-shared.47c9cc79ee85c5d6ebb9759b9d7f261ddd7aee78c7f70f2bc559d5b97444936d.js.gz +0 -0
- package/dist/browser/chunk-shared.60b718ab56ab520275f68f0378efa38941dc2d739c1284f842a19e6a25456e7d.js +0 -2
- package/dist/browser/chunk-shared.60b718ab56ab520275f68f0378efa38941dc2d739c1284f842a19e6a25456e7d.js.br +0 -0
- package/dist/browser/chunk-shared.60b718ab56ab520275f68f0378efa38941dc2d739c1284f842a19e6a25456e7d.js.gz +0 -0
- package/dist/browser/chunk-shared.9974523cbe568c3669da1b1a266aa7de741e2edcce3e4a943e73242c61324004.js +0 -2
- package/dist/browser/chunk-shared.9974523cbe568c3669da1b1a266aa7de741e2edcce3e4a943e73242c61324004.js.br +0 -0
- package/dist/browser/chunk-shared.9974523cbe568c3669da1b1a266aa7de741e2edcce3e4a943e73242c61324004.js.gz +0 -0
- package/dist/browser/chunk-shared.b536969256589ccff71a29b37eff95fccfd5a8f4fa4138ff503cb0e8fb10b4d0.js +0 -2
- package/dist/browser/chunk-shared.b536969256589ccff71a29b37eff95fccfd5a8f4fa4138ff503cb0e8fb10b4d0.js.br +0 -0
- package/dist/browser/chunk-shared.b536969256589ccff71a29b37eff95fccfd5a8f4fa4138ff503cb0e8fb10b4d0.js.gz +0 -0
- package/dist/browser/chunk-shared.cbc3fd4e985ceccf27c731d77030830edbf96dd0197424584ebb202eb6993ebd.js +0 -4
- package/dist/browser/chunk-shared.cbc3fd4e985ceccf27c731d77030830edbf96dd0197424584ebb202eb6993ebd.js.br +0 -0
- package/dist/browser/chunk-shared.cbc3fd4e985ceccf27c731d77030830edbf96dd0197424584ebb202eb6993ebd.js.gz +0 -0
- package/dist/browser/chunk-sonner.da05d41088ec46a49ef6b86f4afa71fccd5462f1befa713ca930aa231e35349b.js.br +0 -0
- package/dist/browser/chunk-sonner.da05d41088ec46a49ef6b86f4afa71fccd5462f1befa713ca930aa231e35349b.js.gz +0 -0
- package/dist/browser/chunk-task-view.9b9f418a71547aeea43a8acb26e8d48d486463b71b940eb72f3856038e27fa90.js +0 -2
- package/dist/browser/chunk-task-view.9b9f418a71547aeea43a8acb26e8d48d486463b71b940eb72f3856038e27fa90.js.br +0 -0
- package/dist/browser/chunk-task-view.9b9f418a71547aeea43a8acb26e8d48d486463b71b940eb72f3856038e27fa90.js.gz +0 -0
- package/dist/browser/chunk-team-chat.2be52f36796d5cd7ca8ea47a2aeb68c550625150ccc4186805bdecd87747138c.js +0 -2
- package/dist/browser/chunk-team-chat.2be52f36796d5cd7ca8ea47a2aeb68c550625150ccc4186805bdecd87747138c.js.br +0 -0
- package/dist/browser/chunk-team-chat.2be52f36796d5cd7ca8ea47a2aeb68c550625150ccc4186805bdecd87747138c.js.gz +0 -0
- package/dist/browser/terminal.1ab49cbf9b9363f0f520b85e4125d40a302dffc10489e77b04ff1c620831eefe.js.br +0 -0
- package/dist/browser/workspace.d6a38fe66b5ee0b74d8ea4b026148c285f664732511bc528c934309bbad1e5e4.js.br +0 -0
- package/dist/browser/workspace.d6a38fe66b5ee0b74d8ea4b026148c285f664732511bc528c934309bbad1e5e4.js.gz +0 -0
- package/dist/browser/workspace.d818fa094b8793160991ca784f4897c6d1862c02fbcbeebae637d8b855ab03d5.css +0 -4
- package/dist/browser/workspace.d818fa094b8793160991ca784f4897c6d1862c02fbcbeebae637d8b855ab03d5.css.br +0 -0
- package/dist/browser/workspace.d818fa094b8793160991ca784f4897c6d1862c02fbcbeebae637d8b855ab03d5.css.gz +0 -0
package/dist/chat-channel.js
CHANGED
|
@@ -13,7 +13,7 @@ Confirm?`}export function armedQuestion(proposal){return(proposal.kind==="action
|
|
|
13
13
|
`),buttons:!1}}export function phoneProposalLink(store,proposal,repos,channel=null){return fitsPhone(proposalPreview(store,proposal,repos,"telegram"))?proposalLink(store,proposal,repos,channel):LEAD_CHAT_LINK}export function confirmedLink(store,outcome,proposal,repos){return outcome.ok&&proposal.kind==="action"&&typeof outcome.href=="string"&&FLOW_HREF.test(outcome.href)?{label:"Open the flow",path:outcome.href}:!outcome.ok||outcome.taskId===null?null:proposal.kind==="action"&&(proposal.payload.operation==="skill_test"||proposal.payload.operation==="task_start")||proposal.kind==="task"||proposal.kind==="scope"||proposal.kind==="agents"||proposal.kind==="task_action"&&proposal.payload.operation==="resume"||proposal.kind==="review"&&proposal.payload.operation==="revise"?taskLink(store,outcome.taskId,repos):null}function lines(text,cap){return phoneText(text,cap).split(`
|
|
14
14
|
`).map(line=>`| ${line}`)}export function proposalPreview(store,proposal,repos,channel=null){const payload=proposal.payload,t=(key,cap=200)=>typeof payload[key]=="string"?phoneText(payload[key],cap):"",task=t("task",64),taskName=t("taskTitle",120)||task,repoLabel=(()=>{const id=t("repoId",8),path=/^r[0-9]+$/.test(id)?repos[Number(id.slice(1))-1]:void 0;return path===void 0?id:projectLabel(path)})(),phone=channel==="telegram",card=(headline,body=[],consequence=null,last=null)=>({text:(phone?[headline,...consequence===null?[]:[consequence],...body.length===0?[]:["",...body],"","Nothing changes until you confirm.",...last===null?[]:[last]]:[headline,...body,...consequence===null?[]:["",consequence],"","Confirm or Dismiss below. Nothing changes until you confirm."]).join(`
|
|
15
15
|
`),buttons:!0}),lasting=phone?" ⚠ can't be undone":" — IRREVERSIBLE",handoff=(headline,body=[])=>({text:[headline,...body,"",HANDOFF].join(`
|
|
16
|
-
`),buttons:!1});switch(proposal.kind){case"action":{const action=sharedActionPayload(payload);return action?channel!==null&&sharedActionAllowsChallenge(action,channel)?card(phoneText(action.title,200),action.terms.map(term=>phoneText(term,APPROVAL_TERM_CHARS)),"Confirm asks once more before anything is recorded.",action.operation==="task_start"&&channel==="telegram"?TYPED_START_LINE:null):sharedActionNeedsReview(action)?handoff(phoneText(action.title,200),["Review the full details and confirm this exact action."]):card(phoneText(action.title,200),action.terms.map(term=>phoneText(term,1200))):handoff("This action is unavailable.")}case"task":return card(`Create task in ${repoLabel||"the project"}: ${t("title",120)}`,[`Goal: ${t("goal",600)}`,...t("not")===""?[]:[`Not: ${t("not",300)}`],...payload.report===!0?["A scout task: it delivers a report, never a branch."]:[]],payload.report===!0?"Confirm files it; a scout needs no approval.":"Confirm files it. You still approve its scope before work starts.");case"next":return card(`Move ${taskName} to the front of its queue (now ${String(payload.position??"?")} of ${String(payload.of??"?")}).`);case"reserve":return card(payload.worker===null?`Release ${taskName} to the shared queue.`:`Reserve ${taskName} for ${t("worker",80)}.`);case"hold":return card(`Hold ${taskName}: ${t("reason",300)}`,[],"The task waits until the hold is released.");case"unhold":return card(`Release ${taskName} from its hold.`);case"steer":return payload.mode==="pause"?card(`Pause ${taskName}.`,[],"Its current turn stops and the build keeps running; its next note continues it."):payload.mode==="resume"?card(`Resume ${taskName}.`,[],"It goes on where it stopped. No note is sent."):payload.mode==="pause-and-steer"?card(`Pause ${taskName}, then send its agent:`,lines(t("note",1e3),1e3),"Its current turn stops first. Scope stays the same."):typeof payload.questionKey=="string"?card(`Reply to ${taskName}'s agent about "${t("questionKey",40)}":`,lines(t("note",1e3),1e3),"The running agent reads it when it next checks for notes, and the question closes. Scope stays the same."):card(`Guidance for ${taskName}'s agent:`,lines(t("note",1e3),1e3),"A running agent reads it when it next checks for notes; otherwise the next attempt does. Scope stays the same.");case"repair":{const blocker=t("blockerTitle",120)||t("blocker",64),operation=t("operation",16),headline=operation==="retry"?`Queue ${blocker} again; ${taskName} follows when it finishes.`:operation==="unlink"?`Let ${taskName} continue without ${blocker}.`:`Make ${taskName} wait for ${t("replacementTitle",120)||t("replacement",64)} instead of ${blocker}.`;return card(headline)}case"agents":{const parts=[...t("risk")===""?[]:[`risk ${t("risk",32)}`],...t("role")===""?[]:[payload.clear===!0?`${t("role",32)}: back to the recommendation`:`${t("role",32)}: ${t("provider",40)} ${t("model",80)}`]];return card(`Change agents for ${taskName}: ${parts.join("; ")}`,[],"Changing agents or risk needs renewed approval before work starts.")}case"scope":return card(`Rewrite the scope of ${taskName}:`,[`Goal: ${t("goal",600)}`,...t("not")===""?[]:[`Not: ${t("not",300)}`]],"After confirming, the new scope still needs your approval before work starts.");case"answer":{const id=typeof payload.decision=="number"?payload.decision:null,decision=id===null?null:store.getDecision(id);if(decision?.supersededReason!=null)return{text:closedQuestionWords(decision.supersededReason),buttons:!1,closed:!0};const pick=t("option",64),irreversible=payload.reversible===!1,body=decision===null?["(the decision is gone)"]:[`Q: ${phoneText(decision.question,400)}`,...decision.options.map(one=>`${one.id===pick?"→":" "} ${phoneText(one.label,120)}${one.reversible?"":lasting}${one.id===decision.recommendation?" (the builder recommends this)":""}: ${phoneText(one.consequence,300)}`),...t("rationale")===""?[]:[`Why: ${t("rationale",300)}`]];return card(`Answer decision #${String(id??"?")} on ${taskName} with "${t("optionLabel",120)||pick}"`,body,irreversible?phone?"⚠ This choice can't be undone. Confirming asks you once more.":"⚠ This choice is irreversible. Confirming asks you once more.":null)}case"task_action":{const operation=payload.operation,action=isChatTaskAction(operation)?CHAT_TASK_ACTIONS[operation]:null,dependency=t("dependencyTitle",120)||t("dependency",64);return action===null?handoff(`An unavailable action was proposed for ${taskName}.`):card(`${action.label}: ${taskName}${dependency===""?"":` · ${dependency}`}`,[action.detail],null)}case"review":{const revise=payload.operation==="revise",snapshot=payload.snapshot,selected=Array.isArray(payload.notes)?payload.notes:[],saved=(snapshot?.notes??[]).filter(one=>selected.includes(one.id)),note=t("note",LIMITS.note),image=parseFeedbackImage(payload.image),path=t("path",300);return card(`${revise?"Request changes to":"Save feedback on"} result #${String(payload.run??"?")} of ${taskName}`,[...note===""?[]:[`Your feedback${path===""?"":` (${path}${typeof payload.line=="number"?`:${payload.line}`:""})`}:`,...image?[`Screenshot ${image.artifact} · result #${image.run}`]:[],...lines(note,LIMITS.note)],...saved.length===0?[]:["Saved notes included:",...saved.map(one=>`• ${one.image?`Screenshot ${one.image.artifact} · result #${one.image.run}: `:""}${one.path===null?"":`${phoneText(one.path,120)}${one.line===null?"":`:${one.line}`}: `}${phoneText(one.note,LIMITS.note)}`)]],revise?"Creates a revision of the same task. Its approval follows your settings.":"Saves feedback; no work starts.")}case"cancel":return handoff(`Cancel ${taskName}: ${t("reason",300)}`,["Cancelling is armed on the task itself, never from a card."]);case"control":{if(isCardProposal(proposal))return handoff(cardPlainOf(proposal));const control=payload.control,label=isChatControl(control)?CHAT_CONTROLS[control].label:"A console control";return handoff(`${label}${taskName===""?"":` for ${taskName}`}`,["This opens an existing control; nothing changes from here."])}default:return handoff("This kind of proposal cannot be confirmed from the phone.")}}export function proposalOutcomeText(proposal){const outcome=proposal.outcome,said=outcome!==null&&typeof outcome.said=="string"?phoneText(outcome.said,600):"",via=outcome!==null&&typeof outcome.via=="string"?` (from ${outcome.via})`:"";switch(proposal.state){case"confirmed":return`✓ Done${via}${said===""?"":`: ${said}`}`;case"refused":return`✗ Not done${via}${said===""?"":`: ${said}`}`;case"dismissed":return"Dismissed.";case"expired":return"This card expired.";case"confirming":return"Being confirmed elsewhere right now.";default:return"Still waiting for your confirmation."}}export const CHAT_ACTION_PARITY={get_brief:{support:"direct",how:"Reads current tasks, decisions, results and project knowledge from the local database through the shared engine, within the enrolled projects.",gap:"Dedicated Telegram and Slack journeys for this tool and live channel rendering remain unverified."},get_project_activity:{support:"direct",how:"Reads the project's Ready backlog, finished-to-decision elapsed time, explicit revisions and recorded cost for completed families in an accessible enrolled project through the shared engine.",gap:"Dedicated Telegram and Slack journeys for this tool and live channel rendering remain unverified."},get_project_context:{support:"direct",how:"Reads bounded source excerpts or advisory import impact in an accessible enrolled project through the shared engine, with source-search fallback when its index is unavailable.",gap:"Index refresh uses the local CLI. Dedicated Telegram and Slack journeys for this tool and live channel rendering remain unverified."},get_code_map:{support:"direct",how:"Reads the project's generated code map through the shared reader, one labelled answer at most 6 KB, paging one pinned version.",gap:null},refresh_code_map:{support:"direct",how:"Queues a check of the project's main, as Check now does on the page.",gap:null},get_action_status:{support:"direct",how:"Reads the exact saved shared action and its outcome, including completion through secure review.",gap:null},get_actions:{support:"direct",how:"Lists the shared action catalogue and required inputs.",gap:null},propose_action:{support:"direct",how:"Prepares exact shared skill, knowledge, approval, acceptance, cancel and resume actions (the separate review request was removed on 2026-09-21). Short ordinary changes confirm here; protected or long changes use one secure review and record the result on the same proposal.",gap:"Secure review requires a working HTTPS console connection. Real transport verification is required."},recap:{support:"direct",how:"Read by the model during a phone turn over the enrolled ceiling.",gap:null},find_tools:{support:"direct",how:"Searches the lead's own other tools by what it wants to do; what it finds is offered to it from its next step in the same reply. Same on every channel: the shared engine runs it.",gap:null},list_repos:{support:"direct",how:"Read during a turn; projects are r1..rN in enrollment order, as on the console.",gap:null},get_skills:{support:"direct",how:"Reads the same project skill library, saved selections and enabled versions as the console. Use propose_action for changes and tests.",gap:"Skill import and long content require secure review. Folder and GitHub import still use the project Skills screen."},get_project_knowledge:{support:"direct",how:"Read during a turn.",gap:null},get_flaky_tests:{support:"direct",how:"Read during a turn: a project's tests with mixed outcomes, each with the task that would fix it. Fixing one is an ordinary task card.",gap:null},get_models:{support:"direct",how:"Read during a turn: default agents with the exact model each runs, CLI versions and new models. Changes use the labelled Settings → Models page.",gap:null},get_diff:{support:"direct",how:"Read during a turn: the exact result's changed files, then one file's diff, so a requested change names the right file and line.",gap:null},get_check_log:{support:"direct",how:"Read during a turn: the end of the exact result's check log, a page of it, or the lines matching a search.",gap:null},get_project_tools:{support:"direct",how:"Read during a turn: a project's tools, the common tools list and servers found on the computer. Adding one is a secure-review card; secrets are set only on the console's Tools page.",gap:null},get_task_conversation:{support:"direct",how:"Read during a turn: what the person and the lead said in one task's own chat, including what was confirmed there.",gap:null},get_attachment:{support:"direct",how:"Read during a turn: a file the person attached to a message in this conversation (from the iPhone), its text 32 KB at a time; a PDF's own text decoded.",gap:"Attaching files is on the iPhone app; a chat app's own attachments aren't read."},get_flows:{support:"direct",how:"Read during a turn: a person's flows, each one's steps in order and its cards — where each card is, what it waits on, whether it needs them, its owner and its discussion.",gap:null},get_subagents:{support:"direct",how:"Read during a turn: the project's subagents, their soul files, the zones they work, what they did today and the questions they're waiting on.",gap:null},propose_subagent:{support:"direct",how:"Asks a subagent to do something for you (the lead delegates; its answer comes back here), adds one from a template or a soul file, changes one section of its soul file (or the whole short file), pauses, resumes or removes it, passes it a note, or answers its question for the person asked, through the shared confirm door.",gap:"Soul files longer than one message are edited on the console's subagent page; the phone changes one section at a time."},get_flow_insights:{support:"direct",how:"Read during a turn: where each flow's cards pass, fail or are sent back, how long they wait, how its scripts did, and a run's log.",gap:null},propose_flow:{support:"direct",how:"Creates or changes a flow, adds, moves, approves, sends back or cancels its cards, comments on them (@name pings that person), sets their owner, follows them, saves the project's scripts, and adds, pauses or removes its triggers, through the shared confirm door; a long drawing opens the secure review. Work a card files is an ordinary task under the usual approvals.",gap:"The flow canvas itself is on the console; the phone confirms cards but draws nothing. Webhook addresses and the Linear key are set on the console's Triggers panel."},commit_to:{support:"direct",how:"Records what the lead promised to follow up on (a task, attempt, check or time; 7 days at most). The follow pass says one line when it is met, in the shared conversation and on the chat the promise was made on.",gap:null},release_commitment:{support:"direct",how:"Stops following up on one of the person's open promises, with the reason.",gap:null},remember:{support:"direct",how:"Proposes a correction or lasting preference as a decision, project instruction or about-you card, through the shared confirm door; an about-you card shows the line it replaces.",gap:null},manage_standing_directions:{support:"direct",how:"Runs during a turn: lists Standing Directions, or adds one turned off, in the same store Settings → Standing directions edits, where the person turns it on, off or removes it; a project direction names one of the person's admitted projects.",gap:null},get_person:{support:"direct",how:"Read during a turn: one person, subagent or team chat in full, with their open tasks.",gap:null},get_integrations:{support:"direct",how:"Read during a turn: which chat apps, email, GitHub, project tools and monitoring are Connected, Not set up or Broken, as Settings → Integrations shows them.",gap:null},get_capabilities:{support:"direct",how:"Read during a turn: which agents are signed in, which workers are online, which tools and skills work, which integrations are connected and what checks the project runs, each with its next step and settings link.",gap:null},ask_owner:{support:"direct",how:"One question with 2-4 options and Something else, drawn as buttons under the reply; the tapped option is sent as the person's next message.",gap:null},search_project_memory:{support:"direct",how:"Read during a turn: one search over decisions, references, lessons and the conversations the person may read.",gap:null},list_tasks:{support:"direct",how:"Read during a turn.",gap:null},tidy_preview:{support:"direct",how:"Read during a turn: what Put away old tasks would put away now and why. Only a person puts tasks away, on the console or with the CLI command it names.",gap:null},get_task:{support:"direct",how:"Read during a turn; a reply to a result message pins the exact execution.",gap:null},get_agents:{support:"direct",how:"Read during a turn.",gap:null},list_decisions:{support:"direct",how:"Read during a turn.",gap:null},get_decision:{support:"direct",how:"Read during a turn.",gap:null},queue:{support:"direct",how:"Read during a turn.",gap:null},get_result:{support:"direct",how:"Read during a turn; the phone card shows the verification verdict, never a local link.",gap:"Secure remote evidence links are not delivered to the phone; a result's screenshots travel through get_result_images."},get_result_images:{support:"direct",how:"Read during a turn; every verified original PNG/JPEG the turn selected (at most 8 per reply, the rest by offset or image id) is sent as a document with a short safe caption after the reply, re-verified before each upload, and a reply to an image binds that exact task and run.",gap:"An image whose record or bytes fail verification, or one Telegram refuses, is named in the chat rather than sent, through the same durable retried part; the operator opens the exact result in the console. Fixture proof only, no physical-phone rendering."},get_controls:{support:"direct",how:"Read during a turn.",gap:null},get_acceptance_evidence:{support:"direct",how:"Shared read-only acceptance packet: exact result, criterion states, gate, reviewer findings, caveats and recorded human acceptance. Screenshot files use get_result_images; marking complete is a propose_action result_accept confirmed behind the phone's own yes/cancel challenge or on the signed-in console.",gap:"A physical-phone completion has not been exercised."},offer_approval:{support:"direct",how:"Pushes the plan's or flow card's own decision card to the owner's paired chat: Approve arms Yes and Cancel, and only the owner's Yes decides, through sealScopeApproval (as a chat-origin approval) or decideFlowCard. Outside the owner's chat-approval setting or a decision's rules it answers why, and the lead opens the console control.",gap:"A flow card's Send back, Edit and a Person chooses step act from the pushed card; a plan's Send back stays in the console. Fixture proof only, no physical-phone rendering."},get_findings:{support:"direct",how:"Read during a turn; a finding's words are shown as untrusted text.",gap:null},show_card:{support:"direct",how:"A card of Toolroll's own records. Telegram shows it as one message: key facts as lines, tables and charts as monospaced text, its links as url buttons.",gap:"A chart is bars of text on Telegram, with every number written out."},show_control:{support:"handoff",how:"The card names the control and the task, with one url button to that exact console control when a trusted https console-url is configured; the button opens the signed-in console and acts on nothing.",gap:"Incomplete phone action: the control itself runs in the console, after sign-in."},propose_task:{support:"direct",how:"Card with Confirm/Dismiss through confirmLeadProposal (filed as a lead proposal, via telegram). The confirmed card links Review & start for the filed task while its scope waits; under a signed automatic mode it says the scope is approved and links the task.",gap:"Under manual approval the plan then needs the person's own yes, on its card."},propose_start:{support:"direct",how:"A protected shared action (task_start): Start work arms Yes and Cancel, and the person's own Yes files and approves one small task under the fast start rules (fastStartBuild), or a typed yes as a reply to the card or as the very next message. When Toolroll can't start it right away it is an ordinary task card.",gap:"Terms too long for one message open the review page, in the signed-in console."},propose_sweep:{support:"direct",how:"A protected shared action (sweep_file): the card lists every item, the shared rules and the success test; confirming files them all and approves each scope.",gap:"Terms too long for one message open the review page, in the signed-in console."},get_sweep:{support:"direct",how:"Reads a sweep's table (each item's state, verdict and result) from the local database through the shared engine.",gap:null},propose_sweep_cancel:{support:"direct",how:"An ordinary shared action (sweep_cancel_rest): Confirm cancels every item not yet ready; finished results stay.",gap:null},propose_scope:{support:"direct",how:"Confirm rewrites the scope through the shared door; the confirmed card links Review & start for the exact task.",gap:"Approving the rewritten scope is a separate yes, on its own card."},propose_next:{support:"direct",how:"Confirm through the shared door with the queue revision it saw.",gap:null},propose_reserve:{support:"direct",how:"Confirm through the shared door.",gap:null},propose_agents:{support:"direct",how:"Confirm through the shared route-edit door; when the change stales the approval, the confirmed card links Review & start for the exact task.",gap:"Renewed approval after the route change happens in the console."},propose_hold:{support:"direct",how:"Confirm through the shared door.",gap:null},propose_unhold:{support:"direct",how:"Confirm through the shared door.",gap:null},propose_steer:{support:"direct",how:"Confirm through the shared door; the guidance is shown verbatim on the card.",gap:null},propose_dependency_repair:{support:"direct",how:"Confirm retry/unlink/replace through the shared door with both projects re-checked.",gap:null},propose_task_action:{support:"direct",how:"stop, retry, plan, wait_for and stop_waiting confirm through the shared door (a stop is audited via telegram); resume, on a person's own tap, lifts the stop.",gap:null},propose_answer:{support:"direct",how:"Confirm answers through the shared door, audited via telegram; an irreversible option arms a second tap first.",gap:null},propose_review:{support:"direct",how:"note saves feedback; revise creates the same-family revision through the shared result service, honouring automatic approval settings; the confirmed card links Review & start for the revision while it waits, or the task once approved.",gap:"Under manual approval the revision is approved in the console, reached from the card's button; under a signed automatic-approval mode it runs unattended."},propose_cancel:{support:"handoff",how:"The door refuses cancel from any card; the card links the exact task's Cancel control when a trusted https console-url is configured, and the cancel is armed there.",gap:"Incomplete phone action: no phone path to cancel by design; the button only opens the task."},toolroll_view_read:{support:"missing",how:"Refused on the phone by design: the workbench's look is the person's own conversation in the console on this computer (view-tools.ts); the tool answers in words and nothing is read or written.",gap:"No phone path by design: restyle from the console on this computer, or edit tui.toml."},toolroll_view_set:{support:"missing",how:"Refused on the phone by design: the workbench's look is the person's own conversation in the console on this computer (view-tools.ts); the tool answers in words and nothing is read or written.",gap:"No phone path by design: restyle from the console on this computer, or edit tui.toml."},list_direct_chats:{support:"direct",how:"Read during a turn: lists active Direct Chat threads in admitted projects with model, effort, status, and token usage.",gap:null},get_direct_chat:{support:"direct",how:"Read during a turn: reads one Direct Chat's full turn transcript, tool history, and token usage from SQLite.",gap:null},get_direct_chat_diff:{support:"direct",how:"Read during a turn: inspects a Direct Chat's changed files, bounded patch, and Ship readiness.",gap:null},manage_direct_chat:{support:"missing",how:"Refused on the phone by design: instant Direct Chat controls require the owner's local solo console session on this computer.",gap:"No phone path by design: stop, rename, switch model, or archive Direct Chats from the local Mac app or console."},get_usage_limits:{support:"direct",how:"Read during a turn: reports live Claude, Codex, and Gemini subscription windows and monthly spend budgets.",gap:null},get_recent_updates:{support:"direct",how:"Read during a turn: aggregates Ready results, completions, failures, updated Direct Chats, open decisions, and recent actions.",gap:null},propose_direct_chat:{support:"handoff",how:"Drafts a confirmation card to start, reply to, or promote a Direct Chat; promote files a Task on confirm while start and reply execute only on the local solo console.",gap:"Incomplete phone action: starting or replying to a local Direct Chat clone runs in the local console or Mac app."},propose_report_followups:{support:"direct",how:"Batch-drafts standard Task confirmation cards from a verified Scout Report's follow-up recommendations through the shared door.",gap:null},shared_browser:{support:"missing",how:"Refused on the phone by design: the Shared Browser is driven only from the person's own conversation in the console on this computer; a phone turn has no browser to drive, so the tool answers in words and nothing opens.",gap:"No phone path by design: open the Shared Browser from the Mac app (⌘⇧B) or the console on this computer, and sign in there when it asks for a takeover."}};export function parityGaps(){return LEAD_TOOL_SCHEMAS.map(tool=>tool.name).filter(name=>CHAT_ACTION_PARITY[name]===void 0)}export function handoffCardText(text,note){return note===null?text:`${text}
|
|
16
|
+
`),buttons:!1});switch(proposal.kind){case"action":{const action=sharedActionPayload(payload);return action?channel!==null&&sharedActionAllowsChallenge(action,channel)?card(phoneText(action.title,200),action.terms.map(term=>phoneText(term,APPROVAL_TERM_CHARS)),"Confirm asks once more before anything is recorded.",action.operation==="task_start"&&channel==="telegram"?TYPED_START_LINE:null):sharedActionNeedsReview(action)?handoff(phoneText(action.title,200),["Review the full details and confirm this exact action."]):card(phoneText(action.title,200),action.terms.map(term=>phoneText(term,1200))):handoff("This action is unavailable.")}case"task":return card(`Create task in ${repoLabel||"the project"}: ${t("title",120)}`,[`Goal: ${t("goal",600)}`,...t("not")===""?[]:[`Not: ${t("not",300)}`],...payload.report===!0?["A scout task: it delivers a report, never a branch."]:[]],payload.report===!0?"Confirm files it; a scout needs no approval.":"Confirm files it. You still approve its scope before work starts.");case"next":return card(`Move ${taskName} to the front of its queue (now ${String(payload.position??"?")} of ${String(payload.of??"?")}).`);case"reserve":return card(payload.worker===null?`Release ${taskName} to the shared queue.`:`Reserve ${taskName} for ${t("worker",80)}.`);case"hold":return card(`Hold ${taskName}: ${t("reason",300)}`,[],"The task waits until the hold is released.");case"unhold":return card(`Release ${taskName} from its hold.`);case"steer":return payload.mode==="pause"?card(`Pause ${taskName}.`,[],"Its current turn stops and the build keeps running; its next note continues it."):payload.mode==="resume"?card(`Resume ${taskName}.`,[],"It goes on where it stopped. No note is sent."):payload.mode==="pause-and-steer"?card(`Pause ${taskName}, then send its agent:`,lines(t("note",1e3),1e3),"Its current turn stops first. Scope stays the same."):typeof payload.questionKey=="string"?card(`Reply to ${taskName}'s agent about "${t("questionKey",40)}":`,lines(t("note",1e3),1e3),"The running agent reads it when it next checks for notes, and the question closes. Scope stays the same."):card(`Guidance for ${taskName}'s agent:`,lines(t("note",1e3),1e3),"A running agent reads it when it next checks for notes; otherwise the next attempt does. Scope stays the same.");case"repair":{const blocker=t("blockerTitle",120)||t("blocker",64),operation=t("operation",16),headline=operation==="retry"?`Queue ${blocker} again; ${taskName} follows when it finishes.`:operation==="unlink"?`Let ${taskName} continue without ${blocker}.`:`Make ${taskName} wait for ${t("replacementTitle",120)||t("replacement",64)} instead of ${blocker}.`;return card(headline)}case"agents":{const parts=[...t("risk")===""?[]:[`risk ${t("risk",32)}`],...t("role")===""?[]:[payload.clear===!0?`${t("role",32)}: back to the recommendation`:`${t("role",32)}: ${t("provider",40)} ${t("model",80)}`]];return card(`Change agents for ${taskName}: ${parts.join("; ")}`,[],"Changing agents or risk needs renewed approval before work starts.")}case"scope":return card(`Rewrite the scope of ${taskName}:`,[`Goal: ${t("goal",600)}`,...t("not")===""?[]:[`Not: ${t("not",300)}`]],"After confirming, the new scope still needs your approval before work starts.");case"answer":{const id=typeof payload.decision=="number"?payload.decision:null,decision=id===null?null:store.getDecision(id);if(decision?.supersededReason!=null)return{text:closedQuestionWords(decision.supersededReason),buttons:!1,closed:!0};const pick=t("option",64),irreversible=payload.reversible===!1,body=decision===null?["(the decision is gone)"]:[`Q: ${phoneText(decision.question,400)}`,...decision.options.map(one=>`${one.id===pick?"→":" "} ${phoneText(one.label,120)}${one.reversible?"":lasting}${one.id===decision.recommendation?" (the builder recommends this)":""}: ${phoneText(one.consequence,300)}`),...t("rationale")===""?[]:[`Why: ${t("rationale",300)}`]];return card(`Answer decision #${String(id??"?")} on ${taskName} with "${t("optionLabel",120)||pick}"`,body,irreversible?phone?"⚠ This choice can't be undone. Confirming asks you once more.":"⚠ This choice is irreversible. Confirming asks you once more.":null)}case"task_action":{const operation=payload.operation,action=isChatTaskAction(operation)?CHAT_TASK_ACTIONS[operation]:null,dependency=t("dependencyTitle",120)||t("dependency",64);return action===null?handoff(`An unavailable action was proposed for ${taskName}.`):card(`${action.label}: ${taskName}${dependency===""?"":` · ${dependency}`}`,[action.detail],null)}case"review":{const revise=payload.operation==="revise",snapshot=payload.snapshot,selected=Array.isArray(payload.notes)?payload.notes:[],saved=(snapshot?.notes??[]).filter(one=>selected.includes(one.id)),note=t("note",LIMITS.note),image=parseFeedbackImage(payload.image),path=t("path",300);return card(`${revise?"Request changes to":"Save feedback on"} result #${String(payload.run??"?")} of ${taskName}`,[...note===""?[]:[`Your feedback${path===""?"":` (${path}${typeof payload.line=="number"?`:${payload.line}`:""})`}:`,...image?[`Screenshot ${image.artifact} · result #${image.run}`]:[],...lines(note,LIMITS.note)],...saved.length===0?[]:["Saved notes included:",...saved.map(one=>`• ${one.image?`Screenshot ${one.image.artifact} · result #${one.image.run}: `:""}${one.path===null?"":`${phoneText(one.path,120)}${one.line===null?"":`:${one.line}`}: `}${phoneText(one.note,LIMITS.note)}`)]],revise?"Creates a revision of the same task. Its approval follows your settings.":"Saves feedback; no work starts.")}case"cancel":return handoff(`Cancel ${taskName}: ${t("reason",300)}`,["Cancelling is armed on the task itself, never from a card."]);case"control":{if(isCardProposal(proposal))return handoff(cardPlainOf(proposal));const control=payload.control,label=isChatControl(control)?CHAT_CONTROLS[control].label:"A console control";return handoff(`${label}${taskName===""?"":` for ${taskName}`}`,["This opens an existing control; nothing changes from here."])}default:return handoff("This kind of proposal cannot be confirmed from the phone.")}}export function proposalOutcomeText(proposal){const outcome=proposal.outcome,said=outcome!==null&&typeof outcome.said=="string"?phoneText(outcome.said,600):"",via=outcome!==null&&typeof outcome.via=="string"?` (from ${outcome.via})`:"";switch(proposal.state){case"confirmed":return`✓ Done${via}${said===""?"":`: ${said}`}`;case"refused":return`✗ Not done${via}${said===""?"":`: ${said}`}`;case"dismissed":return"Dismissed.";case"expired":return"This card expired.";case"confirming":return"Being confirmed elsewhere right now.";default:return"Still waiting for your confirmation."}}export const CHAT_ACTION_PARITY={get_brief:{support:"direct",how:"Reads current tasks, decisions, results and project knowledge from the local database through the shared engine, within the enrolled projects.",gap:"Dedicated Telegram and Slack journeys for this tool and live channel rendering remain unverified."},get_project_activity:{support:"direct",how:"Reads the project's Ready backlog, finished-to-decision elapsed time, explicit revisions and recorded cost for completed families in an accessible enrolled project through the shared engine.",gap:"Dedicated Telegram and Slack journeys for this tool and live channel rendering remain unverified."},get_project_context:{support:"direct",how:"Reads bounded source excerpts or advisory import impact in an accessible enrolled project through the shared engine, with source-search fallback when its index is unavailable.",gap:"Index refresh uses the local CLI. Dedicated Telegram and Slack journeys for this tool and live channel rendering remain unverified."},get_code_map:{support:"direct",how:"Reads the project's generated code map through the shared reader, one labelled answer at most 6 KB, paging one pinned version.",gap:null},refresh_code_map:{support:"direct",how:"Queues a check of the project's main, as Check now does on the page.",gap:null},get_action_status:{support:"direct",how:"Reads the exact saved shared action and its outcome, including completion through secure review.",gap:null},get_actions:{support:"direct",how:"Lists the shared action catalogue and required inputs.",gap:null},propose_action:{support:"direct",how:"Prepares exact shared skill, knowledge, approval, acceptance, cancel and resume actions (the separate review request was removed on 2026-09-21). Short ordinary changes confirm here; protected or long changes use one secure review and record the result on the same proposal.",gap:"Secure review requires a working HTTPS console connection. Real transport verification is required."},recap:{support:"direct",how:"Read by the model during a phone turn over the enrolled ceiling.",gap:null},find_tools:{support:"direct",how:"Searches the lead's own other tools by what it wants to do; what it finds is offered to it from its next step in the same reply. Same on every channel: the shared engine runs it.",gap:null},list_repos:{support:"direct",how:"Read during a turn; projects are r1..rN in enrollment order, as on the console.",gap:null},get_skills:{support:"direct",how:"Reads the same project skill library, saved selections and enabled versions as the console. Use propose_action for changes and tests.",gap:"Skill import and long content require secure review. Folder and GitHub import still use the project Skills screen."},get_project_knowledge:{support:"direct",how:"Read during a turn.",gap:null},get_flaky_tests:{support:"direct",how:"Read during a turn: a project's tests with mixed outcomes, each with the task that would fix it. Fixing one is an ordinary task card.",gap:null},get_models:{support:"direct",how:"Read during a turn: default agents with the exact model each runs, CLI versions and new models. Changes use the labelled Settings → Models page.",gap:null},get_diff:{support:"direct",how:"Read during a turn: the exact result's changed files, then one file's diff, so a requested change names the right file and line.",gap:null},get_check_log:{support:"direct",how:"Read during a turn: the end of the exact result's check log, a page of it, or the lines matching a search.",gap:null},get_project_tools:{support:"direct",how:"Read during a turn: a project's tools, the common tools list and servers found on the computer. Adding one is a secure-review card; secrets are set only on the console's Tools page.",gap:null},get_task_conversation:{support:"direct",how:"Read during a turn: what the person and the lead said in one task's own chat, including what was confirmed there.",gap:null},get_attachment:{support:"direct",how:"Read during a turn: a file the person attached to a message in this conversation (from the iPhone), its text 32 KB at a time; a PDF's own text decoded.",gap:"Attaching files is on the iPhone app; a chat app's own attachments aren't read."},get_flows:{support:"direct",how:"Read during a turn: a person's flows, each one's steps in order and its cards — where each card is, what it waits on, whether it needs them, its owner and its discussion.",gap:null},get_subagents:{support:"direct",how:"Read during a turn: the project's subagents, their soul files, the zones they work, what they did today and the questions they're waiting on.",gap:null},propose_subagent:{support:"direct",how:"Asks a subagent to do something for you (the lead delegates; its answer comes back here), adds one from a template or a soul file, changes one section of its soul file (or the whole short file), pauses, resumes or removes it, passes it a note, or answers its question for the person asked, through the shared confirm door.",gap:"Soul files longer than one message are edited on the console's subagent page; the phone changes one section at a time."},get_flow_insights:{support:"direct",how:"Read during a turn: where each flow's cards pass, fail or are sent back, how long they wait, how its scripts did, and a run's log.",gap:null},propose_flow:{support:"direct",how:"Creates or changes a flow, adds, moves, approves, sends back or cancels its cards, comments on them (@name pings that person), sets their owner, follows them, saves the project's scripts, and adds, pauses or removes its triggers, through the shared confirm door; a long drawing opens the secure review. Work a card files is an ordinary task under the usual approvals.",gap:"The flow canvas itself is on the console; the phone confirms cards but draws nothing. Webhook addresses and the Linear key are set on the console's Triggers panel."},commit_to:{support:"direct",how:"Records what the lead promised to follow up on (a task, attempt, check or time; 7 days at most). The follow pass says one line when it is met, in the shared conversation and on the chat the promise was made on.",gap:null},release_commitment:{support:"direct",how:"Stops following up on one of the person's open promises, with the reason.",gap:null},remember:{support:"direct",how:"Proposes a correction or lasting preference as a decision, project instruction or about-you card, through the shared confirm door; an about-you card shows the line it replaces.",gap:null},manage_standing_directions:{support:"direct",how:"Runs during a turn: lists Standing Directions, or adds one turned off, in the same store Settings → Standing directions edits, where the person turns it on, off or removes it; a project direction names one of the person's admitted projects.",gap:null},get_person:{support:"direct",how:"Read during a turn: one person, subagent or team chat in full, with their open tasks.",gap:null},get_integrations:{support:"direct",how:"Read during a turn: which chat apps, email, GitHub, project tools and monitoring are Connected, Not set up or Broken, as Settings → Integrations shows them.",gap:null},get_capabilities:{support:"direct",how:"Read during a turn: which agents are signed in, which workers are online, which tools and skills work, which integrations are connected and what checks the project runs, each with its next step and settings link.",gap:null},ask_owner:{support:"direct",how:"One question with 2-4 options and Something else, drawn as buttons under the reply; the tapped option is sent as the person's next message.",gap:null},search_project_memory:{support:"direct",how:"Read during a turn: one search over decisions, references, lessons and the conversations the person may read.",gap:null},list_tasks:{support:"direct",how:"Read during a turn.",gap:null},tidy_preview:{support:"direct",how:"Read during a turn: what Put away old tasks would put away now and why. Only a person puts tasks away, on the console or with the CLI command it names.",gap:null},get_task:{support:"direct",how:"Read during a turn; a reply to a result message pins the exact execution.",gap:null},get_agents:{support:"direct",how:"Read during a turn.",gap:null},list_decisions:{support:"direct",how:"Read during a turn.",gap:null},get_decision:{support:"direct",how:"Read during a turn.",gap:null},queue:{support:"direct",how:"Read during a turn.",gap:null},get_result:{support:"direct",how:"Read during a turn; the phone card shows the verification verdict, never a local link.",gap:"Secure remote evidence links are not delivered to the phone; a result's screenshots travel through get_result_images."},get_result_images:{support:"direct",how:"Read during a turn; every verified original PNG/JPEG the turn selected (at most 8 per reply, the rest by offset or image id) is sent as a document with a short safe caption after the reply, re-verified before each upload, and a reply to an image binds that exact task and run.",gap:"An image whose record or bytes fail verification, or one Telegram refuses, is named in the chat rather than sent, through the same durable retried part; the operator opens the exact result in the console. Fixture proof only, no physical-phone rendering."},get_controls:{support:"direct",how:"Read during a turn.",gap:null},get_acceptance_evidence:{support:"direct",how:"Shared read-only acceptance packet: exact result, criterion states, gate, reviewer findings, caveats and recorded human acceptance. Screenshot files use get_result_images; marking complete is a propose_action result_accept confirmed behind the phone's own yes/cancel challenge or on the signed-in console.",gap:"A physical-phone completion has not been exercised."},offer_approval:{support:"direct",how:"Pushes the plan's or flow card's own decision card to the owner's paired chat: Approve arms Yes and Cancel, and only the owner's Yes decides, through sealScopeApproval (as a chat-origin approval) or decideFlowCard. Outside the owner's chat-approval setting or a decision's rules it answers why, and the lead opens the console control.",gap:"A flow card's Send back, Edit and a Person chooses step act from the pushed card; a plan's Send back stays in the console. Fixture proof only, no physical-phone rendering."},get_findings:{support:"direct",how:"Read during a turn; a finding's words are shown as untrusted text.",gap:null},show_card:{support:"direct",how:"A card of Toolroll's own records. Telegram shows it as one message: key facts as lines, tables and charts as monospaced text, its links as url buttons.",gap:"A chart is bars of text on Telegram, with every number written out."},show_control:{support:"handoff",how:"The card names the control and the task, with one url button to that exact console control when a trusted https console-url is configured; the button opens the signed-in console and acts on nothing.",gap:"Incomplete phone action: the control itself runs in the console, after sign-in."},propose_task:{support:"direct",how:"Card with Confirm/Dismiss through confirmLeadProposal (filed as a lead proposal, via telegram). The confirmed card links Review & start for the filed task while its scope waits; under a signed automatic mode it says the scope is approved and links the task.",gap:"Under manual approval the plan then needs the person's own yes, on its card."},propose_start:{support:"direct",how:"A protected shared action (task_start): Start work arms Yes and Cancel, and the person's own Yes files and approves one small task under the fast start rules (fastStartBuild), or a typed yes as a reply to the card or as the very next message. When Toolroll can't start it right away it is an ordinary task card.",gap:"Terms too long for one message open the review page, in the signed-in console."},propose_sweep:{support:"direct",how:"A protected shared action (sweep_file): the card lists every item, the shared rules and the success test; confirming files them all and approves each scope.",gap:"Terms too long for one message open the review page, in the signed-in console."},get_sweep:{support:"direct",how:"Reads a sweep's table (each item's state, verdict and result) from the local database through the shared engine.",gap:null},propose_sweep_cancel:{support:"direct",how:"An ordinary shared action (sweep_cancel_rest): Confirm cancels every item not yet ready; finished results stay.",gap:null},propose_scope:{support:"direct",how:"Confirm rewrites the scope through the shared door; the confirmed card links Review & start for the exact task.",gap:"Approving the rewritten scope is a separate yes, on its own card."},propose_next:{support:"direct",how:"Confirm through the shared door with the queue revision it saw.",gap:null},propose_reserve:{support:"direct",how:"Confirm through the shared door.",gap:null},propose_agents:{support:"direct",how:"Confirm through the shared route-edit door; when the change stales the approval, the confirmed card links Review & start for the exact task.",gap:"Renewed approval after the route change happens in the console."},propose_hold:{support:"direct",how:"Confirm through the shared door.",gap:null},propose_unhold:{support:"direct",how:"Confirm through the shared door.",gap:null},propose_steer:{support:"direct",how:"Confirm through the shared door; the guidance is shown verbatim on the card.",gap:null},propose_dependency_repair:{support:"direct",how:"Confirm retry/unlink/replace through the shared door with both projects re-checked.",gap:null},propose_task_action:{support:"direct",how:"stop, retry, plan, wait_for and stop_waiting confirm through the shared door (a stop is audited via telegram); resume, on a person's own tap, lifts the stop.",gap:null},propose_answer:{support:"direct",how:"Confirm answers through the shared door, audited via telegram; an irreversible option arms a second tap first.",gap:null},propose_review:{support:"direct",how:"note saves feedback; revise creates the same-family revision through the shared result service, honouring automatic approval settings; the confirmed card links Review & start for the revision while it waits, or the task once approved.",gap:"Under manual approval the revision is approved in the console, reached from the card's button; under a signed automatic-approval mode it runs unattended."},propose_cancel:{support:"handoff",how:"The door refuses cancel from any card; the card links the exact task's Cancel control when a trusted https console-url is configured, and the cancel is armed there.",gap:"Incomplete phone action: no phone path to cancel by design; the button only opens the task."},toolroll_view_read:{support:"missing",how:"Refused on the phone by design: the workbench's look is the person's own conversation in the console on this computer (view-tools.ts); the tool answers in words and nothing is read or written.",gap:"No phone path by design: restyle from the console on this computer, or edit tui.toml."},toolroll_view_set:{support:"missing",how:"Refused on the phone by design: the workbench's look is the person's own conversation in the console on this computer (view-tools.ts); the tool answers in words and nothing is read or written.",gap:"No phone path by design: restyle from the console on this computer, or edit tui.toml."},list_direct_chats:{support:"direct",how:"Read during a turn: lists active Direct Chat threads in admitted projects with model, effort, status, and token usage.",gap:null},get_direct_chat:{support:"direct",how:"Read during a turn: reads one Direct Chat's full turn transcript, tool history, and token usage from SQLite.",gap:null},get_direct_chat_diff:{support:"direct",how:"Read during a turn: inspects a Direct Chat's changed files, bounded patch, and Ship readiness.",gap:null},manage_direct_chat:{support:"missing",how:"Refused on the phone by design: instant Direct Chat controls require the owner's local solo console session on this computer.",gap:"No phone path by design: stop, rename, switch model, or archive Direct Chats from the local Mac app or console."},get_usage_limits:{support:"direct",how:"Read during a turn: reports live Claude, Codex, and Gemini subscription windows and monthly spend budgets.",gap:null},get_recent_updates:{support:"direct",how:"Read during a turn: aggregates Ready results, completions, failures, updated Direct Chats, open decisions, and recent actions.",gap:null},propose_direct_chat:{support:"handoff",how:"Drafts a confirmation card to start, reply to, or promote a Direct Chat; promote files a Task on confirm while start and reply execute only on the local solo console.",gap:"Incomplete phone action: starting or replying to a local Direct Chat clone runs in the local console or Mac app."},propose_report_followups:{support:"direct",how:"Batch-drafts standard Task confirmation cards from a verified Scout Report's follow-up recommendations through the shared door.",gap:null},shared_browser:{support:"missing",how:"Refused on the phone by design: the Shared Browser is driven only from the person's own conversation in the console on this computer; a phone turn has no browser to drive, so the tool answers in words and nothing opens.",gap:"No phone path by design: open the Shared Browser from the Mac app (⌘⇧B) or the console on this computer, and sign in there when it asks for a takeover."},handoff_task:{support:"direct",how:"Drafts a hand-off card for an existing task through the shared confirm door; confirming moves its live branch and worktree, uncommitted changes and a bounded Handoff Packet included, to the chosen agent.",gap:null},orchestrate_workflow:{support:"direct",how:"Drafts one card for a 2 to 8 stage workflow, each stage naming its agent, through the shared confirm door; confirming files every stage as a task routed to its agent (a sequential stage waits on the one before), and building still follows the approval policy.",gap:null}};export function parityGaps(){return LEAD_TOOL_SCHEMAS.map(tool=>tool.name).filter(name=>CHAT_ACTION_PARITY[name]===void 0)}export function handoffCardText(text,note){return note===null?text:`${text}
|
|
17
17
|
|
|
18
18
|
${note}`}export function confirmedCardText(store,outcome,proposal,note){const said=phoneText(outcome.said,600);if(!outcome.ok)return`✗ Not done: ${said}`;const taskId=outcome.taskId,resume=proposal.kind==="task_action"&&proposal.payload.operation==="resume",revise=proposal.kind==="review"&&proposal.payload.operation==="revise";if(!(proposal.kind==="task"||proposal.kind==="scope"||proposal.kind==="agents"||resume||revise)||taskId===null)return`✓ ${said}`;const state=approvalState(store,taskId),approval=state==="waiting",words=proposal.kind==="task"&&state==="approved"?`${said.split(/ — |\. /)[0]} — approved under your automatic approval settings; nothing more is needed from you.`:revise&&state==="approved"?"Revision created under your automatic approval settings.":said,next=resume&&said.startsWith("Resume requested")?"Nothing has resumed yet: finish it on the task.":approval&¬e!==null?"Approve it in Toolroll on the computer.":"",setup=(approval||resume)&¬e!==null?note:"";return[`✓ ${words}`,...[next,setup].filter(one=>one!=="")].join(`
|
|
19
19
|
|
package/dist/chat-decide.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{routeChangeOf}from"./route-change.js";import{CONFIRM_TTL_MS,NIGHTLY_CHECK_ONLY,RELEASE_MERGES_ONLY,nightlyTaskRef,releaseTaskRef}from"./store.js";import{readDecideActionRow}from"./contracts/chat-callback-rows.js";import{createHash,randomBytes}from"node:crypto";import{acceptAndCompleteAsOperator,assignmentOf,owedAcceptance}from"./assignment.js";import{chatControlHref,chatResultHref}from"./chat-controls.js";import{applyChatTaskAction,chatTaskStamp}from"./chat-task-actions.js";import{chatTitle}from"./chat-voice.js";import{readVerifiedArtifact}from"./evidence.js";import{outboundPrivate,privateWords}from"./outbound-privacy.js";import{chatApproveMode}from"./chat-approval.js";import{parseExecutionPlanDocument}from"./plan.js";import{verifyApproverStanding}from"./principal.js";import{pullRequestFollowOf}from"./pull-request-flow.js";import{requestResultChanges}from"./result-actions.js";import{revisionSourceOf}from"./result-review.js";import{APPROVAL_PROOF,approvalOf,approvalProofDetail,approve,deployGateScope,quarantinedAuthor}from"./scope.js";import{gateWords}from"./approval-policy.js";import{releaseCardOf}from"./release-card.js";import{releaseCiHoldOf,releaseCiHoldWords}from"./release-ci-hold.js";import{phoneText,projectLabel}from"./telegram-status.js";import{cardTermsDigest,chatLimitProblem,permissionPlainWords,scopeTermsText,shownAsWritten,shownTermsDigest}from"./chat-terms.js";import{approvalSummaryOf,EVIDENCE_WORDS,summaryContextOf,summaryText}from"./approval-summary.js";import{YOUIYOUX_CARD_KIND,YOUIYOUX_FILED_VIA,YOUIYOUX_HOME_PATH}from"./contracts/youiyoux-request.js";import{FILED_PER_PASS,requestKindWord,requestPassOf}from"./youiyoux-intake.js";import{discordPlain}from"./reply-shape.js";import{PLATFORM_LIMITS}from"./text-limits.js";import{soloChatSeatRefusal}from"./install-mode.js";export{permissionPlainWords};export const DECIDE_LABELS={accept:"Accept",changes:"Send back",retry:"Retry",approve:"Approve & start","not-now":"Not now",merge:"Merge",look:"Look first",open:"Open result",review:"Review plan",details:"Details",edit:"Edit",yes:"Yes",cancel:"Cancel"};const OFFER_TTL_MS=7*864e5,CHANNEL_NAMES={telegram:"Telegram",slack:"Slack",discord:"Discord",teams:"Teams"},PROMPT_TTL_MS=30*6e4,WHAT_SHOULD_CHANGE="What should change?",sha=text=>createHash("sha256").update(text).digest("hex"),isAct=one=>"act"in one,title=(store,taskId)=>phoneText(chatTitle(store,taskId),60);export{chatApproveMode};export function planInChat(store,taskId,approver,now,channel,root,from){if(from!=="requests"&&store.filedViaOf(taskId)===YOUIYOUX_FILED_VIA)return{ok:!1,why:OUTSIDE_TERMS};const ref=store.lookupRef(taskId),scope=store.getScope(taskId);if(ref===null||ref.repo===null||scope===null)return{ok:!1,why:"This plan isn't available now."};if(approvalOf(scope).approved&&store.modeApprovalLive(ref.id,now))return{ok:!1,why:"This plan is already approved."};if(ref.plan==="requested")return{ok:!1,why:"The plan is still being written."};const mode=chatApproveMode(store,ref.repo,approver,now,channel);if(!mode.ok)return mode;if(store.getTask(taskId)?.state==="cancelled"||store.getTask(taskId)?.state==="done")return{ok:!1,why:"This task is already finished."};const family=store.taskFamilyOf(taskId,[ref.repo],!1);if(family===null||family.problem!==null||family.current.id!==taskId)return{ok:!1,why:"A newer version of this task is current."};const whole=ref.coordinatorCid!==null||quarantinedAuthor(scope.proposedVia??null);if(scope.profileState==="unresolved"||scope.routeEra==null||(scope.termsProblem??null)!==null)return{ok:!1,why:"This plan can't say exactly which agents run, so you approve it in Toolroll."};const limited=chatLimitProblem(scope,mode.limits,mode.source==="setting"?"your chat approval setting":"your mode");if(limited!==null)return{ok:!1,why:limited};const gate=store.approvalGate(taskId,approver,"person");if(gate.verdict==="refuse")return{ok:!1,why:gateWords(gate)};if(store.scopePolicyRefusal(taskId)!==null)return{ok:!1,why:"Your organisation's policy needs this plan approved in Toolroll."};if(ref.revisionBriefArtifact!==null){const brief=store.getArtifact(ref.revisionBriefArtifact);let verified=!1;try{verified=brief!==null&&root!==void 0&&readVerifiedArtifact(root,brief).ok}catch{verified=!1}if(!verified)return{ok:!1,why:"This revision's notes can't be verified here, so you approve it in Toolroll."}}const plan=store.latestPlanArtifact(ref.id);if(plan!==null){let verified=!1;try{verified=root!==void 0&&readVerifiedArtifact(root,plan).ok}catch{verified=!1}if(!verified)return{ok:!1,why:"The saved plan can't be verified here, so you approve it in Toolroll."}}const summaryKey=approvalSummaryOf(scope,summaryContextOf(store,taskId,scope,now)).key;return{ok:!0,modeDigest:mode.digest,source:mode.source,scope,whole,digest:sha(`${scope.digest}:${plan?.sha256??""}:${summaryKey}${whole?`:${cardTermsDigest(scopeTermsText(scope))}`:""}`)}}export function mergeInChat(store,taskId,run,approver,now,channel){const ref=store.lookupRef(taskId);if(ref!==null&&nightlyTaskRef(store,ref.id))return{ok:!1,why:NIGHTLY_CHECK_ONLY};if(ref!==null&&releaseTaskRef(store,ref.id))return{ok:!1,why:RELEASE_MERGES_ONLY};const publication=store.publicationForRun(run),follow=publication===null?null:pullRequestFollowOf(store,publication.id);if(ref===null||ref.repo===null||publication===null||follow===null||publication.prNumber===null)return{ok:!1,why:"This result has no pull request to merge."};if(follow.mergeCommit!==null)return{ok:!1,why:"This pull request is already merged."};if(follow.readyHead!==publication.headSha)return{ok:!1,why:"This pull request changed since this card was sent."};const mode=chatApproveMode(store,ref.repo,approver,now,channel);return mode.ok?{ok:!0,modeDigest:mode.digest,source:mode.source,head:publication.headSha}:mode}const REQUESTS_DIGEST="youiyoux:",OPEN_IN_TOOLROLL="Open in Toolroll",OUTSIDE_TERMS="A youiyoux request is approved from its own youiyoux card, which shows every word, or in Toolroll.",TOO_LONG="its full terms don't fit in one chat message",ROOM=400;function wholeTermsText(store,taskId,scope,now){const summary=approvalSummaryOf(scope,summaryContextOf(store,taskId,scope,now));return`${scopeTermsText(scope)}
|
|
1
|
+
import{routeChangeOf}from"./route-change.js";import{CONFIRM_TTL_MS,NIGHTLY_CHECK_ONLY,RELEASE_MERGES_ONLY,nightlyTaskRef,releaseTaskRef}from"./store.js";import{readDecideActionRow}from"./contracts/chat-callback-rows.js";import{createHash,randomBytes}from"node:crypto";import{acceptAndCompleteAsOperator,assignmentOf,owedAcceptance}from"./assignment.js";import{chatControlHref,chatResultHref}from"./chat-controls.js";import{applyChatTaskAction,chatTaskStamp}from"./chat-task-actions.js";import{chatTitle}from"./chat-voice.js";import{readVerifiedArtifact}from"./evidence.js";import{outboundPrivate,privateWords}from"./outbound-privacy.js";import{chatApproveMode}from"./chat-approval.js";import{parseExecutionPlanDocument}from"./plan.js";import{verifyApproverStanding}from"./principal.js";import{pullRequestFollowOf}from"./pull-request-flow.js";import{requestResultChanges}from"./result-actions.js";import{revisionSourceOf}from"./result-review.js";import{APPROVAL_PROOF,RELEASE_PASSKEY_REQUIRED,approvalOf,approvalProofDetail,approve,deployGateScope,quarantinedAuthor,releaseCheckScope}from"./scope.js";import{releaseSheetHref}from"./release-approval.js";import{gateWords}from"./approval-policy.js";import{releaseCardOf}from"./release-card.js";import{releaseCiHoldOf,releaseCiHoldWords}from"./release-ci-hold.js";import{phoneText,projectLabel}from"./telegram-status.js";import{cardTermsDigest,chatLimitProblem,permissionPlainWords,scopeTermsText,shownAsWritten,shownTermsDigest}from"./chat-terms.js";import{approvalSummaryOf,EVIDENCE_WORDS,summaryContextOf,summaryText}from"./approval-summary.js";import{YOUIYOUX_CARD_KIND,YOUIYOUX_FILED_VIA,YOUIYOUX_HOME_PATH}from"./contracts/youiyoux-request.js";import{FILED_PER_PASS,requestKindWord,requestPassOf}from"./youiyoux-intake.js";import{discordPlain}from"./reply-shape.js";import{PLATFORM_LIMITS}from"./text-limits.js";import{soloChatSeatRefusal}from"./install-mode.js";export{permissionPlainWords};export const DECIDE_LABELS={accept:"Accept",changes:"Send back",retry:"Retry",approve:"Approve & start","not-now":"Not now",merge:"Merge",look:"Look first",open:"Open result",review:"Review plan",details:"Details",edit:"Edit",yes:"Yes",cancel:"Cancel"};const OFFER_TTL_MS=7*864e5,CHANNEL_NAMES={telegram:"Telegram",slack:"Slack",discord:"Discord",teams:"Teams"},PROMPT_TTL_MS=30*6e4,WHAT_SHOULD_CHANGE="What should change?",sha=text=>createHash("sha256").update(text).digest("hex"),isAct=one=>"act"in one,title=(store,taskId)=>phoneText(chatTitle(store,taskId),60);export{chatApproveMode};export function planInChat(store,taskId,approver,now,channel,root,from){if(from!=="requests"&&store.filedViaOf(taskId)===YOUIYOUX_FILED_VIA)return{ok:!1,why:OUTSIDE_TERMS};const ref=store.lookupRef(taskId),scope=store.getScope(taskId);if(ref===null||ref.repo===null||scope===null)return{ok:!1,why:"This plan isn't available now."};if(approvalOf(scope).approved&&store.modeApprovalLive(ref.id,now))return{ok:!1,why:"This plan is already approved."};if(ref.plan==="requested")return{ok:!1,why:"The plan is still being written."};const mode=chatApproveMode(store,ref.repo,approver,now,channel);if(!mode.ok)return mode;if(store.getTask(taskId)?.state==="cancelled"||store.getTask(taskId)?.state==="done")return{ok:!1,why:"This task is already finished."};const family=store.taskFamilyOf(taskId,[ref.repo],!1);if(family===null||family.problem!==null||family.current.id!==taskId)return{ok:!1,why:"A newer version of this task is current."};const whole=ref.coordinatorCid!==null||quarantinedAuthor(scope.proposedVia??null);if(scope.profileState==="unresolved"||scope.routeEra==null||(scope.termsProblem??null)!==null)return{ok:!1,why:"This plan can't say exactly which agents run, so you approve it in Toolroll."};const limited=chatLimitProblem(scope,mode.limits,mode.source==="setting"?"your chat approval setting":"your mode");if(limited!==null)return{ok:!1,why:limited};const gate=store.approvalGate(taskId,approver,"person");if(gate.verdict==="refuse")return{ok:!1,why:gateWords(gate)};if(store.scopePolicyRefusal(taskId)!==null)return{ok:!1,why:"Your organisation's policy needs this plan approved in Toolroll."};if(ref.revisionBriefArtifact!==null){const brief=store.getArtifact(ref.revisionBriefArtifact);let verified=!1;try{verified=brief!==null&&root!==void 0&&readVerifiedArtifact(root,brief).ok}catch{verified=!1}if(!verified)return{ok:!1,why:"This revision's notes can't be verified here, so you approve it in Toolroll."}}const plan=store.latestPlanArtifact(ref.id);if(plan!==null){let verified=!1;try{verified=root!==void 0&&readVerifiedArtifact(root,plan).ok}catch{verified=!1}if(!verified)return{ok:!1,why:"The saved plan can't be verified here, so you approve it in Toolroll."}}const summaryKey=approvalSummaryOf(scope,summaryContextOf(store,taskId,scope,now)).key;return{ok:!0,modeDigest:mode.digest,source:mode.source,scope,whole,digest:sha(`${scope.digest}:${plan?.sha256??""}:${summaryKey}${whole?`:${cardTermsDigest(scopeTermsText(scope))}`:""}`)}}export function mergeInChat(store,taskId,run,approver,now,channel){const ref=store.lookupRef(taskId);if(ref!==null&&nightlyTaskRef(store,ref.id))return{ok:!1,why:NIGHTLY_CHECK_ONLY};if(ref!==null&&releaseTaskRef(store,ref.id))return{ok:!1,why:RELEASE_MERGES_ONLY};const publication=store.publicationForRun(run),follow=publication===null?null:pullRequestFollowOf(store,publication.id);if(ref===null||ref.repo===null||publication===null||follow===null||publication.prNumber===null)return{ok:!1,why:"This result has no pull request to merge."};if(follow.mergeCommit!==null)return{ok:!1,why:"This pull request is already merged."};if(follow.readyHead!==publication.headSha)return{ok:!1,why:"This pull request changed since this card was sent."};const mode=chatApproveMode(store,ref.repo,approver,now,channel);return mode.ok?{ok:!0,modeDigest:mode.digest,source:mode.source,head:publication.headSha}:mode}const REQUESTS_DIGEST="youiyoux:",OPEN_IN_TOOLROLL="Open in Toolroll",OUTSIDE_TERMS="A youiyoux request is approved from its own youiyoux card, which shows every word, or in Toolroll.",TOO_LONG="its full terms don't fit in one chat message",ROOM=400;function wholeTermsText(store,taskId,scope,now){const summary=approvalSummaryOf(scope,summaryContextOf(store,taskId,scope,now));return`${scopeTermsText(scope)}
|
|
2
2
|
|
|
3
3
|
${summaryText(summary,one=>one.fields.some(field=>field==="goal"||field==="outOfScope"||field==="acceptance"))}`}const wholeCardDigest=(store,taskId,scope,now)=>sha(`${shownTermsDigest(scope)}:${approvalSummaryOf(scope,summaryContextOf(store,taskId,scope,now)).key}`),listedDigest=list=>`${REQUESTS_DIGEST}${list.map(one=>`${one.taskId}=${one.digest}`).join(",")}`,LISTABLE_ID=/^[A-Za-z0-9._-]{1,64}$/;function listedOf(digest){if(!digest.startsWith(REQUESTS_DIGEST))return null;const list=[];for(const one of digest.slice(REQUESTS_DIGEST.length).split(",")){const match=/^([A-Za-z0-9._-]{1,64})=([0-9a-f]{64})$/.exec(one);if(match===null)return null;list.push({taskId:match[1],digest:match[2]})}return list.length===0||list.length>FILED_PER_PASS?null:list}function shownWhole(text,channel){if(!shownAsWritten(text,channel))return!1;switch(channel){case"telegram":return text.length+ROOM<=3900;case"slack":return text.length+ROOM<=PLATFORM_LIMITS.slack;case"discord":return discordPlain(text).length+ROOM<=PLATFORM_LIMITS.discord;case"teams":return!1}}function waitsForApproval(store,taskId){const state=store.getTask(taskId)?.state,scope=store.getScope(taskId);return state!==void 0&&state!=="done"&&state!=="cancelled"&&scope!==null&&!(scope.approvedDigest!=null&&scope.approvedDigest===scope.digest)}function requestsOffer(store,taskId,who,now,channel,root,said){const waiting=requestPassOf(store,taskId).filter(id=>{const ref=store.lookupRef(id);return ref!==null&&ref.repo!==null&&who.repos.includes(ref.repo)&&store.filedViaOf(id)===YOUIYOUX_FILED_VIA&&waitsForApproval(store,id)});if(waiting.length===0)return null;const repo=store.lookupRef(waiting[0]).repo,what=requestKindWord(store,waiting),head=`${waiting.length===1?`A youiyoux ${what} waits`:`${waiting.length} youiyoux ${what}s wait`} for you · ${projectLabel(repo)}`,mode=chatApproveMode(store,repo,who.name,now,channel),items=waiting.map((id,index)=>({n:index+1,taskId:id,name:title(store,id),listed:null,why:null})),block=item=>`${item.n}. ${item.name}
|
|
4
4
|
${wholeTermsText(store,item.taskId,store.getScope(item.taskId),now)}`,compose=()=>{const shown2=items.filter(one=>one.listed!==null),open=items.filter(one=>one.listed===null);return[...said===void 0?[]:[said],head,...shown2.map(block),...open.length===0?[]:[[...shown2.length===0?[]:["Open in Toolroll to approve:"],...open.map(one=>`${one.n}. ${one.name}${one.why===null?"":`: ${one.why}`}`)].join(`
|
|
@@ -23,10 +23,14 @@ ${said}`,rows:skipped.length===0?[]:linksFor(target),tokens:[]}}:{ack,edit:{text
|
|
|
23
23
|
${PRIVATE_CARD}`,rows:link===null?[]:[[link]]}}function decideOfferUnchecked(store,target,who,now,channel,root){const ref=store.lookupRef(target.taskId);if(ref===null||ref.repo===null||!who.repos.includes(ref.repo))return null;switch(target.kind){case"result":{if(root===void 0)return null;const fresh=resultFresh(store,target.taskId,target.run,who,now,root);if(!fresh.ok)return null;const look={label:DECIDE_LABELS.open,path:chatResultHref(target.taskId,target.run,"changes")};return fresh.exception?null:{text:null,rows:[[{act:"accept",run:target.run,digest:fresh.receipt},{act:"changes",run:target.run,digest:fresh.source}],[look]]}}case"failed":{const stamp=retryStamp(store,target.taskId,who);return stamp===null?null:{text:null,rows:[[{act:"retry",run:null,digest:stamp}],[{label:DECIDE_LABELS.look,path:chatControlHref("task",target.taskId)}]]}}case"plan":{const plan=planInChat(store,target.taskId,who.name,now,channel,root);if(!plan.ok)return null;const release=deployGateScope(plan.scope);if(passwordOnlySeal(plan.scope)){let head;try{head=release?releaseCardOf(store,plan.scope,plan.digest,{profile:permissionPlainWords,chat:!0}).short.split(`
|
|
24
24
|
`).slice(0,3):planCardText(store,target.taskId,plan.scope,root,channel).split(`
|
|
25
25
|
`).slice(0,1)}catch{head=[title(store,target.taskId)]}return{text:[...head,"",needsFullCard(plan.scope)].join(`
|
|
26
|
-
`),rows:[[{label:"Approve in Toolroll",path:chatControlHref("approval",target.taskId)}]]}}if(
|
|
26
|
+
`),rows:[[{label:"Approve in Toolroll",path:chatControlHref("approval",target.taskId)}]]}}if(releaseCheckScope(plan.scope)){if(nightlyTaskRef(store,ref.id))return null;let head;try{const card=releaseCardOf(store,plan.scope,plan.digest,{profile:permissionPlainWords,chat:!0});if(outboundPrivate([card.short,card.full])){const link=decideFallbackLink(target);return{text:`${title(store,target.taskId)}
|
|
27
|
+
|
|
28
|
+
${PRIVATE_CARD}`,rows:link===null?[]:[[link]]}}head=card.short.split(`
|
|
29
|
+
`).slice(0,3)}catch{head=[title(store,target.taskId)]}return{text:[...head,"",RELEASE_PASSKEY_REQUIRED].join(`
|
|
30
|
+
`),rows:[[{label:"Approve in Toolroll",path:releaseSheetHref(target.taskId)}]]}}if(release){const release2=releaseInChat(store,target.taskId,who.name,now,channel,"offer",root);if(!release2.ok)return null;const card=release2.card;return{text:channel==="telegram"?card.short:`${card.short}
|
|
27
31
|
|
|
28
32
|
${card.full}`,rows:[[{act:"approve",run:null,digest:releaseDigest(card),label:"Continue"}],[{label:DECIDE_LABELS.edit,path:chatControlHref("approval",target.taskId)},{act:"not-now",run:null,digest:releaseDigest(card)}]],...channel==="telegram"?{file:{name:card.fileName,text:card.full}}:{}}}return{text:planLineOf(store,target.taskId,ref.id),rows:[[{act:"approve",run:null,digest:plan.digest,label:DECIDE_LABELS.review}],[{label:DECIDE_LABELS.details,path:chatControlHref("approval",target.taskId)}]]}}case"requests":return requestsOffer(store,target.taskId,who,now,channel,root);case"merge":{const merge=mergeInChat(store,target.taskId,target.run,who.name,now,channel);return merge.ok?{text:null,rows:[[{act:"merge",run:target.run,digest:merge.head}],[{label:DECIDE_LABELS.open,path:chatResultHref(target.taskId,target.run,"changes")}]]}:null}}}function resultFresh(store,taskId,run,who,now,root){const assignment=assignmentOf(store,taskId,now,{principal:"operator",repos:who.repos},root);if(assignment===null)return{ok:!1,why:"This result isn't available now."};if(assignment.state==="complete")return{ok:!1,why:"This task is already finished."};if(assignment.state==="cancelled")return{ok:!1,why:"This task was cancelled."};const receipt=assignment.receipt;return receipt===null||receipt.taskId!==taskId||receipt.runId!==run?{ok:!1,why:"A newer result is current."}:assignment.state!=="ready-to-check"?{ok:!1,why:"This result isn't ready to finish now."}:{ok:!0,receipt:receipt.digest,source:revisionSourceOf(store.getScope(taskId)?.digest??null),exception:owedAcceptance(receipt)==="exception"}}function retryStamp(store,taskId,who){if(store.getTask(taskId)?.state!=="failed")return null;const stamp=chatTaskStamp(store,who,taskId);return stamp===null?null:sha(stamp)}export function offerFingerprint(offer){return sha(JSON.stringify(offer))}function readAction(raw){const read=readDecideActionRow(raw);if(!read.ok)return read;const{task_id:taskId,expires_at:expiresAt,consumed_at:consumedAt,created_at:_created,...row}=read.value;return{ok:!0,value:{...row,taskId,expiresAt,consumedAt}}}function mint(store,seat,message,spec,taskId,phase,now){const token=`d:${randomBytes(12).toString("hex")}`;return store.handle.prepare(`INSERT INTO chat_decide_action (token, channel, binding, chat, message, act, phase, task_id, run, digest, created_at, expires_at)
|
|
29
|
-
VALUES (?,?,?,?,?,?,?,?,?,?,?,?)`).run(token,seat.channel,seat.binding,seat.chat,message,spec.act,phase,taskId,spec.run,spec.digest,now.toISOString(),new Date(now.getTime()+(phase==="offer"?OFFER_TTL_MS:CONFIRM_TTL_MS)).toISOString()),token}export function mintDecideButtons(store,seat,target,offer,now,message=null){const tokens=[];return{rows:offer.rows.map(row=>row.map(one=>{if(!isAct(one))return{label:one.label,link:one};const token=mint(store,seat,message,one,one.taskId??target.taskId,"offer",now);return tokens.push(token),{label:one.label??DECIDE_LABELS[one.act],token}})),tokens}}export function placeDecideTokens(store,tokens,message){const place=store.handle.prepare("UPDATE chat_decide_action SET message = ? WHERE token = ? AND message IS NULL");for(const token of tokens)place.run(message,token)}export function retireDecideTokens(store,channel,chat,message,now){store.handle.prepare("UPDATE chat_decide_action SET consumed_at = ? WHERE channel = ? AND chat = ? AND message = ? AND consumed_at IS NULL").run(now.toISOString(),channel,chat,message)}export function dropDecideTokens(store,tokens,now){const drop=store.handle.prepare("UPDATE chat_decide_action SET consumed_at = ? WHERE token = ? AND consumed_at IS NULL");for(const token of tokens)drop.run(now.toISOString(),token)}export function hasLiveDecideTokens(store,channel,chat,message,now){return store.handle.prepare("SELECT 1 FROM chat_decide_action WHERE channel = ? AND chat = ? AND message = ? AND consumed_at IS NULL AND expires_at > ? LIMIT 1").get(channel,chat,message,now.toISOString())!==void 0}export function isDecideToken(store,token){return token.startsWith("d:")&&store.handle.prepare("SELECT 1 FROM chat_decide_action WHERE token = ?").get(token)!==void 0}const RELEASE_DIGEST="release:",needsFullCard=scope=>`This ${deployGateScope(scope)?"release":"plan"}'s checks run outside the sandbox, so this card can't approve it. Approve it in Toolroll, or ask your lead for its approval card, which shows every term.`,passwordOnlySeal=scope=>{const profile=scope.profile;return profile!=null&&(profile.checkAccess!==void 0||profile.machLookup!==void 0)},releaseDigest=card=>`${RELEASE_DIGEST}${card.digest}`;export function privateReleaseChat(store,seat){const row=store.handle.prepare("SELECT member, channel, approver FROM chat_binding WHERE provider = ? AND id = ? AND revoked IS NULL").get(seat.channel,seat.binding);return row===void 0||String(row.approver)!==seat.approver||seat.chat!==String(row.channel)?!1:seat.channel==="telegram"?/^[1-9][0-9]*$/.test(seat.chat)&&seat.chat===String(row.member):seat.channel==="slack"?/^D[A-Z0-9]+$/.test(seat.chat):!1}function releaseInChat(store,taskId,approver,now,channel,seat,root){const plan=planInChat(store,taskId,approver,now,channel,root);if(!plan.ok)return plan;if(!deployGateScope(plan.scope))return{ok:!1,why:"This plan isn't a release."};if(passwordOnlySeal(plan.scope))return{ok:!1,why:needsFullCard(plan.scope)};const ref=store.lookupRef(taskId);if(ref===null||nightlyTaskRef(store,ref.id))return{ok:!1,why:NIGHTLY_CHECK_ONLY};if(seat!=="offer"&&(seat.channel!==channel||!privateReleaseChat(store,seat)))return{ok:!1,why:"A release is approved only in your private chat with Toolroll."};let card;try{card=releaseCardOf(store,plan.scope,plan.digest,{profile:permissionPlainWords,chat:!0})}catch{return{ok:!1,why:"This release's terms can't be shown here, so you approve it in Toolroll."}}return plan.scope.releaseTerms!=null&&card.changes.commits===null?{ok:!1,why:"This release's list of changes couldn't be read, so you approve it in Toolroll."}:{ok:!0,card,modeDigest:plan.modeDigest,source:plan.source,scope:plan.scope}}const QUESTIONS={accept:name=>`Accept "${name}"?`,retry:name=>`Retry "${name}"? It queues another attempt.`,approve:name=>`Approve and start "${name}"?`,merge:name=>`Merge "${name}"?`};function targetOf(row){if(row.digest.startsWith(REQUESTS_DIGEST))return{kind:"requests",taskId:row.taskId};switch(row.act){case"accept":case"changes":return{kind:"result",taskId:row.taskId,run:row.run??0};case"retry":return{kind:"failed",taskId:row.taskId};case"merge":return{kind:"merge",taskId:row.taskId,run:row.run??0};default:return{kind:"plan",taskId:row.taskId}}}function releaseContinue(store,seat,message,taskId,name,card,now,ack,lead){const spec={act:"approve",run:null,digest:releaseDigest(card)},yes=mint(store,seat,message,spec,taskId,"yes",now),cancel=mint(store,seat,message,spec,taskId,"cancel",now),text=`${seat.channel==="telegram"?card.short:`${card.short}
|
|
33
|
+
VALUES (?,?,?,?,?,?,?,?,?,?,?,?)`).run(token,seat.channel,seat.binding,seat.chat,message,spec.act,phase,taskId,spec.run,spec.digest,now.toISOString(),new Date(now.getTime()+(phase==="offer"?OFFER_TTL_MS:CONFIRM_TTL_MS)).toISOString()),token}export function mintDecideButtons(store,seat,target,offer,now,message=null){const tokens=[];return{rows:offer.rows.map(row=>row.map(one=>{if(!isAct(one))return{label:one.label,link:one};const token=mint(store,seat,message,one,one.taskId??target.taskId,"offer",now);return tokens.push(token),{label:one.label??DECIDE_LABELS[one.act],token}})),tokens}}export function placeDecideTokens(store,tokens,message){const place=store.handle.prepare("UPDATE chat_decide_action SET message = ? WHERE token = ? AND message IS NULL");for(const token of tokens)place.run(message,token)}export function retireDecideTokens(store,channel,chat,message,now){store.handle.prepare("UPDATE chat_decide_action SET consumed_at = ? WHERE channel = ? AND chat = ? AND message = ? AND consumed_at IS NULL").run(now.toISOString(),channel,chat,message)}export function dropDecideTokens(store,tokens,now){const drop=store.handle.prepare("UPDATE chat_decide_action SET consumed_at = ? WHERE token = ? AND consumed_at IS NULL");for(const token of tokens)drop.run(now.toISOString(),token)}export function hasLiveDecideTokens(store,channel,chat,message,now){return store.handle.prepare("SELECT 1 FROM chat_decide_action WHERE channel = ? AND chat = ? AND message = ? AND consumed_at IS NULL AND expires_at > ? LIMIT 1").get(channel,chat,message,now.toISOString())!==void 0}export function isDecideToken(store,token){return token.startsWith("d:")&&store.handle.prepare("SELECT 1 FROM chat_decide_action WHERE token = ?").get(token)!==void 0}const RELEASE_DIGEST="release:",needsFullCard=scope=>`This ${deployGateScope(scope)?"release":"plan"}'s checks run outside the sandbox, so this card can't approve it. Approve it in Toolroll, or ask your lead for its approval card, which shows every term.`,passwordOnlySeal=scope=>{const profile=scope.profile;return profile!=null&&(profile.checkAccess!==void 0||profile.machLookup!==void 0)},releaseDigest=card=>`${RELEASE_DIGEST}${card.digest}`;export function privateReleaseChat(store,seat){const row=store.handle.prepare("SELECT member, channel, approver FROM chat_binding WHERE provider = ? AND id = ? AND revoked IS NULL").get(seat.channel,seat.binding);return row===void 0||String(row.approver)!==seat.approver||seat.chat!==String(row.channel)?!1:seat.channel==="telegram"?/^[1-9][0-9]*$/.test(seat.chat)&&seat.chat===String(row.member):seat.channel==="slack"?/^D[A-Z0-9]+$/.test(seat.chat):!1}function releaseInChat(store,taskId,approver,now,channel,seat,root){const plan=planInChat(store,taskId,approver,now,channel,root);if(!plan.ok)return plan;if(!deployGateScope(plan.scope))return{ok:!1,why:"This plan isn't a release."};if(releaseCheckScope(plan.scope))return{ok:!1,why:RELEASE_PASSKEY_REQUIRED};if(passwordOnlySeal(plan.scope))return{ok:!1,why:needsFullCard(plan.scope)};const ref=store.lookupRef(taskId);if(ref===null||nightlyTaskRef(store,ref.id))return{ok:!1,why:NIGHTLY_CHECK_ONLY};if(seat!=="offer"&&(seat.channel!==channel||!privateReleaseChat(store,seat)))return{ok:!1,why:"A release is approved only in your private chat with Toolroll."};let card;try{card=releaseCardOf(store,plan.scope,plan.digest,{profile:permissionPlainWords,chat:!0})}catch{return{ok:!1,why:"This release's terms can't be shown here, so you approve it in Toolroll."}}return plan.scope.releaseTerms!=null&&card.changes.commits===null?{ok:!1,why:"This release's list of changes couldn't be read, so you approve it in Toolroll."}:{ok:!0,card,modeDigest:plan.modeDigest,source:plan.source,scope:plan.scope}}const QUESTIONS={accept:name=>`Accept "${name}"?`,retry:name=>`Retry "${name}"? It queues another attempt.`,approve:name=>`Approve and start "${name}"?`,merge:name=>`Merge "${name}"?`};function targetOf(row){if(row.digest.startsWith(REQUESTS_DIGEST))return{kind:"requests",taskId:row.taskId};switch(row.act){case"accept":case"changes":return{kind:"result",taskId:row.taskId,run:row.run??0};case"retry":return{kind:"failed",taskId:row.taskId};case"merge":return{kind:"merge",taskId:row.taskId,run:row.run??0};default:return{kind:"plan",taskId:row.taskId}}}function releaseContinue(store,seat,message,taskId,name,card,now,ack,lead){const spec={act:"approve",run:null,digest:releaseDigest(card)},yes=mint(store,seat,message,spec,taskId,"yes",now),cancel=mint(store,seat,message,spec,taskId,"cancel",now),text=`${seat.channel==="telegram"?card.short:`${card.short}
|
|
30
34
|
|
|
31
35
|
${card.full}`}${lead===null?"":`
|
|
32
36
|
|
|
@@ -61,7 +65,7 @@ ${QUESTIONS[row.act](name)}`,rows:[[{label:DECIDE_LABELS.yes,token:yes},{label:D
|
|
|
61
65
|
|
|
62
66
|
${said}`,rows,tokens:[]}}),notDone=said=>({ack:"Not done.",edit:{text:`${body}
|
|
63
67
|
|
|
64
|
-
✗ Not done: ${said}`,rows:linksFor(target),tokens:[]}});switch(row.act){case"accept":{if(input.root===void 0)return notDone("this chat can't read the saved result. Open it in Toolroll.");const finished=acceptAndCompleteAsOperator(store,row.taskId,{runId:row.run,receiptDigest:row.digest,note:null},who,now,input.root);return finished.ok?done("✓ Accepted and finished. The recorded checks are unchanged."):notDone(finished.message)}case"retry":{const stamp=chatTaskStamp(store,who,row.taskId),retried=applyChatTaskAction(store,who,{task:row.taskId,operation:"retry",stamp},now,!0,input.root===void 0?{}:{evidenceRoot:input.root});return retried.ok?done("✓ Queued again. Existing approvals and holds still apply."):notDone(retried.message)}case"approve":{if(row.digest.startsWith(RELEASE_DIGEST)){const ciHold=releaseCiHoldOf(store,row.taskId);if(ciHold!==null)return notDone(releaseCiHoldWords(ciHold));const release=releaseInChat(store,row.taskId,who.name,now,seat.channel,seat,input.root);if(!release.ok)return notDone(release.why);const cardDigest=release.card.digest;if(!store.sealScopeApproval(row.taskId,who.name,now,{},{kind:"chat",modeDigest:release.modeDigest,card:"release",cardDigest}))return notDone("the release couldn't be approved from chat. Open it in Toolroll.");const sealedDigest=store.getScope(row.taskId)?.approvedDigest??"";store.recordAction({at:now.toISOString(),actor:who.name,repo:ref.repo,taskId:row.taskId,runId:null,action:APPROVAL_PROOF,outcome:"chat",source:"request",detail:JSON.stringify({v:1,at:now.toISOString(),generation:store.accountOf(who.name)?.generation??0,digest:sealedDigest,card:"release",cardDigest})});const where=`${CHANNEL_NAMES[seat.channel]} · chat binding #${seat.binding}`;store.recordAction({at:now.toISOString(),actor:who.name,repo:ref.repo,taskId:row.taskId,runId:null,action:"release approved in chat",outcome:"approved",source:"request",detail:`via ${where} · ${release.source} ${release.modeDigest} · card ${cardDigest}`});const terms=release.scope.releaseTerms??null;return store.enqueueNotification({dedupeKey:`release-approved-chat:${row.taskId}:${cardDigest}`,kind:"release-approved",recipient:who.name,pushClass:"attention",subject:`Release${terms===null?"":` ${terms.packageVersion}`} approved from ${CHANNEL_NAMES[seat.channel]}`,body:`You approved "${name}"${terms===null?"":` (${terms.approvedSha.slice(0,7)}, pull request #${terms.pr})`} from ${CHANNEL_NAMES[seat.channel]}. If that wasn't you, stop it in Toolroll now.`,link:chatControlHref("task",row.taskId),source:{taskRef:ref.id}},now),done("✓ Release approved. It deploys when its check passes and someone runs the release.")}if(row.digest.startsWith(REQUESTS_DIGEST))return approveRequests(store,seat,who,row.taskId,row.digest,target,body,input.message,input.root,now);const plan=planInChat(store,row.taskId,who.name,now,seat.channel,input.root);if(!plan.ok)return notDone(plan.why);if(deployGateScope(plan.scope))return notDone("This is a release: approve it from its release card.");if(passwordOnlySeal(plan.scope))return notDone(needsFullCard(plan.scope));const words=wholeTermsText(store,row.taskId,plan.scope,now);if(plan.whole&&(plan.digest!==row.digest||!fitsOneMessage(words,seat.channel)||privateWords(words)))return notDone("this plan changed. Open it in Toolroll.");const approved=approve(store,row.taskId,who.name,now,plan.scope.digest,"",{},void 0,{modeDigest:plan.modeDigest,shown:plan.whole?{expect:cardTermsDigest(words),terms:words}:null});return!approved.ok&&approved.reason==="second-approver"?done(gateWords({verdict:"vote",have:approved.have,need:2,already:approved.already})):approved.ok?(store.recordAction({at:now.toISOString(),actor:who.name,repo:ref.repo,taskId:row.taskId,runId:null,action:"plan approved in chat",outcome:"approved",source:"request",detail:`via ${seat.channel} · chat binding #${seat.binding} · ${plan.source} ${plan.modeDigest}`}),done("✓ Approved. Work starts when a worker is free.")):notDone("the plan couldn't be approved from chat. Open it in Toolroll.")}case"merge":{const merge=mergeInChat(store,row.taskId,row.run??0,who.name,now,seat.channel);if(!merge.ok)return notDone(merge.why);const via=`via ${seat.channel} · chat binding #${seat.binding} · ${merge.source} ${merge.modeDigest} · ${merge.head.slice(0,12)}`;return store.recordAction({at:now.toISOString(),actor:who.name,repo:ref.repo,taskId:row.taskId,runId:row.run??null,action:"merge approved in chat",outcome:"approved",source:"request",detail:via}),{ack:"Merging…",edit:{text:`${body}
|
|
68
|
+
✗ Not done: ${said}`,rows:linksFor(target),tokens:[]}});switch(row.act){case"accept":{if(input.root===void 0)return notDone("this chat can't read the saved result. Open it in Toolroll.");const finished=acceptAndCompleteAsOperator(store,row.taskId,{runId:row.run,receiptDigest:row.digest,note:null},who,now,input.root);return finished.ok?done("✓ Accepted and finished. The recorded checks are unchanged."):notDone(finished.message)}case"retry":{const stamp=chatTaskStamp(store,who,row.taskId),retried=applyChatTaskAction(store,who,{task:row.taskId,operation:"retry",stamp},now,!0,input.root===void 0?{}:{evidenceRoot:input.root});return retried.ok?done("✓ Queued again. Existing approvals and holds still apply."):notDone(retried.message)}case"approve":{if(row.digest.startsWith(RELEASE_DIGEST)){if(releaseCheckScope(store.getScope(row.taskId)))return notDone(RELEASE_PASSKEY_REQUIRED);const ciHold=releaseCiHoldOf(store,row.taskId);if(ciHold!==null)return notDone(releaseCiHoldWords(ciHold));const release=releaseInChat(store,row.taskId,who.name,now,seat.channel,seat,input.root);if(!release.ok)return notDone(release.why);const cardDigest=release.card.digest;if(!store.sealScopeApproval(row.taskId,who.name,now,{},{kind:"chat",modeDigest:release.modeDigest,card:"release",cardDigest}))return notDone("the release couldn't be approved from chat. Open it in Toolroll.");const sealedDigest=store.getScope(row.taskId)?.approvedDigest??"";store.recordAction({at:now.toISOString(),actor:who.name,repo:ref.repo,taskId:row.taskId,runId:null,action:APPROVAL_PROOF,outcome:"chat",source:"request",detail:JSON.stringify({v:1,at:now.toISOString(),generation:store.accountOf(who.name)?.generation??0,digest:sealedDigest,card:"release",cardDigest})});const where=`${CHANNEL_NAMES[seat.channel]} · chat binding #${seat.binding}`;store.recordAction({at:now.toISOString(),actor:who.name,repo:ref.repo,taskId:row.taskId,runId:null,action:"release approved in chat",outcome:"approved",source:"request",detail:`via ${where} · ${release.source} ${release.modeDigest} · card ${cardDigest}`});const terms=release.scope.releaseTerms??null;return store.enqueueNotification({dedupeKey:`release-approved-chat:${row.taskId}:${cardDigest}`,kind:"release-approved",recipient:who.name,pushClass:"attention",subject:`Release${terms===null?"":` ${terms.packageVersion}`} approved from ${CHANNEL_NAMES[seat.channel]}`,body:`You approved "${name}"${terms===null?"":` (${terms.approvedSha.slice(0,7)}, pull request #${terms.pr})`} from ${CHANNEL_NAMES[seat.channel]}. If that wasn't you, stop it in Toolroll now.`,link:chatControlHref("task",row.taskId),source:{taskRef:ref.id}},now),done("✓ Release approved. It deploys when its check passes and someone runs the release.")}if(row.digest.startsWith(REQUESTS_DIGEST))return approveRequests(store,seat,who,row.taskId,row.digest,target,body,input.message,input.root,now);const plan=planInChat(store,row.taskId,who.name,now,seat.channel,input.root);if(!plan.ok)return notDone(plan.why);if(releaseCheckScope(plan.scope))return notDone(RELEASE_PASSKEY_REQUIRED);if(deployGateScope(plan.scope))return notDone("This is a release: approve it from its release card.");if(passwordOnlySeal(plan.scope))return notDone(needsFullCard(plan.scope));const words=wholeTermsText(store,row.taskId,plan.scope,now);if(plan.whole&&(plan.digest!==row.digest||!fitsOneMessage(words,seat.channel)||privateWords(words)))return notDone("this plan changed. Open it in Toolroll.");const approved=approve(store,row.taskId,who.name,now,plan.scope.digest,"",{},void 0,{modeDigest:plan.modeDigest,shown:plan.whole?{expect:cardTermsDigest(words),terms:words}:null});return!approved.ok&&approved.reason==="second-approver"?done(gateWords({verdict:"vote",have:approved.have,need:2,already:approved.already})):approved.ok?(store.recordAction({at:now.toISOString(),actor:who.name,repo:ref.repo,taskId:row.taskId,runId:null,action:"plan approved in chat",outcome:"approved",source:"request",detail:`via ${seat.channel} · chat binding #${seat.binding} · ${plan.source} ${plan.modeDigest}`}),done("✓ Approved. Work starts when a worker is free.")):notDone("the plan couldn't be approved from chat. Open it in Toolroll.")}case"merge":{const merge=mergeInChat(store,row.taskId,row.run??0,who.name,now,seat.channel);if(!merge.ok)return notDone(merge.why);const via=`via ${seat.channel} · chat binding #${seat.binding} · ${merge.source} ${merge.modeDigest} · ${merge.head.slice(0,12)}`;return store.recordAction({at:now.toISOString(),actor:who.name,repo:ref.repo,taskId:row.taskId,runId:row.run??null,action:"merge approved in chat",outcome:"approved",source:"request",detail:via}),{ack:"Merging…",edit:{text:`${body}
|
|
65
69
|
|
|
66
70
|
Merging…`,rows:[],tokens:[]},merge:{runId:row.run??0,taskId:row.taskId,by:who.name,repo:ref.repo,via}}}default:return{ack:"That button doesn't do anything now.",ignored:!0}}}export function recordChatMerge(store,merge,result,now){store.recordAction({at:now.toISOString(),actor:merge.by,repo:merge.repo,taskId:merge.taskId,runId:merge.runId,action:"merge from chat",outcome:result.ok?"merged":"failed",source:"request",detail:result.ok?merge.via:`${merge.via} · ${phoneText(result.message,160)}`})}export function mergedText(shown,result){const body=shown.replace(/\n\nMerging…$/,"");return result.ok?`${body}
|
|
67
71
|
|
package/dist/chat-review.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{selectResultImages}from"./chat-evidence.js";import{readVerifiedArtifact}from"./evidence.js";import{hasForbiddenControls,validateNote}from"./decision.js";import{parseFeedbackImage,isRevisionFeedback,revisionSourceOf}from"./result-review.js";import{createResultRevision,feedbackImageProblem}from"./result-actions.js";export function readChatResult(store,who,evidenceRoot,task,run){const ref=store.lookupRef(task);if(ref?.repo==null||!who.repos.includes(ref.repo))return{ok:!1,message:"That task is not in your projects."};const family=store.taskFamilyOf(task,who.repos,!1);if(family===null||family.problem!==null)return{ok:!1,message:"This task's revision history needs repair."};const found=run===void 0?store.runsFor(ref.id).find(one=>(one.role==="builder"||one.role==="repair")&&one.outcome!==null):store.getRun(run);if(found==null||found.taskRef!==ref.id||found.outcome===null)return{ok:!1,message:"There is no finished result for that version yet."};const artifact=store.artifactsFor(found.id).find(one=>one.kind==="terminal-diff");if(artifact===void 0||evidenceRoot===void 0)return{ok:!1,message:"The saved changes are unavailable. Feedback has not been added."};if(!readVerifiedArtifact(evidenceRoot,artifact).ok)return{ok:!1,message:"The saved changes could not be verified. Restore the result before adding feedback."};const images=selectResultImages(store,who,evidenceRoot,task,found.id);return{ok:!0,snapshot:{task,root:family.root.id,execution:family.current.id,run:found.id,artifact:artifact.id,sha:artifact.sha256,source:revisionSourceOf(store.getScope(task)?.digest??null),title:store.getTask(task)?.title??task,images:images.ok?images.selection.images.map(one=>({run:found.id,artifact:one.artifact,sha256:one.sha256})):[],notes:store.liveDiffComments(found.id).filter(isRevisionFeedback).map(one=>({id:one.id,note:one.note,path:one.path,line:one.line,image:one.image??null}))}}}export function reviewInputProblem(note,path,line){if(note!==null){const valid=validateNote(note);if(!valid.ok)return valid.problem}return path!==null&&(path.length>300||path.trim()===""||hasForbiddenControls(path))?"Choose a valid file path.":line!==null&&(path===null||!Number.isInteger(line)||line<1||line>1e6)?"Choose a file and a valid line number.":note===null&&(path!==null||line!==null)?"Write a note before attaching it to a file.":null}export function applyChatReview(store,who,evidenceRoot,request,now,allowMode,origin){try{return store.transact(()=>store.savepoint(()=>{const fail=message=>{throw new ReviewRefusal(message)},{snapshot:saw,operation,note,path,line,notes}=request,problem=reviewInputProblem(note,path,line);if(problem!==null)return fail(problem);const current=readChatResult(store,who,evidenceRoot,saw.task,saw.run);if(!current.ok)return fail(current.message);const live=current.snapshot;if(live.execution!==saw.execution||live.source!==saw.source||live.artifact!==saw.artifact||live.sha!==saw.sha)return fail("This result changed. Review it again before confirming.");if(operation==="revise"&&saw.execution!==saw.task)return fail("A newer revision is current. Review that version before requesting changes.");if(!Array.isArray(notes)||new Set(notes).size!==notes.length||notes.some(id=>!saw.notes.some(n=>n.id===id)||!live.notes.some(n=>n.id===id)))return fail("Some feedback changed or was already used. Review it again.");if(operation==="note"&&(note===null||notes.length>0))return fail("A saved note needs feedback text and cannot consume other notes.");const image=parseFeedbackImage(request.image);if(image===!1||image!==null&¬e===null)return fail("Choose a screenshot and write its feedback again.");const imageProblem=feedbackImageProblem(store,evidenceRoot,live.run,image);if(imageProblem!==null)return fail(imageProblem);const batch=[...notes].sort((a,b)=>a-b);if(note!==null){const id=store.addDiffComment({artifactId:live.artifact,runId:live.run,path,line,note,author:who.name,image},now);if(id===null)return fail("The note could not be saved.");batch.push(id)}if(operation==="note")return{ok:!0,taskId:live.root,run:live.run,said:"Feedback saved. No work started."};if(batch.length===0)return fail("Add feedback or select saved notes before requesting changes.");const result=createResultRevision(store,evidenceRoot,{run:live.run,batch:batch.join(","),source:live.source,actor:who.name,repos:who.repos,allowMode,origin},now);if(!result.ok)return fail(result.message);const scope=store.getScope(result.id),approved=scope?.approvedDigest!=null&&scope.approvedDigest===scope.digest,planning=store.lookupRef(result.id)?.plan==="requested";return{ok:!0,taskId:result.id,run:live.run,said:approved?"Revision created under your automatic approval settings.":planning?"Revision created. Updating the plan with your notes; you'll approve it next.":"Revision created. Review and approve it to start."}}))}catch(error){if(error instanceof ReviewRefusal)return{ok:!1,message:error.message};throw error}}class ReviewRefusal extends Error{}
|
|
1
|
+
import{revisionApproval}from"./server/send-back-build.js";import{selectResultImages}from"./chat-evidence.js";import{readVerifiedArtifact}from"./evidence.js";import{hasForbiddenControls,validateNote}from"./decision.js";import{parseFeedbackImage,isRevisionFeedback,revisionSourceOf}from"./result-review.js";import{createResultRevision,feedbackImageProblem}from"./result-actions.js";export function readChatResult(store,who,evidenceRoot,task,run){const ref=store.lookupRef(task);if(ref?.repo==null||!who.repos.includes(ref.repo))return{ok:!1,message:"That task is not in your projects."};const family=store.taskFamilyOf(task,who.repos,!1);if(family===null||family.problem!==null)return{ok:!1,message:"This task's revision history needs repair."};const found=run===void 0?store.runsFor(ref.id).find(one=>(one.role==="builder"||one.role==="repair")&&one.outcome!==null):store.getRun(run);if(found==null||found.taskRef!==ref.id||found.outcome===null)return{ok:!1,message:"There is no finished result for that version yet."};const artifact=store.artifactsFor(found.id).find(one=>one.kind==="terminal-diff");if(artifact===void 0||evidenceRoot===void 0)return{ok:!1,message:"The saved changes are unavailable. Feedback has not been added."};if(!readVerifiedArtifact(evidenceRoot,artifact).ok)return{ok:!1,message:"The saved changes could not be verified. Restore the result before adding feedback."};const images=selectResultImages(store,who,evidenceRoot,task,found.id);return{ok:!0,snapshot:{task,root:family.root.id,execution:family.current.id,run:found.id,artifact:artifact.id,sha:artifact.sha256,source:revisionSourceOf(store.getScope(task)?.digest??null),title:store.getTask(task)?.title??task,images:images.ok?images.selection.images.map(one=>({run:found.id,artifact:one.artifact,sha256:one.sha256})):[],notes:store.liveDiffComments(found.id).filter(isRevisionFeedback).map(one=>({id:one.id,note:one.note,path:one.path,line:one.line,image:one.image??null}))}}}export function reviewInputProblem(note,path,line){if(note!==null){const valid=validateNote(note);if(!valid.ok)return valid.problem}return path!==null&&(path.length>300||path.trim()===""||hasForbiddenControls(path))?"Choose a valid file path.":line!==null&&(path===null||!Number.isInteger(line)||line<1||line>1e6)?"Choose a file and a valid line number.":note===null&&(path!==null||line!==null)?"Write a note before attaching it to a file.":null}export function applyChatReview(store,who,evidenceRoot,request,now,allowMode,origin){try{return store.transact(()=>store.savepoint(()=>{const fail=message=>{throw new ReviewRefusal(message)},{snapshot:saw,operation,note,path,line,notes}=request,problem=reviewInputProblem(note,path,line);if(problem!==null)return fail(problem);const current=readChatResult(store,who,evidenceRoot,saw.task,saw.run);if(!current.ok)return fail(current.message);const live=current.snapshot;if(live.execution!==saw.execution||live.source!==saw.source||live.artifact!==saw.artifact||live.sha!==saw.sha)return fail("This result changed. Review it again before confirming.");if(operation==="revise"&&saw.execution!==saw.task)return fail("A newer revision is current. Review that version before requesting changes.");if(!Array.isArray(notes)||new Set(notes).size!==notes.length||notes.some(id=>!saw.notes.some(n=>n.id===id)||!live.notes.some(n=>n.id===id)))return fail("Some feedback changed or was already used. Review it again.");if(operation==="note"&&(note===null||notes.length>0))return fail("A saved note needs feedback text and cannot consume other notes.");const image=parseFeedbackImage(request.image);if(image===!1||image!==null&¬e===null)return fail("Choose a screenshot and write its feedback again.");const imageProblem=feedbackImageProblem(store,evidenceRoot,live.run,image);if(imageProblem!==null)return fail(imageProblem);const batch=[...notes].sort((a,b)=>a-b);if(note!==null){const id=store.addDiffComment({artifactId:live.artifact,runId:live.run,path,line,note,author:who.name,image},now);if(id===null)return fail("The note could not be saved.");batch.push(id)}if(operation==="note")return{ok:!0,taskId:live.root,run:live.run,said:"Feedback saved. No work started."};if(batch.length===0)return fail("Add feedback or select saved notes before requesting changes.");const approveNow=request.approveNow===!0&&origin==="person"?revisionApproval(store,who.name,now):void 0,result=createResultRevision(store,evidenceRoot,{...approveNow===void 0?{}:{approveNow,currentResult:()=>{const current2=readChatResult(store,who,evidenceRoot,saw.task);return current2.ok&¤t2.snapshot.execution===saw.execution&¤t2.snapshot.run===saw.run?null:"A newer result is current. Review it before sending back."}},run:live.run,batch:batch.join(","),source:live.source,actor:who.name,repos:who.repos,allowMode,origin},now);if(!result.ok)return fail(result.message);const scope=store.getScope(result.id),approved=scope?.approvedDigest!=null&&scope.approvedDigest===scope.digest,planning=store.lookupRef(result.id)?.plan==="requested";return{ok:!0,taskId:result.id,run:live.run,said:approved?scope?.approvalBasis==="mode"?"Revision created under your automatic approval settings.":"Revision created and approved. It builds next.":planning?"Revision created. Updating the plan with your notes; you'll approve it next.":"Revision created. Review and approve it to start."}}))}catch(error){if(error instanceof ReviewRefusal)return{ok:!1,message:error.message};throw error}}class ReviewRefusal extends Error{}
|
package/dist/chat-terms.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createHash}from"node:crypto";import{
|
|
2
|
-
`)}export function shownTermsDigest(scope){return createHash("sha256").update(JSON.stringify({v:1,scope:scope.digest,shown:scopeTermsText(scope)})).digest("hex")}export function cardTermsDigest(terms){return createHash("sha256").update(JSON.stringify({v:2,shown:terms})).digest("hex")}export function cardShowsScope(scope,terms){if(!terms.includes(scopeTermsText(scope)))return!1;const profile=scope.profile;if(profile==null)return!0;const access=profile.checkAccess,mach=sandboxTermsWords(profile).mach;return(access===void 0||terms.includes(checkAccessWords(access)))&&(mach===null||terms.includes(mach))}export function scopeFullAccess(profile){return profile==null?!1:profile.provider==="claude"?profile.permissionArgv==="bypassPermissions":profile.provider==="gemini"?profile.approvalArgv==="yolo":
|
|
1
|
+
import{createHash}from"node:crypto";import{fullAccessProfile}from"./acp-agents.js";import{checkAccessWords}from"./check-access.js";import{sandboxTermsWords}from"./project-sandbox.js";import{chainTermsLines}from"./scope.js";export function permissionPlainWords(profile){if(profile==null)return null;const full="full access, nothing asks first";return profile.provider==="claude"?profile.permissionArgv==="bypassPermissions"?full:profile.permissionArgv==="auto"?"file edits and routine commands; anything risky stops":"file edits only; commands are refused":profile.provider==="gemini"?profile.approvalArgv==="yolo"?full:"file edits only; other tools are refused":fullAccessProfile(profile)?"full access inside the OS fence, nothing asks first":profile.sandboxMode==="danger-full-access"?full:"file edits and commands inside the project only"}const money=micro=>`$${(micro/1e6).toFixed(2)}`;export function scopeTermsText(scope){const allows=[permissionPlainWords(scope.profile)??"agent permissions not known",scope.budgetMicrousd===null?"no attempt limit":`up to ${money(scope.budgetMicrousd)} per attempt`];return["Goal:",scope.goal,"","Not this:",scope.outOfScope??"Nothing excluded.","",`Files: ${scope.touches.length===0?"any file (no file list)":scope.touches.join(", ")}`,"","Done when:",...scope.acceptance.length===0?["You decide when you review the result."]:scope.acceptance.map(one=>`• ${one.statement} (${one.evidence.join(", ")})`),"",`Starting allows: ${allows.join(" · ")}`,...(chain=>chain.length===0?[]:["","Fallback agents:",...chain])(chainTermsLines(scope))].join(`
|
|
2
|
+
`)}export function shownTermsDigest(scope){return createHash("sha256").update(JSON.stringify({v:1,scope:scope.digest,shown:scopeTermsText(scope)})).digest("hex")}export function cardTermsDigest(terms){return createHash("sha256").update(JSON.stringify({v:2,shown:terms})).digest("hex")}export function cardShowsScope(scope,terms){if(!terms.includes(scopeTermsText(scope)))return!1;const profile=scope.profile;if(profile==null)return!0;const access=profile.checkAccess,mach=sandboxTermsWords(profile).mach;return(access===void 0||terms.includes(checkAccessWords(access)))&&(mach===null||terms.includes(mach))}export function scopeFullAccess(profile){return profile==null?!1:profile.provider==="claude"?profile.permissionArgv==="bypassPermissions":profile.provider==="gemini"?profile.approvalArgv==="yolo":fullAccessProfile(profile)?!0:profile.sandboxMode==="danger-full-access"}export function chatLimitProblem(scope,limits,yours){if(scopeFullAccess(scope.profile)&&!limits.fullAccess)return`This plan asks for more access than ${yours} allows.`;const cap=limits.capMicrousd;return cap!==null&&(scope.budgetMicrousd===null||scope.budgetMicrousd>cap)?`This plan has ${scope.budgetMicrousd===null?"no attempt limit":`a ${money(scope.budgetMicrousd)} attempt limit`}, more than ${yours==="your mode"?"your mode's":"your chat approval limit of"} ${money(cap)}.`:null}export function shownAsWritten(text,channel){switch(channel){case"telegram":case"discord":return!0;case"slack":return!/:[\p{L}\p{N}_+'-]+:/u.test(text);case"teams":return!1}}
|
package/dist/check-levels.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync,readFileSync}from"node:fs";import{join}from"node:path";import{folderAnswers}from"./folder-gate.js";import{approvalOf}from"./scope.js";export const CHECK_LEVELS=["quick","full","off"],isCheckLevel=value=>typeof value=="string"&&CHECK_LEVELS.includes(value),CHECK_LEVEL_WORDS={quick:"Quick",full:"Full",off:"Off"},CHECK_LEVEL_HINTS={quick:"A fast check while building: typecheck and the tests near the change.",full:"The project's full check after every build.",off:"No check. Results are Ready, and say no check ran."};const PROJECT_LEVEL_ACTION="check level changed";export const TASK_LEVEL_ACTION="task checks chosen",RUN_LEVEL_ACTION="checks used",quickVerifyKey=repo=>`quick:${repo}`;export function liveQuickCommand(store,repo){return store.liveVerifyCommand(quickVerifyKey(repo))}export function projectCheckSet(store,repo){return store.liveVerifyCommand(repo)!==null||liveQuickCommand(store,repo)!==null}export const repoClause=repo=>repo===null?["repo IS NULL",[]]:["repo = ?",[repo]];export function repoOfRun(store,runId){const run=store.getRun(runId);return run===null?null:store.refById(run.taskRef)?.repo??null}function newest(store,sql,...params){const row=store.handle.prepare(sql).get(...params);return row===void 0?null:{actor:String(row.actor),at:String(row.at),outcome:String(row.outcome)}}export function projectCheckLevel(store,repo){const row=newest(store,"SELECT actor, at, outcome FROM action_ledger WHERE repo = ? AND task_id IS NULL AND action = ? ORDER BY id DESC LIMIT 1",repo,PROJECT_LEVEL_ACTION);return row===null||!isCheckLevel(row.outcome)?{level:"full",setBy:null,at:null}:{level:row.outcome,setBy:row.actor,at:row.at}}export function setProjectCheckLevel(store,repo,level,by,now){const before=projectCheckLevel(store,repo);return before.level===level&&before.setBy!==null?{changed:!1,before:before.level}:(store.recordAction({at:now.toISOString(),actor:by,repo,taskId:null,runId:null,action:PROJECT_LEVEL_ACTION,outcome:level,source:"policy",detail:`${CHECK_LEVEL_WORDS[before.level]} → ${CHECK_LEVEL_WORDS[level]}`}),{changed:before.level!==level,before:before.level})}export function stampNewProjectLevel(store,repo,now){return newest(store,"SELECT actor, at, outcome FROM action_ledger WHERE repo = ? AND task_id IS NULL AND action = ? LIMIT 1",repo,PROJECT_LEVEL_ACTION)!==null||store.handle.prepare("SELECT 1 FROM verify_command WHERE repo = ? LIMIT 1").get(repo)!==void 0?!1:(store.recordAction({at:now.toISOString(),actor:"system",repo,taskId:null,runId:null,action:PROJECT_LEVEL_ACTION,outcome:"quick",source:"policy",detail:"New project → Quick"}),!0)}export function taskCheckLevel(store,taskId){let id=taskId;for(let depth=0;id!==null&&depth<64;depth++){const ref=store.lookupRef(id),[where,params]=repoClause(ref?.repo??null),row=newest(store,`SELECT actor, at, outcome FROM action_ledger WHERE ${where} AND task_id = ? AND action = ? ORDER BY id DESC LIMIT 1`,...params,id,TASK_LEVEL_ACTION);if(row!==null&&isCheckLevel(row.outcome))return row.outcome;id=ref?.revisionOf??null}return null}export function setTaskCheckLevel(store,taskId,level,by,now){const ref=store.lookupRef(taskId);return ref===null?{ok:!1,message:`No task ${taskId}.`}:approvalOf(store.getScope(taskId)).approved?{ok:!1,message:"This task's plan is already approved, so its checks are fixed. File a new task to change them."}:taskCheckLevel(store,taskId)===level?{ok:!0}:(store.recordAction({at:now.toISOString(),actor:by,repo:ref.repo,taskId,runId:null,action:TASK_LEVEL_ACTION,outcome:level,source:"request",detail:`Checks for this task: ${CHECK_LEVEL_WORDS[level]}`}),{ok:!0})}export function effectiveCheckLevel(store,repo,taskId){const own=taskId===null?null:taskCheckLevel(store,taskId);return own!==null?{level:own,from:"task"}:{level:repo===null?"full":projectCheckLevel(store,repo).level,from:"project"}}export function checkCommandFor(store,repo,level){if(level==="off")return{level:"off",command:null};if(level==="quick"){const quick=liveQuickCommand(store,repo);if(quick!==null)return{level:"quick",command:quick}}return{level:"full",command:store.liveVerifyCommand(repo)}}export function requiredCheckCommandFor(store,repo,taskId,level){return repo===null?null:checkCommandFor(store,repo,level??effectiveCheckLevel(store,repo,taskId).level).command}export function recordRunCheckLevel(store,run,level,from,now){store.recordAction({at:now.toISOString(),actor:"system",repo:run.repo,taskId:run.taskId,runId:run.id,action:RUN_LEVEL_ACTION,outcome:level,source:"work",detail:`${CHECK_LEVEL_WORDS[level]} checks (${from==="task"?"this task's choice":"project setting"})`})}export function runCheckLevel(store,runId){const[where,params]=repoClause(repoOfRun(store,runId)),row=newest(store,`SELECT actor, at, outcome FROM action_ledger WHERE ${where} AND run_id = ? AND action = ? ORDER BY id DESC LIMIT 1`,...params,runId,RUN_LEVEL_ACTION);return row!==null&&isCheckLevel(row.outcome)?row.outcome:null}export function suggestQuickCommand(repo){if(!folderAnswers(repo))return null;const file=join(repo,"package.json");if(!existsSync(file))return null;let scripts={},deps={};try{const parsed=JSON.parse(readFileSync(file,"utf8"));scripts=parsed.scripts??{},deps={...parsed.dependencies,...parsed.devDependencies}}catch{return null}const has=name=>typeof scripts[name]=="string",runner=existsSync(join(repo,"pnpm-lock.yaml"))?"pnpm":existsSync(join(repo,"yarn.lock"))?"yarn":"npm",run=name=>runner==="npm"?`npm run ${name}`:`${runner} ${name}`;if(has("check:quick"))return run("check:quick");const exec=runner==="npm"?"npx":`${runner} exec`,typecheck=["typecheck","type-check","check-types","tsc"].find(has)??null,changed=
|
|
1
|
+
import{existsSync,readFileSync}from"node:fs";import{join}from"node:path";import{folderAnswers}from"./folder-gate.js";import{approvalOf}from"./scope.js";export const CHECK_LEVELS=["quick","full","off"],isCheckLevel=value=>typeof value=="string"&&CHECK_LEVELS.includes(value),CHECK_LEVEL_WORDS={quick:"Quick",full:"Full",off:"Off"},CHECK_LEVEL_HINTS={quick:"A fast check while building: typecheck and the tests near the change.",full:"The project's full check after every build.",off:"No check. Results are Ready, and say no check ran."};const PROJECT_LEVEL_ACTION="check level changed";export const TASK_LEVEL_ACTION="task checks chosen",RUN_LEVEL_ACTION="checks used",quickVerifyKey=repo=>`quick:${repo}`;export function liveQuickCommand(store,repo){return store.liveVerifyCommand(quickVerifyKey(repo))}export function projectCheckSet(store,repo){return store.liveVerifyCommand(repo)!==null||liveQuickCommand(store,repo)!==null}export const repoClause=repo=>repo===null?["repo IS NULL",[]]:["repo = ?",[repo]];export function repoOfRun(store,runId){const run=store.getRun(runId);return run===null?null:store.refById(run.taskRef)?.repo??null}function newest(store,sql,...params){const row=store.handle.prepare(sql).get(...params);return row===void 0?null:{actor:String(row.actor),at:String(row.at),outcome:String(row.outcome)}}export function projectCheckLevel(store,repo){const row=newest(store,"SELECT actor, at, outcome FROM action_ledger WHERE repo = ? AND task_id IS NULL AND action = ? ORDER BY id DESC LIMIT 1",repo,PROJECT_LEVEL_ACTION);return row===null||!isCheckLevel(row.outcome)?{level:"full",setBy:null,at:null}:{level:row.outcome,setBy:row.actor,at:row.at}}export function setProjectCheckLevel(store,repo,level,by,now){const before=projectCheckLevel(store,repo);return before.level===level&&before.setBy!==null?{changed:!1,before:before.level}:(store.recordAction({at:now.toISOString(),actor:by,repo,taskId:null,runId:null,action:PROJECT_LEVEL_ACTION,outcome:level,source:"policy",detail:`${CHECK_LEVEL_WORDS[before.level]} → ${CHECK_LEVEL_WORDS[level]}`}),{changed:before.level!==level,before:before.level})}export function stampNewProjectLevel(store,repo,now){return newest(store,"SELECT actor, at, outcome FROM action_ledger WHERE repo = ? AND task_id IS NULL AND action = ? LIMIT 1",repo,PROJECT_LEVEL_ACTION)!==null||store.handle.prepare("SELECT 1 FROM verify_command WHERE repo = ? LIMIT 1").get(repo)!==void 0?!1:(store.recordAction({at:now.toISOString(),actor:"system",repo,taskId:null,runId:null,action:PROJECT_LEVEL_ACTION,outcome:"quick",source:"policy",detail:"New project → Quick"}),!0)}export function taskCheckLevel(store,taskId){let id=taskId;for(let depth=0;id!==null&&depth<64;depth++){const ref=store.lookupRef(id),[where,params]=repoClause(ref?.repo??null),row=newest(store,`SELECT actor, at, outcome FROM action_ledger WHERE ${where} AND task_id = ? AND action = ? ORDER BY id DESC LIMIT 1`,...params,id,TASK_LEVEL_ACTION);if(row!==null&&isCheckLevel(row.outcome))return row.outcome;id=ref?.revisionOf??null}return null}export function setTaskCheckLevel(store,taskId,level,by,now){const ref=store.lookupRef(taskId);return ref===null?{ok:!1,message:`No task ${taskId}.`}:approvalOf(store.getScope(taskId)).approved?{ok:!1,message:"This task's plan is already approved, so its checks are fixed. File a new task to change them."}:taskCheckLevel(store,taskId)===level?{ok:!0}:(store.recordAction({at:now.toISOString(),actor:by,repo:ref.repo,taskId,runId:null,action:TASK_LEVEL_ACTION,outcome:level,source:"request",detail:`Checks for this task: ${CHECK_LEVEL_WORDS[level]}`}),{ok:!0})}export function effectiveCheckLevel(store,repo,taskId){const own=taskId===null?null:taskCheckLevel(store,taskId);return own!==null?{level:own,from:"task"}:{level:repo===null?"full":projectCheckLevel(store,repo).level,from:"project"}}export function checkCommandFor(store,repo,level){if(level==="off")return{level:"off",command:null};if(level==="quick"){const quick=liveQuickCommand(store,repo);if(quick!==null)return{level:"quick",command:quick}}return{level:"full",command:store.liveVerifyCommand(repo)}}export function requiredCheckCommandFor(store,repo,taskId,level){return repo===null?null:checkCommandFor(store,repo,level??effectiveCheckLevel(store,repo,taskId).level).command}export function recordRunCheckLevel(store,run,level,from,now){store.recordAction({at:now.toISOString(),actor:"system",repo:run.repo,taskId:run.taskId,runId:run.id,action:RUN_LEVEL_ACTION,outcome:level,source:"work",detail:`${CHECK_LEVEL_WORDS[level]} checks (${from==="task"?"this task's choice":"project setting"})`})}export function runCheckLevel(store,runId){const[where,params]=repoClause(repoOfRun(store,runId)),row=newest(store,`SELECT actor, at, outcome FROM action_ledger WHERE ${where} AND run_id = ? AND action = ? ORDER BY id DESC LIMIT 1`,...params,runId,RUN_LEVEL_ACTION);return row!==null&&isCheckLevel(row.outcome)?row.outcome:null}export function suggestQuickCommand(repo){if(!folderAnswers(repo))return null;const file=join(repo,"package.json");if(!existsSync(file))return null;let scripts={},deps={};try{const parsed=JSON.parse(readFileSync(file,"utf8"));scripts=parsed.scripts??{},deps={...parsed.dependencies,...parsed.devDependencies}}catch{return null}const has=name=>typeof scripts[name]=="string",runner=existsSync(join(repo,"pnpm-lock.yaml"))?"pnpm":existsSync(join(repo,"yarn.lock"))?"yarn":"npm",run=name=>runner==="npm"?`npm run ${name}`:`${runner} ${name}`;if(has("check:quick"))return run("check:quick");const exec=runner==="npm"?"npx":`${runner} exec`,typecheck=["typecheck","type-check","check-types","tsc"].find(has)??null,changed='$(git diff --name-only "${TOOLROLL_TASK_BASE}" --)',tests="vitest"in deps?`${exec} vitest related --run ${changed}`:"jest"in deps?`${exec} jest --findRelatedTests --passWithNoTests ${changed}`:null,parts=[typecheck===null?null:run(typecheck),tests].filter(one=>one!==null);return parts.length>0?(tests===null?"":': "${TOOLROLL_TASK_BASE:?Toolroll task base is required}" && ')+parts.join(" && "):has("lint")?run("lint"):null}export function checkLevelFromWords(text){const said=text.toLowerCase().replace(/[’']/g,"'");return/\b(skip|without|no|don't run|do not run|turn off|switch off)\b[^.!?\n]{0,20}\b(the )?(tests|checks)\b/.test(said)||/\b(tests|checks) off\b/.test(said)?"off":/\b(full|all the|every|complete)\s+(test|check)s?\b/.test(said)?"full":/\bquick\s+(test|check)s?\b/.test(said)?"quick":null}
|
package/dist/cli-help.js
CHANGED
|
@@ -1,15 +1,97 @@
|
|
|
1
|
-
import{DEFAULT_MAX_DEPTH}from"./scan.js";export const HELP=`Toolroll
|
|
1
|
+
import{DEFAULT_MAX_DEPTH}from"./scan.js";export const HELP=`Toolroll: local-first workbench for coding agents.
|
|
2
2
|
|
|
3
|
-
toolroll
|
|
4
|
-
|
|
5
|
-
toolroll
|
|
6
|
-
toolroll
|
|
7
|
-
toolroll task
|
|
8
|
-
|
|
9
|
-
toolroll task
|
|
10
|
-
toolroll update
|
|
3
|
+
toolroll open the terminal workbench (--web: browser)
|
|
4
|
+
toolroll demo try sample tasks with no model calls or cost
|
|
5
|
+
toolroll repos add <folder> connect a local repository
|
|
6
|
+
toolroll task add "<change>" --repo . queue a task from the shell
|
|
7
|
+
toolroll task show <id> state, diff summary, checks, and next step
|
|
8
|
+
toolroll task log <id> [-f] tail a task's live output (--sub: subagents)
|
|
9
|
+
toolroll task handoff <id> --to <ag> hand a task's worktree to another coding agent
|
|
10
|
+
toolroll update update to the latest release
|
|
11
|
+
Workbench keys: n new task · a accept · r send back · A agents · H handoff · g goto · ? all keys
|
|
12
|
+
More: toolroll <command> --help (task, repos, config, models, view, card, handoff) · toolroll internals`,REPOS_HELP=`toolroll repos: manage connected local repositories
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
toolroll repos list connected repositories
|
|
15
|
+
toolroll repos add <folder> [--remote <url>]
|
|
16
|
+
connect a local git repository
|
|
17
|
+
toolroll repos remove <folder> disconnect a repository (tasks and results stay)
|
|
18
|
+
toolroll repos add-from-github <owner/name> --root <dir> [--yes]
|
|
19
|
+
preview, then clone and connect a GitHub repo
|
|
20
|
+
|
|
21
|
+
Options
|
|
22
|
+
--json emit a machine-readable JSON envelope
|
|
23
|
+
--token <t> pass a lead token when adding from an agent
|
|
24
|
+
-h, --help show this`,FLOWS_HELP=`toolroll flows: inspect and manage automated workflows
|
|
25
|
+
|
|
26
|
+
toolroll flows list [--repo <path>] list saved flows
|
|
27
|
+
toolroll flows show <id> show stages, triggers, scripts, and active cards
|
|
28
|
+
toolroll flows create --repo <path> ... preview or create a flow (--yes to apply)
|
|
29
|
+
toolroll flows edit <id> ... preview or edit a flow (--yes to apply)
|
|
30
|
+
toolroll flows trigger add|pause|resume|remove ...
|
|
31
|
+
manage a flow's triggers
|
|
32
|
+
toolroll flows script save|approve ... manage flow script zones
|
|
33
|
+
toolroll flows card add|move|approve|send-back|cancel ...
|
|
34
|
+
manage cards moving through a flow
|
|
35
|
+
toolroll flows archive <id> archive a flow
|
|
36
|
+
|
|
37
|
+
Options
|
|
38
|
+
--json emit a machine-readable JSON envelope
|
|
39
|
+
--yes apply a previewed change
|
|
40
|
+
-h, --help show this`,VIEW_HELP=`toolroll view: customize the terminal workbench look
|
|
41
|
+
|
|
42
|
+
toolroll view show current theme, density, and saved themes
|
|
43
|
+
toolroll view theme set <name> switch to a built-in or saved theme
|
|
44
|
+
toolroll view reset restore defaults (keeps tui.toml.bak)
|
|
45
|
+
|
|
46
|
+
Built-in themes: terminal, light, dark, high-contrast
|
|
47
|
+
Options: -h, --help`,LEAD_HELP=`toolroll lead: configure and speak as the Lead coordinator
|
|
48
|
+
|
|
49
|
+
toolroll lead token [--revoke] mint or revoke your Lead agent credential
|
|
50
|
+
toolroll lead say "<text>" [--task <id>] post one short Lead update to chat
|
|
51
|
+
|
|
52
|
+
The Lead coordinator can run on any ready provider (Claude, Codex, Gemini, Grok,
|
|
53
|
+
OpenRouter, or Anthropic) via Settings -> Lead or POST /engine/lead/provider.
|
|
54
|
+
|
|
55
|
+
Options
|
|
56
|
+
--json emit a machine-readable JSON envelope
|
|
57
|
+
-h, --help show this`,CARD_HELP=`toolroll card: read live workspace data cards and declarative TUI panels
|
|
58
|
+
|
|
59
|
+
Built-in workspace cards
|
|
60
|
+
toolroll card <source> [--repo <path>] [--days <n>] [--limit <n>] [--json]
|
|
61
|
+
|
|
62
|
+
Declarative TUI panels (~/.toolroll/panels.toml, read-only)
|
|
63
|
+
toolroll card list [--json] list registered panels and live card previews
|
|
64
|
+
toolroll card --list [--json] same as \`toolroll card list\`
|
|
65
|
+
toolroll card <path.json> [--id <slug>] [--title "<title>"] [--json]
|
|
66
|
+
validate JSON, preview card, and register panel
|
|
67
|
+
toolroll card remove <id> [--json] remove a panel by id (or --remove <id>)
|
|
68
|
+
|
|
69
|
+
Built-in sources
|
|
70
|
+
tasks, results, flows, spend, projects, builders, mode,
|
|
71
|
+
integrations, providers, findings, handover
|
|
72
|
+
|
|
73
|
+
Options
|
|
74
|
+
--id <slug> panel id ([a-z0-9_-]{1,48}) when registering a panel
|
|
75
|
+
--title "<text>" display title when registering a panel
|
|
76
|
+
--list list registered declarative panels
|
|
77
|
+
--remove <id> remove a registered panel by id
|
|
78
|
+
--json emit a machine-readable JSON envelope
|
|
79
|
+
-h, --help show this`,HANDOFF_HELP=`toolroll handoff: pull/push remote worktrees or hand off tasks between agents
|
|
80
|
+
|
|
81
|
+
Remote worktree sync (central <-> local)
|
|
82
|
+
toolroll handoff pull <task> [--repo <dir>] [--profile <name>]
|
|
83
|
+
open a central task in an isolated local worktree
|
|
84
|
+
toolroll handoff push [<task>] [--note "<summary>"] [--profile <name>]
|
|
85
|
+
upload your local diff back as a revision candidate
|
|
86
|
+
toolroll handoff rebase [<task>] [--push] rebase your handoff worktree onto central head
|
|
87
|
+
toolroll handoff status [<task>] show local diff and central check/PR state
|
|
88
|
+
toolroll handoff clean [<task>] [--force] remove an isolated local handoff worktree
|
|
89
|
+
|
|
90
|
+
Agent-to-agent task handoff (local worktree preserved)
|
|
91
|
+
toolroll task handoff <id> --to <agent> [--model <m>] [--note "<text>"] [--json]
|
|
92
|
+
transfer a task's live worktree to another agent
|
|
93
|
+
|
|
94
|
+
Options: -h, --help`,SCAN_HELP=`toolroll scan [path...] — report what is in flight below a folder
|
|
13
95
|
|
|
14
96
|
toolroll scan [path...] report what is in flight (also bare \`toolroll\` outside a repository)
|
|
15
97
|
toolroll [path...] the same report for the paths given
|
|
@@ -75,7 +157,7 @@ Projects
|
|
|
75
157
|
toolroll repos add-from-github <owner/name> --root <dir>
|
|
76
158
|
preview, then clone and connect (--yes)
|
|
77
159
|
|
|
78
|
-
Chat and the lead
|
|
160
|
+
Chat and the lead (\`toolroll lead --help\`, \`toolroll flows --help\`: every command of each)
|
|
79
161
|
toolroll chat --as <you> --token <t>
|
|
80
162
|
talk to your lead: one conversation across every
|
|
81
163
|
project; it proposes, you confirm (--say "…" for one turn)
|
|
@@ -102,7 +184,7 @@ Tasks (\`toolroll task --help\` lists every task command)
|
|
|
102
184
|
toolroll task ready <id> can I merge it? each check, and what clears a blocker
|
|
103
185
|
toolroll task wait <id> [--timeout <seconds>]
|
|
104
186
|
wait for this attempt to finish or need a person
|
|
105
|
-
toolroll task scope <id> --goal <text>
|
|
187
|
+
toolroll task scope <id> --goal <text> --acceptance "<statement>|<evidence,kinds>"
|
|
106
188
|
write a task's plan from the command line
|
|
107
189
|
|
|
108
190
|
Agent guides
|
|
@@ -135,4 +217,51 @@ Machine
|
|
|
135
217
|
open in VS Code on the device you browse from)
|
|
136
218
|
toolroll watch / daemon install run only the builder
|
|
137
219
|
toolroll doctor check that Toolroll's service holds no key a build could read
|
|
138
|
-
toolroll reconcile recover what the last stretch left behind`;
|
|
220
|
+
toolroll reconcile recover what the last stretch left behind`;export function configHelp(providers){return`toolroll config: which agent and model plan, build and review
|
|
221
|
+
|
|
222
|
+
toolroll config show [--repo <path>] which agent and model each role uses
|
|
223
|
+
toolroll config set <phase> --provider <p> [--model <m>] [--repo <path>] [--reroute]
|
|
224
|
+
choose the planner, builder, repairer or reviewer
|
|
225
|
+
(phase: plan | build | repair | review; --repo: one project)
|
|
226
|
+
toolroll config set <phase> --tier strong --provider <p> --model <m>
|
|
227
|
+
the agent large or risky tasks use
|
|
228
|
+
toolroll config set build --tier light --provider <p> --model <m>
|
|
229
|
+
the agent small tasks build on, with no plan
|
|
230
|
+
toolroll config set <plan|build> [--tier light|strong] --also --provider <p> --model <m>
|
|
231
|
+
a second agent for the same size of task;
|
|
232
|
+
each task runs on the one with more room
|
|
233
|
+
toolroll config clear <phase> [--tier light|strong] [--also] [--repo <path>]
|
|
234
|
+
go back to the default
|
|
235
|
+
toolroll config set chat --provider <p> [--model <m>]
|
|
236
|
+
the agent the lead and chat run on
|
|
237
|
+
toolroll config set task-sizing on|off size each new task with a quick model call
|
|
238
|
+
toolroll config set flexible on|off interactive agent threads (beta)
|
|
239
|
+
toolroll config unconfined-agents [allow|refuse]
|
|
240
|
+
whether builds run where this computer can't confine them
|
|
241
|
+
|
|
242
|
+
Providers: ${providers.join(", ")}. Settings -> Models in the browser
|
|
243
|
+
changes the same choices.
|
|
244
|
+
|
|
245
|
+
Options
|
|
246
|
+
--reroute re-route waiting tasks onto the updated models (automatic in Fast mode)
|
|
247
|
+
--as <you> --token <t> who is changing it, and their password
|
|
248
|
+
--json emit a machine-readable JSON envelope
|
|
249
|
+
-h, --help show this`}export const MODELS_HELP=`toolroll models: the models each agent can run, and the agent CLIs
|
|
250
|
+
|
|
251
|
+
toolroll models installed CLI versions, updates and new models
|
|
252
|
+
toolroll models list --provider <p> models a provider can run, newest first, with prices
|
|
253
|
+
toolroll models check fetch the model lists and check CLI versions now
|
|
254
|
+
toolroll models update claude|codex|gemini update one CLI while no work is running
|
|
255
|
+
toolroll models watch on|off the check every 6 hours, and its messages
|
|
256
|
+
toolroll models results [--repo <path>] which model built each finished task
|
|
257
|
+
toolroll models suggestions [--repo <path>] cheaper models a project's results suggest
|
|
258
|
+
toolroll models accept|dismiss|try <id> --repo <path>
|
|
259
|
+
act on a suggestion
|
|
260
|
+
toolroll models turn-off|keep <rule> turn an earned rule off, or keep a paused one
|
|
261
|
+
toolroll models stop <trial> stop a trial
|
|
262
|
+
|
|
263
|
+
To choose which model plans, builds and reviews: \`toolroll config --help\`.
|
|
264
|
+
|
|
265
|
+
Options
|
|
266
|
+
--json emit a machine-readable JSON envelope
|
|
267
|
+
-h, --help show this`;
|