@tangle-network/agent-runtime 0.52.0 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/agent.d.ts +2 -2
  2. package/dist/agent.js +2 -2
  3. package/dist/analyst-loop.d.ts +1 -1
  4. package/dist/{chunk-7SP2OVYZ.js → chunk-5M2WDWBI.js} +3 -3
  5. package/dist/{chunk-4JI4BCBI.js → chunk-AYRQZRDV.js} +2 -2
  6. package/dist/{chunk-BERLUBAP.js → chunk-FO4DCM7R.js} +2 -2
  7. package/dist/{chunk-7JITYN6T.js → chunk-JFIYKDXF.js} +17 -2
  8. package/dist/chunk-JFIYKDXF.js.map +1 -0
  9. package/dist/{chunk-COAVO6QB.js → chunk-K5M3SHEU.js} +3 -3
  10. package/dist/{chunk-2OU7ZQPD.js → chunk-K6WP7PYW.js} +42 -57
  11. package/dist/chunk-K6WP7PYW.js.map +1 -0
  12. package/dist/{chunk-V2K35HF2.js → chunk-P4QNEXFC.js} +2 -2
  13. package/dist/{coder-_YCf3BAK.d.ts → coder-LKm3Mczw.d.ts} +1 -1
  14. package/dist/{delegation-profile-1GbW5yA3.d.ts → delegation-profile-Bvfro2m1.d.ts} +28 -2
  15. package/dist/{driver-DLI1io57.d.ts → driver-B2RKkVJW.d.ts} +1 -1
  16. package/dist/index.d.ts +7 -7
  17. package/dist/index.js +7 -5
  18. package/dist/index.js.map +1 -1
  19. package/dist/intelligence.d.ts +475 -5
  20. package/dist/intelligence.js +547 -3
  21. package/dist/intelligence.js.map +1 -1
  22. package/dist/{kb-gate-CHAyt4aI.d.ts → kb-gate-CKfykcYQ.d.ts} +2 -2
  23. package/dist/{loop-runner-bin-DFUNgpeK.d.ts → loop-runner-bin-D4Ir7b00.d.ts} +4 -4
  24. package/dist/loop-runner-bin.d.ts +5 -5
  25. package/dist/loop-runner-bin.js +3 -3
  26. package/dist/loops.d.ts +6 -5
  27. package/dist/loops.js +1 -1
  28. package/dist/mcp/bin.js +4 -4
  29. package/dist/mcp/index.d.ts +7 -7
  30. package/dist/mcp/index.js +6 -6
  31. package/dist/{openai-tools-D4HLDWgw.d.ts → openai-tools-CKfR3EMh.d.ts} +1 -1
  32. package/dist/profiles.d.ts +2 -2
  33. package/dist/router-client-B0Qi1NiN.d.ts +120 -0
  34. package/dist/{run-loop-BIineL1T.d.ts → run-loop-DgVhucoR.d.ts} +1 -1
  35. package/dist/runtime.d.ts +16 -119
  36. package/dist/runtime.js +1 -1
  37. package/dist/{types-5MGt5KTY.d.ts → types-CNDJCL_0.d.ts} +1 -1
  38. package/dist/{types-BEQsBhOE.d.ts → types-CklkW4Eh.d.ts} +2 -1
  39. package/dist/workflow.d.ts +2 -2
  40. package/dist/workflow.js +1 -1
  41. package/package.json +1 -1
  42. package/dist/chunk-2OU7ZQPD.js.map +0 -1
  43. package/dist/chunk-7JITYN6T.js.map +0 -1
  44. /package/dist/{chunk-7SP2OVYZ.js.map → chunk-5M2WDWBI.js.map} +0 -0
  45. /package/dist/{chunk-4JI4BCBI.js.map → chunk-AYRQZRDV.js.map} +0 -0
  46. /package/dist/{chunk-BERLUBAP.js.map → chunk-FO4DCM7R.js.map} +0 -0
  47. /package/dist/{chunk-COAVO6QB.js.map → chunk-K5M3SHEU.js.map} +0 -0
  48. /package/dist/{chunk-V2K35HF2.js.map → chunk-P4QNEXFC.js.map} +0 -0
@@ -14,7 +14,7 @@ import {
14
14
  DELEGATION_STATUS_DESCRIPTION,
15
15
  DELEGATION_STATUS_INPUT_SCHEMA,
16
16
  DELEGATION_STATUS_TOOL_NAME
17
- } from "./chunk-BERLUBAP.js";
17
+ } from "./chunk-FO4DCM7R.js";
18
18
 
19
19
  // src/mcp/openai-tools.ts
20
20
  function buildTool(name, description, parameters) {
@@ -61,4 +61,4 @@ export {
61
61
  mcpToolsForRuntimeMcp,
62
62
  mcpToolsForRuntimeMcpSubset
63
63
  };
64
- //# sourceMappingURL=chunk-V2K35HF2.js.map
64
+ //# sourceMappingURL=chunk-P4QNEXFC.js.map
@@ -1,5 +1,5 @@
1
1
  import { AgentProfile } from '@tangle-network/sandbox';
2
- import { O as OutputAdapter, V as Validator, A as AgentRunSpec, D as Driver } from './types-BEQsBhOE.js';
2
+ import { O as OutputAdapter, V as Validator, A as AgentRunSpec, D as Driver } from './types-CklkW4Eh.js';
3
3
 
4
4
  /**
5
5
  * @experimental
@@ -1,4 +1,4 @@
1
- import { AgentProfileFileMount, AgentProfileMcpServer, AgentProfile } from '@tangle-network/sandbox';
1
+ import { AgentProfileFileMount, AgentProfile, AgentSubagentProfile, AgentProfileMcpServer } from '@tangle-network/sandbox';
2
2
 
3
3
  /**
4
4
  * Production-profile composition for the agent-runtime delegation MCP.
@@ -17,6 +17,11 @@ import { AgentProfileFileMount, AgentProfileMcpServer, AgentProfile } from '@tan
17
17
  * authenticate on startup. No static profile entry, ever.
18
18
  */
19
19
 
20
+ /** One hook command entry. The SDK declares `AgentProfile.hooks` as
21
+ * `Record<string, AgentProfileHookCommand[]>` but does not re-export the element
22
+ * type from the package entry, so derive it from `AgentProfile` by indexed
23
+ * access — the single source of truth, no drift from the SDK shape. */
24
+ type AgentProfileHookCommand = NonNullable<AgentProfile['hooks']>[string][number];
20
25
  /** MCP server key under which the agent-runtime delegation tools mount. */
21
26
  declare const DELEGATION_MCP_SERVER_KEY = "agent-runtime-delegation";
22
27
  interface BuildDelegationMcpServerOptions {
@@ -53,6 +58,22 @@ interface ComposeProductionAgentProfileOptions {
53
58
  name?: string;
54
59
  /** Environment source for key + OTEL resolution. Defaults to `process.env`. */
55
60
  env?: Record<string, string | undefined>;
61
+ /** Box built-in tool ON/OFF flags merged over the base profile's `tools`
62
+ * (overlay wins per key). The sandbox-seam mapping of a certified surface's
63
+ * tool grants — `AgentProfile.tools` is `Record<string, boolean>` box flags,
64
+ * so it carries grants, not arbitrary tool defs. */
65
+ tools?: Record<string, boolean>;
66
+ /** Per-event hook commands merged over the base profile's `hooks`. An event
67
+ * present in both has the extra commands appended after the base ones. */
68
+ hooks?: Record<string, AgentProfileHookCommand[]>;
69
+ /** Subagent definitions merged over the base profile's `subagents` (overlay
70
+ * wins per key). */
71
+ subagents?: Record<string, AgentSubagentProfile>;
72
+ /** Resolved certified MCP connections injected into `AgentProfile.mcp` — the
73
+ * sandbox-seam delivery of a `ResolvedSurface.mcpConnections`. Merged after
74
+ * the base map and before the delegation entry, so a base/delegation key is
75
+ * never silently shadowed by an injected one. */
76
+ mcpConnections?: Record<string, AgentProfileMcpServer>;
56
77
  }
57
78
  /**
58
79
  * Compose the production `AgentProfile`: the canonical base profile with the
@@ -61,9 +82,14 @@ interface ComposeProductionAgentProfileOptions {
61
82
  * the scorecard profile hash reflects the actual production profile.
62
83
  *
63
84
  * Merge rules:
64
- * - `mcp`: base map preserved; the delegation entry is appended under
85
+ * - `mcp`: base map preserved; `options.mcpConnections` (resolved certified
86
+ * servers) merged over it; the delegation entry is appended last under
65
87
  * {@link DELEGATION_MCP_SERVER_KEY}, and omitted entirely when no sandbox
66
88
  * API key resolves.
89
+ * - `tools`: base box-flags map preserved; `options.tools` overlaid per key.
90
+ * - `hooks`: per event, base commands preserved; `options.hooks[event]`
91
+ * appended after the base ones.
92
+ * - `subagents`: base map preserved; `options.subagents` overlaid per key.
67
93
  * - `prompt.systemPrompt`: replaced when `options.systemPrompt` is set.
68
94
  * - `resources.files`: `options.extraFiles` concatenated after base files.
69
95
  * - `name`: replaced when `options.name` is set.
@@ -1,5 +1,5 @@
1
1
  import { AnalystFinding } from '@tangle-network/agent-eval';
2
- import { I as Iteration, D as Driver } from './types-BEQsBhOE.js';
2
+ import { I as Iteration, D as Driver } from './types-CklkW4Eh.js';
3
3
 
4
4
  /**
5
5
  * @experimental
package/dist/index.d.ts CHANGED
@@ -1,18 +1,18 @@
1
1
  import { AgentProfile, AgentEvalError, KnowledgeReadinessReport, RunRecord, ControlEvalResult, KnowledgeRequirement } from '@tangle-network/agent-eval';
2
2
  export { AgentEvalError, AgentEvalErrorCode, ConfigError, ControlBudget, ControlDecision, ControlEvalResult, ControlRunResult, ControlStep, DataAcquisitionPlan, JudgeError, KnowledgeReadinessReport, KnowledgeRequirement, NotFoundError, RunRecord, ValidationError } from '@tangle-network/agent-eval';
3
- import { h as AgentBackendInput, i as AgentExecutionBackend, c as OpenAIChatTool, j as OpenAIChatToolChoice, k as AgentBackendContext, R as RuntimeStreamEvent, K as KnowledgeReadinessDecision, l as RunAgentTaskOptions, m as AgentTaskRunResult, n as RunAgentTaskStreamOptions, o as AgentRuntimeEvent, p as AgentTaskStatus, q as RuntimeSessionStore, r as RuntimeSession } from './types-BEQsBhOE.js';
4
- export { s as AgentAdapter, t as AgentKnowledgeProvider, u as AgentRuntimeEventSink, v as AgentTaskContext, w as AgentTaskSpec, B as BackendErrorDetail, x as RuntimeRunHandle, y as RuntimeRunPersistenceAdapter, z as RuntimeRunRow, C as startRuntimeRun } from './types-BEQsBhOE.js';
3
+ import { h as AgentBackendInput, i as AgentExecutionBackend, c as OpenAIChatTool, j as OpenAIChatToolChoice, k as AgentBackendContext, R as RuntimeStreamEvent, K as KnowledgeReadinessDecision, l as RunAgentTaskOptions, m as AgentTaskRunResult, n as RunAgentTaskStreamOptions, o as AgentRuntimeEvent, p as AgentTaskStatus, q as RuntimeSessionStore, r as RuntimeSession } from './types-CklkW4Eh.js';
4
+ export { s as AgentAdapter, t as AgentKnowledgeProvider, u as AgentRuntimeEventSink, v as AgentTaskContext, w as AgentTaskSpec, B as BackendErrorDetail, x as RuntimeRunHandle, y as RuntimeRunPersistenceAdapter, z as RuntimeRunRow, C as startRuntimeRun } from './types-CklkW4Eh.js';
5
5
  import { Scenario, ProfileDispatchFn } from '@tangle-network/agent-eval/campaign';
6
- export { C as CoderLoopRunnerOptions, D as DELEGATED_LOOP_MODES, a as DelegatedLoopMode, b as DelegatedLoopRegistry, c as DelegatedLoopResult, d as DelegatedLoopRunner, e as DynamicLoopRunnerOptions, L as LoopRunnerCliArgs, f as LoopRunnerCliResult, R as ResearchLoopResult, g as ResearchLoopRunnerOptions, h as RunDelegatedLoopOptions, V as VetoedFact, i as auditLoopRunner, j as coderLoopRunner, k as dynamicLoopRunner, l as isDelegatedLoopMode, p as parseLoopRunnerArgv, r as researchLoopRunner, m as reviewLoopRunner, n as runDelegatedLoop, o as runLoopRunnerCli, s as selfImproveLoopRunner } from './loop-runner-bin-DFUNgpeK.js';
7
- export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from './openai-tools-D4HLDWgw.js';
8
- export { aD as EvalRunEvent, aE as EvalRunGeneration, aF as EvalRunsExportConfig, aG as EvalRunsExportResult, aH as INTELLIGENCE_WIRE_VERSION, aI as LoopSpanNode, aJ as OtelAttribute, aK as OtelExportConfig, aL as OtelExporter, aM as OtelSpan, aN as buildLoopOtelSpans, aO as buildLoopSpanNodes, aP as createOtelExporter, aQ as exportEvalRuns, aR as loopEventToOtelSpan } from './kb-gate-CHAyt4aI.js';
6
+ export { C as CoderLoopRunnerOptions, D as DELEGATED_LOOP_MODES, a as DelegatedLoopMode, b as DelegatedLoopRegistry, c as DelegatedLoopResult, d as DelegatedLoopRunner, e as DynamicLoopRunnerOptions, L as LoopRunnerCliArgs, f as LoopRunnerCliResult, R as ResearchLoopResult, g as ResearchLoopRunnerOptions, h as RunDelegatedLoopOptions, V as VetoedFact, i as auditLoopRunner, j as coderLoopRunner, k as dynamicLoopRunner, l as isDelegatedLoopMode, p as parseLoopRunnerArgv, r as researchLoopRunner, m as reviewLoopRunner, n as runDelegatedLoop, o as runLoopRunnerCli, s as selfImproveLoopRunner } from './loop-runner-bin-D4Ir7b00.js';
7
+ export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from './openai-tools-CKfR3EMh.js';
8
+ export { aD as EvalRunEvent, aE as EvalRunGeneration, aF as EvalRunsExportConfig, aG as EvalRunsExportResult, aH as INTELLIGENCE_WIRE_VERSION, aI as LoopSpanNode, aJ as OtelAttribute, aK as OtelExportConfig, aL as OtelExporter, aM as OtelSpan, aN as buildLoopOtelSpans, aO as buildLoopSpanNodes, aP as createOtelExporter, aQ as exportEvalRuns, aR as loopEventToOtelSpan } from './kb-gate-CKfykcYQ.js';
9
9
  import { R as RuntimeHooks } from './runtime-hooks-C7JwKb9E.js';
10
10
  export { b as RuntimeDecisionEvidenceRef, c as RuntimeDecisionKind, d as RuntimeDecisionPoint, e as RuntimeHookContext, f as RuntimeHookErrorContext, a as RuntimeHookEvent, g as RuntimeHookPhase, h as RuntimeHookTarget, i as composeRuntimeHooks, j as defineRuntimeHooks, n as notifyRuntimeDecisionPoint, k as notifyRuntimeHookEvent } from './runtime-hooks-C7JwKb9E.js';
11
11
  import '@tangle-network/sandbox';
12
12
  import '@tangle-network/agent-eval/contract';
13
13
  import './types-p8dWBIXL.js';
14
- import './coder-_YCf3BAK.js';
15
- import './driver-DLI1io57.js';
14
+ import './coder-LKm3Mczw.js';
15
+ import './driver-B2RKkVJW.js';
16
16
  import './substrate-CUgk7F7s.js';
17
17
 
18
18
  /**
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  mcpToolsForRuntimeMcp,
3
3
  mcpToolsForRuntimeMcpSubset
4
- } from "./chunk-V2K35HF2.js";
5
- import "./chunk-BERLUBAP.js";
4
+ } from "./chunk-P4QNEXFC.js";
5
+ import "./chunk-FO4DCM7R.js";
6
6
  import {
7
7
  DELEGATED_LOOP_MODES,
8
8
  auditLoopRunner,
@@ -15,9 +15,9 @@ import {
15
15
  runDelegatedLoop,
16
16
  runLoopRunnerCli,
17
17
  selfImproveLoopRunner
18
- } from "./chunk-COAVO6QB.js";
18
+ } from "./chunk-K5M3SHEU.js";
19
19
  import "./chunk-FNMGYYSS.js";
20
- import "./chunk-4JI4BCBI.js";
20
+ import "./chunk-AYRQZRDV.js";
21
21
  import "./chunk-KADIJAD4.js";
22
22
  import "./chunk-HNUXAZIJ.js";
23
23
  import {
@@ -33,7 +33,7 @@ import {
33
33
  defineRuntimeHooks,
34
34
  notifyRuntimeDecisionPoint,
35
35
  notifyRuntimeHookEvent
36
- } from "./chunk-2OU7ZQPD.js";
36
+ } from "./chunk-K6WP7PYW.js";
37
37
  import {
38
38
  AgentEvalError,
39
39
  BackendTransportError,
@@ -351,6 +351,7 @@ function mapCommonBackendEvent(event, context) {
351
351
  proposalId,
352
352
  title: stringValue(data.title) ?? stringValue(record.title) ?? proposalId,
353
353
  status: status === "pending" || status === "approved" || status === "rejected" ? status : void 0,
354
+ content: stringValue(data.content) ?? stringValue(data.body) ?? stringValue(record.content),
354
355
  timestamp: nowIso()
355
356
  };
356
357
  }
@@ -2604,6 +2605,7 @@ function sanitizeRuntimeStreamEvent(event, options = {}) {
2604
2605
  timestamp: event.timestamp,
2605
2606
  proposalId: event.proposalId,
2606
2607
  title: options.includeControlPayloads ? event.title : void 0,
2608
+ content: options.includeControlPayloads ? event.content : void 0,
2607
2609
  status: event.status
2608
2610
  };
2609
2611
  }