@tangle-network/agent-runtime 0.25.1 → 0.27.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/loops.d.ts CHANGED
@@ -1,9 +1,10 @@
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-DmkRGTBn.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-DmkRGTBn.js';
4
- import './runtime-run-D5ItCKl_.js';
5
- import './types-BFgFD_sl.js';
6
- import '@tangle-network/agent-eval';
2
+ import { D as Driver, I as Iteration, A as AgentRunSpec, O as OutputAdapter, V as Validator, E as ExecCtx, L as LoopWinner, a as LoopResult } from './types-Cbe54nB7.js';
3
+ export { b as LoopDecisionPayload, c as LoopEndedPayload, d as LoopIterationDispatchPayload, e as LoopIterationEndedPayload, f as LoopIterationStartedPayload, g as LoopSandboxClient, h as LoopSandboxPlacement, i as LoopStartedPayload, j as LoopTraceEmitter, k as LoopTraceEvent, l as ValidationCtx } from './types-Cbe54nB7.js';
4
+ import { DefaultVerdict } from '@tangle-network/agent-eval';
5
+ export { DefaultVerdict } from '@tangle-network/agent-eval';
6
+ import './runtime-run-B8VIiOhI.js';
7
+ import './types-CsCCryln.js';
7
8
 
8
9
  /**
9
10
  * @experimental
@@ -152,4 +153,4 @@ interface RunLoopOptions<Task, Output, Decision> {
152
153
  /** @experimental */
153
154
  declare function runLoop<Task, Output, Decision>(options: RunLoopOptions<Task, Output, Decision>): Promise<LoopResult<Task, Output, Decision>>;
154
155
 
155
- export { AgentRunSpec, type CreateFanoutVoteDriverOptions, type CreateRefineDriverOptions, DefaultVerdict, Driver, ExecCtx, type FanoutVoteDecision, type FanoutVoteScored, Iteration, LoopResult, LoopWinner, OutputAdapter, type RefineDecision, type RunLoopOptions, Validator, createFanoutVoteDriver, createRefineDriver, refineWinnerIndex, runLoop, scoreFanoutVoteIterations };
156
+ export { AgentRunSpec, type CreateFanoutVoteDriverOptions, type CreateRefineDriverOptions, Driver, ExecCtx, type FanoutVoteDecision, type FanoutVoteScored, Iteration, LoopResult, LoopWinner, OutputAdapter, type RefineDecision, type RunLoopOptions, Validator, createFanoutVoteDriver, createRefineDriver, refineWinnerIndex, runLoop, scoreFanoutVoteIterations };
@@ -1,13 +1,13 @@
1
- import { h as LoopSandboxClient, i as LoopSandboxPlacement, k as LoopTraceEmitter } from '../types-DmkRGTBn.js';
1
+ import { g as LoopSandboxClient, h as LoopSandboxPlacement, j as LoopTraceEmitter } from '../types-Cbe54nB7.js';
2
2
  import { SandboxInstance } from '@tangle-network/sandbox';
3
3
  import { CoderOutput } from '../profiles.js';
4
4
  import { L as LocalHarness, r as runLocalHarness } from '../local-harness-KrdFTY5R.js';
5
5
  export { a as LocalHarnessResult, R as RunLocalHarnessOptions } from '../local-harness-KrdFTY5R.js';
6
- import { b as OtelExporter } from '../otel-export-B33Cy_60.js';
7
- export { m as mcpToolsForRuntimeMcp, e as mcpToolsForRuntimeMcpSubset } from '../otel-export-B33Cy_60.js';
8
- import '../runtime-run-D5ItCKl_.js';
9
- import '../types-BFgFD_sl.js';
6
+ import { O as OtelExporter } from '../otel-export-B2UBcPV4.js';
7
+ export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from '../otel-export-B2UBcPV4.js';
10
8
  import '@tangle-network/agent-eval';
9
+ import '../runtime-run-B8VIiOhI.js';
10
+ import '../types-CsCCryln.js';
11
11
  import 'node:child_process';
12
12
 
13
13
  /**
@@ -1,4 +1,4 @@
1
- import { O as OpenAIChatTool } from './types-BFgFD_sl.js';
1
+ import { O as OpenAIChatTool } from './types-CsCCryln.js';
2
2
 
3
3
  /**
4
4
  * @experimental
@@ -111,4 +111,4 @@ declare function loopEventToOtelSpan(event: {
111
111
  payload: object;
112
112
  }, traceId: string, parentSpanId?: string): OtelSpan;
113
113
 
114
- export { type OtelAttribute as O, type OtelExportConfig as a, type OtelExporter as b, type OtelSpan as c, createOtelExporter as d, mcpToolsForRuntimeMcpSubset as e, loopEventToOtelSpan as l, mcpToolsForRuntimeMcp as m };
114
+ export { type OtelExporter as O, mcpToolsForRuntimeMcpSubset as a, type OtelAttribute as b, type OtelExportConfig as c, type OtelSpan as d, createOtelExporter as e, loopEventToOtelSpan as l, mcpToolsForRuntimeMcp as m };
@@ -1,8 +1,8 @@
1
1
  import { AgentProfile } from '@tangle-network/sandbox';
2
- import { O as OutputAdapter, V as Validator, A as AgentRunSpec, a as Driver } from './types-DmkRGTBn.js';
3
- import './runtime-run-D5ItCKl_.js';
4
- import './types-BFgFD_sl.js';
2
+ import { O as OutputAdapter, V as Validator, A as AgentRunSpec, D as Driver } from './types-Cbe54nB7.js';
5
3
  import '@tangle-network/agent-eval';
4
+ import './runtime-run-B8VIiOhI.js';
5
+ import './types-CsCCryln.js';
6
6
 
7
7
  /**
8
8
  * @experimental
@@ -1,4 +1,4 @@
1
- import { A as AgentTaskSpec, R as RuntimeStreamEvent } from './types-BFgFD_sl.js';
1
+ import { A as AgentTaskSpec, R as RuntimeStreamEvent } from './types-CsCCryln.js';
2
2
 
3
3
  /**
4
4
  * @stable
@@ -1,5 +1,6 @@
1
+ import { DefaultVerdict } from '@tangle-network/agent-eval';
1
2
  import { AgentProfile, CreateSandboxOptions, SandboxEvent, SandboxInstance } from '@tangle-network/sandbox';
2
- import { R as RuntimeRunHandle } from './runtime-run-D5ItCKl_.js';
3
+ import { R as RuntimeRunHandle } from './runtime-run-B8VIiOhI.js';
3
4
 
4
5
  /**
5
6
  * @experimental
@@ -14,17 +15,6 @@ import { R as RuntimeRunHandle } from './runtime-run-D5ItCKl_.js';
14
15
  * output scoring; the output adapter owns event-stream → typed-output decode.
15
16
  */
16
17
 
17
- /** @experimental */
18
- interface DefaultVerdict {
19
- /** Whether the output meets the validator's pass criteria. */
20
- valid: boolean;
21
- /** Aggregate score in [0, 1]. Drivers use this for winner selection. */
22
- score: number;
23
- /** Per-dimension scores. Free-form; weighted into `score` by the validator. */
24
- scores?: Record<string, number>;
25
- /** Human-readable rationale; surfaces in trace + final-result `winner.verdict`. */
26
- notes?: string;
27
- }
28
18
  /** @experimental */
29
19
  interface ValidationCtx {
30
20
  /** Iteration index this output came from (0-based). */
@@ -277,4 +267,4 @@ interface ExecCtx {
277
267
  parentSpanId?: string;
278
268
  }
279
269
 
280
- export type { AgentRunSpec as A, DefaultVerdict as D, ExecCtx as E, Iteration as I, LoopWinner as L, OutputAdapter as O, Validator as V, Driver as a, LoopResult as b, LoopDecisionPayload as c, LoopEndedPayload as d, LoopIterationDispatchPayload as e, LoopIterationEndedPayload as f, LoopIterationStartedPayload as g, LoopSandboxClient as h, LoopSandboxPlacement as i, LoopStartedPayload as j, LoopTraceEmitter as k, LoopTraceEvent as l, ValidationCtx as m };
270
+ export type { AgentRunSpec as A, Driver as D, ExecCtx as E, Iteration as I, LoopWinner as L, OutputAdapter as O, Validator as V, LoopResult as a, LoopDecisionPayload as b, LoopEndedPayload as c, LoopIterationDispatchPayload as d, LoopIterationEndedPayload as e, LoopIterationStartedPayload as f, LoopSandboxClient as g, LoopSandboxPlacement as h, LoopStartedPayload as i, LoopTraceEmitter as j, LoopTraceEvent as k, ValidationCtx as l };
@@ -402,6 +402,30 @@ interface AgentBackendContext {
402
402
  knowledge: KnowledgeReadinessReport;
403
403
  session: RuntimeSession;
404
404
  signal?: AbortSignal;
405
+ /**
406
+ * Conversation/run identifier when this call is part of a multi-agent run.
407
+ * Backends should stamp it into any trace/log emission so cross-participant
408
+ * events correlate. Absent when the call is a stand-alone `runAgentTask`.
409
+ */
410
+ runId?: string;
411
+ /**
412
+ * Deterministic turn id for this single call. Stable across retries of the
413
+ * same logical turn so a caching gateway / idempotent backend can dedupe.
414
+ */
415
+ turnId?: string;
416
+ /**
417
+ * If this call is itself nested inside a higher-order conversation
418
+ * (recursion via `createConversationBackend`), the enclosing turn's id.
419
+ * Used for trace stitching across nested orchestration.
420
+ */
421
+ parentTurnId?: string;
422
+ /**
423
+ * Headers to forward verbatim to any outbound HTTP the backend issues:
424
+ * `X-Tangle-Forwarded-Authorization`, `X-Tangle-Forwarded-Depth`,
425
+ * run/turn correlation. Backends that issue HTTP MUST merge these into
426
+ * the outbound request; backends that don't issue HTTP may ignore them.
427
+ */
428
+ propagatedHeaders?: Readonly<Record<string, string>>;
405
429
  }
406
430
  /** @stable */
407
431
  interface AgentExecutionBackend<TInput extends AgentBackendInput = AgentBackendInput> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-runtime",
3
- "version": "0.25.1",
3
+ "version": "0.27.0",
4
4
  "description": "Reusable runtime lifecycle for domain-specific agents.",
5
5
  "homepage": "https://github.com/tangle-network/agent-runtime#readme",
6
6
  "repository": {
@@ -65,18 +65,8 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "scripts": {
69
- "build": "tsup",
70
- "dev": "tsup --watch",
71
- "prepare": "tsup",
72
- "test": "vitest run",
73
- "test:watch": "vitest",
74
- "lint": "biome check src tests examples",
75
- "lint:fix": "biome check --write src tests examples",
76
- "typecheck": "tsc --noEmit"
77
- },
78
68
  "dependencies": {
79
- "@tangle-network/agent-eval": "^0.40.2"
69
+ "@tangle-network/agent-eval": "^0.48.0"
80
70
  },
81
71
  "devDependencies": {
82
72
  "@biomejs/biome": "^2.4.0",
@@ -86,20 +76,10 @@
86
76
  "typescript": "^5.7.0",
87
77
  "vitest": "^3.0.0"
88
78
  },
89
- "pnpm": {
90
- "minimumReleaseAge": 4320,
91
- "minimumReleaseAgeExclude": [
92
- "@tangle-network/agent-eval"
93
- ],
94
- "onlyBuiltDependencies": [
95
- "esbuild"
96
- ]
97
- },
98
79
  "engines": {
99
80
  "node": ">=20"
100
81
  },
101
82
  "license": "MIT",
102
- "packageManager": "pnpm@10.28.0",
103
83
  "peerDependencies": {
104
84
  "@tangle-network/agent-knowledge": ">=1.3.0 <2.0.0",
105
85
  "@tangle-network/sandbox": ">=0.1.2 <0.4.0"
@@ -107,6 +87,18 @@
107
87
  "peerDependenciesMeta": {
108
88
  "@tangle-network/agent-knowledge": {
109
89
  "optional": true
90
+ },
91
+ "@tangle-network/sandbox": {
92
+ "optional": true
110
93
  }
94
+ },
95
+ "scripts": {
96
+ "build": "tsup",
97
+ "dev": "tsup --watch",
98
+ "test": "vitest run",
99
+ "test:watch": "vitest",
100
+ "lint": "biome check src tests examples",
101
+ "lint:fix": "biome check --write src tests examples",
102
+ "typecheck": "tsc --noEmit"
111
103
  }
112
- }
104
+ }