@quantiya/codevibe-core 2.0.1 → 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__/prompt-parser.test.d.ts +1 -0
- package/dist/adapter/registry.d.ts +69 -2
- package/dist/appsync/__tests__/appsync-client-event-source-filter.test.d.ts +1 -0
- package/dist/appsync/__tests__/appsync-client-task-group.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 +621 -10
- package/dist/appsync/event-throttle.d.ts +28 -0
- package/dist/appsync/index.d.ts +3 -0
- package/dist/appsync/queries.d.ts +19 -0
- package/dist/audit-keys/index.d.ts +32 -0
- package/dist/auth/auth-service.d.ts +32 -2
- package/dist/auth/auth-telemetry.d.ts +19 -1
- package/dist/auth/index.d.ts +1 -0
- package/dist/companion-mode/persist-preference.d.ts +1 -1
- 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 +6 -1
- package/dist/index.js +427 -124
- package/dist/keychain/__tests__/keychain-backend.test.d.ts +1 -0
- package/dist/keychain/keychain-backend.d.ts +82 -0
- 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__/class-a-sign.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__/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__/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__/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__/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 +33 -1
- package/dist/local-executor/class-a-emit.d.ts +3 -1
- package/dist/local-executor/class-a-sign.d.ts +57 -0
- package/dist/local-executor/class-b-consumer.d.ts +159 -4
- 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 +1 -1
- package/dist/local-executor/implementor-argv.d.ts +183 -0
- package/dist/local-executor/index.d.ts +44 -3
- package/dist/local-executor/local-executor-impl.d.ts +645 -4
- 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 +29 -1
- 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 +238 -4
- 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/detect-agents.d.ts +15 -2
- package/dist/orchestration/setup-types.d.ts +2 -1
- 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-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-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-verdict-classifier-wiring.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__/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-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__/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__/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__/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__/serialize-submissions.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__/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 +336 -1
- package/dist/orchestration-shell/cli.js +39318 -3436
- package/dist/orchestration-shell/components/AuditLogPanel.d.ts +11 -0
- package/dist/orchestration-shell/components/ConversationPane.d.ts +7 -1
- 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 +7 -0
- package/dist/orchestration-shell/components/InputBar.d.ts +17 -3
- 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 +81 -15
- package/dist/orchestration-shell/components/ReviewerSetupWizard.d.ts +24 -0
- package/dist/orchestration-shell/components/StatusBar.d.ts +15 -2
- 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 +1 -1
- package/dist/orchestration-shell/gate-decision-submit.d.ts +245 -0
- package/dist/orchestration-shell/gate-prompts.d.ts +361 -3
- package/dist/orchestration-shell/index.d.ts +613 -1
- package/dist/orchestration-shell/ink-runtime.d.ts +21 -1
- 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/non-tty-fallback.d.ts +21 -0
- package/dist/orchestration-shell/quorum-loop.d.ts +1900 -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 +20 -1
- 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/task-progress.d.ts +122 -0
- package/dist/orchestration-shell/team-decompose.d.ts +196 -0
- package/dist/orchestration-shell/types.d.ts +363 -3
- 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__/local-gemma.test.d.ts +1 -0
- package/dist/planner/index.d.ts +2 -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 +16 -6
- 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/index.d.ts +1 -0
- package/dist/session/prepare-event-timestamp.d.ts +30 -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 +3 -1
- package/dist/types/reviewer.d.ts +6 -6
- package/package.json +7 -3
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Exposed for the single log line in createEvent. */
|
|
2
|
+
export declare const CLIENT_THROTTLE_EVENTS_PER_WINDOW: number;
|
|
3
|
+
interface RateWindow {
|
|
4
|
+
windowStartMs: number;
|
|
5
|
+
count: number;
|
|
6
|
+
toolUseAboveThreshold: number;
|
|
7
|
+
suppressed: number;
|
|
8
|
+
logged: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Decide whether this outbound event should be suppressed (not sent).
|
|
12
|
+
* Deterministic given (sessionId, type, now) and prior counter state.
|
|
13
|
+
* Exported for unit tests; resetThrottleState() clears the module map.
|
|
14
|
+
*/
|
|
15
|
+
export declare function shouldSuppressEvent(sessionId: string, type: string, now: number): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the session's rate window exactly once per window — the first time the
|
|
18
|
+
* throttle engages — for a single log line; later calls in the same window
|
|
19
|
+
* return undefined. Keeps logging out of the hot path.
|
|
20
|
+
*/
|
|
21
|
+
export declare function consumeThrottleLogOnce(sessionId: string): RateWindow | undefined;
|
|
22
|
+
/** Test-only: clears the per-process rate map. */
|
|
23
|
+
export declare function resetThrottleState(): void;
|
|
24
|
+
/** Test-only: current size of the per-process rate map (eviction-bound check). */
|
|
25
|
+
export declare function throttleMapSize(): number;
|
|
26
|
+
/** Test-only: whether a session is currently tracked (eviction assertions). */
|
|
27
|
+
export declare function throttleMapHas(sessionId: string): boolean;
|
|
28
|
+
export {};
|
package/dist/appsync/index.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export { AppSyncClient, AppSyncGraphQLError, DownloadUrlResponse } from './appsync-client';
|
|
2
|
+
export { coerceAwsJsonObject } from './appsync-client';
|
|
3
|
+
export type { ClassBPacketEnvelopeMeta } from './appsync-client';
|
|
4
|
+
export type { TaskReviewSummary, TaskReviewSummaryRound, TaskReviewSummaryReviewer, TaskGroupStatusResult, } from './appsync-client';
|
|
2
5
|
export { queries, mutations, subscriptions } from './queries';
|
|
@@ -12,6 +12,15 @@ export declare const queries: {
|
|
|
12
12
|
*/
|
|
13
13
|
listSessions: string;
|
|
14
14
|
getSubscriptionStatus: string;
|
|
15
|
+
queryAudit: string;
|
|
16
|
+
verifyContinuationPacketWritten: string;
|
|
17
|
+
getReviewerPrompt: string;
|
|
18
|
+
getClassBSigningPublicKey: string;
|
|
19
|
+
getInReviewAssignments: string;
|
|
20
|
+
getTaskGroupTracks: string;
|
|
21
|
+
getInFlightTeamTracks: string;
|
|
22
|
+
getTaskGroupStatus: string;
|
|
23
|
+
getTaskReviewSummary: string;
|
|
15
24
|
};
|
|
16
25
|
export declare const mutations: {
|
|
17
26
|
createSession: string;
|
|
@@ -27,9 +36,19 @@ export declare const mutations: {
|
|
|
27
36
|
classifyPlannerPrompt: string;
|
|
28
37
|
pingPlanner: string;
|
|
29
38
|
applyUserDecision: string;
|
|
39
|
+
recordContinuationPacketWritten: string;
|
|
40
|
+
createTaskGroup: string;
|
|
41
|
+
submitMergeGateVerdict: string;
|
|
42
|
+
submitTrackVerificationOutcome: string;
|
|
43
|
+
claimGroupDecision: string;
|
|
44
|
+
startTask: string;
|
|
45
|
+
submitImplementorOutput: string;
|
|
46
|
+
submitReviewerVerdict: string;
|
|
30
47
|
};
|
|
31
48
|
export declare const subscriptions: {
|
|
32
49
|
onEventCreated: string;
|
|
33
50
|
onDeviceKeyRegistered: string;
|
|
34
51
|
onSessionUpdated: string;
|
|
52
|
+
onClassBPacket: string;
|
|
53
|
+
onApplyUserDecision: string;
|
|
35
54
|
};
|
|
@@ -39,3 +39,35 @@ export declare function dedupKeyForDestructiveActionEscalated(gateId: Uuid, acti
|
|
|
39
39
|
* passed alongside).
|
|
40
40
|
*/
|
|
41
41
|
export declare function dedupKeyForFlagBadApproval(flaggedEntryId: Uuid): string;
|
|
42
|
+
/**
|
|
43
|
+
* `ModelCall` (CP-7 §3.5) — pre-forward strict audit row.
|
|
44
|
+
* Identity: `(task_id, "model_call", model_call_id)`.
|
|
45
|
+
*/
|
|
46
|
+
export declare function dedupKeyForModelCall(taskId: Uuid, modelCallId: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* `ModelCallResult` (CP-7 §3.5) — post-response enrichment row.
|
|
49
|
+
* Identity: `(task_id, "model_call_result", model_call_id)`. Shares the
|
|
50
|
+
* `model_call_id` FK with its pre-forward {@link dedupKeyForModelCall}
|
|
51
|
+
* row; framing keeps the two rows on DISTINCT keys despite the prefix
|
|
52
|
+
* overlap.
|
|
53
|
+
*/
|
|
54
|
+
export declare function dedupKeyForModelCallResult(taskId: Uuid, modelCallId: string): string;
|
|
55
|
+
/**
|
|
56
|
+
* `EgressDenied` (CP-7 §3.5) — egress-proxy deny row.
|
|
57
|
+
* Identity: `(task_id, "egress_denied", caller_event_id)`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function dedupKeyForEgressDenied(taskId: Uuid, callerEventId: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* `ModelContextScrubbed` (CP-7 §3.5) — I2 scrub row.
|
|
62
|
+
* Identity: `(task_id, "model_context_scrubbed", model_call_id, field,
|
|
63
|
+
* pattern_class)`. `field` is a canonical JSONPath; `patternClass` lets
|
|
64
|
+
* one field tripping two heuristics record both. This multi-string
|
|
65
|
+
* identity is exactly what the legacy unframed concatenation could not
|
|
66
|
+
* encode injectively.
|
|
67
|
+
*/
|
|
68
|
+
export declare function dedupKeyForModelContextScrubbed(taskId: Uuid, modelCallId: string, field: string, patternClass: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* `BrokerCredentialLoaded` (CP-7 §3.5) — keychain vendor-key load row.
|
|
71
|
+
* Identity: `(task_id, "broker_credential_loaded", credential_issuance_id)`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function dedupKeyForBrokerCredentialLoaded(taskId: Uuid, credentialIssuanceId: string): string;
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
+
import * as http from 'http';
|
|
1
2
|
import { TokenData } from '../types';
|
|
3
|
+
export declare const PRIMARY_PORT = 8080;
|
|
4
|
+
export declare const PORT_RANGE_SIZE = 20;
|
|
5
|
+
/**
|
|
6
|
+
* Bind an HTTP server to the first available port in
|
|
7
|
+
* PRIMARY_PORT..PRIMARY_PORT+PORT_RANGE_SIZE-1.
|
|
8
|
+
*
|
|
9
|
+
* Retries at the `.listen()` level (no separate probe) to avoid TOCTOU races.
|
|
10
|
+
* Installs a persistent post-bind error listener to prevent process crash on
|
|
11
|
+
* later server errors (e.g., EMFILE during connection accept).
|
|
12
|
+
*
|
|
13
|
+
* @param handler - the request handler
|
|
14
|
+
* @returns { server, port } once the server is successfully listening
|
|
15
|
+
* @throws Error with code='EADDRINUSE_ALL' if ALL ports in range are in use
|
|
16
|
+
* @throws Original error if a non-EADDRINUSE error fires (EACCES, etc.)
|
|
17
|
+
*
|
|
18
|
+
* Callers MUST wrap this in try/catch to fire the appropriate auth-failure
|
|
19
|
+
* beacon BEFORE rejecting — otherwise the outer auth-cli fallback downgrades
|
|
20
|
+
* the failure to `unknown` and we lose port_range_exhausted telemetry.
|
|
21
|
+
*/
|
|
22
|
+
export declare function bindOAuthServer(handler: http.RequestListener): Promise<{
|
|
23
|
+
server: http.Server;
|
|
24
|
+
port: number;
|
|
25
|
+
}>;
|
|
2
26
|
/**
|
|
3
27
|
* Authentication service for OAuth flows
|
|
4
28
|
*/
|
|
@@ -51,11 +75,17 @@ export declare class AuthService {
|
|
|
51
75
|
*/
|
|
52
76
|
private generateState;
|
|
53
77
|
/**
|
|
54
|
-
* Build authorization URL
|
|
78
|
+
* Build authorization URL with dynamic redirect_uri (port-range fix).
|
|
55
79
|
*/
|
|
56
80
|
private buildAuthUrl;
|
|
57
81
|
/**
|
|
58
|
-
* Exchange authorization code for tokens
|
|
82
|
+
* Exchange authorization code for tokens.
|
|
83
|
+
*
|
|
84
|
+
* `redirectUri` MUST match the one passed to buildAuthUrl earlier — Cognito
|
|
85
|
+
* compares them at the token endpoint and rejects mismatches. This is the
|
|
86
|
+
* load-bearing change for the port-range fix to work end-to-end: if the
|
|
87
|
+
* authorize URL used port 8081 and the token POST uses 8080, Cognito
|
|
88
|
+
* returns redirect_uri_mismatch.
|
|
59
89
|
*/
|
|
60
90
|
private exchangeCodeForTokens;
|
|
61
91
|
/**
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* Keep values snake_case to match GA4 custom-dimension conventions
|
|
15
15
|
* used elsewhere in the codebase (`step`, `source`, `reason`).
|
|
16
16
|
*/
|
|
17
|
-
export type AuthFailureReason = 'port_in_use' | 'server_listen_failed' | 'browser_open_failed' | 'login_timeout' | 'cognito_rejected' | 'state_mismatch' | 'no_authorization_code' | 'token_exchange_failed' | 'token_exchange_network_error' | 'keychain_write_failed' | 'user_aborted' | 'unknown';
|
|
17
|
+
export type AuthFailureReason = 'port_in_use' | 'port_range_exhausted' | 'server_listen_failed' | 'browser_open_failed' | 'login_timeout' | 'cognito_rejected' | 'state_mismatch' | 'no_authorization_code' | 'token_exchange_failed' | 'token_exchange_network_error' | 'keychain_write_failed' | 'user_aborted' | 'unknown';
|
|
18
18
|
/**
|
|
19
19
|
* Auth flow stage the failure occurred in. Useful for GA4 faceting;
|
|
20
20
|
* each reason has an implicit stage but keeping it as a distinct
|
|
@@ -82,6 +82,24 @@ export declare function fireAuthFailedBeacon(reason: AuthFailureReason, extra?:
|
|
|
82
82
|
stage?: AuthStage;
|
|
83
83
|
errorFragment?: string;
|
|
84
84
|
}): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Coarse reason a machine fell back to file-based credential storage.
|
|
87
|
+
* - `no_keyring_service`: keytar's native addon LOADED but there's no OS
|
|
88
|
+
* keyring service to talk to (structurally-headless Linux — no D-Bus session).
|
|
89
|
+
* - `keytar_load_failed`: keytar's native addon failed to load AND the machine
|
|
90
|
+
* is structurally headless (libsecret absent on a no-keyring box).
|
|
91
|
+
*/
|
|
92
|
+
export type KeychainFallbackReason = 'no_keyring_service' | 'keytar_load_failed';
|
|
93
|
+
/**
|
|
94
|
+
* Fire the `keychain_file_fallback` beacon when keychain-backend auto-selects
|
|
95
|
+
* the file backend on a structurally-headless machine. Deliberately a DISTINCT
|
|
96
|
+
* event from `auth_failed` — this is a successful, working fallback, not a
|
|
97
|
+
* failure. Lets analytics see the headless cohort and confirm the headless fix
|
|
98
|
+
* is reaching the field (the old `keychain_write_failed` signal goes quiet for
|
|
99
|
+
* these users, so we need a positive beacon, not just an absence). No PII: only
|
|
100
|
+
* platform / source / the coarse reason literal.
|
|
101
|
+
*/
|
|
102
|
+
export declare function fireKeychainFileFallbackBeacon(reason: KeychainFallbackReason): Promise<void>;
|
|
85
103
|
/**
|
|
86
104
|
* Attach the reason + beaconed marker to an Error. Non-enumerable so
|
|
87
105
|
* the symbols don't serialize if the error object is ever JSON'd.
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { AuthService, authService } from './auth-service';
|
|
2
|
+
export { bindOAuthServer, PRIMARY_PORT, PORT_RANGE_SIZE } from './auth-service';
|
|
2
3
|
export { runAuthCli } from './auth-cli';
|
|
3
4
|
export { fireAuthCompletedBeacon, fireAuthFailedBeacon, markErrorBeaconed, errorWasBeaconed, getErrorReason, type AuthFailureReason, type AuthStage, } from './auth-telemetry';
|
package/dist/config/config.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Environment type
|
|
3
|
+
*
|
|
4
|
+
* 'experiment' is a separate AWS environment for CodeVibe 2.0 testing —
|
|
5
|
+
* isolated DDB/Cognito/AppSync/Lambda stacks in us-east-1, manual-deploy
|
|
6
|
+
* only (NOT in the codevibe-backend pipeline). Plugins/mobile clients
|
|
7
|
+
* opt in by setting `ENVIRONMENT=experiment`. See
|
|
8
|
+
* `codevibe-backend/docs/2.0/PHASE-INFRA-EXPERIMENT-ENV-DESIGN.md`
|
|
9
|
+
* LOCK #IE-5.
|
|
3
10
|
*/
|
|
4
|
-
export type Environment = 'development' | 'production';
|
|
11
|
+
export type Environment = 'development' | 'production' | 'experiment';
|
|
5
12
|
/**
|
|
6
13
|
* Configuration interface
|
|
7
14
|
*/
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { AuthorityScope } from '../local-executor/authority';
|
|
2
|
+
import type { RepoState } from './types';
|
|
3
|
+
export interface KnownRepo {
|
|
4
|
+
/** repo basename (e.g., `codevibe-backend`). */
|
|
5
|
+
repo: string;
|
|
6
|
+
/** absolute filesystem path of repo root. */
|
|
7
|
+
path: string;
|
|
8
|
+
}
|
|
9
|
+
export interface GitExecOptions {
|
|
10
|
+
/** `cwd` for the git invocation. */
|
|
11
|
+
cwd: string;
|
|
12
|
+
/** Wall-clock timeout in milliseconds. */
|
|
13
|
+
timeoutMs?: number;
|
|
14
|
+
}
|
|
15
|
+
export type GitExecFn = (args: string[], options: GitExecOptions) => Promise<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Default `git` executor. Honors `cwd` + timeout, scrubs the env.
|
|
18
|
+
* Returns stdout as utf8. Throws on non-zero exit / timeout / spawn
|
|
19
|
+
* failure — caller catches and emits the `"unknown"` sentinel row.
|
|
20
|
+
*/
|
|
21
|
+
export declare const defaultGitExec: GitExecFn;
|
|
22
|
+
export interface DirtyStateCollector {
|
|
23
|
+
collect(): Promise<RepoState[]>;
|
|
24
|
+
}
|
|
25
|
+
export interface DirtyStateCollectorOptions {
|
|
26
|
+
gitExec?: GitExecFn;
|
|
27
|
+
timeoutMs?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* §4.7 LOCK #C6-A-7 — enumerate `knownRepos`, clamp to authority,
|
|
31
|
+
* collect git metadata for each in-scope repo. Sentinel-friendly:
|
|
32
|
+
* missing git, non-git dirs, and timeouts each produce a row with
|
|
33
|
+
* `"unknown"` strings instead of throwing.
|
|
34
|
+
*/
|
|
35
|
+
export declare function collectRepoStates(authority: AuthorityScope, knownRepos: KnownRepo[], options?: DirtyStateCollectorOptions): Promise<RepoState[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Factory that produces a `DirtyStateCollector` bound to a known-repo
|
|
38
|
+
* snapshot + authority scope. Used by `createContinuationPacketWriter`
|
|
39
|
+
* to inject the collector as a dependency (test seam).
|
|
40
|
+
*/
|
|
41
|
+
export declare function createDirtyStateCollector(deps: {
|
|
42
|
+
authority: AuthorityScope;
|
|
43
|
+
knownRepos: KnownRepo[];
|
|
44
|
+
gitExec?: GitExecFn;
|
|
45
|
+
timeoutMs?: number;
|
|
46
|
+
}): DirtyStateCollector;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { AgentKind, HandoffReason, GateState, RepoState, ContinuationPacket, PacketWriteInput, PacketWriteResult, PacketListEntry, ContinuationPacketReadResult, } from './types';
|
|
2
|
+
export { PacketFidelityError, PacketIoError, PacketHashMismatch, PacketAuditEmitError, PacketNotFound, PacketUnverified, FrontmatterMalformed, SchemaInvalid, PacketPermissionsLoose, } from './types';
|
|
3
|
+
export { createContinuationPacketWriter, buildContinuationPacket, computePacketHash, renderPacketMarkdown, getPacketFilePath, getTaskDirectoryPath, } from './packet-writer';
|
|
4
|
+
export type { ContinuationPacketWriter, ContinuationPacketWriterDeps, } from './packet-writer';
|
|
5
|
+
export { createContinuationPacketReader, splitFrontmatter, validatePacketSchema, } from './packet-reader';
|
|
6
|
+
export type { ContinuationPacketReader, ContinuationPacketReaderDeps, } from './packet-reader';
|
|
7
|
+
export { collectRepoStates, createDirtyStateCollector, defaultGitExec, } from './dirty-state-collector';
|
|
8
|
+
export type { DirtyStateCollector, DirtyStateCollectorOptions, GitExecFn, GitExecOptions, KnownRepo, } from './dirty-state-collector';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AppSyncClient } from '../appsync/appsync-client';
|
|
2
|
+
import type { ContinuationPacket, PacketListEntry, RepoState } from './types';
|
|
3
|
+
export interface ContinuationPacketReaderDeps {
|
|
4
|
+
appsync: AppSyncClient;
|
|
5
|
+
/** Test seam — override the home directory. Defaults to `os.homedir()`. */
|
|
6
|
+
homeDir?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ContinuationPacketReader {
|
|
9
|
+
read(taskId: string, expectedHash?: string): Promise<ContinuationPacket>;
|
|
10
|
+
list(): Promise<PacketListEntry[]>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Split a markdown body into YAML frontmatter + prose body. Returns
|
|
14
|
+
* `null` for the frontmatter when the body is missing the leading
|
|
15
|
+
* `---` fence.
|
|
16
|
+
*/
|
|
17
|
+
export declare function splitFrontmatter(body: string): {
|
|
18
|
+
yaml: string | null;
|
|
19
|
+
prose: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Validate that a parsed YAML object matches the 17-field
|
|
23
|
+
* `ContinuationPacket` schema per LOCK #C6-A-1. Returns the typed
|
|
24
|
+
* packet on success; throws `SchemaInvalid` with a list of issues
|
|
25
|
+
* otherwise.
|
|
26
|
+
*/
|
|
27
|
+
export declare function validatePacketSchema(parsed: unknown): ContinuationPacket;
|
|
28
|
+
/**
|
|
29
|
+
* Factory for the CP-6 packet reader.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createContinuationPacketReader(deps: ContinuationPacketReaderDeps): ContinuationPacketReader;
|
|
32
|
+
export { getPacketFilePath, getTaskDirectoryPath } from './packet-writer';
|
|
33
|
+
export type { RepoState };
|
|
@@ -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 {};
|