@quantiya/codevibe-core 2.0.0 → 2.0.1
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/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 +24 -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-planner.test.d.ts +1 -0
- package/dist/appsync/__tests__/appsync-client.test.d.ts +1 -0
- package/dist/appsync/appsync-client.d.ts +412 -0
- package/dist/appsync/index.d.ts +1 -1
- package/dist/appsync/queries.d.ts +15 -0
- package/dist/auth/__tests__/auth-telemetry.test.d.ts +1 -0
- package/dist/auth/auth-telemetry.d.ts +98 -5
- 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/index.d.ts +11 -3
- package/dist/index.js +243 -42
- package/dist/keychain/keychain-manager.d.ts +16 -2
- 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-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__/hook-bridge.test.d.ts +1 -0
- package/dist/local-executor/__tests__/local-executor.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/spawn.test.d.ts +1 -0
- package/dist/local-executor/__tests__/verification-runner.test.d.ts +1 -0
- package/dist/local-executor/authority.d.ts +29 -0
- package/dist/local-executor/class-a-emit.d.ts +138 -0
- package/dist/local-executor/class-b-consumer.d.ts +121 -0
- package/dist/local-executor/hook-bridge.d.ts +36 -0
- package/dist/local-executor/index.d.ts +8 -0
- package/dist/local-executor/local-executor-impl.d.ts +83 -0
- package/dist/local-executor/spawn.d.ts +6 -0
- package/dist/local-executor/types.d.ts +183 -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/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 +2 -1
- 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 +140 -0
- package/dist/orchestration/setup-wizard.d.ts +57 -0
- package/dist/orchestration/v1-options.d.ts +97 -0
- package/dist/orchestration-shell/__tests__/cli-authority-bridge.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-planner-stack.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__/components.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/emit-shell-event.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/gate-prompts.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/hostile-grep.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/mode-selection.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__/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__/slash-router.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/sticky-preference.test.d.ts +1 -0
- package/dist/orchestration-shell/cli.d.ts +96 -0
- package/dist/orchestration-shell/cli.js +8309 -0
- package/dist/orchestration-shell/cohort-flag.d.ts +16 -0
- package/dist/orchestration-shell/components/CodeVibeLogo.d.ts +2 -0
- package/dist/orchestration-shell/components/ConversationPane.d.ts +7 -0
- package/dist/orchestration-shell/components/GatePromptEntry.d.ts +9 -0
- package/dist/orchestration-shell/components/InputBar.d.ts +41 -0
- package/dist/orchestration-shell/components/OrchestrationApp.d.ts +63 -0
- package/dist/orchestration-shell/components/StatusBar.d.ts +7 -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/emit-shell-event.d.ts +64 -0
- package/dist/orchestration-shell/gate-prompts.d.ts +123 -0
- package/dist/orchestration-shell/index.d.ts +100 -0
- package/dist/orchestration-shell/ink-runtime.d.ts +64 -0
- package/dist/orchestration-shell/mode-selection.d.ts +46 -0
- package/dist/orchestration-shell/non-tty-fallback.d.ts +46 -0
- package/dist/orchestration-shell/process-markers.d.ts +12 -0
- package/dist/orchestration-shell/reducer.d.ts +8 -0
- package/dist/orchestration-shell/slash-router.d.ts +45 -0
- package/dist/orchestration-shell/sticky-preference.d.ts +24 -0
- package/dist/orchestration-shell/store.d.ts +17 -0
- package/dist/orchestration-shell/types.d.ts +417 -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__/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 +5 -0
- package/dist/planner/types.d.ts +113 -0
- package/dist/session/__tests__/session-resume-service-keys.test.d.ts +1 -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/types/events.d.ts +17 -2
- package/package.json +17 -3
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { AppSyncClient } from '../appsync';
|
|
2
|
+
import { Session } from '../types';
|
|
3
|
+
import { type ShellEventEmit } from './emit-shell-event';
|
|
4
|
+
import { BackendPlannerClient, PlannerCacheLayer, PlannerHealthMachine } from '../planner';
|
|
5
|
+
import type { PlannerAdapter, PlannerInput, PlannerDecision, PlannerProbeResult } from '../planner/adapter';
|
|
6
|
+
/**
|
|
7
|
+
* CP-1.b IMPL r5 H-1 — Sentinel error thrown by the stub-session
|
|
8
|
+
* planner adapter. `handleShellUserInput` catches this typed class and
|
|
9
|
+
* routes it through the explicit error renderer (SLASH_OUTPUT) so the
|
|
10
|
+
* user sees an actionable message in the conversation pane instead of
|
|
11
|
+
* a silent log line. Stub sessions (sessionId prefix `cp1a-local-` or
|
|
12
|
+
* empty `encryptedKeys`) cannot reach the Lambda — `encryptedKeys` is
|
|
13
|
+
* missing, the keychain resolver returns null, and the planner client
|
|
14
|
+
* throws "session key unresolved" deep inside classify(). Surfacing
|
|
15
|
+
* that as a typed error at the adapter boundary is cleaner than the
|
|
16
|
+
* generic Error from `BackendPlannerClient.classify()`.
|
|
17
|
+
*/
|
|
18
|
+
export declare class PlannerUnavailableError extends Error {
|
|
19
|
+
constructor(msg: string);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* CP-1.b IMPL r5 H-1 — Stub-session planner adapter.
|
|
23
|
+
*
|
|
24
|
+
* CP-1.a still ships a fake `cp1a-local-*` session with no
|
|
25
|
+
* `encryptedKeys[]`. The production `BackendPlannerClient` cannot
|
|
26
|
+
* classify against that session — the Lambda requires E2E-encrypted
|
|
27
|
+
* payloads, which requires the session key, which the keychain
|
|
28
|
+
* resolver cannot derive without `encryptedKeys`.
|
|
29
|
+
*
|
|
30
|
+
* Rather than wire up the production stack and let it fail with a
|
|
31
|
+
* generic "session key unresolved" Error deep inside classify(), we
|
|
32
|
+
* detect stub sessions at bootstrap and construct this adapter, which
|
|
33
|
+
* throws a typed `PlannerUnavailableError` on classify(). The shell's
|
|
34
|
+
* `handleShellUserInput` catches this and renders an actionable
|
|
35
|
+
* message to the user (`PLANNER_UNAVAILABLE: <reason>`). CP-1.c lands
|
|
36
|
+
* the real session bootstrap (resumeOrCreateSession + AppSync) and
|
|
37
|
+
* this adapter is no longer wired in.
|
|
38
|
+
*/
|
|
39
|
+
export declare class PlannerUnavailableAdapter implements PlannerAdapter {
|
|
40
|
+
private readonly reason;
|
|
41
|
+
private activeSessionId;
|
|
42
|
+
constructor(reason: string);
|
|
43
|
+
classify(_input: PlannerInput): Promise<PlannerDecision>;
|
|
44
|
+
probe(): Promise<PlannerProbeResult>;
|
|
45
|
+
setActiveSession(sessionId: string | null): void;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* CP-1.b IMPL r5 H-1 — Detect a CP-1.a stub session. Two signals:
|
|
49
|
+
* (a) `sessionId` starts with `cp1a-local-` (the
|
|
50
|
+
* `buildStubSession()` prefix).
|
|
51
|
+
* (b) `session.encryptedKeys` is empty / missing (any session
|
|
52
|
+
* lacking E2E keys cannot route through the Lambda).
|
|
53
|
+
*
|
|
54
|
+
* Either signal triggers the stub-session adapter. The (b) gate is
|
|
55
|
+
* a defensive fallback for the case where CP-1.c starts a real
|
|
56
|
+
* session bootstrap but `prepareSessionEncryption()` returns null
|
|
57
|
+
* (no device keys registered): the planner is genuinely unavailable
|
|
58
|
+
* until the user registers a device key.
|
|
59
|
+
*/
|
|
60
|
+
export declare function isStubSession(session: Session): boolean;
|
|
61
|
+
export declare function main(argv: string[]): Promise<number>;
|
|
62
|
+
/**
|
|
63
|
+
* CP-1.b IMPL r4 H-1 — Production planner stack factory.
|
|
64
|
+
*
|
|
65
|
+
* Builds the full BackendPlannerClient + PlannerCacheLayer +
|
|
66
|
+
* PlannerHealthMachine chain so the orchestration shell can call
|
|
67
|
+
* `plannerAdapter.classify()` on natural-language input.
|
|
68
|
+
*
|
|
69
|
+
* Co-located with the CLI bootstrap (NOT inside `runOrchestrationShell`)
|
|
70
|
+
* because the shell accepts an injected adapter for tests; the
|
|
71
|
+
* production bootstrap site is the single canonical instantiation
|
|
72
|
+
* point.
|
|
73
|
+
*
|
|
74
|
+
* Exported for unit tests; production callers go through `main()`.
|
|
75
|
+
*/
|
|
76
|
+
export declare function buildProductionPlannerStack(appsyncClient: AppSyncClient, emitter: (args: ShellEventEmit) => Promise<void>): {
|
|
77
|
+
adapter: BackendPlannerClient;
|
|
78
|
+
cache: PlannerCacheLayer;
|
|
79
|
+
health: PlannerHealthMachine;
|
|
80
|
+
};
|
|
81
|
+
import { HookBridge } from '../local-executor/hook-bridge';
|
|
82
|
+
export interface BridgeRefusalArgs {
|
|
83
|
+
refusedMessageId: string;
|
|
84
|
+
shellContent: string;
|
|
85
|
+
shellMetadata?: Record<string, unknown>;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Wrap any async operation that may throw `AuthorityError`; on refusal, emit
|
|
89
|
+
* the two-channel refusal pair (LOCK #C4-3) via the supplied HookBridge and
|
|
90
|
+
* re-throw. Non-AuthorityError exceptions propagate unchanged.
|
|
91
|
+
*
|
|
92
|
+
* The HookBridge passed in MUST be the same instance the orchestration shell
|
|
93
|
+
* uses for plugin-hook ingestion — both paths share the audit-before-shell
|
|
94
|
+
* ordering invariant via the bridge's `bridgeAuthorityRefusal` method.
|
|
95
|
+
*/
|
|
96
|
+
export declare function bridgeAuthorityErrorToShellRefusal<T>(bridge: HookBridge, refusalArgs: BridgeRefusalArgs, fn: () => Promise<T>): Promise<T>;
|