@tangle-network/agent-runtime 0.133.7 → 0.133.8

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 (45) hide show
  1. package/dist/{activation-BeFr74qj.js → activation-CbgOt7bK.js} +2 -2
  2. package/dist/{activation-BeFr74qj.js.map → activation-CbgOt7bK.js.map} +1 -1
  3. package/dist/agent.d.ts +1 -1
  4. package/dist/agent.js +2 -2
  5. package/dist/{authoring-CxnWFZVk.js → authoring-DI2ZcORJ.js} +2 -2
  6. package/dist/{authoring-CxnWFZVk.js.map → authoring-DI2ZcORJ.js.map} +1 -1
  7. package/dist/{graph-C_rMgoWQ.js → graph-CnLcp2Tl.js} +2 -2
  8. package/dist/{graph-C_rMgoWQ.js.map → graph-CnLcp2Tl.js.map} +1 -1
  9. package/dist/{improvement-cycle-BBH8oYiA.js → improvement-cycle-ekj_ODWY.js} +3 -3
  10. package/dist/{improvement-cycle-BBH8oYiA.js.map → improvement-cycle-ekj_ODWY.js.map} +1 -1
  11. package/dist/{index-DLjXduyp.d.ts → index-CP8LBWD1.d.ts} +2 -2
  12. package/dist/{index-kMp8g-jT.d.ts → index-Cgo-tyB8.d.ts} +41 -2
  13. package/dist/index.d.ts +3 -3
  14. package/dist/index.js +7 -7
  15. package/dist/intelligence.js +3 -3
  16. package/dist/kernel.d.ts +2 -2
  17. package/dist/kernel.js +7 -7
  18. package/dist/{knowledge-DubRihOP.js → knowledge-BdJoVN9q.js} +3 -3
  19. package/dist/{knowledge-DubRihOP.js.map → knowledge-BdJoVN9q.js.map} +1 -1
  20. package/dist/knowledge.d.ts +1 -1
  21. package/dist/knowledge.js +1 -1
  22. package/dist/{loop-runner-bin-CC5c39zY.d.ts → loop-runner-bin-BX_266wJ.d.ts} +2 -2
  23. package/dist/{loop-runner-bin-CMKMWSH6.js → loop-runner-bin-C1uQcY_O.js} +3 -3
  24. package/dist/{loop-runner-bin-CMKMWSH6.js.map → loop-runner-bin-C1uQcY_O.js.map} +1 -1
  25. package/dist/loop-runner-bin.d.ts +1 -1
  26. package/dist/loop-runner-bin.js +1 -1
  27. package/dist/mcp/bin.js +3 -3
  28. package/dist/mcp/index.d.ts +1 -1
  29. package/dist/mcp/index.js +4 -4
  30. package/dist/{openai-tools-DrQwA-X_.js → openai-tools-BTznyT19.js} +2 -2
  31. package/dist/{openai-tools-DrQwA-X_.js.map → openai-tools-BTznyT19.js.map} +1 -1
  32. package/dist/{runtime-VwxvxGN7.js → runtime-Br49sl8u.js} +79 -17
  33. package/dist/runtime-Br49sl8u.js.map +1 -0
  34. package/dist/{structural-rollout-eAj7HG0m.js → structural-rollout-C4_mifPH.js} +2 -2
  35. package/dist/{structural-rollout-eAj7HG0m.js.map → structural-rollout-C4_mifPH.js.map} +1 -1
  36. package/dist/{supervise-009CRDW1.js → supervise-BTwl4Cdi.js} +19 -5
  37. package/dist/supervise-BTwl4Cdi.js.map +1 -0
  38. package/dist/{supervisor-DNX8CXui.js → supervisor-BA87pb7g.js} +25 -2
  39. package/dist/supervisor-BA87pb7g.js.map +1 -0
  40. package/dist/testing.d.ts +1 -1
  41. package/dist/testing.js +11 -11
  42. package/package.json +1 -1
  43. package/dist/runtime-VwxvxGN7.js.map +0 -1
  44. package/dist/supervise-009CRDW1.js.map +0 -1
  45. package/dist/supervisor-DNX8CXui.js.map +0 -1
@@ -3,7 +3,7 @@ import { t as detachedSnapshot } from "./snapshot-DY6VGliG.js";
3
3
  import { S as contentAddress, b as parseWorkerToolTraceArtifact, d as prepareJsonlAppend, f as writeAllBytes, i as InMemorySpawnJournal, n as FileSpawnJournal, r as InMemoryResultBlobStore, t as FileResultBlobStore, u as parseCommittedJsonLines, x as workerTraceAnalysisStore } from "./spawn-journal-BX3-4WDm.js";
4
4
  import { a as concreteProfileModel, d as harnessRunsAgent, n as assertModelAllowed, r as assertProfileModelsAllowed, s as profileModelExecutionSettings, t as assertExecutableAgentProfile, u as agentHarness } from "./model-policy-Bv1DU2fw.js";
5
5
  import { _ as runtimeOwnedExecutorExecutionBinding, b as runtimeOwnedPendingExecutorMaterialization, d as recordRuntimeOwnedDriveHarnessProviderEvidence, g as runtimeOwnedDriveHarnessProviderEvidence, i as attestRuntimeOwnedScopeOwner, s as inheritRuntimeOwnedExecutorAttestation, v as runtimeOwnedExecutorMaterialization, x as runtimeOwnedScopeOwnerRuntime, y as runtimeOwnedExecutorProviderEvidence } from "./materialization-D2bdTfkK.js";
6
- import { A as spendFromUsageEvents, C as freeSlots, D as teardownExecutor, E as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, F as createExecutorRegistry, Gt as fullProfileMaterialization, Ht as assertProfileMaterialization, I as snapshotExecutorConfig, Jt as promptModelProfileMaterialization, Kt as profileMaterializationAxes$1, M as captureReusableExecutorConfig, O as assertValidBudget, P as createExecutor, R as WORKER_TRACE_PROPAGATION, Ut as controlProfileMaterialization, Wt as defineProfileMaterializationContract, Z as createInbox, _t as createOtelExporter, a as pickBestDelivered, at as runBrainLoop, bt as generateSpanId, c as driverChild, d as deriveNodeExecutionIdentity, en as worktreeCliProfileMaterialization, f as meterRuntimeOwnedProviderAttempt, it as routerBrain, j as bindReusableExecutorExecutionId, l as withDriverExecutor, m as scopeOwnerExecutorNodeContext, mt as buildLoopSpanNodes, n as createSupervisor, o as runFinalizer, p as recordScopeOwnerMaterialization, qt as promptControlProfileMaterialization, r as bestDelivered, s as runTree, wt as toOtelAttributes } from "./supervisor-DNX8CXui.js";
6
+ import { A as spendFromUsageEvents, C as freeSlots, D as teardownExecutor, E as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, F as createExecutor, Gt as defineProfileMaterializationContract, I as createExecutorRegistry, Jt as promptControlProfileMaterialization, Kt as fullProfileMaterialization, L as snapshotExecutorConfig, M as bridgeStopSignalKey, N as captureReusableExecutorConfig, O as assertValidBudget, Q as createInbox, Tt as toOtelAttributes, Ut as assertProfileMaterialization, Wt as controlProfileMaterialization, Yt as promptModelProfileMaterialization, a as pickBestDelivered, at as routerBrain, c as driverChild, d as deriveNodeExecutionIdentity, f as meterRuntimeOwnedProviderAttempt, ht as buildLoopSpanNodes, j as bindReusableExecutorExecutionId, l as withDriverExecutor, m as scopeOwnerExecutorNodeContext, n as createSupervisor, o as runFinalizer, ot as runBrainLoop, p as recordScopeOwnerMaterialization, qt as profileMaterializationAxes$1, r as bestDelivered, s as runTree, tn as worktreeCliProfileMaterialization, vt as createOtelExporter, xt as generateSpanId, z as WORKER_TRACE_PROPAGATION } from "./supervisor-BA87pb7g.js";
7
7
  import { t as composeRuntimeHooks } from "./runtime-hooks-C7iJOWm3.js";
8
8
  import { t as createStdioToolServer } from "./tool-server-VvSK1K3X.js";
9
9
  import { n as UI_LENSES } from "./substrate-B0TYNrXn.js";
@@ -1003,11 +1003,17 @@ function createCoordinationTools(opts) {
1003
1003
  const deliverable = opts.deliverable;
1004
1004
  let stopped = false;
1005
1005
  let reason;
1006
+ let stopNotified = false;
1006
1007
  let submitted;
1007
1008
  let questionSeq = 0;
1008
1009
  const ledger = [];
1009
1010
  const questions = [...opts.priorQuestions ?? []];
1010
1011
  const questionPolicy = opts.questionPolicy ?? "auto";
1012
+ const notifyStop = () => {
1013
+ if (stopNotified) return;
1014
+ stopNotified = true;
1015
+ opts.onStop?.(reason);
1016
+ };
1011
1017
  const completedKeys = /* @__PURE__ */ new Set();
1012
1018
  const keyByWorker = /* @__PURE__ */ new Map();
1013
1019
  const profileNameByWorker = /* @__PURE__ */ new Map();
@@ -2144,6 +2150,7 @@ function createCoordinationTools(opts) {
2144
2150
  submitted = Object.freeze({ result });
2145
2151
  stopped = true;
2146
2152
  reason = "result-accepted";
2153
+ notifyStop();
2147
2154
  return {
2148
2155
  accepted: true,
2149
2156
  retained: "this-result",
@@ -2171,6 +2178,7 @@ function createCoordinationTools(opts) {
2171
2178
  stopped = true;
2172
2179
  const r = obj(raw).reason;
2173
2180
  reason = typeof r === "string" ? r : void 0;
2181
+ notifyStop();
2174
2182
  return Promise.resolve({ stopped: true });
2175
2183
  }
2176
2184
  }
@@ -4850,6 +4858,7 @@ async function serveCoordinationMcp(opts) {
4850
4858
  ...opts.authorizeDownMessage ? { authorizeDownMessage: opts.authorizeDownMessage } : {},
4851
4859
  perWorker: opts.perWorker,
4852
4860
  ...opts.deliverable ? { deliverable: opts.deliverable } : {},
4861
+ ...opts.onStop ? { onStop: opts.onStop } : {},
4853
4862
  ...opts.maxLiveWorkers !== void 0 ? { maxLiveWorkers: opts.maxLiveWorkers } : {},
4854
4863
  awaitTimeoutMs: opts.awaitTimeoutMs ?? 15e3,
4855
4864
  ...opts.analysts ? { analysts: opts.analysts } : {},
@@ -5463,6 +5472,7 @@ function buildSupervisorAgent(profile, deps, testBrain) {
5463
5472
  const priorCoordination = deps.loadPriorCoordination ? await deps.loadPriorCoordination() : deps.priorCoordination;
5464
5473
  const nodeTools = resolveTools && context ? await bindSupervisorTools(resolveTools, context, scope.signal) : void 0;
5465
5474
  const onEvent = bindSupervisorNodeObserver(context, observeNodeEvent, deps.onEvent);
5475
+ const stopController = new AbortController();
5466
5476
  const mcp = await serveCoordinationMcp({
5467
5477
  scope,
5468
5478
  blobs: deps.blobs,
@@ -5473,6 +5483,9 @@ function buildSupervisorAgent(profile, deps, testBrain) {
5473
5483
  ...coordination?.port !== void 0 ? { port: coordination.port } : {},
5474
5484
  ...coordination?.allowUnauthenticatedRemote === true ? { allowUnauthenticatedRemote: true } : {},
5475
5485
  ...deps.deliverable ? { deliverable: deps.deliverable } : {},
5486
+ onStop: (reason) => {
5487
+ if (!stopController.signal.aborted) stopController.abort(reason ?? "coordination stop");
5488
+ },
5476
5489
  ...deps.maxLiveWorkers !== void 0 ? { maxLiveWorkers: deps.maxLiveWorkers } : {},
5477
5490
  ...deps.analysts ? { analysts: deps.analysts } : {},
5478
5491
  ...deps.analyzeOnSettle ? { analyzeOnSettle: deps.analyzeOnSettle } : {},
@@ -5495,6 +5508,7 @@ function buildSupervisorAgent(profile, deps, testBrain) {
5495
5508
  task,
5496
5509
  scope,
5497
5510
  coordinationMcpUrl: mcp.url,
5511
+ stopSignal: stopController.signal,
5498
5512
  coordinationTools: (nodeTools ?? []).map(({ name, description, inputSchema }) => ({
5499
5513
  name,
5500
5514
  description,
@@ -5502,7 +5516,7 @@ function buildSupervisorAgent(profile, deps, testBrain) {
5502
5516
  }))
5503
5517
  });
5504
5518
  } catch (error) {
5505
- if (!mcp.submittedResult()) throw error;
5519
+ if (!mcp.submittedResult() && !mcp.isStopped()) throw error;
5506
5520
  }
5507
5521
  },
5508
5522
  progress: () => ({
@@ -5758,7 +5772,7 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now) {
5758
5772
  const boundBackend = bindReusableExecutorExecutionId(captureReusableExecutorConfig(backend, "driveHarnessFromBackend"), executionId);
5759
5773
  const baseFactory = createExecutor(boundBackend);
5760
5774
  let activeExecutor;
5761
- const drive = async ({ profile, task, scope, coordinationMcpUrl, coordinationTools }) => {
5775
+ const drive = async ({ profile, task, scope, coordinationMcpUrl, stopSignal, coordinationTools }) => {
5762
5776
  const initialBudget = scope.budget;
5763
5777
  if (!(scope.view.inFlight > 0 || scope.view.waiting > 0) && (initialBudget.tokensLeft <= 0 || initialBudget.iterationsLeft <= 0 || initialBudget.usdCapped && initialBudget.usdLeft <= 0 || initialBudget.deadlineMs > 0 && now() >= initialBudget.deadlineMs)) throw new ValidationError("driveHarnessFromBackend: supervisor budget exhausted");
5764
5778
  const canonicalDriverProfile = agentProfileSchema.parse(profile);
@@ -5781,7 +5795,7 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now) {
5781
5795
  const executor = baseFactory(spec, {
5782
5796
  signal: scope.signal,
5783
5797
  node: scopeOwnerExecutorNodeContext(scope),
5784
- seams: {}
5798
+ seams: stopSignal === void 0 ? {} : { [bridgeStopSignalKey]: stopSignal }
5785
5799
  });
5786
5800
  activeExecutor = executor;
5787
5801
  let completed = false;
@@ -6525,4 +6539,4 @@ function rootProviderModelEvidenceFromExecution(evidence) {
6525
6539
  //#endregion
6526
6540
  export { DELEGATION_TRACE_MAX_BYTES as $, DELEGATION_HISTORY_INPUT_SCHEMA as A, defaultToolDetectors as At, DELEGATE_FEEDBACK_INPUT_SCHEMA as B, createMcpServer as C, plateauLength as Ct, createDelegationStatusHandler as D, createCoordinationTools as Dt, DELEGATION_STATUS_TOOL_NAME as E, canonicalFindingEvent as Et, DELEGATE_UI_AUDIT_INPUT_SCHEMA as F, createSupervisorSpanRecorder as Ft, DELEGATE_INPUT_SCHEMA as G, createDelegateFeedbackHandler as H, DELEGATE_UI_AUDIT_TOOL_NAME as I, gateOnDeliverable as It, validateDelegateArgs as J, DELEGATE_TOOL_NAME as K, createDelegateUiAuditHandler as L, mapExecutorResult as Lt, createDelegationHistoryHandler as M, createFileRunContext as Mt, validateDelegationHistoryArgs as N, createInMemoryRunContext as Nt, validateDelegationStatusArgs as O, normalizeAnalyzeOnSettle as Ot, DELEGATE_UI_AUDIT_DESCRIPTION as P, FileCoordinationLog as Pt, hashIdempotencyInput as Q, validateDelegateUiAuditArgs as R, createInProcessTransport as S, bestSoFar as St, DELEGATION_STATUS_INPUT_SCHEMA as T, DEFAULT_AWAIT_EVENT_TIMEOUT_MS 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, watchTrace as jt, DELEGATION_HISTORY_DESCRIPTION as k, createEventBus 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 };
6527
6541
 
6528
- //# sourceMappingURL=supervise-009CRDW1.js.map
6542
+ //# sourceMappingURL=supervise-BTwl4Cdi.js.map