effect-agent 0.1.0-beta.132 → 0.1.0-beta.133
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-C34cVKlT.d.mts → Admin-CUja0lmO.d.mts} +21 -3
- package/dist/{DurableAgentRuntime-BydyN_n-.mjs → DurableAgentRuntime-DH2baLGe.mjs} +13 -21
- package/dist/DurableAgentRuntime-DH2baLGe.mjs.map +1 -0
- package/dist/{EventSource-Bac0SxKL.d.mts → EventSource-DoiZF3xv.d.mts} +2 -2
- package/dist/{PreparedInputAdmission-DcQGQ0Yp.d.mts → PreparedInputAdmission-B1bzyIuV.d.mts} +3 -3
- package/dist/{Subscription-Bk2Smmqc.d.mts → Subscription-m_yNfNeN.d.mts} +2 -2
- package/dist/{SubscriptionInput-ekbJz3pF.d.mts → SubscriptionInput-ON3-b8Sl.d.mts} +2 -2
- package/dist/durable/Admin.d.mts +1 -1
- package/dist/durable/AgentRegistration.d.mts +1 -1
- package/dist/durable/Certification.d.mts +1 -1
- package/dist/durable/CommittedActivity.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.mjs +1 -1
- package/dist/durable/EventSource.d.mts +1 -1
- package/dist/durable/GitHubWorkflowSource.d.mts +3 -3
- package/dist/durable/MessageDelivery.d.mts +41 -41
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +39 -39
- package/dist/durable/PersistentHistory.d.mts +1 -1
- package/dist/durable/PreparedInputAdmission.d.mts +1 -1
- package/dist/durable/Recovery.d.mts +1 -1
- package/dist/durable/RunJournal.d.mts +1 -1
- package/dist/durable/Scheduling.d.mts +1 -1
- package/dist/durable/SqlStorageV2Upgrade.d.mts +1 -1
- package/dist/durable/SqlSubscriptionStore.d.mts +1 -1
- package/dist/durable/SqlThreadNativeReads.d.mts +2 -1
- package/dist/durable/SqlThreadNativeReads.mjs +75 -38
- package/dist/durable/SqlThreadNativeReads.mjs.map +1 -1
- package/dist/durable/SubmissionLedger.d.mts +1 -1
- package/dist/durable/SubmissionLedgerConformance.d.mts +1 -1
- 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/SubscriptionStoreConformance.d.mts +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/ThreadContextHistory.d.mts +1 -1
- package/dist/durable/ThreadInvariants.d.mts +1 -1
- package/dist/durable/ThreadProjectionMaintenance.d.mts +1 -1
- package/dist/durable/ThreadStore.d.mts +2 -2
- package/dist/durable/ThreadStore.mjs +30 -2
- package/dist/durable/ThreadStore.mjs.map +1 -1
- package/dist/durable/ThreadStoreConformance.d.mts +1 -1
- package/dist/durable/ThreadStoreConformance.mjs +34 -3
- package/dist/durable/ThreadStoreConformance.mjs.map +1 -1
- package/dist/durable/WorkerHost.d.mts +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/src/durable/SqlThreadNativeReads.ts +75 -2
- package/src/durable/ThreadStore.ts +63 -1
- package/src/durable/ThreadStoreConformance.ts +113 -1
- package/src/durable/internal/agent-updates.ts +4 -0
- package/src/durable/internal/worker-host.ts +17 -18
- package/dist/DurableAgentRuntime-BydyN_n-.mjs.map +0 -1
|
@@ -516,7 +516,7 @@ declare class SettledSubmission extends SettledSubmission_base {}
|
|
|
516
516
|
declare const SubmissionStatus: Schema.Union<readonly [typeof PendingSubmission, typeof SettledSubmission]>;
|
|
517
517
|
type SubmissionStatus = typeof SubmissionStatus.Type;
|
|
518
518
|
declare namespace ThreadStore_d_exports {
|
|
519
|
-
export { AppendConflict, AppendResult, CheckpointRejected, FenceRejected, FencedAppendRequest, LoadCheckpointRequest, MAX_THREAD_EXPORT_RECORDS, SaveCheckpointRequest, SaveRecoveryCheckpointRequest, SelectedThreadRead, ThreadCheckpoint, ThreadCheckpoints, ThreadExport, ThreadExportRequest, ThreadMaterialization, ThreadNotMaterialized, ThreadObservation, ThreadOutstanding, ThreadOutstandingRequest, ThreadPeerCountRequest, ThreadRead, ThreadReadRequest, ThreadRecordRequest, ThreadRecoveryCheckpoints, ThreadRunInputRequest, ThreadSelection, ThreadStore, ThreadStoreDiagnostic, ThreadStoreError, ThreadStoreFailure, ThreadTail, ThreadTailRequest, ThreadWorkerStateRequest, getRecord, getRunInput, readOutstanding, readWorkerState };
|
|
519
|
+
export { AppendConflict, AppendResult, CheckpointRejected, FenceRejected, FencedAppendRequest, LoadCheckpointRequest, MAX_THREAD_EXPORT_RECORDS, SaveCheckpointRequest, SaveRecoveryCheckpointRequest, SelectedThreadRead, ThreadCheckpoint, ThreadCheckpoints, ThreadExport, ThreadExportRequest, ThreadIdentity, ThreadIdentityRequest, ThreadMaterialization, ThreadNotMaterialized, ThreadObservation, ThreadOutstanding, ThreadOutstandingRequest, ThreadPeerCountRequest, ThreadRead, ThreadReadRequest, ThreadRecordRequest, ThreadRecoveryCheckpoints, ThreadRunInputRequest, ThreadSelection, ThreadStore, ThreadStoreDiagnostic, ThreadStoreError, ThreadStoreFailure, ThreadTail, ThreadTailRequest, ThreadWorkerStateRequest, getRecord, getRunInput, readOutstanding, readWorkerState };
|
|
520
520
|
}
|
|
521
521
|
declare const MAX_THREAD_EXPORT_RECORDS = 131072;
|
|
522
522
|
/** Exact canonical identity; absence is not proof that an admission was never accepted. */
|
|
@@ -733,6 +733,23 @@ declare const ThreadTail_base: Schema.Class<ThreadTail, Schema.Struct<{
|
|
|
733
733
|
* FencedAppendRequest from this value instead of exporting the whole log.
|
|
734
734
|
*/
|
|
735
735
|
declare class ThreadTail extends ThreadTail_base {}
|
|
736
|
+
declare const ThreadIdentityRequest_base: Schema.Class<ThreadIdentityRequest, Schema.Struct<{
|
|
737
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
738
|
+
}>, {}>;
|
|
739
|
+
declare class ThreadIdentityRequest extends ThreadIdentityRequest_base {}
|
|
740
|
+
declare const ThreadIdentity_base: Schema.Class<ThreadIdentity, Schema.Struct<{
|
|
741
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
742
|
+
readonly tailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
743
|
+
readonly tailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
744
|
+
readonly producerEpoch: Schema.brand<Schema.Natural, "@effect-agent/thread/ProducerEpoch">;
|
|
745
|
+
readonly records: Schema.$Array<typeof CanonicalRecordEnvelope>;
|
|
746
|
+
}>, {}>;
|
|
747
|
+
/**
|
|
748
|
+
* One consistent canonical snapshot: tail/epoch, first record, exact worker origin,
|
|
749
|
+
* then exact subagent lineage. A row selected twice appears only once. Missing
|
|
750
|
+
* identity records remain absent; the snapshot itself grants no execution authority.
|
|
751
|
+
*/
|
|
752
|
+
declare class ThreadIdentity extends ThreadIdentity_base {}
|
|
736
753
|
declare const ThreadExport_base: Schema.Class<ThreadExport, Schema.Struct<{
|
|
737
754
|
readonly format: Schema.Literal<"effect-agent/thread@1">;
|
|
738
755
|
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
@@ -857,6 +874,7 @@ declare const ThreadStore_base: Context.ServiceClass<ThreadStore, "@effect-agent
|
|
|
857
874
|
readonly observe: (request: ThreadObservation) => Stream.Stream<CanonicalRecordEnvelope, ThreadStoreError | ThreadNotMaterialized>;
|
|
858
875
|
readonly export: (request: ThreadExportRequest) => Effect.Effect<ThreadExport, ThreadStoreError | ThreadNotMaterialized>;
|
|
859
876
|
readonly inspectTail: (request: ThreadTailRequest) => Effect.Effect<ThreadTail, ThreadStoreError | ThreadNotMaterialized>;
|
|
877
|
+
readonly readIdentity: (request: ThreadIdentityRequest) => Effect.Effect<ThreadIdentity, ThreadStoreError | ThreadNotMaterialized>;
|
|
860
878
|
/** Absent when this adapter does not support disposable checkpoints. */
|
|
861
879
|
readonly checkpoints?: ThreadCheckpoints | undefined;
|
|
862
880
|
readonly recoveryCheckpoints?: ThreadRecoveryCheckpoints | undefined;
|
|
@@ -3177,5 +3195,5 @@ declare const RetryRefused_base: Schema.Class<RetryRefused, Schema.TaggedStruct<
|
|
|
3177
3195
|
*/
|
|
3178
3196
|
declare class RetryRefused extends RetryRefused_base {}
|
|
3179
3197
|
//#endregion
|
|
3180
|
-
export { RepairSubagentStartLink as $,
|
|
3181
|
-
//# sourceMappingURL=Admin-
|
|
3198
|
+
export { RepairSubagentStartLink as $, toolApprovalRequestRecordId as $i, DurableApprovalSuspension as $n, ThreadSelection as $r, RecoverySnapshot as $t, AwaitChildSettlement as A, compileRegistrations as Aa, modelResponseInterruptedBatchId as Ai, UnknownResolution as An, FencedAppendRequest as Ar, ChildReservationConflict as At, MarkUnknown as B, runDurationRecordId as Bi, submissionAbortRecordId as Bn, ThreadIdentity as Br, JoinSnapshot as Bt, renderRecoveryExplanation as C, BindingUnavailable as Ca, approvalDecisionBatchId as Ci, SubmissionSnapshot as Cn, recoveryRepairRecordId as Cr, ApprovalDecisionIntent as Ct, ApplyUnknownResolutions as D, ReplayVersions as Da, compactionRecordId as Di, SuspensionOutcome as Dn, AppendResult as Dr, ChildAttachmentSnapshot as Dt, ApplyJoinAccounting as E, ExecutableAgentBinding as Ea, compactionBatchId as Ei, SuspendRequest as En, AppendConflict as Er, BeginChildBudgetReleaseRequest as Et, CompleteMaterialization as F, projectRunJournalStream as Fi, WaitingForChildSuspension as Fn, SelectedThreadRead as Fr, Claim as Ft, PropagateChildAbort as G, subagentJoinedRecordId as Gi, submissionSettlementRecordId as Gn, ThreadOutstanding as Gr, MarkJoinedRequest as Gt, OpenDelegationCallEvidence as H, runStartedBatchId as Hi, submissionInputRecordId as Hn, ThreadMaterialization as Hr, LedgerCapabilities as Ht, DeclaredPendingBatchEvidence as I, promptFromCanonicalRecords as Ii, WorkerLedgerState as In, ThreadCheckpoint as Ir, ClaimJoiningRequest as It, Recovery_d_exports as J, subagentRequestedBatchId as Ji, DurableAbortFailure as Jn, ThreadRead as Jr, OwnershipLost as Jt, RecoveryDecision as K, subagentLineageBatchId as Ki, workerTerminalFromRecord as Kn, ThreadOutstandingRequest as Kr, MarkReadyRequest as Kt, DelegationAdmissionEvidence as L, runCompletedRecordId as Li, WorkerStopCommand as Ln, ThreadCheckpoints as Lr, ClaimRequest as Lt, AwaitParentEstablishment as M, modelResponseRecordId as Mi, UnknownResolutionConflict as Mn, MAX_THREAD_EXPORT_RECORDS as Mr, ChildReservationStatus as Mt, AwaitUnknownResolution as N, peerMessageRecordId as Ni, UnknownResolutionIntent as Nn, SaveCheckpointRequest as Nr, ChildSettledNotification as Nt, AwaitApprovalDecision as O, ResolvedBinding as Oa, firstWorkerInputRecordId as Oi, SuspensionReason as On, CheckpointRejected as Or, ChildBudgetReservationRequest as Ot, CompleteChildAdmission as P, projectRunJournal as Pi, WaitingChild as Pn, SaveRecoveryCheckpointRequest as Pr, ChildSettledOutcome as Pt, RepairReadiness as Q, toolApprovalDecisionRecordId as Qi, DurableApprovalResolver as Qn, ThreadRunInputRequest as Qr, ParentLinkage as Qt, EnsureWaitingForChild as R, runCompletionDigest as Ri, settlementFailureFromRecord as Rn, ThreadExport as Rr, DEFAULT_OWNERSHIP_LEASE_DURATION as Rt, recoveryDecisionMeaning as S, AgentRegistration as Sa, agentUpdateRecordId as Si, SubmissionLookupByKey as Sn, recoveryRepairBatchId as Sr, ApprovalDecisionCommand as St, ApplyInput as T, DurableWorkerBinding as Ta, childThreadIdFor as Ti, SubmissionWorkItem as Tn, threadCreatedRecordId as Tr, AttachChildToReservationRequest as Tt, OpenToolCallEvidence as U, runStartedRecordId as Ui, submissionSettlementBatchId as Un, ThreadNotMaterialized as Ur, LedgerError as Ut, NoAction as V, runIdForSubmission as Vi, submissionInputBatchId as Vn, ThreadIdentityRequest as Vr, JoiningClaim as Vt, PendingApprovalEvidence as W, subagentJoinBatchId as Wi, submissionSettlementId as Wn, ThreadObservation as Wr, MarkInputAppliedRequest as Wt, RepairInputMarker as X, subagentStartedBatchId as Xi, DurableAgentRuntime_d_exports as Xn, ThreadRecordRequest as Xr, OwnershipSnapshot as Xt, ReleaseOrphanChildReservation as Y, subagentRequestedRecordId as Yi, DurableAgentRuntime as Yn, ThreadReadRequest as Yr, OwnershipRenewal as Yt, RepairJoinMarker as Z, subagentStartedRecordId as Zi, DurableApprovalFailure as Zn, ThreadRecoveryCheckpoints as Zr, OwnershipToken as Zt, RetryCommand as _, workerInputRecordId as _a, RunJournalError as _i, SubmissionLedger as _n, RecoveryReport as _r, AdmissionPolicyError as _t, IntegrityCheck as a, toolCallUnknownRecordId as aa, ThreadTail as ai, ReservedSettlement as an, DurableResolveFailure as ar, SettleAborted as at, obligationSeverityOf as b, AgentRegistration_d_exports as ba, RunJournal_d_exports as bi, SubmissionLookup as bn, childReservationIdFor as br, AdmissionResult as bt, IntegrityReport as c, turnApprovalsBatchId as ca, getRecord as ci, ResolutionNeverHappened as cn, DurableRuntimeConfigOptions as cr, AbortCommand as ct, ObligationReport as d, turnIdForRun as da, readWorkerState as di, Settlement as dn, DurableSubmitOptions as dr, AdmissionAdmitted as dt, toolCallPreparedRecordId as ea, ThreadStore as ei, RecoverySnapshotRequest as en, DurableAwaitFailure as er, ResumeFromTurnBoundary as et, ObligationSeverity as f, turnPreparedBatchId as fa, PendingSubmission as fi, SettlementConflict as fn, DurableVerifyFailure as fr, AdmissionConflict as ft, RecoveryExplanation as g, turnResultsBatchId as ga, JournalBoundary as gi, SubmissionAdmissionFence as gn, RecoveryFailure as gr, AdmissionNotAdmitted as gt, RecoveryDisposition as h, turnResultsBatch as ha, SubmissionStatus_d_exports as hi, SettlementReservationSnapshot as hn, RecoveryBlocked as hr, AdmissionIndeterminate as ht, ExplainedUnknownCall as i, toolCallSettledRecordId as ia, ThreadStore_d_exports as ii, ReservedChildBudget as in, DurableProgressFailure as ir, RevertJoining as it, AwaitHostSettlement as j, definitionDigestsEqual as ja, modelResponseInterruptedRecordId as ji, UnknownResolutionCommand as jn, LoadCheckpointRequest as jr, ChildReservationId as jt, AwaitChildAdmissionResolution as k, compileBindingContracts as ka, markUnknownBatchId as ki, SuspensionSnapshot as kn, FenceRejected as kr, ChildBudgetReservationSnapshot as kt, ObligationBlockedOn as l, turnBatchId as la, getRunInput as li, ResolutionSafeToRetry as ln, DurableSubmitAgent as lr, AbortIntent as lt, RECOVERY_DECISION_MEANINGS as m, turnResponseBatchId as ma, SubmissionStatus as mi, SettlementReservation as mn, DurableWorkerRequirements as mr, AdmissionGroup as mt, ExplainedEvidence as n, toolCallResolvedRecordId as na, ThreadStoreError as ni, ReleaseOwnershipRequest as nn, DurableObligationFailure as nr, ResumeSuspended as nt, IntegrityCheckName as o, toolStepSettledBatchId as oa, ThreadTailRequest as oi, ResolutionAbortSubmission as on, DurableRetryFailure as or, SettleJoinedWithHost as ot, ObligationThresholds as p, turnResponseBatch as pa, SettledSubmission as pi, SettlementFinalization as pn, DurableWorkerFailure as pr, AdmissionFence as pt, RecoveryEvidence as q, subagentLineageRecordId as qi, ApprovalSuspensionError as qn, ThreadPeerCountRequest as qr, MarkUnknownRequest as qt, ExplainedSubmission as r, toolCallResultBatchId as ra, ThreadStoreFailure as ri, RenewOwnershipRequest as rn, DurableObserveOptions as rr, ResumeWaitingParent as rt, IntegrityCheckStatus as s, toolStepSettledRecordId as sa, ThreadWorkerStateRequest as si, ResolutionCompletedWithResult as sn, DurableRuntimeConfig as sr, classifyRecovery as st, Admin_d_exports as t, toolCallResolutionBatchId as ta, ThreadStoreDiagnostic as ti, ReleaseChildBudgetRequest as tn, DurableExplainFailure as tr, ResumePendingToolBatch as tt, ObligationEntry as u, turnCanonicalBatch as ua, readOutstanding as ui, RevertJoiningRequest as un, DurableSubmitFailure as ur, AbortIntentRequest as ut, RetryRefusalReason as v, workerOriginRecordId as va, RunJournalProjection as vi, SubmissionLedgerFailure as vn, RecoverySweepOptions as vr, AdmissionRequest as vt, AppendReservedSettlement as w, DurableBindingFailure as wa, childIdempotencyKeyFor as wi, SubmissionState as wn, threadCreatedBatchId as wr, ApprovalPendingSuspension as wt, predictRecoveryDisposition as x, AgentAttemptContext as xa, TurnCommitInput as xi, SubmissionLookupById as xn, isolateRecovery as xr, ApprovalConflict as xt, RetryRefused as y, workerReportRecordId as ya, RunJournalUsage as yi, SubmissionLedger_d_exports as yn, RecoverySweepResult as yr, AdmissionResolution as yt, FinalizeLedgerFromHistory as z, runDurationBatchId as zi, submissionAbortBatchId as zn, ThreadExportRequest as zr, InputAppliedMarker as zt };
|
|
3199
|
+
//# sourceMappingURL=Admin-CUja0lmO.d.mts.map
|
|
@@ -28,19 +28,19 @@ import { ExplainedEvidence, ExplainedSubmission, ExplainedUnknownCall, Integrity
|
|
|
28
28
|
import { digestJson } from "./durable/Digest.mjs";
|
|
29
29
|
import { a as definitionDigestsEqual, c as resolveWorkerBinding, i as compileRegistrations, l as toolReplayContracts, o as makeLegacyWorkerBinding, s as resolveDefinitionBinding, t as BindingUnavailable } from "./agent-registration-CKNsrpwo.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-BXrq0VIK.mjs";
|
|
31
|
-
import { FencedAppendRequest, LoadCheckpointRequest, MAX_THREAD_EXPORT_RECORDS, SaveRecoveryCheckpointRequest, ThreadCheckpoint, ThreadExportRequest, ThreadMaterialization, ThreadObservation, ThreadRead, ThreadStore, ThreadStoreDiagnostic, ThreadStoreError, ThreadTailRequest, getRecord, getRunInput, readWorkerState } from "./durable/ThreadStore.mjs";
|
|
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";
|
|
33
33
|
import { ScheduledInputRefused, ScheduledInputRetryable } from "./durable/Schedule.mjs";
|
|
34
34
|
import { PreparedInputAdmission } from "./durable/PreparedInputAdmission.mjs";
|
|
35
35
|
import { PreparedInput } from "./durable/Subscription.mjs";
|
|
36
36
|
import { MessageDeliveryDriver, MessageDeliveryFailpoint, MessageDeliveryRecord, MessageDeliveryStore, messageDeliveryCapacity, messageDeliveryUsesCapacity, prepareMessageDelivery } from "./durable/MessageDelivery.mjs";
|
|
37
|
+
import { WakeScheduler } from "./durable/WakeScheduler.mjs";
|
|
37
38
|
import { n as safeUnknownString, t as inspectForeignDiagnostic } from "./foreign-diagnostic-DBQ1XHKh.mjs";
|
|
38
39
|
import { WorkerBudgetAuthorizer, WorkerConcurrencyLimit, WorkerConcurrencyResolver, WorkerHostAuthorizer, WorkerHostConfig, WorkerPolicyResolver } from "./durable/WorkerHost.mjs";
|
|
39
40
|
import { OperationAuthorizationRequest, OperationAuthorizer, OperationDenied } from "./durable/OperationAuthorizer.mjs";
|
|
40
41
|
import { PendingSubmission, SettledSubmission } from "./durable/SubmissionStatus.mjs";
|
|
41
42
|
import { verifyThreadInvariants } from "./durable/ThreadInvariants.mjs";
|
|
42
43
|
import { PreparedToolCallEvidence, ToolReconciler } from "./durable/ToolReconciler.mjs";
|
|
43
|
-
import { WakeScheduler } from "./durable/WakeScheduler.mjs";
|
|
44
44
|
import { Prompt } from "effect/unstable/ai";
|
|
45
45
|
import { Cause, Clock, Context, Crypto, DateTime, Deferred, Duration, Effect, Equal, Exit, Layer, Option, Ref, Result, Schedule, Schema, Semaphore, Stream } from "effect";
|
|
46
46
|
//#region src/durable/internal/journal-checkpoint.ts
|
|
@@ -119,6 +119,7 @@ const rejected = (reason) => UpdateError.make({ reason });
|
|
|
119
119
|
const makeAgentUpdateRuntime = Effect.fn("AgentUpdates.makeDurable")(function* (options) {
|
|
120
120
|
const store = yield* ThreadStore;
|
|
121
121
|
const workers = yield* WorkerRuntime;
|
|
122
|
+
const wake = yield* WakeScheduler;
|
|
122
123
|
const deliveries = yield* Effect.serviceOption(MessageDeliveryStore);
|
|
123
124
|
const crypto = yield* Crypto.Crypto;
|
|
124
125
|
const failpoint = yield* DurableRuntimeFailpoint;
|
|
@@ -238,6 +239,7 @@ const makeAgentUpdateRuntime = Effect.fn("AgentUpdates.makeDurable")(function* (
|
|
|
238
239
|
})
|
|
239
240
|
})).pipe(Effect.as(true), Effect.catchTag("AppendConflict", () => Effect.succeed(false)), Effect.mapError(storage)))) continue;
|
|
240
241
|
yield* failpoint.hit("update:after-canonical-append");
|
|
242
|
+
yield* wake.notify(request.submission.threadId);
|
|
241
243
|
yield* insert(payload);
|
|
242
244
|
return update;
|
|
243
245
|
}
|
|
@@ -726,21 +728,7 @@ const makeWorkerRuntime = Effect.fn("WorkerHost.make")(function* (options) {
|
|
|
726
728
|
if (origin.worker.threadId === previous.origin.worker.threadId || origin.lifecycle !== "assignment" || !samePolicy(origin.policy, previous.origin.policy) || !Schema.toEquivalence(WorkerOrigin.fields.budget)(origin.budget, previous.origin.budget) || !Schema.toEquivalence(SubagentGrant)(origin.grant, previous.origin.grant) || origin.budgetScope !== previous.origin.budgetScope || origin.depth !== previous.origin.depth || origin.toolCallAllowance !== previous.origin.toolCallAllowance || origin.expiresAtMillis > previous.origin.expiresAtMillis) return yield* failure("start", "denied");
|
|
727
729
|
});
|
|
728
730
|
const readIdentity = Effect.fn("WorkerHost.readIdentity")(function* (threadId, operation) {
|
|
729
|
-
|
|
730
|
-
const first = yield* deps.store.read(ThreadRead.make({
|
|
731
|
-
threadId,
|
|
732
|
-
limit: 1
|
|
733
|
-
})).pipe(Stream.runCollect, Effect.mapError(storageFailure(operation)));
|
|
734
|
-
const worker = yield* exactRecord(threadId, workerOriginRecordId(threadId), operation);
|
|
735
|
-
const attached = yield* exactRecord(threadId, subagentLineageRecordId(threadId), operation);
|
|
736
|
-
return {
|
|
737
|
-
...tail,
|
|
738
|
-
records: [
|
|
739
|
-
...first,
|
|
740
|
-
...Option.toArray(worker),
|
|
741
|
-
...Option.toArray(attached)
|
|
742
|
-
]
|
|
743
|
-
};
|
|
731
|
+
return yield* deps.store.readIdentity(ThreadIdentityRequest.make({ threadId })).pipe(Effect.mapError(storageFailure(operation)));
|
|
744
732
|
});
|
|
745
733
|
const readWorkerState$1 = Effect.fn("WorkerHost.readWorkerState")(function* (threadId, operation, sourceSubmissionId) {
|
|
746
734
|
return yield* readWorkerState({
|
|
@@ -752,12 +740,16 @@ const makeWorkerRuntime = Effect.fn("WorkerHost.make")(function* (options) {
|
|
|
752
740
|
const hit = (location, operation) => deps.failpoint.hit(location).pipe(Effect.mapError(storageFailure(operation)));
|
|
753
741
|
const append = Effect.fn("WorkerHost.append")(function* (threadId, id, payload, current, phase, acknowledgements = []) {
|
|
754
742
|
const operation = "start";
|
|
755
|
-
|
|
756
|
-
if (
|
|
743
|
+
let producerEpoch = current.producerEpoch;
|
|
744
|
+
if (producerEpoch === void 0) {
|
|
745
|
+
const tail = yield* deps.store.inspectTail(ThreadTailRequest.make({ threadId }));
|
|
746
|
+
if (tail.tailSequence !== current.tailSequence || tail.tailDigest !== current.tailDigest) return false;
|
|
747
|
+
producerEpoch = tail.producerEpoch;
|
|
748
|
+
}
|
|
757
749
|
yield* hit(`worker:before-${phase}-append`, operation);
|
|
758
750
|
const result = yield* deps.store.append(FencedAppendRequest.make({
|
|
759
751
|
threadId,
|
|
760
|
-
producerEpoch
|
|
752
|
+
producerEpoch,
|
|
761
753
|
expectedTailSequence: current.tailSequence,
|
|
762
754
|
expectedTailDigest: current.tailDigest,
|
|
763
755
|
batch: CanonicalBatch.make({
|
|
@@ -7132,4 +7124,4 @@ var DurableAgentRuntime = class DurableAgentRuntime extends Context.Service()("@
|
|
|
7132
7124
|
//#endregion
|
|
7133
7125
|
export { DurableApprovalSuspension as a, RecoveryFailure as c, childReservationIdFor as d, isolateRecovery as f, threadCreatedRecordId as g, threadCreatedBatchId as h, 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 };
|
|
7134
7126
|
|
|
7135
|
-
//# sourceMappingURL=DurableAgentRuntime-
|
|
7127
|
+
//# sourceMappingURL=DurableAgentRuntime-DH2baLGe.mjs.map
|