@tangle-network/agent-runtime 0.68.0 → 0.70.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/README.md +81 -13
- package/dist/agent.d.ts +4 -5
- package/dist/agent.js +3 -6
- package/dist/agent.js.map +1 -1
- package/dist/chunk-BYZCXQHF.js +474 -0
- package/dist/chunk-BYZCXQHF.js.map +1 -0
- package/dist/{chunk-OYU5LR4T.js → chunk-EDCVUZZC.js} +2 -2
- package/dist/{chunk-QNUEFNU7.js → chunk-L5ZFBVT6.js} +6 -6
- package/dist/chunk-L5ZFBVT6.js.map +1 -0
- package/dist/{chunk-VKUHUFX7.js → chunk-QXWGSDAQ.js} +914 -590
- package/dist/chunk-QXWGSDAQ.js.map +1 -0
- package/dist/{chunk-LTEF2LYD.js → chunk-ZNQVMMR5.js} +3 -3
- package/dist/{coordination-Curpzeyc.d.ts → coordination-C7WxwHXq.d.ts} +8 -1
- package/dist/{delegates-CLFNAKyi.d.ts → delegates-DqAgo32T.d.ts} +105 -10
- package/dist/{improvement-adapter-BC4HhuAR.d.ts → improvement-adapter-BVuMragr.d.ts} +1 -1
- package/dist/index.d.ts +439 -100
- package/dist/index.js +583 -125
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +2 -3
- package/dist/{loop-runner-bin-B6dzNZC8.d.ts → loop-runner-bin-B0NeLTRd.d.ts} +4 -4
- package/dist/loop-runner-bin.d.ts +7 -10
- package/dist/loop-runner-bin.js +4 -7
- package/dist/loops.d.ts +3149 -16
- package/dist/loops.js +34 -63
- package/dist/mcp/bin.js +14 -16
- package/dist/mcp/bin.js.map +1 -1
- package/dist/mcp/index.d.ts +8 -12
- package/dist/mcp/index.js +16 -19
- package/dist/mcp/index.js.map +1 -1
- package/dist/{openai-tools-CA2N3-Ak.d.ts → openai-tools-DPx9Gzvn.d.ts} +1 -1
- package/dist/profiles.d.ts +94 -6
- package/dist/profiles.js +320 -9
- package/dist/profiles.js.map +1 -1
- package/dist/{router-client-30Y_pca8.d.ts → router-client-C7kp_ECN.d.ts} +37 -1
- package/dist/{substrate-CUgk7F7s.d.ts → substrate-BoRXgvka.d.ts} +52 -1
- package/dist/{types-Crxftafi.d.ts → types-BYa2ZOAx.d.ts} +83 -2
- package/dist/{types-p8dWBIXL.d.ts → types-DJu6TBGp.d.ts} +2 -16
- package/dist/{worktree-fanout-DUiKPApb.d.ts → worktree-fanout-gNfl0Byj.d.ts} +9 -37
- package/package.json +9 -39
- package/dist/analyst-loop.d.ts +0 -52
- package/dist/analyst-loop.js +0 -11
- package/dist/analyst-loop.js.map +0 -1
- package/dist/audit.d.ts +0 -93
- package/dist/audit.js +0 -312
- package/dist/audit.js.map +0 -1
- package/dist/chunk-4B6U4CVQ.js +0 -15
- package/dist/chunk-4B6U4CVQ.js.map +0 -1
- package/dist/chunk-FCIPUALH.js +0 -214
- package/dist/chunk-FCIPUALH.js.map +0 -1
- package/dist/chunk-O2UPHN7X.js +0 -114
- package/dist/chunk-O2UPHN7X.js.map +0 -1
- package/dist/chunk-P5OKDSLB.js +0 -580
- package/dist/chunk-P5OKDSLB.js.map +0 -1
- package/dist/chunk-QNUEFNU7.js.map +0 -1
- package/dist/chunk-VKUHUFX7.js.map +0 -1
- package/dist/chunk-VLF5RHEQ.js +0 -143
- package/dist/chunk-VLF5RHEQ.js.map +0 -1
- package/dist/coder-2leJPOvC.d.ts +0 -52
- package/dist/improvement.d.ts +0 -208
- package/dist/improvement.js +0 -343
- package/dist/improvement.js.map +0 -1
- package/dist/local-harness-BE_h8szs.d.ts +0 -93
- package/dist/platform.d.ts +0 -255
- package/dist/platform.js +0 -229
- package/dist/platform.js.map +0 -1
- package/dist/run-loop-D3PwlG7J.d.ts +0 -112
- package/dist/runtime-hooks-C7JwKb9E.d.ts +0 -70
- package/dist/runtime.d.ts +0 -3108
- package/dist/runtime.js +0 -263
- package/dist/runtime.js.map +0 -1
- package/dist/topology.d.ts +0 -126
- package/dist/topology.js +0 -333
- package/dist/topology.js.map +0 -1
- package/dist/workflow.d.ts +0 -551
- package/dist/workflow.js +0 -1781
- package/dist/workflow.js.map +0 -1
- /package/dist/{chunk-OYU5LR4T.js.map → chunk-EDCVUZZC.js.map} +0 -0
- /package/dist/{chunk-LTEF2LYD.js.map → chunk-ZNQVMMR5.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createFleetWorkspaceExecutor,
|
|
3
3
|
createSiblingSandboxExecutor
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-L5ZFBVT6.js";
|
|
5
5
|
import {
|
|
6
6
|
runWorktreeHarness
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QXWGSDAQ.js";
|
|
8
8
|
import {
|
|
9
9
|
buildLoopOtelSpans,
|
|
10
10
|
createOtelExporter
|
|
@@ -275,4 +275,4 @@ export {
|
|
|
275
275
|
createPropagatingTraceEmitter,
|
|
276
276
|
traceContextToEnv
|
|
277
277
|
};
|
|
278
|
-
//# sourceMappingURL=chunk-
|
|
278
|
+
//# sourceMappingURL=chunk-ZNQVMMR5.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as DelegateFeedbackArgs, d as DelegationFeedbackSnapshot, e as DelegationTaskQueue, f as CoderDelegate, R as ResearcherDelegate, U as UiAuditorDelegate, T as TraceContext, A as Agent, S as Scope, g as ResultBlobStore, B as Budget } from './delegates-
|
|
1
|
+
import { c as DelegateFeedbackArgs, d as DelegationFeedbackSnapshot, e as DelegationTaskQueue, f as CoderDelegate, R as ResearcherDelegate, U as UiAuditorDelegate, T as TraceContext, A as Agent, S as Scope, g as ResultBlobStore, B as Budget } from './delegates-DqAgo32T.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @experimental
|
|
@@ -358,6 +358,13 @@ interface CoordinationToolsOptions {
|
|
|
358
358
|
* the driver can still run lenses on demand via `run_analyst`). Requires `analysts`. */
|
|
359
359
|
readonly analyzeOnSettle?: ReadonlyArray<string>;
|
|
360
360
|
}
|
|
361
|
+
/**
|
|
362
|
+
* The supervisor-side toolbox returned by {@link createCoordinationTools}: the MCP tool
|
|
363
|
+
* descriptors a driver `AgentProfile` calls to spawn, steer, observe, and settle workers
|
|
364
|
+
* over a live `Scope`, plus the typed accessors (`settled`/`questions`/`history`/`stats`/
|
|
365
|
+
* `raiseFinding`) for the bidirectional coordination bus. This is the live, backend-of-your-
|
|
366
|
+
* choice, steerable counterpart to the one-shot own-sandbox delegation MCP.
|
|
367
|
+
*/
|
|
361
368
|
interface CoordinationTools {
|
|
362
369
|
readonly tools: McpToolDescriptor[];
|
|
363
370
|
isStopped(): boolean;
|
|
@@ -1,10 +1,99 @@
|
|
|
1
|
+
import { ChildProcess } from 'node:child_process';
|
|
1
2
|
import { DefaultVerdict, AgentEvalError } from '@tangle-network/agent-eval';
|
|
2
3
|
import { AgentProfile } from '@tangle-network/agent-interface';
|
|
3
4
|
import { BackendType, SandboxEvent, SandboxInstance } from '@tangle-network/sandbox';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { d as LoopTokenUsage, b as RuntimeHooks, e as LoopTraceEmitter, L as LoopTraceEvent, S as SandboxClient, A as AgentRunSpec } from './types-BYa2ZOAx.js';
|
|
6
|
+
import { a as UiLens, U as UiFinding, C as CoderTask } from './substrate-BoRXgvka.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @experimental
|
|
10
|
+
*
|
|
11
|
+
* Subprocess wrappers for the local coding-harness CLIs installed in the
|
|
12
|
+
* sandbox image (claude-code, codex, opencode). Used by the in-process
|
|
13
|
+
* delegation executor (`createInProcessExecutor`) so a `delegate_code` call
|
|
14
|
+
* spawns a real harness on a real git worktree instead of provisioning a
|
|
15
|
+
* sibling sandbox.
|
|
16
|
+
*
|
|
17
|
+
* All harness invocations:
|
|
18
|
+
* - run with `cwd` set to the worktree
|
|
19
|
+
* - inherit env from the parent (the MCP server inside the sandbox has
|
|
20
|
+
* the harness's auth already)
|
|
21
|
+
* - capture stdout/stderr
|
|
22
|
+
* - support cancellation via AbortSignal
|
|
23
|
+
* - enforce a wall-clock timeout
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/** Local coding harness available inside the sandbox. */
|
|
27
|
+
type LocalHarness = 'claude' | 'codex' | 'opencode';
|
|
28
|
+
/** @experimental */
|
|
29
|
+
interface RunLocalHarnessOptions {
|
|
30
|
+
harness: LocalHarness;
|
|
31
|
+
/** Working directory for the subprocess (typically a worktree path). */
|
|
32
|
+
cwd: string;
|
|
33
|
+
/** Prompt forwarded as the harness CLI's task argument. */
|
|
34
|
+
taskPrompt: string;
|
|
35
|
+
/**
|
|
36
|
+
* Pre-built command + args (e.g. from `harnessInvocation` so the full authored
|
|
37
|
+
* `AgentProfile` — systemPrompt + model — reaches the harness). When set it OVERRIDES the
|
|
38
|
+
* default prompt-only `buildArgs(taskPrompt)` path; `command` defaults to the harness's
|
|
39
|
+
* default binary when only `args` is supplied. When absent the legacy prompt-only shape
|
|
40
|
+
* is used unchanged.
|
|
41
|
+
*/
|
|
42
|
+
invocation?: {
|
|
43
|
+
command?: string;
|
|
44
|
+
args: ReadonlyArray<string>;
|
|
45
|
+
};
|
|
46
|
+
/** Wall-clock kill deadline (ms). Default 5 min. Subprocess SIGTERMed on expiry. */
|
|
47
|
+
timeoutMs?: number;
|
|
48
|
+
/** Caller cancellation. SIGTERM is sent on abort. */
|
|
49
|
+
signal?: AbortSignal;
|
|
50
|
+
/** Override env (defaults to inheriting from the parent). */
|
|
51
|
+
env?: NodeJS.ProcessEnv;
|
|
52
|
+
/**
|
|
53
|
+
* Test seam — inject a custom spawner so unit tests can mock the
|
|
54
|
+
* subprocess without touching the OS. Defaults to node's `child_process.spawn`.
|
|
55
|
+
*/
|
|
56
|
+
spawn?: (command: string, args: ReadonlyArray<string>, opts: {
|
|
57
|
+
cwd: string;
|
|
58
|
+
env: NodeJS.ProcessEnv;
|
|
59
|
+
stdio: 'pipe';
|
|
60
|
+
}) => ChildProcess;
|
|
61
|
+
}
|
|
62
|
+
/** @experimental */
|
|
63
|
+
interface LocalHarnessResult {
|
|
64
|
+
/** OS exit code. `null` when killed before exit. */
|
|
65
|
+
exitCode: number | null;
|
|
66
|
+
/** Concatenated stdout. */
|
|
67
|
+
stdout: string;
|
|
68
|
+
/** Concatenated stderr. */
|
|
69
|
+
stderr: string;
|
|
70
|
+
/** Set when the process exited via signal (timeout / abort). */
|
|
71
|
+
killedBySignal: NodeJS.Signals | null;
|
|
72
|
+
/** Wall-clock duration ms (spawn → exit). */
|
|
73
|
+
durationMs: number;
|
|
74
|
+
/** Set when timeoutMs elapsed before exit. */
|
|
75
|
+
timedOut: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Spawn a local coding harness CLI as a subprocess + collect its output.
|
|
79
|
+
*
|
|
80
|
+
* NOT responsible for parsing the harness's output or extracting a diff —
|
|
81
|
+
* the in-process executor's `streamPrompt` orchestrates `git diff` against
|
|
82
|
+
* the worktree after this resolves. This function is intentionally narrow:
|
|
83
|
+
* spawn, wait, capture, return.
|
|
84
|
+
*
|
|
85
|
+
* Fails loud — throws when:
|
|
86
|
+
* - `cwd` doesn't exist (subprocess emits ENOENT; surfaced as Error)
|
|
87
|
+
* - the harness binary is not on PATH (ENOENT)
|
|
88
|
+
*
|
|
89
|
+
* Does NOT throw when:
|
|
90
|
+
* - the subprocess exits non-zero (`result.exitCode` carries the code)
|
|
91
|
+
* - the subprocess is aborted / timed out (`result.killedBySignal` /
|
|
92
|
+
* `result.timedOut` carries the reason)
|
|
93
|
+
*
|
|
94
|
+
* @experimental
|
|
95
|
+
*/
|
|
96
|
+
declare function runLocalHarness(options: RunLocalHarnessOptions): Promise<LocalHarnessResult>;
|
|
8
97
|
|
|
9
98
|
/**
|
|
10
99
|
* @experimental
|
|
@@ -76,7 +165,7 @@ interface Executor<Out> {
|
|
|
76
165
|
*/
|
|
77
166
|
execute(task: unknown, signal: AbortSignal): Promise<ExecutorResult<Out>> | AsyncIterable<UsageEvent>;
|
|
78
167
|
/**
|
|
79
|
-
* Optional inbox: receive an out-of-band message from the driver mid-run (the `send`/`
|
|
168
|
+
* Optional inbox: receive an out-of-band message from the driver mid-run (the `send`/`steer_agent`
|
|
80
169
|
* verb). A streaming executor drains pending messages between turns and folds them into the next
|
|
81
170
|
* step (a steer / interrupt / resume). A one-shot executor that can't be steered mid-flight omits
|
|
82
171
|
* this; `Scope.send` then returns `false` for it. Never throws — a malformed message is the
|
|
@@ -1661,7 +1750,7 @@ declare function removeWorktree(options: RemoveWorktreeOptions): Promise<void>;
|
|
|
1661
1750
|
* session id is deterministic and supplied at submit time, so a process
|
|
1662
1751
|
* crash between ticks loses nothing — the turn keeps running in the box.
|
|
1663
1752
|
*
|
|
1664
|
-
* - {@link
|
|
1753
|
+
* - {@link createDetachedTurnResumeDriver} — the resume side. A
|
|
1665
1754
|
* `DelegationResumeDriver` that re-attaches restored in-flight records to
|
|
1666
1755
|
* their detached runs: parse the record's ref, resolve the box, advance the
|
|
1667
1756
|
* turn one `driveTurn` pass per `tick()`, and map the SDK's three states
|
|
@@ -1803,7 +1892,7 @@ interface RunDetachedTurnOptions {
|
|
|
1803
1892
|
*/
|
|
1804
1893
|
declare function runDetachedTurn(options: RunDetachedTurnOptions): Promise<DetachedTurn>;
|
|
1805
1894
|
/** @experimental */
|
|
1806
|
-
interface
|
|
1895
|
+
interface DetachedTurnResumeDriverOptions {
|
|
1807
1896
|
/**
|
|
1808
1897
|
* Resolve the live box owning a detached session. The bin wires this to the
|
|
1809
1898
|
* sandbox client's `get(sandboxId)`; throw when the box no longer exists —
|
|
@@ -1850,7 +1939,7 @@ interface DriveTurnResumeDriverOptions {
|
|
|
1850
1939
|
*
|
|
1851
1940
|
* @experimental
|
|
1852
1941
|
*/
|
|
1853
|
-
declare function
|
|
1942
|
+
declare function createDetachedTurnResumeDriver(options: DetachedTurnResumeDriverOptions): DelegationResumeDriver;
|
|
1854
1943
|
|
|
1855
1944
|
/**
|
|
1856
1945
|
* @experimental
|
|
@@ -1951,6 +2040,12 @@ declare function createFleetWorkspaceExecutor(options: FleetWorkspaceExecutorOpt
|
|
|
1951
2040
|
* Delegate factories — the layer between MCP tool handlers and the
|
|
1952
2041
|
* underlying `runLoop` runners.
|
|
1953
2042
|
*
|
|
2043
|
+
* Delegation vs COORDINATION (`../runtime/supervise/coordination-mcp.ts`): delegation runs a coding
|
|
2044
|
+
* task INSIDE the agent's OWN sandbox environment — a sibling box on its own `SandboxClient`, fresh
|
|
2045
|
+
* branch on its repo — as a durable, fire-and-poll job that survives an MCP restart. It is NOT
|
|
2046
|
+
* backend-pluggable. To instead SPAWN + live-drive workers in a CHOSEN backend (sandbox OR cli-bridge,
|
|
2047
|
+
* via `createExecutor({ backend })`) with observe/steer/resume + recursion, use the coordination MCP.
|
|
2048
|
+
*
|
|
1954
2049
|
* The MCP server is profile-agnostic: it owns the task queue + feedback
|
|
1955
2050
|
* store + transport. Each `*Delegate` is the closure that the queue
|
|
1956
2051
|
* invokes when a task runs. Consumers can override either delegate to
|
|
@@ -2138,10 +2233,10 @@ interface SettleDetachedCoderTurnOptions {
|
|
|
2138
2233
|
* bound to the `runLoop` + sandbox-session substrate. The recursive `Scope`/worktree-CLI leaf has
|
|
2139
2234
|
* journal→replay but no driveTurn-over-a-detached-sandbox-session equivalent yet, so resume is NOT
|
|
2140
2235
|
* advertised on the generic `worktreeFanout` path. This helper (with `coderTaskFromArgs` and
|
|
2141
|
-
* `
|
|
2236
|
+
* `createDetachedTurnResumeDriver`) stays as the resume seam `bin.ts` wires for in-flight records.
|
|
2142
2237
|
*
|
|
2143
2238
|
* @experimental
|
|
2144
2239
|
*/
|
|
2145
2240
|
declare function settleDetachedCoderTurn(turn: DetachedTurn, options: SettleDetachedCoderTurnOptions): Promise<CoderOutput>;
|
|
2146
2241
|
|
|
2147
|
-
export { type
|
|
2242
|
+
export { type DelegationProfile as $, type Agent as A, type Budget as B, type CoderReviewer as C, type DelegateCodeArgs as D, type ExecutorRegistry as E, type FleetHandle as F, type GitRunner as G, type DelegationStatusArgs as H, type CappedDelegationTrace as I, type CoderReview as J, type CreateWorktreeOptions as K, type LocalHarness as L, DELEGATION_TRACE_MAX_BYTES as M, type NodeId as N, DELEGATION_TRACE_MAX_SPANS as O, type DelegateCodeConfig as P, type DelegateResearchConfig as Q, type ResearcherDelegate as R, type Scope as S, type TraceContext as T, type UiAuditorDelegate as U, type DelegateRunCtx as V, type DelegateUiAuditConfig as W, type DelegateUiAuditRoute as X, type DelegationError as Y, type DelegationHistoryEntry as Z, DelegationPersistenceError as _, type DetachedWinnerSelection as a, type EvalRunsExportResult as a$, type DelegationProgress as a0, type DelegationRecord as a1, type DelegationResultPayload as a2, type DelegationResumeContext as a3, type DelegationResumeDriver as a4, type DelegationResumeTick as a5, type DelegationRunContext as a6, DelegationStateCorruptError as a7, type DelegationStatus as a8, type DelegationStore as a9, type SubmitOutput as aA, type UiAuditorDelegationOutput as aB, type WorktreeHandle as aC, buildDelegationTraceSpans as aD, capDelegationTrace as aE, captureWorktreeDiff as aF, coderTaskFromArgs as aG, composeLoopTraceEmitters as aH, createDelegationTraceCollector as aI, createDetachedTurnResumeDriver as aJ, createFleetWorkspaceExecutor as aK, createPropagatingTraceEmitter as aL, createSiblingSandboxExecutor as aM, createWorktree as aN, detachedSessionDelegate as aO, detachedTurnEvents as aP, formatDetachedSessionRef as aQ, hashIdempotencyInput as aR, parseDetachedSessionRef as aS, readTraceContextFromEnv as aT, removeWorktree as aU, runDetachedTurn as aV, settleDetachedCoderTurn as aW, traceContextToEnv as aX, type EvalRunEvent as aY, type EvalRunGeneration as aZ, type EvalRunsExportConfig as a_, type DelegationTaskQueueOptions as aa, type DelegationTraceCaps as ab, type DelegationTraceCollector as ac, type DelegationTraceSpan as ad, type DetachedSessionDelegateOptions as ae, type DetachedSessionRefParts as af, type DetachedTurn as ag, type DetachedTurnResumeDriverOptions as ah, type DiffOptions as ai, type DiffResult as aj, type DriveTurnCapableBox as ak, type DriveTurnTick as al, type FeedbackRating as am, type FeedbackRefersTo as an, FileDelegationStore as ao, type FileDelegationStoreOptions as ap, type FleetWorkspaceExecutorOptions as aq, InMemoryDelegationStore as ar, type LocalHarnessResult as as, type RemoveWorktreeOptions as at, type ResearchOutputShape as au, type RunDetachedTurnOptions as av, type RunLocalHarnessOptions as aw, type SettleDetachedCoderTurnOptions as ax, type SiblingSandboxExecutorOptions as ay, type SubmitInput as az, type CoderOutput as b, INTELLIGENCE_WIRE_VERSION as b0, type LoopSpanNode as b1, type OtelAttribute as b2, type OtelExportConfig as b3, type OtelExporter as b4, type OtelSpan as b5, buildLoopOtelSpans as b6, buildLoopSpanNodes as b7, createOtelExporter as b8, exportEvalRuns as b9, loopEventToOtelSpan as ba, type SpawnEvent as bb, type ExecutorFactory as bc, type UsageEvent as bd, type Supervisor as be, type ExecutorContext as bf, type ExecutorResult as bg, type SupervisorOpts as bh, type TreeView as bi, type WidenGate as bj, type DelegateFeedbackArgs as c, type DelegationFeedbackSnapshot as d, DelegationTaskQueue as e, type CoderDelegate as f, type ResultBlobStore as g, type AgentSpec as h, type SpawnJournal as i, type RootHandle as j, type SupervisedResult as k, type Settled as l, type Spend as m, type Executor as n, type DelegationExecutor as o, type DelegateCodeResult as p, type DelegateFeedbackResult as q, runLocalHarness as r, type ResearchSource as s, type DelegateResearchArgs as t, type DelegateResearchResult as u, type DelegateUiAuditArgs as v, type DelegateUiAuditResult as w, type DelegationHistoryResult as x, type DelegationHistoryArgs as y, type DelegationStatusResult as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FindingSubject, AnalystFinding } from '@tangle-network/agent-eval';
|
|
2
|
-
import { I as ImprovementAdapter } from './types-
|
|
2
|
+
import { I as ImprovementAdapter } from './types-DJu6TBGp.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `AgentSurfaces` — declarative map of the mutable file/directory paths
|