@tangle-network/agent-runtime 0.21.0 → 0.22.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 +93 -1
- package/dist/agent.d.ts +1 -1
- package/dist/{chunk-EDVCVFQB.js → chunk-724Y4KHY.js} +2 -2
- package/dist/{chunk-Z5LKAYAS.js → chunk-CBQVID7G.js} +2 -2
- package/dist/{chunk-4XA4TWKW.js → chunk-FTWTA6YE.js} +5 -5
- package/dist/{chunk-4XA4TWKW.js.map → chunk-FTWTA6YE.js.map} +1 -1
- package/dist/{chunk-XLWPTPRP.js → chunk-URDSRUPQ.js} +2 -2
- package/dist/{chunk-RZAOYKCO.js → chunk-XZYF3YJN.js} +9 -1
- package/dist/{chunk-RZAOYKCO.js.map → chunk-XZYF3YJN.js.map} +1 -1
- package/dist/index.d.ts +76 -4
- package/dist/index.js +198 -41
- package/dist/index.js.map +1 -1
- package/dist/loops.d.ts +4 -4
- package/dist/loops.js +3 -3
- package/dist/mcp/bin.js +5 -5
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +5 -5
- package/dist/profiles.d.ts +3 -3
- package/dist/profiles.js +3 -3
- package/dist/{runtime-run-B2j-hvBj.d.ts → runtime-run-D5ItCKl_.d.ts} +1 -1
- package/dist/{types-DvJIha6w.d.ts → types-BFgFD_sl.d.ts} +87 -1
- package/dist/{types-Cu-SkGa0.d.ts → types-Ps7-2gJC.d.ts} +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-EDVCVFQB.js.map → chunk-724Y4KHY.js.map} +0 -0
- /package/dist/{chunk-Z5LKAYAS.js.map → chunk-CBQVID7G.js.map} +0 -0
- /package/dist/{chunk-XLWPTPRP.js.map → chunk-URDSRUPQ.js.map} +0 -0
package/dist/loops.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { AgentProfile, CreateSandboxOptions, SandboxEvent, SandboxInstance } from '@tangle-network/sandbox';
|
|
2
|
-
import { D as DefaultVerdict, a as Driver, I as Iteration, A as AgentRunSpec, O as OutputAdapter, V as Validator, E as ExecCtx, L as LoopWinner, b as LoopResult } from './types-
|
|
3
|
-
export { c as LoopDecisionPayload, d as LoopEndedPayload, e as LoopIterationDispatchPayload, f as LoopIterationEndedPayload, g as LoopIterationStartedPayload, h as LoopSandboxClient, i as LoopSandboxPlacement, j as LoopStartedPayload, k as LoopTraceEmitter, l as LoopTraceEvent, m as ValidationCtx } from './types-
|
|
4
|
-
import './runtime-run-
|
|
5
|
-
import './types-
|
|
2
|
+
import { D as DefaultVerdict, a as Driver, I as Iteration, A as AgentRunSpec, O as OutputAdapter, V as Validator, E as ExecCtx, L as LoopWinner, b as LoopResult } from './types-Ps7-2gJC.js';
|
|
3
|
+
export { c as LoopDecisionPayload, d as LoopEndedPayload, e as LoopIterationDispatchPayload, f as LoopIterationEndedPayload, g as LoopIterationStartedPayload, h as LoopSandboxClient, i as LoopSandboxPlacement, j as LoopStartedPayload, k as LoopTraceEmitter, l as LoopTraceEvent, m as ValidationCtx } from './types-Ps7-2gJC.js';
|
|
4
|
+
import './runtime-run-D5ItCKl_.js';
|
|
5
|
+
import './types-BFgFD_sl.js';
|
|
6
6
|
import '@tangle-network/agent-eval';
|
|
7
7
|
|
|
8
8
|
/**
|
package/dist/loops.js
CHANGED
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
createRefineDriver,
|
|
3
3
|
refineWinnerIndex,
|
|
4
4
|
runLoop
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-724Y4KHY.js";
|
|
6
6
|
import {
|
|
7
7
|
createFanoutVoteDriver,
|
|
8
8
|
scoreFanoutVoteIterations
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-URDSRUPQ.js";
|
|
10
|
+
import "./chunk-XZYF3YJN.js";
|
|
11
11
|
import "./chunk-DGUM43GV.js";
|
|
12
12
|
export {
|
|
13
13
|
createFanoutVoteDriver,
|
package/dist/mcp/bin.js
CHANGED
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
createDefaultCoderDelegate,
|
|
4
4
|
createMcpServer,
|
|
5
5
|
detectExecutor
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-FTWTA6YE.js";
|
|
7
7
|
import {
|
|
8
8
|
runLoop
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-724Y4KHY.js";
|
|
10
|
+
import "../chunk-CBQVID7G.js";
|
|
11
|
+
import "../chunk-URDSRUPQ.js";
|
|
12
|
+
import "../chunk-XZYF3YJN.js";
|
|
13
13
|
import "../chunk-DGUM43GV.js";
|
|
14
14
|
|
|
15
15
|
// src/mcp/bin.ts
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { h as LoopSandboxClient } from '../types-
|
|
1
|
+
import { h as LoopSandboxClient } from '../types-Ps7-2gJC.js';
|
|
2
2
|
import { SandboxInstance } from '@tangle-network/sandbox';
|
|
3
3
|
import { CoderOutput } from '../profiles.js';
|
|
4
|
-
import '../runtime-run-
|
|
5
|
-
import '../types-
|
|
4
|
+
import '../runtime-run-D5ItCKl_.js';
|
|
5
|
+
import '../types-BFgFD_sl.js';
|
|
6
6
|
import '@tangle-network/agent-eval';
|
|
7
7
|
|
|
8
8
|
/**
|
package/dist/mcp/index.js
CHANGED
|
@@ -34,11 +34,11 @@ import {
|
|
|
34
34
|
validateDelegateResearchArgs,
|
|
35
35
|
validateDelegationHistoryArgs,
|
|
36
36
|
validateDelegationStatusArgs
|
|
37
|
-
} from "../chunk-
|
|
38
|
-
import "../chunk-
|
|
39
|
-
import "../chunk-
|
|
40
|
-
import "../chunk-
|
|
41
|
-
import "../chunk-
|
|
37
|
+
} from "../chunk-FTWTA6YE.js";
|
|
38
|
+
import "../chunk-724Y4KHY.js";
|
|
39
|
+
import "../chunk-CBQVID7G.js";
|
|
40
|
+
import "../chunk-URDSRUPQ.js";
|
|
41
|
+
import "../chunk-XZYF3YJN.js";
|
|
42
42
|
import "../chunk-DGUM43GV.js";
|
|
43
43
|
export {
|
|
44
44
|
DELEGATE_CODE_DESCRIPTION,
|
package/dist/profiles.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AgentProfile } from '@tangle-network/sandbox';
|
|
2
|
-
import { O as OutputAdapter, V as Validator, A as AgentRunSpec, a as Driver } from './types-
|
|
3
|
-
import './runtime-run-
|
|
4
|
-
import './types-
|
|
2
|
+
import { O as OutputAdapter, V as Validator, A as AgentRunSpec, a as Driver } from './types-Ps7-2gJC.js';
|
|
3
|
+
import './runtime-run-D5ItCKl_.js';
|
|
4
|
+
import './types-BFgFD_sl.js';
|
|
5
5
|
import '@tangle-network/agent-eval';
|
|
6
6
|
|
|
7
7
|
/**
|
package/dist/profiles.js
CHANGED
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
coderProfile,
|
|
3
3
|
createCoderValidator,
|
|
4
4
|
multiHarnessCoderFanout
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-CBQVID7G.js";
|
|
6
|
+
import "./chunk-URDSRUPQ.js";
|
|
7
|
+
import "./chunk-XZYF3YJN.js";
|
|
8
8
|
import "./chunk-DGUM43GV.js";
|
|
9
9
|
export {
|
|
10
10
|
coderProfile,
|
|
@@ -142,6 +142,71 @@ type AgentRuntimeEvent<TState = unknown, TAction = unknown, TActionResult = unkn
|
|
|
142
142
|
};
|
|
143
143
|
/** @stable */
|
|
144
144
|
type AgentRuntimeEventSink<TState = unknown, TAction = unknown, TActionResult = unknown, TEval extends ControlEvalResult = ControlEvalResult> = (event: AgentRuntimeEvent<TState, TAction, TActionResult, TEval>) => Promise<void> | void;
|
|
145
|
+
/**
|
|
146
|
+
* @stable
|
|
147
|
+
*
|
|
148
|
+
* Typed transport / backend failure detail. Carried on `backend_error` and
|
|
149
|
+
* `final` events when the backend's stream throws or the upstream HTTP call
|
|
150
|
+
* returns a non-success status. Lets consumers (a) distinguish "stream
|
|
151
|
+
* completed with no text" from "stream never reached the model" and
|
|
152
|
+
* (b) reconstruct the precise upstream signal (status + truncated body) when
|
|
153
|
+
* building a `RunRecord.error`.
|
|
154
|
+
*
|
|
155
|
+
* `body` is truncated to 2 KiB by the backend so an HTML error page from a
|
|
156
|
+
* misconfigured proxy never bloats event payloads or logs. Consumers needing
|
|
157
|
+
* the full body should inspect the underlying `BackendTransportError.body`
|
|
158
|
+
* via a custom `mapEvent` or backend wrapper.
|
|
159
|
+
*/
|
|
160
|
+
interface BackendErrorDetail {
|
|
161
|
+
/**
|
|
162
|
+
* `'transport'` — upstream HTTP / network failure with optional status code.
|
|
163
|
+
* `'backend'` — the backend's `stream()` generator threw for a non-transport
|
|
164
|
+
* reason (e.g. a custom adapter error, sandbox crash).
|
|
165
|
+
*/
|
|
166
|
+
kind: 'transport' | 'backend';
|
|
167
|
+
message: string;
|
|
168
|
+
/** Upstream HTTP status when known. `0` for connection / abort errors. */
|
|
169
|
+
status?: number;
|
|
170
|
+
/** Truncated response body (≤2 KiB). Diagnostic only — never machine-parsed. */
|
|
171
|
+
body?: string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* @stable
|
|
175
|
+
*
|
|
176
|
+
* OpenAI Chat Completions tool descriptor. The shape mirrors the
|
|
177
|
+
* `/v1/chat/completions` `tools[]` parameter so callers can pass tool
|
|
178
|
+
* definitions through `createOpenAICompatibleBackend({ tools })` without any
|
|
179
|
+
* runtime translation. The router proxies this shape verbatim to Anthropic
|
|
180
|
+
* (translated server-side), DeepSeek, Groq, OpenAI, and Gemini — every model
|
|
181
|
+
* that the eval surface targets.
|
|
182
|
+
*
|
|
183
|
+
* Callers that build their tool list from MCP servers should run a one-shot
|
|
184
|
+
* MCP `tools/list` at config time and project the result into this shape. The
|
|
185
|
+
* runtime intentionally does NOT depend on `@modelcontextprotocol/sdk` —
|
|
186
|
+
* keeping the backend transport thin lets domain repos own MCP plumbing.
|
|
187
|
+
*/
|
|
188
|
+
interface OpenAIChatTool {
|
|
189
|
+
type: 'function';
|
|
190
|
+
function: {
|
|
191
|
+
name: string;
|
|
192
|
+
description?: string;
|
|
193
|
+
parameters?: Record<string, unknown>;
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* @stable
|
|
198
|
+
*
|
|
199
|
+
* `tool_choice` parameter for OpenAI-compat chat. Same shape as the OpenAI
|
|
200
|
+
* spec: `'auto'` (default — model decides), `'none'` (disable tool calling
|
|
201
|
+
* for this turn), `'required'` (force a tool call), or a specific function
|
|
202
|
+
* pin `{ type: 'function', function: { name } }`.
|
|
203
|
+
*/
|
|
204
|
+
type OpenAIChatToolChoice = 'auto' | 'none' | 'required' | {
|
|
205
|
+
type: 'function';
|
|
206
|
+
function: {
|
|
207
|
+
name: string;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
145
210
|
/** @stable */
|
|
146
211
|
type RuntimeStreamEvent = {
|
|
147
212
|
type: 'task_start';
|
|
@@ -260,6 +325,18 @@ type RuntimeStreamEvent = {
|
|
|
260
325
|
backend: string;
|
|
261
326
|
message: string;
|
|
262
327
|
recoverable: boolean;
|
|
328
|
+
/**
|
|
329
|
+
* Typed transport diagnostic. Present when the upstream returned a
|
|
330
|
+
* non-success HTTP status or every retry attempt threw. Consumers MUST
|
|
331
|
+
* surface this onto their `RunRecord.error` — silently treating a
|
|
332
|
+
* `backend_error` as "no output" hides credit exhaustion, auth failure,
|
|
333
|
+
* and upstream outages from operators.
|
|
334
|
+
* - `kind: 'transport'` — HTTP / network failure with optional `status`
|
|
335
|
+
* + truncated response `body`.
|
|
336
|
+
* - `kind: 'backend'` — the backend's `stream()` generator threw for a
|
|
337
|
+
* reason that isn't a recognized transport failure.
|
|
338
|
+
*/
|
|
339
|
+
error?: BackendErrorDetail;
|
|
263
340
|
timestamp: string;
|
|
264
341
|
} | {
|
|
265
342
|
type: 'backend_end';
|
|
@@ -281,6 +358,15 @@ type RuntimeStreamEvent = {
|
|
|
281
358
|
reason: string;
|
|
282
359
|
text?: string;
|
|
283
360
|
metadata?: Record<string, unknown>;
|
|
361
|
+
/**
|
|
362
|
+
* Typed terminal-error diagnostic. Mirrors the `backend_error.error`
|
|
363
|
+
* shape so a consumer that only listens for `final` still receives a
|
|
364
|
+
* loud, structured failure when the backend never produced output. Only
|
|
365
|
+
* set when `status !== 'completed'`. Consumers building a `RunRecord`
|
|
366
|
+
* MUST map this to `RunRecord.error` rather than recording silent
|
|
367
|
+
* `error: null` with empty `finalText`.
|
|
368
|
+
*/
|
|
369
|
+
error?: BackendErrorDetail;
|
|
284
370
|
timestamp: string;
|
|
285
371
|
};
|
|
286
372
|
/** @stable */
|
|
@@ -376,4 +462,4 @@ interface KnowledgeReadinessDecision {
|
|
|
376
462
|
nonBlockingGapIds: string[];
|
|
377
463
|
}
|
|
378
464
|
|
|
379
|
-
export type { AgentTaskSpec as A, KnowledgeReadinessDecision as K, RuntimeStreamEvent as R, AgentBackendInput as a, AgentExecutionBackend as b,
|
|
465
|
+
export type { AgentTaskSpec as A, BackendErrorDetail as B, KnowledgeReadinessDecision as K, OpenAIChatTool as O, RuntimeStreamEvent as R, AgentBackendInput as a, AgentExecutionBackend as b, OpenAIChatToolChoice as c, AgentBackendContext as d, RunAgentTaskOptions as e, AgentTaskRunResult as f, RunAgentTaskStreamOptions as g, AgentRuntimeEvent as h, AgentTaskStatus as i, RuntimeSessionStore as j, RuntimeSession as k, AgentAdapter as l, AgentKnowledgeProvider as m, AgentRuntimeEventSink as n, AgentTaskContext as o };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AgentProfile, CreateSandboxOptions, SandboxEvent, SandboxInstance } from '@tangle-network/sandbox';
|
|
2
|
-
import { R as RuntimeRunHandle } from './runtime-run-
|
|
2
|
+
import { R as RuntimeRunHandle } from './runtime-run-D5ItCKl_.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @experimental
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|