@tangle-network/agent-runtime 0.54.0 → 0.56.0

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 (47) hide show
  1. package/dist/agent.js +3 -1
  2. package/dist/agent.js.map +1 -1
  3. package/dist/{chunk-KADIJAD4.js → chunk-3BI6PSP3.js} +75 -60
  4. package/dist/chunk-3BI6PSP3.js.map +1 -0
  5. package/dist/{chunk-2BDXWZUC.js → chunk-5ZOYQWEB.js} +2 -2
  6. package/dist/chunk-5ZOYQWEB.js.map +1 -0
  7. package/dist/{chunk-KJH62YEK.js → chunk-A265AJ2Q.js} +2 -2
  8. package/dist/{chunk-A73RADPB.js → chunk-GFDCNQRO.js} +6 -6
  9. package/dist/chunk-GFDCNQRO.js.map +1 -0
  10. package/dist/{chunk-GLR25NG7.js → chunk-GLMFBUKT.js} +28 -6
  11. package/dist/chunk-GLMFBUKT.js.map +1 -0
  12. package/dist/{chunk-FRBWCJLP.js → chunk-UIQTCS6H.js} +10 -89
  13. package/dist/chunk-UIQTCS6H.js.map +1 -0
  14. package/dist/{chunk-JTH2FPCK.js → chunk-ZADWPBOE.js} +392 -11
  15. package/dist/chunk-ZADWPBOE.js.map +1 -0
  16. package/dist/{coder-CEkUFv8h.d.ts → coder-CdsknxGF.d.ts} +54 -2
  17. package/dist/{coordination-BMzskrUR.d.ts → coordination-CfMk-RpQ.d.ts} +81 -2
  18. package/dist/{delegates-BPLIl8EC.d.ts → delegates-htF7l_H6.d.ts} +19 -1
  19. package/dist/improvement.d.ts +1 -1
  20. package/dist/improvement.js +1 -1
  21. package/dist/index.d.ts +3 -3
  22. package/dist/index.js +6 -5
  23. package/dist/index.js.map +1 -1
  24. package/dist/{local-harness-KrdFTY5R.d.ts → local-harness-BE_h8szs.d.ts} +11 -0
  25. package/dist/{loop-runner-bin-BGpVVyXp.d.ts → loop-runner-bin-C4YyFGdT.d.ts} +2 -2
  26. package/dist/loop-runner-bin.d.ts +3 -3
  27. package/dist/loop-runner-bin.js +5 -4
  28. package/dist/loops.d.ts +6 -4
  29. package/dist/loops.js +13 -3
  30. package/dist/mcp/bin.js +7 -7
  31. package/dist/mcp/index.d.ts +8 -87
  32. package/dist/mcp/index.js +11 -11
  33. package/dist/profiles.d.ts +1 -1
  34. package/dist/profiles.js +4 -2
  35. package/dist/profiles.js.map +1 -1
  36. package/dist/runtime.d.ts +281 -5
  37. package/dist/runtime.js +13 -3
  38. package/dist/workflow.js +3 -1
  39. package/dist/workflow.js.map +1 -1
  40. package/package.json +1 -1
  41. package/dist/chunk-2BDXWZUC.js.map +0 -1
  42. package/dist/chunk-A73RADPB.js.map +0 -1
  43. package/dist/chunk-FRBWCJLP.js.map +0 -1
  44. package/dist/chunk-GLR25NG7.js.map +0 -1
  45. package/dist/chunk-JTH2FPCK.js.map +0 -1
  46. package/dist/chunk-KADIJAD4.js.map +0 -1
  47. /package/dist/{chunk-KJH62YEK.js.map → chunk-A265AJ2Q.js.map} +0 -0
package/dist/runtime.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { AgentProfile, BackendType, CreateSandboxOptions, SandboxInstance, SandboxEvent } from '@tangle-network/sandbox';
2
2
  export { AgentProfile, CreateSandboxOptions, SandboxEvent, SandboxInstance } from '@tangle-network/sandbox';
3
- import { R as ResultBlobStore, p as SpawnJournal, N as NodeId, q as SpawnEvent, T as TreeView, r as Settled, s as AgentSpec, E as ExecutorRegistry, B as Budget, t as Agent, u as RootHandle, v as SupervisedResult, w as Spend, x as Scope, y as ExecutorFactory, z as Executor, U as UsageEvent, M as MakeWorkerAgent, D as Supervisor } from './coordination-BMzskrUR.js';
4
- export { G as ExecutorContext, H as ExecutorResult, K as Handle, L as NodeSnapshot, O as NodeStatus, P as Restart, V as RootSignal, W as Runtime, X as SpawnOpts, Y as SupervisorOpts, Z as WidenGate } from './coordination-BMzskrUR.js';
3
+ import { u as ResultBlobStore, v as SpawnJournal, N as NodeId, w as SpawnEvent, T as TreeView, x as Settled, y as AgentSpec, E as ExecutorRegistry, B as Budget, z as Agent, H as RootHandle, K as SupervisedResult, L as Spend, O as Scope, P as ExecutorFactory, U as Executor, V as UsageEvent, G as GitRunner, M as MakeWorkerAgent, X as Supervisor } from './coordination-CfMk-RpQ.js';
4
+ export { Y as ExecutorContext, Z as ExecutorResult, _ as Handle, $ as NodeSnapshot, a0 as NodeStatus, a1 as Restart, a2 as RootSignal, a3 as Runtime, a4 as SpawnOpts, a5 as SupervisorOpts, a6 as WidenGate } from './coordination-CfMk-RpQ.js';
5
5
  import { R as RuntimeHooks } from './runtime-hooks-C7JwKb9E.js';
6
6
  import { ChatClient, AnalystFinding, DefaultVerdict, AgentProfile as AgentProfile$1, AnalystRunInputs } from '@tangle-network/agent-eval';
7
7
  export { DefaultVerdict } from '@tangle-network/agent-eval';
@@ -13,9 +13,11 @@ export { c as createSandboxForSpec, d as defaultSelectWinner, r as runLoop } fro
13
13
  import { b as AnalystRegistryLike } from './types-p8dWBIXL.js';
14
14
  import { R as RouterConfig, T as ToolSpec } from './router-client-30Y_pca8.js';
15
15
  export { a as RouterChatResult, b as RouterChatToolsResult, c as RouterToolCall, d as RouterToolLoopResult, r as routerChatWithTools, e as routerChatWithUsage, f as routerToolLoop } from './router-client-30Y_pca8.js';
16
- import './delegates-BPLIl8EC.js';
17
- import './coder-CEkUFv8h.js';
16
+ import { a as CoderCheckConstraints } from './coder-CdsknxGF.js';
17
+ import { L as LocalHarness, r as runLocalHarness } from './local-harness-BE_h8szs.js';
18
+ import './delegates-htF7l_H6.js';
18
19
  import './substrate-CUgk7F7s.js';
20
+ import 'node:child_process';
19
21
 
20
22
  /**
21
23
  * @experimental
@@ -705,6 +707,13 @@ interface FanoutOptions<Item, D> {
705
707
  itemTask(item: Item, index: number, ctx: ShapeContext<D>): unknown;
706
708
  /** Per-item child label (defaults to `item:<index>` in the impl). */
707
709
  label?(item: Item, index: number): string;
710
+ /**
711
+ * Optional per-item `AgentSpec` override. When set, each item's child is spawned against the
712
+ * returned spec instead of `persona.root` — the seam a heterogeneous fanout uses to give each
713
+ * item a DISTINCT executor (e.g. N authored harness profiles, each on its own worktree-CLI
714
+ * leaf). Absent ⇒ every item runs against the persona's root spec (the homogeneous default).
715
+ */
716
+ itemSpec?(item: Item, index: number, ctx: ShapeContext<D>): AgentSpec;
708
717
  /**
709
718
  * Optional synthesis over the gathered child results: when present, the combinator spawns ONE
710
719
  * synthesis child whose task is built from the drained settlements, and its `done` output is
@@ -712,7 +721,21 @@ interface FanoutOptions<Item, D> {
712
721
  * The synthesis child is a SEPARATE keystone agent (not a re-rank behind the driver).
713
722
  */
714
723
  synthesize?: FanoutSynthesis<D>;
724
+ /**
725
+ * Winner-selection strategy among the gathered `done` children when there is no `synthesize`.
726
+ * Receives the SAME `Iteration[]` the default selector reads (each child's output is its
727
+ * `Outcome<D>`), so a strategy is a thin re-sort (smallest-diff, highest-readiness, first-valid
728
+ * …) over the candidates — NEVER a re-rank behind a judge. Default = `defaultSelectWinner`
729
+ * semantics (best-valid-score, ties→earliest). Mutually exclusive with `synthesize` (a
730
+ * synthesis child IS the selection); supplying both is a config error.
731
+ */
732
+ selectWinner?: FanoutWinnerSelector<D>;
715
733
  }
734
+ /** A winner-selection strategy: argmax/sort over the gathered child iterations (each output is the
735
+ * child's `Outcome<D>`), returning the chosen iteration or `undefined` when none qualifies. */
736
+ type FanoutWinnerSelector<D> = (iterations: Iteration<unknown, Outcome<D>>[]) => {
737
+ readonly output?: Outcome<D> | undefined;
738
+ } | undefined;
716
739
  /** How a fanout's synthesis child is built + read. `synthesisTask` projects the drained child
717
740
  * settlements into the synthesis child's task; `collect` reads its settled output into the
718
741
  * deliverable `Outcome<D>`. */
@@ -2954,6 +2977,236 @@ declare function spendFromUsageEvents(events: UsageEvent[]): Spend;
2954
2977
  */
2955
2978
  declare function createBudgetPool(root: Budget, now?: () => number): BudgetPool;
2956
2979
 
2980
+ /**
2981
+ * @experimental
2982
+ *
2983
+ * The worktree-CLI leaf executor — a supervisor-authored `AgentProfile` driving a local
2984
+ * coding-harness CLI (claude / codex / opencode) on its OWN git worktree, surfaced as the
2985
+ * open `Executor<Out>` port (`./types`). It is a LEAF executor, not a `DelegationExecutor`:
2986
+ * it plugs straight into the `Scope`/`Supervisor` recursion and `gateOnDeliverable`, so it
2987
+ * IS the canonical recursive path (no `runLoop`/virtual-SandboxInstance shim in between).
2988
+ *
2989
+ * The §1.5 payload reaches the harness: `harnessInvocation` (mcp/local-harness) maps the
2990
+ * authored `profile.prompt.systemPrompt` into the prompt channel and `profile.model.default`
2991
+ * into the harness's `-m` selector — the prompt-only `buildArgs(taskPrompt)` path dropped
2992
+ * both. The subprocess runs through `runLocalHarness` (the stdin-CLOSED spawn shape — the
2993
+ * #308 fix that keeps a non-TTY `opencode run` from blocking on input forever).
2994
+ *
2995
+ * Lifecycle per spawn (fresh executor — one box/abort/teardown each):
2996
+ * 1. `createWorktree` — `git worktree add` off `repoRoot` at `baseRef`.
2997
+ * 2. `runLocalHarness` — spawn the harness, fed the profile-aware invocation.
2998
+ * 3. `captureWorktreeDiff` — `git diff` the worktree → the patch artifact.
2999
+ * 4. `removeWorktree` — on `teardown` (always; the loser of a fanout is dirty).
3000
+ *
3001
+ * Reuse, not duplication: `createWorktree` / `captureWorktreeDiff` / `removeWorktree` come
3002
+ * straight from `mcp/worktree`; `runLocalHarness` + `LocalHarness` from `mcp/local-harness`.
3003
+ * Nothing here reimplements a worktree, a spawn, or a diff.
3004
+ *
3005
+ * Token accounting: a harness CLI does not surface usage, so this executor is
3006
+ * `budgetExempt: true` — its spend is NOT metered against the conserved pool and its
3007
+ * iterations are EXCLUDED from the equal-k arms by construction (mirrors `cliExecutor`).
3008
+ */
3009
+
3010
+ /** Outcome of one verification command run in the worktree (test or typecheck). */
3011
+ interface WorktreeCommandResult {
3012
+ /** The shell command line that was run. */
3013
+ command: string;
3014
+ /** Did the command exit 0? The PASS signal the coder deliverable gates on. */
3015
+ passed: boolean;
3016
+ /** OS exit code, or `null` when killed before exit. */
3017
+ exitCode: number | null;
3018
+ /** Combined stdout+stderr (capped) — surfaced in traces for diagnosis. */
3019
+ output: string;
3020
+ }
3021
+ /** Terminal artifact of one worktree-CLI run: the captured diff + the harness's run record. */
3022
+ interface WorktreePatchArtifact {
3023
+ /** The branch the worktree was cut on (`delegate/<runId>`). */
3024
+ branch: string;
3025
+ /** `git diff` of the worktree against its base — the unified patch the harness produced. */
3026
+ patch: string;
3027
+ /** Shortstat-derived change counts. */
3028
+ stats: {
3029
+ filesChanged: number;
3030
+ insertions: number;
3031
+ deletions: number;
3032
+ };
3033
+ /** The harness subprocess outcome (exit code, captured streams, timing). */
3034
+ harness: {
3035
+ name: LocalHarness;
3036
+ exitCode: number | null;
3037
+ timedOut: boolean;
3038
+ killedBySignal: NodeJS.Signals | null;
3039
+ durationMs: number;
3040
+ stdout: string;
3041
+ stderr: string;
3042
+ };
3043
+ /**
3044
+ * Verification signals DERIVED in the live worktree, after the harness ran and before
3045
+ * teardown — the PASS signals the old sandbox `CoderOutput` carried, re-derived here by
3046
+ * running the configured commands. Present only when `testCmd`/`typecheckCmd` were supplied.
3047
+ * The coder deliverable (`coderDeliverable`) reads these to gate the patch.
3048
+ */
3049
+ checks?: {
3050
+ tests?: WorktreeCommandResult;
3051
+ typecheck?: WorktreeCommandResult;
3052
+ };
3053
+ }
3054
+ /** @experimental */
3055
+ interface WorktreeCliExecutorOptions {
3056
+ /** Absolute path to the git checkout the worktree is cut from. */
3057
+ repoRoot: string;
3058
+ /** The SUPERVISOR-AUTHORED profile (the §1.5 payload: systemPrompt + model). */
3059
+ profile: AgentProfile;
3060
+ /** Which local harness CLI drives this leaf (`claude` | `codex` | `opencode`). */
3061
+ harness: LocalHarness;
3062
+ /** The per-task instruction handed to the harness (composed under the system prompt). */
3063
+ taskPrompt: string;
3064
+ /** Unique id for the worktree path + branch. Defaults to a fresh UUID. */
3065
+ runId?: string;
3066
+ /** Override the base ref the worktree is cut from (default `HEAD`). */
3067
+ baseRef?: string;
3068
+ /** Wall-clock cap per harness subprocess (ms). Default 5 min (the `runLocalHarness` default). */
3069
+ harnessTimeoutMs?: number;
3070
+ /**
3071
+ * Shell command run in the live worktree to derive the tests-PASS signal (e.g. `pnpm test`).
3072
+ * Its exit code becomes `artifact.checks.tests.passed`. Omit to skip (no signal derived).
3073
+ */
3074
+ testCmd?: string;
3075
+ /** Shell command run in the live worktree to derive the typecheck-PASS signal (e.g. `pnpm typecheck`). */
3076
+ typecheckCmd?: string;
3077
+ /** Wall-clock cap per verification command (ms). Default = `harnessTimeoutMs` or 5 min. */
3078
+ checkTimeoutMs?: number;
3079
+ /** Test seam — inject a git runner so unit tests drive the worktree helpers without git. */
3080
+ runGit?: GitRunner;
3081
+ /** Test seam — inject the harness runner so unit tests script a `LocalHarnessResult`. */
3082
+ runHarness?: typeof runLocalHarness;
3083
+ /**
3084
+ * Test seam — inject the verification-command runner so unit tests script test/typecheck
3085
+ * outcomes without spawning a real shell. Defaults to a `/bin/sh -c` spawn in the worktree.
3086
+ */
3087
+ runCommand?: (opts: {
3088
+ command: string;
3089
+ cwd: string;
3090
+ timeoutMs: number;
3091
+ signal?: AbortSignal;
3092
+ }) => Promise<{
3093
+ exitCode: number | null;
3094
+ output: string;
3095
+ }>;
3096
+ }
3097
+ /**
3098
+ * Build a worktree-CLI leaf `Executor`. Per-spawn (a fresh worktree + abort + teardown each),
3099
+ * so a fanout of N profiles = N parallel worktrees that never clobber each other.
3100
+ *
3101
+ * Fail-loud: an empty `repoRoot`/`harness`/`taskPrompt` throws at construction (no silent
3102
+ * default for a required boundary). `resultArtifact()` before `execute()` resolves throws.
3103
+ *
3104
+ * @experimental
3105
+ */
3106
+ declare function createWorktreeCliExecutor(options: WorktreeCliExecutorOptions): Executor<WorktreePatchArtifact>;
3107
+
3108
+ /**
3109
+ * @experimental
3110
+ *
3111
+ * `coderDeliverable` — the mechanical coder gate, re-homed as a generic `DeliverableSpec` over
3112
+ * the worktree-CLI artifact. It is the ONE place the coder-domain checks reach the generic
3113
+ * `gateOnDeliverable` path: a `fanout(createWorktreeCliExecutor)` of authored harness profiles,
3114
+ * each `gateOnDeliverable(coderDeliverable(...))`, winner via `defaultSelectWinner`.
3115
+ *
3116
+ * The checks themselves are NOT re-implemented here — `runCoderChecks` (`../../profiles/coder`)
3117
+ * is the single source of the no-op / always-on secret-path floor / forbidden-path / diff-size /
3118
+ * test / typecheck logic, shared with `createCoderValidator`. This factory only adapts the
3119
+ * `WorktreePatchArtifact` shape (its `checks` carry the test/typecheck PASS signals the executor
3120
+ * derived in the live worktree) into the check inputs and returns the boolean the gate consumes.
3121
+ *
3122
+ * Test/typecheck enforcement is OPT-IN per `require`: when a command was not run in the worktree
3123
+ * (the executor's `testCmd`/`typecheckCmd` were omitted) the corresponding signal is treated as
3124
+ * passed UNLESS `require` lists it — so a gate that demands a tests-pass on an artifact that never
3125
+ * ran tests fails closed (the honest outcome) rather than passing on a missing signal.
3126
+ */
3127
+
3128
+ /** @experimental */
3129
+ interface CoderDeliverableOptions extends CoderCheckConstraints {
3130
+ /**
3131
+ * Which verification signals the gate REQUIRES to be present-and-passing. A required signal
3132
+ * that the artifact never derived (the command was not configured on the executor) fails the
3133
+ * gate closed. Unlisted signals default to passed-when-absent (the executor simply didn't run
3134
+ * that command). Default `[]` — gate on no-op / secret / forbidden / diff-size only.
3135
+ */
3136
+ require?: ReadonlyArray<'tests' | 'typecheck'>;
3137
+ }
3138
+ /**
3139
+ * Build the coder `DeliverableSpec<WorktreePatchArtifact>`: `check(artifact)` runs the shared
3140
+ * mechanical gate (`runCoderChecks`) over the captured patch + the worktree-derived pass signals
3141
+ * and returns whether the patch is DELIVERED (the `valid` conjunction).
3142
+ *
3143
+ * @experimental
3144
+ */
3145
+ declare function coderDeliverable(options?: CoderDeliverableOptions): DeliverableSpec<WorktreePatchArtifact>;
3146
+
3147
+ /**
3148
+ * @experimental
3149
+ *
3150
+ * `worktreeCoderFanout` — the GENERIC coding combinator: a `fanout` of N supervisor-authored
3151
+ * harness profiles, each on its OWN worktree-CLI leaf, each `gateOnDeliverable(coderDeliverable)`,
3152
+ * winner via `defaultSelectWinner` (or a thin re-sort strategy). It is the canonical replacement
3153
+ * for the role-coupled multi-harness coder driver: no `runLoop` driver, no `multiHarnessCoderFanout`
3154
+ * harness-list config — the harness list is the fanout's item list, the §1.5 profile is authored
3155
+ * per item, and the mechanical gate is the re-homed `coderDeliverable`.
3156
+ *
3157
+ * The shape is content-free at the `fanout` layer; this builder only assembles the coder-domain
3158
+ * pieces (the worktree-CLI executor + the coder deliverable + the diff/readiness selectors) into
3159
+ * the generic combinator's `itemSpec`/`selectWinner` seams. Nothing here re-implements selection,
3160
+ * gating, or fanout — it composes the existing primitives.
3161
+ */
3162
+
3163
+ /** @experimental One authored harness profile in a coder fanout: the §1.5 profile + which local
3164
+ * harness CLI drives it. The supervisor authors `profile` per sub-task; `harness` chooses the leaf. */
3165
+ interface AuthoredCoderHarness {
3166
+ /** A short label for the worktree branch + trace node. */
3167
+ name: string;
3168
+ /** The supervisor-authored `AgentProfile` (systemPrompt + model reach the harness via §1.5). */
3169
+ profile: AgentProfile;
3170
+ /** Which local harness CLI drives this leaf. */
3171
+ harness: 'claude' | 'codex' | 'opencode';
3172
+ /** Per-harness model/runId/baseRef overrides flow through the profile + these. */
3173
+ runId?: string;
3174
+ baseRef?: string;
3175
+ }
3176
+ /** @experimental Winner-selection among the gated coder candidates. `highest-score` is the
3177
+ * `defaultSelectWinner` default; the rest are thin re-sorts over the same iterations. */
3178
+ type CoderWinnerStrategy = 'highest-score' | 'smallest-diff' | 'first-valid';
3179
+ /** @experimental */
3180
+ interface WorktreeCoderFanoutOptions extends CoderDeliverableOptions {
3181
+ /** Absolute path to the git checkout each worktree is cut from. */
3182
+ repoRoot: string;
3183
+ /** The per-task instruction handed to every harness (composed under each profile's systemPrompt). */
3184
+ taskPrompt: string;
3185
+ /** The authored harness profiles — one fanout item (and one worktree-CLI leaf) each. */
3186
+ harnesses: ReadonlyArray<AuthoredCoderHarness>;
3187
+ /** Shell command run in each worktree to derive the tests-PASS signal. */
3188
+ testCmd?: string;
3189
+ /** Shell command run in each worktree to derive the typecheck-PASS signal. */
3190
+ typecheckCmd?: string;
3191
+ /** Wall-clock cap per harness subprocess (ms). */
3192
+ harnessTimeoutMs?: number;
3193
+ /** Winner-selection strategy. Default `highest-score`. */
3194
+ winnerStrategy?: CoderWinnerStrategy;
3195
+ /** Test seams forwarded to every worktree-CLI leaf (inject git/harness/command runners so the
3196
+ * whole fanout runs offline). Production callers leave these unset. */
3197
+ runGit?: WorktreeCliExecutorOptions['runGit'];
3198
+ runHarness?: WorktreeCliExecutorOptions['runHarness'];
3199
+ runCommand?: WorktreeCliExecutorOptions['runCommand'];
3200
+ }
3201
+ /**
3202
+ * Build the coder fanout combinator. Run it with `runPersonified({ persona, shape, task, budget })`
3203
+ * — equal-k holds by construction (the conserved budget pool bounds the N leaves), and selection is
3204
+ * the single-sourced `defaultSelectWinner` (or a thin re-sort), never a judge.
3205
+ *
3206
+ * @experimental
3207
+ */
3208
+ declare function worktreeCoderFanout<Task>(options: WorktreeCoderFanoutOptions): CombinatorShape<Task, WorktreePatchArtifact>;
3209
+
2957
3210
  /**
2958
3211
  * @experimental
2959
3212
  *
@@ -3215,6 +3468,21 @@ interface CliSeam {
3215
3468
  /** Working directory for the subprocess. */
3216
3469
  cwd?: string;
3217
3470
  }
3471
+ /**
3472
+ * cli-worktree seam. A supervisor-authored `AgentProfile` driving a local coding-harness CLI
3473
+ * (claude / codex / opencode) on its own git worktree — the leaf `createWorktreeCliExecutor`
3474
+ * named as data. `harness` + `repoRoot` + `taskPrompt` are required; the authored
3475
+ * `profile.prompt.systemPrompt` + `profile.model.default` reach the harness via the §1.5
3476
+ * `harnessInvocation` mapper. Everything else mirrors `WorktreeCliExecutorOptions`.
3477
+ */
3478
+ interface CliWorktreeSeam {
3479
+ repoRoot: string;
3480
+ harness: LocalHarness;
3481
+ taskPrompt: string;
3482
+ runId?: string;
3483
+ baseRef?: string;
3484
+ harnessTimeoutMs?: number;
3485
+ }
3218
3486
  /**
3219
3487
  * cli-bridge seam. A local OpenAI-compatible bridge that fronts harness CLIs
3220
3488
  * (claude-code / opencode / kimi / pi) behind one HTTP surface; `model` doubles
@@ -3251,6 +3519,12 @@ interface RouterToolsSeam {
3251
3519
  * or wall-clock deadline at the call site. */
3252
3520
  maxTurns?: number;
3253
3521
  }
3522
+ /**
3523
+ * The leaf `createWorktreeCliExecutor` as a backend-as-data factory: a supervisor-authored
3524
+ * `AgentProfile` driving claude / codex / opencode on its own worktree. `budgetExempt` like
3525
+ * the other CLI leaves; the authored systemPrompt + model reach the harness via §1.5.
3526
+ */
3527
+ declare const cliWorktreeExecutor: ExecutorFactory<unknown>;
3254
3528
  /**
3255
3529
  * The single built-in executor entrypoint. The backend is DATA — the cost dial a
3256
3530
  * profile, an experiment config, or a replay journal can name — not an import
@@ -3267,6 +3541,8 @@ type ExecutorConfig = ({
3267
3541
  } & BridgeSeam) | ({
3268
3542
  backend: 'cli';
3269
3543
  } & CliSeam) | ({
3544
+ backend: 'cli-worktree';
3545
+ } & CliWorktreeSeam) | ({
3270
3546
  backend: 'sandbox';
3271
3547
  harness?: BackendType;
3272
3548
  } & SandboxSeam);
@@ -3521,4 +3797,4 @@ declare function runInWorkspace<T>(ws: Workspace, body: (cwd: string) => Promise
3521
3797
  commitOnInvalid?: boolean;
3522
3798
  }): Promise<WorkspaceRun<T>>;
3523
3799
 
3524
- export { Agent, AgentRunSpec, AgentSpec, type AgenticOptions, type AgenticRunResult, type AgenticSurface, type AgenticTask, type AgenticTool, type AnytimeReport, type AnytimeStrategySummary, type AnytimeTaskCurve, type ArtifactHandle, type AssertTraceDerivedFindings, type AuditIntentInput, type AuditIntentOptions, type AuthorStrategyOptions, type AuthoredProfile, type AuthoredStrategy, type BenchmarkCell, type BenchmarkConfig, type BenchmarkLift, type BenchmarkReport, type BenchmarkStrategySummary, type BenchmarkTaskRow, type BridgeSeam, Budget, type BudgetPool, type BudgetReadout, type ChampionPick, type ChampionPolicy, type CheckpointCapableBox, type CliSeam, type CombinatorShape, type CompletionAnalyst, type CompletionEvidence, type CompletionPolicy, type CompletionVerdict, type CoordinationDriverOptions, type CoordinationMcpHandle, type Corpus, type CorpusFilter, type CorpusRecord, type CreateScopeAnalystOptions, type CriuCapableClient, type DefinePersona, type DefinePersonaInput, type Deliverable, type DeliverableSpec, type DriverChat, type DriverMessage, type DriverToolCall, type DriverTurn, type Environment, type EqualKArm, type EqualKOnCost, type EqualKOnCostOptions, type EqualKVerdict, type EvolutionArchiveNode, type EvolutionAuthor, type EvolutionBandInfo, type EvolutionCandidate, type EvolutionGeneration, type EvolutionReport, ExecCtx, Executor, type ExecutorConfig, ExecutorFactory, ExecutorRegistry, type Fanout, type FanoutOptions, type FanoutSynthesis, FileCorpus, FileResultBlobStore, FileSpawnJournal, type FlatWidenGate, type ForkCapableBox, type GitWorkspaceOptions, type HarvestCorpusOptions, type HarvestFailure, type HarvestReport, InMemoryCorpus, InMemoryResultBlobStore, InMemorySpawnJournal, type IntentAudit, Iteration, type LoopDispatchOptions, type LoopOptionsForDispatch, LoopResult, type LoopShape, LoopTokenUsage, type LoopUntil, type LoopUntilSpec, type LoopUntilState, type McpEndpoint, type McpEnvironmentOptions, type NestedScopeSeam, NodeId, type Observation, type ObserveInput, type ObserveOptions, type OpenSandboxRunOptions, type Outcome, type Panel, type PanelJudge, type PanelSpec, type PanelVerdict, type Persona, type PersonaContext, type PersonaExecutors, type Pipeline, type PipelineStage, type PromotionGateOptions, type PromotionVerdict, type RegistryAnalyzeProjection, type RenderCorpusToInstructions, type RenderCorpusToInstructionsOptions, type ReservationTicket, ResultBlobStore, RootHandle, RouterConfig, type RouterSeam, type RouterToolsSeam, type RunAgenticOptions, RunLoopOptions, type RunPersonified, type RunPersonifiedOptions, type SandboxCapabilities, SandboxClient, type SandboxLineage, type SandboxLineageHandle, type SandboxRun, type SandboxSeam, Scope, type ScopeAnalyst, type ScopeAnalyzeInput, type ScopeWidenGate, type SessionCapableBox, Settled, type ShapeBudget, type ShapeContext, type ShapeRegistry, type Shell, type ShotPersona, type ShotSpec, SpawnEvent, SpawnJournal, Spend, type SteerContext, type Strategy, type StrategyCtx, type StrategyEvolutionConfig, type StrategyResult, SupervisedResult, Supervisor, type SurfaceScore, ToolSpec, type TrajectoryNode, type TrajectoryReport, type TrajectoryReportFn, type TrajectoryReportOptions, TreeView, type TurnResult, UsageEvent, type UsageSink, type VerifierEnvironmentOptions, type Verify, type VerifySpec, type WaterfallCollector, type WaterfallReport, type WaterfallSpan, type Widen, type WidenDecision, type WidenLineage, type WidenSpec, type Workspace, type WorkspaceCommit, type WorkspaceRun, acquireSandbox, adaptiveRefine, anytimeReport, asAuthoredProfile, assertStrategyContract, assertTraceDerivedFindings, auditIntent, authorStrategy, authoredWorker, breadthDriver, buildSteerContext, builtinShapes, completionAuthorizes, contentAddress, coordinationDriverAgent, createBudgetPool, createExecutor, createExecutorRegistry, createMcpEnvironment, createRootHandle, createSandboxLineage, createScope, createScopeAnalyst, createShapeRegistry, createSupervisor, createVerifierEnvironment, createWaterfallCollector, defaultAnalystInstruction, defaultAuditorInstruction, definePersona, defineStrategy, depthDriver, deterministicCompletion, discriminatingMeans, driverChild, driverExecutorFactory, driverRuntime, equalKOnCost, extractLlmCallEvent, fanout, flatWidenGate, gateOnDeliverable, gitWorkspace, harvestCorpus, inlineSandboxClient, isDriverSpec, jjWorkspace, localShell, loopDispatch, loopUntil, mapSandboxEvent, materializeTreeView, nestedScopeSeamKey, observe, openSandboxRun, panel, pickChampion, pipeline, printBenchmarkReport, probeSandboxCapabilities, promotionGate, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderReport, replaySpawnTree, reportLoopUsage, runAgentic, runBenchmark, runInWorkspace, runPersonified, runStrategyEvolution, sample, sampleThenRefine, selectChampion, sentinelCompletion, serveCoordinationMcp, settledToIteration, spendFromUsageEvents, stopSentinel, strategyAuthorContract, supervisorSkill, trajectoryReport, verify, widen, withDriverExecutor };
3800
+ export { Agent, AgentRunSpec, AgentSpec, type AgenticOptions, type AgenticRunResult, type AgenticSurface, type AgenticTask, type AgenticTool, type AnytimeReport, type AnytimeStrategySummary, type AnytimeTaskCurve, type ArtifactHandle, type AssertTraceDerivedFindings, type AuditIntentInput, type AuditIntentOptions, type AuthorStrategyOptions, type AuthoredCoderHarness, type AuthoredProfile, type AuthoredStrategy, type BenchmarkCell, type BenchmarkConfig, type BenchmarkLift, type BenchmarkReport, type BenchmarkStrategySummary, type BenchmarkTaskRow, type BridgeSeam, Budget, type BudgetPool, type BudgetReadout, type ChampionPick, type ChampionPolicy, type CheckpointCapableBox, type CliSeam, type CliWorktreeSeam, type CoderDeliverableOptions, type CoderWinnerStrategy, type CombinatorShape, type CompletionAnalyst, type CompletionEvidence, type CompletionPolicy, type CompletionVerdict, type CoordinationDriverOptions, type CoordinationMcpHandle, type Corpus, type CorpusFilter, type CorpusRecord, type CreateScopeAnalystOptions, type CriuCapableClient, type DefinePersona, type DefinePersonaInput, type Deliverable, type DeliverableSpec, type DriverChat, type DriverMessage, type DriverToolCall, type DriverTurn, type Environment, type EqualKArm, type EqualKOnCost, type EqualKOnCostOptions, type EqualKVerdict, type EvolutionArchiveNode, type EvolutionAuthor, type EvolutionBandInfo, type EvolutionCandidate, type EvolutionGeneration, type EvolutionReport, ExecCtx, Executor, type ExecutorConfig, ExecutorFactory, ExecutorRegistry, type Fanout, type FanoutOptions, type FanoutSynthesis, type FanoutWinnerSelector, FileCorpus, FileResultBlobStore, FileSpawnJournal, type FlatWidenGate, type ForkCapableBox, type GitWorkspaceOptions, type HarvestCorpusOptions, type HarvestFailure, type HarvestReport, InMemoryCorpus, InMemoryResultBlobStore, InMemorySpawnJournal, type IntentAudit, Iteration, type LoopDispatchOptions, type LoopOptionsForDispatch, LoopResult, type LoopShape, LoopTokenUsage, type LoopUntil, type LoopUntilSpec, type LoopUntilState, type McpEndpoint, type McpEnvironmentOptions, type NestedScopeSeam, NodeId, type Observation, type ObserveInput, type ObserveOptions, type OpenSandboxRunOptions, type Outcome, type Panel, type PanelJudge, type PanelSpec, type PanelVerdict, type Persona, type PersonaContext, type PersonaExecutors, type Pipeline, type PipelineStage, type PromotionGateOptions, type PromotionVerdict, type RegistryAnalyzeProjection, type RenderCorpusToInstructions, type RenderCorpusToInstructionsOptions, type ReservationTicket, ResultBlobStore, RootHandle, RouterConfig, type RouterSeam, type RouterToolsSeam, type RunAgenticOptions, RunLoopOptions, type RunPersonified, type RunPersonifiedOptions, type SandboxCapabilities, SandboxClient, type SandboxLineage, type SandboxLineageHandle, type SandboxRun, type SandboxSeam, Scope, type ScopeAnalyst, type ScopeAnalyzeInput, type ScopeWidenGate, type SessionCapableBox, Settled, type ShapeBudget, type ShapeContext, type ShapeRegistry, type Shell, type ShotPersona, type ShotSpec, SpawnEvent, SpawnJournal, Spend, type SteerContext, type Strategy, type StrategyCtx, type StrategyEvolutionConfig, type StrategyResult, SupervisedResult, Supervisor, type SurfaceScore, ToolSpec, type TrajectoryNode, type TrajectoryReport, type TrajectoryReportFn, type TrajectoryReportOptions, TreeView, type TurnResult, UsageEvent, type UsageSink, type VerifierEnvironmentOptions, type Verify, type VerifySpec, type WaterfallCollector, type WaterfallReport, type WaterfallSpan, type Widen, type WidenDecision, type WidenLineage, type WidenSpec, type Workspace, type WorkspaceCommit, type WorkspaceRun, type WorktreeCliExecutorOptions, type WorktreeCoderFanoutOptions, type WorktreeCommandResult, type WorktreePatchArtifact, acquireSandbox, adaptiveRefine, anytimeReport, asAuthoredProfile, assertStrategyContract, assertTraceDerivedFindings, auditIntent, authorStrategy, authoredWorker, breadthDriver, buildSteerContext, builtinShapes, cliWorktreeExecutor, coderDeliverable, completionAuthorizes, contentAddress, coordinationDriverAgent, createBudgetPool, createExecutor, createExecutorRegistry, createMcpEnvironment, createRootHandle, createSandboxLineage, createScope, createScopeAnalyst, createShapeRegistry, createSupervisor, createVerifierEnvironment, createWaterfallCollector, createWorktreeCliExecutor, defaultAnalystInstruction, defaultAuditorInstruction, definePersona, defineStrategy, depthDriver, deterministicCompletion, discriminatingMeans, driverChild, driverExecutorFactory, driverRuntime, equalKOnCost, extractLlmCallEvent, fanout, flatWidenGate, gateOnDeliverable, gitWorkspace, harvestCorpus, inlineSandboxClient, isDriverSpec, jjWorkspace, localShell, loopDispatch, loopUntil, mapSandboxEvent, materializeTreeView, nestedScopeSeamKey, observe, openSandboxRun, panel, pickChampion, pipeline, printBenchmarkReport, probeSandboxCapabilities, promotionGate, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderReport, replaySpawnTree, reportLoopUsage, runAgentic, runBenchmark, runInWorkspace, runPersonified, runStrategyEvolution, sample, sampleThenRefine, selectChampion, sentinelCompletion, serveCoordinationMcp, settledToIteration, spendFromUsageEvents, stopSentinel, strategyAuthorContract, supervisorSkill, trajectoryReport, verify, widen, withDriverExecutor, worktreeCoderFanout };
package/dist/runtime.js CHANGED
@@ -17,6 +17,8 @@ import {
17
17
  breadthDriver,
18
18
  buildSteerContext,
19
19
  builtinShapes,
20
+ cliWorktreeExecutor,
21
+ coderDeliverable,
20
22
  completionAuthorizes,
21
23
  contentAddress,
22
24
  coordinationDriverAgent,
@@ -33,6 +35,7 @@ import {
33
35
  createSupervisor,
34
36
  createVerifierEnvironment,
35
37
  createWaterfallCollector,
38
+ createWorktreeCliExecutor,
36
39
  defaultAnalystInstruction,
37
40
  defaultAuditorInstruction,
38
41
  defaultSelectWinner,
@@ -96,13 +99,16 @@ import {
96
99
  trajectoryReport,
97
100
  verify,
98
101
  widen,
99
- withDriverExecutor
100
- } from "./chunk-JTH2FPCK.js";
102
+ withDriverExecutor,
103
+ worktreeCoderFanout
104
+ } from "./chunk-ZADWPBOE.js";
105
+ import "./chunk-3BI6PSP3.js";
101
106
  import "./chunk-WIR4HOOJ.js";
102
107
  import {
103
108
  extractLlmCallEvent,
104
109
  mapSandboxEvent
105
110
  } from "./chunk-VLF5RHEQ.js";
111
+ import "./chunk-GLMFBUKT.js";
106
112
  import "./chunk-G3RGMA7C.js";
107
113
  import "./chunk-DGUM43GV.js";
108
114
  export {
@@ -124,6 +130,8 @@ export {
124
130
  breadthDriver,
125
131
  buildSteerContext,
126
132
  builtinShapes,
133
+ cliWorktreeExecutor,
134
+ coderDeliverable,
127
135
  completionAuthorizes,
128
136
  contentAddress,
129
137
  coordinationDriverAgent,
@@ -140,6 +148,7 @@ export {
140
148
  createSupervisor,
141
149
  createVerifierEnvironment,
142
150
  createWaterfallCollector,
151
+ createWorktreeCliExecutor,
143
152
  defaultAnalystInstruction,
144
153
  defaultAuditorInstruction,
145
154
  defaultSelectWinner,
@@ -205,6 +214,7 @@ export {
205
214
  trajectoryReport,
206
215
  verify,
207
216
  widen,
208
- withDriverExecutor
217
+ withDriverExecutor,
218
+ worktreeCoderFanout
209
219
  };
210
220
  //# sourceMappingURL=runtime.js.map
package/dist/workflow.js CHANGED
@@ -2,12 +2,14 @@ import {
2
2
  createSandboxForSpec,
3
3
  describeSandboxPlacement,
4
4
  runLoop
5
- } from "./chunk-JTH2FPCK.js";
5
+ } from "./chunk-ZADWPBOE.js";
6
+ import "./chunk-3BI6PSP3.js";
6
7
  import "./chunk-WIR4HOOJ.js";
7
8
  import {
8
9
  ValidationError,
9
10
  extractLlmCallEvent
10
11
  } from "./chunk-VLF5RHEQ.js";
12
+ import "./chunk-GLMFBUKT.js";
11
13
  import "./chunk-G3RGMA7C.js";
12
14
  import "./chunk-DGUM43GV.js";
13
15