effect-agent 0.1.0-beta.155 → 0.1.0-beta.157

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 (116) hide show
  1. package/dist/{Admin-BjmupLN3.d.mts → Admin-BbTZHSLu.d.mts} +23 -11
  2. package/dist/{Agent-1DMSO_Fl.mjs → Agent-BMATXYsI.mjs} +9 -2
  3. package/dist/Agent-BMATXYsI.mjs.map +1 -0
  4. package/dist/{AgentRuntime-BAjT5gXl.d.mts → AgentRuntime-BPlAn5nA.d.mts} +6 -6
  5. package/dist/{AgentRuntime-IF_1GoUf.mjs → AgentRuntime-GQACxY_m.mjs} +21 -5
  6. package/dist/AgentRuntime-GQACxY_m.mjs.map +1 -0
  7. package/dist/{Digest-CaJ2RIsF.d.mts → Digest-CNHImGy0.d.mts} +2 -2
  8. package/dist/{DurableAgentRuntime-BQzYkFVy.mjs → DurableAgentRuntime-BAQvZK1e.mjs} +30 -18
  9. package/dist/DurableAgentRuntime-BAQvZK1e.mjs.map +1 -0
  10. package/dist/{EventSource-C8CKwQy5.d.mts → EventSource-CETtQTiH.d.mts} +3 -3
  11. package/dist/InMemory.d.mts +1 -1
  12. package/dist/{PreparedInputAdmission-CU1PzUVD.d.mts → PreparedInputAdmission-Swp9t800.d.mts} +4 -4
  13. package/dist/{Records-BrEpibum.d.mts → Records-BxGWRs-t.d.mts} +2 -2
  14. package/dist/{RunEvent-DV_llBcq.d.mts → RunEvent-D0aepYwN.d.mts} +2 -2
  15. package/dist/{RunEventSink-D5aVhISG.d.mts → RunEventSink-DsbcGXog.d.mts} +2 -2
  16. package/dist/{RunOptions-CkRYnlJa.d.mts → RunOptions-GjDlAuKh.d.mts} +5 -2
  17. package/dist/{Schedule-B_z7PMg-.d.mts → Schedule-B94iS2X3.d.mts} +2 -2
  18. package/dist/{Subagent-Dld4W1BY.d.mts → Subagent-CLaMeZKu.d.mts} +6 -6
  19. package/dist/{Subagent-CmFtZaeI.mjs → Subagent-JjcidJ7q.mjs} +2 -2
  20. package/dist/{Subagent-CmFtZaeI.mjs.map → Subagent-JjcidJ7q.mjs.map} +1 -1
  21. package/dist/{Subscription-BomcQ9_W.d.mts → Subscription-DaMCppa_.d.mts} +4 -4
  22. package/dist/{SubscriptionInput-gpZSR9vB.d.mts → SubscriptionInput-B0ZtrQoY.d.mts} +3 -3
  23. package/dist/{ThreadHistory-ZEu_ja6L.d.mts → ThreadHistory-FD-o4TsR.d.mts} +2 -2
  24. package/dist/{Usage-Dx0aknfk.d.mts → Usage-BNjPR7Zr.d.mts} +9 -1
  25. package/dist/{WorkerAdmission-CNbm4o_x.mjs → WorkerAdmission-N9hZV85Q.mjs} +2 -2
  26. package/dist/{WorkerAdmission-CNbm4o_x.mjs.map → WorkerAdmission-N9hZV85Q.mjs.map} +1 -1
  27. package/dist/{agent-registration-U3kmV7nW.mjs → agent-registration-BIOzAej4.mjs} +10 -1
  28. package/dist/agent-registration-BIOzAej4.mjs.map +1 -0
  29. package/dist/capabilities/Commands.d.mts +1 -1
  30. package/dist/capabilities/Redaction.d.mts +1 -1
  31. package/dist/capabilities/RunHooks.d.mts +1 -1
  32. package/dist/capabilities/Subagent.d.mts +1 -1
  33. package/dist/capabilities/Subagent.mjs +1 -1
  34. package/dist/capabilities/ToolDiscovery.d.mts +5 -0
  35. package/dist/capabilities/ToolDiscovery.mjs +18 -9
  36. package/dist/capabilities/ToolDiscovery.mjs.map +1 -1
  37. package/dist/capabilities/WebSearch.d.mts +5 -1
  38. package/dist/capabilities/WebSearch.mjs +9 -1
  39. package/dist/capabilities/WebSearch.mjs.map +1 -1
  40. package/dist/core/Agent.mjs +1 -1
  41. package/dist/core/RunEvent.d.mts +1 -1
  42. package/dist/core/Usage.d.mts +1 -1
  43. package/dist/core/Usage.mjs +22 -1
  44. package/dist/core/Usage.mjs.map +1 -1
  45. package/dist/durable/ActivityStore.d.mts +1 -1
  46. package/dist/durable/Admin.d.mts +1 -1
  47. package/dist/durable/AgentRegistration.d.mts +1 -1
  48. package/dist/durable/AgentRegistration.mjs +1 -1
  49. package/dist/durable/Certification.d.mts +1 -1
  50. package/dist/durable/CommittedActivity.d.mts +3 -3
  51. package/dist/durable/Digest.d.mts +1 -1
  52. package/dist/durable/DurableAgentRuntime.d.mts +1 -1
  53. package/dist/durable/DurableAgentRuntime.mjs +2 -2
  54. package/dist/durable/EventSource.d.mts +1 -1
  55. package/dist/durable/GitHubWorkflowSource.d.mts +3 -3
  56. package/dist/durable/LifecyclePublication.d.mts +1 -1
  57. package/dist/durable/LifecyclePublication.mjs +2 -2
  58. package/dist/durable/LifecyclePublication.mjs.map +1 -1
  59. package/dist/durable/MessageDelivery.d.mts +4 -4
  60. package/dist/durable/MessageDeliveryStoreConformance.d.mts +3 -3
  61. package/dist/durable/PersistentHistory.d.mts +2 -2
  62. package/dist/durable/PreparedInputAdmission.d.mts +1 -1
  63. package/dist/durable/Records.d.mts +1 -1
  64. package/dist/durable/Recovery.d.mts +1 -1
  65. package/dist/durable/RunJournal.d.mts +1 -1
  66. package/dist/durable/Schedule.d.mts +1 -1
  67. package/dist/durable/ScheduleStoreConformance.d.mts +1 -1
  68. package/dist/durable/ScheduleTransition.d.mts +1 -1
  69. package/dist/durable/Scheduling.d.mts +3 -3
  70. package/dist/durable/SqlMemoryStore.d.mts +715 -5
  71. package/dist/durable/SqlMemoryStore.mjs +313 -123
  72. package/dist/durable/SqlMemoryStore.mjs.map +1 -1
  73. package/dist/durable/SubmissionLedger.d.mts +1 -1
  74. package/dist/durable/SubmissionLedgerConformance.d.mts +2 -2
  75. package/dist/durable/SubmissionStatus.d.mts +1 -1
  76. package/dist/durable/Subscription.d.mts +1 -1
  77. package/dist/durable/SubscriptionInput.d.mts +1 -1
  78. package/dist/durable/SubscriptionInput.mjs +1 -1
  79. package/dist/durable/SubscriptionStoreConformance.d.mts +1 -1
  80. package/dist/durable/SubscriptionTools.d.mts +4 -4
  81. package/dist/durable/SubscriptionTransition.d.mts +1 -1
  82. package/dist/durable/Subscriptions.d.mts +6 -6
  83. package/dist/durable/ThreadContextHistory.d.mts +1 -1
  84. package/dist/durable/ThreadContextHistoryProjection.d.mts +1 -1
  85. package/dist/durable/ThreadInvariants.d.mts +2 -2
  86. package/dist/durable/ThreadProjection.d.mts +1 -1
  87. package/dist/durable/ThreadProjectionMaintenance.d.mts +1 -1
  88. package/dist/durable/ThreadStore.d.mts +1 -1
  89. package/dist/durable/ThreadStoreConformance.d.mts +1 -1
  90. package/dist/durable/WorkerAdmission.d.mts +2 -2
  91. package/dist/durable/WorkerAdmission.mjs +1 -1
  92. package/dist/durable/WorkerHost.d.mts +2 -2
  93. package/dist/engine/AgentRuntime.d.mts +1 -1
  94. package/dist/engine/AgentRuntime.mjs +1 -1
  95. package/dist/engine/RunEventSink.d.mts +1 -1
  96. package/dist/engine/RunOptions.d.mts +1 -1
  97. package/dist/engine/RunOptions.mjs +1 -0
  98. package/dist/engine/RunOptions.mjs.map +1 -1
  99. package/dist/engine/ThreadHistory.d.mts +1 -1
  100. package/dist/index.d.mts +15 -15
  101. package/dist/index.mjs +5 -5
  102. package/package.json +1 -1
  103. package/src/capabilities/ToolDiscovery.ts +24 -10
  104. package/src/capabilities/WebSearch.ts +15 -0
  105. package/src/core/Agent.ts +16 -2
  106. package/src/core/Usage.ts +41 -0
  107. package/src/durable/DurableAgentRuntime.ts +40 -12
  108. package/src/durable/LifecyclePublication.ts +15 -2
  109. package/src/durable/SqlMemoryStore.ts +462 -188
  110. package/src/durable/internal/agent-registration.ts +11 -0
  111. package/src/engine/RunOptions.ts +3 -0
  112. package/src/engine/internal/agent-runtime.ts +68 -5
  113. package/dist/Agent-1DMSO_Fl.mjs.map +0 -1
  114. package/dist/AgentRuntime-IF_1GoUf.mjs.map +0 -1
  115. package/dist/DurableAgentRuntime-BQzYkFVy.mjs.map +0 -1
  116. package/dist/agent-registration-U3kmV7nW.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { _ as Digest, h as DefinitionDigests, m as DefinitionDigestInput, s as CanonicalBatch } from "./Records-BrEpibum.mjs";
1
+ import { _ as Digest, h as DefinitionDigests, m as DefinitionDigestInput, s as CanonicalBatch } from "./Records-BxGWRs-t.mjs";
2
2
  import { Crypto, Effect, Schema } from "effect";
3
3
  declare namespace Digest_d_exports {
4
4
  export { DigestError, EMPTY_TAIL_DIGEST, digestCanonicalBatch, digestDefinition, digestDefinitions, digestJson };
@@ -19,4 +19,4 @@ declare const digestDefinitions: (definitions: DefinitionDigestInput) => Effect.
19
19
  declare const EMPTY_TAIL_DIGEST: string & import("effect/Brand").Brand<"@effect-agent/thread/Digest">;
20
20
  //#endregion
21
21
  export { digestDefinition as a, digestCanonicalBatch as i, Digest_d_exports as n, digestDefinitions as o, EMPTY_TAIL_DIGEST as r, digestJson as s, DigestError as t };
22
- //# sourceMappingURL=Digest-CaJ2RIsF.d.mts.map
22
+ //# sourceMappingURL=Digest-CNHImGy0.d.mts.map
@@ -15,7 +15,7 @@ import { a as PeerMessageCapacity, d as MessageAdmission, f as MessagingError, i
15
15
  import { SubagentHost } from "./engine/SubagentHost.mjs";
16
16
  import { ThreadHistory } from "./engine/ThreadHistory.mjs";
17
17
  import { n as RunToolVisibility } from "./ToolExposure-9uF_Yo0T.mjs";
18
- import { f as renderInputPrompt, n as AgentChildPending, y as streamWithUsageAccountingUnknown } from "./AgentRuntime-IF_1GoUf.mjs";
18
+ import { f as renderInputPrompt, n as AgentChildPending, y as streamWithUsageAccountingUnknown } from "./AgentRuntime-GQACxY_m.mjs";
19
19
  import { ContextRolloverTool } from "./engine/ContextWindow.mjs";
20
20
  import { getToolExecutionClass } from "./engine/DurableStep.mjs";
21
21
  import { CompactionError, ContextCompactor } from "./engine/ContextCompactor.mjs";
@@ -26,7 +26,7 @@ import { AbortCommand, AbortIntentRequest, AdmissionPolicyError, AdmissionReques
26
26
  import { DeclaredPendingBatchEvidence, OpenDelegationCallEvidence, OpenToolCallEvidence, PendingApprovalEvidence, RecoveryDecision, RecoveryEvidence, classifyRecovery } from "./durable/Recovery.mjs";
27
27
  import { ExplainedEvidence, ExplainedSubmission, ExplainedUnknownCall, IntegrityCheck, IntegrityReport, ObligationEntry, ObligationReport, RecoveryExplanation, RetryRefused, obligationSeverityOf, predictRecoveryDisposition, recoveryDecisionMeaning } from "./durable/Admin.mjs";
28
28
  import { digestJson } from "./durable/Digest.mjs";
29
- import { a as compileRegistrations, c as resolveDefinitionBinding, l as resolveWorkerBinding, n as CurrentBindingSelection, o as definitionDigestsEqual, s as makeLegacyWorkerBinding, t as BindingUnavailable, u as toolReplayContracts } from "./agent-registration-U3kmV7nW.mjs";
29
+ import { a as compileRegistrations, c as resolveDefinitionBinding, l as resolveWorkerBinding, n as CurrentBindingSelection, o as definitionDigestsEqual, s as makeLegacyWorkerBinding, t as BindingUnavailable, u as toolReplayContracts } from "./agent-registration-BIOzAej4.mjs";
30
30
  import { $ as workerOriginRecordId, A as subagentRequestedRecordId, B as toolCallUnknownRecordId, C as runStartedBatchId, D as subagentLineageBatchId, E as subagentJoinedRecordId, F as toolCallPreparedRecordId, G as turnCanonicalBatch, H as toolStepSettledRecordId, I as toolCallResolutionBatchId, J as turnResponseBatch, K as turnIdForRun, L as toolCallResolvedRecordId, M as subagentStartedRecordId, N as toolApprovalDecisionRecordId, O as subagentLineageRecordId, P as toolApprovalRequestRecordId, Q as workerInputRecordId, R as toolCallResultBatchId, S as runIdForSubmission, T as subagentJoinBatchId, U as turnApprovalsBatchId, V as toolStepSettledBatchId, X as turnResultsBatch, a as childIdempotencyKeyFor, b as runDurationBatchId, c as compactionRecordId, d as modelResponseInterruptedBatchId, et as workerReportRecordId, f as modelResponseInterruptedRecordId, g as projectRunJournalStream, i as approvalDecisionBatchId, j as subagentStartedBatchId, k as subagentRequestedBatchId, l as firstWorkerInputRecordId, m as peerMessageRecordId, o as childThreadIdFor, p as modelResponseRecordId, q as turnPreparedBatchId, r as agentUpdateRecordId, s as compactionBatchId, t as RunJournalError, tt as makeJournalMetadata, u as markUnknownBatchId, v as runCompletedRecordId, w as runStartedRecordId, x as runDurationRecordId, y as runCompletionDigest, z as toolCallSettledRecordId } from "./RunJournal-ixFRCyW3.mjs";
31
31
  import { FencedAppendRequest, LoadCheckpointRequest, MAX_THREAD_EXPORT_RECORDS, SaveRecoveryCheckpointRequest, ThreadCheckpoint, ThreadExportRequest, ThreadIdentityRequest, ThreadMaterialization, ThreadObservation, ThreadRead, ThreadStore, ThreadStoreDiagnostic, ThreadStoreError, ThreadTailRequest, getRecord, getRunInput, readWorkerState } from "./durable/ThreadStore.mjs";
32
32
  import { DurableRuntimeFailpoint } from "./durable/DurableFailpoint.mjs";
@@ -36,7 +36,7 @@ import { PreparedInput } from "./durable/Subscription.mjs";
36
36
  import { MessageDeliveryDriver, MessageDeliveryFailpoint, MessageDeliveryRecord, MessageDeliveryStore, messageDeliveryCapacity, messageDeliveryUsesCapacity, prepareMessageDelivery } from "./durable/MessageDelivery.mjs";
37
37
  import { WakeScheduler } from "./durable/WakeScheduler.mjs";
38
38
  import { n as safeUnknownString, t as inspectForeignDiagnostic } from "./foreign-diagnostic-DBQ1XHKh.mjs";
39
- import { c as threadCreatedBatchId, l as threadCreatedRecordId, n as WorkerAdmissionPort, o as ensureThreadCreated, r as WorkerAdmissionRequest, s as ensureWorkerOrigin } from "./WorkerAdmission-CNbm4o_x.mjs";
39
+ import { c as threadCreatedBatchId, l as threadCreatedRecordId, n as WorkerAdmissionPort, o as ensureThreadCreated, r as WorkerAdmissionRequest, s as ensureWorkerOrigin } from "./WorkerAdmission-N9hZV85Q.mjs";
40
40
  import { WorkerBudgetAuthorizer, WorkerConcurrencyLimit, WorkerConcurrencyResolver, WorkerHostAuthorizer, WorkerHostConfig, WorkerPolicyResolver } from "./durable/WorkerHost.mjs";
41
41
  import { OperationAuthorizationRequest, OperationAuthorizer, OperationDenied } from "./durable/OperationAuthorizer.mjs";
42
42
  import { PendingSubmission, SettledSubmission } from "./durable/SubmissionStatus.mjs";
@@ -4107,7 +4107,7 @@ const make = Effect.fn("DurableAgentRuntime.make")(function* (bindings) {
4107
4107
  * journal ends mid-batch,
4108
4108
  * `RunOptions.resume` replays the declared batch without re-invoking the model (§2.4).
4109
4109
  */
4110
- const runModel = (agent, ctx, submission, tokenRef, records, canonical, canonicalThrough, journalSeed, journalMetadata, lineage, approvalDecisions, currentContracts, runTiming, yieldAfter) => Effect.gen(function* () {
4110
+ const runModel = (agent, ctx, submission, tokenRef, renewAtRef, records, canonical, canonicalThrough, journalSeed, journalMetadata, lineage, approvalDecisions, currentContracts, runTiming, yieldAfter) => Effect.gen(function* () {
4111
4111
  const submissionId = submission.submissionId;
4112
4112
  const runId = runIdForSubmission(submissionId);
4113
4113
  const boundaries = [];
@@ -4384,6 +4384,7 @@ const make = Effect.fn("DurableAgentRuntime.make")(function* (bindings) {
4384
4384
  const uncached = yield* addUsageTotal("inputTokens.uncached", detailed.inputTokens.uncached, legacyInput);
4385
4385
  const text = yield* addUsageTotal("outputTokens.text", detailed.outputTokens.text, legacyOutput);
4386
4386
  return RunUsageSummary.make({
4387
+ ...legacyCalls === 0 && detailed.webSearchCalls !== void 0 ? { webSearchCalls: detailed.webSearchCalls } : {},
4387
4388
  modelCalls,
4388
4389
  inputTokens: InputTokenUsage.make({
4389
4390
  total: inputTokens,
@@ -5612,14 +5613,22 @@ const make = Effect.fn("DurableAgentRuntime.make")(function* (bindings) {
5612
5613
  return { _tag: "aborted" };
5613
5614
  }
5614
5615
  }));
5615
- const renewal = halt(Effect.repeat(Effect.gen(function* () {
5616
- const ownershipToken = yield* Ref.get(tokenRef);
5617
- const renewal = yield* ledger.renewOwnership(RenewOwnershipRequest.make({
5618
- submissionId,
5619
- ownershipToken
5620
- }));
5621
- yield* Ref.set(tokenRef, renewal.ownershipToken);
5622
- }).pipe(Effect.uninterruptible), { schedule: Schedule.spaced(config.leaseRenewalInterval) }).pipe(Effect.andThen(Effect.never)));
5616
+ const renewal = halt(Effect.gen(function* () {
5617
+ const renewAt = yield* Ref.get(renewAtRef);
5618
+ const now = yield* Clock.currentTimeMillis;
5619
+ yield* Effect.sleep(Math.max(0, renewAt - now));
5620
+ yield* Effect.repeat(Effect.gen(function* () {
5621
+ const ownershipToken = yield* Ref.get(tokenRef);
5622
+ const renewingAt = yield* Clock.currentTimeMillis;
5623
+ const renewal = yield* ledger.renewOwnership(RenewOwnershipRequest.make({
5624
+ submissionId,
5625
+ ownershipToken
5626
+ }));
5627
+ yield* Ref.set(tokenRef, renewal.ownershipToken);
5628
+ yield* Ref.set(renewAtRef, renewingAt + Duration.toMillis(config.leaseRenewalInterval));
5629
+ }).pipe(Effect.uninterruptible), { schedule: Schedule.spaced(config.leaseRenewalInterval) });
5630
+ return yield* Effect.never;
5631
+ }));
5623
5632
  const execution = Effect.raceFirst(consume, Effect.raceFirst(abortWatcher, renewal));
5624
5633
  const result = yield* (yieldAfter === void 0 && submissionScheduling.yieldTo === void 0 ? execution : Effect.raceFirst(execution, Deferred.await(yieldSignal).pipe(Effect.map((nextSubmissionId) => ({
5625
5634
  _tag: "yielded",
@@ -5703,7 +5712,7 @@ const make = Effect.fn("DurableAgentRuntime.make")(function* (bindings) {
5703
5712
  * (Unknown Outcomes, or a durable approval suspension) — no settlement occurs and the
5704
5713
  * obligation stays owed.
5705
5714
  */
5706
- const runAttempt = (registeredAgent, threadId, claim, tokenRef, resumeAfterRetention, onHandoff, yieldAfter) => Effect.gen(function* () {
5715
+ const runAttempt = (registeredAgent, threadId, claim, tokenRef, renewAtRef, resumeAfterRetention, onHandoff, yieldAfter) => Effect.gen(function* () {
5707
5716
  const submissionId = claim.submissionId;
5708
5717
  const supersededEpoch = yield* store.inspectTail(ThreadTailRequest.make({ threadId })).pipe(Effect.map((tail) => tail.producerEpoch), Effect.catchTag("ThreadNotMaterialized", () => Effect.succeed(ZERO_EPOCH)));
5709
5718
  yield* store.materialize(ThreadMaterialization.make({
@@ -5886,7 +5895,7 @@ const make = Effect.fn("DurableAgentRuntime.make")(function* (bindings) {
5886
5895
  const tail = yield* store.inspectTail(ThreadTailRequest.make({ threadId }));
5887
5896
  const canonical = Stream.concat(initialView.canonical, canonicalRange(threadId, tail.tailSequence, initialThrough));
5888
5897
  const currentRecords = yield* refreshControl(tail.tailSequence);
5889
- const outcome = yield* runModel(agent, ctx, submission, tokenRef, currentRecords, canonical, tail.tailSequence, initialView.seed, journalMetadata?.snapshot(), lineage, approvalDecisionIntents, currentContracts, runTiming, yieldAfter);
5898
+ const outcome = yield* runModel(agent, ctx, submission, tokenRef, renewAtRef, currentRecords, canonical, tail.tailSequence, initialView.seed, journalMetadata?.snapshot(), lineage, approvalDecisionIntents, currentContracts, runTiming, yieldAfter);
5890
5899
  if (outcome._tag === "yielded") {
5891
5900
  if (outcome.nextSubmissionId !== void 0) onHandoff(outcome.nextSubmissionId);
5892
5901
  return Option.none();
@@ -5972,6 +5981,7 @@ const make = Effect.fn("DurableAgentRuntime.make")(function* (bindings) {
5972
5981
  }
5973
5982
  }).pipe(Effect.scoped);
5974
5983
  const acquireClaim = Effect.fn("DurableAgentRuntime.acquireClaim")(function* (threadId, handoff) {
5984
+ const acquiringAt = yield* Clock.currentTimeMillis;
5975
5985
  const claimed = yield* ledger.claim(ClaimRequest.make({
5976
5986
  threadId,
5977
5987
  producerId: config.producerId,
@@ -5980,6 +5990,7 @@ const make = Effect.fn("DurableAgentRuntime.make")(function* (bindings) {
5980
5990
  if (Option.isNone(claimed)) return Option.none();
5981
5991
  const claim = claimed.value;
5982
5992
  const tokenRef = yield* Ref.make(claim.ownershipToken);
5993
+ const renewAtRef = yield* Ref.make(acquiringAt + Duration.toMillis(config.leaseRenewalInterval));
5983
5994
  yield* Effect.addFinalizer(() => Ref.get(tokenRef).pipe(Effect.flatMap((ownershipToken) => ledger.releaseOwnership(ReleaseOwnershipRequest.make({
5984
5995
  submissionId: claim.submissionId,
5985
5996
  ownershipToken
@@ -5990,7 +6001,8 @@ const make = Effect.fn("DurableAgentRuntime.make")(function* (bindings) {
5990
6001
  });
5991
6002
  return Option.some({
5992
6003
  claim,
5993
- tokenRef
6004
+ tokenRef,
6005
+ renewAtRef
5994
6006
  });
5995
6007
  }, Effect.uninterruptible);
5996
6008
  const processThreadHead = (resolve, threadId, options) => Effect.gen(function* () {
@@ -6000,7 +6012,7 @@ const make = Effect.fn("DurableAgentRuntime.make")(function* (bindings) {
6000
6012
  const attempt = Effect.scoped(Effect.gen(function* () {
6001
6013
  const claimed = yield* acquireClaim(threadId, handoff);
6002
6014
  if (Option.isNone(claimed)) return Option.none();
6003
- const { claim, tokenRef } = claimed.value;
6015
+ const { claim, tokenRef, renewAtRef } = claimed.value;
6004
6016
  const attributes = {
6005
6017
  threadId,
6006
6018
  submissionId: claim.submissionId,
@@ -6034,7 +6046,7 @@ const make = Effect.fn("DurableAgentRuntime.make")(function* (bindings) {
6034
6046
  failure
6035
6047
  }) }));
6036
6048
  if (resolution._tag === "refused") return yield* resolution.failure;
6037
- return yield* resolution.binding.attempt((agent, attemptThreadId, attemptClaim) => runAttempt(agent, attemptThreadId, attemptClaim, tokenRef, () => {
6049
+ return yield* resolution.binding.attempt((agent, attemptThreadId, attemptClaim) => runAttempt(agent, attemptThreadId, attemptClaim, tokenRef, renewAtRef, () => {
6038
6050
  resumeAfterRetention = true;
6039
6051
  }, (nextSubmissionId) => {
6040
6052
  nextHandoff = ClaimHandoff.make({
@@ -7301,4 +7313,4 @@ var DurableAgentRuntime = class DurableAgentRuntime extends Context.Service()("@
7301
7313
  //#endregion
7302
7314
  export { DurableApprovalSuspension as a, RecoveryFailure as c, childReservationIdFor as d, isolateRecovery as f, DurableApprovalResolver as i, RecoveryReport as l, recoveryRepairRecordId as m, DurableAgentRuntime as n, DurableRuntimeConfig as o, recoveryRepairBatchId as p, DurableAgentRuntime_exports as r, RecoveryBlocked as s, ApprovalSuspensionError as t, RecoverySweepResult as u };
7303
7315
 
7304
- //# sourceMappingURL=DurableAgentRuntime-BQzYkFVy.mjs.map
7316
+ //# sourceMappingURL=DurableAgentRuntime-BAQvZK1e.mjs.map