@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,55 @@
|
|
|
1
|
+
import { DetectableAgent } from '../orchestration/detect-agents';
|
|
2
|
+
import type { ShellEventEmit } from '../orchestration-shell/emit-shell-event';
|
|
3
|
+
import type { Session } from '../types';
|
|
4
|
+
export declare class NoAgentInstalledError extends Error {
|
|
5
|
+
constructor(message: string);
|
|
6
|
+
}
|
|
7
|
+
export interface CompanionArgs {
|
|
8
|
+
/** Optional `--agent <kind>` CLI override. */
|
|
9
|
+
agent?: DetectableAgent;
|
|
10
|
+
/** Args to pass through to the agent wrapper. */
|
|
11
|
+
passthrough: string[];
|
|
12
|
+
/** When set, clears the persisted preference before resolving. */
|
|
13
|
+
forgetAgent?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Session context for §3 emitShellEvent fan-out. When provided
|
|
16
|
+
* together with `emitter`, MODE_SELECTED is emitted before the exec
|
|
17
|
+
* handoff. When either is omitted, the emit is skipped — Companion
|
|
18
|
+
* Mode is functional without it because the cohort flag gates every
|
|
19
|
+
* emit anyway (CP-1.a default OFF). Per Stage 1 r1 HIGH-3.
|
|
20
|
+
*/
|
|
21
|
+
session?: Session;
|
|
22
|
+
/**
|
|
23
|
+
* Bound emitter (typically `createShellEventEmitter(appsyncClient)`).
|
|
24
|
+
* Required for the MODE_SELECTED emit when `session` is also set.
|
|
25
|
+
*/
|
|
26
|
+
emitter?: (args: ShellEventEmit) => Promise<void>;
|
|
27
|
+
/** Test seam — override the `execFileSync` handoff. */
|
|
28
|
+
execFile?: (binPath: string, args: string[], options: {
|
|
29
|
+
stdio: 'inherit';
|
|
30
|
+
}) => void;
|
|
31
|
+
/** Test seam — override `detectInstalledAgents`. */
|
|
32
|
+
detect?: () => DetectableAgent[];
|
|
33
|
+
/** Test seam — override bin-path resolver (real impl uses `command -v`). */
|
|
34
|
+
resolveBinPath?: (kind: DetectableAgent) => string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Test seam — override the `<wrapper> --version` 2s health-probe
|
|
37
|
+
* (§4 line 280). Real impl spawns the wrapper with a SIGKILL on
|
|
38
|
+
* timeout. Per Stage 2 r1 Codex MEDIUM-2.
|
|
39
|
+
*/
|
|
40
|
+
versionProbe?: (binPath: string) => Promise<boolean>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* §4 LOCK lines 232-273. Detect → resolve → persist → exec.
|
|
44
|
+
*
|
|
45
|
+
* On a TTY with multiple agents, this calls `pickAgent` for the
|
|
46
|
+
* interactive readline picker. The function does NOT mount the Ink
|
|
47
|
+
* TUI — Companion Mode does not need it (the picker hands terminal
|
|
48
|
+
* control directly to the wrapper).
|
|
49
|
+
*
|
|
50
|
+
* NOTE: the function returns when the test seam `execFile` is
|
|
51
|
+
* provided; in production the `execFileSync` call replaces the process
|
|
52
|
+
* (`stdio: 'inherit'`) so `process.exit(0)` is unreachable but kept
|
|
53
|
+
* as a defensive fallback (§4 line 273).
|
|
54
|
+
*/
|
|
55
|
+
export declare function runCompanionMode(args: CompanionArgs): Promise<void>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare function companionPreferenceFilePath(): string;
|
|
2
|
+
export interface CompanionPreference {
|
|
3
|
+
lastAgent: 'CLAUDE' | 'GEMINI' | 'CODEX';
|
|
4
|
+
lastUsedAt: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* §4 lines 304-316 LOCK. Reads + validates the preference file.
|
|
8
|
+
* Returns `null` on every failure mode named in the design:
|
|
9
|
+
* - file missing
|
|
10
|
+
* - loose permissions (any group/world bits set)
|
|
11
|
+
* - malformed JSON
|
|
12
|
+
* - schema mismatch
|
|
13
|
+
*/
|
|
14
|
+
export declare function readCompanionPreference(): Promise<CompanionPreference | null>;
|
|
15
|
+
/**
|
|
16
|
+
* Writes the preference file with mode 0600. Creates parent dir if
|
|
17
|
+
* missing. Self-heals loose perms (writes 0o600 explicitly on every
|
|
18
|
+
* write).
|
|
19
|
+
*/
|
|
20
|
+
export declare function persistCompanionPreference(pref: CompanionPreference): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Clears the preference file (used by `--forget-agent` flag per §4).
|
|
23
|
+
*/
|
|
24
|
+
export declare function clearCompanionPreference(): Promise<void>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DetectableAgent } from '../orchestration/detect-agents';
|
|
2
|
+
export interface DetectedAgent {
|
|
3
|
+
kind: DetectableAgent;
|
|
4
|
+
binPath: string;
|
|
5
|
+
healthy: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface ResolveAgentArgs {
|
|
8
|
+
/** Healthy agents detected on PATH. */
|
|
9
|
+
healthy: DetectedAgent[];
|
|
10
|
+
/** `--agent` CLI flag override (if any). */
|
|
11
|
+
flag?: DetectableAgent;
|
|
12
|
+
/** Persisted preference from `readCompanionPreference()` (if any). */
|
|
13
|
+
preferred?: DetectableAgent;
|
|
14
|
+
}
|
|
15
|
+
export interface ResolveAgentResult {
|
|
16
|
+
/** When a single resolved agent exists. */
|
|
17
|
+
agent?: DetectedAgent;
|
|
18
|
+
/** When multiple healthy agents exist and the picker should run. */
|
|
19
|
+
needsPicker?: {
|
|
20
|
+
healthy: DetectedAgent[];
|
|
21
|
+
defaultIndex: number;
|
|
22
|
+
};
|
|
23
|
+
/** When the flag asked for an agent that's not healthy. */
|
|
24
|
+
flagMissing?: {
|
|
25
|
+
requested: DetectableAgent;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* §4 resolution order LOCK:
|
|
30
|
+
* 1. flag > preference > picker > single-agent fast-path
|
|
31
|
+
*
|
|
32
|
+
* - If `flag` is set and a matching healthy agent exists → return it.
|
|
33
|
+
* - If `flag` is set and no matching healthy agent → `flagMissing`.
|
|
34
|
+
* - Single-agent fast-path: exactly 1 healthy agent → return it
|
|
35
|
+
* (regardless of preference).
|
|
36
|
+
* - Multiple healthy + `preferred` set + matches → picker with that
|
|
37
|
+
* row pre-selected (caller may decide to auto-accept).
|
|
38
|
+
* - Multiple healthy + no preference → picker with first row
|
|
39
|
+
* pre-selected.
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveAgent(args: ResolveAgentArgs): ResolveAgentResult;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { KeychainManager, keychainManager, KeychainError } from './keychain';
|
|
2
2
|
export { CryptoService, cryptoService, CryptoError, ENCRYPTION_VERSION } from './crypto';
|
|
3
|
-
export { AppSyncClient, DownloadUrlResponse } from './appsync';
|
|
3
|
+
export { AppSyncClient, AppSyncGraphQLError, DownloadUrlResponse } from './appsync';
|
|
4
4
|
export { queries, mutations, subscriptions } from './appsync';
|
|
5
5
|
export { AuthService, authService } from './auth';
|
|
6
6
|
export { runAuthCli } from './auth';
|
|
@@ -13,8 +13,16 @@ export { parseInteractivePrompt, normalizeSnapshot, } from './prompt-parser';
|
|
|
13
13
|
export type { ParsedInteractivePrompt, PromptKind, InteractivePromptOption, } from './prompt-parser';
|
|
14
14
|
export { resumeOrCreateSession, prepareSessionEncryption, rekeySessionForNewDevices, startDeviceKeyWatcher, registerDeviceEncryptionKey, } from './session';
|
|
15
15
|
export type { ResumeOrCreateSessionInput, ResumeOrCreateSessionResult } from './session';
|
|
16
|
-
export { detectInstalledAgents, pushDetectedAgents, applyPerSessionOrchestrationOverride, runOrchestrationCli, } from './orchestration';
|
|
17
|
-
export type { DetectableAgent } from './orchestration';
|
|
16
|
+
export { detectInstalledAgents, pushDetectedAgents, applyPerSessionOrchestrationOverride, runOrchestrationCli, V1_ORCHESTRATION_PROMPT_KIND, V1_ORCHESTRATION_OPTIONS, mapOptionNumberToUserDecisionKind, mapOptionToUserDecisionKind, } from './orchestration';
|
|
17
|
+
export type { DetectableAgent, V1OrchestrationOption, V1UserDecisionKind, } from './orchestration';
|
|
18
18
|
export * as Reviewer from './reviewer';
|
|
19
19
|
export * as AuditKeys from './audit-keys';
|
|
20
20
|
export * from './types';
|
|
21
|
+
export * as Planner from './planner';
|
|
22
|
+
export * as StructuralSummary from './structural-summary';
|
|
23
|
+
export { runOrchestrationShell } from './orchestration-shell';
|
|
24
|
+
export { runCompanionMode } from './companion-mode';
|
|
25
|
+
export { pickMode, TierError } from './orchestration-shell';
|
|
26
|
+
export { emitShellEvent, createShellEventEmitter } from './orchestration-shell';
|
|
27
|
+
export { processMarkers, withRoleMarker } from './orchestration-shell';
|
|
28
|
+
export type { Mode, Tier, PlannerDecision, AgentKind, PlannerHealthState, OrchestrationState, OrchestrationAction, ConversationEntry, RunningTaskState, ReviewerSeatState, GateState, ExecutionEventEntry, RefusalEventEntry, BypassEventEntry, MobileEventEntry, EventStreamEntry, QueuedTask, PendingClarification, LastModeFile, } from './orchestration-shell';
|