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,376 @@
|
|
|
1
|
+
/** Optional repository context. Callers admit project access; this module grants no authority.
|
|
2
|
+
* The index is disposable. Every read hashes the current bounded tracked source set;
|
|
3
|
+
* a missing/changed/unreadable index falls back to ordinary text search, never a task gate. */
|
|
4
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
5
|
+
import { execFileSync } from 'node:child_process';
|
|
6
|
+
import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, renameSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
7
|
+
import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
8
|
+
import { scanForSecrets } from './evidence.js';
|
|
9
|
+
const VERSION = 1;
|
|
10
|
+
const MAX_FILES = 1200, MAX_FILE_BYTES = 256_000, MAX_SOURCE_BYTES = 12_000_000;
|
|
11
|
+
const CODE = /\.(?:[cm]?[jt]sx?)$/i;
|
|
12
|
+
const TEXT = /\.(?:[cm]?[jt]sx?|md|txt|css|html|json)$/i;
|
|
13
|
+
const MAX_NODES = 16_000, MAX_EDGES = 12_000;
|
|
14
|
+
const sha = (value) => createHash('sha256').update(value).digest('hex');
|
|
15
|
+
const git = (repo, args) => execFileSync('git', ['--no-optional-locks', '-C', repo, ...args], { encoding: 'utf8', maxBuffer: 2_000_000, timeout: 10_000, stdio: ['ignore', 'pipe', 'pipe'] }).trimEnd();
|
|
16
|
+
const inside = (root, path) => { const r = relative(root, path); return r !== '..' && !r.startsWith('..' + sep) && !isAbsolute(r); };
|
|
17
|
+
function capture(request) {
|
|
18
|
+
const repo = realpathSync(request.repo);
|
|
19
|
+
if (repo !== resolve(request.repo))
|
|
20
|
+
throw Error('The project location changed.');
|
|
21
|
+
if (realpathSync(git(repo, ['rev-parse', '--show-toplevel'])) !== repo)
|
|
22
|
+
throw Error('Choose the project checkout root.');
|
|
23
|
+
const head = git(repo, ['rev-parse', '--verify', 'HEAD']);
|
|
24
|
+
const baseRevision = request.baseRevision ?? head;
|
|
25
|
+
if (!/^[a-f0-9]{40,64}$/.test(baseRevision) || git(repo, ['rev-parse', '--verify', `${baseRevision}^{commit}`]) !== baseRevision)
|
|
26
|
+
throw Error('The requested context base is unavailable.');
|
|
27
|
+
if (request.audience === 'crew' && baseRevision !== head)
|
|
28
|
+
throw Error('Crew context must start at its exact task base.');
|
|
29
|
+
const gitDir = realpathSync(git(repo, ['rev-parse', '--absolute-git-dir']));
|
|
30
|
+
if (request.project && realpathSync(git(repo, ['rev-parse', '--path-format=absolute', '--git-common-dir'])) !== realpathSync(git(request.project, ['rev-parse', '--path-format=absolute', '--git-common-dir'])))
|
|
31
|
+
throw Error('The worktree belongs to a different project.');
|
|
32
|
+
const files = git(repo, ['ls-files', '-z', '--cached']).split('\0').filter(Boolean).sort();
|
|
33
|
+
const sources = [], warnings = [];
|
|
34
|
+
let omitted = 0, omittedBytes = 0, bytes = 0;
|
|
35
|
+
for (const file of [...new Set(files)]) {
|
|
36
|
+
if (!TEXT.test(file) || /(?:^|\/)(?:node_modules|vendor|dist|build|coverage|\.git)(?:\/|$)/.test(file))
|
|
37
|
+
continue;
|
|
38
|
+
const path = resolve(repo, file);
|
|
39
|
+
if (!inside(repo, path) || file.split('/').some(p => p === '..') || /[\x00-\x1f]/.test(file)) {
|
|
40
|
+
omitted++;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
const stat = lstatSync(path);
|
|
45
|
+
// Never follow even an internal symlink: the index is scoped to tracked ordinary files.
|
|
46
|
+
if (!stat.isFile() || stat.isSymbolicLink() || realpathSync(path) !== path) {
|
|
47
|
+
omitted++;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (sources.length >= MAX_FILES || stat.size > MAX_FILE_BYTES || bytes + stat.size > MAX_SOURCE_BYTES) {
|
|
51
|
+
omitted++;
|
|
52
|
+
omittedBytes += stat.size;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const data = readFileSync(path);
|
|
56
|
+
const text = data.toString('utf8');
|
|
57
|
+
if (data.length > MAX_FILE_BYTES || /[\x00-\x08\x0b\x0c\x0e-\x1f\x7f\ufffd]/u.test(text) || scanForSecrets(text).length) {
|
|
58
|
+
omitted++;
|
|
59
|
+
omittedBytes += data.length;
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
sources.push({ file, text, sha256: sha(data) });
|
|
63
|
+
bytes += data.length;
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
omitted++;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (git(repo, ['rev-parse', '--verify', 'HEAD']) !== head)
|
|
70
|
+
throw Error('The checkout changed while context was being read.');
|
|
71
|
+
if (omitted)
|
|
72
|
+
warnings.push(`${omitted} source files were omitted because they were unavailable, excluded, sensitive or beyond the read limits.`);
|
|
73
|
+
warnings.push('Tracked files only. Static imports do not establish every runtime dependency or sufficient test coverage.');
|
|
74
|
+
const sourceHash = sha(JSON.stringify(sources.map(({ file, sha256 }) => [file, sha256])));
|
|
75
|
+
return { checkout: { repo, gitDir, head, baseRevision, sourceHash, source: 'working-tree' }, sources, omitted, omittedBytes, warnings };
|
|
76
|
+
}
|
|
77
|
+
function cacheFile(root, checkout) {
|
|
78
|
+
const absolute = resolve(root);
|
|
79
|
+
// Reject an existing symlink anywhere in the cache path, and caches inside the repo.
|
|
80
|
+
let parent = absolute;
|
|
81
|
+
while (!existsSync(parent) && dirname(parent) !== parent)
|
|
82
|
+
parent = dirname(parent);
|
|
83
|
+
if (realpathSync(parent) !== parent || inside(checkout.repo, absolute))
|
|
84
|
+
throw Error('Repository context cache must be outside the checkout.');
|
|
85
|
+
return join(absolute, `repository-${sha(JSON.stringify([checkout.repo, checkout.gitDir, checkout.baseRevision]))}.json`);
|
|
86
|
+
}
|
|
87
|
+
function validIndex(value) {
|
|
88
|
+
if (!value || typeof value !== 'object')
|
|
89
|
+
return false;
|
|
90
|
+
const i = value;
|
|
91
|
+
return i.version === VERSION && !!i.checkout && i.checkout.source === 'working-tree' && ['repo', 'gitDir', 'head', 'baseRevision', 'sourceHash'].every(k => typeof i.checkout[k] === 'string') &&
|
|
92
|
+
typeof i.extractor === 'string' && Array.isArray(i.warnings) && i.warnings.length < 100 && i.warnings.every(w => typeof w === 'string') &&
|
|
93
|
+
Array.isArray(i.nodes) && i.nodes.length <= MAX_NODES && i.nodes.every(n => typeof n.file === 'string' && typeof n.name === 'string' && Number.isSafeInteger(n.line) && n.line > 0 && Number.isSafeInteger(n.endLine) && n.endLine >= n.line) &&
|
|
94
|
+
Array.isArray(i.relationships) && i.relationships.length <= MAX_EDGES && i.relationships.every(e => typeof e.from === 'string' && typeof e.to === 'string' && typeof e.file === 'string' && Number.isSafeInteger(e.line) && e.line > 0 && ['imports', 're-exports', 'dynamic-import'].includes(e.kind) && e.provenance === 'explicit');
|
|
95
|
+
}
|
|
96
|
+
function readIndex(path) {
|
|
97
|
+
if (!existsSync(path))
|
|
98
|
+
return null;
|
|
99
|
+
if (!lstatSync(path).isFile() || lstatSync(path).isSymbolicLink() || lstatSync(path).size > 5_000_000)
|
|
100
|
+
throw Error('Unreadable repository index.');
|
|
101
|
+
const envelope = JSON.parse(readFileSync(path, 'utf8'));
|
|
102
|
+
if (sha(JSON.stringify(envelope.index)) !== envelope.sha256 || !validIndex(envelope.index))
|
|
103
|
+
throw Error('Invalid repository index.');
|
|
104
|
+
return envelope.index;
|
|
105
|
+
}
|
|
106
|
+
function writeIndex(path, index) {
|
|
107
|
+
mkdirSync(dirname(path), { recursive: true, mode: 0o700 });
|
|
108
|
+
if (realpathSync(dirname(path)) !== dirname(path))
|
|
109
|
+
throw Error('The context cache changed.');
|
|
110
|
+
const tmp = `${path}.${randomUUID()}.tmp`;
|
|
111
|
+
try {
|
|
112
|
+
writeFileSync(tmp, JSON.stringify({ index, sha256: sha(JSON.stringify(index)) }), { flag: 'wx', mode: 0o600 });
|
|
113
|
+
renameSync(tmp, path);
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
try {
|
|
117
|
+
unlinkSync(tmp);
|
|
118
|
+
}
|
|
119
|
+
catch { /* Successful atomic rename leaves no temp file. */ }
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async function buildIndex(snapshot) {
|
|
123
|
+
const compiler = (await import('typescript-parser')).default;
|
|
124
|
+
const byPath = new Map(snapshot.sources.map(source => [resolve(snapshot.checkout.repo, source.file), source]));
|
|
125
|
+
const directories = new Set([snapshot.checkout.repo]);
|
|
126
|
+
for (const file of byPath.keys()) {
|
|
127
|
+
let dir = dirname(file);
|
|
128
|
+
while (inside(snapshot.checkout.repo, dir)) {
|
|
129
|
+
directories.add(dir);
|
|
130
|
+
if (dir === snapshot.checkout.repo)
|
|
131
|
+
break;
|
|
132
|
+
dir = dirname(dir);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
let options = { module: compiler.ModuleKind.NodeNext, moduleResolution: compiler.ModuleResolutionKind.NodeNext, allowJs: true, resolveJsonModule: true };
|
|
136
|
+
const config = byPath.get(join(snapshot.checkout.repo, 'tsconfig.json'));
|
|
137
|
+
const warnings = [];
|
|
138
|
+
if (config) {
|
|
139
|
+
const parsed = compiler.parseConfigFileTextToJson(join(snapshot.checkout.repo, config.file), config.text);
|
|
140
|
+
if (!parsed.error && parsed.config?.compilerOptions) {
|
|
141
|
+
const converted = compiler.convertCompilerOptionsFromJson(parsed.config.compilerOptions, snapshot.checkout.repo);
|
|
142
|
+
options = { ...options, ...converted.options };
|
|
143
|
+
if (parsed.config.extends)
|
|
144
|
+
warnings.push('Inherited tsconfig settings are not indexed; unresolved aliases remain omitted.');
|
|
145
|
+
}
|
|
146
|
+
else
|
|
147
|
+
warnings.push('TypeScript configuration could not be read; relative imports still work.');
|
|
148
|
+
}
|
|
149
|
+
const nodes = [], relationships = [];
|
|
150
|
+
let unresolved = 0, parseFailures = 0;
|
|
151
|
+
const host = {
|
|
152
|
+
fileExists: file => byPath.has(resolve(file)),
|
|
153
|
+
readFile: file => byPath.get(resolve(file))?.text,
|
|
154
|
+
directoryExists: dir => directories.has(resolve(dir)),
|
|
155
|
+
getCurrentDirectory: () => snapshot.checkout.repo,
|
|
156
|
+
realpath: file => resolve(file),
|
|
157
|
+
};
|
|
158
|
+
for (const source of snapshot.sources.filter(s => CODE.test(s.file))) {
|
|
159
|
+
const fileName = resolve(snapshot.checkout.repo, source.file);
|
|
160
|
+
const tree = compiler.createSourceFile(fileName, source.text, compiler.ScriptTarget.Latest, true);
|
|
161
|
+
if (tree.parseDiagnostics?.length)
|
|
162
|
+
parseFailures++;
|
|
163
|
+
const line = (pos) => tree.getLineAndCharacterOfPosition(Math.min(pos, source.text.length)).line + 1;
|
|
164
|
+
const relationship = (specifier, kind, at) => {
|
|
165
|
+
const resolved = compiler.resolveModuleName(specifier, fileName, options, host).resolvedModule?.resolvedFileName;
|
|
166
|
+
if (!resolved || !byPath.has(resolve(resolved))) {
|
|
167
|
+
unresolved++;
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (relationships.length < MAX_EDGES)
|
|
171
|
+
relationships.push({ from: source.file, to: byPath.get(resolve(resolved)).file, kind, file: source.file, line: line(at), provenance: 'explicit' });
|
|
172
|
+
};
|
|
173
|
+
const visit = (node) => {
|
|
174
|
+
if (nodes.length < MAX_NODES && (compiler.isFunctionDeclaration(node) || compiler.isClassDeclaration(node) || compiler.isInterfaceDeclaration(node) || compiler.isTypeAliasDeclaration(node) || compiler.isEnumDeclaration(node) || compiler.isMethodDeclaration(node) || compiler.isVariableDeclaration(node))) {
|
|
175
|
+
const name = node.name;
|
|
176
|
+
if (name && compiler.isIdentifier(name))
|
|
177
|
+
nodes.push({ file: source.file, name: name.text, line: line(node.getStart(tree)), endLine: line(node.end) });
|
|
178
|
+
}
|
|
179
|
+
if (compiler.isImportDeclaration(node) && compiler.isStringLiteral(node.moduleSpecifier))
|
|
180
|
+
relationship(node.moduleSpecifier.text, 'imports', node.getStart(tree));
|
|
181
|
+
if (compiler.isExportDeclaration(node) && node.moduleSpecifier && compiler.isStringLiteral(node.moduleSpecifier))
|
|
182
|
+
relationship(node.moduleSpecifier.text, 're-exports', node.getStart(tree));
|
|
183
|
+
if (compiler.isCallExpression(node) && node.arguments.length === 1 && compiler.isStringLiteral(node.arguments[0])) {
|
|
184
|
+
if (node.expression.kind === compiler.SyntaxKind.ImportKeyword)
|
|
185
|
+
relationship(node.arguments[0].text, 'dynamic-import', node.getStart(tree));
|
|
186
|
+
// require may be shadowed; do not present a guessed call as a proven relationship.
|
|
187
|
+
}
|
|
188
|
+
compiler.forEachChild(node, visit);
|
|
189
|
+
};
|
|
190
|
+
visit(tree);
|
|
191
|
+
}
|
|
192
|
+
if (unresolved)
|
|
193
|
+
warnings.push(`${unresolved} external or unresolved imports were omitted.`);
|
|
194
|
+
if (parseFailures)
|
|
195
|
+
warnings.push(`${parseFailures} files had syntax errors; extracted relationships may be incomplete.`);
|
|
196
|
+
if (nodes.length === MAX_NODES || relationships.length === MAX_EDGES)
|
|
197
|
+
warnings.push('Repository relationships reached the index limit; remaining entries were omitted.');
|
|
198
|
+
return { version: VERSION, checkout: snapshot.checkout, extractor: `typescript-parser@${compiler.version}/imports-v1`, nodes, relationships, warnings };
|
|
199
|
+
}
|
|
200
|
+
const terms = (query) => [...new Set(query.replace(/([a-z])([A-Z])/g, '$1 $2').toLowerCase().match(/[\p{L}\p{N}_-]{2,}/gu) ?? [])].filter(t => !['the', 'and', 'for', 'this', 'that', 'what', 'where', 'with', 'from', 'does', 'show', 'code'].includes(t)).slice(0, 12);
|
|
201
|
+
function search(snapshot, query, index) {
|
|
202
|
+
const words = terms(query), hits = [];
|
|
203
|
+
if (!words.length)
|
|
204
|
+
return [];
|
|
205
|
+
for (const source of snapshot.sources) {
|
|
206
|
+
const names = index?.nodes.filter(n => n.file === source.file) ?? [];
|
|
207
|
+
const pathScore = words.reduce((n, word) => n + (source.file.toLowerCase().includes(word) ? 3 : 0), 0);
|
|
208
|
+
const symbol = names.map(node => ({ node, score: words.reduce((n, word) => n + (node.name.toLowerCase().includes(word) ? 5 : 0), 0) })).sort((a, b) => b.score - a.score)[0];
|
|
209
|
+
const lines = source.text.split('\n');
|
|
210
|
+
let bestLine = symbol?.score ? symbol.node.line : 1, bestScore = 0;
|
|
211
|
+
lines.forEach((line, i) => { const score = words.reduce((n, word) => n + (line.toLowerCase().includes(word) ? 1 : 0), 0); if (score > bestScore) {
|
|
212
|
+
bestScore = score;
|
|
213
|
+
if (!symbol?.score)
|
|
214
|
+
bestLine = i + 1;
|
|
215
|
+
} });
|
|
216
|
+
const score = pathScore + (symbol?.score ?? 0) + bestScore;
|
|
217
|
+
if (score)
|
|
218
|
+
hits.push({ source, line: bestLine, score, symbol: symbol?.score ? symbol.node.name : null, reason: symbol?.score ? 'Matching code symbol' : pathScore ? 'Matching file and source text' : 'Matching source text' });
|
|
219
|
+
}
|
|
220
|
+
return hits.sort((a, b) => b.score - a.score || a.source.file.localeCompare(b.source.file));
|
|
221
|
+
}
|
|
222
|
+
function impact(snapshot, query, index, warnings) {
|
|
223
|
+
const normalized = query.replace(/^\.\//, '').trim();
|
|
224
|
+
const direct = snapshot.sources.find(s => s.file === normalized);
|
|
225
|
+
const matching = index.nodes.filter(n => n.name.toLowerCase() === normalized.toLowerCase());
|
|
226
|
+
const files = [...new Set(matching.map(n => n.file))];
|
|
227
|
+
const target = direct?.file ?? (files.length === 1 ? files[0] : undefined);
|
|
228
|
+
if (!target) {
|
|
229
|
+
warnings.push(files.length > 1 ? 'That symbol occurs in several files. Use its exact repository-relative file path for impact.' : 'No exact indexed file or symbol matched. Ordinary search results are shown.');
|
|
230
|
+
return { hits: search(snapshot, query, index), edges: [] };
|
|
231
|
+
}
|
|
232
|
+
const depths = new Map([[target, 0]]), edges = [];
|
|
233
|
+
for (let depth = 0; depth < 2; depth++) {
|
|
234
|
+
for (const edge of index.relationships)
|
|
235
|
+
if (depths.get(edge.to) === depth && edges.length < 200) {
|
|
236
|
+
edges.push(edge);
|
|
237
|
+
if (!depths.has(edge.from))
|
|
238
|
+
depths.set(edge.from, depth + 1);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
const byFile = new Map(snapshot.sources.map(s => [s.file, s]));
|
|
242
|
+
const hits = [...depths].flatMap(([file, depth]) => {
|
|
243
|
+
const source = byFile.get(file);
|
|
244
|
+
if (!source)
|
|
245
|
+
return [];
|
|
246
|
+
const edge = edges.find(e => e.from === file);
|
|
247
|
+
return [{ source, line: edge?.line ?? matching.find(n => n.file === file)?.line ?? 1, score: 100 - depth, reason: depth === 0 ? 'Selected source' : `Imports the selected source within ${depth} step${depth === 1 ? '' : 's'}`, symbol: null }];
|
|
248
|
+
});
|
|
249
|
+
return { hits, edges };
|
|
250
|
+
}
|
|
251
|
+
function initialResult(request) {
|
|
252
|
+
return { version: 1, readOnly: !request.refresh, query: request.query.slice(0, 1000), mode: request.mode ?? 'search', asOf: new Date().toISOString(), checkout: null,
|
|
253
|
+
index: { engine: 'text-search', status: 'unavailable', generation: null, extractor: null }, excerpts: [], relationships: [], omissions: { files: 0, excerpts: 0, relationships: 0, sourceBytes: 0 }, warnings: [] };
|
|
254
|
+
}
|
|
255
|
+
function captureForResult(request, result) {
|
|
256
|
+
try {
|
|
257
|
+
const snapshot = capture(request);
|
|
258
|
+
result.checkout = snapshot.checkout;
|
|
259
|
+
result.warnings.push(...snapshot.warnings);
|
|
260
|
+
result.omissions.files = snapshot.omitted;
|
|
261
|
+
result.omissions.sourceBytes = snapshot.omittedBytes;
|
|
262
|
+
return snapshot;
|
|
263
|
+
}
|
|
264
|
+
catch {
|
|
265
|
+
result.warnings.push(request.audience === 'crew' ? 'Repository context is unavailable at the exact task base. Continue with the saved project context and read the assigned worktree.' : 'Repository context is unavailable. Continue with the saved project context and ordinary file reading.');
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
const responseBudget = (request) => Math.max(3000, Math.min(20_000, Number.isFinite(request.maxBytes) ? Math.floor(request.maxBytes) : request.audience === 'crew' ? 12_000 : 6500));
|
|
270
|
+
function finishContext(request, result, snapshot, index) {
|
|
271
|
+
const mode = request.mode ?? 'search';
|
|
272
|
+
const budget = responseBudget(request);
|
|
273
|
+
if (index) {
|
|
274
|
+
result.index = { engine: 'typescript-ast', status: 'ready', generation: sha(JSON.stringify(index)), extractor: index.extractor };
|
|
275
|
+
result.warnings.push(...index.warnings);
|
|
276
|
+
}
|
|
277
|
+
else
|
|
278
|
+
result.warnings.push('No current repository index is available. Ordinary source search is being used; refresh context to restore relationship lookup.');
|
|
279
|
+
const found = mode === 'impact' && index ? impact(snapshot, request.query, index, result.warnings) : { hits: search(snapshot, request.query, index), edges: [] };
|
|
280
|
+
if (mode === 'impact' && !index)
|
|
281
|
+
result.warnings.push('These are text matches, not an impact analysis.');
|
|
282
|
+
const selected = found.hits.slice(0, request.audience === 'crew' ? 8 : 5);
|
|
283
|
+
result.omissions.excerpts = Math.max(0, found.hits.length - selected.length);
|
|
284
|
+
for (const hit of selected) {
|
|
285
|
+
const lines = hit.source.text.split('\n');
|
|
286
|
+
const start = Math.max(1, hit.line - 2), end = Math.min(lines.length, start + 10);
|
|
287
|
+
const excerpt = { file: hit.source.file, line: start, endLine: end, sha256: hit.source.sha256, text: lines.slice(start - 1, end).join('\n').slice(0, 1800), reason: hit.reason, symbol: hit.symbol };
|
|
288
|
+
result.excerpts.push(excerpt);
|
|
289
|
+
if (Buffer.byteLength(JSON.stringify(result)) > budget - 750) {
|
|
290
|
+
result.excerpts.pop();
|
|
291
|
+
result.omissions.excerpts++;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
const selectedFiles = new Set(result.excerpts.map(e => e.file));
|
|
295
|
+
const related = mode === 'impact' ? found.edges : index?.relationships.filter(e => selectedFiles.has(e.from) && selectedFiles.has(e.to)) ?? [];
|
|
296
|
+
for (const edge of related) {
|
|
297
|
+
result.relationships.push(edge);
|
|
298
|
+
if (result.relationships.length > 20 || Buffer.byteLength(JSON.stringify(result)) > budget) {
|
|
299
|
+
result.relationships.pop();
|
|
300
|
+
result.omissions.relationships++;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return boundContext(result, budget);
|
|
304
|
+
}
|
|
305
|
+
function boundContext(result, budget) {
|
|
306
|
+
// Metadata is part of the same budget: a Unicode query alone can exceed
|
|
307
|
+
// a small crew allocation even when every excerpt was already omitted.
|
|
308
|
+
if (Buffer.byteLength(JSON.stringify(result)) > budget) {
|
|
309
|
+
result.query = result.query.slice(0, 128);
|
|
310
|
+
result.warnings.push('Response size limited the selection and shortened the displayed query.');
|
|
311
|
+
while (Buffer.byteLength(JSON.stringify(result)) > budget && result.excerpts.length) {
|
|
312
|
+
result.excerpts.pop();
|
|
313
|
+
result.omissions.excerpts++;
|
|
314
|
+
}
|
|
315
|
+
while (Buffer.byteLength(JSON.stringify(result)) > budget && result.relationships.length) {
|
|
316
|
+
result.relationships.pop();
|
|
317
|
+
result.omissions.relationships++;
|
|
318
|
+
}
|
|
319
|
+
if (Buffer.byteLength(JSON.stringify(result)) > budget) {
|
|
320
|
+
// Never truncate path identity and then imply it still pins source.
|
|
321
|
+
result.checkout = null;
|
|
322
|
+
result.index = { engine: 'text-search', status: 'unavailable', generation: null, extractor: null };
|
|
323
|
+
result.warnings = ['Repository context identity exceeded the response limit. Continue with ordinary file reading.'];
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
return result;
|
|
327
|
+
}
|
|
328
|
+
/** Synchronous, read-only capture for DB transaction and provider-admission callers.
|
|
329
|
+
* Call once and persist the returned selection; resume uses that capture, never fresh source. */
|
|
330
|
+
export function repositoryContextRead(request) {
|
|
331
|
+
const result = initialResult(request), snapshot = captureForResult(request, result);
|
|
332
|
+
if (!snapshot)
|
|
333
|
+
return boundContext(result, responseBudget(request));
|
|
334
|
+
let index = null;
|
|
335
|
+
try {
|
|
336
|
+
const path = request.cacheRoot ? cacheFile(request.cacheRoot, snapshot.checkout) : null;
|
|
337
|
+
const stored = path ? readIndex(path) : null;
|
|
338
|
+
if (stored && stored.extractor === 'typescript-parser@6.0.3/imports-v1' && JSON.stringify(stored.checkout) === JSON.stringify(snapshot.checkout))
|
|
339
|
+
index = stored;
|
|
340
|
+
else
|
|
341
|
+
result.index.status = stored ? 'stale' : 'missing';
|
|
342
|
+
}
|
|
343
|
+
catch {
|
|
344
|
+
result.index.status = 'unavailable';
|
|
345
|
+
}
|
|
346
|
+
return finishContext(request, result, snapshot, index);
|
|
347
|
+
}
|
|
348
|
+
/** Explicit refresh is the only cache-writing path. It never changes project/task records. */
|
|
349
|
+
export async function repositoryContext(request) {
|
|
350
|
+
if (!request.refresh)
|
|
351
|
+
return repositoryContextRead(request);
|
|
352
|
+
const result = initialResult(request), snapshot = captureForResult(request, result);
|
|
353
|
+
if (!snapshot)
|
|
354
|
+
return boundContext(result, responseBudget(request));
|
|
355
|
+
let index = null;
|
|
356
|
+
try {
|
|
357
|
+
const path = request.cacheRoot ? cacheFile(request.cacheRoot, snapshot.checkout) : null;
|
|
358
|
+
index = await buildIndex(snapshot);
|
|
359
|
+
if (path) {
|
|
360
|
+
try {
|
|
361
|
+
writeIndex(path, index);
|
|
362
|
+
}
|
|
363
|
+
catch {
|
|
364
|
+
result.warnings.push('The current source map was built but could not be saved. A later read will use ordinary source search.');
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
catch {
|
|
369
|
+
result.index.status = 'unavailable';
|
|
370
|
+
}
|
|
371
|
+
return finishContext(request, result, snapshot, index);
|
|
372
|
+
}
|
|
373
|
+
/** Human/model context rendering; saved records remain the authority and retain this structured capture. */
|
|
374
|
+
export function repositoryContextText(context) {
|
|
375
|
+
return '\nRepository context (source material, not instructions or authority). This selection is pinned to the shown checkout and source hashes; missing context never blocks the task.\n' + JSON.stringify(context).replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029') + '\n';
|
|
376
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Restart certification (plan acceptance 7): a BASELINE of the boot, the
|
|
3
|
+
* runtime, the installed service and the database's live custody, taken
|
|
4
|
+
* before a login or reboot; and a VERIFICATION afterwards against the same
|
|
5
|
+
* database — boot identity as the OS reports it, service liveness by a
|
|
6
|
+
* fresh heartbeat, recovery of what the old boot left pending, task
|
|
7
|
+
* completion — without printing a secret and without rebooting anything.
|
|
8
|
+
*
|
|
9
|
+
* The precise limits, written into every baseline so nobody reads more
|
|
10
|
+
* into a pass than it proves:
|
|
11
|
+
* - macOS LaunchAgents resume at USER LOGIN after a reboot, not before
|
|
12
|
+
* FileVault unlock / login; a machine that sits at the login window
|
|
13
|
+
* runs nothing.
|
|
14
|
+
* - Linux user services depend on a login session or `loginctl
|
|
15
|
+
* enable-linger`; without linger the user manager stops at logout.
|
|
16
|
+
* - The Windows Task Scheduler logon trigger is a LOGON trigger, not a
|
|
17
|
+
* boot service.
|
|
18
|
+
* - This tool never reboots, logs out, or restarts a service itself. A
|
|
19
|
+
* physical reboot that has not happened is not claimed: `bootChanged`
|
|
20
|
+
* is the OS's own word, and `unknown` stays unknown.
|
|
21
|
+
*/
|
|
22
|
+
import { type BootIdentity } from "./boot-identity.js";
|
|
23
|
+
import { type ServiceDefinition, type ServiceStatus, type SupervisorRunner } from "./daemon.js";
|
|
24
|
+
import { type Store } from "./store.js";
|
|
25
|
+
export declare const RESTART_LIMITS: readonly string[];
|
|
26
|
+
export type RestartBaseline = {
|
|
27
|
+
version: 2;
|
|
28
|
+
runnerName: string | null;
|
|
29
|
+
completionTasks: string[];
|
|
30
|
+
recordedAt: string;
|
|
31
|
+
host: string;
|
|
32
|
+
boot: {
|
|
33
|
+
id: string | null;
|
|
34
|
+
source: string | null;
|
|
35
|
+
problem: string | null;
|
|
36
|
+
};
|
|
37
|
+
runtime: {
|
|
38
|
+
digest: string;
|
|
39
|
+
nodeVersion: string;
|
|
40
|
+
execPath: string;
|
|
41
|
+
platform: NodeJS.Platform;
|
|
42
|
+
packageVersion: string | null;
|
|
43
|
+
};
|
|
44
|
+
containment: Record<string, unknown>;
|
|
45
|
+
service: (ServiceStatus & {
|
|
46
|
+
label: string;
|
|
47
|
+
platform: string;
|
|
48
|
+
}) | null;
|
|
49
|
+
database: {
|
|
50
|
+
identity: string;
|
|
51
|
+
schemaVersion: number;
|
|
52
|
+
runners: {
|
|
53
|
+
name: string;
|
|
54
|
+
host: string;
|
|
55
|
+
heartbeatAt: string;
|
|
56
|
+
alive: boolean;
|
|
57
|
+
retired: boolean;
|
|
58
|
+
}[];
|
|
59
|
+
pendingStops: {
|
|
60
|
+
run: number;
|
|
61
|
+
taskRef: number;
|
|
62
|
+
requestedAt: string;
|
|
63
|
+
problem: string | null;
|
|
64
|
+
}[];
|
|
65
|
+
openRuns: {
|
|
66
|
+
id: number;
|
|
67
|
+
taskRef: number;
|
|
68
|
+
role: string;
|
|
69
|
+
runner: string;
|
|
70
|
+
leaseId: string;
|
|
71
|
+
}[];
|
|
72
|
+
runningTasks: string[];
|
|
73
|
+
witnesses: {
|
|
74
|
+
run: number;
|
|
75
|
+
pid: number | null;
|
|
76
|
+
host: string;
|
|
77
|
+
bootId: string | null;
|
|
78
|
+
containment: string | null;
|
|
79
|
+
open: boolean;
|
|
80
|
+
}[];
|
|
81
|
+
};
|
|
82
|
+
limits: readonly string[];
|
|
83
|
+
};
|
|
84
|
+
export type BaselineInputs = {
|
|
85
|
+
store: Store;
|
|
86
|
+
service?: {
|
|
87
|
+
definition: ServiceDefinition;
|
|
88
|
+
run: SupervisorRunner;
|
|
89
|
+
} | undefined;
|
|
90
|
+
now?: Date;
|
|
91
|
+
packageVersion?: string | null;
|
|
92
|
+
boot?: BootIdentity;
|
|
93
|
+
runnerName?: string;
|
|
94
|
+
completionTasks?: string[];
|
|
95
|
+
/** Injectable reader for runtime fixtures; production re-reads its actual files. */
|
|
96
|
+
runtimeDigest?: () => string;
|
|
97
|
+
};
|
|
98
|
+
export declare function restartRuntimeDigest(executable?: string, root?: string): string;
|
|
99
|
+
/** Everything a person needs to compare later, none of what they must not see. */
|
|
100
|
+
export declare function recordRestartBaseline(inputs: BaselineInputs): Promise<RestartBaseline>;
|
|
101
|
+
export type RestartCheck = {
|
|
102
|
+
name: string;
|
|
103
|
+
ok: boolean;
|
|
104
|
+
detail: string;
|
|
105
|
+
};
|
|
106
|
+
export type RestartVerification = {
|
|
107
|
+
ok: boolean;
|
|
108
|
+
/** The OS's word: true = a different verified boot, false = the same boot, null = unknown either side. */
|
|
109
|
+
bootChanged: boolean | null;
|
|
110
|
+
expectation: "reboot" | "login" | "either";
|
|
111
|
+
checks: RestartCheck[];
|
|
112
|
+
current: RestartBaseline;
|
|
113
|
+
limits: readonly string[];
|
|
114
|
+
};
|
|
115
|
+
export type VerifyInputs = BaselineInputs & {
|
|
116
|
+
baseline: RestartBaseline;
|
|
117
|
+
/** What the operator did: a reboot must show a changed boot; a login (no reboot) the same one. */
|
|
118
|
+
expect?: "reboot" | "login" | "either";
|
|
119
|
+
/** Settle what the old boot left behind before judging recovery (the watch does this on its own; the certificate does it explicitly). */
|
|
120
|
+
recover?: boolean;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Compare now against the baseline. Recovery is judged by the SAME rules
|
|
124
|
+
* the controller uses (stopQuiescenceProblem, settleQuiescentStops): a
|
|
125
|
+
* stop the old boot left pending settles only when its witnesses are
|
|
126
|
+
* proven gone — by the verified boot change, or by the probes — and a
|
|
127
|
+
* stop that still cannot settle is reported with the exact reason, never
|
|
128
|
+
* forced.
|
|
129
|
+
*/
|
|
130
|
+
export declare function verifyRestartRecovery(inputs: VerifyInputs): Promise<RestartVerification>;
|
|
131
|
+
/** The baseline and verification are meant to be printed; this keeps a secret from ever entering them. */
|
|
132
|
+
export declare function assertNoSecret(json: string, secrets: readonly string[]): void;
|
|
133
|
+
/** The current boot id, for scripts that print it beside a baseline. */
|
|
134
|
+
export declare function bootIdNow(): string | null;
|