@evomap/evolver-core 2.0.0-beta.18 → 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.
- package/dist/algo/candidateAssembly.js +21 -2
- package/dist/algo/cycleEngine.d.ts +12 -0
- package/dist/algo/cycleEngine.js +36 -4
- package/dist/algo/geneHealth.d.ts +2 -2
- package/dist/algo/geneHealth.js +5 -4
- package/dist/algo/geneSelection.d.ts +1 -1
- package/dist/algo/orchestrator.js +9 -2
- package/dist/assetstore/assetSidecarRecords.js +4 -0
- package/dist/assetstore/assetStoreHealth.js +41 -24
- package/dist/assetstore/assetStoreStorage.d.ts +1 -1
- package/dist/assetstore/assetStoreStorage.js +16 -7
- package/dist/assetstore/localJsonl.d.ts +2 -1
- package/dist/assetstore/localJsonl.js +54 -10
- package/dist/assetstore/provenance.d.ts +24 -0
- package/dist/assetstore/provenance.js +219 -12
- package/dist/assetstore/provider.d.ts +20 -1
- package/dist/assetstore/provider.js +34 -1
- package/dist/bootstrap/index.d.ts +2 -1
- package/dist/bootstrap/index.js +2 -1
- package/dist/bootstrap/v1EnvCompat.d.ts +110 -0
- package/dist/bootstrap/v1EnvCompat.js +256 -0
- package/dist/events/public.d.ts +1 -1
- package/dist/events/public.js +1 -1
- package/dist/events/reports.d.ts +2 -0
- package/dist/events/reports.js +4 -0
- package/dist/exec/autoExec.d.ts +1 -1
- package/dist/exec/autoExec.js +8 -10
- package/dist/exec/autonomousCycle.d.ts +19 -4
- package/dist/exec/autonomousCycle.js +63 -13
- package/dist/exec/claudeBridge.d.ts +25 -7
- package/dist/exec/claudeBridge.js +264 -29
- package/dist/exec/prompt.js +5 -1
- package/dist/exec/runnerRegistry.d.ts +68 -26
- package/dist/exec/runnerRegistry.js +307 -72
- package/dist/exec/selfPr.js +1 -7
- package/dist/feedback/envelope.d.ts +61 -0
- package/dist/feedback/envelope.js +168 -0
- package/dist/feedback/index.d.ts +1 -0
- package/dist/feedback/index.js +1 -0
- package/dist/hub/assetCallLog.d.ts +35 -1
- package/dist/hub/assetCallLog.js +124 -1
- package/dist/hub/bindings.d.ts +8 -1
- package/dist/hub/bindings.js +17 -6
- package/dist/hub/capability.d.ts +11 -1
- package/dist/hub/fake.d.ts +2 -2
- package/dist/hub/fake.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -1
- package/dist/mailbox/dispatch.d.ts +1 -1
- package/dist/mailbox/dispatch.js +22 -6
- package/dist/mailbox/envelope.d.ts +7 -1
- package/dist/mailbox/envelope.js +9 -2
- package/dist/mailbox/ipcServer.d.ts +10 -2
- package/dist/mailbox/ipcServer.js +163 -13
- package/dist/mailbox/store.d.ts +38 -2
- package/dist/mailbox/store.js +416 -27
- package/dist/signals/curriculum.d.ts +55 -0
- package/dist/signals/curriculum.js +202 -0
- package/dist/signals/expand.js +17 -6
- package/dist/signals/index.d.ts +2 -1
- package/dist/signals/index.js +2 -1
- package/dist/strategy/constraintAblation.js +115 -369
- package/dist/strategy/constraintAblationPredicates.d.ts +31 -0
- package/dist/strategy/constraintAblationPredicates.js +339 -0
- package/dist/trace/proxyTurns.js +15 -7
- package/dist/verify/validation.d.ts +11 -1
- package/dist/verify/validation.js +31 -0
- package/package.json +4 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
1
2
|
export declare const DEFAULT_TIMEOUT_MS = 600000;
|
|
3
|
+
export declare const MAX_AGENT_SESSION_ID_CHARS = 128;
|
|
2
4
|
/** Per-stream stdout/stderr capture ceiling. A child can emit indefinitely without growing the parent heap. */
|
|
3
5
|
export declare const DEFAULT_MAX_CAPTURE_BYTES = 1048576;
|
|
4
6
|
export interface AgentRunContext {
|
|
@@ -8,13 +10,31 @@ export interface AgentRunContext {
|
|
|
8
10
|
signal?: AbortSignal;
|
|
9
11
|
/** Environment for the spawned agent. The bridge passes a scrubbed env here (see scrubAgentEnv); undefined → inherit. */
|
|
10
12
|
env?: NodeJS.ProcessEnv;
|
|
13
|
+
/** Explicit opt-in to continue one native harness session. Runner identity prevents cross-harness reuse. */
|
|
14
|
+
resume?: AgentSessionResume;
|
|
15
|
+
/** Request a runner-owned isolated worktree. Currently used only by native Cursor resume. */
|
|
16
|
+
managedWorktreeName?: string;
|
|
11
17
|
}
|
|
18
|
+
/** Vendor-neutral native session target. The identifier remains opaque to Evolver. */
|
|
19
|
+
export interface AgentSessionResume {
|
|
20
|
+
runner: RunnerName;
|
|
21
|
+
sessionId: string;
|
|
22
|
+
}
|
|
23
|
+
export type AgentSessionResumeErrorCode = 'invalid_session_id' | 'runner_mismatch' | 'unsupported_runner';
|
|
24
|
+
export declare class AgentSessionResumeError extends Error {
|
|
25
|
+
readonly code: AgentSessionResumeErrorCode;
|
|
26
|
+
constructor(code: AgentSessionResumeErrorCode, message: string);
|
|
27
|
+
}
|
|
28
|
+
/** Validate before spawn so malformed or cross-harness session targets always fail closed. */
|
|
29
|
+
export declare function validateAgentSessionResume(resume: AgentSessionResume, expectedRunner: RunnerName): AgentSessionResume;
|
|
12
30
|
export interface AgentRunResult {
|
|
13
31
|
ok: boolean;
|
|
14
32
|
output: string;
|
|
15
33
|
error?: string;
|
|
16
34
|
failureKind?: 'spawn_failed' | 'timeout' | 'cancelled' | 'permission_denied' | 'non_zero_exit' | 'invalid_output' | 'runtime_error';
|
|
17
35
|
exitCode?: number | null;
|
|
36
|
+
/** Runner-reported worktree used for the run; the bridge must verify it before reading or cleanup. */
|
|
37
|
+
managedWorktreePath?: string;
|
|
18
38
|
}
|
|
19
39
|
/** Run a coding agent against a working directory with the given instruction. */
|
|
20
40
|
export type AgentRunner = (prompt: string, ctx: AgentRunContext) => Promise<AgentRunResult>;
|
|
@@ -22,10 +42,18 @@ export type AgentRunner = (prompt: string, ctx: AgentRunContext) => Promise<Agen
|
|
|
22
42
|
export declare class UnboundedSkipPermissionsError extends Error {
|
|
23
43
|
constructor();
|
|
24
44
|
}
|
|
45
|
+
/** Thrown when Codex permission options cannot be enforced by its CLI. */
|
|
46
|
+
export declare class UnsupportedCodexPermissionOptionsError extends Error {
|
|
47
|
+
constructor();
|
|
48
|
+
}
|
|
25
49
|
/** Thrown when Cursor skipPermissions is requested before the runner can enforce per-run permissions. */
|
|
26
50
|
export declare class UnsupportedCursorSkipPermissionsError extends Error {
|
|
27
51
|
constructor();
|
|
28
52
|
}
|
|
53
|
+
/** Thrown when Cursor workspace trust is requested without verified host containment. */
|
|
54
|
+
export declare class UnsupportedCursorWorkspaceTrustError extends Error {
|
|
55
|
+
constructor();
|
|
56
|
+
}
|
|
29
57
|
/** Thrown when Gemini permission options cannot be mapped to a verified bounded CLI contract. */
|
|
30
58
|
export declare class UnsupportedGeminiPermissionOptionsError extends Error {
|
|
31
59
|
constructor();
|
|
@@ -91,6 +119,12 @@ export interface SpawnCaptureOptions {
|
|
|
91
119
|
processPlatform?: NodeJS.Platform;
|
|
92
120
|
/** Test seam for the shell-free Windows taskkill invocation. */
|
|
93
121
|
windowsProcessTreeKiller?: WindowsProcessTreeKiller;
|
|
122
|
+
/** Test seam for deterministic child-process lifecycle tests. */
|
|
123
|
+
spawnCommand?: typeof spawn;
|
|
124
|
+
}
|
|
125
|
+
/** Thrown when Cursor allowedTools are requested without a verified per-tool CLI allowlist. */
|
|
126
|
+
export declare class UnsupportedCursorAllowedToolsError extends Error {
|
|
127
|
+
constructor();
|
|
94
128
|
}
|
|
95
129
|
export interface SpawnCaptureResult {
|
|
96
130
|
code: number | null;
|
|
@@ -118,67 +152,75 @@ export declare class SpawnCaptureFinalizeError extends Error {
|
|
|
118
152
|
*/
|
|
119
153
|
export declare function spawnCapture(cmd: string, args: readonly string[], opts: SpawnCaptureOptions): Promise<SpawnCaptureResult>;
|
|
120
154
|
/** Map the shared process result into the failure taxonomy used by plain-text runners. */
|
|
121
|
-
export declare function classifyBasicRunnerResult(runner: 'claude' | 'codex' | 'cursor', result: SpawnCaptureResult, timeoutMs: number): AgentRunResult;
|
|
122
|
-
/** Options
|
|
155
|
+
export declare function classifyBasicRunnerResult(runner: 'claude' | 'codex' | 'cursor', result: SpawnCaptureResult, timeoutMs: number, resume?: AgentSessionResume): AgentRunResult;
|
|
156
|
+
/** Options shared by built-in headless runners. Runner-specific fields are ignored by other runners. */
|
|
157
|
+
type ClaudePermissionMode = 'acceptEdits';
|
|
158
|
+
type ClaudeSafeTool = 'Read' | 'Edit' | 'Write' | 'Glob' | 'Grep';
|
|
159
|
+
export declare const CLAUDE_SAFE_AUTONOMOUS_TOOLS: readonly ["Read", "Edit", "Write", "Glob", "Grep"];
|
|
123
160
|
export interface AgentRunnerOptions {
|
|
124
|
-
/** Bypass permission prompts so the agent can edit autonomously
|
|
125
|
-
* MUST be paired with a non-empty allowedTools (enforced)
|
|
161
|
+
/** Bypass permission prompts so the agent can edit autonomously. Default off.
|
|
162
|
+
* MUST be paired with a non-empty allowedTools (enforced); bypassing prompts without bounding tools
|
|
126
163
|
* would be an unbounded autonomous agent. */
|
|
127
164
|
skipPermissions?: boolean;
|
|
128
|
-
/** Constrain the agent to these tools (e.g. ['Read', 'Edit', 'Write'])
|
|
165
|
+
/** Constrain the agent to these tools (e.g. ['Read', 'Edit', 'Write']); the safety counterpart to
|
|
129
166
|
* skipPermissions: bypass prompts but bound what the agent can do. */
|
|
130
167
|
allowedTools?: readonly string[];
|
|
168
|
+
/** Trust the workspace only when the bridge provides an isolated worktree. */
|
|
169
|
+
workspaceTrust?: 'isolated-worktree';
|
|
170
|
+
/** Claude's bounded project-edit mode. Unlike skipPermissions, this keeps path permission checks enabled. */
|
|
171
|
+
permissionMode?: ClaudePermissionMode;
|
|
172
|
+
/** Claude tools exposed to the headless session. Autonomous cycles accept only file/search tools. */
|
|
173
|
+
tools?: readonly ClaudeSafeTool[];
|
|
131
174
|
/** Pin a model (e.g. 'claude-sonnet-4-6'). */
|
|
132
175
|
model?: string;
|
|
133
176
|
}
|
|
134
|
-
|
|
177
|
+
export declare function hasBoundedClaudeFileAccess(opts: AgentRunnerOptions | undefined): boolean;
|
|
178
|
+
/** @deprecated use AgentRunnerOptions; kept for back-compat (#91 item 6 rename). */
|
|
135
179
|
export type ClaudeRunnerOptions = AgentRunnerOptions;
|
|
136
|
-
/** @deprecated use AgentRunnerOptions
|
|
180
|
+
/** @deprecated use AgentRunnerOptions; Codex shares the exact option shape. */
|
|
137
181
|
export type CodexRunnerOptions = AgentRunnerOptions;
|
|
138
182
|
/**
|
|
139
|
-
* Build the `claude -p` argv for the given options (pure
|
|
183
|
+
* Build the `claude -p` argv for the given options (pure and testable without spawning).
|
|
140
184
|
* Safety invariant: skipPermissions (bypassing prompts) is only allowed together with a non-empty
|
|
141
|
-
* allowedTools
|
|
185
|
+
* allowedTools; otherwise it would be an unattended agent with full tools and no gate; refuse loudly.
|
|
142
186
|
*/
|
|
143
|
-
export declare function claudeRunnerArgs(opts?: AgentRunnerOptions): string[];
|
|
187
|
+
export declare function claudeRunnerArgs(opts?: AgentRunnerOptions, resume?: AgentSessionResume): string[];
|
|
144
188
|
/**
|
|
145
|
-
* Build a headless `claude -p` agent runner. Prompt fed via stdin (no shell, no argv length limit).
|
|
146
|
-
* unattended
|
|
147
|
-
* permission prompts but bound the agent to file edits. Validated end to end against a real agent.
|
|
189
|
+
* Build a headless `claude -p` agent runner. Prompt is fed via stdin (no shell, no argv length limit).
|
|
190
|
+
* For unattended edits, prefer permissionMode: 'acceptEdits' with the bounded file/search tool list.
|
|
148
191
|
*/
|
|
149
192
|
export declare function makeClaudeHeadlessRunner(opts?: AgentRunnerOptions): AgentRunner;
|
|
150
193
|
/** Default agent runner: conservative `claude -p --output-format text` (no permission bypass; opt in via makeClaudeHeadlessRunner). */
|
|
151
194
|
export declare const claudeHeadlessRunner: AgentRunner;
|
|
152
195
|
/**
|
|
153
|
-
* Build the `codex exec` argv (pure). Verified live against codex-cli 0.
|
|
154
|
-
* - sandboxed default →
|
|
155
|
-
*
|
|
156
|
-
* -
|
|
157
|
-
*
|
|
158
|
-
* acknowledgement guard, same shape as claude.
|
|
196
|
+
* Build the `codex exec` argv (pure). Verified live against codex-cli 0.144.6:
|
|
197
|
+
* - sandboxed default → `--ask-for-approval never exec --sandbox workspace-write`: edits the workspace
|
|
198
|
+
* without waiting for interactive approval. The wrapper's worktree + allowedRoots are the outer containment.
|
|
199
|
+
* - permission overrides fail closed: Codex has no per-tool allowlist, and a Git worktree does not contain
|
|
200
|
+
* danger-full-access host filesystem or network access.
|
|
159
201
|
*/
|
|
160
202
|
export declare function codexRunnerArgs(opts?: AgentRunnerOptions): string[];
|
|
161
|
-
/** Headless `codex exec` runner. Working root pinned with `--cd`; prompt is
|
|
162
|
-
export declare function makeCodexHeadlessRunner(opts?: AgentRunnerOptions): AgentRunner;
|
|
203
|
+
/** Headless `codex exec` runner. Working root pinned with `--cd`; prompt is sent over stdin. */
|
|
204
|
+
export declare function makeCodexHeadlessRunner(opts?: AgentRunnerOptions, spawnCaptureFn?: typeof spawnCapture): AgentRunner;
|
|
163
205
|
/** Interpret one bounded Gemini subprocess result. Structured output and diagnostics require complete capture. */
|
|
164
206
|
export declare function classifyGeminiRunnerResult(result: SpawnCaptureResult, timeoutMs: number): AgentRunResult;
|
|
165
207
|
/** Build verified Gemini CLI argv. The prompt is appended separately as one argv element with shell:false. */
|
|
166
208
|
export declare function geminiRunnerArgs(opts?: AgentRunnerOptions): string[];
|
|
167
209
|
/** Headless Gemini runner with structured failure classification; stdout text alone never proves execution success. */
|
|
168
|
-
export declare function makeGeminiHeadlessRunner(opts?: AgentRunnerOptions): AgentRunner;
|
|
210
|
+
export declare function makeGeminiHeadlessRunner(opts?: AgentRunnerOptions, removeTempDir?: (path: string) => void): AgentRunner;
|
|
169
211
|
/**
|
|
170
212
|
* Build the `cursor-agent` argv (pure). Ground-truth from `cursor-agent --help` (#66): base `-p --output-format
|
|
171
213
|
* text` (headless, write+shell access). `--model` is a real flag. skipPermissions is rejected until Cursor has a
|
|
172
214
|
* verified per-run allowlist/sandbox mapping; allowedTools is not emitted because cursor has no per-tool allowlist.
|
|
173
215
|
*/
|
|
174
|
-
export declare function cursorRunnerArgs(opts?: AgentRunnerOptions): string[];
|
|
216
|
+
export declare function cursorRunnerArgs(opts?: AgentRunnerOptions, resume?: AgentSessionResume, managedWorktreeName?: string): string[];
|
|
175
217
|
/**
|
|
176
218
|
* Headless `cursor-agent` runner. Prompt passed as the trailing positional arg (shell:false, no injection risk;
|
|
177
|
-
* docs show `cursor-agent -p "<prompt>"`). cwd is set via spawn.
|
|
178
|
-
*
|
|
219
|
+
* docs show `cursor-agent -p "<prompt>"`). cwd is set via spawn. Workspace trust must be certified by the
|
|
220
|
+
* bridge refuses built-in autonomous Cursor until host containment is verified.
|
|
179
221
|
*/
|
|
180
222
|
export declare function makeCursorHeadlessRunner(opts?: AgentRunnerOptions, platform?: NodeJS.Platform): AgentRunner;
|
|
181
|
-
/** A built-in coding-agent harness (#66).
|
|
223
|
+
/** A built-in coding-agent harness (#66). */
|
|
182
224
|
export type RunnerName = 'claude' | 'codex' | 'cursor' | 'gemini';
|
|
183
225
|
/** A harness runner: how to launch it + which env auth prefixes it (and ONLY it) may keep (#66). */
|
|
184
226
|
export interface AgentRunnerSpec {
|