@evomap/evolver-cli 2.0.0-beta.17 → 2.0.0-beta.19

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 (64) hide show
  1. package/dist/antiGeneRollout.js +7 -3
  2. package/dist/assetTrust.js +14 -1
  3. package/dist/atp.d.ts +8 -3
  4. package/dist/atp.js +82 -11
  5. package/dist/atpAutoBuyer.d.ts +120 -0
  6. package/dist/atpAutoBuyer.js +814 -0
  7. package/dist/atpAutoDeliver.js +2 -2
  8. package/dist/autoDistillLlm.js +2 -1
  9. package/dist/autoDistillTranscript.js +3 -2
  10. package/dist/autoexec.d.ts +90 -13
  11. package/dist/autoexec.js +731 -84
  12. package/dist/cli.js +13 -0
  13. package/dist/cliContracts.d.ts +5 -2
  14. package/dist/cliContracts.js +135 -8
  15. package/dist/commands.d.ts +1 -0
  16. package/dist/commands.js +1 -0
  17. package/dist/curriculumCapabilityGaps.d.ts +6 -0
  18. package/dist/curriculumCapabilityGaps.js +24 -0
  19. package/dist/cycleConsumer.d.ts +4 -0
  20. package/dist/cycleConsumer.js +175 -20
  21. package/dist/dashboard.js +47 -9
  22. package/dist/dispatch.js +6 -2
  23. package/dist/distillPrimitives.js +18 -6
  24. package/dist/doctor.js +63 -5
  25. package/dist/identityHome.js +2 -1
  26. package/dist/index.d.ts +67 -39
  27. package/dist/index.js +504 -185
  28. package/dist/learningTrace.d.ts +4 -0
  29. package/dist/learningTrace.js +30 -3
  30. package/dist/lifecycle.d.ts +54 -1
  31. package/dist/lifecycle.js +489 -37
  32. package/dist/materialSnapshot.d.ts +9 -1
  33. package/dist/materialSnapshot.js +23 -6
  34. package/dist/migrate/envTranslate.d.ts +26 -0
  35. package/dist/migrate/envTranslate.js +145 -0
  36. package/dist/migrate/oauthImport.d.ts +66 -0
  37. package/dist/migrate/oauthImport.js +667 -0
  38. package/dist/migrate/v1Import.d.ts +13 -1
  39. package/dist/migrate/v1Import.js +621 -122
  40. package/dist/promptRecallHook.d.ts +24 -0
  41. package/dist/promptRecallHook.js +425 -0
  42. package/dist/recallVerifyReport.d.ts +37 -0
  43. package/dist/recallVerifyReport.js +244 -0
  44. package/dist/requiredSandboxValidation.d.ts +5 -0
  45. package/dist/requiredSandboxValidation.js +4 -0
  46. package/dist/reuse.d.ts +1 -0
  47. package/dist/reuse.js +45 -37
  48. package/dist/runtimeCapabilities.js +13 -13
  49. package/dist/runtimeSessionSource.d.ts +3 -2
  50. package/dist/runtimeSessionSource.js +63 -11
  51. package/dist/sessionIngest.d.ts +37 -0
  52. package/dist/sessionIngest.js +156 -0
  53. package/dist/setupHooks.js +95 -1
  54. package/dist/skill2gep.d.ts +4 -7
  55. package/dist/skill2gep.js +4 -21
  56. package/dist/solo/mode.js +1 -0
  57. package/dist/sync.js +125 -23
  58. package/dist/thesis.d.ts +1 -1
  59. package/dist/thesis.js +18 -3
  60. package/dist/trajectoryExport.js +21 -3
  61. package/dist/v1Compat.d.ts +1 -0
  62. package/dist/v1Compat.js +9 -0
  63. package/dist/workflowRuntime.js +24 -18
  64. package/package.json +10 -7
@@ -6,6 +6,10 @@ export interface LearningTraceWiring {
6
6
  packetSink: trace.LearningPacketSink;
7
7
  traceSink?: trace.TraceSink;
8
8
  sourceRepo?: string;
9
+ proxyTraces?: {
10
+ dir: string;
11
+ readOptions?: trace.TraceReadOptions;
12
+ };
9
13
  } | null;
10
14
  }
11
15
  export declare function resolveLearningTrace(env?: NodeJS.ProcessEnv): LearningTraceWiring;
@@ -6,13 +6,33 @@
6
6
  import { events, trace } from '@evomap/evolver-core';
7
7
  import { join } from 'node:path';
8
8
  import { homedir } from 'node:os';
9
- import { existsSync } from 'node:fs';
9
+ import { existsSync, readFileSync } from 'node:fs';
10
10
  import { HubLearningPacketSink, TeeLearningPacketSink, connectPublicHub, resolveHubUrl, globalFetchLike, } from '@evomap/evolver-adapter-public';
11
- import { resolveAtpHome, resolveAtpSenderId } from './atp.js';
11
+ import { resolveAtpSenderId } from './atp.js';
12
+ import { resolveIdentityHome } from './identityHome.js';
13
+ /** Same default node-secret resolution as trajectory export: env first, then ~/.evomap/node_secret. Best-effort —
14
+ * without a secret the fold still reads plaintext/metadata-only rows; encrypted envelopes are just skipped. */
15
+ function defaultNodeSecret(env) {
16
+ const envSecret = env['EVOMAP_NODE_SECRET'] ?? env['A2A_NODE_SECRET'];
17
+ if (typeof envSecret === 'string' && envSecret.length > 0)
18
+ return envSecret;
19
+ try {
20
+ const file = join(events.evomapHome(env), 'node_secret');
21
+ if (existsSync(file))
22
+ return readFileSync(file, 'utf8').trim() || undefined;
23
+ }
24
+ catch { /* secretless fold still covers unencrypted rows */ }
25
+ return undefined;
26
+ }
12
27
  function resolveHubUpload(env) {
13
28
  if (env['EVOLVER_LEARNING_TRACE_UPLOAD'] !== '1')
14
29
  return { sink: null, state: 'off' };
15
- const dir = resolveAtpHome(env) ?? join(homedir(), '.evomap');
30
+ const configuredHubMode = env['EVOMAP_HUB_MODE'];
31
+ const publicUploadAllowed = configuredHubMode === undefined
32
+ || configuredHubMode.trim().toLowerCase() === 'public';
33
+ if (!publicUploadAllowed)
34
+ return { sink: null, state: 'off' };
35
+ const dir = resolveIdentityHome(env) ?? join(homedir(), '.evomap');
16
36
  if (!existsSync(join(dir, 'token.json')))
17
37
  return { sink: null, state: 'no_credentials' };
18
38
  try {
@@ -34,6 +54,9 @@ export function resolveLearningTrace(env = process.env) {
34
54
  const dir = events.learningTraceDir(env);
35
55
  const fileSink = new trace.FileLearningPacketSink(dir);
36
56
  const upload = resolveHubUpload(env);
57
+ // Proxy llm_turn fold (slice 5): point the per-run fold at the proxy's trace day-files. Rides the same
58
+ // master switch — if the proxy isn't running the dir is simply empty and the fold is a no-op.
59
+ const nodeSecret = defaultNodeSecret(env);
37
60
  return {
38
61
  enabled: true,
39
62
  upload: upload.state,
@@ -41,6 +64,10 @@ export function resolveLearningTrace(env = process.env) {
41
64
  packetSink: upload.sink ? new TeeLearningPacketSink(fileSink, upload.sink) : fileSink,
42
65
  traceSink: new trace.FileTraceSink(join(dir, 'trace-events.jsonl')),
43
66
  sourceRepo: 'evolver-v2',
67
+ proxyTraces: {
68
+ dir: events.tracesDir(env),
69
+ ...(nodeSecret ? { readOptions: { nodeSecret } } : {}),
70
+ },
44
71
  },
45
72
  };
46
73
  }
@@ -1,4 +1,5 @@
1
1
  import { spawn } from 'node:child_process';
2
+ export type ServiceTarget = 'launchd' | 'systemd' | 'windows';
2
3
  export interface DaemonCommand {
3
4
  command: string;
4
5
  args: string[];
@@ -9,7 +10,7 @@ interface ProcessIdentity {
9
10
  parentPid?: number;
10
11
  startedAt?: number;
11
12
  }
12
- interface LifecyclePaths {
13
+ export interface LifecyclePaths {
13
14
  home: string;
14
15
  stateDir: string;
15
16
  logDir: string;
@@ -33,6 +34,8 @@ export interface LifecycleResult {
33
34
  logFile?: string;
34
35
  files?: string[];
35
36
  service?: string;
37
+ autoexecHome?: string;
38
+ actions?: string[];
36
39
  }
37
40
  type UnixRecoveryControllerModule = Pick<typeof import('@evomap/evolver-proxy'), 'provisionStableUnixRecoveryController' | 'stableUnixRecoveryControllerPathForTarget' | 'UNIX_RECOVERY_CONTROLLER_ARG'>;
38
41
  type LoadUnixRecoveryController = () => Promise<UnixRecoveryControllerModule>;
@@ -40,9 +43,22 @@ interface RunLifecycleDeps {
40
43
  argv1?: string;
41
44
  env?: NodeJS.ProcessEnv;
42
45
  loadUnixRecoveryController?: LoadUnixRecoveryController;
46
+ removeAutoexecService?: (target: ServiceTarget, dryRun: boolean) => LifecycleResult;
43
47
  stdout?: (text: string) => void;
44
48
  stderr?: (text: string) => void;
45
49
  }
50
+ interface ServiceControlResult {
51
+ status: number | null;
52
+ error?: unknown;
53
+ }
54
+ export interface RemoveAutoexecServiceDeps {
55
+ paths?: Partial<Record<ServiceTarget, string>>;
56
+ run?: (command: string, args: readonly string[]) => ServiceControlResult;
57
+ exists?: (path: string) => boolean;
58
+ remove?: (path: string) => void;
59
+ write?: (path: string, content: string, mode: number) => void;
60
+ uid?: number;
61
+ }
46
62
  export type SessionStartSpawn = (command: string, args: readonly string[], options: Parameters<typeof spawn>[2]) => ReturnType<typeof spawn>;
47
63
  interface SessionStartAutostartDeps {
48
64
  stderr?: (text: string) => void;
@@ -52,6 +68,7 @@ interface SessionStartAutostartDeps {
52
68
  export interface StopLifecycleDeps {
53
69
  processCommandLine?: (pid: number) => string | undefined;
54
70
  processIdentity?: (pid: number) => ProcessIdentity | undefined;
71
+ platform?: NodeJS.Platform;
55
72
  }
56
73
  export declare function runLifecycleCommand(argv: readonly string[], deps?: RunLifecycleDeps): Promise<number>;
57
74
  export declare function maybeAutoRestartProxyForSessionStart(env?: NodeJS.ProcessEnv, argv1?: string | undefined, deps?: SessionStartAutostartDeps): Promise<void>;
@@ -62,6 +79,16 @@ export declare function lifecycleStatus(paths: LifecyclePaths, env?: NodeJS.Proc
62
79
  quietSettingsReadError?: boolean;
63
80
  stderr?: (text: string) => void;
64
81
  }): Promise<LifecycleStatus>;
82
+ /** Extended connection status for `evolver daily`: includes hub_auth_status and last_sync_at from proxy. */
83
+ export interface DailyConnectionStatus extends LifecycleStatus {
84
+ hubAuthStatus?: string;
85
+ lastSyncAt?: string;
86
+ }
87
+ /** Fetch enriched connection status for the daily summary. Builds on lifecycleStatus, adding hub details. */
88
+ export declare function dailyConnectionStatus(paths: LifecyclePaths, env?: NodeJS.ProcessEnv, options?: {
89
+ timeoutMs?: number;
90
+ stderr?: (text: string) => void;
91
+ }): Promise<DailyConnectionStatus>;
65
92
  export declare function lifecyclePaths(env?: NodeJS.ProcessEnv): LifecyclePaths;
66
93
  export declare function renderSystemdUnit(opts?: {
67
94
  envFile?: string;
@@ -70,6 +97,11 @@ export declare function renderSystemdUnit(opts?: {
70
97
  selfUpdateStateDir?: string;
71
98
  selfUpdateTarget?: string;
72
99
  }): string;
100
+ export declare function renderAutoexecSystemdUnit(opts: {
101
+ envFile?: string;
102
+ workingDirectory?: string;
103
+ execStart: string;
104
+ }): string;
73
105
  export declare function renderLaunchdPlist(opts?: {
74
106
  envFile?: string;
75
107
  workingDirectory?: string;
@@ -79,6 +111,15 @@ export declare function renderLaunchdPlist(opts?: {
79
111
  logDir?: string;
80
112
  selfUpdateStateDir?: string;
81
113
  selfUpdateTarget?: string;
114
+ label?: string;
115
+ logName?: string;
116
+ selfUpdateSupervisor?: boolean;
117
+ }): string;
118
+ export declare function renderAutoexecLaunchdPlist(opts: {
119
+ envFile?: string;
120
+ workingDirectory?: string;
121
+ programArguments: readonly string[];
122
+ logDir?: string;
82
123
  }): string;
83
124
  export declare function renderWindowsInstaller(defaults?: {
84
125
  evolverBin?: string;
@@ -87,10 +128,22 @@ export declare function renderWindowsInstaller(defaults?: {
87
128
  envFile?: string;
88
129
  selfUpdateStateDir?: string;
89
130
  }): string;
131
+ export declare function renderWindowsAutoexecInstaller(defaults?: {
132
+ evolverBin?: string;
133
+ nodePath?: string;
134
+ cliBin?: string;
135
+ envFile?: string;
136
+ autoexecHome?: string;
137
+ workingDirectory?: string;
138
+ }): string;
139
+ export declare function removeAutoexecService(target: ServiceTarget, dryRun: boolean, deps?: RemoveAutoexecServiceDeps): LifecycleResult;
90
140
  export declare function resolveDaemonCommand(env: NodeJS.ProcessEnv, execPath?: string, argv1?: string | undefined): DaemonCommand;
91
141
  export declare function resolveSelfUpdatingExecutable(execPath: string, argv1: string | undefined): DaemonCommand | undefined;
142
+ export declare function resolveAutoexecDaemonCommand(env: NodeJS.ProcessEnv, execPath?: string, argv1?: string | undefined, autoexecHome?: string): DaemonCommand | undefined;
92
143
  export declare function resolveProxyBinPath(): string | undefined;
93
144
  export declare function resolveStableNodePath(): string;
94
145
  export declare function sessionStartHookVerboseEnabled(env?: NodeJS.ProcessEnv): boolean;
95
146
  export declare function proxyExpected(env?: NodeJS.ProcessEnv): boolean;
147
+ declare function writeWindowsHelper(preferredPath: string, content: string): string;
148
+ export declare const _writeWindowsHelperForTest: typeof writeWindowsHelper;
96
149
  export {};