@evomap/evolver-cli 2.0.0-beta.9 → 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/antiGeneBenchmark.js +2 -0
- package/dist/antiGeneRollout.js +9 -3
- package/dist/assetHealth.js +2 -0
- package/dist/assetTrust.js +14 -1
- package/dist/atp.d.ts +10 -5
- package/dist/atp.js +119 -26
- package/dist/atpAutoBuyer.d.ts +120 -0
- package/dist/atpAutoBuyer.js +814 -0
- package/dist/atpAutoDeliver.js +2 -2
- package/dist/autoDistillLlm.js +2 -1
- package/dist/autoDistillTranscript.js +3 -2
- package/dist/autoexec.d.ts +101 -13
- package/dist/autoexec.js +794 -91
- package/dist/cli.js +13 -0
- package/dist/cliContracts.d.ts +23 -2
- package/dist/cliContracts.js +504 -54
- package/dist/commands.d.ts +1 -0
- package/dist/commands.js +1 -0
- package/dist/curriculumCapabilityGaps.d.ts +6 -0
- package/dist/curriculumCapabilityGaps.js +24 -0
- package/dist/cycleConsumer.d.ts +13 -0
- package/dist/cycleConsumer.js +186 -20
- package/dist/dashboard.js +47 -9
- package/dist/dispatch.js +8 -2
- package/dist/distillPrimitives.d.ts +3 -2
- package/dist/distillPrimitives.js +80 -12
- package/dist/doctor.js +120 -11
- package/dist/identityHome.d.ts +9 -0
- package/dist/identityHome.js +47 -0
- package/dist/index.d.ts +70 -40
- package/dist/index.js +581 -193
- package/dist/learningTrace.d.ts +15 -0
- package/dist/learningTrace.js +73 -0
- package/dist/lifecycle.d.ts +67 -1
- package/dist/lifecycle.js +738 -44
- package/dist/localMemoryGraph.d.ts +90 -3
- package/dist/localMemoryGraph.js +2031 -231
- package/dist/login.d.ts +1 -1
- package/dist/login.js +3 -3
- package/dist/materialSnapshot.d.ts +9 -1
- package/dist/materialSnapshot.js +23 -6
- package/dist/memoryGraphOps.d.ts +8 -0
- package/dist/memoryGraphOps.js +140 -0
- package/dist/migrate/assetFormatMap.d.ts +61 -0
- package/dist/migrate/assetFormatMap.js +53 -0
- package/dist/migrate/envTranslate.d.ts +26 -0
- package/dist/migrate/envTranslate.js +147 -0
- package/dist/migrate/fieldMap.d.ts +4 -2
- package/dist/migrate/fieldMap.js +9 -5
- package/dist/migrate/oauthImport.d.ts +66 -0
- package/dist/migrate/oauthImport.js +667 -0
- package/dist/migrate/v1Import.d.ts +92 -1
- package/dist/migrate/v1Import.js +1481 -141
- package/dist/promptRecallHook.d.ts +24 -0
- package/dist/promptRecallHook.js +425 -0
- package/dist/recallVerifyReport.d.ts +37 -0
- package/dist/recallVerifyReport.js +244 -0
- package/dist/recipe.d.ts +7 -1
- package/dist/recipe.js +426 -56
- package/dist/requiredSandboxValidation.d.ts +5 -0
- package/dist/requiredSandboxValidation.js +4 -0
- package/dist/reuse.d.ts +9 -0
- package/dist/reuse.js +151 -56
- package/dist/runtimeCapabilities.js +15 -15
- package/dist/runtimeSessionSource.d.ts +3 -2
- package/dist/runtimeSessionSource.js +63 -11
- package/dist/selectionPolicyConfig.d.ts +8 -0
- package/dist/selectionPolicyConfig.js +18 -0
- package/dist/semanticIdfConfig.d.ts +2 -0
- package/dist/semanticIdfConfig.js +4 -0
- package/dist/sessionIngest.d.ts +37 -0
- package/dist/sessionIngest.js +156 -0
- package/dist/setupHooks.js +95 -1
- package/dist/skill2gep.d.ts +13 -9
- package/dist/skill2gep.js +42 -30
- package/dist/skillDistill.d.ts +8 -4
- package/dist/skillDistill.js +38 -9
- package/dist/solo/mode.js +1 -0
- package/dist/sync.d.ts +12 -0
- package/dist/sync.js +1246 -151
- package/dist/thesis.d.ts +1 -1
- package/dist/thesis.js +20 -3
- package/dist/trajectoryExport.js +21 -3
- package/dist/v1Compat.d.ts +1 -0
- package/dist/v1Compat.js +9 -0
- package/dist/workflowRuntime.js +24 -18
- package/package.json +11 -8
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { trace } from '@evomap/evolver-core';
|
|
2
|
+
export interface LearningTraceWiring {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
upload: 'on' | 'off' | 'no_credentials';
|
|
5
|
+
config: {
|
|
6
|
+
packetSink: trace.LearningPacketSink;
|
|
7
|
+
traceSink?: trace.TraceSink;
|
|
8
|
+
sourceRepo?: string;
|
|
9
|
+
proxyTraces?: {
|
|
10
|
+
dir: string;
|
|
11
|
+
readOptions?: trace.TraceReadOptions;
|
|
12
|
+
};
|
|
13
|
+
} | null;
|
|
14
|
+
}
|
|
15
|
+
export declare function resolveLearningTrace(env?: NodeJS.ProcessEnv): LearningTraceWiring;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Learning-trace wiring for the autoexec daemon (Learning Ops slices 2+3). Local file sinks are the
|
|
2
|
+
// always-on durability layer — per-run LearningPacket drafts land under ~/.evomap/evolution/learning-trace/
|
|
3
|
+
// (kill switch: EVOLVER_LEARNING_TRACE=0). Hub upload (slice 3) is opt-in via EVOLVER_LEARNING_TRACE_UPLOAD=1
|
|
4
|
+
// and rides the same OAuth credential as the other hub links; when enabled + credentialed, packets are teed
|
|
5
|
+
// file-first then uploaded best-effort, so a hub outage never loses the local record or affects a verdict.
|
|
6
|
+
import { events, trace } from '@evomap/evolver-core';
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
import { homedir } from 'node:os';
|
|
9
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
10
|
+
import { HubLearningPacketSink, TeeLearningPacketSink, connectPublicHub, resolveHubUrl, globalFetchLike, } from '@evomap/evolver-adapter-public';
|
|
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
|
+
}
|
|
27
|
+
function resolveHubUpload(env) {
|
|
28
|
+
if (env['EVOLVER_LEARNING_TRACE_UPLOAD'] !== '1')
|
|
29
|
+
return { sink: null, state: 'off' };
|
|
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');
|
|
36
|
+
if (!existsSync(join(dir, 'token.json')))
|
|
37
|
+
return { sink: null, state: 'no_credentials' };
|
|
38
|
+
try {
|
|
39
|
+
const hubUrl = resolveHubUrl(env);
|
|
40
|
+
const senderId = resolveAtpSenderId(env);
|
|
41
|
+
const { auth } = connectPublicHub({ hubUrl, authMode: 'oauth', evomapDir: dir, senderId: () => senderId });
|
|
42
|
+
return {
|
|
43
|
+
sink: new HubLearningPacketSink({ baseUrl: hubUrl, auth, fetchFn: globalFetchLike, nodeId: () => senderId }),
|
|
44
|
+
state: 'on',
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return { sink: null, state: 'no_credentials' };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export function resolveLearningTrace(env = process.env) {
|
|
52
|
+
if (env['EVOLVER_LEARNING_TRACE'] === '0')
|
|
53
|
+
return { enabled: false, upload: 'off', config: null };
|
|
54
|
+
const dir = events.learningTraceDir(env);
|
|
55
|
+
const fileSink = new trace.FileLearningPacketSink(dir);
|
|
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);
|
|
60
|
+
return {
|
|
61
|
+
enabled: true,
|
|
62
|
+
upload: upload.state,
|
|
63
|
+
config: {
|
|
64
|
+
packetSink: upload.sink ? new TeeLearningPacketSink(fileSink, upload.sink) : fileSink,
|
|
65
|
+
traceSink: new trace.FileTraceSink(join(dir, 'trace-events.jsonl')),
|
|
66
|
+
sourceRepo: 'evolver-v2',
|
|
67
|
+
proxyTraces: {
|
|
68
|
+
dir: events.tracesDir(env),
|
|
69
|
+
...(nodeSecret ? { readOptions: { nodeSecret } } : {}),
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
package/dist/lifecycle.d.ts
CHANGED
|
@@ -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,13 +34,38 @@ export interface LifecycleResult {
|
|
|
33
34
|
logFile?: string;
|
|
34
35
|
files?: string[];
|
|
35
36
|
service?: string;
|
|
37
|
+
autoexecHome?: string;
|
|
38
|
+
actions?: string[];
|
|
36
39
|
}
|
|
40
|
+
type UnixRecoveryControllerModule = Pick<typeof import('@evomap/evolver-proxy'), 'provisionStableUnixRecoveryController' | 'stableUnixRecoveryControllerPathForTarget' | 'UNIX_RECOVERY_CONTROLLER_ARG'>;
|
|
41
|
+
type LoadUnixRecoveryController = () => Promise<UnixRecoveryControllerModule>;
|
|
37
42
|
interface RunLifecycleDeps {
|
|
38
43
|
argv1?: string;
|
|
39
44
|
env?: NodeJS.ProcessEnv;
|
|
45
|
+
loadUnixRecoveryController?: LoadUnixRecoveryController;
|
|
46
|
+
removeAutoexecService?: (target: ServiceTarget, dryRun: boolean) => LifecycleResult;
|
|
47
|
+
bootstrap?: BootstrapServiceDeps;
|
|
40
48
|
stdout?: (text: string) => void;
|
|
41
49
|
stderr?: (text: string) => void;
|
|
42
50
|
}
|
|
51
|
+
export interface BootstrapServiceDeps {
|
|
52
|
+
platform?: NodeJS.Platform;
|
|
53
|
+
run?: (command: string, args: readonly string[]) => ServiceControlResult;
|
|
54
|
+
uid?: number;
|
|
55
|
+
install?: (target: ServiceTarget, flags: Record<string, string | true>, env: NodeJS.ProcessEnv, argv1: string | undefined, loadUnixRecoveryController?: LoadUnixRecoveryController) => Promise<LifecycleResult>;
|
|
56
|
+
}
|
|
57
|
+
interface ServiceControlResult {
|
|
58
|
+
status: number | null;
|
|
59
|
+
error?: unknown;
|
|
60
|
+
}
|
|
61
|
+
export interface RemoveAutoexecServiceDeps {
|
|
62
|
+
paths?: Partial<Record<ServiceTarget, string>>;
|
|
63
|
+
run?: (command: string, args: readonly string[]) => ServiceControlResult;
|
|
64
|
+
exists?: (path: string) => boolean;
|
|
65
|
+
remove?: (path: string) => void;
|
|
66
|
+
write?: (path: string, content: string, mode: number) => void;
|
|
67
|
+
uid?: number;
|
|
68
|
+
}
|
|
43
69
|
export type SessionStartSpawn = (command: string, args: readonly string[], options: Parameters<typeof spawn>[2]) => ReturnType<typeof spawn>;
|
|
44
70
|
interface SessionStartAutostartDeps {
|
|
45
71
|
stderr?: (text: string) => void;
|
|
@@ -49,6 +75,7 @@ interface SessionStartAutostartDeps {
|
|
|
49
75
|
export interface StopLifecycleDeps {
|
|
50
76
|
processCommandLine?: (pid: number) => string | undefined;
|
|
51
77
|
processIdentity?: (pid: number) => ProcessIdentity | undefined;
|
|
78
|
+
platform?: NodeJS.Platform;
|
|
52
79
|
}
|
|
53
80
|
export declare function runLifecycleCommand(argv: readonly string[], deps?: RunLifecycleDeps): Promise<number>;
|
|
54
81
|
export declare function maybeAutoRestartProxyForSessionStart(env?: NodeJS.ProcessEnv, argv1?: string | undefined, deps?: SessionStartAutostartDeps): Promise<void>;
|
|
@@ -59,14 +86,30 @@ export declare function lifecycleStatus(paths: LifecyclePaths, env?: NodeJS.Proc
|
|
|
59
86
|
quietSettingsReadError?: boolean;
|
|
60
87
|
stderr?: (text: string) => void;
|
|
61
88
|
}): Promise<LifecycleStatus>;
|
|
89
|
+
/** Extended connection status for `evolver daily`: includes hub_auth_status and last_sync_at from proxy. */
|
|
90
|
+
export interface DailyConnectionStatus extends LifecycleStatus {
|
|
91
|
+
hubAuthStatus?: string;
|
|
92
|
+
lastSyncAt?: string;
|
|
93
|
+
}
|
|
94
|
+
/** Fetch enriched connection status for the daily summary. Builds on lifecycleStatus, adding hub details. */
|
|
95
|
+
export declare function dailyConnectionStatus(paths: LifecyclePaths, env?: NodeJS.ProcessEnv, options?: {
|
|
96
|
+
timeoutMs?: number;
|
|
97
|
+
stderr?: (text: string) => void;
|
|
98
|
+
}): Promise<DailyConnectionStatus>;
|
|
62
99
|
export declare function lifecyclePaths(env?: NodeJS.ProcessEnv): LifecyclePaths;
|
|
63
100
|
export declare function renderSystemdUnit(opts?: {
|
|
64
101
|
envFile?: string;
|
|
65
102
|
workingDirectory?: string;
|
|
66
103
|
execStart?: string;
|
|
104
|
+
lifecycleStateDir?: string;
|
|
67
105
|
selfUpdateStateDir?: string;
|
|
68
106
|
selfUpdateTarget?: string;
|
|
69
107
|
}): string;
|
|
108
|
+
export declare function renderAutoexecSystemdUnit(opts: {
|
|
109
|
+
envFile?: string;
|
|
110
|
+
workingDirectory?: string;
|
|
111
|
+
execStart: string;
|
|
112
|
+
}): string;
|
|
70
113
|
export declare function renderLaunchdPlist(opts?: {
|
|
71
114
|
envFile?: string;
|
|
72
115
|
workingDirectory?: string;
|
|
@@ -74,20 +117,43 @@ export declare function renderLaunchdPlist(opts?: {
|
|
|
74
117
|
proxyBin?: string;
|
|
75
118
|
programArguments?: readonly string[];
|
|
76
119
|
logDir?: string;
|
|
120
|
+
lifecycleStateDir?: string;
|
|
77
121
|
selfUpdateStateDir?: string;
|
|
78
122
|
selfUpdateTarget?: string;
|
|
123
|
+
label?: string;
|
|
124
|
+
logName?: string;
|
|
125
|
+
selfUpdateSupervisor?: boolean;
|
|
126
|
+
}): string;
|
|
127
|
+
export declare function renderAutoexecLaunchdPlist(opts: {
|
|
128
|
+
envFile?: string;
|
|
129
|
+
workingDirectory?: string;
|
|
130
|
+
programArguments: readonly string[];
|
|
131
|
+
logDir?: string;
|
|
79
132
|
}): string;
|
|
80
133
|
export declare function renderWindowsInstaller(defaults?: {
|
|
81
134
|
evolverBin?: string;
|
|
82
135
|
nodePath?: string;
|
|
83
136
|
proxyBin?: string;
|
|
84
137
|
envFile?: string;
|
|
138
|
+
lifecycleStateDir?: string;
|
|
85
139
|
selfUpdateStateDir?: string;
|
|
86
140
|
}): string;
|
|
141
|
+
export declare function renderWindowsAutoexecInstaller(defaults?: {
|
|
142
|
+
evolverBin?: string;
|
|
143
|
+
nodePath?: string;
|
|
144
|
+
cliBin?: string;
|
|
145
|
+
envFile?: string;
|
|
146
|
+
autoexecHome?: string;
|
|
147
|
+
workingDirectory?: string;
|
|
148
|
+
}): string;
|
|
149
|
+
export declare function removeAutoexecService(target: ServiceTarget, dryRun: boolean, deps?: RemoveAutoexecServiceDeps): LifecycleResult;
|
|
87
150
|
export declare function resolveDaemonCommand(env: NodeJS.ProcessEnv, execPath?: string, argv1?: string | undefined): DaemonCommand;
|
|
88
151
|
export declare function resolveSelfUpdatingExecutable(execPath: string, argv1: string | undefined): DaemonCommand | undefined;
|
|
152
|
+
export declare function resolveAutoexecDaemonCommand(env: NodeJS.ProcessEnv, execPath?: string, argv1?: string | undefined, autoexecHome?: string): DaemonCommand | undefined;
|
|
89
153
|
export declare function resolveProxyBinPath(): string | undefined;
|
|
90
154
|
export declare function resolveStableNodePath(): string;
|
|
91
155
|
export declare function sessionStartHookVerboseEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
92
156
|
export declare function proxyExpected(env?: NodeJS.ProcessEnv): boolean;
|
|
157
|
+
declare function writeWindowsHelper(preferredPath: string, content: string): string;
|
|
158
|
+
export declare const _writeWindowsHelperForTest: typeof writeWindowsHelper;
|
|
93
159
|
export {};
|