@tangle-network/agent-runtime 0.56.1 → 0.57.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.
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +1 -1
- package/dist/analyst-loop.d.ts +1 -1
- package/dist/{chunk-6XKXWA7H.js → chunk-6BOIKGSU.js} +2 -2
- package/dist/{chunk-F5XQA43K.js → chunk-NJST5D2G.js} +2 -2
- package/dist/{chunk-4H2FML7G.js → chunk-RLDUT4JL.js} +758 -191
- package/dist/chunk-RLDUT4JL.js.map +1 -0
- package/dist/{chunk-EXIV2C72.js → chunk-TVBXDW7C.js} +59 -79
- package/dist/chunk-TVBXDW7C.js.map +1 -0
- package/dist/{chunk-G4NIVG34.js → chunk-WFEQCRQP.js} +4 -3
- package/dist/chunk-WFEQCRQP.js.map +1 -0
- package/dist/{coder-COuOK8h8.d.ts → coder-CybltHEm.d.ts} +1 -1
- package/dist/{coordination-DWNGqygr.d.ts → coordination-BydGBQCZ.d.ts} +164 -4
- package/dist/{delegates-D9o5_VFj.d.ts → delegates-C94qchkz.d.ts} +8 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.js +4 -4
- package/dist/intelligence.d.ts +1 -1
- package/dist/{loop-runner-bin-CN2Se3jB.d.ts → loop-runner-bin-Noz7P-mS.d.ts} +3 -3
- package/dist/loop-runner-bin.d.ts +4 -4
- package/dist/loop-runner-bin.js +3 -3
- package/dist/loops.d.ts +7 -6
- package/dist/loops.js +13 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +20 -82
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-CoeLQ7Uo.d.ts → openai-tools-d4GKwgya.d.ts} +1 -1
- package/dist/profiles.d.ts +2 -2
- package/dist/{run-loop-DluzfJ2h.d.ts → run-loop-CcqfR_gy.d.ts} +1 -1
- package/dist/runtime.d.ts +255 -67
- package/dist/runtime.js +13 -1
- package/dist/{types-C8rNlxfV.d.ts → types-CUzjRFZ3.d.ts} +1 -1
- package/dist/workflow.d.ts +2 -2
- package/dist/workflow.js +1 -1
- package/package.json +2 -2
- package/skills/loop-writer/SKILL.md +1 -1
- package/skills/supervise/SKILL.md +1 -1
- package/dist/chunk-4H2FML7G.js.map +0 -1
- package/dist/chunk-EXIV2C72.js.map +0 -1
- package/dist/chunk-G4NIVG34.js.map +0 -1
- /package/dist/{chunk-6XKXWA7H.js.map → chunk-6BOIKGSU.js.map} +0 -0
- /package/dist/{chunk-F5XQA43K.js.map → chunk-NJST5D2G.js.map} +0 -0
package/dist/runtime.d.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
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 { 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-
|
|
4
|
-
export { Y as
|
|
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, a as CoordinationTools, A as AnalystRegistry, C as CoordinationEvent, l as QuestionPolicy, X as Supervisor } from './coordination-BydGBQCZ.js';
|
|
4
|
+
export { Y as BusEvent, Z as BusRecord, _ as BusStats, $ as EventBus, a0 as ExecutorContext, a1 as ExecutorResult, a2 as Handle, a3 as NodeSnapshot, a4 as NodeStatus, a5 as PublishOptions, a6 as Restart, a7 as RootSignal, a8 as Runtime, a9 as SpawnOpts, aa as SupervisorOpts, ab as WidenGate, ac as createEventBus } from './coordination-BydGBQCZ.js';
|
|
5
5
|
import { R as RuntimeHooks } from './runtime-hooks-C7JwKb9E.js';
|
|
6
|
-
import { ChatClient, AnalystFinding, DefaultVerdict, AgentProfile as AgentProfile$1, AnalystRunInputs } from '@tangle-network/agent-eval';
|
|
6
|
+
import { ChatClient, AnalystFinding, DefaultVerdict, AgentProfile as AgentProfile$1, AnalystRunInputs, DetectorSignal, StreamingDetector, buildTrajectory } from '@tangle-network/agent-eval';
|
|
7
7
|
export { DefaultVerdict } from '@tangle-network/agent-eval';
|
|
8
|
-
import { I as Iteration, S as SandboxClient, b as LoopResult,
|
|
9
|
-
export { D as Driver, F as LoopDecisionPayload, G as LoopEndedPayload, H as LoopIterationDispatchPayload, J as LoopIterationEndedPayload, M as LoopIterationStartedPayload, a as LoopLineageOptions, N as LoopPlanDescription, P as LoopPlanPayload, f as LoopSandboxPlacement, Q as LoopStartedPayload, T as LoopTeardownFailedPayload, g as LoopTraceEmitter,
|
|
8
|
+
import { I as Iteration, S as SandboxClient, b as LoopResult, e as LoopTokenUsage, R as RuntimeStreamEvent, A as AgentRunSpec, E as ExecCtx } from './types-CUzjRFZ3.js';
|
|
9
|
+
export { D as Driver, F as LoopDecisionPayload, G as LoopEndedPayload, H as LoopIterationDispatchPayload, J as LoopIterationEndedPayload, M as LoopIterationStartedPayload, a as LoopLineageOptions, N as LoopPlanDescription, P as LoopPlanPayload, f as LoopSandboxPlacement, Q as LoopStartedPayload, T as LoopTeardownFailedPayload, g as LoopTraceEmitter, d as LoopTraceEvent, L as LoopWinner, O as OutputAdapter, U as ValidationCtx, V as Validator } from './types-CUzjRFZ3.js';
|
|
10
10
|
import { Scenario, ProfileDispatchFn } from '@tangle-network/agent-eval/campaign';
|
|
11
|
-
import { R as RunLoopOptions } from './run-loop-
|
|
12
|
-
export { c as createSandboxForSpec, d as defaultSelectWinner, r as runLoop } from './run-loop-
|
|
11
|
+
import { R as RunLoopOptions } from './run-loop-CcqfR_gy.js';
|
|
12
|
+
export { c as createSandboxForSpec, d as defaultSelectWinner, r as runLoop } from './run-loop-CcqfR_gy.js';
|
|
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 { a as CoderCheckConstraints } from './coder-
|
|
16
|
+
import { a as CoderCheckConstraints } from './coder-CybltHEm.js';
|
|
17
17
|
import { L as LocalHarness, r as runLocalHarness } from './local-harness-BE_h8szs.js';
|
|
18
|
-
import '
|
|
18
|
+
import { stuckLoopView, toolWasteView } from '@tangle-network/agent-eval/pipelines';
|
|
19
|
+
import './delegates-C94qchkz.js';
|
|
19
20
|
import './substrate-CUgk7F7s.js';
|
|
20
21
|
import 'node:child_process';
|
|
21
22
|
|
|
@@ -115,7 +116,8 @@ declare class FileSpawnJournal implements SpawnJournal {
|
|
|
115
116
|
declare function replaySpawnTree(journal: SpawnJournal, blobs: ResultBlobStore, root: NodeId): Promise<Settled<unknown>[]>;
|
|
116
117
|
/**
|
|
117
118
|
* Materialize the live tree (`TreeView`) from a journaled event list for resume. Folds
|
|
118
|
-
* `spawned`/`settled`/`cancelled` into a per-node snapshot in `seq` order
|
|
119
|
+
* `spawned`/`settled`/`cancelled` into a per-node snapshot in `seq` order, then adds each
|
|
120
|
+
* `metered` event's driver-inference spend onto its node in a separate additive pass — so the
|
|
119
121
|
* resumed view matches what `scope.view` showed at the recorded cursor position.
|
|
120
122
|
*/
|
|
121
123
|
declare function materializeTreeView(events: SpawnEvent[]): TreeView;
|
|
@@ -2928,10 +2930,13 @@ interface ReservationTicket {
|
|
|
2928
2930
|
}
|
|
2929
2931
|
/** Post-reservation pool readout — the shape `Scope.budget` exposes. `tokensLeft`,
|
|
2930
2932
|
* `usdLeft`, and `reservedTokens` reflect committed-but-unsettled reservations;
|
|
2931
|
-
* `deadlineMs` is the ABSOLUTE wall-clock deadline (0 when the root set none).
|
|
2933
|
+
* `deadlineMs` is the ABSOLUTE wall-clock deadline (0 when the root set none).
|
|
2934
|
+
* `usdCapped` distinguishes a real `usdLeft <= 0` exhaustion from an uncapped pool (which always
|
|
2935
|
+
* reads `usdLeft: 0`) — the in-loop guard needs it to bound a usd-capped driver. */
|
|
2932
2936
|
type BudgetReadout = Readonly<{
|
|
2933
2937
|
tokensLeft: number;
|
|
2934
2938
|
usdLeft: number;
|
|
2939
|
+
usdCapped: boolean;
|
|
2935
2940
|
deadlineMs: number;
|
|
2936
2941
|
reservedTokens: number;
|
|
2937
2942
|
}>;
|
|
@@ -2960,6 +2965,17 @@ interface BudgetPool {
|
|
|
2960
2965
|
spendFrom(events: AsyncIterable<UsageEvent> | UsageEvent[]): Promise<Spend>;
|
|
2961
2966
|
/** The current readout, reflecting all outstanding reservations. */
|
|
2962
2967
|
readout(): BudgetReadout;
|
|
2968
|
+
/**
|
|
2969
|
+
* Record OBSERVED spend that did NOT go through reserve/reconcile — the driver's OWN inference
|
|
2970
|
+
* (its chat turns), which is real compute but not a spawned child. A direct `free → committed`
|
|
2971
|
+
* debit, so `total ≡ free + reserved + committed` is preserved: equal-k counts the driver's
|
|
2972
|
+
* tokens and the in-loop budget guard (`readout().tokensLeft`) sees them. `free` may go negative
|
|
2973
|
+
* when a run overspends — that is honest (the readout then signals exhaustion). It never throws:
|
|
2974
|
+
* the spend already happened, so accounting records reality; the in-loop guard prevents MORE.
|
|
2975
|
+
* The DURABLE record is the journal's `metered` event (written by `Scope.meter`); this debit
|
|
2976
|
+
* only makes the live `readout()` reflect driver inference for the in-loop guard.
|
|
2977
|
+
*/
|
|
2978
|
+
observe(spend: Spend): void;
|
|
2963
2979
|
/** Fail loud if any reservation is still open — the conserved-pool leak detector. Called at the
|
|
2964
2980
|
* supervisor's join barrier: once every child has settled, no ticket may remain (a leaked
|
|
2965
2981
|
* reservation would silently break `total ≡ free + reserved + committed`). */
|
|
@@ -2980,46 +2996,37 @@ declare function createBudgetPool(root: Budget, now?: () => number): BudgetPool;
|
|
|
2980
2996
|
/**
|
|
2981
2997
|
* @experimental
|
|
2982
2998
|
*
|
|
2983
|
-
* The worktree-
|
|
2984
|
-
* coding-harness CLI (claude / codex / opencode)
|
|
2985
|
-
*
|
|
2986
|
-
*
|
|
2987
|
-
*
|
|
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).
|
|
2999
|
+
* The ONE worktree-harness execution core. The physical act — run a supervisor-authored
|
|
3000
|
+
* `AgentProfile` on a local coding-harness CLI (claude / codex / opencode) against a fresh git
|
|
3001
|
+
* worktree off `repoRoot`, capture the diff, derive the test/typecheck PASS signals, then clean
|
|
3002
|
+
* up — lives here ONCE. Two executors adapt it to two ports without re-implementing it:
|
|
3003
|
+
* - `createWorktreeCliExecutor` — the `Scope`/`Supervisor` leaf `Executor`.
|
|
3004
|
+
* - `createInProcessExecutor` — the `runLoop` `SandboxClient` / coder-delegate path.
|
|
2994
3005
|
*
|
|
2995
|
-
*
|
|
2996
|
-
*
|
|
2997
|
-
*
|
|
2998
|
-
* 3. `captureWorktreeDiff` — `git diff` the worktree → the patch artifact.
|
|
2999
|
-
* 4. `removeWorktree` — on `teardown` (always; the loser of a fanout is dirty).
|
|
3006
|
+
* §1.5 by construction: the authored `profile.prompt.systemPrompt` + `profile.model.default`
|
|
3007
|
+
* reach the harness through `harnessInvocation` HERE, so neither port can drop them — the exact
|
|
3008
|
+
* bug that existed while the in-process path called `runLocalHarness` with only the task prompt.
|
|
3000
3009
|
*
|
|
3001
|
-
*
|
|
3002
|
-
*
|
|
3003
|
-
*
|
|
3004
|
-
*
|
|
3005
|
-
*
|
|
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`).
|
|
3010
|
+
* Lifecycle: `createWorktree` → `harnessInvocation` + `runLocalHarness` → `captureWorktreeDiff`
|
|
3011
|
+
* (BEFORE checks, so the patch is the harness's output, not polluted by files a test run writes)
|
|
3012
|
+
* → the configured test/typecheck commands in the live worktree → return the result + a `cleanup`
|
|
3013
|
+
* the caller invokes at its own teardown point. A throw cleans up before propagating, so a failed
|
|
3014
|
+
* run never leaks a worktree.
|
|
3008
3015
|
*/
|
|
3009
3016
|
|
|
3010
3017
|
/** Outcome of one verification command run in the worktree (test or typecheck). */
|
|
3011
3018
|
interface WorktreeCommandResult {
|
|
3012
3019
|
/** The shell command line that was run. */
|
|
3013
3020
|
command: string;
|
|
3014
|
-
/** Did the command exit 0? The PASS signal
|
|
3021
|
+
/** Did the command exit 0? The PASS signal a deliverable gate / coder output reads. */
|
|
3015
3022
|
passed: boolean;
|
|
3016
3023
|
/** OS exit code, or `null` when killed before exit. */
|
|
3017
3024
|
exitCode: number | null;
|
|
3018
3025
|
/** Combined stdout+stderr (capped) — surfaced in traces for diagnosis. */
|
|
3019
3026
|
output: string;
|
|
3020
3027
|
}
|
|
3021
|
-
/**
|
|
3022
|
-
interface
|
|
3028
|
+
/** The canonical result of one worktree-harness run, projected by each port to its own shape. */
|
|
3029
|
+
interface WorktreeHarnessResult {
|
|
3023
3030
|
/** The branch the worktree was cut on (`delegate/<runId>`). */
|
|
3024
3031
|
branch: string;
|
|
3025
3032
|
/** `git diff` of the worktree against its base — the unified patch the harness produced. */
|
|
@@ -3030,7 +3037,7 @@ interface WorktreePatchArtifact {
|
|
|
3030
3037
|
insertions: number;
|
|
3031
3038
|
deletions: number;
|
|
3032
3039
|
};
|
|
3033
|
-
/** The harness subprocess outcome
|
|
3040
|
+
/** The harness subprocess outcome. */
|
|
3034
3041
|
harness: {
|
|
3035
3042
|
name: LocalHarness;
|
|
3036
3043
|
exitCode: number | null;
|
|
@@ -3040,17 +3047,46 @@ interface WorktreePatchArtifact {
|
|
|
3040
3047
|
stdout: string;
|
|
3041
3048
|
stderr: string;
|
|
3042
3049
|
};
|
|
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
|
-
*/
|
|
3050
|
+
/** Verification signals derived in the live worktree (present only when commands were given). */
|
|
3049
3051
|
checks?: {
|
|
3050
3052
|
tests?: WorktreeCommandResult;
|
|
3051
3053
|
typecheck?: WorktreeCommandResult;
|
|
3052
3054
|
};
|
|
3053
3055
|
}
|
|
3056
|
+
/** The single shell-command-in-worktree runner seam (replaces the per-executor copies). */
|
|
3057
|
+
type WorktreeCheckRunner = (opts: {
|
|
3058
|
+
command: string;
|
|
3059
|
+
cwd: string;
|
|
3060
|
+
timeoutMs: number;
|
|
3061
|
+
signal?: AbortSignal;
|
|
3062
|
+
}) => Promise<{
|
|
3063
|
+
exitCode: number | null;
|
|
3064
|
+
output: string;
|
|
3065
|
+
}>;
|
|
3066
|
+
|
|
3067
|
+
/**
|
|
3068
|
+
* @experimental
|
|
3069
|
+
*
|
|
3070
|
+
* The worktree-CLI leaf executor — a supervisor-authored `AgentProfile` driving a local
|
|
3071
|
+
* coding-harness CLI (claude / codex / opencode) on its OWN git worktree, surfaced as the open
|
|
3072
|
+
* `Executor<Out>` port (`./types`). It is a LEAF executor: it plugs straight into the
|
|
3073
|
+
* `Scope`/`Supervisor` recursion and `gateOnDeliverable`, so it IS the canonical recursive path
|
|
3074
|
+
* (no `runLoop`/virtual-SandboxInstance shim in between).
|
|
3075
|
+
*
|
|
3076
|
+
* This is a THIN adapter: the physical act (worktree → profile-aware harness invocation → diff →
|
|
3077
|
+
* checks → cleanup) lives ONCE in `runWorktreeHarness` (`../../mcp/worktree-harness`), shared with
|
|
3078
|
+
* the `runLoop`/coder-delegate `createInProcessExecutor`. This executor only projects that core's
|
|
3079
|
+
* result onto the `Executor` port (artifact + spend) and owns the teardown point. The §1.5 payload
|
|
3080
|
+
* (authored systemPrompt + model) reaches the harness inside the core, not here.
|
|
3081
|
+
*
|
|
3082
|
+
* Token accounting: a harness CLI does not surface usage, so this executor is `budgetExempt: true`
|
|
3083
|
+
* — its spend is NOT metered against the conserved pool and its iterations are EXCLUDED from the
|
|
3084
|
+
* equal-k arms by construction (mirrors `cliExecutor`).
|
|
3085
|
+
*/
|
|
3086
|
+
|
|
3087
|
+
/** Terminal artifact of one worktree-CLI run — the canonical worktree-harness result (the captured
|
|
3088
|
+
* diff + the harness's run record + the derived checks). */
|
|
3089
|
+
type WorktreePatchArtifact = WorktreeHarnessResult;
|
|
3054
3090
|
/** @experimental */
|
|
3055
3091
|
interface WorktreeCliExecutorOptions {
|
|
3056
3092
|
/** Absolute path to the git checkout the worktree is cut from. */
|
|
@@ -3080,26 +3116,16 @@ interface WorktreeCliExecutorOptions {
|
|
|
3080
3116
|
runGit?: GitRunner;
|
|
3081
3117
|
/** Test seam — inject the harness runner so unit tests script a `LocalHarnessResult`. */
|
|
3082
3118
|
runHarness?: typeof runLocalHarness;
|
|
3083
|
-
/**
|
|
3084
|
-
*
|
|
3085
|
-
|
|
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
|
-
}>;
|
|
3119
|
+
/** Test seam — inject the verification-command runner so unit tests script test/typecheck
|
|
3120
|
+
* outcomes without spawning a real shell. Defaults to a `/bin/sh -c` spawn in the worktree. */
|
|
3121
|
+
runCommand?: WorktreeCheckRunner;
|
|
3096
3122
|
}
|
|
3097
3123
|
/**
|
|
3098
|
-
* Build a worktree-CLI leaf `Executor`. Per-spawn (a fresh worktree + abort + teardown each),
|
|
3099
|
-
*
|
|
3124
|
+
* Build a worktree-CLI leaf `Executor`. Per-spawn (a fresh worktree + abort + teardown each), so a
|
|
3125
|
+
* fanout of N profiles = N parallel worktrees that never clobber each other.
|
|
3100
3126
|
*
|
|
3101
|
-
* Fail-loud: an empty `repoRoot`/`harness`/`taskPrompt` throws at construction (
|
|
3102
|
-
*
|
|
3127
|
+
* Fail-loud: an empty `repoRoot`/`harness`/`taskPrompt` throws at construction. `resultArtifact()`
|
|
3128
|
+
* before `execute()` resolves throws.
|
|
3103
3129
|
*
|
|
3104
3130
|
* @experimental
|
|
3105
3131
|
*/
|
|
@@ -3252,6 +3278,15 @@ interface DriverTurn {
|
|
|
3252
3278
|
readonly toolCalls?: ReadonlyArray<DriverToolCall>;
|
|
3253
3279
|
/** The driver's natural-language output — the answer when there are no tool calls. */
|
|
3254
3280
|
readonly content?: string;
|
|
3281
|
+
/** The driver LLM's OWN token usage for THIS turn — metered against the conserved pool so the
|
|
3282
|
+
* driver's inference counts toward equal-k AND the in-loop budget guard. Omit for a scripted/
|
|
3283
|
+
* mock turn (no real inference); production `routerDriverChat` forwards it from the router. */
|
|
3284
|
+
readonly usage?: {
|
|
3285
|
+
readonly input: number;
|
|
3286
|
+
readonly output: number;
|
|
3287
|
+
};
|
|
3288
|
+
/** The turn's inference cost (usd), when the provider priced it. */
|
|
3289
|
+
readonly costUsd?: number;
|
|
3255
3290
|
}
|
|
3256
3291
|
/** The injected driver-LLM seam: one turn over the conversation + the coordination tool specs. */
|
|
3257
3292
|
interface DriverChat {
|
|
@@ -3278,8 +3313,14 @@ interface CoordinationDriverOptions {
|
|
|
3278
3313
|
/** The driver's stance — a string, or built from the task (the worker-driver prompt /
|
|
3279
3314
|
* the generator). INJECTED so the prompt is a pluggable, optimizable role. */
|
|
3280
3315
|
readonly systemPrompt: string | ((task: unknown) => string);
|
|
3281
|
-
/** Max driver turns before the loop force-finalizes on the best settled child. Default 16.
|
|
3316
|
+
/** Max driver turns before the loop force-finalizes on the best settled child. Default 16.
|
|
3317
|
+
* `0` lifts the turn-COUNT cap: the loop is bounded instead by the conserved budget pool,
|
|
3318
|
+
* an absolute deadline, the driver's own stop, and abort (checked in-loop). A finite
|
|
3319
|
+
* anti-runaway tripwire still guards a degenerate driver that loops on a no-spawn tool. */
|
|
3282
3320
|
readonly maxTurns?: number;
|
|
3321
|
+
/** Injected clock for the in-loop absolute-deadline guard — keeps the deadline check
|
|
3322
|
+
* deterministic in tests. Defaults to `Date.now`. */
|
|
3323
|
+
readonly now?: () => number;
|
|
3283
3324
|
}
|
|
3284
3325
|
/**
|
|
3285
3326
|
* Build the intelligent recursive driver. Its `act` is the LLM tool-loop; spawn it as a
|
|
@@ -3290,7 +3331,7 @@ declare function coordinationDriverAgent(opts: CoordinationDriverOptions): Agent
|
|
|
3290
3331
|
/**
|
|
3291
3332
|
* @experimental
|
|
3292
3333
|
*
|
|
3293
|
-
* Serve the coordination verbs (spawn_worker /
|
|
3334
|
+
* Serve the coordination verbs (spawn_worker / await_event / observe_worker / steer_worker / stop)
|
|
3294
3335
|
* as a real HTTP MCP server over a LIVE `Scope`. This is the keystone that lets a coding-harness
|
|
3295
3336
|
* agent (opencode via the cli-bridge, claude-code, codex) BE the supervisor: it mounts this MCP
|
|
3296
3337
|
* (`mcp.mcpServers.coordination`) and calls `spawn_worker` as a native tool, which lands on
|
|
@@ -3313,6 +3354,12 @@ interface CoordinationMcpHandle {
|
|
|
3313
3354
|
outRef?: string;
|
|
3314
3355
|
}>;
|
|
3315
3356
|
isStopped(): boolean;
|
|
3357
|
+
/** The full ordered bus-event log — observability audit + replay trail. */
|
|
3358
|
+
history: CoordinationTools['history'];
|
|
3359
|
+
/** Bus throughput counters for live dashboards. */
|
|
3360
|
+
stats: CoordinationTools['stats'];
|
|
3361
|
+
/** Raise a `finding` on the bus from an online detector watching a worker's live pipe. */
|
|
3362
|
+
raiseFinding: CoordinationTools['raiseFinding'];
|
|
3316
3363
|
close(): Promise<void>;
|
|
3317
3364
|
}
|
|
3318
3365
|
/** Stand up the coordination MCP over a live scope. The HOST address is `127.0.0.1` (the bridge runs
|
|
@@ -3324,8 +3371,51 @@ declare function serveCoordinationMcp(opts: {
|
|
|
3324
3371
|
perWorker: Budget;
|
|
3325
3372
|
port?: number;
|
|
3326
3373
|
host?: string;
|
|
3374
|
+
/** Trace-analyst lenses the driver can run (`run_analyst`) or auto-fire on settle. */
|
|
3375
|
+
analysts?: AnalystRegistry;
|
|
3376
|
+
/** Analyst kinds to auto-run when a worker settles `done` — findings flow up the bus. */
|
|
3377
|
+
analyzeOnSettle?: ReadonlyArray<string>;
|
|
3378
|
+
/** Pass-through subscriber for every bus event (settled / question / finding). */
|
|
3379
|
+
onEvent?: (event: CoordinationEvent) => void | Promise<void>;
|
|
3380
|
+
questionPolicy?: QuestionPolicy;
|
|
3327
3381
|
}): Promise<CoordinationMcpHandle>;
|
|
3328
3382
|
|
|
3383
|
+
/**
|
|
3384
|
+
* @experimental
|
|
3385
|
+
*
|
|
3386
|
+
* The online analyst on the worker pipe. As a worker streams its tool calls, this folds each one
|
|
3387
|
+
* through agent-eval's streaming detector kernel (`repeatedActionDetector` etc. — the SAME kernel the
|
|
3388
|
+
* control loop uses, published in @tangle-network/agent-eval) and fires `onSignal` the moment one
|
|
3389
|
+
* trips. The wiring point: `onSignal` raises a `finding` on the coordination bus, so the driver learns
|
|
3390
|
+
* mid-round that its worker is stuck — instead of finding out only at settle.
|
|
3391
|
+
*
|
|
3392
|
+
* Detection logic + the failure taxonomy live in agent-eval (substrate); this module is the thin
|
|
3393
|
+
* runtime adapter that projects a live tool call into a `DetectorEvent` (the tool name + `argHash` of
|
|
3394
|
+
* its args → an action fingerprint) and pumps the detectors. No detection logic is reimplemented here.
|
|
3395
|
+
*/
|
|
3396
|
+
|
|
3397
|
+
interface ToolStep {
|
|
3398
|
+
readonly toolName: string;
|
|
3399
|
+
readonly args: unknown;
|
|
3400
|
+
/** Whether the tool call errored (drives error-streak detection). Omit/`'ok'` when unknown. */
|
|
3401
|
+
readonly status?: 'ok' | 'error';
|
|
3402
|
+
}
|
|
3403
|
+
interface DetectorMonitor {
|
|
3404
|
+
/** Fold one tool step through the detectors; returns (and fires `onSignal` for) every signal. */
|
|
3405
|
+
observeToolStep(step: ToolStep): DetectorSignal[];
|
|
3406
|
+
reset(): void;
|
|
3407
|
+
}
|
|
3408
|
+
interface DetectorMonitorOptions {
|
|
3409
|
+
/** The detectors to run online. Defaults to a stuck-loop + error-streak panel. */
|
|
3410
|
+
readonly detectors?: ReadonlyArray<StreamingDetector>;
|
|
3411
|
+
/** Fired for each signal a detector raises — the seam that raises a `finding` on the bus. */
|
|
3412
|
+
readonly onSignal?: (signal: DetectorSignal) => void | Promise<void>;
|
|
3413
|
+
}
|
|
3414
|
+
/** The default online panel for a tool-call pipe: a worker repeating the same call, or hammering
|
|
3415
|
+
* consecutive errors. (No-progress needs a domain progress-probe, so it is opt-in, not default.) */
|
|
3416
|
+
declare function defaultToolDetectors(): StreamingDetector[];
|
|
3417
|
+
declare function createDetectorMonitor(opts?: DetectorMonitorOptions): DetectorMonitor;
|
|
3418
|
+
|
|
3329
3419
|
/**
|
|
3330
3420
|
* @experimental
|
|
3331
3421
|
*
|
|
@@ -3407,6 +3497,56 @@ declare const driverExecutorFactory: ExecutorFactory<unknown>;
|
|
|
3407
3497
|
*/
|
|
3408
3498
|
declare function withDriverExecutor(base: ExecutorRegistry): ExecutorRegistry;
|
|
3409
3499
|
|
|
3500
|
+
/**
|
|
3501
|
+
* @experimental
|
|
3502
|
+
*
|
|
3503
|
+
* The worker-side receive end of the down-leg: a per-worker inbox an executor exposes as
|
|
3504
|
+
* `Executor.deliver`. The driver's `steer_worker` / `answer_question` land here,
|
|
3505
|
+
* and the worker's agent loop drains them at two points (Drew's two delivery modes):
|
|
3506
|
+
*
|
|
3507
|
+
* - QUEUED (default): the message accumulates and is FLUSHED at the next step boundary — folded
|
|
3508
|
+
* into the conversation before the next think. A worker is also forced to flush BEFORE it may
|
|
3509
|
+
* settle, so it can never finish while a steer/answer it never read is still pending.
|
|
3510
|
+
* - FORCEFUL (`interrupt: true`): trips `freshInterrupt()`'s signal so the loop can abort its
|
|
3511
|
+
* in-flight turn immediately, then re-plan with the message folded in — breaking the worker out
|
|
3512
|
+
* of a wrong path mid-task instead of waiting for it to finish the step.
|
|
3513
|
+
*
|
|
3514
|
+
* `deliver` never throws — a malformed message is ignored, per the `Executor.deliver` contract.
|
|
3515
|
+
*/
|
|
3516
|
+
interface InboxMessage {
|
|
3517
|
+
readonly kind: 'steer' | 'answer';
|
|
3518
|
+
readonly text: string;
|
|
3519
|
+
/** Forceful messages abort the in-flight turn; queued ones wait for the boundary flush. */
|
|
3520
|
+
readonly interrupt: boolean;
|
|
3521
|
+
/** Present for an `answer` — the question id it resolves. */
|
|
3522
|
+
readonly questionId?: string;
|
|
3523
|
+
}
|
|
3524
|
+
interface Inbox {
|
|
3525
|
+
/** The `Executor.deliver` implementation — accept a raw down-message from `Scope.send`. */
|
|
3526
|
+
deliver(msg: unknown): void;
|
|
3527
|
+
/** Remove and return all pending messages (the flush). */
|
|
3528
|
+
drain(): InboxMessage[];
|
|
3529
|
+
pending(): number;
|
|
3530
|
+
/** Open a fresh per-turn interrupt signal; a later forceful `deliver` aborts it. The loop links
|
|
3531
|
+
* this into the signal it passes to its inference call, then re-plans when it fires. */
|
|
3532
|
+
freshInterrupt(): AbortSignal;
|
|
3533
|
+
/** Render drained messages as ONE operator turn to fold into the worker's conversation. */
|
|
3534
|
+
fold(messages: ReadonlyArray<InboxMessage>): string;
|
|
3535
|
+
}
|
|
3536
|
+
declare function createInbox(): Inbox;
|
|
3537
|
+
|
|
3538
|
+
/**
|
|
3539
|
+
* The router-backed driver-LLM seam: adapt the OpenAI-compatible router's tool-calling chat
|
|
3540
|
+
* to the `DriverChat` port a `coordinationDriverAgent` drives. Tests script a mock `DriverChat`;
|
|
3541
|
+
* production passes `routerDriverChat(cfg)` so the driver's spawn/observe/steer/await/stop turns
|
|
3542
|
+
* are real router tool-calls. This is the one turnkey piece a consumer needs to run an in-process
|
|
3543
|
+
* supervisor (the driver brain) — everything else is `createSupervisor().run(...)`.
|
|
3544
|
+
*/
|
|
3545
|
+
|
|
3546
|
+
declare function routerDriverChat(c: RouterConfig, opts?: {
|
|
3547
|
+
temperature?: number;
|
|
3548
|
+
}): DriverChat;
|
|
3549
|
+
|
|
3410
3550
|
/**
|
|
3411
3551
|
* @experimental
|
|
3412
3552
|
*
|
|
@@ -3514,6 +3654,13 @@ interface RouterToolsSeam {
|
|
|
3514
3654
|
model?: string;
|
|
3515
3655
|
tools: ReadonlyArray<ToolSpec>;
|
|
3516
3656
|
executeToolCall: (name: string, args: Record<string, unknown>, task: unknown) => Promise<string>;
|
|
3657
|
+
/** Online observer of each tool step — the seam a `DetectorMonitor` taps to watch the live pipe
|
|
3658
|
+
* (raise a `finding` when the worker loops/errors). Called after every tool call resolves. */
|
|
3659
|
+
onToolStep?: (step: {
|
|
3660
|
+
toolName: string;
|
|
3661
|
+
args: Record<string, unknown>;
|
|
3662
|
+
status: 'ok' | 'error';
|
|
3663
|
+
}) => void;
|
|
3517
3664
|
/** Max inference turns. Default 200 (runaway backstop — set far above any
|
|
3518
3665
|
* legitimate workflow). For tighter per-workflow limits use a cost budget
|
|
3519
3666
|
* or wall-clock deadline at the call site. */
|
|
@@ -3687,9 +3834,9 @@ declare function settledToIteration<Out>(settled: Settled<Out>): Iteration<unkno
|
|
|
3687
3834
|
* no-winner; it does not restart anything.
|
|
3688
3835
|
*
|
|
3689
3836
|
* Selection lives in the driver, not here (selector≠judge): `act` returns the synthesized
|
|
3690
|
-
* winner `Out`. The supervisor content-addresses that `Out` for its replay `outRef`,
|
|
3691
|
-
*
|
|
3692
|
-
* not re-rank children behind the driver's back.
|
|
3837
|
+
* winner `Out`. The supervisor content-addresses that `Out` for its replay `outRef`, reads
|
|
3838
|
+
* `spentTotal` off the journal (`settled` child work + `metered` driver inference), and wraps
|
|
3839
|
+
* it as a typed `winner` — it does not re-rank children behind the driver's back.
|
|
3693
3840
|
*/
|
|
3694
3841
|
|
|
3695
3842
|
declare function createSupervisor<Task, Out>(): Supervisor<Task, Out>;
|
|
@@ -3702,6 +3849,47 @@ declare function createSupervisor<Task, Out>(): Supervisor<Task, Out>;
|
|
|
3702
3849
|
*/
|
|
3703
3850
|
declare function createRootHandle<Out>(): RootHandle<Out>;
|
|
3704
3851
|
|
|
3852
|
+
/**
|
|
3853
|
+
* @experimental
|
|
3854
|
+
*
|
|
3855
|
+
* The settle-time trace analyzer. Captures a worker's tool steps and, when it settles, replays them
|
|
3856
|
+
* as agent-eval spans into an in-memory `TraceStore` and runs agent-eval's PUBLISHED batch analyzers
|
|
3857
|
+
* over them — `buildTrajectory` (structured run summary), `stuckLoopView` (full-run repeated-call
|
|
3858
|
+
* view, complementing the ONLINE consecutive detector), and `toolWasteView` (waste ratio). The result
|
|
3859
|
+
* is the "parent runs trace analyzers over the whole loop trace at settle" piece, reusing agent-eval —
|
|
3860
|
+
* no analysis logic is reimplemented here; this is the thin adapter that bridges live tool steps into
|
|
3861
|
+
* the substrate's trace model.
|
|
3862
|
+
*
|
|
3863
|
+
* Pairs with `createDetectorMonitor` (the ONLINE pipe watcher): feed both from the worker's `onToolStep`
|
|
3864
|
+
* seam — the monitor raises findings mid-run, the recorder produces the post-hoc trajectory at settle.
|
|
3865
|
+
*/
|
|
3866
|
+
|
|
3867
|
+
interface RecordedToolStep {
|
|
3868
|
+
readonly toolName: string;
|
|
3869
|
+
readonly args: unknown;
|
|
3870
|
+
readonly status?: 'ok' | 'error';
|
|
3871
|
+
readonly result?: unknown;
|
|
3872
|
+
}
|
|
3873
|
+
interface TrajectoryAnalysis {
|
|
3874
|
+
/** Structured run summary (tool-call count, step order). Steps are recorded at a single timestamp
|
|
3875
|
+
* — the moment the tool call resolved — so per-span duration is 0; loop/waste detection keys on
|
|
3876
|
+
* call PATTERNS + cross-span windows, not individual durations. */
|
|
3877
|
+
readonly trajectory: Awaited<ReturnType<typeof buildTrajectory>>;
|
|
3878
|
+
/** Full-run repeated-call view (total occurrences + window), distinct from the online consecutive
|
|
3879
|
+
* detector — catches a loop that is interleaved with other calls. */
|
|
3880
|
+
readonly stuckLoop: Awaited<ReturnType<typeof stuckLoopView>>;
|
|
3881
|
+
/** Wasted-vs-total tool-call ratio for the run. */
|
|
3882
|
+
readonly toolWaste: Awaited<ReturnType<typeof toolWasteView>>;
|
|
3883
|
+
}
|
|
3884
|
+
interface TrajectoryRecorder {
|
|
3885
|
+
/** Capture one tool step (feed from the same `onToolStep` seam as the online monitor). */
|
|
3886
|
+
observeToolStep(step: RecordedToolStep): void;
|
|
3887
|
+
/** Replay the captured steps as agent-eval spans and run the batch analyzers over them. */
|
|
3888
|
+
analyze(): Promise<TrajectoryAnalysis>;
|
|
3889
|
+
reset(): void;
|
|
3890
|
+
}
|
|
3891
|
+
declare function createTrajectoryRecorder(runId: string, now?: () => number): TrajectoryRecorder;
|
|
3892
|
+
|
|
3705
3893
|
/**
|
|
3706
3894
|
* createVerifierEnvironment — ANY checkable task as an `Environment`, no tool surface
|
|
3707
3895
|
* required. The generalization piece: EOPS/commit0-style domains have tools that mutate
|
|
@@ -3797,4 +3985,4 @@ declare function runInWorkspace<T>(ws: Workspace, body: (cwd: string) => Promise
|
|
|
3797
3985
|
commitOnInvalid?: boolean;
|
|
3798
3986
|
}): Promise<WorkspaceRun<T>>;
|
|
3799
3987
|
|
|
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 };
|
|
3988
|
+
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 DetectorMonitor, type DetectorMonitorOptions, 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 Inbox, type InboxMessage, 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 RecordedToolStep, 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 ToolStep, type TrajectoryAnalysis, type TrajectoryNode, type TrajectoryRecorder, 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, createDetectorMonitor, createExecutor, createExecutorRegistry, createInbox, createMcpEnvironment, createRootHandle, createSandboxLineage, createScope, createScopeAnalyst, createShapeRegistry, createSupervisor, createTrajectoryRecorder, createVerifierEnvironment, createWaterfallCollector, createWorktreeCliExecutor, defaultAnalystInstruction, defaultAuditorInstruction, defaultToolDetectors, 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, routerDriverChat, 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
|
@@ -23,8 +23,11 @@ import {
|
|
|
23
23
|
contentAddress,
|
|
24
24
|
coordinationDriverAgent,
|
|
25
25
|
createBudgetPool,
|
|
26
|
+
createDetectorMonitor,
|
|
27
|
+
createEventBus,
|
|
26
28
|
createExecutor,
|
|
27
29
|
createExecutorRegistry,
|
|
30
|
+
createInbox,
|
|
28
31
|
createMcpEnvironment,
|
|
29
32
|
createRootHandle,
|
|
30
33
|
createSandboxForSpec,
|
|
@@ -33,12 +36,14 @@ import {
|
|
|
33
36
|
createScopeAnalyst,
|
|
34
37
|
createShapeRegistry,
|
|
35
38
|
createSupervisor,
|
|
39
|
+
createTrajectoryRecorder,
|
|
36
40
|
createVerifierEnvironment,
|
|
37
41
|
createWaterfallCollector,
|
|
38
42
|
createWorktreeCliExecutor,
|
|
39
43
|
defaultAnalystInstruction,
|
|
40
44
|
defaultAuditorInstruction,
|
|
41
45
|
defaultSelectWinner,
|
|
46
|
+
defaultToolDetectors,
|
|
42
47
|
definePersona,
|
|
43
48
|
defineStrategy,
|
|
44
49
|
depthDriver,
|
|
@@ -79,6 +84,7 @@ import {
|
|
|
79
84
|
reportLoopUsage,
|
|
80
85
|
routerChatWithTools,
|
|
81
86
|
routerChatWithUsage,
|
|
87
|
+
routerDriverChat,
|
|
82
88
|
routerToolLoop,
|
|
83
89
|
runAgentic,
|
|
84
90
|
runBenchmark,
|
|
@@ -101,7 +107,7 @@ import {
|
|
|
101
107
|
widen,
|
|
102
108
|
withDriverExecutor,
|
|
103
109
|
worktreeCoderFanout
|
|
104
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-RLDUT4JL.js";
|
|
105
111
|
import "./chunk-7QYOXFCD.js";
|
|
106
112
|
import "./chunk-WIR4HOOJ.js";
|
|
107
113
|
import {
|
|
@@ -136,8 +142,11 @@ export {
|
|
|
136
142
|
contentAddress,
|
|
137
143
|
coordinationDriverAgent,
|
|
138
144
|
createBudgetPool,
|
|
145
|
+
createDetectorMonitor,
|
|
146
|
+
createEventBus,
|
|
139
147
|
createExecutor,
|
|
140
148
|
createExecutorRegistry,
|
|
149
|
+
createInbox,
|
|
141
150
|
createMcpEnvironment,
|
|
142
151
|
createRootHandle,
|
|
143
152
|
createSandboxForSpec,
|
|
@@ -146,12 +155,14 @@ export {
|
|
|
146
155
|
createScopeAnalyst,
|
|
147
156
|
createShapeRegistry,
|
|
148
157
|
createSupervisor,
|
|
158
|
+
createTrajectoryRecorder,
|
|
149
159
|
createVerifierEnvironment,
|
|
150
160
|
createWaterfallCollector,
|
|
151
161
|
createWorktreeCliExecutor,
|
|
152
162
|
defaultAnalystInstruction,
|
|
153
163
|
defaultAuditorInstruction,
|
|
154
164
|
defaultSelectWinner,
|
|
165
|
+
defaultToolDetectors,
|
|
155
166
|
definePersona,
|
|
156
167
|
defineStrategy,
|
|
157
168
|
depthDriver,
|
|
@@ -194,6 +205,7 @@ export {
|
|
|
194
205
|
reportLoopUsage,
|
|
195
206
|
routerChatWithTools,
|
|
196
207
|
routerChatWithUsage,
|
|
208
|
+
routerDriverChat,
|
|
197
209
|
routerToolLoop,
|
|
198
210
|
runAgentic,
|
|
199
211
|
runBenchmark,
|
|
@@ -1097,4 +1097,4 @@ interface ExecCtx {
|
|
|
1097
1097
|
parentSpanId?: string;
|
|
1098
1098
|
}
|
|
1099
1099
|
|
|
1100
|
-
export { type AgentRunSpec as A, type BackendErrorDetail as B, startRuntimeRun as C, type Driver as D, type ExecCtx as E, type LoopDecisionPayload as F, type LoopEndedPayload as G, type LoopIterationDispatchPayload as H, type Iteration as I, type LoopIterationEndedPayload as J, type KnowledgeReadinessDecision as K, type LoopWinner as L, type LoopIterationStartedPayload as M, type LoopPlanDescription as N, type OutputAdapter as O, type LoopPlanPayload as P, type LoopStartedPayload as Q, type RuntimeStreamEvent as R, type SandboxClient as S, type LoopTeardownFailedPayload as T, type ValidationCtx as U, type Validator as V, type LoopLineageOptions as a, type LoopResult as b, type OpenAIChatTool as c, type
|
|
1100
|
+
export { type AgentRunSpec as A, type BackendErrorDetail as B, startRuntimeRun as C, type Driver as D, type ExecCtx as E, type LoopDecisionPayload as F, type LoopEndedPayload as G, type LoopIterationDispatchPayload as H, type Iteration as I, type LoopIterationEndedPayload as J, type KnowledgeReadinessDecision as K, type LoopWinner as L, type LoopIterationStartedPayload as M, type LoopPlanDescription as N, type OutputAdapter as O, type LoopPlanPayload as P, type LoopStartedPayload as Q, type RuntimeStreamEvent as R, type SandboxClient as S, type LoopTeardownFailedPayload as T, type ValidationCtx as U, type Validator as V, type LoopLineageOptions as a, type LoopResult as b, type OpenAIChatTool as c, type LoopTraceEvent as d, type LoopTokenUsage as e, type LoopSandboxPlacement as f, type LoopTraceEmitter as g, type AgentBackendInput as h, type AgentExecutionBackend as i, type OpenAIChatToolChoice as j, type AgentBackendContext as k, type RunAgentTaskOptions as l, type AgentTaskRunResult as m, type RunAgentTaskStreamOptions as n, type AgentRuntimeEvent as o, type AgentTaskStatus as p, type RuntimeSessionStore as q, type RuntimeSession as r, type AgentAdapter as s, type AgentKnowledgeProvider as t, type AgentRuntimeEventSink as u, type AgentTaskContext as v, type AgentTaskSpec as w, type RuntimeRunHandle as x, type RuntimeRunPersistenceAdapter as y, type RuntimeRunRow as z };
|
package/dist/workflow.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AgentProfile, CreateSandboxOptions, PromptOptions, TaskOptions, SandboxEvent } from '@tangle-network/sandbox';
|
|
2
|
-
import { S as SandboxClient, O as OutputAdapter, f as LoopSandboxPlacement, b as LoopResult } from './types-
|
|
3
|
-
import { R as RunLoopOptions } from './run-loop-
|
|
2
|
+
import { S as SandboxClient, O as OutputAdapter, f as LoopSandboxPlacement, b as LoopResult } from './types-CUzjRFZ3.js';
|
|
3
|
+
import { R as RunLoopOptions } from './run-loop-CcqfR_gy.js';
|
|
4
4
|
import '@tangle-network/agent-eval';
|
|
5
5
|
import './runtime-hooks-C7JwKb9E.js';
|
|
6
6
|
|
package/dist/workflow.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"description": "Shared task-lifecycle skeleton for agents: a recursive loop kernel for chat turns, one-shot tasks, and multi-attempt loops, with trace capture and eval-gated self-improvement. Domain behavior lives in adapters; scoring and ship-gates in @tangle-network/agent-eval.",
|
|
5
5
|
"homepage": "https://github.com/tangle-network/agent-runtime#readme",
|
|
6
6
|
"repository": {
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
108
|
"@biomejs/biome": "^2.4.15",
|
|
109
|
-
"@tangle-network/agent-eval": "^0.
|
|
109
|
+
"@tangle-network/agent-eval": "^0.93.0",
|
|
110
110
|
"@tangle-network/sandbox": "^0.6.0",
|
|
111
111
|
"@types/node": "^25.9.3",
|
|
112
112
|
"playwright": "^1.61.0",
|
|
@@ -110,7 +110,7 @@ const result = await createSupervisor<Task, Output>().run(driver, task, supervis
|
|
|
110
110
|
```
|
|
111
111
|
|
|
112
112
|
When the driver lives in a sandbox, expose the same verbs through
|
|
113
|
-
`createCoordinationTools`: `spawn_worker`, `
|
|
113
|
+
`createCoordinationTools`: `spawn_worker`, `await_event`, `observe_worker`,
|
|
114
114
|
`steer_worker`, `list_questions`, `answer_question`, `ask_parent`, `stop`, and
|
|
115
115
|
optional analyst tools.
|
|
116
116
|
|