@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,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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quantiya/codevibe-core",
|
|
3
|
-
"version": "2.0.
|
|
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,12 +10,13 @@
|
|
|
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
22
|
"test": "vitest run",
|
|
@@ -23,17 +24,30 @@
|
|
|
23
24
|
"test:live": "QUORUM_LIVE_SMOKE=1 vitest run"
|
|
24
25
|
},
|
|
25
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",
|
|
26
36
|
"uuid": "^9.0.0",
|
|
27
|
-
"ws": "^8.14.0"
|
|
37
|
+
"ws": "^8.14.0",
|
|
38
|
+
"zod": "^3.23.0"
|
|
28
39
|
},
|
|
29
40
|
"optionalDependencies": {
|
|
30
41
|
"keytar": "^7.9.0"
|
|
31
42
|
},
|
|
32
43
|
"devDependencies": {
|
|
44
|
+
"@types/gradient-string": "^1.1.6",
|
|
33
45
|
"@types/node": "^20.0.0",
|
|
46
|
+
"@types/react": "^18.3.0",
|
|
34
47
|
"@types/uuid": "^9.0.0",
|
|
35
48
|
"@types/ws": "^8.5.0",
|
|
36
49
|
"esbuild": "^0.28.0",
|
|
50
|
+
"ink-testing-library": "^4.0.0",
|
|
37
51
|
"typescript": "^5.0.0",
|
|
38
52
|
"vitest": "^1.6.1"
|
|
39
53
|
},
|