@tangle-network/agent-runtime 0.155.0 → 0.156.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 (36) hide show
  1. package/dist/agent.d.ts +1 -1
  2. package/dist/agent.js +1 -1
  3. package/dist/{authoring-8NW3YQvI.js → authoring-C4uCoDmO.js} +2 -2
  4. package/dist/{authoring-8NW3YQvI.js.map → authoring-C4uCoDmO.js.map} +1 -1
  5. package/dist/durable.d.ts +1 -1
  6. package/dist/durable.js +1 -1
  7. package/dist/{graph-BCzC-tnl.js → graph-BibNm6a-.js} +2 -2
  8. package/dist/{graph-BCzC-tnl.js.map → graph-BibNm6a-.js.map} +1 -1
  9. package/dist/{index-CNqUQfuv.d.ts → index-B2A_KtAZ.d.ts} +14 -4
  10. package/dist/{index-DU6lU9GO.d.ts → index-BYGBIxtx.d.ts} +2 -2
  11. package/dist/index.d.ts +3 -3
  12. package/dist/index.js +4 -4
  13. package/dist/kernel.d.ts +1 -1
  14. package/dist/kernel.js +4 -4
  15. package/dist/{knowledge-BDoJh3Me.js → knowledge-DeP-wG8l.js} +2 -2
  16. package/dist/{knowledge-BDoJh3Me.js.map → knowledge-DeP-wG8l.js.map} +1 -1
  17. package/dist/knowledge.d.ts +1 -1
  18. package/dist/knowledge.js +1 -1
  19. package/dist/{loop-runner-bin-mX79dLj2.d.ts → loop-runner-bin-9VUQihh7.d.ts} +2 -2
  20. package/dist/{loop-runner-bin-DyoELXnJ.js → loop-runner-bin-LvaprzUz.js} +2 -2
  21. package/dist/{loop-runner-bin-DyoELXnJ.js.map → loop-runner-bin-LvaprzUz.js.map} +1 -1
  22. package/dist/loop-runner-bin.d.ts +1 -1
  23. package/dist/loop-runner-bin.js +1 -1
  24. package/dist/mcp/bin.js +2 -2
  25. package/dist/mcp/index.d.ts +3 -3
  26. package/dist/mcp/index.js +4 -4
  27. package/dist/{openai-tools-DUOEbKMV.js → openai-tools-CkSQJppW.js} +2 -2
  28. package/dist/{openai-tools-DUOEbKMV.js.map → openai-tools-CkSQJppW.js.map} +1 -1
  29. package/dist/{runtime-DW9t84HW.js → runtime-D-NDRp4y.js} +4 -4
  30. package/dist/{runtime-DW9t84HW.js.map → runtime-D-NDRp4y.js.map} +1 -1
  31. package/dist/{supervise-gZ3xYJs3.js → supervise-BVE0XAJa.js} +24 -7
  32. package/dist/supervise-BVE0XAJa.js.map +1 -0
  33. package/dist/testing.d.ts +1 -1
  34. package/dist/testing.js +10 -10
  35. package/package.json +1 -1
  36. package/dist/supervise-gZ3xYJs3.js.map +0 -1
@@ -143,6 +143,10 @@ function createEventBus(now = Date.now) {
143
143
  *
144
144
  * @experimental
145
145
  */
146
+ /** Where a question this driver cannot answer goes next. `answer_question` accepts these and
147
+ * nothing else, so the decision type states them and nothing else. */
148
+ const questionEscalationTargets = ["parent", "user"];
149
+ const isQuestionEscalationTarget = (value) => questionEscalationTargets.includes(value);
146
150
  /** Producer-side cleanliness for the `finding` event. The findings payload is arbitrary analyst
147
151
  * output, the digest a subscriber computes (RFC 8785) throws on ANY `undefined` value — nested
148
152
  * included — and a throwing subscriber leaves the event invisible to EVERY subscriber. The
@@ -1433,7 +1437,7 @@ function createCoordinationTools(opts) {
1433
1437
  deferReason: { type: "string" },
1434
1438
  escalateTo: {
1435
1439
  type: "string",
1436
- enum: ["parent", "user"]
1440
+ enum: questionEscalationTargets
1437
1441
  },
1438
1442
  escalateReason: { type: "string" }
1439
1443
  },
@@ -1468,7 +1472,8 @@ function createCoordinationTools(opts) {
1468
1472
  kind: "defer",
1469
1473
  reason: a.deferReason
1470
1474
  }) });
1471
- if (a.escalateTo === "parent" || a.escalateTo === "user") {
1475
+ if (typeof a.escalateTo === "string" && a.escalateTo.length > 0) {
1476
+ if (!isQuestionEscalationTarget(a.escalateTo)) throw new Error(`answer_question: escalateTo must be one of ${questionEscalationTargets.join(", ")}; received ${JSON.stringify(a.escalateTo)}`);
1472
1477
  const escalateReason = typeof a.escalateReason === "string" && a.escalateReason.length > 0 ? a.escalateReason : "driver escalated";
1473
1478
  return Promise.resolve({ question: decideQuestion(questionId, {
1474
1479
  kind: "escalate",
@@ -4846,6 +4851,18 @@ function defaultEstimate(args) {
4846
4851
  return PER_LENS_PER_ROUTE_ESTIMATE_MS * lenses * routes;
4847
4852
  }
4848
4853
  //#endregion
4854
+ //#region src/mcp/types.ts
4855
+ /**
4856
+ * Every delegation profile a queued record can carry. One owner: the tool schemas and validators
4857
+ * that filter on a profile read this list, so a profile added here cannot be one a tool refuses.
4858
+ * @experimental
4859
+ */
4860
+ const delegationProfiles = [
4861
+ "coder",
4862
+ "researcher",
4863
+ "ui-auditor"
4864
+ ];
4865
+ //#endregion
4849
4866
  //#region src/mcp/tools/delegation-history.ts
4850
4867
  /** MCP tool name for the `delegation_history` read-past-delegations tool. @stable */
4851
4868
  const DELEGATION_HISTORY_TOOL_NAME = "delegation_history";
@@ -4865,7 +4882,7 @@ const DELEGATION_HISTORY_DESCRIPTION = [
4865
4882
  "Each entry carries `hasTrace` — when true, the full loop-trace span tree",
4866
4883
  "is retrievable via delegation_status { taskId, includeTrace: true }.",
4867
4884
  "",
4868
- "Filters: `namespace` (multi-tenant scope), `profile` (\"coder\" | \"researcher\"),",
4885
+ `Filters: \`namespace\` (multi-tenant scope), \`profile\` (${delegationProfiles.map((profile) => `"${profile}"`).join(" | ")}),`,
4869
4886
  "`since` (ISO date — only delegations started at-or-after). `limit` defaults",
4870
4887
  "to 50, capped at 500."
4871
4888
  ].join("\n");
@@ -4876,7 +4893,7 @@ const DELEGATION_HISTORY_INPUT_SCHEMA = {
4876
4893
  namespace: { type: "string" },
4877
4894
  profile: {
4878
4895
  type: "string",
4879
- enum: ["coder", "researcher"]
4896
+ enum: delegationProfiles
4880
4897
  },
4881
4898
  since: {
4882
4899
  type: "string",
@@ -4901,7 +4918,7 @@ function validateDelegationHistoryArgs(raw) {
4901
4918
  out.namespace = value.namespace;
4902
4919
  }
4903
4920
  if (value.profile !== void 0) {
4904
- if (value.profile !== "coder" && value.profile !== "researcher") throw new TypeError("delegation_history: `profile` must be \"coder\" or \"researcher\"");
4921
+ if (!delegationProfiles.includes(value.profile)) throw new TypeError(`delegation_history: \`profile\` must be one of ${delegationProfiles.join(", ")}`);
4905
4922
  out.profile = value.profile;
4906
4923
  }
4907
4924
  if (value.since !== void 0) {
@@ -7170,6 +7187,6 @@ function rootProviderModelEvidenceFromExecution(evidence) {
7170
7187
  return evidence ?? rootProviderModelEvidence([]);
7171
7188
  }
7172
7189
  //#endregion
7173
- export { DELEGATION_TRACE_MAX_BYTES as $, DELEGATION_HISTORY_INPUT_SCHEMA as A, mapExecutorResult as At, DELEGATE_FEEDBACK_INPUT_SCHEMA as B, createMcpServer as C, plateauLength as Ct, createDelegationStatusHandler as D, FileCoordinationLog as Dt, DELEGATION_STATUS_TOOL_NAME as E, createInMemoryRunContext as Et, DELEGATE_UI_AUDIT_INPUT_SCHEMA as F, createEventBus as Ft, DELEGATE_INPUT_SCHEMA as G, createDelegateFeedbackHandler as H, DELEGATE_UI_AUDIT_TOOL_NAME as I, defaultToolDetectors as It, validateDelegateArgs as J, DELEGATE_TOOL_NAME as K, createDelegateUiAuditHandler as L, watchTrace as Lt, createDelegationHistoryHandler as M, canonicalFindingEvent as Mt, validateDelegationHistoryArgs as N, createCoordinationTools as Nt, validateDelegationStatusArgs as O, createSupervisorSpanRecorder as Ot, DELEGATE_UI_AUDIT_DESCRIPTION as P, normalizeAnalyzeOnSettle as Pt, hashIdempotencyInput as Q, validateDelegateUiAuditArgs as R, createInProcessTransport as S, bestSoFar as St, DELEGATION_STATUS_INPUT_SCHEMA as T, createFileRunContext as Tt, validateDelegateFeedbackArgs as U, DELEGATE_FEEDBACK_TOOL_NAME as V, DELEGATE_DESCRIPTION as W, delegate as X, defaultDelegateBudget as Y, DelegationTaskQueue as Z, promptHandle as _, noProgressFor as _t, assertCoordinationBinding as a, DelegationPersistenceError as at, classifyDriverFailure as b, anytimeReport as bt, supervisorAgentWithTestBrain as c, InMemoryDelegationStore as ct, delegatesWorkerBriefPrompt as d, driverAgent as dt, DELEGATION_TRACE_MAX_SPANS as et, dumbContinuationFailPrompt as f, finalizeBestDelivered as ft, naiveContinuationPrompt as g, createProgressTracker as gt, kernelPromptRegistry as h, anyOf as ht, workerFromBackend as i, createDelegationTraceCollector as it, DELEGATION_HISTORY_TOOL_NAME as j, DEFAULT_AWAIT_EVENT_TIMEOUT_MS as jt, DELEGATION_HISTORY_DESCRIPTION as k, gateOnDeliverable as kt, analyzesFindingsReportPrompt as l, InMemoryFeedbackStore as lt, formatPromptHandle as m, allWorkersStalled as mt, supervise as n, capDelegationTrace as nt, resolveSupervisorProfile as o, DelegationStateCorruptError as ot, dumbContinuationPassPrompt as p, allOf as pt, createDelegateHandler as q, superviseWithTestBrain as r, composeLoopTraceEmitters as rt, supervisorAgent as s, FileDelegationStore as st, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, buildDelegationTraceSpans as tt, createPromptRegistry as u, eventToSnapshot as ut, supervisorPolicyPrompt as v, plateau as vt, DELEGATION_STATUS_DESCRIPTION as w, renderAnytimeTable as wt, serveCoordinationMcp as x, areaUnderCurve as xt, DriverAttemptsExhaustedError as y, sampleFromSettled as yt, DELEGATE_FEEDBACK_DESCRIPTION as z };
7190
+ export { hashIdempotencyInput as $, DELEGATION_HISTORY_INPUT_SCHEMA as A, gateOnDeliverable as At, DELEGATE_FEEDBACK_DESCRIPTION as B, createMcpServer as C, bestSoFar as Ct, createDelegationStatusHandler as D, createInMemoryRunContext as Dt, DELEGATION_STATUS_TOOL_NAME as E, createFileRunContext as Et, DELEGATE_UI_AUDIT_DESCRIPTION as F, normalizeAnalyzeOnSettle as Ft, DELEGATE_DESCRIPTION as G, DELEGATE_FEEDBACK_TOOL_NAME as H, DELEGATE_UI_AUDIT_INPUT_SCHEMA as I, questionEscalationTargets as It, createDelegateHandler as J, DELEGATE_INPUT_SCHEMA as K, DELEGATE_UI_AUDIT_TOOL_NAME as L, createEventBus as Lt, createDelegationHistoryHandler as M, DEFAULT_AWAIT_EVENT_TIMEOUT_MS as Mt, validateDelegationHistoryArgs as N, canonicalFindingEvent as Nt, validateDelegationStatusArgs as O, FileCoordinationLog as Ot, delegationProfiles as P, createCoordinationTools as Pt, DelegationTaskQueue as Q, createDelegateUiAuditHandler as R, defaultToolDetectors as Rt, createInProcessTransport as S, areaUnderCurve as St, DELEGATION_STATUS_INPUT_SCHEMA as T, renderAnytimeTable as Tt, createDelegateFeedbackHandler as U, DELEGATE_FEEDBACK_INPUT_SCHEMA as V, validateDelegateFeedbackArgs as W, defaultDelegateBudget as X, validateDelegateArgs as Y, delegate as Z, promptHandle as _, createProgressTracker as _t, assertCoordinationBinding as a, createDelegationTraceCollector as at, classifyDriverFailure as b, sampleFromSettled as bt, supervisorAgentWithTestBrain as c, FileDelegationStore as ct, delegatesWorkerBriefPrompt as d, eventToSnapshot as dt, DELEGATION_TRACE_MAX_BYTES as et, dumbContinuationFailPrompt as f, driverAgent as ft, naiveContinuationPrompt as g, anyOf as gt, kernelPromptRegistry as h, allWorkersStalled as ht, workerFromBackend as i, composeLoopTraceEmitters as it, DELEGATION_HISTORY_TOOL_NAME as j, mapExecutorResult as jt, DELEGATION_HISTORY_DESCRIPTION as k, createSupervisorSpanRecorder as kt, analyzesFindingsReportPrompt as l, InMemoryDelegationStore as lt, formatPromptHandle as m, allOf as mt, supervise as n, buildDelegationTraceSpans as nt, resolveSupervisorProfile as o, DelegationPersistenceError as ot, dumbContinuationPassPrompt as p, finalizeBestDelivered as pt, DELEGATE_TOOL_NAME as q, superviseWithTestBrain as r, capDelegationTrace as rt, supervisorAgent as s, DelegationStateCorruptError as st, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, DELEGATION_TRACE_MAX_SPANS as tt, createPromptRegistry as u, InMemoryFeedbackStore as ut, supervisorPolicyPrompt as v, noProgressFor as vt, DELEGATION_STATUS_DESCRIPTION as w, plateauLength as wt, serveCoordinationMcp as x, anytimeReport as xt, DriverAttemptsExhaustedError as y, plateau as yt, validateDelegateUiAuditArgs as z, watchTrace as zt };
7174
7191
 
7175
- //# sourceMappingURL=supervise-gZ3xYJs3.js.map
7192
+ //# sourceMappingURL=supervise-BVE0XAJa.js.map