@evomap/evolver-cli 2.0.0-beta.2 → 2.0.0-beta.22

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.
Files changed (124) hide show
  1. package/dist/antiGeneBenchmark.js +2 -0
  2. package/dist/antiGeneRollout.js +9 -3
  3. package/dist/assetHealth.d.ts +6 -0
  4. package/dist/assetHealth.js +107 -0
  5. package/dist/assetRepair.d.ts +24 -0
  6. package/dist/assetRepair.js +172 -0
  7. package/dist/assetSidecarRecovery.d.ts +14 -0
  8. package/dist/assetSidecarRecovery.js +171 -0
  9. package/dist/assetTrust.d.ts +24 -0
  10. package/dist/assetTrust.js +231 -0
  11. package/dist/atp.d.ts +10 -5
  12. package/dist/atp.js +119 -26
  13. package/dist/atpAutoBuyer.d.ts +120 -0
  14. package/dist/atpAutoBuyer.js +814 -0
  15. package/dist/atpAutoDeliver.js +2 -2
  16. package/dist/autoDistillAntiGene.js +7 -5
  17. package/dist/autoDistillLlm.d.ts +26 -0
  18. package/dist/autoDistillLlm.js +119 -22
  19. package/dist/autoDistillTranscript.js +3 -2
  20. package/dist/autoexec.d.ts +111 -24
  21. package/dist/autoexec.js +887 -120
  22. package/dist/autoexecConfig.d.ts +10 -0
  23. package/dist/autoexecConfig.js +69 -0
  24. package/dist/cli.js +13 -0
  25. package/dist/cliContracts.d.ts +33 -2
  26. package/dist/cliContracts.js +818 -78
  27. package/dist/commandCatalog.d.ts +72 -0
  28. package/dist/commandCatalog.js +120 -0
  29. package/dist/commands.d.ts +1 -0
  30. package/dist/commands.js +1 -0
  31. package/dist/curriculumCapabilityGaps.d.ts +6 -0
  32. package/dist/curriculumCapabilityGaps.js +24 -0
  33. package/dist/cycleConsumer.d.ts +17 -2
  34. package/dist/cycleConsumer.js +374 -50
  35. package/dist/dashboard.d.ts +13 -1
  36. package/dist/dashboard.js +235 -18
  37. package/dist/dispatch.d.ts +9 -2
  38. package/dist/dispatch.js +29 -6
  39. package/dist/distillAdmission.d.ts +13 -0
  40. package/dist/distillAdmission.js +35 -0
  41. package/dist/distillObserver.js +27 -12
  42. package/dist/distillPrimitives.d.ts +11 -8
  43. package/dist/distillPrimitives.js +116 -22
  44. package/dist/doctor.d.ts +13 -0
  45. package/dist/doctor.js +177 -10
  46. package/dist/identityHome.d.ts +9 -0
  47. package/dist/identityHome.js +47 -0
  48. package/dist/index.d.ts +73 -40
  49. package/dist/index.js +745 -207
  50. package/dist/issueReport.d.ts +7 -0
  51. package/dist/issueReport.js +291 -0
  52. package/dist/learningTrace.d.ts +15 -0
  53. package/dist/learningTrace.js +73 -0
  54. package/dist/lifecycle.d.ts +199 -2
  55. package/dist/lifecycle.js +4999 -152
  56. package/dist/lifecycleBootstrapTransaction.d.ts +235 -0
  57. package/dist/lifecycleBootstrapTransaction.js +2182 -0
  58. package/dist/localMemoryGraph.d.ts +184 -0
  59. package/dist/localMemoryGraph.js +2689 -0
  60. package/dist/login.d.ts +1 -1
  61. package/dist/login.js +3 -3
  62. package/dist/materialPackage.js +3 -6
  63. package/dist/materialSnapshot.d.ts +35 -1
  64. package/dist/materialSnapshot.js +265 -18
  65. package/dist/memoryGraphOps.d.ts +8 -0
  66. package/dist/memoryGraphOps.js +140 -0
  67. package/dist/migrate/assetFormatMap.d.ts +61 -0
  68. package/dist/migrate/assetFormatMap.js +53 -0
  69. package/dist/migrate/envTranslate.d.ts +26 -0
  70. package/dist/migrate/envTranslate.js +147 -0
  71. package/dist/migrate/fieldMap.d.ts +7 -5
  72. package/dist/migrate/fieldMap.js +20 -14
  73. package/dist/migrate/oauthImport.d.ts +66 -0
  74. package/dist/migrate/oauthImport.js +667 -0
  75. package/dist/migrate/v1Import.d.ts +98 -1
  76. package/dist/migrate/v1Import.js +1532 -71
  77. package/dist/modelCompatibility.d.ts +10 -0
  78. package/dist/modelCompatibility.js +296 -0
  79. package/dist/promptRecallHook.d.ts +24 -0
  80. package/dist/promptRecallHook.js +425 -0
  81. package/dist/recallVerifyReport.d.ts +37 -0
  82. package/dist/recallVerifyReport.js +244 -0
  83. package/dist/recipe.d.ts +14 -2
  84. package/dist/recipe.js +543 -65
  85. package/dist/repairedAssetStore.d.ts +2 -0
  86. package/dist/repairedAssetStore.js +12 -0
  87. package/dist/requiredSandboxValidation.d.ts +5 -0
  88. package/dist/requiredSandboxValidation.js +4 -0
  89. package/dist/reuse.d.ts +18 -4
  90. package/dist/reuse.js +375 -107
  91. package/dist/reviewFilter.d.ts +3 -1
  92. package/dist/reviewFilter.js +3 -1
  93. package/dist/runtimeCapabilities.d.ts +18 -0
  94. package/dist/runtimeCapabilities.js +81 -0
  95. package/dist/runtimeSessionSource.d.ts +8 -2
  96. package/dist/runtimeSessionSource.js +63 -11
  97. package/dist/selectionPolicyConfig.d.ts +8 -0
  98. package/dist/selectionPolicyConfig.js +18 -0
  99. package/dist/semanticIdfConfig.d.ts +2 -0
  100. package/dist/semanticIdfConfig.js +4 -0
  101. package/dist/sessionIngest.d.ts +43 -0
  102. package/dist/sessionIngest.js +180 -0
  103. package/dist/setupHooks.d.ts +5 -0
  104. package/dist/setupHooks.js +330 -14
  105. package/dist/skill2gep.d.ts +13 -9
  106. package/dist/skill2gep.js +99 -36
  107. package/dist/skillDistill.d.ts +8 -4
  108. package/dist/skillDistill.js +39 -9
  109. package/dist/solo/mode.js +1 -0
  110. package/dist/sync.d.ts +13 -1
  111. package/dist/sync.js +1947 -265
  112. package/dist/thesis.d.ts +1 -1
  113. package/dist/thesis.js +20 -3
  114. package/dist/trajectoryExport.js +21 -3
  115. package/dist/v1Compat.d.ts +1 -0
  116. package/dist/v1Compat.js +9 -0
  117. package/dist/valueDigest.js +8 -1
  118. package/dist/windowsLegacyTaskCleanup.d.ts +228 -0
  119. package/dist/windowsLegacyTaskCleanup.js +1475 -0
  120. package/dist/workflow.d.ts +39 -0
  121. package/dist/workflow.js +386 -0
  122. package/dist/workflowRuntime.d.ts +66 -0
  123. package/dist/workflowRuntime.js +638 -0
  124. package/package.json +14 -7
@@ -0,0 +1,10 @@
1
+ import { compatibility, exec, verify } from '@evomap/evolver-core';
2
+ export interface ModelCompatibilityReplayDeps {
3
+ spawn?: typeof exec.spawnCapture;
4
+ validation?: typeof verify.runSandboxedValidation;
5
+ isolationAvailable?: () => boolean;
6
+ }
7
+ declare function claudeArgs(test: compatibility.ReplayCase): string[];
8
+ export declare function runModelCompatibilityReplay(argv: string[], deps?: ModelCompatibilityReplayDeps): Promise<number>;
9
+ export declare const modelCompatibilityClaudeArgs: typeof claudeArgs;
10
+ export {};
@@ -0,0 +1,296 @@
1
+ import { compatibility, exec, verify } from '@evomap/evolver-core';
2
+ import { cpSync, existsSync, lstatSync, mkdtempSync, readFileSync, rmSync, statSync } from 'node:fs';
3
+ import { tmpdir } from 'node:os';
4
+ import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
5
+ const MAX_INPUT = 2 * 1024 * 1024;
6
+ const MAX_CASES = 256;
7
+ const EXIT_USAGE = 2;
8
+ const EXIT_RUNTIME = 3;
9
+ const EXIT_QUARANTINE = 4;
10
+ const RESULT_SCHEMA = {
11
+ type: 'object',
12
+ additionalProperties: false,
13
+ properties: {
14
+ status: { type: 'string', enum: ['completed'] },
15
+ task_family: { type: 'string' },
16
+ input_digest: { type: 'string' },
17
+ mode: { type: 'string', enum: ['baseline', 'asset-enabled'] },
18
+ },
19
+ required: ['status', 'task_family', 'input_digest', 'mode'],
20
+ };
21
+ function flag(argv, name) {
22
+ const index = argv.indexOf(name);
23
+ return index >= 0 ? argv[index + 1] : undefined;
24
+ }
25
+ function output(value) { process.stdout.write(`${JSON.stringify(value)}\n`); }
26
+ function fail(message, code) { process.stderr.write(`[model-compatibility-replay] ${message}\n`); return code; }
27
+ function object(value, label) {
28
+ if (!value || typeof value !== 'object' || Array.isArray(value))
29
+ throw new Error(`${label} must be an object`);
30
+ return value;
31
+ }
32
+ function boundedJson(path) {
33
+ const raw = readFileSync(path, 'utf8');
34
+ if (Buffer.byteLength(raw) > MAX_INPUT)
35
+ throw new Error('input exceeds 2 MiB');
36
+ return JSON.parse(raw);
37
+ }
38
+ function positiveNumber(value, label) {
39
+ if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0)
40
+ throw new Error(`${label} must be positive`);
41
+ return value;
42
+ }
43
+ function runnerDefinition(value) {
44
+ if (value === undefined)
45
+ return { kind: 'claude-cli' };
46
+ const input = object(value, 'runner');
47
+ const kind = input.kind === 'fixture' ? 'fixture' : input.kind === 'claude-cli' ? 'claude-cli' : undefined;
48
+ if (!kind)
49
+ throw new Error('runner.kind must be claude-cli or fixture');
50
+ return {
51
+ kind,
52
+ ...(typeof input.executable === 'string' ? { executable: input.executable.slice(0, 512) } : {}),
53
+ ...(Array.isArray(input.argv) ? { argv: input.argv.filter((item) => typeof item === 'string').slice(0, 64) } : {}),
54
+ ...(Array.isArray(input.setupFiles) ? { setupFiles: input.setupFiles.filter((item) => typeof item === 'string').slice(0, 64) } : {}),
55
+ };
56
+ }
57
+ function assertWithinRoot(root, value, label) {
58
+ if (isAbsolute(value))
59
+ throw new Error(`${label} must be relative to --cwd`);
60
+ const target = resolve(root, value);
61
+ const rel = relative(root, target);
62
+ if (rel === '..' || rel.startsWith(`..${sep}`) || isAbsolute(rel))
63
+ throw new Error(`${label} escapes --cwd`);
64
+ return target;
65
+ }
66
+ function replayCase(value, root) {
67
+ const input = object(value, 'case');
68
+ const asset = object(input.asset, 'asset');
69
+ for (const key of ['type', 'id', 'revision'])
70
+ if (typeof asset[key] !== 'string' || !asset[key])
71
+ throw new Error(`asset.${key} is required`);
72
+ if (typeof input.requestedModelId !== 'string' || !input.requestedModelId)
73
+ throw new Error('requestedModelId is required');
74
+ if (typeof input.taskFamily !== 'string' || !input.taskFamily)
75
+ throw new Error('taskFamily is required');
76
+ const budgetInput = object(input.budget, 'budget');
77
+ const timeoutMs = positiveNumber(budgetInput.timeoutMs, 'budget.timeoutMs');
78
+ if (!Number.isSafeInteger(timeoutMs) || timeoutMs > 120_000)
79
+ throw new Error('budget.timeoutMs must be an integer up to 120000');
80
+ const validation = Array.isArray(input.validation)
81
+ ? input.validation.filter((item) => typeof item === 'string').slice(0, 64)
82
+ : [];
83
+ if (validation.length === 0)
84
+ throw new Error('validation must contain at least one command');
85
+ for (const command of validation) {
86
+ if (!verify.isValidationCommandAllowed(command))
87
+ throw new Error('validation commands must be safe node scripts');
88
+ const script = verify.validationScriptPath(command);
89
+ if (script)
90
+ assertWithinRoot(root, script, 'validation script');
91
+ }
92
+ return {
93
+ asset: { type: asset.type, id: asset.id, revision: asset.revision },
94
+ requestedModelId: input.requestedModelId,
95
+ taskFamily: input.taskFamily,
96
+ input: input.input,
97
+ environment: input.environment ?? {},
98
+ budget: { maxUsd: positiveNumber(budgetInput.maxUsd, 'budget.maxUsd'), timeoutMs },
99
+ validation,
100
+ };
101
+ }
102
+ function copySandbox(root, files) {
103
+ const sandbox = mkdtempSync(join(tmpdir(), 'evolver-model-compatibility-'));
104
+ try {
105
+ for (const file of files) {
106
+ const source = assertWithinRoot(root, file, 'setup file');
107
+ if (!existsSync(source) || lstatSync(source).isSymbolicLink())
108
+ throw new Error(`setup file is missing or symlinked: ${file}`);
109
+ const target = join(sandbox, file);
110
+ const parent = dirname(target);
111
+ const parentRel = relative(sandbox, parent);
112
+ if (parentRel === '..' || parentRel.startsWith(`..${sep}`))
113
+ throw new Error('setup target escapes sandbox');
114
+ cpSync(source, target, { recursive: statSync(source).isDirectory(), dereference: false, force: true });
115
+ }
116
+ return sandbox;
117
+ }
118
+ catch (error) {
119
+ rmSync(sandbox, { recursive: true, force: true });
120
+ throw error;
121
+ }
122
+ }
123
+ function claudeArgs(test) {
124
+ return [
125
+ '--print', '--safe-mode', '--no-session-persistence', '--tools', '', '--permission-mode', 'dontAsk',
126
+ '--model', test.requestedModelId, '--effort', 'low', '--output-format', 'json',
127
+ '--json-schema', JSON.stringify(RESULT_SCHEMA), '--max-budget-usd', String(test.budget.maxUsd),
128
+ ];
129
+ }
130
+ function fixtureArgs(definition, test, mode) {
131
+ const argv = [...(definition.argv ?? [])];
132
+ if (argv.some((item) => /[;&|`$<>\n\r]/.test(item)))
133
+ throw new Error('unsafe fixture argv');
134
+ return [...argv, '--model', test.requestedModelId, '--mode', mode];
135
+ }
136
+ function prompt(test, mode) {
137
+ return JSON.stringify({
138
+ instruction: 'Execute the fixed compatibility replay task. Do not use fallback models. Return only the schema result.',
139
+ task_family: test.taskFamily,
140
+ input_digest: compatibility.canonicalDigest(test.input),
141
+ mode,
142
+ asset: mode === 'asset-enabled' ? test.asset : null,
143
+ input: test.input,
144
+ });
145
+ }
146
+ function finiteInteger(value) {
147
+ return typeof value === 'number' && Number.isSafeInteger(value) && value >= 0 ? value : undefined;
148
+ }
149
+ function finiteNumber(value) {
150
+ return typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : undefined;
151
+ }
152
+ function parseStructuredResult(value, test, mode) {
153
+ let result = value;
154
+ if (typeof result === 'string') {
155
+ try {
156
+ result = JSON.parse(result);
157
+ }
158
+ catch {
159
+ return null;
160
+ }
161
+ }
162
+ if (!result || typeof result !== 'object' || Array.isArray(result))
163
+ return null;
164
+ const row = result;
165
+ if (Object.keys(row).some((key) => !['status', 'task_family', 'input_digest', 'mode'].includes(key)))
166
+ return null;
167
+ return row.status === 'completed'
168
+ && row.task_family === test.taskFamily
169
+ && row.input_digest === compatibility.canonicalDigest(test.input)
170
+ && row.mode === mode ? row : null;
171
+ }
172
+ function parseClaudeEnvelope(raw, test, mode, processResult) {
173
+ let envelope;
174
+ try {
175
+ envelope = object(JSON.parse(raw), 'Claude CLI envelope');
176
+ }
177
+ catch {
178
+ envelope = undefined;
179
+ }
180
+ const usage = envelope?.usage && typeof envelope.usage === 'object' ? envelope.usage : undefined;
181
+ const modelUsage = envelope?.modelUsage && typeof envelope.modelUsage === 'object' && !Array.isArray(envelope.modelUsage)
182
+ ? envelope.modelUsage : undefined;
183
+ const servedIds = modelUsage ? Object.keys(modelUsage) : [];
184
+ const servedModel = servedIds.length === 1 && servedIds[0] === test.requestedModelId
185
+ ? { id: servedIds[0], source: 'claude-cli-envelope' }
186
+ : null;
187
+ const inputTokens = finiteInteger(usage?.input_tokens);
188
+ const outputTokens = finiteInteger(usage?.output_tokens);
189
+ const cacheCreation = finiteInteger(usage?.cache_creation_input_tokens);
190
+ const cacheRead = finiteInteger(usage?.cache_read_input_tokens);
191
+ const cost = finiteNumber(envelope?.total_cost_usd);
192
+ const parsedUsage = inputTokens !== undefined && outputTokens !== undefined && cacheCreation !== undefined && cacheRead !== undefined && cost !== undefined
193
+ ? { inputTokens, outputTokens, cacheCreationInputTokens: cacheCreation, cacheReadInputTokens: cacheRead, costUsd: cost }
194
+ : null;
195
+ const structuredResult = parseStructuredResult(envelope?.structured_output ?? envelope?.result, test, mode);
196
+ const sessionId = typeof envelope?.session_id === 'string' && envelope.session_id.length > 0 ? envelope.session_id : null;
197
+ const envelopeSuccess = envelope?.type === 'result' && envelope.subtype === 'success' && envelope.is_error === false;
198
+ return {
199
+ trust: 'claude-cli', mode,
200
+ ok: processResult.code === 0 && processResult.termination === 'exit' && envelopeSuccess,
201
+ exitCode: processResult.code,
202
+ termination: processResult.termination,
203
+ requestedModel: { id: test.requestedModelId }, servedModel, sessionId, usage: parsedUsage, structuredResult,
204
+ stdoutTruncated: processResult.stdoutTruncated === true,
205
+ stderrTruncated: processResult.stderrTruncated === true,
206
+ };
207
+ }
208
+ function fixtureObservation(test, mode, result) {
209
+ return {
210
+ trust: 'fixture', mode, ok: result.code === 0 && result.termination === 'exit', exitCode: result.code,
211
+ termination: result.termination, requestedModel: { id: test.requestedModelId }, servedModel: null,
212
+ sessionId: null, usage: null, structuredResult: null,
213
+ stdoutTruncated: result.stdoutTruncated === true, stderrTruncated: result.stderrTruncated === true,
214
+ };
215
+ }
216
+ async function execute(definition, test, mode, cwd, deps) {
217
+ const spawn = deps.spawn ?? exec.spawnCapture;
218
+ const executable = definition.kind === 'claude-cli' ? definition.executable ?? 'claude' : definition.executable ?? process.execPath;
219
+ if (definition.kind === 'claude-cli' && executable !== 'claude')
220
+ throw new Error('claude-cli runner executable must be claude');
221
+ if (definition.kind === 'fixture' && ![process.execPath, 'node', 'nodejs'].includes(executable))
222
+ throw new Error('fixture executable is not allowlisted');
223
+ const result = await spawn(executable, definition.kind === 'claude-cli' ? claudeArgs(test) : fixtureArgs(definition, test, mode), {
224
+ cwd, timeoutMs: test.budget.timeoutMs, input: prompt(test, mode), maxOutputBytes: 256 * 1024,
225
+ env: { PATH: process.env.PATH ?? '/usr/bin:/bin', HOME: cwd, NODE_ENV: 'production' },
226
+ });
227
+ const processEvidence = definition.kind === 'claude-cli'
228
+ ? parseClaudeEnvelope(result.stdout, test, mode, result)
229
+ : fixtureObservation(test, mode, result);
230
+ const validate = deps.validation ?? verify.runSandboxedValidation;
231
+ const validation = await validate(test.validation, cwd, {
232
+ timeoutMs: Math.min(test.budget.timeoutMs, 30_000), requireIsolation: true, readOnlyRoot: cwd,
233
+ ...(deps.isolationAvailable ? { unshareCheck: deps.isolationAvailable } : {}),
234
+ });
235
+ const steps = validation.results.map((item) => ({
236
+ command: item.cmd, exitCode: item.exitCode, passed: item.passed, executed: true, termination: 'exit',
237
+ }));
238
+ for (const skipped of validation.skipped)
239
+ steps.push({
240
+ command: skipped.cmd, exitCode: null, passed: false, executed: false, termination: 'not-started',
241
+ });
242
+ return { ...processEvidence, validation: compatibility.validationTrace(validation.isolated, steps) };
243
+ }
244
+ export async function runModelCompatibilityReplay(argv, deps = {}) {
245
+ if (argv.includes('--help')) {
246
+ output({ usage: 'evolver model-compatibility-replay --input <json> [--ledger <json>] [--cwd <dir>] [--retries <n>] [--transition quarantine|revalidate|release --request-id <id> --reason <text>]' });
247
+ return 0;
248
+ }
249
+ const inputPath = flag(argv, '--input');
250
+ if (!inputPath)
251
+ return fail('Usage: evolver model-compatibility-replay --input <json>', EXIT_USAGE);
252
+ try {
253
+ const root = resolve(flag(argv, '--cwd') ?? process.cwd());
254
+ const source = boundedJson(resolve(inputPath));
255
+ const body = Array.isArray(source) ? { cases: source } : object(source, 'input');
256
+ const cases = Array.isArray(body.cases) ? body.cases : null;
257
+ if (!cases || cases.length === 0 || cases.length > MAX_CASES)
258
+ throw new Error('input must contain 1 to 256 cases');
259
+ const corpus = cases.map((item) => replayCase(item, root));
260
+ const ledgerPath = flag(argv, '--ledger');
261
+ const transition = flag(argv, '--transition');
262
+ if (transition) {
263
+ if (!ledgerPath || corpus.length !== 1 || !['quarantine', 'revalidate', 'release'].includes(transition))
264
+ throw new Error('transition requires --ledger, one case, and a valid transition');
265
+ const requestId = flag(argv, '--request-id');
266
+ const reason = flag(argv, '--reason');
267
+ if (!requestId || !reason)
268
+ throw new Error('transition requires --request-id and --reason');
269
+ const ledger = new compatibility.CompatibilityLedger(resolve(ledgerPath));
270
+ const changed = ledger.transition(compatibility.compatibilityKey(corpus[0]), transition, requestId, reason);
271
+ output({ changed, resolved: ledger.resolve(compatibility.compatibilityKey(corpus[0])) });
272
+ return 0;
273
+ }
274
+ const definition = runnerDefinition(body.runner);
275
+ const retries = Math.max(0, Math.min(Number(flag(argv, '--retries') ?? '1') || 0, 5));
276
+ const setupFiles = definition.setupFiles ?? [];
277
+ const run = await compatibility.replayCorpus(corpus, async ({ mode, test }) => {
278
+ const sandbox = copySandbox(root, setupFiles);
279
+ try {
280
+ return await execute(definition, test, mode, sandbox, deps);
281
+ }
282
+ finally {
283
+ rmSync(sandbox, { recursive: true, force: true });
284
+ }
285
+ }, { requestId: flag(argv, '--request-id'), retries });
286
+ if (ledgerPath)
287
+ new compatibility.CompatibilityLedger(resolve(ledgerPath)).appendRun(run);
288
+ const decisions = run.evidence.map((item) => compatibility.evaluateEvidence(item));
289
+ output({ ...run, decisions });
290
+ return decisions.includes('quarantine') ? EXIT_QUARANTINE : 0;
291
+ }
292
+ catch (error) {
293
+ return fail(error instanceof Error ? error.message : String(error), EXIT_RUNTIME);
294
+ }
295
+ }
296
+ export const modelCompatibilityClaudeArgs = claudeArgs;
@@ -0,0 +1,24 @@
1
+ import { assetstore, hub } from '@evomap/evolver-core';
2
+ export type PromptRecallMode = 'off' | 'shadow' | 'enforce';
3
+ /** The hook sees a raw user prompt, so reject oversized payloads instead of retaining a partial JSON document. */
4
+ export declare const MAX_PROMPT_RECALL_STDIN_BYTES: number;
5
+ export declare const MAX_PROMPT_RECALL_LOCAL_FILE_BYTES: number;
6
+ export declare const MAX_PROMPT_RECALL_LOCAL_TOTAL_BYTES: number;
7
+ type HookInputReader = () => string | undefined | Promise<string | undefined>;
8
+ export interface PromptRecallHookDeps {
9
+ store?: assetstore.AssetStoreProvider;
10
+ review?: assetstore.ReviewLedger;
11
+ provenance?: assetstore.ProvenanceStore;
12
+ callLog?: Pick<hub.AssetCallLog, 'append'>;
13
+ env?: NodeJS.ProcessEnv;
14
+ readHookInput?: HookInputReader;
15
+ stdout?: (text: string) => void;
16
+ selectionTimeoutMs?: number;
17
+ }
18
+ export declare function promptRecallMode(env?: NodeJS.ProcessEnv): PromptRecallMode;
19
+ /**
20
+ * Shared Claude Code/Codex UserPromptSubmit entrypoint. It is intentionally local-only and fail-open: no Hub
21
+ * query, no transcript read, no prompt persistence, and exactly one JSON object on stdout for every outcome.
22
+ */
23
+ export declare function runPromptRecallHook(argv: readonly string[], deps?: PromptRecallHookDeps): Promise<number>;
24
+ export {};