@evomap/evolver-cli 2.0.0-beta.1 → 2.0.0-beta.10

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 (86) hide show
  1. package/dist/antiGeneBenchmark.js +12 -0
  2. package/dist/antiGeneEvidence.d.ts +15 -0
  3. package/dist/antiGeneEvidence.js +49 -0
  4. package/dist/antiGeneRollout.d.ts +3 -1
  5. package/dist/antiGeneRollout.js +16 -2
  6. package/dist/assetHealth.d.ts +6 -0
  7. package/dist/assetHealth.js +105 -0
  8. package/dist/assetSidecarRecovery.d.ts +14 -0
  9. package/dist/assetSidecarRecovery.js +171 -0
  10. package/dist/assetTrust.d.ts +24 -0
  11. package/dist/assetTrust.js +218 -0
  12. package/dist/atp.js +4 -2
  13. package/dist/autoDistillLlm.d.ts +6 -0
  14. package/dist/autoDistillLlm.js +44 -7
  15. package/dist/autoexec.d.ts +14 -12
  16. package/dist/autoexec.js +84 -34
  17. package/dist/autoexecConfig.d.ts +10 -0
  18. package/dist/autoexecConfig.js +68 -0
  19. package/dist/cli.js +12 -5
  20. package/dist/cliContracts.js +30 -3
  21. package/dist/cliLifecycle.d.ts +7 -0
  22. package/dist/cliLifecycle.js +9 -0
  23. package/dist/cycleConsumer.d.ts +61 -1
  24. package/dist/cycleConsumer.js +551 -16
  25. package/dist/dashboard.d.ts +33 -0
  26. package/dist/dashboard.js +352 -0
  27. package/dist/dispatch.d.ts +10 -1
  28. package/dist/dispatch.js +40 -2
  29. package/dist/distillAdmission.d.ts +13 -0
  30. package/dist/distillAdmission.js +35 -0
  31. package/dist/distillObserver.js +6 -8
  32. package/dist/distillPrimitives.d.ts +9 -7
  33. package/dist/distillPrimitives.js +65 -12
  34. package/dist/doctor.d.ts +2 -0
  35. package/dist/doctor.js +49 -3
  36. package/dist/index.d.ts +8 -2
  37. package/dist/index.js +350 -42
  38. package/dist/issueReport.d.ts +7 -0
  39. package/dist/issueReport.js +291 -0
  40. package/dist/lifecycle.d.ts +19 -1
  41. package/dist/lifecycle.js +226 -29
  42. package/dist/localMemoryGraph.d.ts +97 -0
  43. package/dist/localMemoryGraph.js +889 -0
  44. package/dist/login.d.ts +20 -4
  45. package/dist/login.js +58 -8
  46. package/dist/materialPackage.d.ts +52 -0
  47. package/dist/materialPackage.js +401 -0
  48. package/dist/materialSnapshot.d.ts +54 -0
  49. package/dist/materialSnapshot.js +370 -0
  50. package/dist/memoryEventMirror.d.ts +23 -0
  51. package/dist/memoryEventMirror.js +140 -0
  52. package/dist/migrate/fieldMap.js +25 -0
  53. package/dist/migrate/v1Import.d.ts +7 -1
  54. package/dist/migrate/v1Import.js +132 -11
  55. package/dist/nonGitWorkspaceNotice.d.ts +24 -0
  56. package/dist/nonGitWorkspaceNotice.js +122 -0
  57. package/dist/proxyToken.d.ts +10 -0
  58. package/dist/proxyToken.js +80 -0
  59. package/dist/recipe.d.ts +12 -2
  60. package/dist/recipe.js +381 -8
  61. package/dist/reuse.d.ts +5 -3
  62. package/dist/reuse.js +74 -6
  63. package/dist/reuseReport.js +16 -16
  64. package/dist/runtimeCapabilities.d.ts +18 -0
  65. package/dist/runtimeCapabilities.js +81 -0
  66. package/dist/runtimeSessionSource.d.ts +10 -0
  67. package/dist/runtimeSessionSource.js +32 -5
  68. package/dist/setupHooks.d.ts +11 -1
  69. package/dist/setupHooks.js +235 -16
  70. package/dist/skill2gep.d.ts +38 -9
  71. package/dist/skill2gep.js +147 -14
  72. package/dist/skillDistill.d.ts +1 -0
  73. package/dist/skillDistill.js +4 -4
  74. package/dist/skillFetch.d.ts +18 -0
  75. package/dist/skillFetch.js +391 -0
  76. package/dist/solo/mode.js +5 -0
  77. package/dist/sync.d.ts +38 -0
  78. package/dist/sync.js +1981 -0
  79. package/dist/trajectoryExport.js +23 -12
  80. package/dist/v1Compat.d.ts +24 -0
  81. package/dist/v1Compat.js +249 -0
  82. package/dist/workflow.d.ts +39 -0
  83. package/dist/workflow.js +386 -0
  84. package/dist/workflowRuntime.d.ts +66 -0
  85. package/dist/workflowRuntime.js +631 -0
  86. package/package.json +12 -6
@@ -1,10 +1,13 @@
1
+ import { createHash } from 'node:crypto';
1
2
  import { createReadStream } from 'node:fs';
2
- import { existsSync, mkdirSync, appendFileSync, copyFileSync } from 'node:fs';
3
- import { join, dirname } from 'node:path';
3
+ import { appendFileSync, closeSync, constants, existsSync, fstatSync, fsyncSync, linkSync, lstatSync, mkdirSync, openSync, readSync, realpathSync, unlinkSync, writeFileSync, writeSync, } from 'node:fs';
4
+ import { basename, dirname, join, resolve, sep } from 'node:path';
4
5
  import { assetstore } from '@evomap/evolver-core';
5
6
  import { mapV1Asset } from './fieldMap.js';
7
+ import { LocalMemoryGraph, MemoryGraphBusyError, MemoryGraphImportStateRejectedError, resolveLocalMemoryUserId, } from '../localMemoryGraph.js';
6
8
  const FILES = { Gene: 'genes.jsonl', Capsule: 'capsules.jsonl', EvolutionEvent: 'events.jsonl' };
7
9
  const DEFAULT_IMPORT_JSONL_MAX_LINE_BYTES = 16 * 1024 * 1024;
10
+ let migrationArchiveNonce = 0;
8
11
  function maxJsonlLineBytes() {
9
12
  const raw = Number(process.env['EVOLVER_IMPORT_JSONL_MAX_LINE_BYTES']);
10
13
  return Number.isFinite(raw) && raw > 0 ? Math.floor(raw) : DEFAULT_IMPORT_JSONL_MAX_LINE_BYTES;
@@ -71,15 +74,11 @@ async function* readJsonl(path) {
71
74
  for (const record of finish())
72
75
  yield record;
73
76
  }
74
- /**
75
- * v1→v2 只读迁移(M8-2). 只读 v1(无双写); 冻结存量 asset_id; 非 schema 字段(avoid)落 sidecar;
76
- * memory_graph 不强转(语义不符)→ 归档只读; candidates 候选池不属 wire 资产 → 跳过.
77
- */
78
- export async function importV1(v1Dir, store, outDir) {
77
+ export async function importV1(v1Dir, store, outDir, options = {}) {
79
78
  const sidecarPath = join(outDir, 'migration', 'v1_extensions.jsonl');
80
79
  const rep = {
81
80
  imported: { Gene: 0, Capsule: 0, EvolutionEvent: 0 }, frozen: 0, recomputed: 0, deduped: 0,
82
- sidecarExtensions: 0, memoryGraphArchived: false, candidatesSkipped: false,
81
+ sidecarExtensions: 0, memoryGraphArchived: false, memoryGraphImported: 0, memoryGraphDeferred: false, candidatesSkipped: false,
83
82
  };
84
83
  const gepDir = join(v1Dir, 'assets', 'gep');
85
84
  for (const kind of ['Gene', 'Capsule', 'EvolutionEvent']) {
@@ -103,16 +102,138 @@ export async function importV1(v1Dir, store, outDir) {
103
102
  }
104
103
  }
105
104
  }
106
- // memory_graph: 不迁移成 EvolutionEvent(缺 required + 无 intent/genes_used 语义, 强转=污染谱系). 归档只读.
105
+ // memory_graph remains a sidecar: never convert it into EvolutionEvent or mutate Gene/Capsule identity.
107
106
  const mg = join(v1Dir, 'memory', 'evolution', 'memory_graph.jsonl');
108
- if (existsSync(mg)) {
107
+ if (secureRegularFileWithin(v1Dir, mg)) {
109
108
  const dest = join(outDir, 'migration', 'legacy_memory_graph.jsonl');
110
109
  mkdirSync(dirname(dest), { recursive: true });
111
- copyFileSync(mg, dest);
110
+ archiveRegularFile(mg, dest);
112
111
  rep.memoryGraphArchived = true;
112
+ const workspace = options.workspace ? canonicalDirectory(options.workspace) : null;
113
+ if (!workspace) {
114
+ rep.memoryGraphDeferred = true;
115
+ }
116
+ else {
117
+ const source = realpathSync(mg);
118
+ const userId = options.userId ?? resolveLocalMemoryUserId();
119
+ const marker = scopedMemoryGraphMarker(outDir, workspace, userId, source);
120
+ if (!existsSync(marker)) {
121
+ const graph = new LocalMemoryGraph({ dir: join(outDir, 'evolution'), userId });
122
+ try {
123
+ for await (const record of readJsonl(mg)) {
124
+ if (graph.importV1Outcome(workspace, record, source))
125
+ rep.memoryGraphImported += 1;
126
+ }
127
+ }
128
+ catch (error) {
129
+ if (!(error instanceof MemoryGraphImportStateRejectedError) && !(error instanceof MemoryGraphBusyError))
130
+ throw error;
131
+ rep.memoryGraphDeferred = true;
132
+ }
133
+ if (!rep.memoryGraphDeferred)
134
+ writeFileSync(marker, `${rep.memoryGraphImported}\n`, { mode: 0o600 });
135
+ }
136
+ }
113
137
  }
114
138
  // candidates 候选池非 wire 资产 → 不迁移(留作 selection 输入)
115
139
  if (existsSync(join(gepDir, 'candidates.jsonl')))
116
140
  rep.candidatesSkipped = true;
117
141
  return rep;
142
+ }
143
+ function canonicalDirectory(path) {
144
+ try {
145
+ const absolute = resolve(path);
146
+ const stat = lstatSync(absolute);
147
+ return stat.isDirectory() && !stat.isSymbolicLink() ? realpathSync(absolute) : null;
148
+ }
149
+ catch {
150
+ return null;
151
+ }
152
+ }
153
+ function scopedMemoryGraphMarker(outDir, workspace, userId, source) {
154
+ const scope = createHash('sha256').update(JSON.stringify({ workspace, userId, source })).digest('hex');
155
+ return join(outDir, 'migration', `v1_memory_graph_import.${scope}.complete`);
156
+ }
157
+ function secureRegularFileWithin(root, path) {
158
+ try {
159
+ const absoluteRoot = resolve(root);
160
+ const absolutePath = resolve(path);
161
+ const rootStat = lstatSync(absoluteRoot);
162
+ const fileStat = lstatSync(absolutePath);
163
+ if (!rootStat.isDirectory() || rootStat.isSymbolicLink() || !fileStat.isFile() || fileStat.isSymbolicLink())
164
+ return false;
165
+ const canonicalRoot = realpathSync(absoluteRoot);
166
+ const canonicalPath = realpathSync(absolutePath);
167
+ return canonicalPath.startsWith(canonicalRoot.endsWith(sep) ? canonicalRoot : `${canonicalRoot}${sep}`);
168
+ }
169
+ catch {
170
+ return false;
171
+ }
172
+ }
173
+ function archiveRegularFile(source, destination) {
174
+ if (existsSync(destination)) {
175
+ const existing = lstatSync(destination);
176
+ if (!existing.isFile() || existing.isSymbolicLink())
177
+ throw new Error('memory_graph_archive_path_rejected');
178
+ return;
179
+ }
180
+ const sourceFd = openSync(source, constants.O_RDONLY | constants.O_NOFOLLOW);
181
+ const temp = join(dirname(destination), `.${basename(destination)}.${process.pid}.${Date.now()}.${migrationArchiveNonce++}.tmp`);
182
+ let tempFd;
183
+ let copyError;
184
+ try {
185
+ if (!fstatSync(sourceFd).isFile())
186
+ throw new Error('memory_graph_source_path_rejected');
187
+ tempFd = openSync(temp, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW, 0o600);
188
+ const buffer = Buffer.alloc(64 * 1024);
189
+ for (;;) {
190
+ const bytesRead = readSync(sourceFd, buffer, 0, buffer.length, null);
191
+ if (bytesRead === 0)
192
+ break;
193
+ let offset = 0;
194
+ while (offset < bytesRead)
195
+ offset += writeSync(tempFd, buffer, offset, bytesRead - offset);
196
+ }
197
+ fsyncSync(tempFd);
198
+ }
199
+ catch (error) {
200
+ copyError = error;
201
+ }
202
+ finally {
203
+ closeSync(sourceFd);
204
+ if (tempFd !== undefined)
205
+ closeSync(tempFd);
206
+ }
207
+ if (copyError !== undefined) {
208
+ try {
209
+ if (existsSync(temp))
210
+ unlinkSync(temp);
211
+ }
212
+ catch {
213
+ // Preserve the source/copy failure; cleanup is best-effort.
214
+ }
215
+ throw copyError;
216
+ }
217
+ try {
218
+ if (existsSync(destination)) {
219
+ const existing = lstatSync(destination);
220
+ if (!existing.isFile() || existing.isSymbolicLink())
221
+ throw new Error('memory_graph_archive_path_rejected');
222
+ unlinkSync(temp);
223
+ return;
224
+ }
225
+ // A same-directory hard link publishes without replacing a path created by a concurrent process.
226
+ linkSync(temp, destination);
227
+ unlinkSync(temp);
228
+ }
229
+ catch (error) {
230
+ try {
231
+ if (existsSync(temp))
232
+ unlinkSync(temp);
233
+ }
234
+ catch {
235
+ // Preserve the publication failure; cleanup is best-effort.
236
+ }
237
+ throw error;
238
+ }
118
239
  }
@@ -0,0 +1,24 @@
1
+ type GitWorkspaceStatus = 'git' | 'non_git' | 'unknown';
2
+ export declare const NON_GIT_WORKSPACE_NOTICE_THROTTLE_MS: number;
3
+ export interface NonGitWorkspaceNoticeOptions {
4
+ cwd?: string;
5
+ statePath?: string;
6
+ now?: () => number;
7
+ throttleMs?: number;
8
+ detect?: (cwd: string) => GitWorkspaceStatus;
9
+ write?: (line: string) => void;
10
+ }
11
+ interface NonGitWorkspaceNoticeResult {
12
+ status: GitWorkspaceStatus;
13
+ emitted: boolean;
14
+ workspaceHash?: string;
15
+ }
16
+ type GitProbe = (file: string, args: readonly string[], options: {
17
+ encoding: 'utf8';
18
+ stdio: readonly ['ignore', 'pipe', 'pipe'];
19
+ timeout: number;
20
+ windowsHide: true;
21
+ }) => string;
22
+ export declare function detectGitWorkspace(cwd?: string, gitProbe?: GitProbe): GitWorkspaceStatus;
23
+ export declare function maybeEmitNonGitWorkspaceNotice(options?: NonGitWorkspaceNoticeOptions): NonGitWorkspaceNoticeResult;
24
+ export {};
@@ -0,0 +1,122 @@
1
+ import { execFileSync } from 'node:child_process';
2
+ import { createHash } from 'node:crypto';
3
+ import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
4
+ import { dirname, join, parse, resolve } from 'node:path';
5
+ import { events } from '@evomap/evolver-core';
6
+ export const NON_GIT_WORKSPACE_NOTICE_THROTTLE_MS = 24 * 60 * 60 * 1000;
7
+ const NON_GIT_WORKSPACE_NOTICE = '[evolver] This workspace is not a git repository; Evolver will still run, but recording, recall, and rollback context may be limited. Run from a project root or initialize git for full context.\n';
8
+ const GIT_DETECT_TIMEOUT_MS = 500;
9
+ function nonGitWorkspaceNoticeStatePath() {
10
+ return join(events.evomapHome(), 'evolution', 'non-git-workspace-notice.json');
11
+ }
12
+ function hasGitMarkerAncestor(cwd) {
13
+ let cur = resolve(cwd);
14
+ const root = parse(cur).root;
15
+ for (;;) {
16
+ if (existsSync(join(cur, '.git')))
17
+ return true;
18
+ if (cur === root)
19
+ return false;
20
+ cur = dirname(cur);
21
+ }
22
+ }
23
+ export function detectGitWorkspace(cwd = process.cwd(), gitProbe = execFileSync) {
24
+ try {
25
+ const out = gitProbe('git', ['-C', cwd, 'rev-parse', '--is-inside-work-tree'], {
26
+ encoding: 'utf8',
27
+ stdio: ['ignore', 'pipe', 'pipe'],
28
+ timeout: GIT_DETECT_TIMEOUT_MS,
29
+ windowsHide: true,
30
+ }).trim();
31
+ if (out === 'true')
32
+ return 'git';
33
+ if (out === 'false')
34
+ return 'unknown';
35
+ return 'unknown';
36
+ }
37
+ catch (error) {
38
+ const err = error;
39
+ const stderr = Buffer.isBuffer(err.stderr) ? err.stderr.toString('utf8') : typeof err.stderr === 'string' ? err.stderr : '';
40
+ const msg = `${stderr} ${typeof err.message === 'string' ? err.message : ''}`;
41
+ if (err.status === 128) {
42
+ if (hasGitMarkerAncestor(cwd))
43
+ return 'unknown';
44
+ if (/not a git repository|not a git repo/i.test(msg))
45
+ return 'non_git';
46
+ return 'non_git';
47
+ }
48
+ return 'unknown';
49
+ }
50
+ }
51
+ function workspaceHash(cwd) {
52
+ const normalized = resolve(cwd);
53
+ return createHash('sha256').update(normalized).digest('hex');
54
+ }
55
+ function readState(path) {
56
+ try {
57
+ const parsed = JSON.parse(readFileSync(path, 'utf8'));
58
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
59
+ return { version: 1, workspaces: {} };
60
+ const workspaces = parsed.workspaces;
61
+ if (!workspaces || typeof workspaces !== 'object' || Array.isArray(workspaces))
62
+ return { version: 1, workspaces: {} };
63
+ const out = {};
64
+ for (const [key, value] of Object.entries(workspaces)) {
65
+ if (!/^[a-f0-9]{64}$/.test(key))
66
+ continue;
67
+ if (!value || typeof value !== 'object' || Array.isArray(value))
68
+ continue;
69
+ const lastNotifiedAt = value.lastNotifiedAt;
70
+ if (typeof lastNotifiedAt === 'string')
71
+ out[key] = { lastNotifiedAt };
72
+ }
73
+ return { version: 1, workspaces: out };
74
+ }
75
+ catch {
76
+ return { version: 1, workspaces: {} };
77
+ }
78
+ }
79
+ function writeStateBestEffort(path, state) {
80
+ try {
81
+ mkdirSync(dirname(path), { recursive: true, mode: 0o700 });
82
+ const tmp = `${path}.${process.pid}.${Date.now()}.tmp`;
83
+ writeFileSync(tmp, `${JSON.stringify(state, null, 2)}\n`, { encoding: 'utf8', mode: 0o600 });
84
+ renameSync(tmp, path);
85
+ }
86
+ catch {
87
+ // The notice is operator UX only; state persistence must never break hooks.
88
+ }
89
+ }
90
+ function isThrottled(lastNotifiedAt, now, throttleMs) {
91
+ if (!lastNotifiedAt)
92
+ return false;
93
+ const previous = Date.parse(lastNotifiedAt);
94
+ if (!Number.isFinite(previous))
95
+ return false;
96
+ return now - previous < throttleMs;
97
+ }
98
+ export function maybeEmitNonGitWorkspaceNotice(options = {}) {
99
+ const cwd = options.cwd ?? process.cwd();
100
+ const detect = options.detect ?? detectGitWorkspace;
101
+ const status = detect(cwd);
102
+ if (status !== 'non_git')
103
+ return { status, emitted: false };
104
+ const now = options.now ? options.now() : Date.now();
105
+ const throttleMs = options.throttleMs ?? NON_GIT_WORKSPACE_NOTICE_THROTTLE_MS;
106
+ const statePath = options.statePath ?? nonGitWorkspaceNoticeStatePath();
107
+ const hash = workspaceHash(cwd);
108
+ const state = readState(statePath);
109
+ if (isThrottled(state.workspaces[hash]?.lastNotifiedAt, now, throttleMs)) {
110
+ return { status, emitted: false, workspaceHash: hash };
111
+ }
112
+ const write = options.write ?? ((line) => process.stderr.write(line));
113
+ try {
114
+ write(NON_GIT_WORKSPACE_NOTICE);
115
+ }
116
+ catch {
117
+ return { status, emitted: false, workspaceHash: hash };
118
+ }
119
+ state.workspaces[hash] = { lastNotifiedAt: new Date(now).toISOString() };
120
+ writeStateBestEffort(statePath, state);
121
+ return { status, emitted: true, workspaceHash: hash };
122
+ }
@@ -0,0 +1,10 @@
1
+ import { lstatSync, readFileSync } from 'node:fs';
2
+ export interface ProxyTokenDeps {
3
+ env?: Record<string, string | undefined>;
4
+ stdout?: (text: string) => void;
5
+ stderr?: (text: string) => void;
6
+ homeDir?: string;
7
+ lstat?: typeof lstatSync;
8
+ readFile?: typeof readFileSync;
9
+ }
10
+ export declare function runProxyToken(argv: readonly string[], deps?: ProxyTokenDeps): Promise<number>;
@@ -0,0 +1,80 @@
1
+ import { lstatSync, readFileSync } from 'node:fs';
2
+ import { homedir } from 'node:os';
3
+ import { join } from 'node:path';
4
+ const USAGE = 'Usage: evolver proxy-token [--settings FILE]\n';
5
+ function proxyTokenUsage() {
6
+ return USAGE;
7
+ }
8
+ function resolveProxyTokenSettingsPath(env = process.env, homeDir = homedir(), explicitSettings) {
9
+ const explicit = explicitSettings?.trim();
10
+ if (explicit)
11
+ return explicit;
12
+ const proxySettingsFile = env['EVOLVER_PROXY_SETTINGS_FILE']?.trim();
13
+ if (proxySettingsFile)
14
+ return proxySettingsFile;
15
+ const settingsDir = env['EVOLVER_SETTINGS_DIR']?.trim() || join(homeDir, '.evolver');
16
+ return join(settingsDir, 'settings.json');
17
+ }
18
+ function readProxyTokenFromSettingsFile(settingsPath, deps = {}) {
19
+ const stat = deps.lstat ?? lstatSync;
20
+ const read = deps.readFile ?? readFileSync;
21
+ try {
22
+ if (!stat(settingsPath).isFile())
23
+ return undefined;
24
+ const parsed = JSON.parse(read(settingsPath, 'utf8'));
25
+ const proxy = recordValue(recordValue(parsed)['proxy']);
26
+ const token = typeof proxy['token'] === 'string' ? proxy['token'].trim() : '';
27
+ return token || undefined;
28
+ }
29
+ catch {
30
+ return undefined;
31
+ }
32
+ }
33
+ export async function runProxyToken(argv, deps = {}) {
34
+ const stdout = deps.stdout ?? ((text) => { process.stdout.write(text); });
35
+ const stderr = deps.stderr ?? ((text) => { process.stderr.write(text); });
36
+ const env = deps.env ?? process.env;
37
+ let settingsFile;
38
+ for (let i = 0; i < argv.length; i++) {
39
+ const arg = argv[i];
40
+ if (arg === '-h' || arg === '--help') {
41
+ stdout(proxyTokenUsage());
42
+ return 0;
43
+ }
44
+ if (arg === '--settings') {
45
+ const value = argv[i + 1];
46
+ if (value === undefined || value.length === 0) {
47
+ stderr(USAGE);
48
+ stderr('[proxy-token] missing value for --settings\n');
49
+ return 2;
50
+ }
51
+ settingsFile = value;
52
+ i++;
53
+ continue;
54
+ }
55
+ if (arg?.startsWith('--settings=')) {
56
+ const value = arg.slice('--settings='.length);
57
+ if (!value) {
58
+ stderr(USAGE);
59
+ stderr('[proxy-token] missing value for --settings\n');
60
+ return 2;
61
+ }
62
+ settingsFile = value;
63
+ continue;
64
+ }
65
+ stderr(USAGE);
66
+ stderr('[proxy-token] unknown argument\n');
67
+ return 2;
68
+ }
69
+ const path = resolveProxyTokenSettingsPath(env, deps.homeDir ?? homedir(), settingsFile);
70
+ const token = readProxyTokenFromSettingsFile(path, deps);
71
+ if (!token) {
72
+ stderr('[proxy-token] no active proxy token found; start evolver-proxy first\n');
73
+ return 1;
74
+ }
75
+ stdout(`${token}\n`);
76
+ return 0;
77
+ }
78
+ function recordValue(value) {
79
+ return value && typeof value === 'object' && !Array.isArray(value) ? value : {};
80
+ }
package/dist/recipe.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { assetstore, type hub as hubNs } from '@evomap/evolver-core';
1
+ import { assetstore, events, type hub as hubNs } from '@evomap/evolver-core';
2
2
  import type { ConnectPublicOptions, PublicHubCapability } from '@evomap/evolver-adapter-public';
3
3
  export interface RecipeCliDeps {
4
4
  hub?: RecipeHub;
@@ -6,6 +6,8 @@ export interface RecipeCliDeps {
6
6
  env?: NodeJS.ProcessEnv;
7
7
  log?: (line: string) => void;
8
8
  err?: (line: string) => void;
9
+ ingestor?: events.Ingestor;
10
+ review?: assetstore.ReviewLedger;
9
11
  connectHub?: (opts: ConnectPublicOptions) => {
10
12
  hub: PublicHubCapability;
11
13
  auth: hubNs.AuthProvider;
@@ -42,12 +44,20 @@ export interface RecipeReuseOptions {
42
44
  inputPayload: Record<string, unknown>;
43
45
  jsonOut: boolean;
44
46
  }
45
- export type RecipeOptions = RecipeBuildOptions | RecipeReuseOptions;
47
+ export interface RecipeFromSkillsOptions {
48
+ sub: 'from-skills';
49
+ manifestPath: string;
50
+ publish: boolean;
51
+ jsonOut: boolean;
52
+ }
53
+ export type RecipeOptions = RecipeBuildOptions | RecipeReuseOptions | RecipeFromSkillsOptions;
46
54
  export declare function runRecipeCommand(argv: readonly string[], deps?: RecipeCliDeps): Promise<number>;
47
55
  export declare function createRecipeHubFromEnv(env?: NodeJS.ProcessEnv, connectHub?: (opts: ConnectPublicOptions) => {
48
56
  hub: PublicHubCapability;
49
57
  auth: hubNs.AuthProvider;
50
58
  }): PublicHubCapability;
59
+ /** Opaque identity for resume isolation; raw credentials, account ids, and local paths never leave this helper. */
60
+ export declare function resolveRecipeHubResumeIdentityFingerprint(env: NodeJS.ProcessEnv): string;
51
61
  export declare function parseRecipeArgs(argv: readonly string[]): ParseResult<RecipeOptions>;
52
62
  /**
53
63
  * The EXPLICIT home overrides (EVOMAP_DIR / EVOLVER_HOME / EVOMAP_HOME) the recipe credential layer honors,