toolroll 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1113 -0
- package/THIRD_PARTY_NOTICES.md +449 -0
- package/dist/accent-colors.d.ts +48 -0
- package/dist/accent-colors.js +122 -0
- package/dist/action-ledger.d.ts +26 -0
- package/dist/action-ledger.js +75 -0
- package/dist/agent-fence.d.ts +42 -0
- package/dist/agent-fence.js +183 -0
- package/dist/agentconfig.d.ts +216 -0
- package/dist/agentconfig.js +454 -0
- package/dist/api-tokens.d.ts +16 -0
- package/dist/api-tokens.js +27 -0
- package/dist/approval-policy.d.ts +69 -0
- package/dist/approval-policy.js +137 -0
- package/dist/approval-rules-ui.d.ts +25 -0
- package/dist/approval-rules-ui.js +39 -0
- package/dist/assignment-adapters.d.ts +180 -0
- package/dist/assignment-adapters.js +239 -0
- package/dist/assignment-brief.d.ts +71 -0
- package/dist/assignment-brief.js +129 -0
- package/dist/assignment-delivery.d.ts +56 -0
- package/dist/assignment-delivery.js +160 -0
- package/dist/assignment-presentation.d.ts +26 -0
- package/dist/assignment-presentation.js +80 -0
- package/dist/assignment-status.d.ts +62 -0
- package/dist/assignment-status.js +152 -0
- package/dist/assignment-ui.d.ts +71 -0
- package/dist/assignment-ui.js +103 -0
- package/dist/assignment.d.ts +222 -0
- package/dist/assignment.js +399 -0
- package/dist/attest.d.ts +56 -0
- package/dist/attest.js +153 -0
- package/dist/backend.d.ts +97 -0
- package/dist/backend.js +166 -0
- package/dist/backup-ui.d.ts +22 -0
- package/dist/backup-ui.js +59 -0
- package/dist/backup.d.ts +84 -0
- package/dist/backup.js +421 -0
- package/dist/beads.d.ts +34 -0
- package/dist/beads.js +135 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +22 -0
- package/dist/board.d.ts +150 -0
- package/dist/board.js +210 -0
- package/dist/boot-identity.d.ts +63 -0
- package/dist/boot-identity.js +99 -0
- package/dist/browser/THIRD_PARTY_NOTICES.txt +2295 -0
- package/dist/browser/workspace.css +4 -0
- package/dist/browser/workspace.js +225 -0
- package/dist/browser-crew.d.ts +11 -0
- package/dist/browser-crew.js +50 -0
- package/dist/browser-shell.d.ts +8 -0
- package/dist/browser-shell.js +60 -0
- package/dist/browser-workspace.d.ts +780 -0
- package/dist/browser-workspace.js +47 -0
- package/dist/budget-alerts.d.ts +19 -0
- package/dist/budget-alerts.js +46 -0
- package/dist/builder.d.ts +370 -0
- package/dist/builder.js +3262 -0
- package/dist/capscan.d.ts +35 -0
- package/dist/capscan.js +113 -0
- package/dist/chat-acceptance.d.ts +71 -0
- package/dist/chat-acceptance.js +120 -0
- package/dist/chat-actions.d.ts +265 -0
- package/dist/chat-actions.js +1273 -0
- package/dist/chat-channel.d.ts +109 -0
- package/dist/chat-channel.js +652 -0
- package/dist/chat-continuity.d.ts +32 -0
- package/dist/chat-continuity.js +317 -0
- package/dist/chat-controls.d.ts +113 -0
- package/dist/chat-controls.js +53 -0
- package/dist/chat-delivery-state.d.ts +159 -0
- package/dist/chat-delivery-state.js +309 -0
- package/dist/chat-delivery.d.ts +38 -0
- package/dist/chat-delivery.js +693 -0
- package/dist/chat-display.d.ts +1 -0
- package/dist/chat-display.js +18 -0
- package/dist/chat-evidence.d.ts +123 -0
- package/dist/chat-evidence.js +207 -0
- package/dist/chat-flow.d.ts +44 -0
- package/dist/chat-flow.js +215 -0
- package/dist/chat-inbox.d.ts +57 -0
- package/dist/chat-inbox.js +123 -0
- package/dist/chat-polish.d.ts +16 -0
- package/dist/chat-polish.js +135 -0
- package/dist/chat-review.d.ts +46 -0
- package/dist/chat-review.js +98 -0
- package/dist/chat-rooms.d.ts +123 -0
- package/dist/chat-rooms.js +216 -0
- package/dist/chat-task-actions.d.ts +44 -0
- package/dist/chat-task-actions.js +79 -0
- package/dist/check-progress.d.ts +51 -0
- package/dist/check-progress.js +290 -0
- package/dist/child-database.d.ts +12 -0
- package/dist/child-database.js +30 -0
- package/dist/claim.d.ts +688 -0
- package/dist/claim.js +1740 -0
- package/dist/cli.d.ts +137 -0
- package/dist/cli.js +1461 -0
- package/dist/codex-limits.d.ts +15 -0
- package/dist/codex-limits.js +145 -0
- package/dist/coding-context.d.ts +55 -0
- package/dist/coding-context.js +92 -0
- package/dist/coding-handoff.d.ts +57 -0
- package/dist/coding-handoff.js +277 -0
- package/dist/coding-provider.d.ts +72 -0
- package/dist/coding-provider.js +424 -0
- package/dist/coding-shipping-ui.d.ts +4 -0
- package/dist/coding-shipping-ui.js +12 -0
- package/dist/coding-types.d.ts +62 -0
- package/dist/coding-types.js +1 -0
- package/dist/coding-ui.d.ts +17 -0
- package/dist/coding-ui.js +364 -0
- package/dist/coding-update.d.ts +15 -0
- package/dist/coding-update.js +149 -0
- package/dist/coding-workspace.d.ts +124 -0
- package/dist/coding-workspace.js +768 -0
- package/dist/container-state.d.ts +5 -0
- package/dist/container-state.js +62 -0
- package/dist/containment.d.ts +197 -0
- package/dist/containment.js +559 -0
- package/dist/contest.d.ts +318 -0
- package/dist/contest.js +753 -0
- package/dist/control-setup.d.ts +35 -0
- package/dist/control-setup.js +40 -0
- package/dist/control-ui.d.ts +29 -0
- package/dist/control-ui.js +53 -0
- package/dist/controller-service.d.ts +1 -0
- package/dist/controller-service.js +19 -0
- package/dist/controller-supervisor.d.ts +30 -0
- package/dist/controller-supervisor.js +104 -0
- package/dist/converse.d.ts +304 -0
- package/dist/converse.js +849 -0
- package/dist/coordinator-proposals.d.ts +29 -0
- package/dist/coordinator-proposals.js +137 -0
- package/dist/coordinator.d.ts +186 -0
- package/dist/coordinator.js +447 -0
- package/dist/credentials-ui.d.ts +25 -0
- package/dist/credentials-ui.js +48 -0
- package/dist/daemon.d.ts +209 -0
- package/dist/daemon.js +604 -0
- package/dist/decision.d.ts +120 -0
- package/dist/decision.js +388 -0
- package/dist/demo.d.ts +55 -0
- package/dist/demo.js +992 -0
- package/dist/desktop-access.d.ts +28 -0
- package/dist/desktop-access.js +88 -0
- package/dist/desktop-bundle.d.ts +16 -0
- package/dist/desktop-bundle.js +74 -0
- package/dist/desktop-host.d.ts +54 -0
- package/dist/desktop-host.js +508 -0
- package/dist/desktop-update-gate.d.ts +12 -0
- package/dist/desktop-update-gate.js +91 -0
- package/dist/desktop-update-recovery.d.ts +14 -0
- package/dist/desktop-update-recovery.js +243 -0
- package/dist/desktop-update.d.ts +110 -0
- package/dist/desktop-update.js +740 -0
- package/dist/discord-api.d.ts +20 -0
- package/dist/discord-api.js +138 -0
- package/dist/discord-chat.d.ts +16 -0
- package/dist/discord-chat.js +381 -0
- package/dist/discord-settings.d.ts +7 -0
- package/dist/discord-settings.js +75 -0
- package/dist/discord.d.ts +10 -0
- package/dist/discord.js +169 -0
- package/dist/discover.d.ts +75 -0
- package/dist/discover.js +150 -0
- package/dist/dispatch.d.ts +100 -0
- package/dist/dispatch.js +311 -0
- package/dist/dispose.d.ts +161 -0
- package/dist/dispose.js +803 -0
- package/dist/email-settings.d.ts +34 -0
- package/dist/email-settings.js +50 -0
- package/dist/envelope.d.ts +47 -0
- package/dist/envelope.js +105 -0
- package/dist/evidence-pack.d.ts +185 -0
- package/dist/evidence-pack.js +258 -0
- package/dist/evidence.d.ts +345 -0
- package/dist/evidence.js +782 -0
- package/dist/exec.d.ts +285 -0
- package/dist/exec.js +1841 -0
- package/dist/exhaustion.d.ts +85 -0
- package/dist/exhaustion.js +141 -0
- package/dist/export-ui.d.ts +4 -0
- package/dist/export-ui.js +17 -0
- package/dist/export.d.ts +48 -0
- package/dist/export.js +305 -0
- package/dist/flow-actions.d.ts +77 -0
- package/dist/flow-actions.js +203 -0
- package/dist/flow-code.d.ts +50 -0
- package/dist/flow-code.js +159 -0
- package/dist/flow-draft.d.ts +38 -0
- package/dist/flow-draft.js +80 -0
- package/dist/flow-engine.d.ts +66 -0
- package/dist/flow-engine.js +416 -0
- package/dist/flow-insights.d.ts +95 -0
- package/dist/flow-insights.js +149 -0
- package/dist/flow-live.d.ts +24 -0
- package/dist/flow-live.js +150 -0
- package/dist/flow-people.d.ts +24 -0
- package/dist/flow-people.js +91 -0
- package/dist/flow-replies.d.ts +48 -0
- package/dist/flow-replies.js +113 -0
- package/dist/flow-scripts.d.ts +38 -0
- package/dist/flow-scripts.js +73 -0
- package/dist/flow-secrets.d.ts +13 -0
- package/dist/flow-secrets.js +45 -0
- package/dist/flow-sort.d.ts +82 -0
- package/dist/flow-sort.js +153 -0
- package/dist/flow-steps.d.ts +40 -0
- package/dist/flow-steps.js +408 -0
- package/dist/flow-triggers.d.ts +244 -0
- package/dist/flow-triggers.js +959 -0
- package/dist/flows-ui.d.ts +20 -0
- package/dist/flows-ui.js +175 -0
- package/dist/flows.d.ts +229 -0
- package/dist/flows.js +968 -0
- package/dist/fonts.d.ts +19 -0
- package/dist/fonts.js +19 -0
- package/dist/gaps.d.ts +35 -0
- package/dist/gaps.js +101 -0
- package/dist/gate-failure.d.ts +40 -0
- package/dist/gate-failure.js +66 -0
- package/dist/git.d.ts +54 -0
- package/dist/git.js +94 -0
- package/dist/google-mail.d.ts +58 -0
- package/dist/google-mail.js +151 -0
- package/dist/grant.d.ts +136 -0
- package/dist/grant.js +238 -0
- package/dist/graph.d.ts +164 -0
- package/dist/graph.js +383 -0
- package/dist/guides.d.ts +22 -0
- package/dist/guides.js +363 -0
- package/dist/held.d.ts +150 -0
- package/dist/held.js +799 -0
- package/dist/invoke.d.ts +112 -0
- package/dist/invoke.js +780 -0
- package/dist/issues.d.ts +41 -0
- package/dist/issues.js +131 -0
- package/dist/job-object-helper.ps1 +252 -0
- package/dist/jsonl-discriminants.d.ts +11 -0
- package/dist/jsonl-discriminants.js +93 -0
- package/dist/keys.d.ts +104 -0
- package/dist/keys.js +229 -0
- package/dist/kits-ui.d.ts +17 -0
- package/dist/kits-ui.js +46 -0
- package/dist/kits.d.ts +86 -0
- package/dist/kits.js +215 -0
- package/dist/knowledge-cli.d.ts +101 -0
- package/dist/knowledge-cli.js +92 -0
- package/dist/knowledge-ui.d.ts +24 -0
- package/dist/knowledge-ui.js +40 -0
- package/dist/lead-context.d.ts +8 -0
- package/dist/lead-context.js +56 -0
- package/dist/lead-follow.d.ts +22 -0
- package/dist/lead-follow.js +167 -0
- package/dist/lead-status.d.ts +75 -0
- package/dist/lead-status.js +285 -0
- package/dist/ledger-chain.d.ts +46 -0
- package/dist/ledger-chain.js +187 -0
- package/dist/ledger-csv.d.ts +4 -0
- package/dist/ledger-csv.js +11 -0
- package/dist/ledger-view.d.ts +24 -0
- package/dist/ledger-view.js +58 -0
- package/dist/limits-ui.d.ts +26 -0
- package/dist/limits-ui.js +67 -0
- package/dist/link.d.ts +72 -0
- package/dist/link.js +217 -0
- package/dist/live.d.ts +96 -0
- package/dist/live.js +366 -0
- package/dist/liveness.d.ts +30 -0
- package/dist/liveness.js +42 -0
- package/dist/log.d.ts +7 -0
- package/dist/log.js +25 -0
- package/dist/mailbox.d.ts +57 -0
- package/dist/mailbox.js +150 -0
- package/dist/maintenance.d.ts +11 -0
- package/dist/maintenance.js +35 -0
- package/dist/mate-cli.d.ts +52 -0
- package/dist/mate-cli.js +345 -0
- package/dist/mate-contract.d.ts +10 -0
- package/dist/mate-contract.js +30 -0
- package/dist/mate-doors.d.ts +69 -0
- package/dist/mate-doors.js +548 -0
- package/dist/mate-progress.d.ts +29 -0
- package/dist/mate-progress.js +121 -0
- package/dist/mate-tools.d.ts +94 -0
- package/dist/mate-tools.js +1878 -0
- package/dist/mate.d.ts +92 -0
- package/dist/mate.js +435 -0
- package/dist/mcp-connect.d.ts +103 -0
- package/dist/mcp-connect.js +252 -0
- package/dist/mcp.d.ts +27 -0
- package/dist/mcp.js +651 -0
- package/dist/memory-cli.d.ts +466 -0
- package/dist/memory-cli.js +111 -0
- package/dist/memory-pass.d.ts +160 -0
- package/dist/memory-pass.js +409 -0
- package/dist/metrics.d.ts +3 -0
- package/dist/metrics.js +56 -0
- package/dist/mobile-viewport.d.ts +3 -0
- package/dist/mobile-viewport.js +37 -0
- package/dist/model-catalog.d.ts +118 -0
- package/dist/model-catalog.js +376 -0
- package/dist/models-cli.d.ts +102 -0
- package/dist/models-cli.js +66 -0
- package/dist/models-ui.d.ts +34 -0
- package/dist/models-ui.js +68 -0
- package/dist/modes.d.ts +80 -0
- package/dist/modes.js +182 -0
- package/dist/monitoring-settings.d.ts +44 -0
- package/dist/monitoring-settings.js +173 -0
- package/dist/monitoring-ui.d.ts +20 -0
- package/dist/monitoring-ui.js +51 -0
- package/dist/monitoring.d.ts +34 -0
- package/dist/monitoring.js +221 -0
- package/dist/names.d.ts +67 -0
- package/dist/names.js +102 -0
- package/dist/observations.d.ts +40 -0
- package/dist/observations.js +211 -0
- package/dist/oidc.d.ts +71 -0
- package/dist/oidc.js +182 -0
- package/dist/onboard.d.ts +108 -0
- package/dist/onboard.js +325 -0
- package/dist/openrouter-models.d.ts +30 -0
- package/dist/openrouter-models.js +120 -0
- package/dist/operate.d.ts +118 -0
- package/dist/operate.js +11321 -0
- package/dist/peek-cli.d.ts +97 -0
- package/dist/peek-cli.js +215 -0
- package/dist/peek.d.ts +134 -0
- package/dist/peek.js +578 -0
- package/dist/phase-routing.d.ts +307 -0
- package/dist/phase-routing.js +658 -0
- package/dist/plan-auto.d.ts +14 -0
- package/dist/plan-auto.js +92 -0
- package/dist/plan.d.ts +186 -0
- package/dist/plan.js +401 -0
- package/dist/planner-source.d.ts +251 -0
- package/dist/planner-source.js +460 -0
- package/dist/planner.d.ts +75 -0
- package/dist/planner.js +992 -0
- package/dist/policy-ui.d.ts +20 -0
- package/dist/policy-ui.js +41 -0
- package/dist/policy.d.ts +111 -0
- package/dist/policy.js +231 -0
- package/dist/prepared-evidence.d.ts +16 -0
- package/dist/prepared-evidence.js +96 -0
- package/dist/pricing.d.ts +45 -0
- package/dist/pricing.js +77 -0
- package/dist/principal.d.ts +42 -0
- package/dist/principal.js +82 -0
- package/dist/probe.d.ts +46 -0
- package/dist/probe.js +79 -0
- package/dist/process-custody.d.ts +17 -0
- package/dist/process-custody.js +91 -0
- package/dist/process-liveness.d.ts +10 -0
- package/dist/process-liveness.js +81 -0
- package/dist/process-recovery-anchor.d.ts +75 -0
- package/dist/process-recovery-anchor.js +188 -0
- package/dist/process-recovery-coalition.d.ts +25 -0
- package/dist/process-recovery-coalition.js +105 -0
- package/dist/process-recovery-eligibility.d.ts +178 -0
- package/dist/process-recovery-eligibility.js +170 -0
- package/dist/process-recovery-native.d.ts +172 -0
- package/dist/process-recovery-native.js +592 -0
- package/dist/process-recovery-provenance.d.ts +163 -0
- package/dist/process-recovery-provenance.js +292 -0
- package/dist/process-recovery-services.d.ts +56 -0
- package/dist/process-recovery-services.js +191 -0
- package/dist/process-recovery-settlement.d.ts +32 -0
- package/dist/process-recovery-settlement.js +132 -0
- package/dist/process-recovery.d.ts +41 -0
- package/dist/process-recovery.js +91 -0
- package/dist/process-tree.d.ts +41 -0
- package/dist/process-tree.js +264 -0
- package/dist/project-access.d.ts +14 -0
- package/dist/project-access.js +34 -0
- package/dist/project-cli.d.ts +18 -0
- package/dist/project-cli.js +104 -0
- package/dist/project-delete-ui.d.ts +22 -0
- package/dist/project-delete-ui.js +48 -0
- package/dist/project-delete.d.ts +55 -0
- package/dist/project-delete.js +413 -0
- package/dist/project-knowledge.d.ts +111 -0
- package/dist/project-knowledge.js +241 -0
- package/dist/project-learning.d.ts +100 -0
- package/dist/project-learning.js +438 -0
- package/dist/project-memory.d.ts +81 -0
- package/dist/project-memory.js +264 -0
- package/dist/project-skills.d.ts +152 -0
- package/dist/project-skills.js +660 -0
- package/dist/project-tools.d.ts +219 -0
- package/dist/project-tools.js +796 -0
- package/dist/project.d.ts +61 -0
- package/dist/project.js +125 -0
- package/dist/prompt.d.ts +22 -0
- package/dist/prompt.js +72 -0
- package/dist/proof.d.ts +513 -0
- package/dist/proof.js +1140 -0
- package/dist/proposal.d.ts +82 -0
- package/dist/proposal.js +210 -0
- package/dist/provider-connection.d.ts +22 -0
- package/dist/provider-connection.js +98 -0
- package/dist/provider-limits.d.ts +35 -0
- package/dist/provider-limits.js +95 -0
- package/dist/provider.d.ts +279 -0
- package/dist/provider.js +935 -0
- package/dist/publish.d.ts +107 -0
- package/dist/publish.js +650 -0
- package/dist/pulls.d.ts +118 -0
- package/dist/pulls.js +240 -0
- package/dist/push.d.ts +95 -0
- package/dist/push.js +353 -0
- package/dist/quality.d.ts +8 -0
- package/dist/quality.js +6 -0
- package/dist/recipe-ui.d.ts +18 -0
- package/dist/recipe-ui.js +152 -0
- package/dist/recipes.d.ts +81 -0
- package/dist/recipes.js +332 -0
- package/dist/remote.d.ts +67 -0
- package/dist/remote.js +122 -0
- package/dist/render.d.ts +64 -0
- package/dist/render.js +587 -0
- package/dist/report-summary.d.ts +13 -0
- package/dist/report-summary.js +15 -0
- package/dist/repos.d.ts +65 -0
- package/dist/repos.js +277 -0
- package/dist/repository-context-ui.d.ts +2 -0
- package/dist/repository-context-ui.js +10 -0
- package/dist/repository-context.d.ts +67 -0
- package/dist/repository-context.js +376 -0
- package/dist/restart-certification.d.ts +134 -0
- package/dist/restart-certification.js +226 -0
- package/dist/result-actions.d.ts +28 -0
- package/dist/result-actions.js +270 -0
- package/dist/result-completion.d.ts +18 -0
- package/dist/result-completion.js +66 -0
- package/dist/result-review.d.ts +213 -0
- package/dist/result-review.js +430 -0
- package/dist/retention-ui.d.ts +12 -0
- package/dist/retention-ui.js +39 -0
- package/dist/retention.d.ts +72 -0
- package/dist/retention.js +288 -0
- package/dist/review-context.d.ts +243 -0
- package/dist/review-context.js +1043 -0
- package/dist/review-evidence.d.ts +33 -0
- package/dist/review-evidence.js +56 -0
- package/dist/reviewer.d.ts +97 -0
- package/dist/reviewer.js +202 -0
- package/dist/routine.d.ts +228 -0
- package/dist/routine.js +764 -0
- package/dist/runner.d.ts +266 -0
- package/dist/runner.js +399 -0
- package/dist/scan.d.ts +32 -0
- package/dist/scan.js +92 -0
- package/dist/scope.d.ts +695 -0
- package/dist/scope.js +1176 -0
- package/dist/scout-report.d.ts +42 -0
- package/dist/scout-report.js +108 -0
- package/dist/scout.d.ts +69 -0
- package/dist/scout.js +351 -0
- package/dist/serve.d.ts +313 -0
- package/dist/serve.js +21776 -0
- package/dist/session-brief.d.ts +8 -0
- package/dist/session-brief.js +24 -0
- package/dist/session-cli.d.ts +13 -0
- package/dist/session-cli.js +284 -0
- package/dist/session-contract.d.ts +183 -0
- package/dist/session-contract.js +122 -0
- package/dist/session-http.d.ts +19 -0
- package/dist/session-http.js +154 -0
- package/dist/session-server.d.ts +12 -0
- package/dist/session-server.js +37 -0
- package/dist/session-service.d.ts +22 -0
- package/dist/session-service.js +157 -0
- package/dist/setup-guide.d.ts +39 -0
- package/dist/setup-guide.js +93 -0
- package/dist/sign-in-guard.d.ts +45 -0
- package/dist/sign-in-guard.js +74 -0
- package/dist/skills-ui.d.ts +11 -0
- package/dist/skills-ui.js +58 -0
- package/dist/skills.d.ts +97 -0
- package/dist/skills.js +276 -0
- package/dist/slack-api.d.ts +55 -0
- package/dist/slack-api.js +229 -0
- package/dist/slack-chat.d.ts +28 -0
- package/dist/slack-chat.js +413 -0
- package/dist/slack-settings.d.ts +7 -0
- package/dist/slack-settings.js +75 -0
- package/dist/slack-state.d.ts +13 -0
- package/dist/slack-state.js +9 -0
- package/dist/slack.d.ts +13 -0
- package/dist/slack.js +167 -0
- package/dist/spend-ui.d.ts +28 -0
- package/dist/spend-ui.js +95 -0
- package/dist/spend.d.ts +142 -0
- package/dist/spend.js +313 -0
- package/dist/sqlite-runtime.d.ts +3 -0
- package/dist/sqlite-runtime.js +6 -0
- package/dist/sso-settings.d.ts +33 -0
- package/dist/sso-settings.js +103 -0
- package/dist/sso-ui.d.ts +22 -0
- package/dist/sso-ui.js +39 -0
- package/dist/storage.d.ts +15 -0
- package/dist/storage.js +84 -0
- package/dist/store.d.ts +7754 -0
- package/dist/store.js +23279 -0
- package/dist/structured-output.d.ts +58 -0
- package/dist/structured-output.js +103 -0
- package/dist/style-asset.d.ts +7 -0
- package/dist/style-asset.js +41 -0
- package/dist/subscription-chat.d.ts +46 -0
- package/dist/subscription-chat.js +275 -0
- package/dist/summary.d.ts +33 -0
- package/dist/summary.js +71 -0
- package/dist/supervisor.mjs +297 -0
- package/dist/surface.d.ts +63 -0
- package/dist/surface.js +352 -0
- package/dist/sync.d.ts +94 -0
- package/dist/sync.js +279 -0
- package/dist/task-composer.d.ts +13 -0
- package/dist/task-composer.js +52 -0
- package/dist/task-control.d.ts +165 -0
- package/dist/task-control.js +214 -0
- package/dist/task-outcome-cli.d.ts +10 -0
- package/dist/task-outcome-cli.js +92 -0
- package/dist/task-text.d.ts +30 -0
- package/dist/task-text.js +41 -0
- package/dist/team-cli.d.ts +15 -0
- package/dist/team-cli.js +618 -0
- package/dist/team-contract.d.ts +92 -0
- package/dist/team-contract.js +1 -0
- package/dist/team-http.d.ts +17 -0
- package/dist/team-http.js +144 -0
- package/dist/team-leads.d.ts +81 -0
- package/dist/team-leads.js +565 -0
- package/dist/team-runtime.d.ts +27 -0
- package/dist/team-runtime.js +264 -0
- package/dist/team-ui.d.ts +3 -0
- package/dist/team-ui.js +9 -0
- package/dist/team-updates.d.ts +8 -0
- package/dist/team-updates.js +57 -0
- package/dist/teammate-admin.d.ts +53 -0
- package/dist/teammate-admin.js +111 -0
- package/dist/teammate-desk.d.ts +60 -0
- package/dist/teammate-desk.js +154 -0
- package/dist/teammate-memory.d.ts +64 -0
- package/dist/teammate-memory.js +196 -0
- package/dist/teammate-question.d.ts +59 -0
- package/dist/teammate-question.js +175 -0
- package/dist/teammate-tools.d.ts +108 -0
- package/dist/teammate-tools.js +271 -0
- package/dist/teammate-week.d.ts +68 -0
- package/dist/teammate-week.js +132 -0
- package/dist/teammate-work.d.ts +76 -0
- package/dist/teammate-work.js +280 -0
- package/dist/teammates-ui.d.ts +20 -0
- package/dist/teammates-ui.js +166 -0
- package/dist/teammates.d.ts +180 -0
- package/dist/teammates.js +253 -0
- package/dist/teams-api.d.ts +33 -0
- package/dist/teams-api.js +204 -0
- package/dist/teams-chat.d.ts +26 -0
- package/dist/teams-chat.js +215 -0
- package/dist/teams-settings.d.ts +12 -0
- package/dist/teams-settings.js +57 -0
- package/dist/teams.d.ts +21 -0
- package/dist/teams.js +124 -0
- package/dist/telegram-flow.d.ts +49 -0
- package/dist/telegram-flow.js +110 -0
- package/dist/telegram-mate.d.ts +137 -0
- package/dist/telegram-mate.js +707 -0
- package/dist/telegram-progress.d.ts +14 -0
- package/dist/telegram-progress.js +129 -0
- package/dist/telegram-settings.d.ts +9 -0
- package/dist/telegram-settings.js +36 -0
- package/dist/telegram-status.d.ts +75 -0
- package/dist/telegram-status.js +265 -0
- package/dist/telegram-team.d.ts +85 -0
- package/dist/telegram-team.js +359 -0
- package/dist/telegram.d.ts +230 -0
- package/dist/telegram.js +1931 -0
- package/dist/templates.d.ts +65 -0
- package/dist/templates.js +118 -0
- package/dist/tool-launcher.d.ts +1 -0
- package/dist/tool-launcher.js +101 -0
- package/dist/tools-ui.d.ts +30 -0
- package/dist/tools-ui.js +40 -0
- package/dist/transitions-recipes.d.ts +1 -0
- package/dist/transitions-recipes.js +203 -0
- package/dist/tree-proof.d.ts +34 -0
- package/dist/tree-proof.js +58 -0
- package/dist/verification-evidence.d.ts +44 -0
- package/dist/verification-evidence.js +238 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +10 -0
- package/dist/webhooks.d.ts +91 -0
- package/dist/webhooks.js +283 -0
- package/dist/work-index.d.ts +68 -0
- package/dist/work-index.js +384 -0
- package/dist/work-summary.d.ts +57 -0
- package/dist/work-summary.js +116 -0
- package/dist/workspace-motion.d.ts +4 -0
- package/dist/workspace-motion.js +133 -0
- package/dist/workspace-revision.d.ts +19 -0
- package/dist/workspace-revision.js +92 -0
- package/dist/workspace-ui.d.ts +204 -0
- package/dist/workspace-ui.js +411 -0
- package/dist/worktree-notices.d.ts +13 -0
- package/dist/worktree-notices.js +17 -0
- package/dist/worktree.d.ts +249 -0
- package/dist/worktree.js +720 -0
- package/package.json +122 -0
- package/scripts/canary-assertions.mjs +42 -0
- package/scripts/crash-canary.mjs +253 -0
- package/scripts/fixtures/crash-process.mjs +74 -0
- package/scripts/fixtures/pilot-scenarios.mjs +85 -0
- package/scripts/fixtures/restart-service.mjs +27 -0
- package/scripts/launchd-certification.mjs +143 -0
- package/scripts/pilot.mjs +121 -0
- package/scripts/proof-preflight.mjs +140 -0
- package/scripts/provider-canary.mjs +379 -0
- package/scripts/recovery-canary.mjs +135 -0
- package/scripts/restart-certification.mjs +98 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Progressive enhancement for the existing chat, not a second transport.
|
|
2
|
+
* Native POSTs and server-rendered approval forms remain the authority.
|
|
3
|
+
* Only the message draft is kept in this tab, for at most 24 hours.
|
|
4
|
+
*
|
|
5
|
+
* Package 2 (2026-09-13) extends the SAME read-only status poll: the
|
|
6
|
+
* server answers with a version of the displayed facts and, when it
|
|
7
|
+
* differs from the page's, server-rendered fragments for the three safe
|
|
8
|
+
* regions — the thread, what follows the composer, and the task's live
|
|
9
|
+
* region. The page reconciles them by stable keys, so an unchanged card
|
|
10
|
+
* keeps its node, its open disclosures, and its focus; the composer is
|
|
11
|
+
* never touched, so the draft, caret, and focus survive every update.
|
|
12
|
+
* A reader above the latest message keeps their place and gets a
|
|
13
|
+
* keyboard-usable New update button; only that act moves them.
|
|
14
|
+
*
|
|
15
|
+
* Sending goes to the existing endpoint once, with the existing request
|
|
16
|
+
* receipt key and session binding, and is never retried by itself; the
|
|
17
|
+
* draft clears only on the server's receipt for THE REQUEST THAT POLL
|
|
18
|
+
* ASKED ABOUT, never for a newer send or edit that replaced it. A changed
|
|
19
|
+
* or ended session, a lost sign-in, an unavailable task, denied storage,
|
|
20
|
+
* and a lost connection each say so in their own words; sending waits
|
|
21
|
+
* for an explicit reconnection under stale authority, and drafting stays
|
|
22
|
+
* available.
|
|
23
|
+
*
|
|
24
|
+
* Revision (build 1550 annotations): a poll acknowledges only the request
|
|
25
|
+
* it captured when it started; an answer is validated whole before any
|
|
26
|
+
* state changes, so a malformed one retries instead of latching a changed
|
|
27
|
+
* session or advancing a version nothing rendered; a task fragment held
|
|
28
|
+
* back while the reader was inside the region lands after they leave it,
|
|
29
|
+
* even when the server has nothing new; and the words carried across an
|
|
30
|
+
* explicit reconnection are bound to the server-named account, the task,
|
|
31
|
+
* and an expiry, so another account's tab never inherits them. */
|
|
32
|
+
export declare const CHAT_CONTINUITY_SCRIPT: string;
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
/** Progressive enhancement for the existing chat, not a second transport.
|
|
2
|
+
* Native POSTs and server-rendered approval forms remain the authority.
|
|
3
|
+
* Only the message draft is kept in this tab, for at most 24 hours.
|
|
4
|
+
*
|
|
5
|
+
* Package 2 (2026-09-13) extends the SAME read-only status poll: the
|
|
6
|
+
* server answers with a version of the displayed facts and, when it
|
|
7
|
+
* differs from the page's, server-rendered fragments for the three safe
|
|
8
|
+
* regions — the thread, what follows the composer, and the task's live
|
|
9
|
+
* region. The page reconciles them by stable keys, so an unchanged card
|
|
10
|
+
* keeps its node, its open disclosures, and its focus; the composer is
|
|
11
|
+
* never touched, so the draft, caret, and focus survive every update.
|
|
12
|
+
* A reader above the latest message keeps their place and gets a
|
|
13
|
+
* keyboard-usable New update button; only that act moves them.
|
|
14
|
+
*
|
|
15
|
+
* Sending goes to the existing endpoint once, with the existing request
|
|
16
|
+
* receipt key and session binding, and is never retried by itself; the
|
|
17
|
+
* draft clears only on the server's receipt for THE REQUEST THAT POLL
|
|
18
|
+
* ASKED ABOUT, never for a newer send or edit that replaced it. A changed
|
|
19
|
+
* or ended session, a lost sign-in, an unavailable task, denied storage,
|
|
20
|
+
* and a lost connection each say so in their own words; sending waits
|
|
21
|
+
* for an explicit reconnection under stale authority, and drafting stays
|
|
22
|
+
* available.
|
|
23
|
+
*
|
|
24
|
+
* Revision (build 1550 annotations): a poll acknowledges only the request
|
|
25
|
+
* it captured when it started; an answer is validated whole before any
|
|
26
|
+
* state changes, so a malformed one retries instead of latching a changed
|
|
27
|
+
* session or advancing a version nothing rendered; a task fragment held
|
|
28
|
+
* back while the reader was inside the region lands after they leave it,
|
|
29
|
+
* even when the server has nothing new; and the words carried across an
|
|
30
|
+
* explicit reconnection are bound to the server-named account, the task,
|
|
31
|
+
* and an expiry, so another account's tab never inherits them. */
|
|
32
|
+
export const CHAT_CONTINUITY_SCRIPT = String.raw `
|
|
33
|
+
(function(){
|
|
34
|
+
var form=document.querySelector('.composer[data-chat-session]');
|
|
35
|
+
if(!form)return;
|
|
36
|
+
var box=form.querySelector('textarea[name="message"]'),request=form.querySelector('[name="request"]');
|
|
37
|
+
var status=document.getElementById('chat-connection'),reconnect=document.getElementById('chat-reconnect'),newUpdate=document.getElementById('chat-new-update');
|
|
38
|
+
var session=form.dataset.chatSession,task=form.dataset.chatTask||'',user=form.dataset.chatUser||'';
|
|
39
|
+
var key='standing-orders:chat-draft:'+session+':'+task,carryKey='standing-orders:chat-carry:'+task;
|
|
40
|
+
var prefix='standing-orders:chat-draft:',draft=null,sending=false,timer=null,polling=false;
|
|
41
|
+
var busy=form.dataset.chatBusy==='1',version=form.dataset.chatVersion||'',storage=true,stale=false,offline=navigator.onLine===false;
|
|
42
|
+
// The last send still waiting for its receipt: {request, text}. It
|
|
43
|
+
// outlives an edit, so the older send still settles while the newer
|
|
44
|
+
// draft (with its own fresh request) stays in the box.
|
|
45
|
+
var sent=null,unread=null;
|
|
46
|
+
// A task fragment the server sent while the reader was inside the live
|
|
47
|
+
// region (or an approval form was open): kept until it can land safely,
|
|
48
|
+
// so leaving the field is enough — no second server change is needed.
|
|
49
|
+
var deferredLive=null;
|
|
50
|
+
var sources=new WeakMap();
|
|
51
|
+
function say(text){if(status)status.textContent=text;}
|
|
52
|
+
function fresh(){var bytes=new Uint8Array(16);crypto.getRandomValues(bytes);return Array.from(bytes,function(b){return b.toString(16).padStart(2,'0');}).join('');}
|
|
53
|
+
function save(){try{if(draft)sessionStorage.setItem(key,JSON.stringify(draft));else sessionStorage.removeItem(key);}catch(e){storage=false;}}
|
|
54
|
+
try{
|
|
55
|
+
for(var i=sessionStorage.length-1;i>=0;i--){var old=sessionStorage.key(i);if(old&&old.indexOf(prefix)===0){var item=JSON.parse(sessionStorage.getItem(old)||'null');if(!item||item.at<Date.now()-86400000||old.indexOf(prefix+session+':')!==0)sessionStorage.removeItem(old);}}
|
|
56
|
+
var saved=JSON.parse(sessionStorage.getItem(key)||'null');
|
|
57
|
+
if(saved&&typeof saved.text==='string'&&saved.text.length<=2000&&/^[a-f0-9]{32}$/.test(saved.request)){draft=saved;box.value=saved.text;request.value=saved.request;if(saved.submitted)sent={request:saved.request,text:saved.text};}
|
|
58
|
+
// Words carried across an EXPLICIT reconnection (below): a new draft
|
|
59
|
+
// under this session and lens, its own fresh request key — nothing is
|
|
60
|
+
// sent, and nothing from the old session is treated as received. The
|
|
61
|
+
// record is honoured only for the account the server names on this
|
|
62
|
+
// page, this task, and within a day; anything else is discarded here.
|
|
63
|
+
var carry=JSON.parse(sessionStorage.getItem(carryKey)||'null');sessionStorage.removeItem(carryKey);
|
|
64
|
+
if(!draft&&carry&&user&&carry.owner===user&&carry.task===task&&typeof carry.text==='string'&&carry.text.length<=2000&&typeof carry.at==='number'&&carry.at>Date.now()-86400000){box.value=carry.text;draft={text:carry.text,request:request.value,submitted:false,at:Date.now()};save();}
|
|
65
|
+
}catch(e){storage=false;}
|
|
66
|
+
function buttons(){document.querySelectorAll('form[action="/chat"] button[type="submit"]').forEach(function(button){button.disabled=busy||sending||stale||offline;});}
|
|
67
|
+
function showReconnect(on){if(reconnect)reconnect.hidden=!on;}
|
|
68
|
+
function lostAuthority(){stale=true;buttons();showReconnect(true);say('Sign in again to reconnect. Your draft stays in this tab.');}
|
|
69
|
+
function changed(){stale=true;buttons();showReconnect(true);say('This conversation changed or ended. Your draft stays in this tab; reconnect to continue.');}
|
|
70
|
+
function unavailable(){stale=true;buttons();showReconnect(true);say('This task is no longer available here. Your draft stays in this tab.');}
|
|
71
|
+
if(reconnect)reconnect.addEventListener('click',function(){
|
|
72
|
+
// The reader's own act: the unsent words ride along to the reloaded
|
|
73
|
+
// page as a NEW draft, bound to this account and task; the old
|
|
74
|
+
// session's draft is not resent.
|
|
75
|
+
try{if(box.value.trim()&&user)sessionStorage.setItem(carryKey,JSON.stringify({text:box.value,at:Date.now(),owner:user,task:task}));}catch(e){}
|
|
76
|
+
location.reload();
|
|
77
|
+
});
|
|
78
|
+
box.addEventListener('input',function(){
|
|
79
|
+
// An edit after a send is a NEW message: its own request key, its own
|
|
80
|
+
// receipt. The earlier send keeps settling on its own key.
|
|
81
|
+
if(draft&&draft.submitted)request.value=fresh();
|
|
82
|
+
draft=box.value===''?null:{text:box.value,request:request.value,submitted:false,at:Date.now()};save();
|
|
83
|
+
if(!storage)say('Draft stays on this page only. Browser storage is unavailable.');
|
|
84
|
+
});
|
|
85
|
+
function bind(one){
|
|
86
|
+
if(!one.querySelector('[name="request"]')){var id=document.createElement('input');id.type='hidden';id.name='request';id.value=fresh();one.appendChild(id);}
|
|
87
|
+
if(!one.querySelector('[name="request-session"]')){var binding=document.createElement('input');binding.type='hidden';binding.name='request-session';binding.value=session;one.appendChild(binding);}
|
|
88
|
+
}
|
|
89
|
+
document.querySelectorAll('form[action="/chat"]').forEach(bind);
|
|
90
|
+
// One delegated handler for every form the conversation renders now or
|
|
91
|
+
// later: a refreshed card never gains a second listener or a second
|
|
92
|
+
// request. Prompt buttons keep their native submit (their value is the
|
|
93
|
+
// prompt); the composer sends once through fetch; other forms only get
|
|
94
|
+
// a double-submit latch.
|
|
95
|
+
document.addEventListener('submit',function(event){
|
|
96
|
+
var one=event.target;
|
|
97
|
+
if(!(one instanceof HTMLFormElement))return;
|
|
98
|
+
var action=one.getAttribute('action')||'';
|
|
99
|
+
if(action==='/chat'){
|
|
100
|
+
if(busy||sending||stale||offline){event.preventDefault();return;}
|
|
101
|
+
bind(one);
|
|
102
|
+
if(one===form){
|
|
103
|
+
if(!box.value.trim()){event.preventDefault();return;}
|
|
104
|
+
draft={text:box.value,request:request.value,submitted:true,at:Date.now()};save();
|
|
105
|
+
sent={request:request.value,text:box.value};
|
|
106
|
+
event.preventDefault();send();return;
|
|
107
|
+
}
|
|
108
|
+
sending=true;say('Sending…');one.setAttribute('aria-busy','true');
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if(action==='/chat/mate/end'){draft=null;save();}
|
|
112
|
+
if(one.getAttribute('aria-busy')==='true'){event.preventDefault();return;}
|
|
113
|
+
one.setAttribute('aria-busy','true');
|
|
114
|
+
});
|
|
115
|
+
function send(){
|
|
116
|
+
sending=true;say('Sending…');form.setAttribute('aria-busy','true');buttons();
|
|
117
|
+
var body=new URLSearchParams(new FormData(form));
|
|
118
|
+
fetch('/chat',{method:'POST',body:body,headers:{accept:'application/json'},credentials:'same-origin',signal:AbortSignal.timeout(15000)})
|
|
119
|
+
.then(function(r){
|
|
120
|
+
if(r.status===401||r.status===403||r.redirected){lostAuthority();return null;}
|
|
121
|
+
return r.json().then(function(data){return {status:r.status,data:data};},function(){throw new Error('response');});
|
|
122
|
+
})
|
|
123
|
+
.then(function(got){
|
|
124
|
+
if(got===null)return;
|
|
125
|
+
var data=got.data||{};
|
|
126
|
+
if(data.ok===true){
|
|
127
|
+
if(String(data.session)!==session){changed();return;}
|
|
128
|
+
say('Sent. Waiting for the reply…');later(300);return;
|
|
129
|
+
}
|
|
130
|
+
// Refused, so nothing was received: the draft stays, editable and
|
|
131
|
+
// resendable under its own key; the words are the server's.
|
|
132
|
+
if(draft&&draft.submitted)draft.submitted=false;save();sent=null;
|
|
133
|
+
say(typeof data.said==='string'?data.said:'Message not sent.');
|
|
134
|
+
if(data.session===null)changed();
|
|
135
|
+
})
|
|
136
|
+
.catch(function(){
|
|
137
|
+
// An uncertain send is NEVER retried here: the receipt poll says
|
|
138
|
+
// whether it landed; the draft stays until it does.
|
|
139
|
+
say('Message not confirmed. Check the conversation before retrying.');later(1500);
|
|
140
|
+
})
|
|
141
|
+
.then(function(){sending=false;form.removeAttribute('aria-busy');buttons();});
|
|
142
|
+
}
|
|
143
|
+
// A receipt settles exactly the request the poll asked about. A send
|
|
144
|
+
// submitted after that poll started (a different key) keeps its words
|
|
145
|
+
// and keeps waiting for its own receipt.
|
|
146
|
+
function receipt(asked){
|
|
147
|
+
if(draft&&draft.submitted&&draft.request===asked){draft=null;save();box.value='';request.value=fresh();box.dispatchEvent(new Event('input'));}
|
|
148
|
+
if(sent&&sent.request===asked)sent=null;
|
|
149
|
+
}
|
|
150
|
+
// ---- live regions --------------------------------------------------
|
|
151
|
+
function normalize(html){return html.replace(/<time\b[^>]*>[^<]*<\/time>/g,'<time></time>').replace(/ id="latest"/g,'').replace(/ aria-busy="true"/g,'');}
|
|
152
|
+
function remember(container){Array.prototype.forEach.call(container.children,function(child){sources.set(child,normalize(child.outerHTML));if(child.hasAttribute('data-chat-list'))remember(child);});}
|
|
153
|
+
function keyOf(el,index){return el.getAttribute('data-key')||(el.tagName+'#'+el.id+'.'+el.className+'@'+index);}
|
|
154
|
+
function reconcile(container,next,report){
|
|
155
|
+
var existing={};
|
|
156
|
+
Array.prototype.forEach.call(container.children,function(child,index){var k=keyOf(child,index);if(!(k in existing))existing[k]=child;});
|
|
157
|
+
var list=[];
|
|
158
|
+
Array.prototype.forEach.call(next.children,function(incoming,index){
|
|
159
|
+
var k=keyOf(incoming,index),src=normalize(incoming.outerHTML),have=existing[k],node;
|
|
160
|
+
if(have&&incoming.hasAttribute('data-chat-list')&&have.hasAttribute('data-chat-list')){reconcile(have,incoming,report);node=have;delete existing[k];}
|
|
161
|
+
else if(have&&sources.get(have)===src){node=have;delete existing[k];if(have.id!==incoming.id)have.id=incoming.id;}
|
|
162
|
+
else{
|
|
163
|
+
node=document.importNode(incoming,true);sources.set(node,src);if(node.hasAttribute('data-chat-list'))remember(node);
|
|
164
|
+
if(have){delete existing[k];if(have===document.activeElement||have.contains(document.activeElement))report.focused=true;have.remove();}
|
|
165
|
+
if(!report.first&&node.getAttribute('data-key')!=='said')report.first=node;
|
|
166
|
+
}
|
|
167
|
+
list.push(node);
|
|
168
|
+
});
|
|
169
|
+
list.forEach(function(node,i){var at=container.children[i];if(at!==node)container.insertBefore(node,at||null);});
|
|
170
|
+
while(container.children.length>list.length)container.children[list.length].remove();
|
|
171
|
+
for(var k in existing)if(existing[k].parentNode===container)existing[k].remove();
|
|
172
|
+
}
|
|
173
|
+
function anchor(){
|
|
174
|
+
var doc=document.documentElement,atBottom=window.innerHeight+window.scrollY>=doc.scrollHeight-120;
|
|
175
|
+
if(atBottom)return {bottom:true};
|
|
176
|
+
var nodes=document.querySelectorAll('#chat-thread [data-key]');
|
|
177
|
+
for(var i=0;i<nodes.length;i++){var r=nodes[i].getBoundingClientRect();if(r.bottom>80)return {bottom:false,node:nodes[i],top:r.top};}
|
|
178
|
+
return {bottom:false};
|
|
179
|
+
}
|
|
180
|
+
function restore(where,report){
|
|
181
|
+
if(where.bottom){if(report.first)window.scrollTo({top:document.documentElement.scrollHeight,behavior:'instant'});return;}
|
|
182
|
+
if(where.node&&where.node.isConnected){var r=where.node.getBoundingClientRect();if(Math.abs(r.top-where.top)>1)window.scrollBy({top:r.top-where.top,behavior:'instant'});}
|
|
183
|
+
if(report.first&&newUpdate){if(!unread||!unread.isConnected)unread=report.first;newUpdate.hidden=false;}
|
|
184
|
+
}
|
|
185
|
+
if(newUpdate)newUpdate.addEventListener('click',function(){
|
|
186
|
+
newUpdate.hidden=true;
|
|
187
|
+
if(!unread||!unread.isConnected)return;
|
|
188
|
+
var top=unread.getBoundingClientRect().top+window.scrollY-80;
|
|
189
|
+
window.scrollTo({top:top,behavior:'instant'});
|
|
190
|
+
if(!unread.hasAttribute('tabindex'))unread.setAttribute('tabindex','-1');
|
|
191
|
+
unread.focus({preventScroll:true});unread=null;
|
|
192
|
+
});
|
|
193
|
+
window.addEventListener('scroll',function(){if(newUpdate&&!newUpdate.hidden&&window.innerHeight+window.scrollY>=document.documentElement.scrollHeight-120)newUpdate.hidden=true;},{passive:true});
|
|
194
|
+
function markStale(live,openForm){
|
|
195
|
+
if(openForm.getAttribute('data-stale')==='1')return;
|
|
196
|
+
openForm.setAttribute('data-stale','1');
|
|
197
|
+
var submit=openForm.querySelector('button[type="submit"]');if(submit)submit.disabled=true;
|
|
198
|
+
var note=document.createElement('div');note.className='problem chat-approval-stale';note.setAttribute('role','alert');
|
|
199
|
+
var strong=document.createElement('strong');strong.textContent='The plan changed since this form opened.';
|
|
200
|
+
var words=document.createTextNode(' Review the current exact terms before approving. ');
|
|
201
|
+
var review=document.createElement('button');review.type='button';review.className='quiet';review.textContent='Review the current plan';
|
|
202
|
+
review.addEventListener('click',function(){location.reload();});
|
|
203
|
+
note.appendChild(strong);note.appendChild(words);note.appendChild(review);
|
|
204
|
+
var action=document.getElementById('task-chat-action');
|
|
205
|
+
if(action)action.insertAdjacentElement('beforebegin',note);else live.insertAdjacentElement('afterbegin',note);
|
|
206
|
+
}
|
|
207
|
+
function parse(html){return new DOMParser().parseFromString('<!doctype html><body>'+html+'</body>','text/html');}
|
|
208
|
+
// The live task region lands only when it is safe: never under an open
|
|
209
|
+
// approval form (its password, its nonce, its digest stay exactly as
|
|
210
|
+
// rendered — the stale notice above speaks for the change), never while
|
|
211
|
+
// the reader is inside it. Otherwise the fragment is kept for later.
|
|
212
|
+
function liveSafe(live){return !live.querySelector('form.approve-form')&&!live.contains(document.activeElement);}
|
|
213
|
+
function swapLive(live,nextLive){
|
|
214
|
+
reconcile(live,nextLive,{first:null,focused:false});
|
|
215
|
+
Array.prototype.forEach.call(nextLive.attributes,function(attribute){live.setAttribute(attribute.name,attribute.value);});
|
|
216
|
+
}
|
|
217
|
+
function apply(fragments){
|
|
218
|
+
// Everything is parsed and checked before the page changes: every
|
|
219
|
+
// region this page has must arrive whole, or the answer is malformed
|
|
220
|
+
// and nothing — not even the version — is taken from it.
|
|
221
|
+
var parsed=parse(fragments.thread+(fragments.after||'')+(fragments.live||''));
|
|
222
|
+
var nextThread=parsed.getElementById('chat-thread'),thread=document.getElementById('chat-thread');
|
|
223
|
+
if(!nextThread||!thread)throw new Error('response');
|
|
224
|
+
var after=document.getElementById('chat-after-composer'),nextAfter=parsed.getElementById('chat-after-composer');
|
|
225
|
+
if(after&&!nextAfter)throw new Error('response');
|
|
226
|
+
var live=document.getElementById('task-chat-live'),nextLive=parsed.getElementById('task-chat-live');
|
|
227
|
+
if(live&&!nextLive)throw new Error('response');
|
|
228
|
+
var where=anchor(),report={first:null,focused:false};
|
|
229
|
+
reconcile(thread,nextThread,report);
|
|
230
|
+
if(after)reconcile(after,nextAfter,{first:null,focused:false});
|
|
231
|
+
deferredLive=null;
|
|
232
|
+
if(live){if(liveSafe(live))swapLive(live,nextLive);else deferredLive=fragments.live;}
|
|
233
|
+
restore(where,report);
|
|
234
|
+
}
|
|
235
|
+
function settleLive(){
|
|
236
|
+
if(deferredLive===null)return;
|
|
237
|
+
var live=document.getElementById('task-chat-live');
|
|
238
|
+
if(!live){deferredLive=null;return;}
|
|
239
|
+
if(!liveSafe(live))return;
|
|
240
|
+
var nextLive=parse(deferredLive).getElementById('task-chat-live');
|
|
241
|
+
deferredLive=null;
|
|
242
|
+
if(!nextLive)return;
|
|
243
|
+
var where=anchor();
|
|
244
|
+
swapLive(live,nextLive);
|
|
245
|
+
restore(where,{first:null,focused:false});
|
|
246
|
+
}
|
|
247
|
+
function guardApproval(digest){
|
|
248
|
+
var live=document.getElementById('task-chat-live');if(!live)return;
|
|
249
|
+
var openForm=live.querySelector('form.approve-form');
|
|
250
|
+
if(openForm&&(live.getAttribute('data-approval')||'')!==digest)markStale(live,openForm);
|
|
251
|
+
}
|
|
252
|
+
remember(document.getElementById('chat-thread')||form);
|
|
253
|
+
var liveNow=document.getElementById('task-chat-live');if(liveNow)remember(liveNow);
|
|
254
|
+
// ---- the status poll -----------------------------------------------
|
|
255
|
+
// The whole answer must have the shape the server writes before any of
|
|
256
|
+
// it is believed. Only a complete answer can end the session (an
|
|
257
|
+
// explicit session:null) or move the page; anything else is a bad
|
|
258
|
+
// refresh that changes nothing and is asked again.
|
|
259
|
+
function valid(data){
|
|
260
|
+
if(data===null||typeof data!=='object')return false;
|
|
261
|
+
if(data.session===null)return true;
|
|
262
|
+
if(typeof data.session!=='number'&&typeof data.session!=='string')return false;
|
|
263
|
+
if(typeof data.task!=='string')return false;
|
|
264
|
+
if(data.unavailable===true)return true;
|
|
265
|
+
if(typeof data.version!=='string'||typeof data.pending!=='boolean'||typeof data.received!=='boolean')return false;
|
|
266
|
+
if(data.approval!==undefined&&typeof data.approval!=='string')return false;
|
|
267
|
+
if(data.fragments!==undefined){
|
|
268
|
+
var f=data.fragments;
|
|
269
|
+
if(f===null||typeof f!=='object'||typeof f.thread!=='string')return false;
|
|
270
|
+
if(f.after!==undefined&&f.after!==null&&typeof f.after!=='string')return false;
|
|
271
|
+
if(f.live!==undefined&&f.live!==null&&typeof f.live!=='string')return false;
|
|
272
|
+
}
|
|
273
|
+
return true;
|
|
274
|
+
}
|
|
275
|
+
function later(ms){if(stale)return;clearTimeout(timer);timer=setTimeout(check,ms);}
|
|
276
|
+
async function check(){
|
|
277
|
+
if(polling||stale)return;
|
|
278
|
+
if(document.hidden){later(5000);return;}
|
|
279
|
+
polling=true;
|
|
280
|
+
// The request this poll asks about is fixed here: a send submitted
|
|
281
|
+
// while the answer is in flight is a different key and is not settled
|
|
282
|
+
// by it.
|
|
283
|
+
var asked=sent?sent.request:'';
|
|
284
|
+
try{
|
|
285
|
+
var query='/chat/mate/status?version='+encodeURIComponent(version)+(task?'&task='+encodeURIComponent(task):'')+(asked?'&request='+encodeURIComponent(asked):'');
|
|
286
|
+
var r=await fetch(query,{cache:'no-store',signal:AbortSignal.timeout(10000)});
|
|
287
|
+
if(r.status===401||r.status===403||r.redirected){lostAuthority();return;}
|
|
288
|
+
if(!r.ok)throw new Error('connection');
|
|
289
|
+
var data=await r.json();
|
|
290
|
+
if(!valid(data))throw new Error('response');
|
|
291
|
+
if(data.session===null||String(data.session)!==session){changed();return;}
|
|
292
|
+
// A late answer for another lens never lands here; the poll goes on.
|
|
293
|
+
if(data.task!==task){later(5000);return;}
|
|
294
|
+
if(data.unavailable===true){unavailable();return;}
|
|
295
|
+
if(asked&&data.received===true)receipt(asked);
|
|
296
|
+
if(typeof data.approval==='string')guardApproval(data.approval);
|
|
297
|
+
if(data.version!==version){
|
|
298
|
+
// A changed version is rendered or it is not taken: without its
|
|
299
|
+
// fragments nothing moved, so the page keeps asking as before.
|
|
300
|
+
if(data.fragments===undefined)throw new Error('response');
|
|
301
|
+
apply(data.fragments);version=data.version;
|
|
302
|
+
}
|
|
303
|
+
settleLive();
|
|
304
|
+
busy=data.pending;buttons();
|
|
305
|
+
say(busy?'Reply in progress. You can draft your next message or come back later.':sent?'Message not confirmed. Check the conversation before retrying.':'');
|
|
306
|
+
later(busy?2500:5000);
|
|
307
|
+
}catch(e){say('Connection lost. Reconnecting… Your existing work is not cancelled.');later(10000);}
|
|
308
|
+
finally{polling=false;}
|
|
309
|
+
}
|
|
310
|
+
document.addEventListener('visibilitychange',function(){if(!document.hidden){sending=false;buttons();later(0);}});
|
|
311
|
+
document.addEventListener('focusout',function(){later(0);});
|
|
312
|
+
window.addEventListener('online',function(){offline=false;buttons();if(!stale)say('Connected again. Checking for updates…');later(0);});
|
|
313
|
+
window.addEventListener('offline',function(){offline=true;buttons();say('Offline. Your draft stays here; sending resumes when the connection returns.');});
|
|
314
|
+
window.addEventListener('pageshow',function(){sending=false;form.removeAttribute('aria-busy');buttons();later(0);});
|
|
315
|
+
if(offline)say('Offline. Your draft stays here; sending resumes when the connection returns.');
|
|
316
|
+
buttons();later(0);
|
|
317
|
+
})();`;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/** Fixed destinations only. A model cannot supply a URL or an executable action.
|
|
2
|
+
* These open the existing authenticated controls, never grant their authority.
|
|
3
|
+
*/
|
|
4
|
+
export declare const CHAT_CONTROLS: {
|
|
5
|
+
readonly task: {
|
|
6
|
+
readonly label: "Open task";
|
|
7
|
+
readonly target: "task";
|
|
8
|
+
};
|
|
9
|
+
readonly approval: {
|
|
10
|
+
readonly label: "Review & start";
|
|
11
|
+
readonly target: "task";
|
|
12
|
+
};
|
|
13
|
+
readonly planning: {
|
|
14
|
+
readonly label: "Review plan";
|
|
15
|
+
readonly target: "task";
|
|
16
|
+
};
|
|
17
|
+
readonly recovery: {
|
|
18
|
+
readonly label: "Review recovery options";
|
|
19
|
+
readonly target: "task";
|
|
20
|
+
};
|
|
21
|
+
readonly cancel: {
|
|
22
|
+
readonly label: "Cancel task";
|
|
23
|
+
readonly target: "task";
|
|
24
|
+
};
|
|
25
|
+
readonly result: {
|
|
26
|
+
readonly label: "Open result";
|
|
27
|
+
readonly target: "task";
|
|
28
|
+
};
|
|
29
|
+
readonly acceptance: {
|
|
30
|
+
readonly label: "Inspect result";
|
|
31
|
+
readonly target: "task";
|
|
32
|
+
};
|
|
33
|
+
readonly publish: {
|
|
34
|
+
readonly label: "Review publication";
|
|
35
|
+
readonly target: "task";
|
|
36
|
+
};
|
|
37
|
+
readonly projects: {
|
|
38
|
+
readonly label: "Manage projects";
|
|
39
|
+
readonly href: "/projects";
|
|
40
|
+
};
|
|
41
|
+
readonly code: {
|
|
42
|
+
readonly label: "Open coding workspace";
|
|
43
|
+
readonly href: "/code";
|
|
44
|
+
};
|
|
45
|
+
readonly routines: {
|
|
46
|
+
readonly label: "Manage routines";
|
|
47
|
+
readonly href: "/routines";
|
|
48
|
+
};
|
|
49
|
+
readonly flows: {
|
|
50
|
+
readonly label: "Open flows";
|
|
51
|
+
readonly href: "/flows";
|
|
52
|
+
};
|
|
53
|
+
readonly recipes: {
|
|
54
|
+
readonly label: "Browse workflows";
|
|
55
|
+
readonly href: "/recipes";
|
|
56
|
+
};
|
|
57
|
+
readonly workers: {
|
|
58
|
+
readonly label: "Manage workers";
|
|
59
|
+
readonly href: "/fleet";
|
|
60
|
+
};
|
|
61
|
+
readonly slack: {
|
|
62
|
+
readonly label: "Manage Slack";
|
|
63
|
+
readonly href: "/settings/slack";
|
|
64
|
+
};
|
|
65
|
+
readonly discord: {
|
|
66
|
+
readonly label: "Manage Discord";
|
|
67
|
+
readonly href: "/settings/discord";
|
|
68
|
+
};
|
|
69
|
+
readonly settings: {
|
|
70
|
+
readonly label: "Open settings";
|
|
71
|
+
readonly href: "/settings";
|
|
72
|
+
};
|
|
73
|
+
readonly permissions: {
|
|
74
|
+
readonly label: "Review permissions";
|
|
75
|
+
readonly href: "/settings";
|
|
76
|
+
};
|
|
77
|
+
readonly providers: {
|
|
78
|
+
readonly label: "Connect an agent";
|
|
79
|
+
readonly href: "/settings#providers";
|
|
80
|
+
};
|
|
81
|
+
readonly skills: {
|
|
82
|
+
readonly label: "Manage skills";
|
|
83
|
+
readonly href: "/settings/skills";
|
|
84
|
+
};
|
|
85
|
+
readonly tools: {
|
|
86
|
+
readonly label: "Manage tools";
|
|
87
|
+
readonly href: "/settings/tools";
|
|
88
|
+
};
|
|
89
|
+
readonly knowledge: {
|
|
90
|
+
readonly label: "Edit project knowledge";
|
|
91
|
+
readonly href: "/settings/knowledge";
|
|
92
|
+
};
|
|
93
|
+
readonly learning: {
|
|
94
|
+
readonly label: "Review learning history";
|
|
95
|
+
readonly href: "/settings/learning";
|
|
96
|
+
};
|
|
97
|
+
readonly mode: {
|
|
98
|
+
readonly label: "Review automatic approvals";
|
|
99
|
+
readonly href: "/mode";
|
|
100
|
+
};
|
|
101
|
+
readonly policy: {
|
|
102
|
+
readonly label: "Review organisation policy";
|
|
103
|
+
readonly href: "/settings/policy";
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
export type ChatControl = keyof typeof CHAT_CONTROLS;
|
|
107
|
+
export declare function isChatControl(value: unknown): value is ChatControl;
|
|
108
|
+
/** The exact recorded result of one execution, opened where the console's
|
|
109
|
+
* own result panel lives: the task lens names the execution, the run names
|
|
110
|
+
* the result, and the tab names what to read first. Never the latest run. */
|
|
111
|
+
export type ChatResultTab = "summary" | "checks" | "changes";
|
|
112
|
+
export declare function chatResultHref(task: string, run: number, tab?: ChatResultTab): string;
|
|
113
|
+
export declare function chatControlHref(control: ChatControl, task: string, run?: unknown, project?: unknown): string;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** Fixed destinations only. A model cannot supply a URL or an executable action.
|
|
2
|
+
* These open the existing authenticated controls, never grant their authority.
|
|
3
|
+
*/
|
|
4
|
+
export const CHAT_CONTROLS = {
|
|
5
|
+
task: { label: "Open task", target: "task" },
|
|
6
|
+
approval: { label: "Review & start", target: "task" },
|
|
7
|
+
planning: { label: "Review plan", target: "task" },
|
|
8
|
+
recovery: { label: "Review recovery options", target: "task" },
|
|
9
|
+
cancel: { label: "Cancel task", target: "task" },
|
|
10
|
+
result: { label: "Open result", target: "task" },
|
|
11
|
+
acceptance: { label: "Inspect result", target: "task" },
|
|
12
|
+
publish: { label: "Review publication", target: "task" },
|
|
13
|
+
projects: { label: "Manage projects", href: "/projects" },
|
|
14
|
+
code: { label: "Open coding workspace", href: "/code" },
|
|
15
|
+
routines: { label: "Manage routines", href: "/routines" },
|
|
16
|
+
flows: { label: "Open flows", href: "/flows" },
|
|
17
|
+
recipes: { label: "Browse workflows", href: "/recipes" },
|
|
18
|
+
workers: { label: "Manage workers", href: "/fleet" },
|
|
19
|
+
slack: { label: "Manage Slack", href: "/settings/slack" },
|
|
20
|
+
discord: { label: "Manage Discord", href: "/settings/discord" },
|
|
21
|
+
settings: { label: "Open settings", href: "/settings" },
|
|
22
|
+
permissions: { label: "Review permissions", href: "/settings" },
|
|
23
|
+
providers: { label: "Connect an agent", href: "/settings#providers" },
|
|
24
|
+
skills: { label: "Manage skills", href: "/settings/skills" },
|
|
25
|
+
tools: { label: "Manage tools", href: "/settings/tools" },
|
|
26
|
+
knowledge: { label: "Edit project knowledge", href: "/settings/knowledge" },
|
|
27
|
+
learning: { label: "Review learning history", href: "/settings/learning" },
|
|
28
|
+
mode: { label: "Review automatic approvals", href: "/mode" },
|
|
29
|
+
// Sprint 8: allowed providers, models and tools, and the permission ceiling. Changed there, with a password.
|
|
30
|
+
policy: { label: "Review organisation policy", href: "/settings/policy" },
|
|
31
|
+
};
|
|
32
|
+
export function isChatControl(value) {
|
|
33
|
+
return typeof value === "string" && Object.hasOwn(CHAT_CONTROLS, value);
|
|
34
|
+
}
|
|
35
|
+
export function chatResultHref(task, run, tab = "summary") {
|
|
36
|
+
return `/chat?task=${encodeURIComponent(task)}&result=${run}${tab === "summary" ? "" : `&tab=${tab}`}`;
|
|
37
|
+
}
|
|
38
|
+
export function chatControlHref(control, task, run, project) {
|
|
39
|
+
const entry = CHAT_CONTROLS[control];
|
|
40
|
+
if (control === "skills" || control === "tools")
|
|
41
|
+
return CHAT_CONTROLS[control].href + (typeof project === "string" && project ? "?repo=" + encodeURIComponent(project) : "");
|
|
42
|
+
if ("href" in entry)
|
|
43
|
+
return entry.href;
|
|
44
|
+
if (control === "acceptance")
|
|
45
|
+
return `/review?result=${encodeURIComponent(task)}&run=${Number.isSafeInteger(run) && Number(run) > 0 ? run : 0}&tab=checks`;
|
|
46
|
+
if (control === "result" && Number.isSafeInteger(run) && Number(run) > 0)
|
|
47
|
+
return chatResultHref(task, Number(run));
|
|
48
|
+
const base = "/chat?task=" + encodeURIComponent(task);
|
|
49
|
+
// Task details owns cancel, retry, publication and other dedicated ceremonies.
|
|
50
|
+
if (control === "cancel" || control === "recovery" || control === "publish")
|
|
51
|
+
return "/t/" + encodeURIComponent(task);
|
|
52
|
+
return base + (control === "approval" || control === "planning" ? "#task-chat-action" : "");
|
|
53
|
+
}
|