@tangle-network/agent-runtime 0.53.0 → 0.54.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 (71) hide show
  1. package/README.md +27 -16
  2. package/dist/agent.d.ts +1 -1
  3. package/dist/agent.js +5 -3
  4. package/dist/agent.js.map +1 -1
  5. package/dist/analyst-loop.d.ts +1 -1
  6. package/dist/analyst-loop.js +2 -2
  7. package/dist/{chunk-K5M3SHEU.js → chunk-2BDXWZUC.js} +5 -34
  8. package/dist/chunk-2BDXWZUC.js.map +1 -0
  9. package/dist/chunk-A73RADPB.js +281 -0
  10. package/dist/chunk-A73RADPB.js.map +1 -0
  11. package/dist/chunk-FRBWCJLP.js +396 -0
  12. package/dist/chunk-FRBWCJLP.js.map +1 -0
  13. package/dist/chunk-GRAGM4MC.js +72 -0
  14. package/dist/chunk-GRAGM4MC.js.map +1 -0
  15. package/dist/{chunk-K6WP7PYW.js → chunk-JTH2FPCK.js} +3231 -424
  16. package/dist/chunk-JTH2FPCK.js.map +1 -0
  17. package/dist/{chunk-P4QNEXFC.js → chunk-KJH62YEK.js} +2 -2
  18. package/dist/{chunk-HNUXAZIJ.js → chunk-P5OKDSLB.js} +2 -2
  19. package/dist/{chunk-GSUO5QS6.js → chunk-VLF5RHEQ.js} +2 -5
  20. package/dist/{chunk-GSUO5QS6.js.map → chunk-VLF5RHEQ.js.map} +1 -1
  21. package/dist/{chunk-JFIYKDXF.js → chunk-XRYEZPR6.js} +2 -1
  22. package/dist/chunk-XRYEZPR6.js.map +1 -0
  23. package/dist/{coder-LKm3Mczw.d.ts → coder-CEkUFv8h.d.ts} +1 -1
  24. package/dist/{types-CNDJCL_0.d.ts → coordination-BMzskrUR.d.ts} +268 -2
  25. package/dist/{kb-gate-CKfykcYQ.d.ts → delegates-BPLIl8EC.d.ts} +491 -566
  26. package/dist/index.d.ts +7 -7
  27. package/dist/index.js +23 -80
  28. package/dist/index.js.map +1 -1
  29. package/dist/intelligence.d.ts +2 -2
  30. package/dist/kb-gate-CuzMYGYM.d.ts +76 -0
  31. package/dist/{loop-runner-bin-D4Ir7b00.d.ts → loop-runner-bin-BGpVVyXp.d.ts} +6 -27
  32. package/dist/loop-runner-bin.d.ts +5 -5
  33. package/dist/loop-runner-bin.js +6 -5
  34. package/dist/loops.d.ts +8 -6
  35. package/dist/loops.js +32 -8
  36. package/dist/mcp/bin.js +94 -30
  37. package/dist/mcp/bin.js.map +1 -1
  38. package/dist/mcp/index.d.ts +9 -272
  39. package/dist/mcp/index.js +45 -365
  40. package/dist/mcp/index.js.map +1 -1
  41. package/dist/{openai-tools-CKfR3EMh.d.ts → openai-tools-CoeLQ7Uo.d.ts} +1 -1
  42. package/dist/profiles.d.ts +2 -2
  43. package/dist/profiles.js +4 -4
  44. package/dist/{router-client-B0Qi1NiN.d.ts → router-client-30Y_pca8.d.ts} +1 -1
  45. package/dist/{run-loop-DgVhucoR.d.ts → run-loop-DluzfJ2h.d.ts} +1 -1
  46. package/dist/runtime.d.ts +424 -23
  47. package/dist/runtime.js +32 -8
  48. package/dist/topology.d.ts +54 -1
  49. package/dist/topology.js +222 -0
  50. package/dist/topology.js.map +1 -1
  51. package/dist/{types-CklkW4Eh.d.ts → types-C8rNlxfV.d.ts} +4 -4
  52. package/dist/workflow.d.ts +2 -2
  53. package/dist/workflow.js +4 -2
  54. package/dist/workflow.js.map +1 -1
  55. package/package.json +5 -5
  56. package/skills/agent-runtime-adoption/SKILL.md +54 -46
  57. package/skills/build-with-agent-runtime/SKILL.md +12 -8
  58. package/skills/loop-writer/SKILL.md +9 -1
  59. package/skills/supervise/SKILL.md +24 -0
  60. package/dist/chunk-5M2WDWBI.js +0 -908
  61. package/dist/chunk-5M2WDWBI.js.map +0 -1
  62. package/dist/chunk-AYRQZRDV.js +0 -623
  63. package/dist/chunk-AYRQZRDV.js.map +0 -1
  64. package/dist/chunk-FO4DCM7R.js +0 -1356
  65. package/dist/chunk-FO4DCM7R.js.map +0 -1
  66. package/dist/chunk-JFIYKDXF.js.map +0 -1
  67. package/dist/chunk-K5M3SHEU.js.map +0 -1
  68. package/dist/chunk-K6WP7PYW.js.map +0 -1
  69. package/dist/driver-B2RKkVJW.d.ts +0 -221
  70. /package/dist/{chunk-P4QNEXFC.js.map → chunk-KJH62YEK.js.map} +0 -0
  71. /package/dist/{chunk-HNUXAZIJ.js.map → chunk-P5OKDSLB.js.map} +0 -0
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-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';
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-C8rNlxfV.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-C8rNlxfV.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-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';
6
+ export { C as CoderLoopRunnerOptions, D as DELEGATED_LOOP_MODES, a as DelegatedLoopMode, b as DelegatedLoopRegistry, c as DelegatedLoopResult, d as DelegatedLoopRunner, L as LoopRunnerCliArgs, e as LoopRunnerCliResult, R as ResearchLoopResult, f as ResearchLoopRunnerOptions, g as RunDelegatedLoopOptions, V as VetoedFact, h as auditLoopRunner, i as coderLoopRunner, j as isDelegatedLoopMode, p as parseLoopRunnerArgv, r as researchLoopRunner, k as reviewLoopRunner, l as runDelegatedLoop, m as runLoopRunnerCli, s as selfImproveLoopRunner } from './loop-runner-bin-BGpVVyXp.js';
7
+ export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from './openai-tools-CoeLQ7Uo.js';
8
+ export { ax as EvalRunEvent, ay as EvalRunGeneration, az as EvalRunsExportConfig, aA as EvalRunsExportResult, aB as INTELLIGENCE_WIRE_VERSION, aC as LoopSpanNode, aD as OtelAttribute, aE as OtelExportConfig, aF as OtelExporter, aG as OtelSpan, aH as buildLoopOtelSpans, aI as buildLoopSpanNodes, aJ as createOtelExporter, aK as exportEvalRuns, aL as loopEventToOtelSpan } from './delegates-BPLIl8EC.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-LKm3Mczw.js';
15
- import './driver-B2RKkVJW.js';
14
+ import './kb-gate-CuzMYGYM.js';
15
+ import './coder-CEkUFv8h.js';
16
16
  import './substrate-CUgk7F7s.js';
17
17
 
18
18
  /**
package/dist/index.js CHANGED
@@ -1,13 +1,19 @@
1
1
  import {
2
2
  mcpToolsForRuntimeMcp,
3
3
  mcpToolsForRuntimeMcpSubset
4
- } from "./chunk-P4QNEXFC.js";
5
- import "./chunk-FO4DCM7R.js";
4
+ } from "./chunk-KJH62YEK.js";
5
+ import {
6
+ DEFAULT_ROUTER_BASE_URL,
7
+ cleanModelId,
8
+ getModels,
9
+ resolveChatModel,
10
+ resolveRouterBaseUrl,
11
+ validateChatModelId
12
+ } from "./chunk-GRAGM4MC.js";
6
13
  import {
7
14
  DELEGATED_LOOP_MODES,
8
15
  auditLoopRunner,
9
16
  coderLoopRunner,
10
- dynamicLoopRunner,
11
17
  isDelegatedLoopMode,
12
18
  parseLoopRunnerArgv,
13
19
  researchLoopRunner,
@@ -15,25 +21,18 @@ import {
15
21
  runDelegatedLoop,
16
22
  runLoopRunnerCli,
17
23
  selfImproveLoopRunner
18
- } from "./chunk-K5M3SHEU.js";
24
+ } from "./chunk-2BDXWZUC.js";
19
25
  import "./chunk-FNMGYYSS.js";
20
- import "./chunk-AYRQZRDV.js";
26
+ import "./chunk-A73RADPB.js";
21
27
  import "./chunk-KADIJAD4.js";
22
- import "./chunk-HNUXAZIJ.js";
23
- import {
24
- INTELLIGENCE_WIRE_VERSION,
25
- buildLoopOtelSpans,
26
- buildLoopSpanNodes,
27
- createOtelExporter,
28
- exportEvalRuns,
29
- loopEventToOtelSpan
30
- } from "./chunk-G3RGMA7C.js";
28
+ import "./chunk-P5OKDSLB.js";
31
29
  import {
32
30
  composeRuntimeHooks,
33
31
  defineRuntimeHooks,
34
32
  notifyRuntimeDecisionPoint,
35
33
  notifyRuntimeHookEvent
36
- } from "./chunk-K6WP7PYW.js";
34
+ } from "./chunk-JTH2FPCK.js";
35
+ import "./chunk-WIR4HOOJ.js";
37
36
  import {
38
37
  AgentEvalError,
39
38
  BackendTransportError,
@@ -44,7 +43,15 @@ import {
44
43
  RuntimeRunStateError,
45
44
  SessionMismatchError,
46
45
  ValidationError
47
- } from "./chunk-GSUO5QS6.js";
46
+ } from "./chunk-VLF5RHEQ.js";
47
+ import {
48
+ INTELLIGENCE_WIRE_VERSION,
49
+ buildLoopOtelSpans,
50
+ buildLoopSpanNodes,
51
+ createOtelExporter,
52
+ exportEvalRuns,
53
+ loopEventToOtelSpan
54
+ } from "./chunk-G3RGMA7C.js";
48
55
  import "./chunk-DGUM43GV.js";
49
56
 
50
57
  // src/sessions.ts
@@ -1861,69 +1868,6 @@ function deriveExecutionId(input) {
1861
1868
  return `${input.projectId}:${input.sessionId}:${input.turnIndex}`;
1862
1869
  }
1863
1870
 
1864
- // src/model-resolution.ts
1865
- var DEFAULT_ROUTER_BASE_URL = "https://router.tangle.tools";
1866
- function resolveRouterBaseUrl(env = {}) {
1867
- return (env.TANGLE_ROUTER_URL ?? env.TANGLE_ROUTER_BASE_URL ?? DEFAULT_ROUTER_BASE_URL).replace(/\/v1\/?$/, "").replace(/\/$/, "");
1868
- }
1869
- async function getModels(routerBaseUrl = DEFAULT_ROUTER_BASE_URL) {
1870
- const res = await fetch(`${routerBaseUrl}/v1/models`, {
1871
- headers: { Accept: "application/json" }
1872
- });
1873
- if (!res.ok) throw new Error(`router /v1/models ${res.status}`);
1874
- const body = await res.json();
1875
- return Array.isArray(body.data) ? body.data : [];
1876
- }
1877
- function cleanModelId(value) {
1878
- if (typeof value !== "string") return void 0;
1879
- const trimmed = value.trim();
1880
- return trimmed.length > 0 ? trimmed : void 0;
1881
- }
1882
- function resolveChatModel(candidates, fallback) {
1883
- for (const candidate of candidates) {
1884
- const model = cleanModelId(candidate.model);
1885
- if (model) return { source: candidate.source, model };
1886
- }
1887
- return fallback;
1888
- }
1889
- var WELL_FORMED_MODEL_ID = /^[A-Za-z0-9._/@:-]+$/;
1890
- function isWellFormedModelId(modelId) {
1891
- return modelId.length <= 200 && WELL_FORMED_MODEL_ID.test(modelId);
1892
- }
1893
- function catalogIdsForModel(model) {
1894
- const ids = /* @__PURE__ */ new Set();
1895
- const id = cleanModelId(model.id);
1896
- if (id) ids.add(id);
1897
- const provider = cleanModelId(model._provider) ?? cleanModelId(model.provider);
1898
- if (provider && id && !id.includes("/")) ids.add(`${provider}/${id}`);
1899
- return [...ids];
1900
- }
1901
- async function validateChatModelId(modelId, options = {}) {
1902
- const {
1903
- allowlist = [],
1904
- routerBaseUrl = DEFAULT_ROUTER_BASE_URL,
1905
- loadModels = getModels
1906
- } = options;
1907
- const cleaned = cleanModelId(modelId);
1908
- if (!cleaned) return { succeeded: false, error: "Model id must be a non-empty string." };
1909
- if (!isWellFormedModelId(cleaned)) {
1910
- return { succeeded: false, error: `Model id is malformed: ${cleaned}` };
1911
- }
1912
- if (allowlist.some((id) => cleanModelId(id) === cleaned)) {
1913
- return { succeeded: true, value: cleaned };
1914
- }
1915
- let catalog;
1916
- try {
1917
- catalog = await loadModels(routerBaseUrl);
1918
- } catch (err) {
1919
- const message = err instanceof Error ? err.message : String(err);
1920
- return { succeeded: false, error: `Could not validate model catalog: ${message}` };
1921
- }
1922
- const ids = new Set(catalog.flatMap(catalogIdsForModel));
1923
- if (!ids.has(cleaned)) return { succeeded: false, error: `Model is not available: ${cleaned}` };
1924
- return { succeeded: true, value: cleaned };
1925
- }
1926
-
1927
1871
  // src/readiness.ts
1928
1872
  var DEFAULT_MINIMUM_READINESS_SCORE = 0.7;
1929
1873
  function decideKnowledgeReadiness(report, options = {}) {
@@ -3369,7 +3313,6 @@ export {
3369
3313
  defineConversation,
3370
3314
  defineRuntimeHooks,
3371
3315
  deriveExecutionId,
3372
- dynamicLoopRunner,
3373
3316
  exportEvalRuns,
3374
3317
  getModels,
3375
3318
  handleChatTurn,