@quantiya/codevibe-core 1.0.23 → 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 +278 -1
- package/dist/appsync/index.d.ts +1 -1
- package/dist/appsync/queries.d.ts +8 -0
- package/dist/audit-keys/__tests__/audit-keys-parity.test.d.ts +1 -0
- package/dist/audit-keys/index.d.ts +41 -0
- package/dist/auth/__tests__/auth-telemetry.test.d.ts +1 -0
- package/dist/auth/auth-telemetry.d.ts +29 -8
- 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 +13 -1
- package/dist/index.js +253 -33
- 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 +57 -0
- package/dist/orchestration/index.d.ts +3 -0
- package/dist/orchestration/orchestration-cli.d.ts +12 -0
- 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/reviewer/__tests__/integration.test.d.ts +1 -0
- package/dist/reviewer/__tests__/mocks.test.d.ts +1 -0
- package/dist/reviewer/__tests__/output-parser.test.d.ts +1 -0
- package/dist/reviewer/__tests__/registry.test.d.ts +1 -0
- package/dist/reviewer/__tests__/subprocess.test.d.ts +1 -0
- package/dist/reviewer/index.d.ts +15 -0
- package/dist/reviewer/mocks.d.ts +80 -0
- package/dist/reviewer/output-parser.d.ts +95 -0
- package/dist/reviewer/provider.d.ts +153 -0
- package/dist/reviewer/providers/__tests__/claude-live-smoke.test.d.ts +1 -0
- package/dist/reviewer/providers/__tests__/claude.test.d.ts +1 -0
- package/dist/reviewer/providers/__tests__/codex-live-smoke.test.d.ts +1 -0
- package/dist/reviewer/providers/__tests__/codex.test.d.ts +1 -0
- package/dist/reviewer/providers/__tests__/gemini-live-smoke.test.d.ts +1 -0
- package/dist/reviewer/providers/__tests__/gemini.test.d.ts +1 -0
- package/dist/reviewer/providers/claude.d.ts +59 -0
- package/dist/reviewer/providers/codex.d.ts +67 -0
- package/dist/reviewer/providers/common.d.ts +25 -0
- package/dist/reviewer/providers/gemini.d.ts +108 -0
- package/dist/reviewer/registry.d.ts +87 -0
- package/dist/reviewer/subprocess.d.ts +117 -0
- package/dist/reviewer/types.d.ts +101 -0
- package/dist/session/__tests__/session-resume-service-keys.test.d.ts +1 -0
- package/dist/session/session-resume.d.ts +24 -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/dist/types/index.d.ts +1 -0
- package/dist/types/reviewer.d.ts +67 -0
- package/dist/types/session.d.ts +16 -0
- package/package.json +22 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ExclusionState, type StructuralSummaryGenerator } from './types';
|
|
2
|
+
export declare function createStructuralSummaryGenerator(): StructuralSummaryGenerator;
|
|
3
|
+
export interface ReadmeCounters {
|
|
4
|
+
excludedAsUntracked: number;
|
|
5
|
+
excludedByGitignore: number;
|
|
6
|
+
excludedByIgnoreFile: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function readReadmePreview(rootPath: string, exclusionState: ExclusionState, countedExactPaths: Set<string>, countedPrunedPrefixes: Set<string>, counters: ReadmeCounters): Promise<string>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { createStructuralSummaryGenerator, readReadmePreview, } from './generator';
|
|
2
|
+
export { walk as walkRepoTree } from './walker';
|
|
3
|
+
export { isPathAdmissible, isPathInIgnoredPrefixes, isPathAccountedFor, matchesSecretDenyList, SECRET_DENY_LIST, } from './privacy-filter';
|
|
4
|
+
export { readOptIn, addBodyPath, removeBodyPath, optInFilePath, } from './opt-in-store';
|
|
5
|
+
export { compileUserIgnore, emptyUserIgnoreMatcher, } from './user-ignore-matcher';
|
|
6
|
+
export type { DirectoryNode, RepoSummary, StructuralSummary, StructuralSummaryGenerator, GenerateOpts, PrivacyEnvelope, WalkResult, ExclusionState, UserIgnoreMatcher, ParsedManifest, ManifestType, OptInFile, StructuralSummaryErrorKind, } from './types';
|
|
7
|
+
export { StructuralSummaryError } from './types';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ExclusionState, ParsedManifest } from '../types';
|
|
2
|
+
export interface ManifestCounters {
|
|
3
|
+
excludedAsUntracked: number;
|
|
4
|
+
excludedByGitignore: number;
|
|
5
|
+
excludedByIgnoreFile: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function parse(rootPath: string, exclusionState: ExclusionState, countedExactPaths: Set<string>, countedPrunedPrefixes: Set<string>, counters: ManifestCounters): Promise<ParsedManifest>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ParsedManifest } from '../types';
|
|
2
|
+
export declare const pyproject: {
|
|
3
|
+
findManifest(rootPath: string): Promise<string | null>;
|
|
4
|
+
parse(file: string): Promise<ParsedManifest>;
|
|
5
|
+
};
|
|
6
|
+
export declare const gomod: {
|
|
7
|
+
findManifest(rootPath: string): Promise<string | null>;
|
|
8
|
+
parse(file: string): Promise<ParsedManifest>;
|
|
9
|
+
};
|
|
10
|
+
export declare const podfile: {
|
|
11
|
+
findManifest(rootPath: string): Promise<string | null>;
|
|
12
|
+
parse(file: string): Promise<ParsedManifest>;
|
|
13
|
+
};
|
|
14
|
+
export declare const gradle: {
|
|
15
|
+
findManifest(rootPath: string): Promise<string | null>;
|
|
16
|
+
parse(file: string): Promise<ParsedManifest>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type OptInFile } from './types';
|
|
2
|
+
import type { Tier } from '../orchestration-shell/types';
|
|
3
|
+
export declare function optInFilePath(): string;
|
|
4
|
+
/**
|
|
5
|
+
* Per Stage 2 r1 Gemini M-1: reader takes `currentTier`. If
|
|
6
|
+
* `parsed.tierAtOptIn !== currentTier`, returns `null` (graceful tier-
|
|
7
|
+
* downgrade invalidation — no error throw).
|
|
8
|
+
*/
|
|
9
|
+
export declare function readOptIn(currentTier: Tier): Promise<OptInFile | null>;
|
|
10
|
+
/**
|
|
11
|
+
* Per Stage 2 r1 Gemini H-3 option (a): widen to `Tier` so callers can
|
|
12
|
+
* pass `args.tier` directly without an unsafe type narrow. Runtime gate
|
|
13
|
+
* inside the function is authoritative; non-MAX throws `tier_gate`.
|
|
14
|
+
*
|
|
15
|
+
* Stage 2 r2 fix (H-1, Codex): validates that `bodyPath` is absolute
|
|
16
|
+
* BEFORE any persistence work. Normalises via `path.resolve()`
|
|
17
|
+
* (defense-in-depth — strips any residual `..` segments) and resolves
|
|
18
|
+
* symlinks via `fs.realpath()`. The realpath result is what gets
|
|
19
|
+
* persisted, so a future `cd` that lands the user in a different repo
|
|
20
|
+
* cannot trip a relative-path match. Throws `StructuralSummaryError(
|
|
21
|
+
* 'invalid_path')` for non-absolute or unresolvable inputs.
|
|
22
|
+
*/
|
|
23
|
+
export declare function addBodyPath(bodyPath: string, currentTier: Tier): Promise<OptInFile>;
|
|
24
|
+
export declare function removeBodyPath(bodyPath: string): Promise<OptInFile>;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { ExclusionState } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Stage 2 IMPL r2 fix (H-3, Codex H-2): strict path-containment helper.
|
|
4
|
+
*
|
|
5
|
+
* Returns true iff `rel` (the output of `path.relative(root, target)`)
|
|
6
|
+
* denotes a path OUTSIDE `root` via parent-directory traversal. Required
|
|
7
|
+
* because the naive `rel.startsWith('..')` form falsely classifies valid
|
|
8
|
+
* child names that happen to BEGIN with `..` (e.g., `..scratch/file.ts`,
|
|
9
|
+
* `..hidden`, `..foo/bar`) as outside the root.
|
|
10
|
+
*
|
|
11
|
+
* Correct semantics:
|
|
12
|
+
* rel === '..' → outside (parent of root)
|
|
13
|
+
* rel === '..' + path.sep + 'sib' → outside (sibling of root)
|
|
14
|
+
* rel === '..' + '/' + 'sib' → outside (POSIX form, used by
|
|
15
|
+
* git output / forward-slash
|
|
16
|
+
* callers on Windows)
|
|
17
|
+
* rel === '..foo' → INSIDE (child whose name
|
|
18
|
+
* starts with `..`)
|
|
19
|
+
*
|
|
20
|
+
* Used in: walker.ts `buildExclusionState` (realRootPath outside-repo
|
|
21
|
+
* check + untracked subtree filter) and privacy-filter.ts
|
|
22
|
+
* `isPathAdmissible` (relative-to-realRootPath admission).
|
|
23
|
+
*/
|
|
24
|
+
export declare function isOutsideRoot(rel: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Static secret-file deny-list. Matches `.env`, `.env.*`, `.aws/credentials`,
|
|
27
|
+
* and assorted private-key formats. Matched against absolute-path basename
|
|
28
|
+
* and a few suffix patterns. Per §4.3 step 2 first match.
|
|
29
|
+
*/
|
|
30
|
+
export declare const SECRET_DENY_LIST: readonly string[];
|
|
31
|
+
/**
|
|
32
|
+
* Pure path test — returns true if `absolutePath` matches any secret
|
|
33
|
+
* deny-list pattern. The walker uses this to skip secret files silently
|
|
34
|
+
* (no counter increment per §4.3 hard-caps audit-quality note).
|
|
35
|
+
*/
|
|
36
|
+
export declare function matchesSecretDenyList(absolutePath: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Helper exported alongside `isPathAdmissible`: returns true if
|
|
39
|
+
* `absolutePath` is either:
|
|
40
|
+
* (a) an exact entry in `exactPaths` — file-level gitignore match,
|
|
41
|
+
* O(1) `Set.has(p)`; OR
|
|
42
|
+
* (b) equal to OR a descendant of an entry in `dirPrefixes` —
|
|
43
|
+
* directory-level gitignore match, implemented via check-then-step
|
|
44
|
+
* ancestor-walk:
|
|
45
|
+
*
|
|
46
|
+
* let p = absolutePath;
|
|
47
|
+
* while (true) {
|
|
48
|
+
* if (dirPrefixes.has(p)) return true;
|
|
49
|
+
* const parent = path.dirname(p);
|
|
50
|
+
* if (parent === p) return false; // filesystem root reached
|
|
51
|
+
* p = parent;
|
|
52
|
+
* }
|
|
53
|
+
*
|
|
54
|
+
* Key properties (per round-7 revision Codex r6 H-1 + Gemini r6 H-1/M-2):
|
|
55
|
+
*
|
|
56
|
+
* 1. **Signature is 3-arg** `(absolutePath, exactPaths, dirPrefixes)`.
|
|
57
|
+
* The helper does NOT receive `realRootPath`. The walk MUST proceed
|
|
58
|
+
* past `realRootPath` because `git ls-files --directory` may report
|
|
59
|
+
* an ignored ancestor ABOVE the launch root (e.g., parent
|
|
60
|
+
* `.gitignore` ignores `sub/` when launch root is `repo/sub/inner`).
|
|
61
|
+
* 2. **Check-then-step semantics**: check `dirPrefixes.has(p)` BEFORE
|
|
62
|
+
* advancing `p`. This handles the case where `absolutePath` is
|
|
63
|
+
* itself an entry in `dirPrefixes` (e.g., Step 0.5 root admission
|
|
64
|
+
* tests `realRootPath` directly when it is itself ignored).
|
|
65
|
+
* 3. **Loop termination**: when `path.dirname(p) === p` (POSIX `/`,
|
|
66
|
+
* Windows `C:\`). NO early termination at `realRootPath`.
|
|
67
|
+
*
|
|
68
|
+
* Lookup cost is O(absolute filesystem depth) (typically <30 on any sane
|
|
69
|
+
* mount tree), independent of `|dirPrefixes|`.
|
|
70
|
+
*/
|
|
71
|
+
export declare function isPathInIgnoredPrefixes(absolutePath: string, exactPaths: Set<string>, dirPrefixes: Set<string>): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* INTERNAL helper (not exported from the module index, but exported here
|
|
74
|
+
* so the manifest dispatcher + README reader can import it). Returns true
|
|
75
|
+
* iff `realFile` is already accounted for in the walker's two-set ledger
|
|
76
|
+
* (exact match OR equal-to-or-descendant-of an entry in pruned prefixes).
|
|
77
|
+
*
|
|
78
|
+
* Same canonical algorithm as `isPathInIgnoredPrefixes` — 3-arg signature,
|
|
79
|
+
* check-then-step, filesystem-root termination. Per round-7 revision
|
|
80
|
+
* Gemini r6 M-1 + Codex r6 H-1 + Gemini r6 M-2.
|
|
81
|
+
*/
|
|
82
|
+
export declare function isPathAccountedFor(realFile: string, countedExactPaths: Set<string>, countedPrunedPrefixes: Set<string>): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Order of checks (mirrors §4.3 step 2, first match wins):
|
|
85
|
+
* 1. secret (deny-list path-glob match — operates on basename + suffix).
|
|
86
|
+
* 2. untracked (`state.untrackedSet.has(absolutePath)`; SKIPPED if
|
|
87
|
+
* notInGitRepo).
|
|
88
|
+
* 3. gitignore (`isPathInIgnoredPrefixes(...)`; SKIPPED if notInGitRepo).
|
|
89
|
+
* 4. userIgnore (`state.userIgnoreMatcher.ignores(path.relative(
|
|
90
|
+
* realRootPath, absolutePath), isDir)`).
|
|
91
|
+
*
|
|
92
|
+
* Pure in-memory check; consults only the pre-built `state`. No I/O.
|
|
93
|
+
*
|
|
94
|
+
* `isDir` (Stage 2 r2 fix, M-2 Gemini M-1): walker passes
|
|
95
|
+
* `entry.isDirectory()` here. File-only callers (manifest dispatcher,
|
|
96
|
+
* README reader) accept the default `false`. The flag is consumed by
|
|
97
|
+
* `userIgnoreMatcher.ignores()` to honour trailing-slash `dir/` rules.
|
|
98
|
+
*
|
|
99
|
+
* Caller is responsible for incrementing the appropriate counter on
|
|
100
|
+
* `privacyEnvelope` when `admissible === false` (so audit signal is
|
|
101
|
+
* preserved). `reason === 'secret'` is silent (no counter — per §4.3
|
|
102
|
+
* hard-caps audit-quality note).
|
|
103
|
+
*/
|
|
104
|
+
export declare function isPathAdmissible(absolutePath: string, state: ExclusionState, isDir?: boolean): {
|
|
105
|
+
admissible: true;
|
|
106
|
+
} | {
|
|
107
|
+
admissible: false;
|
|
108
|
+
reason: 'secret' | 'untracked' | 'gitignore' | 'userIgnore';
|
|
109
|
+
};
|
|
110
|
+
export type { ExclusionState } from './types';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TOCTOU-safe text file read. Returns the file contents as UTF-8 or
|
|
3
|
+
* `null` on any refusal / error. See module JSDoc for the syscall
|
|
4
|
+
* sequence + threat model.
|
|
5
|
+
*
|
|
6
|
+
* @param absPath Absolute filesystem path. Caller is responsible for
|
|
7
|
+
* path absolutism + admission-oracle checks BEFORE
|
|
8
|
+
* invoking this function; this helper only guards the
|
|
9
|
+
* lstat→open transition.
|
|
10
|
+
*/
|
|
11
|
+
export declare function safeReadTextFile(absPath: string): Promise<string | null>;
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import type { Tier } from '../orchestration-shell/types';
|
|
2
|
+
/**
|
|
3
|
+
* The 6 manifest kinds detected by the first slice (§4.4), plus `other`
|
|
4
|
+
* (parser found a candidate but parsing failed) and `none` (no manifest
|
|
5
|
+
* found at this rootPath).
|
|
6
|
+
*
|
|
7
|
+
* Matches the locked `RepoSummary.manifestType` enum at CP-0 §10.S.7 line 145.
|
|
8
|
+
*/
|
|
9
|
+
export type ManifestType = 'npm' | 'cargo' | 'pyproject' | 'go' | 'podfile' | 'gradle' | 'other' | 'none';
|
|
10
|
+
export interface ParsedManifest {
|
|
11
|
+
type: ManifestType;
|
|
12
|
+
packageName?: string;
|
|
13
|
+
dependencies: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* One directory in the walked tree. Mirrors CP-0 §10.S.7:153-160; the
|
|
17
|
+
* Max-tier `body` + `bodyTruncated` fields are `[ADDITIVE WIDENING — CP-1.d]`
|
|
18
|
+
* per Hendry-locked round-1 Q1. `truncatedByDepth` is set when the walker
|
|
19
|
+
* hits `maxDepth = 12` on this node's subtree (§4.7).
|
|
20
|
+
*/
|
|
21
|
+
export interface DirectoryNode {
|
|
22
|
+
path: string;
|
|
23
|
+
fileCount: number;
|
|
24
|
+
bytes: number;
|
|
25
|
+
children: DirectoryNode[];
|
|
26
|
+
inferredLanguage?: string;
|
|
27
|
+
/** `[ADDITIVE WIDENING — CP-1.d]` Q1 LOCKED — Max-tier opt-in only. */
|
|
28
|
+
body?: string;
|
|
29
|
+
/** `[ADDITIVE WIDENING — CP-1.d]` Q1 LOCKED — true if `body` truncated or skipped due to per-file 512 KiB cap or shared 64 MiB body budget. */
|
|
30
|
+
bodyTruncated?: boolean;
|
|
31
|
+
/** True if walker stopped recursing here because `maxDepth = 12` was hit on a descendant. */
|
|
32
|
+
truncatedByDepth?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* One repo's portion of the assembled summary. The `rootPath` ECHOES the
|
|
36
|
+
* caller-supplied (possibly symlinked) path so the user-visible digest
|
|
37
|
+
* stays stable; the walker uses `realRootPath` for internal admission
|
|
38
|
+
* checks (§4.3 step 2 step 0).
|
|
39
|
+
*/
|
|
40
|
+
export interface RepoSummary {
|
|
41
|
+
rootPath: string;
|
|
42
|
+
manifestType: ManifestType;
|
|
43
|
+
packageName?: string;
|
|
44
|
+
dependencies: string[];
|
|
45
|
+
inferredLanguages: string[];
|
|
46
|
+
readmePreview: string;
|
|
47
|
+
directoryTree: DirectoryNode;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Privacy envelope counters + status flags. All but the first 3 fields are
|
|
51
|
+
* `[ADDITIVE WIDENING — CP-1.d]` extensions to the CP-0 §10.S.7:136-140
|
|
52
|
+
* 3-field sketch (per Stage 2 r1 Codex H-1 + Gemini H-1 + Hendry-locked Q2).
|
|
53
|
+
*/
|
|
54
|
+
export interface PrivacyEnvelope {
|
|
55
|
+
bodyInclusionPaths: string[];
|
|
56
|
+
excludedByGitignore: number;
|
|
57
|
+
excludedByIgnoreFile: number;
|
|
58
|
+
/** `[ADDITIVE WIDENING — CP-1.d]` Stage 2 r1 Codex H-1. */
|
|
59
|
+
excludedAsUntracked?: number;
|
|
60
|
+
/** `[ADDITIVE WIDENING — CP-1.d]` Q2 LOCKED — covers both file-count AND body-byte budgets. */
|
|
61
|
+
budgetExceeded?: boolean;
|
|
62
|
+
/** `[ADDITIVE WIDENING — CP-1.d]` Stage 2 r1 Gemini H-1 — disambiguates which budget tripped first. */
|
|
63
|
+
budgetReason?: 'fileCount' | 'bodyBytes';
|
|
64
|
+
/** `[ADDITIVE WIDENING — CP-1.d]` Stage 2 r1 Codex H-1 — graceful non-git fallback marker. */
|
|
65
|
+
notInGitRepo?: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The top-level structural summary returned by `generate()`. CP-1.b
|
|
69
|
+
* consumes `sha256` as an opaque cache key.
|
|
70
|
+
*/
|
|
71
|
+
export interface StructuralSummary {
|
|
72
|
+
generatedAt: string;
|
|
73
|
+
rootPaths: string[];
|
|
74
|
+
repos: RepoSummary[];
|
|
75
|
+
totalFileCount: number;
|
|
76
|
+
totalBytes: number;
|
|
77
|
+
privacyEnvelope: PrivacyEnvelope;
|
|
78
|
+
/**
|
|
79
|
+
* Hex-encoded SHA-256 over the canonical-JSON serialization of the
|
|
80
|
+
* summary EXCLUDING BOTH the `sha256` field AND the `generatedAt`
|
|
81
|
+
* field. `generatedAt` is excluded so identical repo content →
|
|
82
|
+
* identical sha256 across runs (the CP-1.b reproducibility contract);
|
|
83
|
+
* a wall-clock timestamp would defeat that.
|
|
84
|
+
*
|
|
85
|
+
* Canonical-JSON definition: `JSON.stringify(hashPayload, canonicalReplacer)`
|
|
86
|
+
* where `canonicalReplacer` sorts object keys lexicographically.
|
|
87
|
+
* Arrays preserve order, so any input array (e.g., `directoryTree.children`,
|
|
88
|
+
* `inferredLanguages`) must be sorted deterministically upstream — see
|
|
89
|
+
* `walker.ts` (children byte-wise sort) and `generator.ts:inferLanguages`
|
|
90
|
+
* (count + name byte-wise tie-break).
|
|
91
|
+
*
|
|
92
|
+
* See `generator.ts:~200-220` for the canonical hash-payload
|
|
93
|
+
* construction. The previous co-location in `assembler.ts` no longer
|
|
94
|
+
* applies (Stage 2 IMPL r2 — assembly inlined into `generator.ts`).
|
|
95
|
+
*/
|
|
96
|
+
sha256: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Caller-supplied options. Mirrors PHASE-CP-1-DESIGN.md:1590-1596.
|
|
100
|
+
*
|
|
101
|
+
* `_test_caps` is a test-only escape hatch (note the underscore prefix
|
|
102
|
+
* + the `__INTERNAL__` doc tag). Production callers MUST NOT pass it;
|
|
103
|
+
* unit tests use it to trip the file-count + body-byte budget paths
|
|
104
|
+
* without authoring 50,000-file fixtures. Added by Stage 1 r1 M-3
|
|
105
|
+
* fix to support the design §5 line 1173 test row.
|
|
106
|
+
*/
|
|
107
|
+
export interface GenerateOpts {
|
|
108
|
+
rootPaths: string[];
|
|
109
|
+
ignoreFile?: string;
|
|
110
|
+
includeBodies?: string[];
|
|
111
|
+
userId: string;
|
|
112
|
+
tier: Tier;
|
|
113
|
+
/** __INTERNAL__ test-only seam — see JSDoc above. */
|
|
114
|
+
_test_caps?: {
|
|
115
|
+
fileCountCap?: number;
|
|
116
|
+
bodyByteCap?: number;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export interface StructuralSummaryGenerator {
|
|
120
|
+
generate(opts: GenerateOpts): Promise<StructuralSummary>;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Walker return value. Carries the assembled `directoryTree` + per-rootPath
|
|
124
|
+
* audit + the exclusion state + the two-set walker-accounting ledger.
|
|
125
|
+
*
|
|
126
|
+
* `countedExactPaths` + `countedPrunedPrefixes` (round-6 split per Codex r5 M-1)
|
|
127
|
+
* are the explicit ledger the manifest dispatcher + README reader consult via
|
|
128
|
+
* `isPathAccountedFor()` to avoid double-counting. See §4.3 step 6.
|
|
129
|
+
*/
|
|
130
|
+
export interface WalkResult {
|
|
131
|
+
directoryTree: DirectoryNode;
|
|
132
|
+
fileExtensions: Map<string, number>;
|
|
133
|
+
excludedByGitignore: number;
|
|
134
|
+
excludedByIgnoreFile: number;
|
|
135
|
+
excludedAsUntracked: number;
|
|
136
|
+
truncated: boolean;
|
|
137
|
+
bodyBudgetExceeded: boolean;
|
|
138
|
+
notInGitRepo: boolean;
|
|
139
|
+
exclusionState: ExclusionState;
|
|
140
|
+
/**
|
|
141
|
+
* Exact absolute paths the walker enumerated + already incremented an
|
|
142
|
+
* `excludedBy*` counter for (any of gitignore/userIgnore/untracked —
|
|
143
|
+
* NOT secret, which is silent).
|
|
144
|
+
*/
|
|
145
|
+
countedExactPaths: Set<string>;
|
|
146
|
+
/**
|
|
147
|
+
* Absolute directory paths the walker pruned upfront without enumerating
|
|
148
|
+
* (Step 0.5 root admission OR Step 2 child-directory prune-during-descent).
|
|
149
|
+
* Counter was incremented once per prefix.
|
|
150
|
+
*/
|
|
151
|
+
countedPrunedPrefixes: Set<string>;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Minimal gitignore-format matcher signature — the user-ignore file is
|
|
155
|
+
* matched against this. Kept as an interface so the implementation can swap
|
|
156
|
+
* between an in-process matcher and the `ignore` npm package later without
|
|
157
|
+
* surface churn.
|
|
158
|
+
*/
|
|
159
|
+
export interface UserIgnoreMatcher {
|
|
160
|
+
/**
|
|
161
|
+
* Returns true if the gitignore-style ruleset matches `relativePath`.
|
|
162
|
+
* `relativePath` is path.relative(realRootPath, absolutePath), with forward
|
|
163
|
+
* slashes on POSIX.
|
|
164
|
+
*
|
|
165
|
+
* Stage 2 r2 widening (M-2, Gemini M-1): `isDir` is consulted by rules
|
|
166
|
+
* with trailing `/` (e.g., `dist/`) — they MUST NOT match a regular
|
|
167
|
+
* file. Defaults to `false`; only the walker has cheap `Dirent.isDirectory()`
|
|
168
|
+
* info and threads it through. File-only callers (manifest dispatcher,
|
|
169
|
+
* README reader) get correct semantics with the default.
|
|
170
|
+
*/
|
|
171
|
+
ignores(relativePath: string, isDir?: boolean): boolean;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Per-rootPath exclusion state, built ONCE at walker startup. See §4.3a.
|
|
175
|
+
*
|
|
176
|
+
* `ignoredExactPaths` + `ignoredDirPrefixes` (round-6 trailing-slash partition
|
|
177
|
+
* per Codex r5 H-1) replace round-5's conflated single `ignoredPrefixes` set.
|
|
178
|
+
* `realRootPath` (round-4 Codex H-1 + Gemini H-1) canonicalises the launch
|
|
179
|
+
* root through `fs.realpath()` so symlinked launch roots produce correct
|
|
180
|
+
* subtree-membership filters.
|
|
181
|
+
*/
|
|
182
|
+
export interface ExclusionState {
|
|
183
|
+
rootPath: string;
|
|
184
|
+
realRootPath: string;
|
|
185
|
+
notInGitRepo: boolean;
|
|
186
|
+
repoTopLevel: string;
|
|
187
|
+
untrackedSet: Set<string>;
|
|
188
|
+
ignoredExactPaths: Set<string>;
|
|
189
|
+
ignoredDirPrefixes: Set<string>;
|
|
190
|
+
userIgnoreMatcher: UserIgnoreMatcher;
|
|
191
|
+
secretDenyList: readonly string[];
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* On-disk schema for `~/.codevibe/structural-summary.opt-in.json`. Locked
|
|
195
|
+
* at §4.6.
|
|
196
|
+
*/
|
|
197
|
+
export interface OptInFile {
|
|
198
|
+
schemaVersion: 1;
|
|
199
|
+
bodyInclusionPaths: string[];
|
|
200
|
+
lastUpdatedAt: string;
|
|
201
|
+
tierAtOptIn: 'MAX';
|
|
202
|
+
}
|
|
203
|
+
export type StructuralSummaryErrorKind = 'tier_gate' | 'fs_unreadable' | 'budget_exceeded' | 'manifest_parse'
|
|
204
|
+
/**
|
|
205
|
+
* `[ADDITIVE WIDENING — CP-1.d]` Stage 2 r2 Codex H-1.
|
|
206
|
+
* Thrown when a body-inclusion opt-in path is not absolute, or when
|
|
207
|
+
* realpath resolution fails (ENOENT etc.) — prevents PRIVACY REGRESSION
|
|
208
|
+
* where a relative opt-in could leak raw bodies from an unrelated
|
|
209
|
+
* repo's directory of the same name on a future `cd`.
|
|
210
|
+
*/
|
|
211
|
+
| 'invalid_path';
|
|
212
|
+
export declare class StructuralSummaryError extends Error {
|
|
213
|
+
readonly kind: StructuralSummaryErrorKind;
|
|
214
|
+
constructor(message: string, kind: StructuralSummaryErrorKind);
|
|
215
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UserIgnoreMatcher } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a matcher from a gitignore-format text blob.
|
|
4
|
+
*/
|
|
5
|
+
export declare function compileUserIgnore(text: string): UserIgnoreMatcher;
|
|
6
|
+
/**
|
|
7
|
+
* Returns a no-op matcher (no rules — admits everything).
|
|
8
|
+
*/
|
|
9
|
+
export declare function emptyUserIgnoreMatcher(): UserIgnoreMatcher;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { WalkResult } from './types';
|
|
2
|
+
export interface WalkOpts {
|
|
3
|
+
rootPath: string;
|
|
4
|
+
ignoreFile?: string;
|
|
5
|
+
includeBodies: string[];
|
|
6
|
+
maxDepth: number;
|
|
7
|
+
/** Shared file-count budget (mutated in-place across rootPaths). */
|
|
8
|
+
fileCountBudget: {
|
|
9
|
+
remaining: number;
|
|
10
|
+
};
|
|
11
|
+
/** Shared body-byte budget (mutated in-place across rootPaths). */
|
|
12
|
+
bodyBudget: {
|
|
13
|
+
remaining: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Walks `rootPath` and returns a `WalkResult`. Mutates the shared
|
|
18
|
+
* `fileCountBudget` + `bodyBudget` counters.
|
|
19
|
+
*/
|
|
20
|
+
export declare function walk(opts: WalkOpts): Promise<WalkResult>;
|
package/dist/types/events.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Event types matching GraphQL schema
|
|
2
|
+
* Event types matching GraphQL schema.
|
|
3
|
+
*
|
|
4
|
+
* 1.x values come first. CP-1 adds 9 new values per
|
|
5
|
+
* `codevibe-backend/docs/2.0/PHASE-CP-1-DESIGN.md` §3 lines 138-148 +
|
|
6
|
+
* §16 Stage A LOCK. Emission of CP-1 values is gated by the
|
|
7
|
+
* `new-event-types-enabled` cohort flag (default OFF — Phase 4 flips
|
|
8
|
+
* per-user once mobile decoders ship).
|
|
3
9
|
*/
|
|
4
10
|
export declare enum EventType {
|
|
5
11
|
USER_PROMPT = "USER_PROMPT",
|
|
@@ -8,7 +14,16 @@ export declare enum EventType {
|
|
|
8
14
|
NOTIFICATION = "NOTIFICATION",
|
|
9
15
|
INTERACTIVE_PROMPT = "INTERACTIVE_PROMPT",
|
|
10
16
|
PROMPT_RESPONSE = "PROMPT_RESPONSE",
|
|
11
|
-
REASONING = "REASONING"
|
|
17
|
+
REASONING = "REASONING",
|
|
18
|
+
MODE_SELECTED = "MODE_SELECTED",
|
|
19
|
+
PLANNER_DECISION = "PLANNER_DECISION",
|
|
20
|
+
PLANNER_CACHE_HIT = "PLANNER_CACHE_HIT",
|
|
21
|
+
PLANNER_DEGRADED = "PLANNER_DEGRADED",
|
|
22
|
+
PLANNER_OUTAGE = "PLANNER_OUTAGE",
|
|
23
|
+
PLANNER_RECOVERED = "PLANNER_RECOVERED",
|
|
24
|
+
SLASH_COMMAND_INVOKED = "SLASH_COMMAND_INVOKED",
|
|
25
|
+
STRUCTURAL_SUMMARY_GENERATED = "STRUCTURAL_SUMMARY_GENERATED",
|
|
26
|
+
LOCAL_AUTHORITY_REFUSAL = "LOCAL_AUTHORITY_REFUSAL"
|
|
12
27
|
}
|
|
13
28
|
export declare enum EventSource {
|
|
14
29
|
DESKTOP = "DESKTOP",
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Review lens a reviewer seat evaluates through. Mirrors
|
|
3
|
+
* codevibe-policy::ReviewerRole in the Rust engine.
|
|
4
|
+
*
|
|
5
|
+
* **Append-only post-launch** per the 2026-04-23 memory lock — these
|
|
6
|
+
* string values are cryptographically bound into the audit hash chain
|
|
7
|
+
* once used. Renaming or removing a value would break chain verification
|
|
8
|
+
* on every prior entry. Add new values freely; never rename or remove.
|
|
9
|
+
*
|
|
10
|
+
* UPPERCASE here (matches AppSync GraphQL enum convention). The Lambda
|
|
11
|
+
* translates to snake_case before writing to the audit chain / Rust
|
|
12
|
+
* engine wire.
|
|
13
|
+
*/
|
|
14
|
+
export declare enum ReviewerRole {
|
|
15
|
+
ARCHITECTURE = "ARCHITECTURE",
|
|
16
|
+
CORRECTNESS = "CORRECTNESS",
|
|
17
|
+
SECURITY = "SECURITY",
|
|
18
|
+
ACCURACY = "ACCURACY",
|
|
19
|
+
CLARITY = "CLARITY",
|
|
20
|
+
COMPLETENESS = "COMPLETENESS",
|
|
21
|
+
ARCHITECTURE_AND_ACCURACY = "ARCHITECTURE_AND_ACCURACY",
|
|
22
|
+
CORRECTNESS_AND_CLARITY = "CORRECTNESS_AND_CLARITY",
|
|
23
|
+
SECURITY_AND_COMPLETENESS = "SECURITY_AND_COMPLETENESS"
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* One seat in a user's reviewer panel. `seat_id` is the panel position
|
|
27
|
+
* (0-indexed: Pro has seats 0–1, Max has 0–2). `role` is the review lens
|
|
28
|
+
* — unique within a policy. `agent` (CLAUDE | GEMINI | CODEX) may repeat
|
|
29
|
+
* across seats — single-vendor users get multiple same-kind seats with
|
|
30
|
+
* distinct roles.
|
|
31
|
+
*/
|
|
32
|
+
export interface ReviewerAgentSpec {
|
|
33
|
+
seatId: number;
|
|
34
|
+
role: ReviewerRole;
|
|
35
|
+
agent: 'CLAUDE' | 'GEMINI' | 'CODEX';
|
|
36
|
+
modelHint?: string | null;
|
|
37
|
+
}
|
|
38
|
+
export interface ReviewerAgentSpecInput {
|
|
39
|
+
seatId: number;
|
|
40
|
+
role: ReviewerRole;
|
|
41
|
+
agent: 'CLAUDE' | 'GEMINI' | 'CODEX';
|
|
42
|
+
modelHint?: string | null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Input for updateReviewerPolicy. Fields are independent:
|
|
46
|
+
* - orchestrationEnabledDefault: set to true/false to persist the user's
|
|
47
|
+
* opt-in preference for new sessions. Null = leave unchanged.
|
|
48
|
+
* - reviewerSeats: non-empty array sets a custom panel. Empty array
|
|
49
|
+
* resets to tier defaults. Null = leave unchanged.
|
|
50
|
+
*/
|
|
51
|
+
export interface UpdateReviewerPolicyInput {
|
|
52
|
+
orchestrationEnabledDefault?: boolean | null;
|
|
53
|
+
reviewerSeats?: ReviewerAgentSpecInput[] | null;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* User record returned by updateAvailableAgents and updateReviewerPolicy.
|
|
57
|
+
* Subset of the full AppSync User type — only the fields the two mutations
|
|
58
|
+
* return. Use this in the AppSyncClient response typing, not as a general
|
|
59
|
+
* "User" replacement.
|
|
60
|
+
*/
|
|
61
|
+
export interface UserReviewerPolicySnapshot {
|
|
62
|
+
userId: string;
|
|
63
|
+
availableAgents?: Array<'CLAUDE' | 'GEMINI' | 'CODEX'> | null;
|
|
64
|
+
orchestrationEnabledDefault?: boolean | null;
|
|
65
|
+
reviewerSeats?: ReviewerAgentSpec[] | null;
|
|
66
|
+
updatedAt: string;
|
|
67
|
+
}
|
package/dist/types/session.d.ts
CHANGED
|
@@ -32,6 +32,12 @@ export interface Session {
|
|
|
32
32
|
creatorDeviceId?: string;
|
|
33
33
|
encryptionVersion?: number;
|
|
34
34
|
lastHeartbeatAt?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Quorum 2.0 opt-in flag (2f.0.a.3). True routes the session to the
|
|
37
|
+
* 2.0 orchestration flow once 2f.3 Lambda is live; null/false keeps
|
|
38
|
+
* the 1.0 companion flow.
|
|
39
|
+
*/
|
|
40
|
+
orchestrationEnabled?: boolean | null;
|
|
35
41
|
}
|
|
36
42
|
/**
|
|
37
43
|
* GraphQL input for creating sessions
|
|
@@ -47,6 +53,11 @@ export interface CreateSessionInput {
|
|
|
47
53
|
creatorDeviceId?: string;
|
|
48
54
|
isEncrypted?: boolean;
|
|
49
55
|
encryptionVersion?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Quorum 2.0 (2f.0.a.3). Null/absent = server reads
|
|
58
|
+
* User.orchestrationEnabledDefault (option 6a auto-populate).
|
|
59
|
+
*/
|
|
60
|
+
orchestrationEnabled?: boolean;
|
|
50
61
|
}
|
|
51
62
|
/**
|
|
52
63
|
* GraphQL input for updating sessions
|
|
@@ -56,4 +67,9 @@ export interface UpdateSessionInput {
|
|
|
56
67
|
status?: SessionStatus;
|
|
57
68
|
metadata?: Record<string, any>;
|
|
58
69
|
lastHeartbeatAt?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Quorum 2.0 (2f.0.a.3). Per-session override for the orchestration
|
|
72
|
+
* opt-in. Plugin CLI --orchestration/--no-orchestration sets this.
|
|
73
|
+
*/
|
|
74
|
+
orchestrationEnabled?: boolean;
|
|
59
75
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quantiya/codevibe-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Core library for CodeVibe plugins - shared keychain, crypto, AppSync, and auth functionality",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,29 +10,46 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"dist/**/*.d.ts",
|
|
12
12
|
"dist/index.js",
|
|
13
|
+
"dist/orchestration-shell/cli.js",
|
|
13
14
|
"bin"
|
|
14
15
|
],
|
|
15
16
|
"scripts": {
|
|
16
17
|
"typecheck": "tsc --noEmit",
|
|
17
18
|
"emit-types": "tsc --emitDeclarationOnly",
|
|
18
|
-
"build": "rm -rf dist && npm run emit-types && esbuild src/index.ts --bundle --platform=node --target=node18 --minify --packages=external --outfile=dist/index.js",
|
|
19
|
+
"build": "rm -rf dist && npm run emit-types && esbuild src/index.ts --bundle --platform=node --target=node18 --minify --packages=external --outfile=dist/index.js && esbuild src/orchestration-shell/cli.ts --bundle --platform=node --target=node18 --packages=external --outfile=dist/orchestration-shell/cli.js --banner:js=\"#!/usr/bin/env node\"",
|
|
19
20
|
"clean": "rm -rf dist",
|
|
20
21
|
"prepublishOnly": "npm run build",
|
|
21
|
-
"test": "
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest",
|
|
24
|
+
"test:live": "QUORUM_LIVE_SMOKE=1 vitest run"
|
|
22
25
|
},
|
|
23
26
|
"dependencies": {
|
|
27
|
+
"@iarna/toml": "^2.2.5",
|
|
28
|
+
"@npmcli/package-json": "^5.2.1",
|
|
29
|
+
"gradient-string": "^3.0.0",
|
|
30
|
+
"ink": "^5.2.1",
|
|
31
|
+
"ink-select-input": "^6.2.0",
|
|
32
|
+
"ink-spinner": "^5.0.0",
|
|
33
|
+
"ink-text-input": "^6.0.0",
|
|
34
|
+
"react": "^18.3.1",
|
|
35
|
+
"ulid": "^3.0.0",
|
|
24
36
|
"uuid": "^9.0.0",
|
|
25
|
-
"ws": "^8.14.0"
|
|
37
|
+
"ws": "^8.14.0",
|
|
38
|
+
"zod": "^3.23.0"
|
|
26
39
|
},
|
|
27
40
|
"optionalDependencies": {
|
|
28
41
|
"keytar": "^7.9.0"
|
|
29
42
|
},
|
|
30
43
|
"devDependencies": {
|
|
44
|
+
"@types/gradient-string": "^1.1.6",
|
|
31
45
|
"@types/node": "^20.0.0",
|
|
46
|
+
"@types/react": "^18.3.0",
|
|
32
47
|
"@types/uuid": "^9.0.0",
|
|
33
48
|
"@types/ws": "^8.5.0",
|
|
34
49
|
"esbuild": "^0.28.0",
|
|
35
|
-
"
|
|
50
|
+
"ink-testing-library": "^4.0.0",
|
|
51
|
+
"typescript": "^5.0.0",
|
|
52
|
+
"vitest": "^1.6.1"
|
|
36
53
|
},
|
|
37
54
|
"engines": {
|
|
38
55
|
"node": ">=18.0.0"
|