@quantiya/codevibe-core 2.0.0 → 2.0.2
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/dist/__tests__/cp-5-baseline-invariants.test.d.ts +1 -0
- package/dist/__tests__/prompt-parser.test.d.ts +1 -0
- package/dist/adapter/__tests__/capabilities.test.d.ts +1 -0
- package/dist/adapter/__tests__/contract-conformance.test.d.ts +1 -0
- package/dist/adapter/__tests__/packets.test.d.ts +1 -0
- package/dist/adapter/__tests__/progress.test.d.ts +1 -0
- package/dist/adapter/__tests__/registry.test.d.ts +1 -0
- package/dist/adapter/__tests__/smoke/claude.smoke.test.d.ts +1 -0
- package/dist/adapter/__tests__/smoke/codex.smoke.test.d.ts +1 -0
- package/dist/adapter/__tests__/smoke/gemini.smoke.test.d.ts +1 -0
- package/dist/adapter/capabilities.d.ts +68 -0
- package/dist/adapter/index.d.ts +7 -0
- package/dist/adapter/packets.d.ts +129 -0
- package/dist/adapter/progress.d.ts +93 -0
- package/dist/adapter/registry.d.ts +91 -0
- package/dist/adapter/types.d.ts +22 -0
- package/dist/appsync/__tests__/appsync-client-apply-user-decision.test.d.ts +1 -0
- package/dist/appsync/__tests__/appsync-client-classb.test.d.ts +1 -0
- package/dist/appsync/__tests__/appsync-client-event-source-filter.test.d.ts +1 -0
- package/dist/appsync/__tests__/appsync-client-planner.test.d.ts +1 -0
- package/dist/appsync/__tests__/appsync-client-task-group.test.d.ts +1 -0
- package/dist/appsync/__tests__/appsync-client.test.d.ts +1 -0
- package/dist/appsync/__tests__/cleanup-subscription.test.d.ts +1 -0
- package/dist/appsync/__tests__/coerce-awsjson-and-review-summary.test.d.ts +1 -0
- package/dist/appsync/__tests__/cp1f-quorum-sdk.test.d.ts +1 -0
- package/dist/appsync/__tests__/event-throttle.test.d.ts +1 -0
- package/dist/appsync/appsync-client.d.ts +1025 -2
- package/dist/appsync/event-throttle.d.ts +28 -0
- package/dist/appsync/index.d.ts +4 -1
- package/dist/appsync/queries.d.ts +34 -0
- package/dist/audit-keys/index.d.ts +32 -0
- package/dist/auth/__tests__/auth-telemetry.test.d.ts +1 -0
- package/dist/auth/auth-service.d.ts +32 -2
- package/dist/auth/auth-telemetry.d.ts +117 -6
- package/dist/auth/index.d.ts +1 -0
- package/dist/companion-mode/__tests__/persist-preference.test.d.ts +1 -0
- package/dist/companion-mode/__tests__/resolve-agent.test.d.ts +1 -0
- package/dist/companion-mode/agent-picker.d.ts +9 -0
- package/dist/companion-mode/index.d.ts +55 -0
- package/dist/companion-mode/persist-preference.d.ts +24 -0
- package/dist/companion-mode/resolve-agent.d.ts +41 -0
- package/dist/config/config.d.ts +8 -1
- package/dist/continuation/__tests__/dirty-state-collector.test.d.ts +1 -0
- package/dist/continuation/__tests__/integration.test.d.ts +1 -0
- package/dist/continuation/__tests__/packet-reader.test.d.ts +1 -0
- package/dist/continuation/__tests__/packet-writer.test.d.ts +1 -0
- package/dist/continuation/__tests__/parity.test.d.ts +1 -0
- package/dist/continuation/__tests__/status-cli.test.d.ts +1 -0
- package/dist/continuation/dirty-state-collector.d.ts +46 -0
- package/dist/continuation/index.d.ts +8 -0
- package/dist/continuation/packet-reader.d.ts +33 -0
- package/dist/continuation/packet-writer.d.ts +86 -0
- package/dist/continuation/types.d.ts +239 -0
- package/dist/credential-broker/__tests__/broker.test.d.ts +1 -0
- package/dist/credential-broker/__tests__/canonical.test.d.ts +1 -0
- package/dist/credential-broker/__tests__/scrubber.test.d.ts +1 -0
- package/dist/credential-broker/__tests__/upstream-client.test.d.ts +1 -0
- package/dist/credential-broker/__tests__/vendor-key-store.test.d.ts +1 -0
- package/dist/credential-broker/audit-sink.d.ts +69 -0
- package/dist/credential-broker/broker-config.d.ts +39 -0
- package/dist/credential-broker/broker-token.d.ts +123 -0
- package/dist/credential-broker/broker.d.ts +165 -0
- package/dist/credential-broker/canonical.d.ts +119 -0
- package/dist/credential-broker/index.d.ts +15 -0
- package/dist/credential-broker/scrubber.d.ts +45 -0
- package/dist/credential-broker/types.d.ts +141 -0
- package/dist/credential-broker/upstream-client.d.ts +20 -0
- package/dist/credential-broker/vendor-key-store.d.ts +54 -0
- package/dist/index.d.ts +17 -4
- package/dist/index.js +559 -55
- package/dist/keychain/__tests__/keychain-backend.test.d.ts +1 -0
- package/dist/keychain/keychain-backend.d.ts +82 -0
- package/dist/keychain/keychain-manager.d.ts +16 -2
- package/dist/local-executor/__tests__/agentic-disposable-repo.test.d.ts +1 -0
- package/dist/local-executor/__tests__/agentic-resolve.test.d.ts +1 -0
- package/dist/local-executor/__tests__/agentic-resolver-flag.test.d.ts +1 -0
- package/dist/local-executor/__tests__/authority-symlink-fixture.d.ts +15 -0
- package/dist/local-executor/__tests__/authority.test.d.ts +1 -0
- package/dist/local-executor/__tests__/class-a-emit.test.d.ts +1 -0
- package/dist/local-executor/__tests__/class-a-sign.test.d.ts +1 -0
- package/dist/local-executor/__tests__/class-b-consumer.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/class-b-consumer.test.d.ts +1 -0
- package/dist/local-executor/__tests__/class1-reconcilers.test.d.ts +1 -0
- package/dist/local-executor/__tests__/class2-resolver.test.d.ts +1 -0
- package/dist/local-executor/__tests__/confined-model-caller.test.d.ts +1 -0
- package/dist/local-executor/__tests__/conflict-classifier.test.d.ts +1 -0
- package/dist/local-executor/__tests__/conflict-resolution-durable-store.test.d.ts +1 -0
- package/dist/local-executor/__tests__/conflict-resolution-store.test.d.ts +1 -0
- package/dist/local-executor/__tests__/cp1f-quorum-consumer.test.d.ts +1 -0
- package/dist/local-executor/__tests__/cp7-audit-writer.test.d.ts +1 -0
- package/dist/local-executor/__tests__/durable-store.test.d.ts +1 -0
- package/dist/local-executor/__tests__/git-lock-retry.test.d.ts +1 -0
- package/dist/local-executor/__tests__/hook-bridge.test.d.ts +1 -0
- package/dist/local-executor/__tests__/implementor-argv.test.d.ts +1 -0
- package/dist/local-executor/__tests__/local-executor-teams.test.d.ts +1 -0
- package/dist/local-executor/__tests__/local-executor.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-conflict-extract.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-conflict-git.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-conflict-resolve-agentic.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-conflict-resolve.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-journal-store.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-train-agentic-recovery.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-train-w3.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-train-waveb.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-train.test.d.ts +1 -0
- package/dist/local-executor/__tests__/promote-wal-store.test.d.ts +1 -0
- package/dist/local-executor/__tests__/revert-reconcile.test.d.ts +1 -0
- package/dist/local-executor/__tests__/revert-runner.test.d.ts +1 -0
- package/dist/local-executor/__tests__/shared-contract-detector.test.d.ts +1 -0
- package/dist/local-executor/__tests__/spawn.test.d.ts +1 -0
- package/dist/local-executor/__tests__/substrate-engage.test.d.ts +1 -0
- package/dist/local-executor/__tests__/team-execution-flag.test.d.ts +1 -0
- package/dist/local-executor/__tests__/track-registry.test.d.ts +1 -0
- package/dist/local-executor/__tests__/verification-runner.test.d.ts +1 -0
- package/dist/local-executor/__tests__/wb2-review-bundle.test.d.ts +1 -0
- package/dist/local-executor/__tests__/wb2-substrate-spawn.live.test.d.ts +1 -0
- package/dist/local-executor/__tests__/workspace-shadow.test.d.ts +1 -0
- package/dist/local-executor/__tests__/worktree-merge.test.d.ts +1 -0
- package/dist/local-executor/agentic-disposable-repo.d.ts +52 -0
- package/dist/local-executor/agentic-resolve.d.ts +54 -0
- package/dist/local-executor/agentic-resolver-flag.d.ts +9 -0
- package/dist/local-executor/authority.d.ts +61 -0
- package/dist/local-executor/class-a-emit.d.ts +140 -0
- package/dist/local-executor/class-a-sign.d.ts +57 -0
- package/dist/local-executor/class-b-consumer.d.ts +276 -0
- package/dist/local-executor/class-b-verify.d.ts +30 -0
- package/dist/local-executor/class1-reconcilers.d.ts +58 -0
- package/dist/local-executor/class2-resolver.d.ts +74 -0
- package/dist/local-executor/confined-model-caller.d.ts +39 -0
- package/dist/local-executor/conflict-classifier.d.ts +21 -0
- package/dist/local-executor/conflict-resolution-durable-store.d.ts +61 -0
- package/dist/local-executor/conflict-resolution-store.d.ts +210 -0
- package/dist/local-executor/conflict-types.d.ts +86 -0
- package/dist/local-executor/cp7-audit-writer.d.ts +152 -0
- package/dist/local-executor/durable-store.d.ts +334 -0
- package/dist/local-executor/git-lock-retry.d.ts +40 -0
- package/dist/local-executor/hook-bridge.d.ts +36 -0
- package/dist/local-executor/implementor-argv.d.ts +183 -0
- package/dist/local-executor/index.d.ts +49 -0
- package/dist/local-executor/local-executor-impl.d.ts +724 -0
- package/dist/local-executor/merge-conflict-extract.d.ts +34 -0
- package/dist/local-executor/merge-conflict-resolve.d.ts +101 -0
- package/dist/local-executor/merge-journal-store.d.ts +311 -0
- package/dist/local-executor/merge-train.d.ts +713 -0
- package/dist/local-executor/promote-wal-store.d.ts +301 -0
- package/dist/local-executor/resolution-set-index.d.ts +51 -0
- package/dist/local-executor/revert-reconcile.d.ts +89 -0
- package/dist/local-executor/revert-runner.d.ts +17 -0
- package/dist/local-executor/shared-contract-detector.d.ts +57 -0
- package/dist/local-executor/spawn.d.ts +34 -0
- package/dist/local-executor/task-group-types.d.ts +346 -0
- package/dist/local-executor/team-execution-flag.d.ts +21 -0
- package/dist/local-executor/track-registry.d.ts +50 -0
- package/dist/local-executor/types.d.ts +417 -0
- package/dist/local-executor/verification-gates/build.d.ts +6 -0
- package/dist/local-executor/verification-gates/deploy-preflight.d.ts +6 -0
- package/dist/local-executor/verification-gates/diff-sanity.d.ts +6 -0
- package/dist/local-executor/verification-gates/hostile-grep.d.ts +6 -0
- package/dist/local-executor/verification-gates/lint.d.ts +6 -0
- package/dist/local-executor/verification-gates/shell-runner.d.ts +40 -0
- package/dist/local-executor/verification-gates/source-traceability.d.ts +6 -0
- package/dist/local-executor/verification-gates/tests.d.ts +6 -0
- package/dist/local-executor/verification-gates/typecheck.d.ts +6 -0
- package/dist/local-executor/verification-runner.d.ts +28 -0
- package/dist/local-executor/wb2-review-bundle.d.ts +59 -0
- package/dist/local-executor/workspace-shadow.d.ts +290 -0
- package/dist/local-executor/worktree-merge.d.ts +601 -0
- package/dist/local-model/__tests__/installer.test.d.ts +1 -0
- package/dist/local-model/__tests__/manager.test.d.ts +1 -0
- package/dist/local-model/__tests__/ollama.test.d.ts +1 -0
- package/dist/local-model/__tests__/runtime.test.d.ts +1 -0
- package/dist/local-model/__tests__/state.test.d.ts +1 -0
- package/dist/local-model/manager.d.ts +119 -0
- package/dist/local-model/ollama.d.ts +27 -0
- package/dist/local-model/runtime.d.ts +27 -0
- package/dist/local-model/state.d.ts +32 -0
- package/dist/orchestration/__tests__/setup-bootstrap.test.d.ts +1 -0
- package/dist/orchestration/__tests__/setup-failure-recourse.test.d.ts +1 -0
- package/dist/orchestration/__tests__/setup-save.test.d.ts +1 -0
- package/dist/orchestration/__tests__/setup-seat-picker.test.d.ts +1 -0
- package/dist/orchestration/__tests__/setup-telemetry.test.d.ts +1 -0
- package/dist/orchestration/__tests__/setup-test-agents.test.d.ts +1 -0
- package/dist/orchestration/__tests__/setup-types.test.d.ts +1 -0
- package/dist/orchestration/__tests__/setup-wizard.test.d.ts +1 -0
- package/dist/orchestration/__tests__/v1-options.test.d.ts +1 -0
- package/dist/orchestration/detect-agents.d.ts +16 -2
- package/dist/orchestration/index.d.ts +1 -0
- package/dist/orchestration/orchestration-cli.d.ts +4 -1
- package/dist/orchestration/setup-bootstrap.d.ts +146 -0
- package/dist/orchestration/setup-failure-recourse.d.ts +23 -0
- package/dist/orchestration/setup-save.d.ts +47 -0
- package/dist/orchestration/setup-seat-picker.d.ts +72 -0
- package/dist/orchestration/setup-telemetry.d.ts +54 -0
- package/dist/orchestration/setup-test-agents.d.ts +108 -0
- package/dist/orchestration/setup-types.d.ts +141 -0
- package/dist/orchestration/setup-wizard.d.ts +57 -0
- package/dist/orchestration/v1-options.d.ts +97 -0
- package/dist/orchestration-shell/__tests__/attachments.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/audit-browser.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/audited-path-fixes.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/bracketed-paste.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-authority-bridge.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-group-halt-wiring.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-orchestration-session-bootstrap.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-planner-stack.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-probe-group-status.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-quorum-loop-tier.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-singleton-enforcement.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-stub-session-adapter.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-verdict-classifier-wiring.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/components.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/context-store.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp10-585-accept-echo-target.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp10-585-loop.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp10-585-prompts.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp12-w2b-team-loop.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp12-w4-team-recovery.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp1f-quorum-loop.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp606-team-track-user-resolved.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp7-reviewer-substrate.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/declared-test-runner.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/emit-shell-event.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/familiarize-routing.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/gate-decision-submit.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/gate-details-panel.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/gate-prompts.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/gate-verdict-details-dispatch.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/group-decision-submit.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/hostile-grep.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/image-attach-e2e.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/input-bar-autocomplete.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/live-region-cap.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/live-static-order.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/mode-selection.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/model-cli.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/non-gate-prompt-routing.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/orchestration-app-group-decision-transport.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/orchestration-app-layout.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/process-markers.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/reducer.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/reissue-team-retained-spec.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/review-summary-render.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/reviewer-wizard.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/reviewers-format.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/root-discovery.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/runOrchestrationShell-classify-dispatch.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/runOrchestrationShell-planner-wiring.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/runOrchestrationShell-signal.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/runOrchestrationShell.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/serialize-submissions.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/slash-router.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/slash-suggest.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/status-format.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/sticky-preference.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/task-progress.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/team-decompose-routing.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/team-decompose-types.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/team-decompose.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/team-e2e-smoke.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/tier2-reviewer-selection.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/web-browsing.test.d.ts +1 -0
- package/dist/orchestration-shell/attachments.d.ts +152 -0
- package/dist/orchestration-shell/audit-browser.d.ts +115 -0
- package/dist/orchestration-shell/audit-runner.d.ts +59 -0
- package/dist/orchestration-shell/bracketed-paste.d.ts +26 -0
- package/dist/orchestration-shell/cli.d.ts +431 -0
- package/dist/orchestration-shell/cli.js +44191 -0
- package/dist/orchestration-shell/cohort-flag.d.ts +16 -0
- package/dist/orchestration-shell/components/AuditLogPanel.d.ts +11 -0
- package/dist/orchestration-shell/components/CodeVibeLogo.d.ts +2 -0
- package/dist/orchestration-shell/components/ConversationPane.d.ts +13 -0
- package/dist/orchestration-shell/components/GateDetailsPanel.d.ts +57 -0
- package/dist/orchestration-shell/components/GatePanelEntry.d.ts +9 -0
- package/dist/orchestration-shell/components/GatePromptEntry.d.ts +16 -0
- package/dist/orchestration-shell/components/InputBar.d.ts +55 -0
- package/dist/orchestration-shell/components/LiveProgressLine.d.ts +8 -0
- package/dist/orchestration-shell/components/MultiTrackStatusNode.d.ts +8 -0
- package/dist/orchestration-shell/components/OrchestrationApp.d.ts +129 -0
- package/dist/orchestration-shell/components/ReviewerSetupWizard.d.ts +24 -0
- package/dist/orchestration-shell/components/StatusBar.d.ts +20 -0
- package/dist/orchestration-shell/components/nodes/AdvisoryEntry.d.ts +8 -0
- package/dist/orchestration-shell/components/nodes/GateStatusNode.d.ts +8 -0
- package/dist/orchestration-shell/components/nodes/PlannerDecisionEntry.d.ts +8 -0
- package/dist/orchestration-shell/components/nodes/ReviewerQuorumStatusNode.d.ts +8 -0
- package/dist/orchestration-shell/components/nodes/SlashOutputEntry.d.ts +8 -0
- package/dist/orchestration-shell/components/nodes/SubagentEventEntry.d.ts +8 -0
- package/dist/orchestration-shell/components/nodes/UserMessageEntry.d.ts +8 -0
- package/dist/orchestration-shell/context-store.d.ts +389 -0
- package/dist/orchestration-shell/declared-test-runner.d.ts +84 -0
- package/dist/orchestration-shell/emit-shell-event.d.ts +64 -0
- package/dist/orchestration-shell/gate-decision-submit.d.ts +245 -0
- package/dist/orchestration-shell/gate-prompts.d.ts +481 -0
- package/dist/orchestration-shell/index.d.ts +712 -0
- package/dist/orchestration-shell/ink-runtime.d.ts +84 -0
- package/dist/orchestration-shell/live-region-cap.d.ts +70 -0
- package/dist/orchestration-shell/live-static-order.d.ts +22 -0
- package/dist/orchestration-shell/mode-selection.d.ts +46 -0
- package/dist/orchestration-shell/non-tty-fallback.d.ts +67 -0
- package/dist/orchestration-shell/process-markers.d.ts +12 -0
- package/dist/orchestration-shell/quorum-loop.d.ts +1900 -0
- package/dist/orchestration-shell/reducer.d.ts +8 -0
- package/dist/orchestration-shell/root-discovery.d.ts +25 -0
- package/dist/orchestration-shell/route-browse.d.ts +20 -0
- package/dist/orchestration-shell/slash-router.d.ts +64 -0
- package/dist/orchestration-shell/slash-routes/continuation.d.ts +71 -0
- package/dist/orchestration-shell/slash-routes/reviewers.d.ts +41 -0
- package/dist/orchestration-shell/slash-suggest.d.ts +29 -0
- package/dist/orchestration-shell/status-format.d.ts +59 -0
- package/dist/orchestration-shell/sticky-preference.d.ts +24 -0
- package/dist/orchestration-shell/store.d.ts +17 -0
- package/dist/orchestration-shell/task-progress.d.ts +122 -0
- package/dist/orchestration-shell/team-decompose.d.ts +196 -0
- package/dist/orchestration-shell/types.d.ts +777 -0
- package/dist/orchestration-shell/vendor/ink-parse-keypress.d.ts +42 -0
- package/dist/orchestration-shell/web/extract.d.ts +11 -0
- package/dist/orchestration-shell/web/fetch.d.ts +15 -0
- package/dist/orchestration-shell/web/ip.d.ts +26 -0
- package/dist/orchestration-shell/web/sanitize.d.ts +14 -0
- package/dist/orchestration-shell/web/search.d.ts +16 -0
- package/dist/planner/__tests__/cache-clarification-bypass.test.d.ts +1 -0
- package/dist/planner/__tests__/cache.test.d.ts +1 -0
- package/dist/planner/__tests__/client.test.d.ts +1 -0
- package/dist/planner/__tests__/health-machine-transitions.test.d.ts +1 -0
- package/dist/planner/__tests__/local-gemma.test.d.ts +1 -0
- package/dist/planner/__tests__/types-zod.test.d.ts +1 -0
- package/dist/planner/adapter.d.ts +16 -0
- package/dist/planner/cache.d.ts +35 -0
- package/dist/planner/client.d.ts +103 -0
- package/dist/planner/health-state.d.ts +24 -0
- package/dist/planner/index.d.ts +7 -0
- package/dist/planner/local-advisory.d.ts +84 -0
- package/dist/planner/local-gemma.d.ts +23 -0
- package/dist/planner/types.d.ts +123 -0
- package/dist/reviewer/__tests__/antigravity-provider.test.d.ts +1 -0
- package/dist/reviewer/__tests__/claude-provider-json.test.d.ts +1 -0
- package/dist/reviewer/__tests__/cp7-reviewer-sandbox.test.d.ts +1 -0
- package/dist/reviewer/__tests__/output-parser-classifier-helpers.test.d.ts +1 -0
- package/dist/reviewer/__tests__/verdict-classifier.test.d.ts +1 -0
- package/dist/reviewer/index.d.ts +2 -0
- package/dist/reviewer/output-parser.d.ts +48 -12
- package/dist/reviewer/provider.d.ts +107 -3
- package/dist/reviewer/providers/__tests__/failure-classifier.test.d.ts +1 -0
- package/dist/reviewer/providers/antigravity.d.ts +49 -0
- package/dist/reviewer/providers/claude.d.ts +19 -4
- package/dist/reviewer/providers/codex.d.ts +47 -5
- package/dist/reviewer/providers/failure-classifier.d.ts +26 -0
- package/dist/reviewer/providers/gemini.d.ts +5 -4
- package/dist/reviewer/registry.d.ts +5 -5
- package/dist/reviewer/subprocess.d.ts +37 -0
- package/dist/reviewer/token-usage.d.ts +32 -0
- package/dist/reviewer/types.d.ts +5 -5
- package/dist/reviewer/verdict-classifier.d.ts +62 -0
- package/dist/session/__tests__/prepare-event-timestamp.test.d.ts +1 -0
- package/dist/session/__tests__/session-resume-service-keys.test.d.ts +1 -0
- package/dist/session/index.d.ts +1 -0
- package/dist/session/prepare-event-timestamp.d.ts +30 -0
- package/dist/session/session-rekey.d.ts +40 -0
- package/dist/session/session-resume.d.ts +25 -0
- package/dist/structural-summary/__tests__/__fixtures__/fixture-helpers.d.ts +11 -0
- package/dist/structural-summary/__tests__/assembler.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/generator.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/language-detect.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/manifest-parsers/cargo.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/manifest-parsers/gomod.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/manifest-parsers/gradle.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/manifest-parsers/index.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/manifest-parsers/npm.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/manifest-parsers/podfile.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/manifest-parsers/pyproject.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/opt-in-store.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/privacy-filter.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/safe-file-read.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/user-ignore-matcher.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/walker.test.d.ts +1 -0
- package/dist/structural-summary/generator.d.ts +8 -0
- package/dist/structural-summary/index.d.ts +7 -0
- package/dist/structural-summary/manifest-parsers/cargo.d.ts +3 -0
- package/dist/structural-summary/manifest-parsers/index.d.ts +7 -0
- package/dist/structural-summary/manifest-parsers/npm.d.ts +3 -0
- package/dist/structural-summary/manifest-parsers/other.d.ts +17 -0
- package/dist/structural-summary/opt-in-store.d.ts +24 -0
- package/dist/structural-summary/privacy-filter.d.ts +110 -0
- package/dist/structural-summary/safe-file-read.d.ts +11 -0
- package/dist/structural-summary/types.d.ts +215 -0
- package/dist/structural-summary/user-ignore-matcher.d.ts +9 -0
- package/dist/structural-summary/walker.d.ts +20 -0
- package/dist/substrate/__tests__/docker.test.d.ts +1 -0
- package/dist/substrate/__tests__/forwarder.test.d.ts +1 -0
- package/dist/substrate/__tests__/git-proxy.test.d.ts +1 -0
- package/dist/substrate/__tests__/sandbox-exec.test.d.ts +1 -0
- package/dist/substrate/__tests__/substrate-e2e.integration.test.d.ts +1 -0
- package/dist/substrate/command-runner.d.ts +19 -0
- package/dist/substrate/docker.d.ts +134 -0
- package/dist/substrate/errors.d.ts +33 -0
- package/dist/substrate/forwarder.d.ts +67 -0
- package/dist/substrate/git-proxy.d.ts +35 -0
- package/dist/substrate/index.d.ts +12 -0
- package/dist/substrate/relay-script.d.ts +27 -0
- package/dist/substrate/sandbox-exec.d.ts +116 -0
- package/dist/substrate/types.d.ts +218 -0
- package/dist/substrate-launch/__tests__/apikey-bootstrap.test.d.ts +1 -0
- package/dist/substrate-launch/__tests__/creditless-loop.integration.test.d.ts +1 -0
- package/dist/substrate-launch/__tests__/engage-substrate.test.d.ts +1 -0
- package/dist/substrate-launch/__tests__/fallback-ladder.test.d.ts +1 -0
- package/dist/substrate-launch/__tests__/le-env-scrub.test.d.ts +1 -0
- package/dist/substrate-launch/__tests__/sanitized-env.test.d.ts +1 -0
- package/dist/substrate-launch/apikey-bootstrap.d.ts +84 -0
- package/dist/substrate-launch/engage-substrate.d.ts +102 -0
- package/dist/substrate-launch/fallback-ladder.d.ts +49 -0
- package/dist/substrate-launch/index.d.ts +12 -0
- package/dist/substrate-launch/le-env-scrub.d.ts +77 -0
- package/dist/substrate-launch/sanitized-env.d.ts +73 -0
- package/dist/types/auth.d.ts +6 -1
- package/dist/types/events.d.ts +19 -2
- package/dist/types/reviewer.d.ts +6 -6
- package/package.json +21 -3
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { AppSyncClient } from '../appsync/appsync-client';
|
|
2
|
+
import type { AuthorityScope } from '../local-executor/authority';
|
|
3
|
+
import type { ContinuationPacket, PacketWriteInput, PacketWriteResult, RepoState } from './types';
|
|
4
|
+
import { type DirtyStateCollector } from './dirty-state-collector';
|
|
5
|
+
export interface ContinuationPacketWriterDeps {
|
|
6
|
+
/** Direct mutation invocation per LOCK #C6-A-10.4.10.2 — NOT routed via emitShellEvent. */
|
|
7
|
+
appsync: AppSyncClient;
|
|
8
|
+
/** Authority scope for dirty-state clamp per LOCK #C6-A-7. */
|
|
9
|
+
authority: AuthorityScope;
|
|
10
|
+
/**
|
|
11
|
+
* Optional INFORMATIONAL Class A timeline mirror. Failure is swallowed;
|
|
12
|
+
* the AUTHORITATIVE audit row is what `recordContinuationPacketWritten`
|
|
13
|
+
* produced.
|
|
14
|
+
*/
|
|
15
|
+
shellEmit?: (event: {
|
|
16
|
+
type: string;
|
|
17
|
+
taskId: string;
|
|
18
|
+
packetHash: string;
|
|
19
|
+
}) => Promise<void>;
|
|
20
|
+
/** Test seam — override the dirty-state collector. */
|
|
21
|
+
dirtyStateCollector?: DirtyStateCollector;
|
|
22
|
+
/** Test seam — override the home directory. Defaults to `os.homedir()`. */
|
|
23
|
+
homeDir?: string;
|
|
24
|
+
/** Test seam — clock injection. */
|
|
25
|
+
clock?: () => number;
|
|
26
|
+
/** Test seam — random tmp-suffix injection. */
|
|
27
|
+
randomHex?: () => string;
|
|
28
|
+
}
|
|
29
|
+
export interface ContinuationPacketWriter {
|
|
30
|
+
write(input: PacketWriteInput): Promise<PacketWriteResult>;
|
|
31
|
+
/** Test-only — exposes the per-task mutex map size for assertions. */
|
|
32
|
+
readonly mutexMapSizeForTests: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* §8.1 AUTO-SENTINEL placeholders — the values `buildContinuationPacket` writes
|
|
36
|
+
* for `completedWork` / `remainingWork` / `verification` when the source
|
|
37
|
+
* implementor did NOT enumerate its progress (e.g. a HARD quota cap where the
|
|
38
|
+
* agent never produced a structured continuation output — the realistic case
|
|
39
|
+
* the quota fork covers). Exported so the resume path
|
|
40
|
+
* (`QuorumLoop.buildResumeBrief`) can DETECT the sentinel-only case and frame
|
|
41
|
+
* the task summary as the full actionable work, instead of echoing "unknown"
|
|
42
|
+
* back to the resumed agent (which reads it as "nothing to do" and no-ops).
|
|
43
|
+
*/
|
|
44
|
+
export declare const WORK_NOT_ENUMERATED_SENTINEL = "unknown \u2014 implementor did not enumerate";
|
|
45
|
+
export declare const VERIFICATION_NOT_RECORDED_SENTINEL = "not_checked \u2014 no verification recorded by source implementor";
|
|
46
|
+
/**
|
|
47
|
+
* Build the canonical 17-field `ContinuationPacket` from the caller-
|
|
48
|
+
* supplied `PacketWriteInput`. Applies the §8.1 sentinel taxonomy:
|
|
49
|
+
* - 8 STRICT-REQUIRED fields → throw `PacketFidelityError` on
|
|
50
|
+
* undefined.
|
|
51
|
+
* - 1 CALLER-OR-COLLECTOR field (`repoStates`) → fall through to
|
|
52
|
+
* `repoStatesFromCollector` (which the caller pre-resolved).
|
|
53
|
+
* - 7 AUTO-SENTINEL fields → default per §8.1 table.
|
|
54
|
+
* - 1 WRITER-CONSTANT field (`packetVersion`) → always `1`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function buildContinuationPacket(input: PacketWriteInput, repoStatesFromCollector: RepoState[]): ContinuationPacket;
|
|
57
|
+
/**
|
|
58
|
+
* §4.2 LOCK #C6-A-2 — compute the JCS-canonical-JSON SHA-256 hash of
|
|
59
|
+
* the typed packet struct. Library pin: `json-freeze@^1.x` (RFC 8785
|
|
60
|
+
* conformant). The TS-side hash MUST match the Rust `serde_jcs` hash
|
|
61
|
+
* byte-for-byte (P1 parity test).
|
|
62
|
+
*/
|
|
63
|
+
export declare function computePacketHash(packet: ContinuationPacket): string;
|
|
64
|
+
/**
|
|
65
|
+
* §4.2 LOCK #C6-A-2 — render the YAML frontmatter + prose-body
|
|
66
|
+
* markdown body. The YAML frontmatter is the human-readable
|
|
67
|
+
* serialization; the JCS-canonical-JSON is the cross-impl hash input.
|
|
68
|
+
* Both are derived from the same parsed struct.
|
|
69
|
+
*/
|
|
70
|
+
export declare function renderPacketMarkdown(packet: ContinuationPacket): string;
|
|
71
|
+
/**
|
|
72
|
+
* §4.3 LOCK #C6-A-3 — resolve the absolute path to a task's directory.
|
|
73
|
+
* Exported for use by the reader + status CLI.
|
|
74
|
+
*/
|
|
75
|
+
export declare function getTaskDirectoryPath(taskId: string, homeDir?: string): string;
|
|
76
|
+
/**
|
|
77
|
+
* §4.3 LOCK #C6-A-3 — resolve the absolute path to a task's
|
|
78
|
+
* CONTINUATION.md.
|
|
79
|
+
*/
|
|
80
|
+
export declare function getPacketFilePath(taskId: string, homeDir?: string): string;
|
|
81
|
+
/**
|
|
82
|
+
* Factory for the CP-6 packet writer. Per-task `Mutex` map is owned by
|
|
83
|
+
* the returned instance (one map per writer instance — production
|
|
84
|
+
* code wires a single writer per LE process).
|
|
85
|
+
*/
|
|
86
|
+
export declare function createContinuationPacketWriter(deps: ContinuationPacketWriterDeps): ContinuationPacketWriter;
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CP-6 LOCK #C6-A-1 AgentKind union — 4 values per AGY-2.0-SUPPORT-DESIGN.md.
|
|
3
|
+
* As of Phase C, ANTIGRAVITY is a fully-valid continuation SOURCE and TARGET
|
|
4
|
+
* end-to-end (TS `VALID_TARGET_AGENTS` + the Rust
|
|
5
|
+
* `recordContinuationPacketWritten` / `apply_user_decision` validators all
|
|
6
|
+
* accept it; the Codex M2 §4.10.4 rejection was inverted in Phase C).
|
|
7
|
+
*/
|
|
8
|
+
export type AgentKind = 'CLAUDE' | 'CODEX' | 'GEMINI' | 'ANTIGRAVITY';
|
|
9
|
+
/**
|
|
10
|
+
* CP-6 LOCK #C6-A-1 — 4-value `HandoffReason` union. Implementor-
|
|
11
|
+
* continuation triggers only (master §8:932-937 reserves
|
|
12
|
+
* `reviewer_unavailable` / `reviewer_conflict` / `unsafe_action` for
|
|
13
|
+
* CP-3.h / CP-2.h / CP-9 min escalation — NOT CP-6 continuation
|
|
14
|
+
* packet-write paths).
|
|
15
|
+
*
|
|
16
|
+
* The 4 §7 trigger rows map onto §6:827 wire spellings 1:1:
|
|
17
|
+
* - §7 "Quota exhausted" → `quota_exhausted`
|
|
18
|
+
* - §7 "Auth failed" → `auth_failed`
|
|
19
|
+
* - §7 "Agent timeout" → `timeout`
|
|
20
|
+
* - §7 "User request" → `user_requested`
|
|
21
|
+
*
|
|
22
|
+
* §6:827 also defines `explicit_escalation` + `reviewer_conflict`;
|
|
23
|
+
* the CP-6 reader accepts them but the writer never emits them.
|
|
24
|
+
*/
|
|
25
|
+
export type HandoffReason = 'quota_exhausted' | 'auth_failed' | 'timeout' | 'user_requested';
|
|
26
|
+
/**
|
|
27
|
+
* Gate-state snapshot embedded in every continuation packet. Captures
|
|
28
|
+
* the prior implementor's verification + reviewer-quorum + final-
|
|
29
|
+
* approval pose so the next implementor can read but not bypass.
|
|
30
|
+
*/
|
|
31
|
+
export interface GateState {
|
|
32
|
+
verification: 'not_started' | 'pass' | 'fail';
|
|
33
|
+
reviewerQuorum: 'not_started' | 'pass' | 'revise' | 'block';
|
|
34
|
+
finalApproval: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Per-repo state captured at packet-write time by LOCK #C6-A-7
|
|
38
|
+
* dirty-state collector. `headSha` / `branch` fall through to the
|
|
39
|
+
* literal `"unknown"` sentinel when git is unavailable or
|
|
40
|
+
* `git rev-parse` times out.
|
|
41
|
+
*/
|
|
42
|
+
export interface RepoState {
|
|
43
|
+
/** repo basename (e.g., `codevibe-backend`). */
|
|
44
|
+
repo: string;
|
|
45
|
+
/** absolute filesystem path (clamped to authority writeScopes/readScopes). */
|
|
46
|
+
path: string;
|
|
47
|
+
/** git branch — literal `"unknown"` when git rev-parse fails. */
|
|
48
|
+
branch: string;
|
|
49
|
+
/** 40-hex git sha — literal `"unknown"` when git rev-parse fails. */
|
|
50
|
+
headSha: string;
|
|
51
|
+
dirty: boolean;
|
|
52
|
+
/** git status --porcelain output, relative to repo root. */
|
|
53
|
+
changedFiles: string[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* CP-6 LOCK #C6-A-1 — 17-field continuation packet structural type.
|
|
57
|
+
* Mirrors master §6:820-852 byte-for-byte.
|
|
58
|
+
*
|
|
59
|
+
* Sentinel taxonomy per §8.1:
|
|
60
|
+
* - WRITER-CONSTANT (1): packetVersion (always 1)
|
|
61
|
+
* - STRICT-REQUIRED (8): taskId, sessionId, sourceAgent,
|
|
62
|
+
* targetAgent, handoffReason, role,
|
|
63
|
+
* taskSummary, expiresAt
|
|
64
|
+
* - CALLER-OR-COLLECTOR (1): repoStates (falls through to
|
|
65
|
+
* dirty-state collector when caller
|
|
66
|
+
* passes undefined)
|
|
67
|
+
* - AUTO-SENTINEL (7): completedWork, remainingWork,
|
|
68
|
+
* verification, activeRules, gateState,
|
|
69
|
+
* safetyConstraints, reviewHistoryRefs
|
|
70
|
+
*/
|
|
71
|
+
export interface ContinuationPacket {
|
|
72
|
+
packetVersion: 1;
|
|
73
|
+
taskId: string;
|
|
74
|
+
sessionId: string;
|
|
75
|
+
sourceAgent: AgentKind;
|
|
76
|
+
targetAgent: AgentKind;
|
|
77
|
+
handoffReason: HandoffReason;
|
|
78
|
+
/** CP-6 always emits `"implementor"`; reviewer-role packets deferred. */
|
|
79
|
+
role: 'implementor';
|
|
80
|
+
repoStates: RepoState[];
|
|
81
|
+
/** Master §6:839 — "what the implementor is trying to complete". */
|
|
82
|
+
taskSummary: string;
|
|
83
|
+
/** Master §6:840 — facts already done. */
|
|
84
|
+
completedWork: string[];
|
|
85
|
+
/** Master §6:841 — next actions. */
|
|
86
|
+
remainingWork: string[];
|
|
87
|
+
/** Master §6:842 — tests run AND tests intentionally not run. */
|
|
88
|
+
verification: string[];
|
|
89
|
+
/** Master §6:843 — gate plan + commit/push rules + safety constraints. */
|
|
90
|
+
activeRules: string[];
|
|
91
|
+
gateState: GateState;
|
|
92
|
+
/** Master §6:849. */
|
|
93
|
+
safetyConstraints: string[];
|
|
94
|
+
/** Master §6:850 — file paths or AppSync row IDs. */
|
|
95
|
+
reviewHistoryRefs: string[];
|
|
96
|
+
/** ISO-8601 RFC 3339 timestamp. */
|
|
97
|
+
expiresAt: string;
|
|
98
|
+
}
|
|
99
|
+
export declare class PacketFidelityError extends Error {
|
|
100
|
+
readonly missingFields: string[];
|
|
101
|
+
constructor(missingFields: string[], message?: string);
|
|
102
|
+
}
|
|
103
|
+
export declare class PacketIoError extends Error {
|
|
104
|
+
readonly cause?: NodeJS.ErrnoException;
|
|
105
|
+
constructor(message: string, cause?: NodeJS.ErrnoException);
|
|
106
|
+
}
|
|
107
|
+
export declare class PacketHashMismatch extends Error {
|
|
108
|
+
readonly expectedHash: string;
|
|
109
|
+
readonly actualHash: string;
|
|
110
|
+
constructor(expectedHash: string, actualHash: string);
|
|
111
|
+
}
|
|
112
|
+
export declare class PacketAuditEmitError extends Error {
|
|
113
|
+
readonly reason: string;
|
|
114
|
+
constructor(reason: string);
|
|
115
|
+
}
|
|
116
|
+
export declare class PacketNotFound extends Error {
|
|
117
|
+
readonly packetPath: string;
|
|
118
|
+
constructor(packetPath: string);
|
|
119
|
+
}
|
|
120
|
+
export declare class PacketUnverified extends Error {
|
|
121
|
+
readonly packetPath: string;
|
|
122
|
+
readonly taskId: string;
|
|
123
|
+
readonly packetHash: string;
|
|
124
|
+
constructor(packetPath: string, taskId: string, packetHash: string);
|
|
125
|
+
}
|
|
126
|
+
export declare class FrontmatterMalformed extends Error {
|
|
127
|
+
readonly cause?: Error;
|
|
128
|
+
constructor(message: string, cause?: Error);
|
|
129
|
+
}
|
|
130
|
+
export declare class SchemaInvalid extends Error {
|
|
131
|
+
readonly errors: string[];
|
|
132
|
+
constructor(errors: string[]);
|
|
133
|
+
}
|
|
134
|
+
export declare class PacketPermissionsLoose extends Error {
|
|
135
|
+
readonly path: string;
|
|
136
|
+
readonly actualMode: number;
|
|
137
|
+
constructor(filePath: string, actualMode: number);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Caller-supplied fields for `writer.write()`. All 8 STRICT-REQUIRED
|
|
141
|
+
* fields (per §8.1 sentinel taxonomy) are required at the type level;
|
|
142
|
+
* AUTO-SENTINEL fields are optional and default to the §8.1 sentinel
|
|
143
|
+
* when omitted. `repoStates` is optional — when undefined, the writer
|
|
144
|
+
* dispatches to the dirty-state collector.
|
|
145
|
+
*
|
|
146
|
+
* `offerId` is not part of the packet body itself (it lives on the
|
|
147
|
+
* backend audit row per LOCK #C6-A-10); the writer forwards it to
|
|
148
|
+
* `AppSyncClient.recordContinuationPacketWritten`. Use `null` for
|
|
149
|
+
* LE-initiated writes that have no prior Class B offer.
|
|
150
|
+
*/
|
|
151
|
+
export interface PacketWriteInput {
|
|
152
|
+
taskId: string;
|
|
153
|
+
sessionId: string;
|
|
154
|
+
sourceAgent: AgentKind;
|
|
155
|
+
targetAgent: AgentKind;
|
|
156
|
+
handoffReason: HandoffReason;
|
|
157
|
+
/**
|
|
158
|
+
* STRICT-REQUIRED per §8.1 sentinel taxonomy (Stage 2 R1 M-2 fix —
|
|
159
|
+
* was previously optional with a silent `?? 'implementor'` default,
|
|
160
|
+
* a contract deviation from the locked design). Callers MUST pass
|
|
161
|
+
* `'implementor'` explicitly; the writer throws `PacketFidelityError`
|
|
162
|
+
* with `missingFields: ['role', ...]` when undefined.
|
|
163
|
+
*/
|
|
164
|
+
role: 'implementor';
|
|
165
|
+
taskSummary: string;
|
|
166
|
+
expiresAt: string;
|
|
167
|
+
repoStates?: RepoState[];
|
|
168
|
+
completedWork?: string[];
|
|
169
|
+
remainingWork?: string[];
|
|
170
|
+
verification?: string[];
|
|
171
|
+
activeRules?: string[];
|
|
172
|
+
gateState?: GateState;
|
|
173
|
+
safetyConstraints?: string[];
|
|
174
|
+
reviewHistoryRefs?: string[];
|
|
175
|
+
offerId?: string | null;
|
|
176
|
+
blockedReason?: HandoffReason;
|
|
177
|
+
/**
|
|
178
|
+
* PHASE-CP-10-MIN (#585) — the round's gate the desktop is handing off from
|
|
179
|
+
* (H-A). Forwarded to `recordContinuationPacketWritten` (the additive
|
|
180
|
+
* `gateId: ID` input) so the handler `fetch_row`s it, cross-checks
|
|
181
|
+
* `gate_row.task_id == input.task_id`, and uses it as the #C10M-14
|
|
182
|
+
* mutual-exclusion stamp target + the emitted prompt's `EmitContext.gate_id`.
|
|
183
|
+
* NOT embedded in the packet body. Required at the handler for #585's two
|
|
184
|
+
* triggers; optional at the type level so legacy/LE-initiated writes that
|
|
185
|
+
* predate CP-10 still type-check.
|
|
186
|
+
*/
|
|
187
|
+
gateId?: string;
|
|
188
|
+
}
|
|
189
|
+
export interface PacketWriteResult {
|
|
190
|
+
/** 64-char lowercase hex SHA-256 of JCS-canonical-JSON(packet). */
|
|
191
|
+
packetHash: string;
|
|
192
|
+
/** Absolute path of the written CONTINUATION.md. */
|
|
193
|
+
path: string;
|
|
194
|
+
}
|
|
195
|
+
export interface PacketListEntry {
|
|
196
|
+
taskId: string;
|
|
197
|
+
packetExists: boolean;
|
|
198
|
+
lastModified: Date | null;
|
|
199
|
+
packetHash?: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Discriminated union returned by `reader.read()` when used in
|
|
203
|
+
* fail-soft mode. Throwing variants live on the reader directly; the
|
|
204
|
+
* union is exported for callers that prefer typed-return semantics.
|
|
205
|
+
*/
|
|
206
|
+
export type ContinuationPacketReadResult = {
|
|
207
|
+
kind: 'ok';
|
|
208
|
+
packet: ContinuationPacket;
|
|
209
|
+
packetHash: string;
|
|
210
|
+
} | {
|
|
211
|
+
kind: 'not_found';
|
|
212
|
+
path: string;
|
|
213
|
+
} | {
|
|
214
|
+
kind: 'unverified';
|
|
215
|
+
path: string;
|
|
216
|
+
taskId: string;
|
|
217
|
+
packetHash: string;
|
|
218
|
+
} | {
|
|
219
|
+
kind: 'permissions_loose';
|
|
220
|
+
path: string;
|
|
221
|
+
actualMode: number;
|
|
222
|
+
} | {
|
|
223
|
+
kind: 'frontmatter_malformed';
|
|
224
|
+
path: string;
|
|
225
|
+
message: string;
|
|
226
|
+
} | {
|
|
227
|
+
kind: 'schema_invalid';
|
|
228
|
+
path: string;
|
|
229
|
+
errors: string[];
|
|
230
|
+
} | {
|
|
231
|
+
kind: 'hash_mismatch';
|
|
232
|
+
path: string;
|
|
233
|
+
expectedHash: string;
|
|
234
|
+
actualHash: string;
|
|
235
|
+
} | {
|
|
236
|
+
kind: 'io_error';
|
|
237
|
+
path: string;
|
|
238
|
+
message: string;
|
|
239
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The five CP-7 audit kinds (§3.5), in their snake_case wire form — the
|
|
3
|
+
* exact strings the `AuditEventKind` enum serializes as and the
|
|
4
|
+
* `audit-keys` discriminator constants use. Defined here (not imported
|
|
5
|
+
* from a Rust-mirrored module) because W1 only needs the broker-side
|
|
6
|
+
* wire kinds; W3 wires these to the real `AuditEventKind` enum + NAPI
|
|
7
|
+
* `parse_audit_kind`.
|
|
8
|
+
*
|
|
9
|
+
* Note: only `model_call`, `model_call_result`, `model_context_scrubbed`,
|
|
10
|
+
* and `broker_credential_loaded` are broker-emitted. `egress_denied` is
|
|
11
|
+
* emitted by the substrate's egress proxy (§3.5, W2/W3) — it is included
|
|
12
|
+
* in the union for completeness of the CP-7 audit taxonomy but the broker
|
|
13
|
+
* never emits it.
|
|
14
|
+
*/
|
|
15
|
+
export type AuditKindCp7 = "model_call" | "model_call_result" | "egress_denied" | "model_context_scrubbed" | "broker_credential_loaded";
|
|
16
|
+
/**
|
|
17
|
+
* The strict audit sink the broker emits through (§3.5).
|
|
18
|
+
*
|
|
19
|
+
* Per §3.5: the sender transmits `{kind, payload}` and BLOCKS for the
|
|
20
|
+
* LE's durable ACK. A resolved `{ ack }` means the row is durably on
|
|
21
|
+
* disk (the gated effect — the upstream forward — may proceed for a
|
|
22
|
+
* pre-forward row). A resolved `{ nack }` means the durable write failed
|
|
23
|
+
* (the broker fails closed: 503, no forward). A rejected/timed-out promise
|
|
24
|
+
* is treated by the broker exactly like a NACK (fail closed on a
|
|
25
|
+
* pre-forward row).
|
|
26
|
+
*/
|
|
27
|
+
export interface StrictAuditSink {
|
|
28
|
+
emit(kind: AuditKindCp7, payload: Record<string, unknown>): Promise<{
|
|
29
|
+
ack: string;
|
|
30
|
+
} | {
|
|
31
|
+
nack: string;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A recorded emit, surfaced by {@link StubStrictAuditSink} for test
|
|
36
|
+
* assertions (the real LE emitter exposes nothing comparable — this is a
|
|
37
|
+
* test seam only).
|
|
38
|
+
*/
|
|
39
|
+
export interface RecordedAuditEmit {
|
|
40
|
+
kind: AuditKindCp7;
|
|
41
|
+
payload: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* In-memory deterministic `StrictAuditSink` for unit tests + the injected
|
|
45
|
+
* default until W3. Every `emit` ACKs with a deterministic
|
|
46
|
+
* `stub-ack-<n>` id and records the `{kind, payload}` for assertions.
|
|
47
|
+
*
|
|
48
|
+
* Two test hooks (both default off so the happy path is deterministic):
|
|
49
|
+
* - `nackKinds`: any kind in this set NACKs instead of ACKing — exercises
|
|
50
|
+
* the audit-before-effect 503 path.
|
|
51
|
+
* - `failKinds`: any kind in this set REJECTS the promise — exercises the
|
|
52
|
+
* "IPC error / timeout treated as fail-closed" path.
|
|
53
|
+
*/
|
|
54
|
+
export declare class StubStrictAuditSink implements StrictAuditSink {
|
|
55
|
+
private readonly opts;
|
|
56
|
+
readonly emitted: RecordedAuditEmit[];
|
|
57
|
+
private counter;
|
|
58
|
+
constructor(opts?: {
|
|
59
|
+
nackKinds?: ReadonlyArray<AuditKindCp7>;
|
|
60
|
+
failKinds?: ReadonlyArray<AuditKindCp7>;
|
|
61
|
+
});
|
|
62
|
+
emit(kind: AuditKindCp7, payload: Record<string, unknown>): Promise<{
|
|
63
|
+
ack: string;
|
|
64
|
+
} | {
|
|
65
|
+
nack: string;
|
|
66
|
+
}>;
|
|
67
|
+
/** All emitted rows of a given kind (test helper). */
|
|
68
|
+
ofKind(kind: AuditKindCp7): RecordedAuditEmit[];
|
|
69
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { VendorProvider } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Per-provider wire facts the broker synthesizes on the upstream call.
|
|
4
|
+
*/
|
|
5
|
+
export interface ProviderConfig {
|
|
6
|
+
/** Upstream origin (scheme + host) the broker forwards to. */
|
|
7
|
+
readonly upstreamBaseUrl: string;
|
|
8
|
+
/** The canonical upstream path for this provider's model route. */
|
|
9
|
+
readonly upstreamPath: "/v1/messages" | "/v1/responses";
|
|
10
|
+
/**
|
|
11
|
+
* Headers the broker synthesizes on EVERY upstream call — overriding
|
|
12
|
+
* whatever the agent supplied. `content-type` is always normalized to
|
|
13
|
+
* `application/json` (the only carried-through content type, §3.4).
|
|
14
|
+
*/
|
|
15
|
+
readonly synthesizedHeaders: Readonly<Record<string, string>>;
|
|
16
|
+
/**
|
|
17
|
+
* The EXACT allowlist of `anthropic-beta` (or provider equivalent)
|
|
18
|
+
* tokens the broker will pass through. A request carrying a beta token
|
|
19
|
+
* outside this set is rejected (400) — header VALUES are agent-
|
|
20
|
+
* controlled and can carry data (Codex R2). Empty for OpenAI (no beta
|
|
21
|
+
* header is forwarded).
|
|
22
|
+
*/
|
|
23
|
+
readonly betaTokenAllowlist: ReadonlySet<string>;
|
|
24
|
+
/**
|
|
25
|
+
* The name of the agent-supplied beta header this provider honors
|
|
26
|
+
* (lowercased), or `null` if the provider has none. Used by the
|
|
27
|
+
* canonical constructor to find the agent's beta tokens to validate.
|
|
28
|
+
*/
|
|
29
|
+
readonly betaHeaderName: string | null;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Resolve the locked wire facts for a provider. Pure data — no I/O.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getProviderConfig(provider: VendorProvider): ProviderConfig;
|
|
35
|
+
/**
|
|
36
|
+
* Map an inbound broker route path to the vendor provider it gateways.
|
|
37
|
+
* `/v1/messages` → Anthropic, `/v1/responses` → OpenAI.
|
|
38
|
+
*/
|
|
39
|
+
export declare function providerForPath(path: string): VendorProvider | null;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { BrokerToken } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Mints + holds the current per-session broker token, and authenticates
|
|
4
|
+
* inbound agent→broker tokens against it. A new token replaces the prior
|
|
5
|
+
* one (single active token per session); `authenticate` accepts ONLY the
|
|
6
|
+
* current, unexpired value — every other value (including a just-rotated
|
|
7
|
+
* old token) is rejected, which the broker maps to the only 401 it emits.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* A grace-rotation handle (Finding 3). `rotateWithGrace` returns this; the LE
|
|
11
|
+
* passes it back to {@link BrokerTokenMinter.commitRotation} /
|
|
12
|
+
* {@link BrokerTokenMinter.rollbackRotation}. The `generation` GENERATION-BINDS
|
|
13
|
+
* the commit/rollback to the SPECIFIC rotation that produced it: a stale handle
|
|
14
|
+
* (from a rotation already superseded by a newer one) is rejected, so a slow
|
|
15
|
+
* commit/rollback cannot clobber a newer in-flight rotation's token.
|
|
16
|
+
*/
|
|
17
|
+
export interface RotationHandle {
|
|
18
|
+
readonly token: BrokerToken;
|
|
19
|
+
readonly generation: number;
|
|
20
|
+
}
|
|
21
|
+
export declare class BrokerTokenMinter {
|
|
22
|
+
private readonly ttlMs;
|
|
23
|
+
private current;
|
|
24
|
+
/**
|
|
25
|
+
* During a rotation the PRIOR token stays acceptable until the LE confirms
|
|
26
|
+
* the apiKeyHelper file holds the NEW token (`commitRotation`). This closes
|
|
27
|
+
* the 401-loop window the contract forbids (Stage-2 M-3): if we invalidated
|
|
28
|
+
* the prior token BEFORE the file refresh landed, the agent's file would hold
|
|
29
|
+
* a now-rejected token until the next refresh. With the grace token, BOTH the
|
|
30
|
+
* new and the prior token authenticate until the write is confirmed.
|
|
31
|
+
*/
|
|
32
|
+
private graceToken;
|
|
33
|
+
/**
|
|
34
|
+
* Finding 3 — generation counter, bumped on every successful grace rotation.
|
|
35
|
+
* Commit/rollback are bound to the generation of the rotation they belong to;
|
|
36
|
+
* a stale (superseded) commit/rollback is a no-op. The generation also gates
|
|
37
|
+
* OVERLAPPING rotations: `rotateWithGrace` REJECTS (returns null) while a grace
|
|
38
|
+
* is still pending, so two near-concurrent rotations can never chain
|
|
39
|
+
* grace→grace and strand the file token.
|
|
40
|
+
*/
|
|
41
|
+
private generation;
|
|
42
|
+
constructor(ttlMs?: number);
|
|
43
|
+
/** Mint (or rotate) the session's broker token; returns the new token. */
|
|
44
|
+
mint(now?: number): BrokerToken;
|
|
45
|
+
/**
|
|
46
|
+
* M-3 — SAFE rotation. Mint a NEW current token but KEEP the prior token
|
|
47
|
+
* valid (as a grace token) so there is no window where the agent's file (which
|
|
48
|
+
* still holds the prior token until the LE rewrites it) is rejected. The LE
|
|
49
|
+
* MUST call {@link commitRotation} AFTER it confirms the helper file now holds
|
|
50
|
+
* the new token (drops the grace token), or {@link rollbackRotation} if the
|
|
51
|
+
* file write FAILED (restores the prior token as current and discards the new
|
|
52
|
+
* one — the agent's file is still valid, fail-closed, no dead token).
|
|
53
|
+
*
|
|
54
|
+
* Finding 3 — OVERLAP REJECTION: returns null when a grace rotation is already
|
|
55
|
+
* pending (not yet committed/rolled back). Chaining grace→grace would make the
|
|
56
|
+
* SECOND rotation's grace token be the FIRST rotation's new token (not the
|
|
57
|
+
* file-resident prior token); if the first refresh then writes its token and
|
|
58
|
+
* commits, the file token could be left unauthenticated. By refusing to start a
|
|
59
|
+
* second rotation until the first settles, BOTH tokens that ever authenticate
|
|
60
|
+
* are {file-resident prior, new} — the file token is never stranded.
|
|
61
|
+
*
|
|
62
|
+
* Returns the {@link RotationHandle} for the new token, or null if the broker
|
|
63
|
+
* has no current token yet (nothing to rotate) OR a rotation is in-flight.
|
|
64
|
+
*/
|
|
65
|
+
rotateWithGrace(now?: number): RotationHandle | null;
|
|
66
|
+
/**
|
|
67
|
+
* Confirm the helper file now holds the new token — drop the grace token so
|
|
68
|
+
* the prior token stops authenticating (single-active-token restored).
|
|
69
|
+
*
|
|
70
|
+
* Finding 3 — generation-bound: a commit whose `generation` does not match the
|
|
71
|
+
* current generation is STALE (a newer rotation/mint superseded it) and is a
|
|
72
|
+
* NO-OP, so it cannot drop a newer rotation's grace token.
|
|
73
|
+
*/
|
|
74
|
+
commitRotation(handle?: RotationHandle): void;
|
|
75
|
+
/**
|
|
76
|
+
* The file refresh FAILED — roll back: restore the prior (grace) token as
|
|
77
|
+
* current and discard the just-minted new token. The agent's file still holds
|
|
78
|
+
* the prior token, which is once again the sole active token → no dead-token
|
|
79
|
+
* window. No-op if there is no pending grace rotation.
|
|
80
|
+
*
|
|
81
|
+
* Finding 3 — generation-bound: a rollback whose `generation` does not match
|
|
82
|
+
* the current generation is STALE and a NO-OP, so a late rollback from a
|
|
83
|
+
* superseded rotation cannot revert a newer rotation's token.
|
|
84
|
+
*/
|
|
85
|
+
rollbackRotation(handle?: RotationHandle): void;
|
|
86
|
+
/** Whether a rotation is mid-flight (grace token still accepted). Test seam. */
|
|
87
|
+
hasPendingGrace(): boolean;
|
|
88
|
+
/** The current token, or null if none minted yet. */
|
|
89
|
+
get(): BrokerToken | null;
|
|
90
|
+
/**
|
|
91
|
+
* EVERY broker-token value that `authenticate()` would currently accept — the
|
|
92
|
+
* CURRENT token plus, during a mid-flight grace rotation, the PRIOR (grace)
|
|
93
|
+
* token. Used by the broker's self-credential guard so it scrubs ALL tokens a
|
|
94
|
+
* model-bound field could be carrying, not just `get()` (Stage-2 MEDIUM): the
|
|
95
|
+
* prior token still authenticates during the grace window AND is still resident
|
|
96
|
+
* in the agent's helper file, so a model-bound field echoing it is a live-token
|
|
97
|
+
* leak the guard must redact. Values are returned only (the actual scrub +
|
|
98
|
+
* commit/rollback gate is the caller's); a stale/expired grace token is NOT
|
|
99
|
+
* included (it can no longer authenticate, so it is not a live secret).
|
|
100
|
+
*
|
|
101
|
+
* NOTE: this does NOT filter on `expiresAtMs` — `authenticate()` rejects an
|
|
102
|
+
* expired token, but an expired-yet-still-resident token in the helper file is
|
|
103
|
+
* still a secret-shaped value the guard should keep out of model-bound content;
|
|
104
|
+
* we err toward scrubbing both held values whenever they are non-null. (An
|
|
105
|
+
* expired token cannot be USED, but redacting it is strictly safer and never
|
|
106
|
+
* wrong — the guard only ever removes a value, never adds one.)
|
|
107
|
+
*/
|
|
108
|
+
acceptedValues(): string[];
|
|
109
|
+
/**
|
|
110
|
+
* Authenticate an inbound agent→broker token. True for the current, unexpired
|
|
111
|
+
* token value OR (during a mid-flight rotation) the unexpired grace token —
|
|
112
|
+
* the latter keeps the agent's pre-refresh file valid until the LE confirms
|
|
113
|
+
* the file rewrite (M-3 no-rejection-window contract). A missing / stale /
|
|
114
|
+
* expired / mismatched token → false (the broker returns 401 — the ONLY 401
|
|
115
|
+
* it emits, §3.2).
|
|
116
|
+
*
|
|
117
|
+
* Constant-time-ish compare is unnecessary for a loopback-only local
|
|
118
|
+
* token, but we still avoid leaking via early-return on length.
|
|
119
|
+
*/
|
|
120
|
+
authenticate(token: string | undefined, now?: number): boolean;
|
|
121
|
+
/** Zeroize the held token (broker teardown). */
|
|
122
|
+
clear(): void;
|
|
123
|
+
}
|