@tangle-network/agent-runtime 2.3.0 → 2.3.3

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-BpkpEn0T.d.ts → activation-BAUOO9T-.d.ts} +2 -2
  2. package/dist/{activation-D9KoX_R4.js → activation-SA2R6STL.js} +2 -2
  3. package/dist/{activation-D9KoX_R4.js.map → activation-SA2R6STL.js.map} +1 -1
  4. package/dist/agent.d.ts +1 -1
  5. package/dist/agent.js +2 -2
  6. package/dist/{coordination-manager-CqZGCqjV.js → coordination-manager-BxnEJXsv.js} +2 -2
  7. package/dist/{coordination-manager-CqZGCqjV.js.map → coordination-manager-BxnEJXsv.js.map} +1 -1
  8. package/dist/{delegate-B5XFrkTg.js → delegate-Drwq3e6S.js} +2 -2
  9. package/dist/{delegate-B5XFrkTg.js.map → delegate-Drwq3e6S.js.map} +1 -1
  10. package/dist/durable.d.ts +1 -1
  11. package/dist/durable.js +3 -3
  12. package/dist/{graph-Ds6VUJzW.js → graph-Bio7TWRa.js} +4 -4
  13. package/dist/{graph-Ds6VUJzW.js.map → graph-Bio7TWRa.js.map} +1 -1
  14. package/dist/{improve-DbfENElN.js → improve-BaVcOScf.js} +5 -5
  15. package/dist/{improve-DbfENElN.js.map → improve-BaVcOScf.js.map} +1 -1
  16. package/dist/index.d.ts +3 -3
  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 +1 -1
  21. package/dist/kernel.js +9 -9
  22. package/dist/{loop-runner-CL_5TsT8.js → loop-runner-Dazsm0A5.js} +2 -2
  23. package/dist/{loop-runner-CL_5TsT8.js.map → loop-runner-Dazsm0A5.js.map} +1 -1
  24. package/dist/loop-runner-bin.d.ts +1 -1
  25. package/dist/loop-runner-bin.js +1 -1
  26. package/dist/{loop-runner-DjYZrgqT.d.ts → loop-runner-t4qfcieO.d.ts} +2 -2
  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/profiles.d.ts +1 -1
  31. package/dist/{provision-supervisor-Cmej51pt.js → provision-supervisor-DG4E0Viy.js} +3 -3
  32. package/dist/{provision-supervisor-Cmej51pt.js.map → provision-supervisor-DG4E0Viy.js.map} +1 -1
  33. package/dist/{runtime-Dm8QlK_z.js → runtime-7qnbJxS_.js} +9 -9
  34. package/dist/{runtime-Dm8QlK_z.js.map → runtime-7qnbJxS_.js.map} +1 -1
  35. package/dist/{search-executor-CN2Axxt9.js → search-executor-DRzb2WwZ.js} +2 -2
  36. package/dist/{search-executor-CN2Axxt9.js.map → search-executor-DRzb2WwZ.js.map} +1 -1
  37. package/dist/{server-DlKT7AgQ.js → server-BNsxRqPY.js} +3 -3
  38. package/dist/{server-DlKT7AgQ.js.map → server-BNsxRqPY.js.map} +1 -1
  39. package/dist/{structural-rollout-BPz5dLDB.js → structural-rollout-C49iL5Cn.js} +2 -2
  40. package/dist/{structural-rollout-BPz5dLDB.js.map → structural-rollout-C49iL5Cn.js.map} +1 -1
  41. package/dist/{supervise-BtjM7_0G.js → supervise-BwUx_gjv.js} +3 -3
  42. package/dist/{supervise-BtjM7_0G.js.map → supervise-BwUx_gjv.js.map} +1 -1
  43. package/dist/{supervisor-BsW69Ccw.js → supervisor-ByarsrwH.js} +25 -18
  44. package/dist/supervisor-ByarsrwH.js.map +1 -0
  45. package/dist/testing.d.ts +1 -1
  46. package/dist/testing.js +11 -11
  47. package/dist/{top-web-Bjb_UlNI.js → top-web-Dh1i-KLd.js} +56 -2
  48. package/dist/top-web-Dh1i-KLd.js.map +1 -0
  49. package/dist/tui/bin.js +1 -1
  50. package/dist/tui/index.d.ts +6 -1
  51. package/dist/tui/index.js +2 -2
  52. package/dist/{types-BDmLQLNj.d.ts → types-BGGZDz0I.d.ts} +6 -2
  53. package/package.json +1 -1
  54. package/dist/supervisor-BsW69Ccw.js.map +0 -1
  55. package/dist/top-web-Bjb_UlNI.js.map +0 -1
@@ -12597,12 +12597,12 @@ function journaledAdmissions(journalRoot, replayRunId, onAdmission) {
12597
12597
  }
12598
12598
  /**
12599
12599
  * The interactive handle with its accepted turns and its end journaled beside its admissions, so a
12600
- * viewer sees the run take turns and settle rather than run forever. A turn records its number and
12601
- * operation id, never the prompt. The end is the first exited status read or accepted stop.
12600
+ * viewer sees the run take turns and settle rather than run forever. A turn records its operation id,
12601
+ * never the prompt, so handles in different processes agree. The end is the first exited status
12602
+ * read or accepted stop.
12602
12603
  */
12603
12604
  function journaledInteractiveHandle(handle, journalRoot, runId) {
12604
12605
  if (journalRoot === void 0) return handle;
12605
- let turns = 0;
12606
12606
  let settled = false;
12607
12607
  const settle = async (failed, detail) => {
12608
12608
  if (settled) return;
@@ -12616,13 +12616,7 @@ function journaledInteractiveHandle(handle, journalRoot, runId) {
12616
12616
  ...handle,
12617
12617
  sendPrompt: async (command, options) => {
12618
12618
  const ack = await handle.sendPrompt(command, options);
12619
- if (ack.status === "accepted") {
12620
- turns += 1;
12621
- await appendRetainedObserverEvent(journalRoot, runId, `turn:${command.operationId}`, "agent.turn", "event", {
12622
- turn: turns,
12623
- operationId: command.operationId
12624
- });
12625
- }
12619
+ if (ack.status === "accepted") await appendRetainedObserverEvent(journalRoot, runId, `turn:${command.operationId}`, "agent.turn", "event", { operationId: command.operationId });
12626
12620
  return ack;
12627
12621
  },
12628
12622
  status: async (options) => {
@@ -15962,6 +15956,17 @@ async function observeRouterResponse(observer, receipt, signal) {
15962
15956
  if (onAbort) signal.removeEventListener("abort", onAbort);
15963
15957
  }
15964
15958
  }
15959
+ /**
15960
+ * A completed response whose observation failed: never a reason to infer again. Recognized by its
15961
+ * `context.phase`, not `instanceof SDKError`: a caller's transport throws the SDKError of its own
15962
+ * agent-core copy, and a second installed copy (discovery-lab pinned 1.0.0 beside Runtime's ^1.0.1)
15963
+ * made the check false, so a completed seat process re-ran up to `maxAttempts` times.
15964
+ */
15965
+ function isResponseObservationFailure(error) {
15966
+ if (typeof error !== "object" || error === null) return false;
15967
+ const context = error.context;
15968
+ return typeof context === "object" && context !== null && context.phase === "response_observation";
15969
+ }
15965
15970
  async function retryRouterOperation(retry, callerSignal, operation) {
15966
15971
  let attempts = 0;
15967
15972
  try {
@@ -15972,7 +15977,7 @@ async function retryRouterOperation(retry, callerSignal, operation) {
15972
15977
  try {
15973
15978
  return await operation(attemptSignal.signal);
15974
15979
  } catch (error) {
15975
- if (error instanceof SDKError && error.context?.phase === "response_observation") throw error;
15980
+ if (isResponseObservationFailure(error)) throw error;
15976
15981
  if (callerSignal?.aborted) throw callerSignal.reason ?? error;
15977
15982
  if (attemptSignal.signal.aborted) throw new SDKError(`router request timeout after ${retry.requestTimeoutMs}ms`, {
15978
15983
  code: "TIMEOUT",
@@ -24622,7 +24627,6 @@ async function startRetainedInteractiveRun(options) {
24622
24627
  assertStableText(startOptions.environment.idempotencyKey, "environment idempotency key");
24623
24628
  assertStableText(startOptions.interactiveIdempotencyKey, "interactive idempotency key");
24624
24629
  if (typeof startOptions.onAdmission !== "function") throw new Error("startRetainedInteractiveRun requires an awaited onAdmission durability hook");
24625
- const onAdmission = journaledAdmissions(startOptions.journalRoot, startOptions.intent?.runId, startOptions.onAdmission);
24626
24630
  if (!startOptions.provider.get) throw new Error(`provider "${startOptions.provider.name}" cannot reconstruct an environment by id`);
24627
24631
  const profile = agentProfileSchema.parse(startOptions.environment.profile);
24628
24632
  if (profile.harness === void 0) throw new Error("retained interactive runs require AgentProfile.harness");
@@ -24633,6 +24637,7 @@ async function startRetainedInteractiveRun(options) {
24633
24637
  };
24634
24638
  assertStableText(identity.sessionId, "retained session id");
24635
24639
  assertStableText(identity.executionId, "retained execution id");
24640
+ const onAdmission = journaledAdmissions(startOptions.journalRoot, identity.sessionId, startOptions.onAdmission);
24636
24641
  const intent = interactiveIntent(startOptions, profile, identity);
24637
24642
  if (startOptions.intent === void 0) await admitDurably(onAdmission, intent);
24638
24643
  else assertExactInteractiveIntent(startOptions.intent, intent, () => interactiveIntent(startOptions, profile, identity, legacyRetainedCreateMaterial));
@@ -24670,7 +24675,7 @@ async function startRetainedInteractiveRun(options) {
24670
24675
  interactiveIdempotencyKey: startOptions.interactiveIdempotencyKey,
24671
24676
  ref
24672
24677
  });
24673
- return journaledInteractiveHandle(createRetainedInteractiveRunHandle(environment, ref, capabilities, request), startOptions.journalRoot, intent.runId);
24678
+ return journaledInteractiveHandle(createRetainedInteractiveRunHandle(environment, ref, capabilities, request), startOptions.journalRoot, identity.sessionId);
24674
24679
  }
24675
24680
  /**
24676
24681
  * Retry one exact start after its provider response may have been lost.
@@ -24691,20 +24696,22 @@ async function recoverRetainedInteractiveRun(options) {
24691
24696
  ...options.replay,
24692
24697
  intent: admission,
24693
24698
  onAdmission: options.onAdmission,
24694
- signal: options.signal
24699
+ signal: options.signal,
24700
+ ...options.journalRoot === void 0 ? {} : { journalRoot: options.journalRoot }
24695
24701
  });
24696
24702
  }
24697
24703
  const request = exactRecoveryRequest(admission);
24698
24704
  const { environment, capabilities } = await reconstructEnvironment(options.provider, admission.environmentId, options.signal);
24699
24705
  if (!environment || !capabilities) return null;
24700
24706
  const ref = exactStartedRef(request, await awaitAbortable$1(Promise.resolve().then(() => environment.startInteractive(request, { signal: options.signal })), options.signal));
24701
- await admitDurably(options.onAdmission, {
24707
+ const sessionId = request.run.sessionId;
24708
+ await admitDurably(journaledAdmissions(options.journalRoot, sessionId, options.onAdmission), {
24702
24709
  phase: "interactive_started",
24703
24710
  idempotencyKey: admission.idempotencyKey,
24704
24711
  interactiveIdempotencyKey: admission.interactiveIdempotencyKey,
24705
24712
  ref
24706
24713
  });
24707
- return createRetainedInteractiveRunHandle(environment, ref, capabilities, request);
24714
+ return journaledInteractiveHandle(createRetainedInteractiveRunHandle(environment, ref, capabilities, request), options.journalRoot, sessionId);
24708
24715
  }
24709
24716
  function exactRecoveryRequest(admission) {
24710
24717
  assertStableText(admission.environmentId, "interactive environment id");
@@ -24734,7 +24741,7 @@ async function reconnectRetainedInteractiveRun(options) {
24734
24741
  if (ref.run.provider !== options.provider.name) throw new Error("interactive session reference belongs to another provider");
24735
24742
  const { environment, capabilities } = await reconstructEnvironment(options.provider, ref.run.environmentId, options.signal);
24736
24743
  if (!environment || !capabilities) return null;
24737
- const handle = createRetainedInteractiveRunHandle(environment, ref, capabilities);
24744
+ const handle = journaledInteractiveHandle(createRetainedInteractiveRunHandle(environment, ref, capabilities), options.journalRoot, ref.run.sessionId);
24738
24745
  await handle.status({ signal: options.signal });
24739
24746
  return handle;
24740
24747
  }
@@ -29694,4 +29701,4 @@ async function noWinner(settled, rejection) {
29694
29701
  }
29695
29702
  export { abandonScopeRetainedOwnerInvocation as $, gateFactoryOnDeliverable as $n, providerAttemptEvidence as $r, persistHarnessTranscript as $t, noteScopeOwnerPlannedExecution as A, isPeerMailEnvelope as An, terminateProcessTreeAndConfirm as Ar, TERMINAL_DECISIONS as At, deriveNodeExecutionIdentity as B, HarnessTurnFailedError as Bn, sandboxActProfileMaterialization as Br, resolveAgentEnvironmentProvider as Bt, interactiveAdmissionSeamKey as C, createInbox as Cn, bridgeRuntimeAttachmentsKey as Cr, createSteerableSandboxSession as Ct, recoverRetainedInteractiveRun as D, PEER_MAIL_WIRE_KEY as Dn, runWorktreeHarness as Dr, createSandboxForSpec as Dt, reconnectRetainedInteractiveRun as E, DEFAULT_PEER_MAIL_LIMITS as En, runSettledCommand as Er, readPromptOptions as Et, coordinationProfileToolPrefix as F, createActivityLog as Fn, fullProfileMaterialization as Fr, runCodeMode as Ft, meterRuntimeOwnedProviderAttempt as G, undispatchedCredentialExit as Gn, attestRuntimeOwnedScopeOwner as Gr, recoverRetainedRun as Gt, queueOf as H, causedByPartialFailure as Hn, unsupportedProfileDimensions as Hr, LEAF_CONTINUATION_TASK as Ht, providerVisibleProfile as I, readWorkerProgress as In, profileMaterializationAxes$1 as Ir, toolResultText as It, recordScopeOwnerPause as J, SeatChainExhaustedError as Jn, finalizeRuntimeOwnedPendingExecutor as Jr, retainedCreateMaterial as Jt, recordScopeOwnerBarrenPause as K, upstreamUnavailableSignal as Kn, authoredAgentIdentity as Kr, startRetainedRun as Kt, runtimeGraphMetadataKey as L, isLiveNodeStatus as Ln, promptControlProfileMaterialization as Lr, createRouterTranscript as Lt, restoreScopeOwnerAcceptedExecution as M, peerMailVerbNames as Mn, assertProfileMaterializes as Mr, codeModeArguments as Mt, scopeOwnerExecutorNodeContext as N, taskToPrompt$1 as Nn, controlProfileMaterialization as Nr, codeModeModelOutput as Nt, startRetainedInteractiveRun as O, claimsAuthority as On, LOCAL_HARNESSES as Or, createSandboxLineage as Ot, coordinationMcpAlias as P, DEFAULT_STALL_AFTER_MS as Pn, defineProfileMaterializationContract as Pr, createCodeModeTools as Pt, resolveSpawnResourcePaths as Q, CheckUnavailableError as Qn, newExecutionAttemptId as Qr, harnessTranscriptArtifact as Qt, settledToIteration as R, isTerminalNodeStatus as Rn, promptModelProfileMaterialization as Rr, routerBrain as Rt, workerTraceAnalysisStore as S, INBOX_RECEIPT_KEY as Sn, signalAbortError as Sr, DEFAULT_SANDBOX_STEERING_MAX_TURNS as St, readWorkerInteractiveBinding as T, AUTHORITY_MARKERS as Tn, defaultRunCommand as Tr, assertBoxlessPromptOptions as Tt, rollingDispatch as U, classifyDriverFailure as Un, worktreeCliProfileMaterialization as Ur, providerAsSandboxClient as Ut, freeSlots as V, abandonablePending as Vn, sandboxProfileMaterialization as Vr, providerAsExecutor as Vt, meterRuntimeOwnedAccounting as W, summarizeDriverAttempts as Wn, attestRuntimeOwnedPendingExecutor as Wr, reconnectRetainedRun as Wt, scopeRetainedOwnerResourceReader as X, seatExecutionProfile as Xn, knownExecutionBindingReceipt as Xr, environmentGone as Xt, prepareScopeRetainedOwnerSeatSwitch as Y, authoredSeatStages as Yn, inheritRuntimeOwnedExecutorAttestation as Yr, destroyInteractiveEnvironment as Yt, environmentReader as Z, subscriptionUsageLimitSignal as Zn, knownMaterializationReceipt as Zr, captureHarnessTranscript as Zt, withDriverExecutor as _, promptFromAgentTurnInput as _i, loopEventToOtelSpan as _n, readCodexRolloutSession as _r, createExecutorRegistry as _t, assertRunParking as a, runtimeOwnedPendingExecutorMaterialization as ai, createWorktreeCliExecutor as an, bestComposite as ar, scopeRetainedOwnerTurnEnded as at, isTraceAnalysisStore as b, sanitizeKnowledgeReadinessReport as bn, linkAbort as br, createExecutor as bt, sleepScopeWait as c, unknownMaterializationReceipt as ci, createPropagatingTraceEmitter as cn, failedItems as cr, noteScopeRetainedOwnerCoordination as ct, runFinalizer as d, isRuntimeFlowBrain as di, buildLoopSpanNodes as dn, bridgeModelRouteRefusal as dr, scopeRetainedOwnerContext as dt, recordRuntimeOwnedDriveHarnessProviderEvidence as ei, readHarnessTranscript as en, gateOnDeliverable as er, consumeScopeRetainedOwnerResult as et, runTree as f, runtimeFlowAgent as fi, buildRuntimeEventOtelSpans as fn, priceTokens as fr, scopeRetainedOwnerJournalRoot as ft, isDriverSpec as g, awaitAbortable$1 as gi, generateSpanId as gn, harnessUsageIsEmpty as gr, InMemorySpawnJournal as gt, driverExecutorFactory as h, readSandboxOutcome as hi, flatOtelSpan as hn, createCodexRolloutStoreReader as hr, InMemoryResultBlobStore as ht, RunParkedError as i, runtimeOwnedExecutorProviderEvidence as ii, openSlotGroup as in, admitContinuationPolicy as ir, beginScopeRetainedOwnerDrive as it, recordScopeOwnerMaterialization as j, peerMailTools as jn, assertProfileMaterialization as jr, defaultSelectWinner as jt, beginScopeOwnerAttempt as k, createPeerMailbox as kn, harnessInvocation as kr, acquireSandbox as kt, withRunParking as l, executableAgentProfileSnapshot as li, readTraceContextFromEnv as ln, isFiniteNumber as lr, bindScopeRetainedOwnerEnvironmentId as lt, driverChild as m, projectSandboxOutcome as mi, createOtelExporter as mn, addHarnessUsage as mr, materializeTreeView as mt, createSupervisor as n, runtimeOwnedExecutorExecutionBinding as ni, retainHarnessTranscript as nn, verdictFromJudgeScore as nr, scopeRetainedOwnerPriorSpend as nt, bindScopeParkingDrain as o, runtimeOwnedScopeOwnerRuntime as oi, createInPlaceCliExecutor as on, checkVerdictOf as or, reconcileScopeRetainedOwnerEnvironment as ot, createRootHandle as p, runtimeFlowBrain as pi, createOpenInferenceFileExporter as pn, ROUTER_PRICE_SOURCE as pr, loadSpawnForest as pt, recordScopeOwnerDriverAttempt as q, SeatChain as qn, authoredProfileDigest as qr, startRetainedRunInEnvironment as qt, assertResumeLimits as r, runtimeOwnedExecutorMaterialization as ri, createWorkerSlots as rn, CONTINUATIONS_DIR as rr, scopeRetainedOwnerResult as rt, readRunParking as s, unknownExecutionBindingReceipt as si, WORKER_TRACE_PROPAGATION as sn, createContinuationKeeper as sr, scopeRetainedOwnerRestorePoint as st, DEFAULT_MAX_DEPTH as t, runtimeOwnedDriveHarnessProviderEvidence as ti, resolveHarnessTranscriptCapture as tn, mapExecutorResult as tr, prepareScopeRetainedOwnerTask as tt, bestDelivered as u, executableAgentSpecSnapshot as ui, buildLoopOtelSpans as un, bridgeAdmissionRefusal as ur, bindScopeRetainedOwnerProvider as ut, createScope as v, promptOptionsFromAgentTurnInput as vi, createRuntimeEventCollector as vn, createPushTraceSource as vr, bindReusableExecutorExecutionId as vt, attachWorker as w, failPendingAfter as wn, bridgeStopSignalKey as wr, runAgentRounds as wt, parseWorkerToolTraceArtifact as x, sanitizeRuntimeStreamEvent as xn, runAbortable as xr, snapshotExecutorConfig as xt, replaySpawnTree as y, providerMessageText as yi, createRuntimeStreamEventCollector as yn, RunCancellationReason as yr, captureReusableExecutorConfig as yt, assertRecursiveReservationPolicy as z, DriverAttemptsExhaustedError as zn, renderUnsupported as zr, createAgentEnvironmentProviderRegistry as zt };
29696
29703
 
29697
- //# sourceMappingURL=supervisor-BsW69Ccw.js.map
29704
+ //# sourceMappingURL=supervisor-ByarsrwH.js.map