@yielded/agent 0.1.0-beta.172 → 0.1.0-beta.174
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.
- package/dist/{Admin-BX9ns28E.d.mts → Admin-BHmp2V9p.d.mts} +25 -16
- package/dist/{Agent-9aBoIi74.d.mts → Agent-B39jRnFv.d.mts} +2 -2
- package/dist/{Agent-0WvBWWbM.mjs → Agent-BiRbr73L.mjs} +7 -6
- package/dist/Agent-BiRbr73L.mjs.map +1 -0
- package/dist/{AgentRuntime-CQ-qcETl.mjs → AgentRuntime-B6qZlD3f.mjs} +199 -191
- package/dist/AgentRuntime-B6qZlD3f.mjs.map +1 -0
- package/dist/{AgentRuntime-BfP14534.d.mts → AgentRuntime-BD3ZHAMq.d.mts} +10 -10
- package/dist/{Digest-DCuPlhNk.mjs → Digest-EpeqWEdv.mjs} +41 -14
- package/dist/Digest-EpeqWEdv.mjs.map +1 -0
- package/dist/{DurableAgentRuntime-BAmSkWYr.mjs → DurableAgentRuntime-CBBjRNJN.mjs} +1447 -1424
- package/dist/DurableAgentRuntime-CBBjRNJN.mjs.map +1 -0
- package/dist/{EventSource-BwliwQz9.d.mts → EventSource-C9aaJaXT.d.mts} +2 -2
- package/dist/{MessageDelivery-CeSDfHZa.d.mts → MessageDelivery-BGDm-c46.d.mts} +4 -4
- package/dist/{Messaging-C_6OOg_s.d.mts → Messaging-SVu6rWV8.d.mts} +12 -6
- package/dist/{MessagingHost-B8oKM7AC.d.mts → MessagingHost-C6SOAcoG.d.mts} +2 -2
- package/dist/{Output-Dsx6k52t.d.mts → Output-CRamN1Fy.d.mts} +2 -2
- package/dist/{PreparedInputAdmission-CxSJSiTl.d.mts → PreparedInputAdmission-BvDqlgiP.d.mts} +3 -3
- package/dist/{RunContinuation-DHYNAQFi.mjs → RunContinuation-4ZATcVLB.mjs} +113 -56
- package/dist/RunContinuation-4ZATcVLB.mjs.map +1 -0
- package/dist/{RunContinuation-FHM7XPjq.d.mts → RunContinuation-CTJ1jGrO.d.mts} +6 -6
- package/dist/{RunJournal-kfKVxJj7.mjs → RunJournal-CNZqA3Ge.mjs} +33 -5
- package/dist/RunJournal-CNZqA3Ge.mjs.map +1 -0
- package/dist/{RunOptions-D8zxFIrZ.d.mts → RunOptions-Be77lKVZ.d.mts} +2 -2
- package/dist/{RunStorage-uqPxps09.mjs → RunStorage-BHjuuERI.mjs} +9 -6
- package/dist/RunStorage-BHjuuERI.mjs.map +1 -0
- package/dist/{Scheduling-CVyfXlBR.mjs → Scheduling-NG8slKdI.mjs} +11 -11
- package/dist/Scheduling-NG8slKdI.mjs.map +1 -0
- package/dist/{Subagent-vpffemql.mjs → Subagent-CTIpnzlB.mjs} +53 -40
- package/dist/Subagent-CTIpnzlB.mjs.map +1 -0
- package/dist/{Subagent-E6tvd7-k.d.mts → Subagent-DKhZA72u.d.mts} +19 -8
- package/dist/{SubagentHost-B6w2m-SI.d.mts → SubagentHost-D1xBgn9g.d.mts} +2 -2
- package/dist/{Subscription-DONig54Q.d.mts → Subscription-BNg9VCRl.d.mts} +2 -2
- package/dist/{SubscriptionInput-mJIRxWJM.d.mts → SubscriptionInput-BUoXv-_K.d.mts} +2 -2
- package/dist/{ThreadImport-CoQTZywm.d.mts → ThreadImport-CMgzttvr.d.mts} +43 -43
- package/dist/{ThreadImport-DckUMEqJ.mjs → ThreadImport-CodYoJoa.mjs} +7 -7
- package/dist/ThreadImport-CodYoJoa.mjs.map +1 -0
- package/dist/{ThreadStore-CEekRa80.mjs → ThreadStore-59uDGXul.mjs} +163 -84
- package/dist/ThreadStore-59uDGXul.mjs.map +1 -0
- package/dist/{ThreadTransfer-B4gTQLIl.mjs → ThreadTransfer-3jigUl3g.mjs} +3 -3
- package/dist/{ThreadTransfer-B4gTQLIl.mjs.map → ThreadTransfer-3jigUl3g.mjs.map} +1 -1
- package/dist/{WorkerAdmission-DFVbbVh2.mjs → WorkerAdmission-DDYJdOsU.mjs} +4 -4
- package/dist/{WorkerAdmission-DFVbbVh2.mjs.map → WorkerAdmission-DDYJdOsU.mjs.map} +1 -1
- package/dist/{agent-registration-ByMZ_cK5.mjs → agent-registration-DRbyhAu-.mjs} +69 -56
- package/dist/agent-registration-DRbyhAu-.mjs.map +1 -0
- package/dist/capabilities/Approval.mjs +2 -2
- package/dist/capabilities/Approval.mjs.map +1 -1
- package/dist/capabilities/BrowserUse.d.mts +102 -1867
- package/dist/capabilities/BrowserUse.mjs +74 -798
- package/dist/capabilities/BrowserUse.mjs.map +1 -1
- package/dist/capabilities/Budget.mjs +3 -1
- package/dist/capabilities/Budget.mjs.map +1 -1
- package/dist/capabilities/CodeMode.d.mts +1 -1
- package/dist/capabilities/CodeMode.mjs +16 -9
- package/dist/capabilities/CodeMode.mjs.map +1 -1
- package/dist/capabilities/Commands.d.mts +1 -1
- package/dist/capabilities/McpClient.mjs +1 -1
- package/dist/capabilities/McpClient.mjs.map +1 -1
- package/dist/capabilities/Messaging.d.mts +1 -1
- package/dist/capabilities/Messaging.mjs +4 -4
- package/dist/capabilities/Messaging.mjs.map +1 -1
- package/dist/capabilities/ModelContext.mjs +7 -5
- package/dist/capabilities/ModelContext.mjs.map +1 -1
- package/dist/capabilities/Redaction.mjs +49 -19
- package/dist/capabilities/Redaction.mjs.map +1 -1
- package/dist/capabilities/RunHooks.d.mts +1 -1
- package/dist/capabilities/RunHooks.mjs +1 -1
- package/dist/capabilities/RunHooks.mjs.map +1 -1
- package/dist/capabilities/Subagent.d.mts +1 -1
- package/dist/capabilities/Subagent.mjs +1 -1
- package/dist/capabilities/SubagentReservations.mjs +3 -1
- package/dist/capabilities/SubagentReservations.mjs.map +1 -1
- package/dist/capabilities/WebCapture.mjs.map +1 -1
- package/dist/capabilities/WebSearch.mjs +7 -7
- package/dist/capabilities/WebSearch.mjs.map +1 -1
- package/dist/core/Agent.d.mts +1 -1
- package/dist/core/Agent.mjs +1 -1
- package/dist/core/AgentUpdates.mjs +8 -8
- package/dist/core/AgentUpdates.mjs.map +1 -1
- package/dist/core/Thread.mjs +1 -1
- package/dist/core/Thread.mjs.map +1 -1
- package/dist/core/Usage.mjs +2 -2
- package/dist/core/Usage.mjs.map +1 -1
- package/dist/durable/Admin.d.mts +1 -1
- package/dist/durable/AgentRegistration.d.mts +1 -1
- package/dist/durable/AgentRegistration.mjs +1 -1
- package/dist/durable/Certification.d.mts +1 -1
- package/dist/durable/CommittedActivity.d.mts +1 -1
- package/dist/durable/CommittedActivity.mjs +2 -2
- package/dist/durable/Digest.mjs +1 -1
- package/dist/durable/DurableAgentRuntime.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.mjs +2 -2
- package/dist/durable/EventSource.d.mts +1 -1
- package/dist/durable/EventSource.mjs +6 -6
- package/dist/durable/EventSource.mjs.map +1 -1
- package/dist/durable/GitHubWorkflowSource.d.mts +3 -3
- package/dist/durable/LifecyclePublication.d.mts +1 -1
- package/dist/durable/LifecyclePublication.mjs +1 -1
- package/dist/durable/MessageDelivery.d.mts +1 -1
- package/dist/durable/MessageDelivery.mjs +1 -1
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +2 -2
- package/dist/durable/MessageDeliveryStoreConformance.mjs +1 -1
- package/dist/durable/PersistentHistory.d.mts +1 -1
- package/dist/durable/PersistentHistory.mjs +3 -3
- package/dist/durable/PreparedInputAdmission.d.mts +1 -1
- package/dist/durable/RecordFormat.mjs +2 -2
- package/dist/durable/RecordFormat.mjs.map +1 -1
- package/dist/durable/Recovery.d.mts +1 -1
- package/dist/durable/RunContinuation.d.mts +2 -2
- package/dist/durable/RunContinuation.mjs +2 -2
- package/dist/durable/RunJournal.d.mts +1 -1
- package/dist/durable/RunJournal.mjs +1 -1
- package/dist/durable/RunStorage.d.mts +1 -1
- package/dist/durable/RunStorage.mjs +1 -1
- package/dist/durable/Scheduling.d.mts +1 -1
- package/dist/durable/Scheduling.mjs +1 -1
- package/dist/durable/SettlementPublisher.d.mts +1 -1
- package/dist/durable/SettlementPublisher.mjs +2 -2
- package/dist/durable/SubmissionLedger.d.mts +1 -1
- package/dist/durable/SubmissionLedger.mjs +5 -1
- package/dist/durable/SubmissionLedger.mjs.map +1 -1
- package/dist/durable/SubmissionLedgerConformance.d.mts +1 -1
- package/dist/durable/SubmissionLedgerConformance.mjs +4 -4
- package/dist/durable/SubmissionStatus.d.mts +1 -1
- package/dist/durable/Subscription.d.mts +1 -1
- package/dist/durable/SubscriptionInput.d.mts +1 -1
- package/dist/durable/SubscriptionInput.mjs +3 -3
- package/dist/durable/SubscriptionInput.mjs.map +1 -1
- package/dist/durable/SubscriptionStoreConformance.d.mts +1 -1
- package/dist/durable/SubscriptionStoreConformance.mjs +2 -2
- package/dist/durable/SubscriptionStoreConformance.mjs.map +1 -1
- package/dist/durable/SubscriptionTools.d.mts +2 -2
- package/dist/durable/SubscriptionTransition.d.mts +1 -1
- package/dist/durable/Subscriptions.d.mts +5 -5
- package/dist/durable/Subscriptions.mjs +2 -2
- package/dist/durable/Subscriptions.mjs.map +1 -1
- package/dist/durable/ThreadArchiveRange.d.mts +1 -1
- package/dist/durable/ThreadContextHistory.d.mts +1 -1
- package/dist/durable/ThreadContextHistory.mjs +1 -1
- package/dist/durable/ThreadImport.d.mts +1 -1
- package/dist/durable/ThreadImport.mjs +1 -1
- package/dist/durable/ThreadInvariants.d.mts +3 -3
- package/dist/durable/ThreadInvariants.mjs +4 -4
- package/dist/durable/ThreadInvariants.mjs.map +1 -1
- package/dist/durable/ThreadProjectionMaintenance.d.mts +1 -1
- package/dist/durable/ThreadReader.d.mts +1 -1
- package/dist/durable/ThreadReader.mjs +1 -1
- package/dist/durable/ThreadStore.d.mts +1 -1
- package/dist/durable/ThreadStore.mjs +1 -1
- package/dist/durable/ThreadStoreConformance.d.mts +1 -1
- package/dist/durable/ThreadStoreConformance.mjs +3 -3
- package/dist/durable/ThreadTransfer.d.mts +1 -1
- package/dist/durable/ThreadTransfer.mjs +1 -1
- package/dist/durable/ThreadWork.d.mts +1 -1
- package/dist/durable/ThreadWork.mjs +4 -4
- package/dist/durable/ThreadWork.mjs.map +1 -1
- package/dist/durable/WorkerAdmission.d.mts +1 -1
- package/dist/durable/WorkerAdmission.mjs +1 -1
- package/dist/durable/WorkerHost.d.mts +2 -2
- package/dist/engine/AgentRuntime.d.mts +1 -1
- package/dist/engine/AgentRuntime.mjs +1 -1
- package/dist/engine/MessagingHost.d.mts +1 -1
- package/dist/engine/Output.d.mts +1 -1
- package/dist/engine/RunOptions.d.mts +1 -1
- package/dist/engine/SubagentHost.d.mts +1 -1
- package/dist/index.d.mts +19 -19
- package/dist/index.mjs +14 -14
- package/dist/{run-context-reader-OcsZr4bk.d.mts → run-context-reader-CC7ZD95F.d.mts} +2 -2
- package/package.json +1 -1
- package/src/capabilities/Approval.ts +58 -60
- package/src/capabilities/BrowserUse.ts +89 -944
- package/src/capabilities/Budget.ts +8 -1
- package/src/capabilities/CodeMode.ts +57 -33
- package/src/capabilities/McpClient.ts +2 -2
- package/src/capabilities/Messaging.ts +51 -55
- package/src/capabilities/ModelContext.ts +5 -2
- package/src/capabilities/Redaction.ts +64 -34
- package/src/capabilities/RunHooks.ts +52 -55
- package/src/capabilities/Subagent.ts +33 -33
- package/src/capabilities/SubagentReservations.ts +9 -1
- package/src/capabilities/WebCapture.ts +6 -0
- package/src/capabilities/WebSearch.ts +10 -7
- package/src/capabilities/internal/subagent-background.ts +202 -158
- package/src/core/Agent.ts +11 -6
- package/src/core/AgentUpdates.ts +8 -8
- package/src/core/Thread.ts +9 -10
- package/src/core/Usage.ts +7 -8
- package/src/core/internal/agent-updates.ts +1 -0
- package/src/durable/DurableAgentRuntime.ts +645 -625
- package/src/durable/EventSource.ts +15 -9
- package/src/durable/RecordFormat.ts +5 -3
- package/src/durable/RunContinuation.ts +233 -81
- package/src/durable/RunJournal.ts +10 -9
- package/src/durable/RunStorage.ts +122 -124
- package/src/durable/Scheduling.ts +639 -651
- package/src/durable/SubmissionLedger.ts +4 -0
- package/src/durable/SubscriptionInput.ts +5 -3
- package/src/durable/SubscriptionStoreConformance.ts +23 -23
- package/src/durable/Subscriptions.ts +18 -19
- package/src/durable/ThreadImport.ts +18 -19
- package/src/durable/ThreadInvariants.ts +2 -1
- package/src/durable/ThreadStore.ts +215 -111
- package/src/durable/ThreadWork.ts +1 -2
- package/src/durable/internal/StorageOwner.ts +10 -4
- package/src/durable/internal/agent-registration.ts +96 -89
- package/src/durable/internal/canonical-json.ts +61 -20
- package/src/durable/internal/prompt-history-cache.ts +13 -4
- package/src/durable/internal/record-encoding.ts +120 -64
- package/src/durable/internal/schedule-time.ts +6 -6
- package/src/durable/internal/usage-totals.ts +38 -0
- package/src/durable/internal/worker-host.ts +69 -74
- package/src/engine/internal/agent-runtime.ts +1067 -1018
- package/src/engine/internal/provisional-text.ts +12 -10
- package/src/engine/internal/tool-exposure.ts +22 -18
- package/src/engine/internal/tool-telemetry.ts +12 -7
- package/dist/Agent-0WvBWWbM.mjs.map +0 -1
- package/dist/AgentRuntime-CQ-qcETl.mjs.map +0 -1
- package/dist/Digest-DCuPlhNk.mjs.map +0 -1
- package/dist/DurableAgentRuntime-BAmSkWYr.mjs.map +0 -1
- package/dist/RunContinuation-DHYNAQFi.mjs.map +0 -1
- package/dist/RunJournal-kfKVxJj7.mjs.map +0 -1
- package/dist/RunStorage-uqPxps09.mjs.map +0 -1
- package/dist/Scheduling-CVyfXlBR.mjs.map +0 -1
- package/dist/Subagent-vpffemql.mjs.map +0 -1
- package/dist/ThreadImport-DckUMEqJ.mjs.map +0 -1
- package/dist/ThreadStore-CEekRa80.mjs.map +0 -1
- package/dist/agent-registration-ByMZ_cK5.mjs.map +0 -1
|
@@ -171,71 +171,70 @@ const makeWriter = Effect.fnUntraced(function* (threadId: ThreadId) {
|
|
|
171
171
|
}),
|
|
172
172
|
);
|
|
173
173
|
|
|
174
|
-
const append: RunWriter["append"] = (batch, executions)
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
AppendRequest.make({
|
|
178
|
-
threadId,
|
|
179
|
-
expectedTailSequence: tail.sequence,
|
|
180
|
-
batch,
|
|
181
|
-
...(executions === undefined ? {} : { executions }),
|
|
182
|
-
}),
|
|
183
|
-
).pipe(
|
|
184
|
-
Effect.mapError((cause) =>
|
|
185
|
-
ThreadStoreError.make({
|
|
186
|
-
operation: "capture append",
|
|
187
|
-
message: cause.message,
|
|
188
|
-
cause,
|
|
189
|
-
}),
|
|
190
|
-
),
|
|
191
|
-
);
|
|
192
|
-
|
|
193
|
-
return yield* owner.withProgress(
|
|
174
|
+
const append: RunWriter["append"] = Effect.fnUntraced(function* (batch, executions) {
|
|
175
|
+
const captured = yield* PreparedAppend.capture(
|
|
176
|
+
AppendRequest.make({
|
|
194
177
|
threadId,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
.pipe(
|
|
209
|
-
Effect.catchTag("AppendConflict", (conflict) => {
|
|
210
|
-
if (
|
|
211
|
-
conflict.reason !== "tail" ||
|
|
212
|
-
conflict.actualTailSequence === undefined ||
|
|
213
|
-
retries >= 8
|
|
214
|
-
)
|
|
215
|
-
return Effect.fail(conflict);
|
|
216
|
-
tail = { sequence: conflict.actualTailSequence };
|
|
217
|
-
if (captured.executions !== undefined) return Effect.fail(conflict);
|
|
218
|
-
|
|
219
|
-
return Effect.succeed(undefined);
|
|
220
|
-
}),
|
|
221
|
-
);
|
|
178
|
+
expectedTailSequence: tail.sequence,
|
|
179
|
+
batch,
|
|
180
|
+
...(executions === undefined ? {} : { executions }),
|
|
181
|
+
}),
|
|
182
|
+
).pipe(
|
|
183
|
+
Effect.mapError((cause) =>
|
|
184
|
+
ThreadStoreError.make({
|
|
185
|
+
operation: "capture append",
|
|
186
|
+
message: cause.message,
|
|
187
|
+
cause,
|
|
188
|
+
}),
|
|
189
|
+
),
|
|
190
|
+
);
|
|
222
191
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
192
|
+
return yield* owner.withProgress(
|
|
193
|
+
threadId,
|
|
194
|
+
owner.withMutation(
|
|
195
|
+
Effect.gen(function* () {
|
|
196
|
+
yield* checkActive;
|
|
197
|
+
for (let retries = 0; ; retries++) {
|
|
198
|
+
const result = yield* store
|
|
199
|
+
.append(
|
|
200
|
+
captured.expectedTailSequence === tail.sequence
|
|
201
|
+
? captured
|
|
202
|
+
: AppendRequest.make({
|
|
203
|
+
...captured,
|
|
204
|
+
expectedTailSequence: tail.sequence,
|
|
205
|
+
}),
|
|
206
|
+
)
|
|
207
|
+
.pipe(
|
|
208
|
+
Effect.catchTag("AppendConflict", (conflict) => {
|
|
209
|
+
if (
|
|
210
|
+
conflict.reason !== "tail" ||
|
|
211
|
+
conflict.actualTailSequence === undefined ||
|
|
212
|
+
retries >= 8
|
|
213
|
+
)
|
|
214
|
+
return Effect.fail(conflict);
|
|
215
|
+
tail = { sequence: conflict.actualTailSequence };
|
|
216
|
+
if (captured.executions !== undefined) return Effect.fail(conflict);
|
|
217
|
+
|
|
218
|
+
return Effect.succeed(undefined);
|
|
219
|
+
}),
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
if (result === undefined) continue;
|
|
223
|
+
// A historical replay returns its original coordinates, not today's canonical tail.
|
|
224
|
+
if (result.replayed) yield* refresh;
|
|
225
|
+
else tail = { sequence: result.lastSequence };
|
|
226
|
+
|
|
227
|
+
return result;
|
|
228
|
+
}
|
|
229
|
+
}).pipe(
|
|
230
|
+
// Revoke uncertain writes before releasing the writer's mutation gate.
|
|
231
|
+
Effect.onError((cause) =>
|
|
232
|
+
isDefiniteWriteFailure(cause) ? Effect.void : ownership.release,
|
|
235
233
|
),
|
|
236
234
|
),
|
|
237
|
-
)
|
|
238
|
-
|
|
235
|
+
),
|
|
236
|
+
);
|
|
237
|
+
});
|
|
239
238
|
|
|
240
239
|
const writer = {
|
|
241
240
|
threadId,
|
|
@@ -371,73 +370,72 @@ export const make = Effect.gen(function* () {
|
|
|
371
370
|
),
|
|
372
371
|
),
|
|
373
372
|
),
|
|
374
|
-
publishSettlement: (batch, executions)
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
373
|
+
publishSettlement: Effect.fnUntraced(function* (batch, executions) {
|
|
374
|
+
const captured = yield* PreparedAppend.capture(
|
|
375
|
+
AppendRequest.make({
|
|
376
|
+
threadId: request.threadId,
|
|
377
|
+
expectedTailSequence: (yield* writer.tail).sequence,
|
|
378
|
+
batch,
|
|
379
|
+
...(executions === undefined ? {} : { executions }),
|
|
380
|
+
}),
|
|
381
|
+
).pipe(
|
|
382
|
+
Effect.mapError((cause) =>
|
|
383
|
+
LedgerError.make({
|
|
384
|
+
operation: "capture settlement",
|
|
385
|
+
message: cause.message,
|
|
386
|
+
cause,
|
|
382
387
|
}),
|
|
383
|
-
)
|
|
384
|
-
|
|
385
|
-
LedgerError.make({
|
|
386
|
-
operation: "capture settlement",
|
|
387
|
-
message: cause.message,
|
|
388
|
-
cause,
|
|
389
|
-
}),
|
|
390
|
-
),
|
|
391
|
-
);
|
|
392
|
-
|
|
393
|
-
return yield* owner.withProgress(
|
|
394
|
-
request.threadId,
|
|
395
|
-
owned(
|
|
396
|
-
Effect.gen(function* () {
|
|
397
|
-
for (let retries = 0; ; retries++) {
|
|
398
|
-
const result = yield* publisher
|
|
399
|
-
.publish(
|
|
400
|
-
SettlementPublication.make({
|
|
401
|
-
submissionId: claimed.submissionId,
|
|
402
|
-
authority: { _tag: "Owned" },
|
|
403
|
-
append: AppendRequest.make({
|
|
404
|
-
...captured,
|
|
405
|
-
expectedTailSequence: (yield* writer.tail).sequence,
|
|
406
|
-
}),
|
|
407
|
-
}),
|
|
408
|
-
)
|
|
409
|
-
.pipe(
|
|
410
|
-
Effect.catchTag("AppendConflict", (conflict) => {
|
|
411
|
-
if (
|
|
412
|
-
conflict.reason !== "tail" ||
|
|
413
|
-
conflict.actualTailSequence === undefined ||
|
|
414
|
-
retries >= 8
|
|
415
|
-
)
|
|
416
|
-
return Effect.fail(conflict);
|
|
417
|
-
|
|
418
|
-
return writer.refresh.pipe(
|
|
419
|
-
Effect.andThen(
|
|
420
|
-
captured.executions === undefined
|
|
421
|
-
? Effect.succeed(undefined)
|
|
422
|
-
: Effect.fail(conflict),
|
|
423
|
-
),
|
|
424
|
-
);
|
|
425
|
-
}),
|
|
426
|
-
);
|
|
427
|
-
|
|
428
|
-
if (result === undefined) continue;
|
|
429
|
-
adoptTail(result.tailSequence);
|
|
388
|
+
),
|
|
389
|
+
);
|
|
430
390
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
391
|
+
return yield* owner.withProgress(
|
|
392
|
+
request.threadId,
|
|
393
|
+
owned(
|
|
394
|
+
Effect.gen(function* () {
|
|
395
|
+
for (let retries = 0; ; retries++) {
|
|
396
|
+
const result = yield* publisher
|
|
397
|
+
.publish(
|
|
398
|
+
SettlementPublication.make({
|
|
399
|
+
submissionId: claimed.submissionId,
|
|
400
|
+
authority: { _tag: "Owned" },
|
|
401
|
+
append: AppendRequest.make({
|
|
402
|
+
...captured,
|
|
403
|
+
expectedTailSequence: (yield* writer.tail).sequence,
|
|
404
|
+
}),
|
|
405
|
+
}),
|
|
406
|
+
)
|
|
407
|
+
.pipe(
|
|
408
|
+
Effect.catchTag("AppendConflict", (conflict) => {
|
|
409
|
+
if (
|
|
410
|
+
conflict.reason !== "tail" ||
|
|
411
|
+
conflict.actualTailSequence === undefined ||
|
|
412
|
+
retries >= 8
|
|
413
|
+
)
|
|
414
|
+
return Effect.fail(conflict);
|
|
415
|
+
|
|
416
|
+
return writer.refresh.pipe(
|
|
417
|
+
Effect.andThen(
|
|
418
|
+
captured.executions === undefined
|
|
419
|
+
? Effect.succeed(undefined)
|
|
420
|
+
: Effect.fail(conflict),
|
|
421
|
+
),
|
|
422
|
+
);
|
|
423
|
+
}),
|
|
424
|
+
);
|
|
425
|
+
|
|
426
|
+
if (result === undefined) continue;
|
|
427
|
+
adoptTail(result.tailSequence);
|
|
428
|
+
|
|
429
|
+
return result;
|
|
430
|
+
}
|
|
431
|
+
}).pipe(
|
|
432
|
+
Effect.onError((cause) =>
|
|
433
|
+
isDefiniteWriteFailure(cause) ? Effect.void : generation.release,
|
|
437
434
|
),
|
|
438
435
|
),
|
|
439
|
-
)
|
|
440
|
-
|
|
436
|
+
),
|
|
437
|
+
);
|
|
438
|
+
}),
|
|
441
439
|
reserveChildBudget: (value) =>
|
|
442
440
|
owned(
|
|
443
441
|
ledger.reserveChildBudget(
|