@tangle-network/agent-runtime 0.335.0 → 0.336.1

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 (53) hide show
  1. package/dist/{activation-DZbEj4oG.d.ts → activation-D3h2jg6U.d.ts} +2 -2
  2. package/dist/{activation-BT3VoIpg.js → activation-WRMocDPp.js} +2 -2
  3. package/dist/{activation-BT3VoIpg.js.map → activation-WRMocDPp.js.map} +1 -1
  4. package/dist/agent.d.ts +1 -1
  5. package/dist/agent.js +2 -2
  6. package/dist/{coordination-driver-rNoFHYmZ.js → coordination-driver-DIxyUXKr.js} +2 -2
  7. package/dist/{coordination-driver-rNoFHYmZ.js.map → coordination-driver-DIxyUXKr.js.map} +1 -1
  8. package/dist/{delegate-BdwThtY9.js → delegate-DZ_EV8BU.js} +2 -2
  9. package/dist/{delegate-BdwThtY9.js.map → delegate-DZ_EV8BU.js.map} +1 -1
  10. package/dist/durable.d.ts +1 -1
  11. package/dist/durable.js +3 -3
  12. package/dist/{graph-Bph_DX-z.js → graph-DOIziP_V.js} +4 -4
  13. package/dist/{graph-Bph_DX-z.js.map → graph-DOIziP_V.js.map} +1 -1
  14. package/dist/{improvement-cycle-Coj69usO.js → improvement-cycle-DRiKtfty.js} +3 -3
  15. package/dist/{improvement-cycle-Coj69usO.js.map → improvement-cycle-DRiKtfty.js.map} +1 -1
  16. package/dist/index.d.ts +4 -4
  17. package/dist/index.js +7 -7
  18. package/dist/intelligence.d.ts +2 -2
  19. package/dist/intelligence.js +3 -3
  20. package/dist/kernel.d.ts +2 -2
  21. package/dist/kernel.js +8 -8
  22. package/dist/{loop-runner-bin-9MtarSBu.js → loop-runner-bin-DCCieRnZ.js} +3 -3
  23. package/dist/{loop-runner-bin-9MtarSBu.js.map → loop-runner-bin-DCCieRnZ.js.map} +1 -1
  24. package/dist/{loop-runner-bin-BTC2czoj.d.ts → loop-runner-bin-DXMrEOWf.d.ts} +2 -2
  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 +21 -4
  28. package/dist/mcp/bin.js.map +1 -1
  29. package/dist/mcp/index.d.ts +2 -2
  30. package/dist/mcp/index.js +4 -4
  31. package/dist/{openai-tools-DWuf9K9X.d.ts → openai-tools-mpuNXxBB.d.ts} +2 -2
  32. package/dist/profiles.d.ts +1 -1
  33. package/dist/{provision-supervisor-Ced9EeHy.js → provision-supervisor-BGXehCW5.js} +3 -3
  34. package/dist/{provision-supervisor-Ced9EeHy.js.map → provision-supervisor-BGXehCW5.js.map} +1 -1
  35. package/dist/{runtime-DMVBv34m.js → runtime-B-qPSZyM.js} +74 -11
  36. package/dist/runtime-B-qPSZyM.js.map +1 -0
  37. package/dist/{search-executor-BNTeMygV.js → search-executor-B6X1doWD.js} +2 -2
  38. package/dist/{search-executor-BNTeMygV.js.map → search-executor-B6X1doWD.js.map} +1 -1
  39. package/dist/{server-z7xI_ItY.js → server-BwdkANs5.js} +3 -3
  40. package/dist/{server-z7xI_ItY.js.map → server-BwdkANs5.js.map} +1 -1
  41. package/dist/{supervise-ISaRiWVe.js → supervise-N4Wilrg1.js} +31 -6
  42. package/dist/supervise-N4Wilrg1.js.map +1 -0
  43. package/dist/{supervisor-B-bkXttM.js → supervisor-CLi80MYC.js} +51 -7
  44. package/dist/supervisor-CLi80MYC.js.map +1 -0
  45. package/dist/testing.d.ts +1 -1
  46. package/dist/testing.js +12 -12
  47. package/dist/tui/index.d.ts +1 -1
  48. package/dist/tui/index.js +1 -1
  49. package/dist/{types-BO8kh52C.d.ts → types-C9qQxCd9.d.ts} +47 -3
  50. package/package.json +1 -1
  51. package/dist/runtime-DMVBv34m.js.map +0 -1
  52. package/dist/supervise-ISaRiWVe.js.map +0 -1
  53. package/dist/supervisor-B-bkXttM.js.map +0 -1
@@ -1,11 +1,11 @@
1
1
  import { n as assertNoSymlinkDescendant } from "./durable-file-B_eJr6Mb.js";
2
- import { A as bindScopeRetainedOwnerEnvironmentId, At as createInbox, B as scopeRetainedOwnerResourceReader, C as recordScopeOwnerMaterialization, Ca as newUsageTotals, Ci as runtimeOwnedPendingExecutorMaterialization, E as scopeOwnerExecutorNodeContext, F as prepareScopeRetainedOwnerTask, Fi as registerRetainedExecutorPreparation, Gr as assertProfileMaterialization, Gt as summarizeDriverAttempts, H as scopeRetainedOwnerResult, Ht as HarnessTurnFailedError, I as reconcileScopeRetainedOwnerEnvironment, Ii as retainedExecutorSeamKey, It as isPeerMailEnvelope, J as coordinationMcpAlias, Jr as defineProfileMaterializationContract, Jt as SeatChainExhaustedError, L as scopeRetainedOwnerContext, M as consumeScopeRetainedOwnerResult, N as noteScopeRetainedOwnerCoordination, Nt as PEER_MAIL_WIRE_KEY, O as abandonScopeRetainedOwnerInvocation, On as routerBrain, Ot as createActivityLog, P as prepareScopeRetainedOwnerSeatSwitch, Pn as resolveAgentEnvironmentProvider, Qn as runAbortable, Qr as promptModelProfileMaterialization, Qt as CONTINUATIONS_DIR, R as scopeRetainedOwnerJournalRoot, Rn as bridgeRuntimeAttachmentsKey, S as recordScopeOwnerDriverAttempt, Sa as meterUsageEvent, Si as runtimeOwnedExecutorProviderEvidence, T as restoreScopeOwnerAcceptedExecution, Ta as spendFromUsageTotals, Tr as toOtelAttributes, U as scopeRetainedOwnerTurnEnded, V as scopeRetainedOwnerRestorePoint, Wt as runDriverWithRetry, X as providerVisibleProfile, Xr as profileMaterializationAxes$1, Xt as seatExecutionProfile, Y as coordinationProfileToolPrefix, Yn as RunCancellationReason, Yr as fullProfileMaterialization, Yt as authoredSeatStages, Z as runtimeGraphMetadataKey, Zn as linkAbort, Zr as promptControlProfileMaterialization, _a as errMessage, _i as providerAttemptEvidence, ai as unsupportedProfileDimensions, an as createContinuationKeeper, b as meterRuntimeOwnedProviderAttempt, ba as assertValidBudget, bi as runtimeOwnedExecutorExecutionBinding, c as runTree, d as isDriverSpec, da as parseWorkerToolTraceArtifact, dn as bridgeAdmissionRefusal, en as CheckUnavailableError, fn as bridgeModelRouteRefusal, g as beginScopeOwnerAttempt, ga as executorFailure, h as assertRecursiveReservationPolicy, ha as detachedSnapshot, ht as snapshotExecutorConfig, i as bestDelivered, ii as sandboxProfileMaterialization, in as checkVerdictOf, j as bindScopeRetainedOwnerProvider, k as beginScopeRetainedOwnerDrive, l as driverChild, li as attestRuntimeOwnedScopeOwner, lt as bindReusableExecutorExecutionId, n as createRootHandle, ni as renderUnsupported, nr as readHarnessTranscript, pa as contentAddress, pi as inheritRuntimeOwnedExecutorAttestation, pt as createExecutor, qr as controlProfileMaterialization, qt as SeatChain, r as createSupervisor, rn as bestComposite, s as runFinalizer, si as worktreeCliProfileMaterialization, st as gateOnDeliverable, tn as admitContinuationPolicy, tr as persistHarnessTranscript, u as driverExecutorFactory, ui as authoredAgentIdentity, ut as captureReusableExecutorConfig, v as deriveNodeExecutionIdentity, vi as recordRuntimeOwnedDriveHarnessProviderEvidence, w as recordScopeOwnerPause, wi as runtimeOwnedScopeOwnerRuntime, x as noteScopeOwnerPlannedExecution, xi as runtimeOwnedExecutorMaterialization, xr as generateSpanId, xt as WORKER_TRACE_PROPAGATION, y as meterRuntimeOwnedAccounting, yi as runtimeOwnedDriveHarnessProviderEvidence, yr as createOtelExporter, yt as createRouterTranscript, z as scopeRetainedOwnerPriorSpend, zn as bridgeStopSignalKey, zt as isLiveNodeStatus } from "./supervisor-B-bkXttM.js";
2
+ import { A as bindScopeRetainedOwnerEnvironmentId, At as createInbox, B as scopeRetainedOwnerResourceReader, C as recordScopeOwnerMaterialization, Ca as newUsageTotals, Ci as runtimeOwnedPendingExecutorMaterialization, E as scopeOwnerExecutorNodeContext, F as prepareScopeRetainedOwnerTask, Fi as registerRetainedExecutorPreparation, Gr as assertProfileMaterialization, Gt as summarizeDriverAttempts, H as scopeRetainedOwnerResult, Ht as HarnessTurnFailedError, I as reconcileScopeRetainedOwnerEnvironment, Ii as retainedExecutorSeamKey, It as isPeerMailEnvelope, J as coordinationMcpAlias, Jr as defineProfileMaterializationContract, Jt as SeatChainExhaustedError, L as scopeRetainedOwnerContext, M as consumeScopeRetainedOwnerResult, N as noteScopeRetainedOwnerCoordination, Nt as PEER_MAIL_WIRE_KEY, O as abandonScopeRetainedOwnerInvocation, On as routerBrain, Ot as createActivityLog, P as prepareScopeRetainedOwnerSeatSwitch, Pn as resolveAgentEnvironmentProvider, Qn as runAbortable, Qr as promptModelProfileMaterialization, Qt as CONTINUATIONS_DIR, R as scopeRetainedOwnerJournalRoot, Rn as bridgeRuntimeAttachmentsKey, S as recordScopeOwnerDriverAttempt, Sa as meterUsageEvent, Si as runtimeOwnedExecutorProviderEvidence, T as restoreScopeOwnerAcceptedExecution, Ta as spendFromUsageTotals, Tr as toOtelAttributes, U as scopeRetainedOwnerTurnEnded, V as scopeRetainedOwnerRestorePoint, Wt as runDriverWithRetry, X as providerVisibleProfile, Xr as profileMaterializationAxes$1, Xt as seatExecutionProfile, Y as coordinationProfileToolPrefix, Yn as RunCancellationReason, Yr as fullProfileMaterialization, Yt as authoredSeatStages, Z as runtimeGraphMetadataKey, Zn as linkAbort, Zr as promptControlProfileMaterialization, _a as errMessage, _i as providerAttemptEvidence, ai as unsupportedProfileDimensions, an as createContinuationKeeper, b as meterRuntimeOwnedProviderAttempt, ba as assertValidBudget, bi as runtimeOwnedExecutorExecutionBinding, c as runTree, d as isDriverSpec, da as parseWorkerToolTraceArtifact, dn as bridgeAdmissionRefusal, en as CheckUnavailableError, fn as bridgeModelRouteRefusal, g as beginScopeOwnerAttempt, ga as executorFailure, h as assertRecursiveReservationPolicy, ha as detachedSnapshot, ht as snapshotExecutorConfig, i as bestDelivered, ii as sandboxProfileMaterialization, in as checkVerdictOf, j as bindScopeRetainedOwnerProvider, k as beginScopeRetainedOwnerDrive, l as driverChild, li as attestRuntimeOwnedScopeOwner, lt as bindReusableExecutorExecutionId, n as createRootHandle, ni as renderUnsupported, nr as readHarnessTranscript, pa as contentAddress, pi as inheritRuntimeOwnedExecutorAttestation, pt as createExecutor, qr as controlProfileMaterialization, qt as SeatChain, r as createSupervisor, rn as bestComposite, s as runFinalizer, si as worktreeCliProfileMaterialization, st as gateOnDeliverable, tn as admitContinuationPolicy, tr as persistHarnessTranscript, u as driverExecutorFactory, ui as authoredAgentIdentity, ut as captureReusableExecutorConfig, v as deriveNodeExecutionIdentity, vi as recordRuntimeOwnedDriveHarnessProviderEvidence, w as recordScopeOwnerPause, wi as runtimeOwnedScopeOwnerRuntime, x as noteScopeOwnerPlannedExecution, xi as runtimeOwnedExecutorMaterialization, xr as generateSpanId, xt as WORKER_TRACE_PROPAGATION, y as meterRuntimeOwnedAccounting, yi as runtimeOwnedDriveHarnessProviderEvidence, yr as createOtelExporter, yt as createRouterTranscript, z as scopeRetainedOwnerPriorSpend, zn as bridgeStopSignalKey, zt as isLiveNodeStatus } from "./supervisor-CLi80MYC.js";
3
3
  import { f as RuntimeRunStateError, i as ConfigError, m as ValidationError } from "./errors-DodWX-cb.js";
4
4
  import { $ as isAsyncIterable$1, Ot as teardownExecutor, U as addSpend, Y as errorMessage, at as sleep, dt as zeroSpend, gt as withBudgetResources, ht as resourceTelemetry, kt as teardownSurfaces, lt as unmeteredSpend, pt as addResourceSpend, ut as withTimeout, xt as DEFAULT_SUCCESSFUL_SHUTDOWN_MS } from "./sandbox-profile-compat-D_ZOL80S.js";
5
5
  import { a as readCommittedJsonLines, n as isNoEntError, r as prepareJsonlAppend } from "./jsonl-file-DBv31uPi.js";
6
6
  import { _ as agentHarness, a as concreteProfileModel, c as profileModelExecutionSettings, l as profileProviderModel, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile, v as harnessRunsAgent } from "./model-policy-CyCUwHed.js";
7
7
  import { t as composeRuntimeHooks } from "./runtime-hooks-tXpAarhW.js";
8
- import { C as createFileRunContext, F as createCoordinationToolsForManager, N as coordinationVerbNames, O as applyRunCancellation, T as withRunContext, c as refreshedWake, g as progressStop, h as plateau, k as watchRunCancellation, l as resolveWakePolicy, n as createSteerAcknowledger, o as composeWakeInput, p as createProgressTracker, r as driverAgent, s as deadlineWarningAt, t as createCancelAcknowledger, w as createInMemoryRunContext } from "./coordination-driver-rNoFHYmZ.js";
8
+ import { C as createFileRunContext, F as createCoordinationToolsForManager, N as coordinationVerbNames, O as applyRunCancellation, T as withRunContext, c as refreshedWake, g as progressStop, h as plateau, k as watchRunCancellation, l as resolveWakePolicy, n as createSteerAcknowledger, o as composeWakeInput, p as createProgressTracker, r as driverAgent, s as deadlineWarningAt, t as createCancelAcknowledger, w as createInMemoryRunContext } from "./coordination-driver-DIxyUXKr.js";
9
9
  import { r as createStdioToolServer, t as PROTOCOL_VERSION } from "./tool-server-Dqer2M4_.js";
10
10
  import { c as loadGraph, i as graphRegistry } from "./graph-registry-DAI6KNXB.js";
11
11
  import { k as writeRunCancellation, o as readRunCancelRequest, s as readRunCancellation } from "./run-layout-Cu8H7aeh.js";
@@ -2114,8 +2114,19 @@ function composeReentryTask(input) {
2114
2114
  function whyLine(reentry) {
2115
2115
  if (reentry.reason === "unmet-contract") return `Your previous turn ended with the completion check unmet (continuation ${reentry.continuation}).`;
2116
2116
  if (reentry.reason === "wake") return "Your previous turn ended while your workers ran, and Runtime woke you with what happened.";
2117
+ if (reentry.reason === "run-reentered") return restartLine(reentry);
2117
2118
  return reentry.reason === "upstream-unavailable" ? "Your previous turn was interrupted before it finished; the run itself is intact." : `Your previous turn ended before it finished (retry ${reentry.retry}); the run itself is intact.`;
2118
2119
  }
2120
+ function restartLine(reentry) {
2121
+ const replaced = new Set(reentry.replaced);
2122
+ const gone = reentry.live.filter((id) => !replaced.has(id));
2123
+ return [
2124
+ "The process supervising this run stopped before the run ended, and a new process took it over; the run itself is intact.",
2125
+ reentry.live.length === 0 ? "None of your workers was running when it stopped." : `Workers that were running when it stopped: ${reentry.live.join(", ")}.`,
2126
+ ...reentry.replaced.length === 0 ? [] : [`Running again: ${reentry.replaced.join(", ")}.`],
2127
+ ...gone.length === 0 ? [] : [`Gone, and they will not report: ${gone.join(", ")}. Their unfinished work is lost; spawn a replacement for any you still need.`]
2128
+ ].join(" ");
2129
+ }
2119
2130
  function environmentLine(continuity) {
2120
2131
  if (continuity.environment === "same") return `You run in the same environment as before${continuity.environmentId === void 0 ? "" : ` (${continuity.environmentId})`}, and your files are where you left them.`;
2121
2132
  if (continuity.environment === "replaced") return `Your previous environment${continuity.previousEnvironmentId === void 0 ? "" : ` (${continuity.previousEnvironmentId})`} is gone, and you run in a new one. ` + (continuity.workspace === "kept" ? "Its files were carried over." : continuity.workspace === "restored" ? `Its files were restored from a checkpoint taken at ${continuity.checkpointAt ?? "your last coordination call"}; anything you wrote after that is not here. The coordinator and the knowledge store kept everything below.` : "Files you wrote there are not here. The coordinator and the knowledge store kept everything below.");
@@ -3071,9 +3082,19 @@ function buildSupervisorAgent(profile, deps, testBrain) {
3071
3082
  continuations: keeper?.entries() ?? []
3072
3083
  });
3073
3084
  };
3085
+ let modelEvents = 0;
3086
+ const reenteredWorkers = scope.resume?.reentered;
3087
+ const reentered = reenteredWorkers === void 0 ? void 0 : {
3088
+ first: {
3089
+ reason: "run-reentered",
3090
+ ...reenteredWorkers
3091
+ },
3092
+ modelEvents: () => modelEvents
3093
+ };
3074
3094
  let driverFailed = true;
3075
3095
  try {
3076
3096
  await runDriverWithRetry({
3097
+ ...reentered === void 0 ? {} : { reentered },
3077
3098
  drive: async (attempt, reentry) => {
3078
3099
  candidate = void 0;
3079
3100
  if (deps.controlDir !== void 0 && deps.abortRun !== void 0) applyRunCancellation(deps.controlDir, deps.abortRun, () => (/* @__PURE__ */ new Date()).toISOString());
@@ -3140,7 +3161,10 @@ function buildSupervisorAgent(profile, deps, testBrain) {
3140
3161
  coordinationMcpHeaders: mcp.headers,
3141
3162
  ...deps.peerMailUrl ? { peerMailUrl: deps.peerMailUrl } : {},
3142
3163
  stopSignal: stopController.signal,
3143
- coordinationTools
3164
+ coordinationTools,
3165
+ onModelEvent: () => {
3166
+ modelEvents += 1;
3167
+ }
3144
3168
  });
3145
3169
  completed = true;
3146
3170
  } catch (error) {
@@ -4135,7 +4159,7 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
4135
4159
  let seatChain;
4136
4160
  let activeSeat;
4137
4161
  let switchedProviderCheckpointAt;
4138
- const drive = async ({ profile, authoredProfile, registeredProfile, task, scope, coordinationMcpUrl, coordinationMcpHeaders, peerMailUrl, stopSignal, coordinationTools, reentry, session }) => {
4162
+ const drive = async ({ profile, authoredProfile, registeredProfile, task, scope, coordinationMcpUrl, coordinationMcpHeaders, peerMailUrl, stopSignal, coordinationTools, reentry, session, onModelEvent }) => {
4139
4163
  const priorCommittedArtifact = managerArtifact;
4140
4164
  managerArtifact = void 0;
4141
4165
  switchedProviderCheckpointAt = void 0;
@@ -4202,7 +4226,7 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
4202
4226
  }
4203
4227
  let driveTask = task;
4204
4228
  if (reentry !== void 0) {
4205
- const proven = switchedProviderCheckpointAt === void 0 ? await reentryContinuity(boundBackend, scope, retainedOwner !== void 0) : {
4229
+ const proven = reentry.reason.reason === "run-reentered" ? UNPROVEN_CONTINUITY : switchedProviderCheckpointAt === void 0 ? await reentryContinuity(boundBackend, scope, retainedOwner !== void 0) : {
4206
4230
  session: "new",
4207
4231
  environment: "replaced",
4208
4232
  workspace: "restored",
@@ -4503,6 +4527,7 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
4503
4527
  } else if (event.kind === "progress") {
4504
4528
  rootStream?.append(event.progress);
4505
4529
  noteDriveProgress(event.progress);
4530
+ onModelEvent?.();
4506
4531
  } else pendingUsage.push(event);
4507
4532
  await meterPending();
4508
4533
  const artifact = executor.resultArtifact();
@@ -6035,4 +6060,4 @@ function withModelSubstitution(agent, substitution) {
6035
6060
  //#endregion
6036
6061
  export { dumbContinuationPassPrompt as A, defaultEdgeTraversalCap as C, createPromptRegistry as D, analyzesFindingsReportPrompt as E, serveCoordinationMcp as F, kernelPromptRegistry as M, naiveContinuationPrompt as N, delegatesWorkerBriefPrompt as O, promptHandle as P, createGraphOverlay as S, validateGraphTopology as T, readRootStream as _, superviseRootProfile as a, composeReentryTask as b, isPreSpawnExecutorFailure as c, withWorkerSpawnRetry as d, assertCoordinationBinding as f, ROOT_STREAM_FILE as g, supervisorAgentWithTestBrain as h, superviseFleetCapabilities as i, formatPromptHandle as j, dumbContinuationFailPrompt as k, resolveWorkerSpawnRetry as l, supervisorAgent as m, profileGuidanceComposer as n, superviseWithTestBrain as o, resolveSupervisorProfile as p, supervise as r, workerFromBackend as s, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, retryPreSpawnRefusals as u, readRootStreamReceipt as v, graphRootProfile as w, createSupervisorSpanRecorder as x, UNPROVEN_CONTINUITY as y };
6037
6062
 
6038
- //# sourceMappingURL=supervise-ISaRiWVe.js.map
6063
+ //# sourceMappingURL=supervise-N4Wilrg1.js.map