@tangle-network/agent-runtime 0.231.1 → 0.233.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 (55) hide show
  1. package/dist/{activation-Dltkq5S8.d.ts → activation-C8fPmjWa.d.ts} +2 -2
  2. package/dist/{activation-DVqSBfe1.js → activation-D0_qcEXf.js} +2 -2
  3. package/dist/{activation-DVqSBfe1.js.map → activation-D0_qcEXf.js.map} +1 -1
  4. package/dist/agent.d.ts +2 -2
  5. package/dist/agent.js +2 -2
  6. package/dist/{coordination-driver-CUdEC2Qh.js → coordination-driver-BR52Rt39.js} +14 -13
  7. package/dist/{coordination-driver-CUdEC2Qh.js.map → coordination-driver-BR52Rt39.js.map} +1 -1
  8. package/dist/{delegate-BN0cSSUT.js → delegate-CA-Tnr1_.js} +2 -2
  9. package/dist/{delegate-BN0cSSUT.js.map → delegate-CA-Tnr1_.js.map} +1 -1
  10. package/dist/durable.d.ts +11 -2
  11. package/dist/durable.js +13 -3
  12. package/dist/durable.js.map +1 -1
  13. package/dist/{graph-D4wgK3ns.js → graph-BtMQMQin.js} +3 -3
  14. package/dist/{graph-D4wgK3ns.js.map → graph-BtMQMQin.js.map} +1 -1
  15. package/dist/{improvement-cycle-CjIeWuyB.js → improvement-cycle-WJJALdil.js} +3 -3
  16. package/dist/{improvement-cycle-CjIeWuyB.js.map → improvement-cycle-WJJALdil.js.map} +1 -1
  17. package/dist/{index-BW6lJXnH.d.ts → index-BwWBXoyq.d.ts} +39 -24
  18. package/dist/index.d.ts +6 -6
  19. package/dist/index.js +7 -7
  20. package/dist/intelligence.d.ts +3 -3
  21. package/dist/intelligence.js +3 -3
  22. package/dist/kernel.d.ts +4 -4
  23. package/dist/kernel.js +9 -9
  24. package/dist/{loop-runner-bin-BodmUPOf.js → loop-runner-bin-7cS9NAmk.js} +3 -3
  25. package/dist/{loop-runner-bin-BodmUPOf.js.map → loop-runner-bin-7cS9NAmk.js.map} +1 -1
  26. package/dist/{loop-runner-bin-BcqlGNW-.d.ts → loop-runner-bin-DaOd42mA.d.ts} +3 -3
  27. package/dist/loop-runner-bin.d.ts +1 -1
  28. package/dist/loop-runner-bin.js +1 -1
  29. package/dist/mcp/bin.js +3 -3
  30. package/dist/mcp/index.d.ts +5 -5
  31. package/dist/mcp/index.js +4 -4
  32. package/dist/{openai-tools-avHT8eq3.d.ts → openai-tools-BdFqNlha.d.ts} +2 -2
  33. package/dist/profiles.d.ts +2 -2
  34. package/dist/{provision-supervisor-DyNDlA2I.js → provision-supervisor-BME3OgTk.js} +3 -3
  35. package/dist/{provision-supervisor-DyNDlA2I.js.map → provision-supervisor-BME3OgTk.js.map} +1 -1
  36. package/dist/{runtime-BxZHapmG.js → runtime-CcfA_ElB.js} +9 -8
  37. package/dist/{runtime-BxZHapmG.js.map → runtime-CcfA_ElB.js.map} +1 -1
  38. package/dist/{server-C9pa2tSq.js → server-DU3nDuDb.js} +3 -3
  39. package/dist/{server-C9pa2tSq.js.map → server-DU3nDuDb.js.map} +1 -1
  40. package/dist/{stream-agent-turn-hiU4vgGX.d.ts → stream-agent-turn-aXpd9b_N.d.ts} +2 -11
  41. package/dist/{structural-rollout-DQoLyth9.js → structural-rollout-YlkrevWE.js} +2 -2
  42. package/dist/{structural-rollout-DQoLyth9.js.map → structural-rollout-YlkrevWE.js.map} +1 -1
  43. package/dist/{substrate-CBo6TWOl.d.ts → substrate-B2Os0b0f.d.ts} +2 -2
  44. package/dist/{supervise-Cl_-IsVc.js → supervise-CAJWyXQ-.js} +13 -10
  45. package/dist/supervise-CAJWyXQ-.js.map +1 -0
  46. package/dist/{supervisor-DFsXULnE.js → supervisor-C2xWmESG.js} +517 -199
  47. package/dist/supervisor-C2xWmESG.js.map +1 -0
  48. package/dist/testing.d.ts +2 -2
  49. package/dist/testing.js +12 -12
  50. package/dist/tui/index.d.ts +1 -1
  51. package/dist/tui/index.js +1 -1
  52. package/dist/{types-DBovefLD.d.ts → types-F5MG_7Qq.d.ts} +228 -27
  53. package/package.json +1 -1
  54. package/dist/supervise-Cl_-IsVc.js.map +0 -1
  55. package/dist/supervisor-DFsXULnE.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { Qr as OutputAdapter, jr as Driver, kr as AgentRunSpec, ri as Validator } from "./types-DBovefLD.js";
1
+ import { Br as Driver, Rr as AgentRunSpec, fi as Validator, si as OutputAdapter } from "./types-F5MG_7Qq.js";
2
2
  import { AgentProfile } from "@tangle-network/agent-interface";
3
3
  //#region src/profiles/coder.d.ts
4
4
  /**
@@ -281,4 +281,4 @@ interface UiFinding {
281
281
  }
282
282
  //#endregion
283
283
  export { CoderTask as _, UiFindingSeverity as a, KnowledgeUpdate as c, ResearchSource as d, ResearchTask as f, researcherProfile as g, multiHarnessResearcherFanout as h, UiFindingScreenshot as i, MultiHarnessResearcherFanoutOptions as l, createResearcherValidator as m, UI_LENSES as n, UiLens as o, ResearcherProfileOptions as p, UiFinding as r, KnowledgeItem as s, UI_FINDING_SEVERITIES as t, ResearchOutput as u, coderTaskToPrompt as v };
284
- //# sourceMappingURL=substrate-CBo6TWOl.d.ts.map
284
+ //# sourceMappingURL=substrate-B2Os0b0f.d.ts.map
@@ -1,10 +1,10 @@
1
- import { $ as captureReusableExecutorConfig, $r as runtimeOwnedExecutorMaterialization, An as RunCancellationReason, At as spendFromUsageTotals, Bi as withBudgetResources, Bt as createInbox, C as scopeOwnerExecutorNodeContext, Ci as addSpend, Cn as resolveAgentEnvironmentProvider, Cr as controlProfileMaterialization, Ct as contentAddress, Dr as promptControlProfileMaterialization, Dt as meterUsageEvent, Er as profileMaterializationAxes$1, F as scopeRetainedOwnerPriorSpend, Fi as unmeteredSpend, Gr as inheritRuntimeOwnedExecutorAttestation, Hr as attestRuntimeOwnedScopeOwner, I as scopeRetainedOwnerResult, Ii as withTimeout, Ir as worktreeCliProfileMaterialization, Ki as teardownExecutor, Li as zeroSpend, Lr as isNoEntError, M as consumeScopeRetainedOwnerResult, Mn as linkAbort, Mr as renderUnsupported, N as prepareScopeRetainedOwnerTask, Nn as runAbortable, On as registerRetainedExecutorPreparation, Or as promptModelProfileMaterialization, Ot as newUsageTotals, P as scopeRetainedOwnerContext, Pr as unsupportedProfileDimensions, Q as bindReusableExecutorExecutionId, Qr as runtimeOwnedExecutorExecutionBinding, Qt as bridgeModelRouteRefusal, Ri as addResourceSpend, Rr as parseCommittedJsonLines, S as restoreScopeOwnerAcceptedExecution, Sr as assertProfileMaterialization, Tr as fullProfileMaterialization, Tt as assertValidBudget, Wi as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, Xr as recordRuntimeOwnedDriveHarnessProviderEvidence, Yr as providerAttemptEvidence, Zn as createOtelExporter, Zr as runtimeOwnedDriveHarnessProviderEvidence, Zt as bridgeAdmissionRefusal, b as meterRuntimeOwnedProviderAttempt, ci as detachedSnapshot, d as runDriverWithRetry, ei as runtimeOwnedExecutorProviderEvidence, er as generateSpanId, f as driverChild, g as beginScopeOwnerAttempt, hn as routerBrain, in as bridgeStopSignalKey, ir as toOtelAttributes, it as snapshotExecutorConfig, j as bindScopeRetainedOwnerProvider, ji as sleep, jt as WORKER_TRACE_PROPAGATION, kn as retainedExecutorSeamKey, m as isDriverSpec, n as createSupervisor, ni as runtimeOwnedScopeOwnerRuntime, nt as createExecutor, o as runFinalizer, p as driverExecutorFactory, r as bestDelivered, rn as bridgeRuntimeAttachmentsKey, s as runTree, t as createRootHandle, ti as runtimeOwnedPendingExecutorMaterialization, u as defaultUnmetContractSteer, v as deriveNodeExecutionIdentity, wr as defineProfileMaterializationContract, x as recordScopeOwnerMaterialization, y as meterRuntimeOwnedAccounting, zi as resourceTelemetry, zr as prepareJsonlAppend } from "./supervisor-DFsXULnE.js";
2
- import { i as ConfigError, m as ValidationError } from "./errors-DodWX-cb.js";
1
+ import { $ as bindReusableExecutorExecutionId, $r as providerAttemptEvidence, An as RunCancellationReason, Ar as profileMaterializationAxes$1, At as spendFromUsageTotals, Bi as withTimeout, Br as worktreeCliProfileMaterialization, Bt as createInbox, C as scopeOwnerExecutorNodeContext, Cn as resolveAgentEnvironmentProvider, Di as addSpend, Dr as controlProfileMaterialization, Dt as meterUsageEvent, Er as assertProfileMaterialization, F as scopeRetainedOwnerPriorSpend, Fi as sleep, Gn as contentAddress, Hi as addResourceSpend, Hr as parseCommittedJsonLines, I as scopeRetainedOwnerResult, Ir as renderUnsupported, J as errMessage, Ji as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, Kr as attestRuntimeOwnedScopeOwner, M as consumeScopeRetainedOwnerResult, Mn as linkAbort, Mr as promptModelProfileMaterialization, N as prepareScopeRetainedOwnerTask, Nn as runAbortable, On as registerRetainedExecutorPreparation, Or as defineProfileMaterializationContract, Ot as newUsageTotals, P as scopeRetainedOwnerContext, Qt as bridgeModelRouteRefusal, Rr as unsupportedProfileDimensions, S as restoreScopeOwnerAcceptedExecution, Tt as assertValidBudget, Ui as resourceTelemetry, Ur as prepareJsonlAppend, Vi as zeroSpend, Vr as isNoEntError, Wi as withBudgetResources, Xi as teardownExecutor, Yr as inheritRuntimeOwnedExecutorAttestation, Zt as bridgeAdmissionRefusal, ai as runtimeOwnedPendingExecutorMaterialization, at as snapshotExecutorConfig, b as meterRuntimeOwnedProviderAttempt, cr as toOtelAttributes, d as runDriverWithRetry, ei as recordRuntimeOwnedDriveHarnessProviderEvidence, et as captureReusableExecutorConfig, f as driverChild, fi as detachedSnapshot, g as beginScopeOwnerAttempt, hn as routerBrain, ii as runtimeOwnedExecutorProviderEvidence, in as bridgeStopSignalKey, ir as generateSpanId, j as bindScopeRetainedOwnerProvider, jr as promptControlProfileMaterialization, jt as WORKER_TRACE_PROPAGATION, kn as retainedExecutorSeamKey, kr as fullProfileMaterialization, m as isDriverSpec, n as createSupervisor, ni as runtimeOwnedExecutorExecutionBinding, o as runFinalizer, oi as runtimeOwnedScopeOwnerRuntime, p as driverExecutorFactory, r as bestDelivered, ri as runtimeOwnedExecutorMaterialization, rn as bridgeRuntimeAttachmentsKey, rt as createExecutor, s as runTree, t as createRootHandle, ti as runtimeOwnedDriveHarnessProviderEvidence, tr as createOtelExporter, u as defaultUnmetContractSteer, v as deriveNodeExecutionIdentity, x as recordScopeOwnerMaterialization, y as meterRuntimeOwnedAccounting, zi as unmeteredSpend } from "./supervisor-C2xWmESG.js";
2
+ import { f as RuntimeRunStateError, i as ConfigError, m as ValidationError } from "./errors-DodWX-cb.js";
3
3
  import { a as concreteProfileModel, c as profileModelExecutionSettings, d as agentHarness, f as harnessRunsAgent, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile } from "./model-policy-BbSCSak0.js";
4
4
  import { t as composeRuntimeHooks } from "./runtime-hooks-tXpAarhW.js";
5
5
  import { n as assertNoSymlinkDescendant } from "./durable-file-D24y9zg7.js";
6
6
  import { n as createStdioToolServer, t as PROTOCOL_VERSION } from "./tool-server-x9NEhvHZ.js";
7
- import { D as coordinationVerbNames, O as createCoordinationTools, S as watchRunCancellation, c as createProgressTracker, d as progressStop, r as driverAgent, v as createFileRunContext, w as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, x as applyRunCancellation, y as createInMemoryRunContext } from "./coordination-driver-CUdEC2Qh.js";
7
+ import { D as coordinationVerbNames, O as createCoordinationTools, S as watchRunCancellation, c as createProgressTracker, d as progressStop, r as driverAgent, v as createFileRunContext, w as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, x as applyRunCancellation, y as createInMemoryRunContext } from "./coordination-driver-BR52Rt39.js";
8
8
  import { k as writeRunCancellation, o as readRunCancelRequest, s as readRunCancellation } from "./run-layout-hZREkcfu.js";
9
9
  import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalCandidateJson, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
10
10
  import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
@@ -78,6 +78,7 @@ function gateOnDeliverable(inner, deliverable) {
78
78
  ...inner.progress ? { progress: () => inner.progress?.() } : {},
79
79
  ...inner.traceSource ? { traceSource: () => inner.traceSource?.() } : {},
80
80
  ...inner.metered ? { metered: () => inner.metered?.() } : {},
81
+ ...inner.harnessTranscript ? { harnessTranscript: () => inner.harnessTranscript?.() } : {},
81
82
  execute(task, signal) {
82
83
  const r = inner.execute(task, signal);
83
84
  if (isAsyncIterable$2(r)) return (async function* () {
@@ -138,6 +139,7 @@ function mapExecutorResult(inner, map) {
138
139
  ...inner.traceSource ? { traceSource: () => inner.traceSource?.() } : {},
139
140
  ...inner.accounting ? { accounting: () => inner.accounting?.() } : {},
140
141
  ...inner.metered ? { metered: () => inner.metered?.() } : {},
142
+ ...inner.harnessTranscript ? { harnessTranscript: () => inner.harnessTranscript?.() } : {},
141
143
  execute(task, signal) {
142
144
  const execution = inner.execute(task, signal);
143
145
  if (isAsyncIterable$2(execution)) return (async function* () {
@@ -1556,9 +1558,10 @@ function buildSupervisorAgent(profile, deps, testBrain) {
1556
1558
  if (harness === null && deps.peerMail) throw new ValidationError("supervisorAgent: peerMail is only served by a harness-brained supervisor (profile.harness set). A router-brained supervisor serves no coordination MCP listener, so there is no peer-mail post office to mint worker capabilities from.");
1557
1559
  if (harness !== null && deps.compaction) throw new ValidationError("supervisorAgent: compaction is only supported for router-brained supervisors (profile.harness omitted or cli-base)");
1558
1560
  if (harness === null && (deps.repromptOnUnmet !== void 0 || deps.onUnmetContract !== void 0)) throw new ValidationError("supervisorAgent: repromptOnUnmet/onUnmetContract apply to an EXTERNAL-harness supervisor only (profile.harness set). A router-brained supervisor runs its own turn loop in process, so this option would be silently ignored.");
1559
- if (deps.repromptOnUnmet !== void 0 && (!Number.isInteger(deps.repromptOnUnmet) || deps.repromptOnUnmet < 0)) throw new ValidationError("supervisorAgent: repromptOnUnmet must be a non-negative integer (0 = never re-prompt)");
1560
- if (deps.onUnmetContract !== void 0 && (deps.repromptOnUnmet ?? 0) <= 0) throw new ValidationError("supervisorAgent: onUnmetContract needs repromptOnUnmet >= 1 — without a cap the hook is never consulted");
1561
- if ((deps.repromptOnUnmet ?? 0) > 0 && deps.deliverable === void 0) throw new ValidationError("supervisorAgent: repromptOnUnmet needs a `deliverable` completion check — with no check there is no contract that can be unmet, and every run would re-prompt");
1561
+ if (deps.repromptOnUnmet !== void 0 && deps.repromptOnUnmet !== "until-complete" && (!Number.isInteger(deps.repromptOnUnmet) || deps.repromptOnUnmet < 0)) throw new ValidationError("supervisorAgent: repromptOnUnmet must be a non-negative integer or 'until-complete' (0 = never re-prompt)");
1562
+ const repromptEnabled = deps.repromptOnUnmet === "until-complete" || (deps.repromptOnUnmet ?? 0) > 0;
1563
+ if (deps.onUnmetContract !== void 0 && !repromptEnabled) throw new ValidationError("supervisorAgent: onUnmetContract needs repromptOnUnmet >= 1 or 'until-complete'");
1564
+ if (repromptEnabled && deps.deliverable === void 0) throw new ValidationError("supervisorAgent: repromptOnUnmet needs a `deliverable` completion check — with no check there is no contract that can be unmet, and every run would re-prompt");
1562
1565
  if (harness === null) {
1563
1566
  assertRouterArmResourcePolicy(stableProfile);
1564
1567
  const brain = testBrain ?? routerBrainFromProfile(stableProfile, stableRouter);
@@ -1748,7 +1751,7 @@ function buildSupervisorAgent(profile, deps, testBrain) {
1748
1751
  budget: () => scope.budget,
1749
1752
  signal: scope.signal,
1750
1753
  ...deps.driverRetry ? { policy: deps.driverRetry } : {},
1751
- ...maxReprompts > 0 ? { reprompt: {
1754
+ ...repromptEnabled ? { reprompt: {
1752
1755
  maxReprompts,
1753
1756
  ...deps.deliverable?.describe === void 0 ? {} : { describe: deps.deliverable.describe },
1754
1757
  onUnmetContract: async (context) => {
@@ -2002,6 +2005,7 @@ function retryPreSpawnRefusals(inner, policy, hooks = {}) {
2002
2005
  ...inner.progress ? { progress: () => inner.progress?.() } : {},
2003
2006
  ...inner.traceSource ? { traceSource: () => inner.traceSource?.() } : {},
2004
2007
  ...inner.metered ? { metered: () => inner.metered?.() } : {},
2008
+ ...inner.harnessTranscript ? { harnessTranscript: () => inner.harnessTranscript?.() } : {},
2005
2009
  ...inner.interactive === void 0 ? {} : { interactive: () => interactiveOf(inner) },
2006
2010
  execute(task, signal) {
2007
2011
  const first = inner.execute(task, signal);
@@ -2805,8 +2809,7 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
2805
2809
  telemetry: "unknown-after-failure"
2806
2810
  });
2807
2811
  } catch (error) {
2808
- const budget = scope.budget;
2809
- if (budget.tokensKnown !== false || budget.usdCapped && budget.usdKnown !== false) failure = error;
2812
+ failure = new RuntimeRunStateError(`${errMessage(failure)}; accounting failed: ${errMessage(error)}`, { cause: failure });
2810
2813
  }
2811
2814
  try {
2812
2815
  if (!retainedOwner?.preserveEnvironment || retainedOwner.admissions.length === 0) await teardownOnce(completed ? DEFAULT_SUCCESSFUL_SHUTDOWN_MS : "brutalKill");
@@ -3671,4 +3674,4 @@ function rootProviderModelEvidenceFromExecution(evidence) {
3671
3674
  //#endregion
3672
3675
  export { createSupervisorSpanRecorder as _, isPreSpawnExecutorFailure as a, mapExecutorResult as b, withWorkerSpawnRetry as c, resolveSupervisorProfile as d, supervisorAgent as f, readRootStreamReceipt as g, readRootStream as h, workerFromBackend as i, assertCoordinationBinding as l, ROOT_STREAM_FILE as m, supervise as n, resolveWorkerSpawnRetry as o, supervisorAgentWithTestBrain as p, superviseWithTestBrain as r, retryPreSpawnRefusals as s, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, coordinationProfileToolPrefix as u, serveCoordinationMcp as v, gateOnDeliverable as y };
3673
3676
 
3674
- //# sourceMappingURL=supervise-Cl_-IsVc.js.map
3677
+ //# sourceMappingURL=supervise-CAJWyXQ-.js.map