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
package/dist/live.js
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The live window (arc 1): what the running agent is saying, on disk, for
|
|
3
|
+
* the run page to poll — and NOTHING else.
|
|
4
|
+
*
|
|
5
|
+
* This file is display state, not evidence. No artifact row points at it,
|
|
6
|
+
* no digest binds it, and the page that renders it says so: the machine
|
|
7
|
+
* running the agent could alter it. It exists so a person can watch work
|
|
8
|
+
* happen without a terminal, and every byte in it went through the same
|
|
9
|
+
* sanitize discipline as the peek: controls stripped, credential-shaped
|
|
10
|
+
* lines replaced whole, tool activity described in OUR fixed vocabulary —
|
|
11
|
+
* event metadata is never echoed.
|
|
12
|
+
*
|
|
13
|
+
* Fail-soft everywhere: a live view that cannot be written must never
|
|
14
|
+
* break, slow, or reclassify a build.
|
|
15
|
+
*/
|
|
16
|
+
import { closeSync, constants, fstatSync, mkdirSync, openSync, readSync, readdirSync, statSync, unlinkSync, writeSync } from "node:fs";
|
|
17
|
+
import { join } from "node:path";
|
|
18
|
+
import { scanForSecrets } from "./evidence.js";
|
|
19
|
+
export const LIVE_LINE_CAP = 2 * 1024;
|
|
20
|
+
export const LIVE_FILE_CAP = 2 * 1024 * 1024;
|
|
21
|
+
export const LIVE_CAP_MARKER = "[the live view stopped at its size cap — the run record continues]";
|
|
22
|
+
export const LIVE_REDACTED_LINE = "[a credential-shaped line was redacted]";
|
|
23
|
+
/** Finalized runs keep their live file this long for the final drain. */
|
|
24
|
+
export const LIVE_RETAIN_MS = 24 * 60 * 60 * 1000;
|
|
25
|
+
/** The bounded sweep: at most this many FINALIZED files survive a pass. */
|
|
26
|
+
export const LIVE_FILE_BOUND = 500;
|
|
27
|
+
export function liveDir(root) {
|
|
28
|
+
return join(root, "live");
|
|
29
|
+
}
|
|
30
|
+
/** The exact filename, from the numeric id and nothing else — no user
|
|
31
|
+
* input is ever parsed into this path. */
|
|
32
|
+
export function liveLogPath(root, runId) {
|
|
33
|
+
return join(liveDir(root), `${Math.trunc(runId)}.log`);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The fixed tool-headline vocabulary. Known harness tools map to OUR
|
|
37
|
+
* phrases; anything unrecognized gets the generic line. The tool's own
|
|
38
|
+
* name, arguments, and metadata never reach the file: a tool named after
|
|
39
|
+
* a secret stays unspoken.
|
|
40
|
+
*/
|
|
41
|
+
const TOOL_HEADLINES = new Map([
|
|
42
|
+
["Edit", "→ editing files"],
|
|
43
|
+
["Write", "→ editing files"],
|
|
44
|
+
["MultiEdit", "→ editing files"],
|
|
45
|
+
["NotebookEdit", "→ editing files"],
|
|
46
|
+
["Bash", "→ running a command"],
|
|
47
|
+
["Read", "→ reading the code"],
|
|
48
|
+
["Glob", "→ searching the code"],
|
|
49
|
+
["Grep", "→ searching the code"],
|
|
50
|
+
["LS", "→ reading the code"],
|
|
51
|
+
["WebFetch", "→ looking something up"],
|
|
52
|
+
["WebSearch", "→ looking something up"],
|
|
53
|
+
["TodoWrite", "→ organizing its plan"],
|
|
54
|
+
["Task", "→ delegating to a helper"],
|
|
55
|
+
]);
|
|
56
|
+
const TOOL_HEADLINE_GENERIC = "→ using a tool";
|
|
57
|
+
/** Strip ANSI escapes and every control character; tabs become spaces. */
|
|
58
|
+
function stripControls(text) {
|
|
59
|
+
return text
|
|
60
|
+
.replace(/\x1b\[[0-9;?]*[ -\/]*[@-~]/g, "")
|
|
61
|
+
.replace(/\t/g, " ")
|
|
62
|
+
.replace(/[\x00-\x1f\x7f-\x9f]/g, "");
|
|
63
|
+
}
|
|
64
|
+
/** Cut a string to at most `cap` UTF-8 bytes without splitting a character. */
|
|
65
|
+
function capBytes(text, cap) {
|
|
66
|
+
if (Buffer.byteLength(text, "utf8") <= cap)
|
|
67
|
+
return text;
|
|
68
|
+
const bytes = Buffer.from(text, "utf8").subarray(0, cap);
|
|
69
|
+
const decoded = bytes.toString("utf8");
|
|
70
|
+
// A cut mid-character decodes with a trailing replacement char — drop it.
|
|
71
|
+
return decoded.endsWith("�") ? decoded.slice(0, -1) : decoded;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* One stream event → zero or more display lines, in the fixed vocabulary.
|
|
75
|
+
* Assistant TEXT is the agent's own words (sanitized below); tool use is a
|
|
76
|
+
* headline; everything else — tool results, deltas, results, subagent
|
|
77
|
+
* chatter — renders nothing in v1.
|
|
78
|
+
*/
|
|
79
|
+
export function renderTranscriptLines(event) {
|
|
80
|
+
const type = String(event["type"] ?? "");
|
|
81
|
+
if (type === "system" && String(event["subtype"] ?? "") === "init") {
|
|
82
|
+
return ["the agent session started"];
|
|
83
|
+
}
|
|
84
|
+
// Codex-shaped streams (peek): a thread starts, items complete.
|
|
85
|
+
if (type === "thread.started")
|
|
86
|
+
return ["the agent session started"];
|
|
87
|
+
if (type === "item.completed") {
|
|
88
|
+
const item = event["item"];
|
|
89
|
+
const kind = item === undefined ? "" : String(item["type"] ?? "");
|
|
90
|
+
if (kind === "agent_message") {
|
|
91
|
+
const text = item?.["text"];
|
|
92
|
+
return typeof text === "string" ? text.split("\n").filter(one => one.trim() !== "") : [];
|
|
93
|
+
}
|
|
94
|
+
if (kind === "command_execution")
|
|
95
|
+
return ["→ running a command"];
|
|
96
|
+
if (kind === "file_change")
|
|
97
|
+
return ["→ editing files"];
|
|
98
|
+
if (kind === "web_search")
|
|
99
|
+
return ["→ looking something up"];
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
102
|
+
// Gemini-shaped streams (peek): whole assistant messages, never deltas.
|
|
103
|
+
if (type === "init")
|
|
104
|
+
return ["the agent session started"];
|
|
105
|
+
if (type === "message" && String(event["role"] ?? "") === "assistant" && event["delta"] !== true) {
|
|
106
|
+
const content = event["content"];
|
|
107
|
+
return typeof content === "string" ? content.split("\n").filter(one => one.trim() !== "") : [];
|
|
108
|
+
}
|
|
109
|
+
if (type === "tool_call" || type === "tool_use") {
|
|
110
|
+
const name = event["name"] ?? event["tool"]?.["name"];
|
|
111
|
+
return [TOOL_HEADLINES.get(typeof name === "string" ? name : "") ?? TOOL_HEADLINE_GENERIC];
|
|
112
|
+
}
|
|
113
|
+
if (type !== "assistant")
|
|
114
|
+
return [];
|
|
115
|
+
// Top-level only: a subagent's words are not this run's transcript.
|
|
116
|
+
const parent = event["parent_tool_use_id"];
|
|
117
|
+
if (parent !== undefined && parent !== null)
|
|
118
|
+
return [];
|
|
119
|
+
const message = event["message"];
|
|
120
|
+
const content = message?.["content"];
|
|
121
|
+
if (!Array.isArray(content))
|
|
122
|
+
return [];
|
|
123
|
+
const lines = [];
|
|
124
|
+
for (const block of content) {
|
|
125
|
+
if (block === null || typeof block !== "object")
|
|
126
|
+
continue;
|
|
127
|
+
const kind = String(block["type"] ?? "");
|
|
128
|
+
if (kind === "text") {
|
|
129
|
+
const text = block["text"];
|
|
130
|
+
if (typeof text === "string" && text.trim() !== "") {
|
|
131
|
+
for (const one of text.split("\n")) {
|
|
132
|
+
if (one.trim() !== "")
|
|
133
|
+
lines.push(one);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
else if (kind === "tool_use") {
|
|
138
|
+
const name = block["name"];
|
|
139
|
+
lines.push(TOOL_HEADLINES.get(typeof name === "string" ? name : "") ?? TOOL_HEADLINE_GENERIC);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return lines;
|
|
143
|
+
}
|
|
144
|
+
/** Sanitize one display line: strip, redact whole on any secret hit, cap. */
|
|
145
|
+
export function sanitizeTranscriptLine(line) {
|
|
146
|
+
const stripped = stripControls(line);
|
|
147
|
+
if (scanForSecrets(stripped).length > 0)
|
|
148
|
+
return LIVE_REDACTED_LINE;
|
|
149
|
+
return capBytes(stripped, LIVE_LINE_CAP);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Open the run's live file for appending. The directory is 0700, the file
|
|
153
|
+
* 0600 and CREATED HERE (O_EXCL: a name that already exists — whatever put
|
|
154
|
+
* it there — is refused, not appended to), opened O_NOFOLLOW with the
|
|
155
|
+
* descriptor retained for the run's whole duration. Returns null on any
|
|
156
|
+
* failure: no live view is ever worth a build.
|
|
157
|
+
*/
|
|
158
|
+
export function openLiveLog(root, runId) {
|
|
159
|
+
let fd;
|
|
160
|
+
try {
|
|
161
|
+
mkdirSync(liveDir(root), { recursive: true, mode: 0o700 });
|
|
162
|
+
fd = openSync(liveLogPath(root, runId), constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | constants.O_APPEND | constants.O_NOFOLLOW, 0o600);
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
let written = 0;
|
|
168
|
+
let capped = false;
|
|
169
|
+
let closed = false;
|
|
170
|
+
const append = (line) => {
|
|
171
|
+
if (closed || capped)
|
|
172
|
+
return;
|
|
173
|
+
const payload = Buffer.from(`${line}\n`, "utf8");
|
|
174
|
+
// The marker is RESERVED inside the cap: whatever remains must still fit it.
|
|
175
|
+
const markerBytes = Buffer.byteLength(`${LIVE_CAP_MARKER}\n`, "utf8");
|
|
176
|
+
if (written + payload.length + markerBytes > LIVE_FILE_CAP) {
|
|
177
|
+
capped = true;
|
|
178
|
+
try {
|
|
179
|
+
writeSync(fd, `${LIVE_CAP_MARKER}\n`);
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
// Nothing to do: the file simply ends early.
|
|
183
|
+
}
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
try {
|
|
187
|
+
writeSync(fd, payload);
|
|
188
|
+
written += payload.length;
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
closed = true; // a broken descriptor never breaks the run
|
|
192
|
+
try {
|
|
193
|
+
closeSync(fd);
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
// already gone
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
return {
|
|
201
|
+
observe(event) {
|
|
202
|
+
try {
|
|
203
|
+
for (const line of renderTranscriptLines(event)) {
|
|
204
|
+
append(sanitizeTranscriptLine(line));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
// Rendering is observational; a malformed event renders nothing.
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
close() {
|
|
212
|
+
if (closed)
|
|
213
|
+
return;
|
|
214
|
+
closed = true;
|
|
215
|
+
try {
|
|
216
|
+
closeSync(fd);
|
|
217
|
+
}
|
|
218
|
+
catch {
|
|
219
|
+
// already gone
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
const READ_WINDOW = 64 * 1024;
|
|
225
|
+
const READ_LOOKAHEAD = 2 * 1024;
|
|
226
|
+
/**
|
|
227
|
+
* Read the live file from a byte offset, returning only COMPLETE lines
|
|
228
|
+
* (through the last LF in the window). The descriptor is the authority:
|
|
229
|
+
* opened O_NOFOLLOW, proved a regular file, measured and read through
|
|
230
|
+
* itself. A file smaller than the offset was replaced — the caller resets,
|
|
231
|
+
* visibly, never silently duplicating (arc 1 §4). `allowTail` (the final
|
|
232
|
+
* drain) returns the unterminated tail after finalization.
|
|
233
|
+
*/
|
|
234
|
+
export function readLiveWindow(root, runId, from, allowTail = false) {
|
|
235
|
+
if (!Number.isSafeInteger(from) || from < 0)
|
|
236
|
+
return { ok: false, reason: "unreadable" };
|
|
237
|
+
let fd;
|
|
238
|
+
try {
|
|
239
|
+
fd = openSync(liveLogPath(root, runId), constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
240
|
+
}
|
|
241
|
+
catch (error) {
|
|
242
|
+
return { ok: false, reason: error.code === "ENOENT" ? "missing" : "unreadable" };
|
|
243
|
+
}
|
|
244
|
+
try {
|
|
245
|
+
const stat = fstatSync(fd);
|
|
246
|
+
if (!stat.isFile())
|
|
247
|
+
return { ok: false, reason: "unreadable" };
|
|
248
|
+
const size = Number(stat.size);
|
|
249
|
+
if (size < from)
|
|
250
|
+
return { ok: false, reason: "replaced" };
|
|
251
|
+
const want = Math.min(size - from, READ_WINDOW + READ_LOOKAHEAD);
|
|
252
|
+
const buffer = Buffer.alloc(want);
|
|
253
|
+
let offset = 0;
|
|
254
|
+
while (offset < want) {
|
|
255
|
+
const read = readSync(fd, buffer, offset, want - offset, from + offset);
|
|
256
|
+
if (read <= 0)
|
|
257
|
+
break;
|
|
258
|
+
offset += read;
|
|
259
|
+
}
|
|
260
|
+
const chunk = buffer.subarray(0, offset);
|
|
261
|
+
const lastLf = chunk.lastIndexOf(0x0a);
|
|
262
|
+
const eofReached = from + offset >= size;
|
|
263
|
+
if (lastLf === -1) {
|
|
264
|
+
if (allowTail && eofReached && offset > 0) {
|
|
265
|
+
return { ok: true, text: chunk.toString("utf8"), nextOffset: from + offset, eof: true };
|
|
266
|
+
}
|
|
267
|
+
return { ok: true, text: "", nextOffset: from, eof: eofReached && offset === 0 };
|
|
268
|
+
}
|
|
269
|
+
if (allowTail && eofReached && lastLf + 1 < offset) {
|
|
270
|
+
return { ok: true, text: chunk.toString("utf8"), nextOffset: from + offset, eof: true };
|
|
271
|
+
}
|
|
272
|
+
const complete = chunk.subarray(0, lastLf + 1);
|
|
273
|
+
return { ok: true, text: complete.toString("utf8"), nextOffset: from + lastLf + 1, eof: from + lastLf + 1 >= size };
|
|
274
|
+
}
|
|
275
|
+
catch {
|
|
276
|
+
return { ok: false, reason: "unreadable" };
|
|
277
|
+
}
|
|
278
|
+
finally {
|
|
279
|
+
closeSync(fd);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Enumerate the live directory for the reconcile sweep. Pure listing — the
|
|
284
|
+
* CALLER decides which runs are finalized and when; this module only
|
|
285
|
+
* refuses to guess. Non-run names are reported with runId null (orphans
|
|
286
|
+
* from nothing this plane wrote; aged on mtime like everything else).
|
|
287
|
+
*/
|
|
288
|
+
export function listLiveFiles(root) {
|
|
289
|
+
let names;
|
|
290
|
+
try {
|
|
291
|
+
names = readdirSync(liveDir(root));
|
|
292
|
+
}
|
|
293
|
+
catch {
|
|
294
|
+
return [];
|
|
295
|
+
}
|
|
296
|
+
const out = [];
|
|
297
|
+
for (const name of names) {
|
|
298
|
+
let mtimeMs = 0;
|
|
299
|
+
try {
|
|
300
|
+
mtimeMs = statSync(join(liveDir(root), name)).mtimeMs;
|
|
301
|
+
}
|
|
302
|
+
catch {
|
|
303
|
+
continue;
|
|
304
|
+
}
|
|
305
|
+
const match = /^(\d{1,15})\.log$/.exec(name);
|
|
306
|
+
out.push({ runId: match === null ? null : Number(match[1]), fileName: name, mtimeMs });
|
|
307
|
+
}
|
|
308
|
+
return out;
|
|
309
|
+
}
|
|
310
|
+
/** Remove one live file, silently: a sweep never throws over display state. */
|
|
311
|
+
export function removeLiveFile(root, fileName) {
|
|
312
|
+
// The name comes from listLiveFiles' own readdir, never from user input.
|
|
313
|
+
if (fileName.includes("/") || fileName.includes("\\") || fileName.includes(".."))
|
|
314
|
+
return;
|
|
315
|
+
try {
|
|
316
|
+
unlinkSync(join(liveDir(root), fileName));
|
|
317
|
+
}
|
|
318
|
+
catch {
|
|
319
|
+
// already gone
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* The reconcile sweep (arc 1 §2): ACTIVE runs are exempt ABSOLUTELY — the
|
|
324
|
+
* transport's no-truncation assumption depends on it. Finalized runs age
|
|
325
|
+
* from finished_at; orphans (no run row, or a name this plane never
|
|
326
|
+
* writes) age from mtime; and the 500-file bound applies only WITHIN the
|
|
327
|
+
* finalized-or-orphan set, oldest first.
|
|
328
|
+
*/
|
|
329
|
+
export function sweepLiveLogs(store, root, now) {
|
|
330
|
+
const removed = [];
|
|
331
|
+
const removable = [];
|
|
332
|
+
for (const entry of listLiveFiles(root)) {
|
|
333
|
+
if (entry.runId !== null) {
|
|
334
|
+
const run = store.getRun(entry.runId);
|
|
335
|
+
if (run !== null && run.outcome === null)
|
|
336
|
+
continue; // live: untouchable
|
|
337
|
+
const finished = run?.finishedAt === null || run?.finishedAt === undefined ? null : Date.parse(run.finishedAt);
|
|
338
|
+
removable.push({
|
|
339
|
+
fileName: entry.fileName,
|
|
340
|
+
ageAnchorMs: finished === null || Number.isNaN(finished) ? entry.mtimeMs : finished,
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
removable.push({ fileName: entry.fileName, ageAnchorMs: entry.mtimeMs });
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
removable.sort((a, b) => a.ageAnchorMs - b.ageAnchorMs);
|
|
348
|
+
const cutoff = now.getTime() - LIVE_RETAIN_MS;
|
|
349
|
+
const survivors = [];
|
|
350
|
+
for (const one of removable) {
|
|
351
|
+
if (one.ageAnchorMs <= cutoff) {
|
|
352
|
+
removeLiveFile(root, one.fileName);
|
|
353
|
+
removed.push(one.fileName);
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
survivors.push(one);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
// Oldest-first beyond the bound — still never touching an active run.
|
|
360
|
+
for (let index = 0; index < survivors.length - LIVE_FILE_BOUND; index += 1) {
|
|
361
|
+
const one = survivors[index];
|
|
362
|
+
removeLiveFile(root, one.fileName);
|
|
363
|
+
removed.push(one.fileName);
|
|
364
|
+
}
|
|
365
|
+
return { removed };
|
|
366
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attended-liveness semantics (Parity II Phase 1, S3) — the ONE definition
|
|
3
|
+
* every attended feature consumes. A browser proves presence only by
|
|
4
|
+
* RENEWING a heartbeat; absence is inferred only from renewal ceasing,
|
|
5
|
+
* never from observing a tab close (which is not reliably observable).
|
|
6
|
+
* Renewal can extend nothing past an absolute expiry and can never mint
|
|
7
|
+
* or broaden authority — it only keeps an already-signed authorization
|
|
8
|
+
* usable (strategy rulings 1c/12).
|
|
9
|
+
*
|
|
10
|
+
* The state contract, exact (spec finding 11/18):
|
|
11
|
+
* - "expired" iff now >= absoluteExpiryAt — checked FIRST; renewal is
|
|
12
|
+
* irrelevant past the absolute wall.
|
|
13
|
+
* - a null beat (never renewed) is "lapsed".
|
|
14
|
+
* - a FUTURE beat is "lapsed": strict means strict — a clock that claims
|
|
15
|
+
* tomorrow proves nothing about presence now.
|
|
16
|
+
* - "live" iff now - lastBeatAt <= 20s (one 15s beat + 5s jitter).
|
|
17
|
+
* - "grace" iff now - lastBeatAt <= 45s (one missed beat, forgiven —
|
|
18
|
+
* background-tab throttling survives grace, not live).
|
|
19
|
+
* - otherwise "lapsed".
|
|
20
|
+
*
|
|
21
|
+
* Session COOKIE lifetimes (12h idle / 7d absolute in serve.ts) are a
|
|
22
|
+
* different thing and are untouched by all of this.
|
|
23
|
+
*/
|
|
24
|
+
export declare const BEAT_MS = 15000;
|
|
25
|
+
/** live = one beat plus jitter. */
|
|
26
|
+
export declare const LIVE_MS = 20000;
|
|
27
|
+
/** grace = one whole missed beat beyond live, forgiven. */
|
|
28
|
+
export declare const GRACE_MS = 45000;
|
|
29
|
+
export type AttendedLiveness = "live" | "grace" | "lapsed" | "expired";
|
|
30
|
+
export declare function attendedLivenessState(lastBeatAt: number | null, now: number, absoluteExpiryAt: number): AttendedLiveness;
|
package/dist/liveness.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attended-liveness semantics (Parity II Phase 1, S3) — the ONE definition
|
|
3
|
+
* every attended feature consumes. A browser proves presence only by
|
|
4
|
+
* RENEWING a heartbeat; absence is inferred only from renewal ceasing,
|
|
5
|
+
* never from observing a tab close (which is not reliably observable).
|
|
6
|
+
* Renewal can extend nothing past an absolute expiry and can never mint
|
|
7
|
+
* or broaden authority — it only keeps an already-signed authorization
|
|
8
|
+
* usable (strategy rulings 1c/12).
|
|
9
|
+
*
|
|
10
|
+
* The state contract, exact (spec finding 11/18):
|
|
11
|
+
* - "expired" iff now >= absoluteExpiryAt — checked FIRST; renewal is
|
|
12
|
+
* irrelevant past the absolute wall.
|
|
13
|
+
* - a null beat (never renewed) is "lapsed".
|
|
14
|
+
* - a FUTURE beat is "lapsed": strict means strict — a clock that claims
|
|
15
|
+
* tomorrow proves nothing about presence now.
|
|
16
|
+
* - "live" iff now - lastBeatAt <= 20s (one 15s beat + 5s jitter).
|
|
17
|
+
* - "grace" iff now - lastBeatAt <= 45s (one missed beat, forgiven —
|
|
18
|
+
* background-tab throttling survives grace, not live).
|
|
19
|
+
* - otherwise "lapsed".
|
|
20
|
+
*
|
|
21
|
+
* Session COOKIE lifetimes (12h idle / 7d absolute in serve.ts) are a
|
|
22
|
+
* different thing and are untouched by all of this.
|
|
23
|
+
*/
|
|
24
|
+
export const BEAT_MS = 15_000;
|
|
25
|
+
/** live = one beat plus jitter. */
|
|
26
|
+
export const LIVE_MS = 20_000;
|
|
27
|
+
/** grace = one whole missed beat beyond live, forgiven. */
|
|
28
|
+
export const GRACE_MS = 45_000;
|
|
29
|
+
export function attendedLivenessState(lastBeatAt, now, absoluteExpiryAt) {
|
|
30
|
+
if (now >= absoluteExpiryAt)
|
|
31
|
+
return "expired";
|
|
32
|
+
if (lastBeatAt === null)
|
|
33
|
+
return "lapsed";
|
|
34
|
+
if (lastBeatAt > now)
|
|
35
|
+
return "lapsed";
|
|
36
|
+
const age = now - lastBeatAt;
|
|
37
|
+
if (age <= LIVE_MS)
|
|
38
|
+
return "live";
|
|
39
|
+
if (age <= GRACE_MS)
|
|
40
|
+
return "grace";
|
|
41
|
+
return "lapsed";
|
|
42
|
+
}
|
package/dist/log.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type LogLevel = "info" | "warn" | "error";
|
|
2
|
+
export type LogFields = Record<string, string | number | boolean | null | undefined>;
|
|
3
|
+
export declare function formatLogLine(level: LogLevel, event: string, fields: LogFields, now: Date, json: boolean): string;
|
|
4
|
+
export declare function logEvent(level: LogLevel, event: string, fields?: LogFields, options?: {
|
|
5
|
+
now?: Date;
|
|
6
|
+
write?: (line: string) => void;
|
|
7
|
+
}): void;
|
package/dist/log.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One line per event on stderr (v99), where the service manager keeps the
|
|
3
|
+
* log. Plain by default ("2026-09-27T17:00:00.000Z error serve.error path=/x
|
|
4
|
+
* error=…"); with TOOLROLL_LOG_FORMAT=json, one JSON object per line
|
|
5
|
+
* for a log shipper. Fields are facts about the event, never a request body,
|
|
6
|
+
* a password or a token; values are cut to 500 characters and key-shaped text
|
|
7
|
+
* is blanked.
|
|
8
|
+
*/
|
|
9
|
+
import { scanForSecrets } from "./evidence.js";
|
|
10
|
+
import { envValue } from "./names.js";
|
|
11
|
+
const clean = (value) => {
|
|
12
|
+
const cut = value.replace(/[\u0000-\u001f\u007f]+/g, " ").slice(0, 500);
|
|
13
|
+
return scanForSecrets(cut).length > 0 ? "[redacted: key-shaped text]" : cut;
|
|
14
|
+
};
|
|
15
|
+
export function formatLogLine(level, event, fields, now, json) {
|
|
16
|
+
const facts = Object.entries(fields).filter((entry) => entry[1] !== undefined)
|
|
17
|
+
.map(([key, value]) => [key, typeof value === "string" ? clean(value) : value]);
|
|
18
|
+
if (json)
|
|
19
|
+
return JSON.stringify({ at: now.toISOString(), level, event, ...Object.fromEntries(facts) });
|
|
20
|
+
return [now.toISOString(), level, event, ...facts.map(([key, value]) => `${key}=${typeof value === "string" && /\s/.test(value) ? JSON.stringify(value) : String(value)}`)].join(" ");
|
|
21
|
+
}
|
|
22
|
+
export function logEvent(level, event, fields = {}, options = {}) {
|
|
23
|
+
const line = formatLogLine(level, event, fields, options.now ?? new Date(), envValue(process.env, "LOG_FORMAT") === "json");
|
|
24
|
+
(options.write ?? (text => process.stderr.write(text)))(`${line}\n`);
|
|
25
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export type MailboxAccess = {
|
|
2
|
+
host: string;
|
|
3
|
+
port: number;
|
|
4
|
+
secure: boolean;
|
|
5
|
+
user: string;
|
|
6
|
+
password?: string;
|
|
7
|
+
accessToken?: string;
|
|
8
|
+
};
|
|
9
|
+
export type InboundMail = {
|
|
10
|
+
uid: number;
|
|
11
|
+
messageId: string | null;
|
|
12
|
+
inReplyTo: string | null;
|
|
13
|
+
references: string[];
|
|
14
|
+
from: string;
|
|
15
|
+
fromName: string | null;
|
|
16
|
+
subject: string;
|
|
17
|
+
text: string;
|
|
18
|
+
automatic: boolean;
|
|
19
|
+
};
|
|
20
|
+
/** Where a folder stands: its UIDVALIDITY and the last UID seen. */
|
|
21
|
+
export type MailCursor = {
|
|
22
|
+
validity: string;
|
|
23
|
+
uid: number;
|
|
24
|
+
};
|
|
25
|
+
/** `at` is where the next read starts; `more` says mail is still waiting past it. */
|
|
26
|
+
export type MailRead = {
|
|
27
|
+
ok: true;
|
|
28
|
+
at: MailCursor;
|
|
29
|
+
mails: InboundMail[];
|
|
30
|
+
renumbered: boolean;
|
|
31
|
+
more: boolean;
|
|
32
|
+
} | {
|
|
33
|
+
ok: false;
|
|
34
|
+
said: string;
|
|
35
|
+
permanent: boolean;
|
|
36
|
+
};
|
|
37
|
+
export type MailReader = (access: MailboxAccess, folder: string, after: MailCursor | null, limit: number) => Promise<MailRead>;
|
|
38
|
+
export declare function mailCursorOf(text: string | null): MailCursor | null;
|
|
39
|
+
export declare const mailCursorText: (at: MailCursor) => string;
|
|
40
|
+
/** Whether Inbox triggers can read mail: a connected Google account, or a mail server with its IMAP address. */
|
|
41
|
+
export declare function mailboxReady(dir: string | null): boolean;
|
|
42
|
+
/** The mailbox to read, signed in: Google when connected, else the mail server's IMAP. */
|
|
43
|
+
export declare function mailboxAccess(dir: string | null, fetcher: typeof fetch): Promise<{
|
|
44
|
+
ok: true;
|
|
45
|
+
access: MailboxAccess;
|
|
46
|
+
address: string;
|
|
47
|
+
} | {
|
|
48
|
+
ok: false;
|
|
49
|
+
said: string;
|
|
50
|
+
permanent: boolean;
|
|
51
|
+
}>;
|
|
52
|
+
/** The new part of a message: no quoted earlier messages, no signature, tidy lines. */
|
|
53
|
+
export declare function freshText(text: string): string;
|
|
54
|
+
/** One raw message as plain words, and whether a machine sent it. */
|
|
55
|
+
export declare function readMail(uid: number, source: Buffer | string): Promise<InboundMail>;
|
|
56
|
+
/** The production reader: one read-only IMAP visit. */
|
|
57
|
+
export declare const readThroughImap: MailReader;
|