effect-agent 0.1.0-beta.161 → 0.1.0-beta.162
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-Dirux8PR.d.mts → Admin-Vhz6NdaH.d.mts} +10 -2
- package/dist/{EventSource-DOXB0RJR.d.mts → EventSource-CtS0RBM7.d.mts} +2 -2
- package/dist/{PreparedInputAdmission-B7r401xJ.d.mts → PreparedInputAdmission-CS_zlCvD.d.mts} +3 -3
- package/dist/{Subscription-B3ScCBaN.d.mts → Subscription-nbSNY6Hs.d.mts} +2 -2
- package/dist/{SubscriptionInput-BP5WVsX_.d.mts → SubscriptionInput-DbXnOMS2.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/EventSource.d.mts +1 -1
- package/dist/durable/GitHubWorkflowSource.d.mts +3 -3
- package/dist/durable/LifecyclePublication.d.mts +1 -1
- package/dist/durable/LifecyclePublication.mjs +25 -16
- package/dist/durable/LifecyclePublication.mjs.map +1 -1
- package/dist/durable/MessageDelivery.d.mts +3 -3
- 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/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 +1 -1
- package/dist/durable/ThreadStoreConformance.d.mts +1 -1
- package/dist/durable/WorkerAdmission.d.mts +1 -1
- package/dist/durable/WorkerHost.d.mts +1 -1
- package/dist/index.d.mts +5 -5
- package/package.json +1 -1
- package/src/durable/LifecyclePublication.ts +52 -29
|
@@ -1511,6 +1511,12 @@ interface LifecyclePublicationStorage {
|
|
|
1511
1511
|
}) => Effect.Effect<ReadonlyArray<LifecyclePublicationBatch>, LifecyclePublicationError>;
|
|
1512
1512
|
/** Atomically acknowledge the exact batch, retaining its identities and fingerprints. */
|
|
1513
1513
|
readonly acknowledge: (publications: LifecyclePublicationBatch) => Effect.Effect<void, LifecyclePublicationError>;
|
|
1514
|
+
/** Optional atomic acknowledgement of up to 100 successfully published owner batches.
|
|
1515
|
+
* Validate every exact batch before consuming any debt. Empty waves succeed without writes.
|
|
1516
|
+
* Wrappers that validate acknowledgement authority must wrap this method too.
|
|
1517
|
+
* Custom services may omit this; drains then acknowledge each batch immediately.
|
|
1518
|
+
*/
|
|
1519
|
+
readonly acknowledgeMany?: (batches: ReadonlyArray<LifecyclePublicationBatch>) => Effect.Effect<void, LifecyclePublicationError>;
|
|
1514
1520
|
/**
|
|
1515
1521
|
* Claim a due owner batch and persist its retry before dispatch. Eight automatic attempts;
|
|
1516
1522
|
* 1s exponential backoff capped at 60s, after the dispatch timeout. The final attempt parks
|
|
@@ -1547,7 +1553,9 @@ declare const lifecyclePublicationLayer: Layer.Layer<never, never, Crypto.Crypto
|
|
|
1547
1553
|
* One finite wave for the host's existing maintenance coordinator. Persist the next deadline
|
|
1548
1554
|
* before dispatch, so interruption and process loss retain the same facts without another timer.
|
|
1549
1555
|
* Finish independent owner batches before surfacing failures; interruption stops the wave.
|
|
1550
|
-
* Acknowledgements are exact and idempotent.
|
|
1556
|
+
* Acknowledgements are exact and idempotent. An optional storage wave acknowledgement commits
|
|
1557
|
+
* completed batches in groups of up to 100, including when a later dispatch is interrupted. No producer or
|
|
1558
|
+
* external Tool is re-executed here.
|
|
1551
1559
|
*/
|
|
1552
1560
|
declare const drainLifecyclePublications: (storage: LifecyclePublicationStorage, timeoutMillis?: any, limit?: any, options?: {
|
|
1553
1561
|
readonly retainedOnly?: boolean;
|
|
@@ -4267,4 +4275,4 @@ declare const RetryRefused_base: Schema.Class<RetryRefused, Schema.TaggedStruct<
|
|
|
4267
4275
|
declare class RetryRefused extends RetryRefused_base {}
|
|
4268
4276
|
//#endregion
|
|
4269
4277
|
export { RepairSubagentStartLink as $, runDurationBatchId as $i, DurableApprovalFailure as $n, ThreadRecoveryCheckpoints as $r, ParentLinkage as $t, AwaitChildSettlement as A, turnResultsBatchId as Aa, JournalBoundary as Ai, SuspensionReason as An, CheckpointRejected as Ar, ChildReservationConflict as At, MarkUnknown as B, DurableBindingFailure as Ba, compactionBatchId as Bi, settlementFailureFromRecord as Bn, ThreadExport as Br, InputAppliedMarker as Bt, renderRecoveryExplanation as C, turnBatchId as Ca, drainLifecyclePublications as Ci, SubmissionLookupByKey as Cn, isolateRecovery as Cr, ApprovalDecisionIntent as Ct, ApplyUnknownResolutions as D, turnResponseBatch as Da, SettledSubmission as Di, SubmissionWorkItem as Dn, threadCreatedRecordId as Dr, ChildAttachmentSnapshot as Dt, ApplyJoinAccounting as E, turnPreparedBatchId as Ea, PendingSubmission as Ei, SubmissionState as En, threadCreatedBatchId as Er, BeginChildBudgetReleaseRequest as Et, CompleteMaterialization as F, AgentAttemptContext as Fa, TurnCommitInput as Fi, UnknownResolutionIntent as Fn, SaveCheckpointRequest as Fr, Claim as Ft, PropagateChildAbort as G, compileBindingContracts as Ga, modelResponseInterruptedRecordId as Gi, submissionSettlementBatchId as Gn, ThreadNotMaterialized as Gr, MarkInputAppliedRequest as Gt, OpenDelegationCallEvidence as H, ExecutableAgentBinding as Ha, firstWorkerInputRecordId as Hi, submissionAbortRecordId as Hn, ThreadIdentity as Hr, JoiningClaim as Ht, DeclaredPendingBatchEvidence as I, AgentRegistration as Ia, agentUpdateRecordId as Ii, WaitingChild as In, SaveRecoveryCheckpointRequest as Ir, ClaimHandoff as It, Recovery_d_exports as J, projectRunJournal as Ji, workerTerminalFromRecord as Jn, ThreadOutstandingRequest as Jr, MarkUnknownRequest as Jt, RecoveryDecision as K, compileRegistrations as Ka, modelResponseRecordId as Ki, submissionSettlementId as Kn, ThreadObservation as Kr, MarkJoinedRequest as Kt, DelegationAdmissionEvidence as L, BindingSelection as La, approvalDecisionBatchId as Li, WaitingForChildSuspension as Ln, SelectedThreadRead as Lr, ClaimJoiningRequest as Lt, AwaitParentEstablishment as M, workerOriginRecordId as Ma, RunJournalProjection as Mi, UnknownResolution as Mn, FencedAppendRequest as Mr, ChildReservationStatus as Mt, AwaitUnknownResolution as N, workerReportRecordId as Na, RunJournalUsage as Ni, UnknownResolutionCommand as Nn, LoadCheckpointRequest as Nr, ChildSettledNotification as Nt, AwaitApprovalDecision as O, turnResponseBatchId as Oa, SubmissionStatus as Oi, SuspendRequest as On, AppendConflict as Or, ChildBudgetReservationRequest as Ot, CompleteChildAdmission as P, AgentRegistration_d_exports as Pa, RunJournal_d_exports as Pi, UnknownResolutionConflict as Pn, MAX_THREAD_EXPORT_RECORDS as Pr, ChildSettledOutcome as Pt, RepairReadiness as Q, runCompletionDigest as Qi, DurableAgentRuntime_d_exports as Qn, ThreadRecordRequest as Qr, OwnershipToken as Qt, EnsureWaitingForChild as R, BindingUnavailable as Ra, childIdempotencyKeyFor as Ri, WorkerLedgerState as Rn, ThreadCheckpoint as Rr, ClaimRequest as Rt, recoveryDecisionMeaning as S, turnApprovalsBatchId as Sa, LifecyclePublication_d_exports as Si, SubmissionLookupById as Sn, childReservationIdFor as Sr, ApprovalDecisionCommand as St, ApplyInput as T, turnIdForRun as Ta, lifecyclePublicationLayer as Ti, SubmissionSnapshot as Tn, recoveryRepairRecordId as Tr, AttachChildToReservationRequest as Tt, OpenToolCallEvidence as U, ReplayVersions as Ua, markUnknownBatchId as Ui, submissionInputBatchId as Un, ThreadIdentityRequest as Ur, LedgerCapabilities as Ut, NoAction as V, DurableWorkerBinding as Va, compactionRecordId as Vi, submissionAbortBatchId as Vn, ThreadExportRequest as Vr, JoinSnapshot as Vt, PendingApprovalEvidence as W, ResolvedBinding as Wa, modelResponseInterruptedBatchId as Wi, submissionInputRecordId as Wn, ThreadMaterialization as Wr, LedgerError as Wt, RepairInputMarker as X, promptFromCanonicalRecords as Xi, DurableAbortFailure as Xn, ThreadRead as Xr, OwnershipRenewal as Xt, ReleaseOrphanChildReservation as Y, projectRunJournalStream as Yi, ApprovalSuspensionError as Yn, ThreadPeerCountRequest as Yr, OwnershipLost as Yt, RepairJoinMarker as Z, runCompletedRecordId as Zi, DurableAgentRuntime as Zn, ThreadReadRequest as Zr, OwnershipSnapshot as Zt, RetryCommand as _, toolCallResultBatchId as _a, LifecyclePublicationError as _i, SubmissionAdmissionFence as _n, RecoveryBlocked as _r, AdmissionPolicyError as _t, IntegrityCheck as a, subagentJoinedRecordId as aa, ThreadStoreFailure as ai, ReservedChildBudget as an, DurableObserveOptions as ar, SettleAborted as at, obligationSeverityOf as b, toolStepSettledBatchId as ba, LifecyclePublicationSource as bi, SubmissionLedger_d_exports as bn, RecoverySweepOptions as br, AdmissionResult as bt, IntegrityReport as c, subagentRequestedBatchId as ca, ThreadTailRequest as ci, ResolutionCompletedWithResult as cn, DurableRetryFailure as cr, AbortCommand as ct, ObligationReport as d, subagentStartedRecordId as da, getRunInput as di, RevertJoiningRequest as dn, DurableSubmitAgent as dr, AdmissionAdmitted as dt, runDurationRecordId as ea, ThreadRunInputRequest as ei, RecoverySnapshot as en, DurableApprovalResolver as er, ResumeFromTurnBoundary as et, ObligationSeverity as f, toolApprovalDecisionRecordId as fa, readOutstanding as fi, Settlement as fn, DurableSubmitFailure as fr, AdmissionConflict as ft, RecoveryExplanation as g, toolCallResolvedRecordId as ga, LifecyclePublicationConfig as gi, SettlementReservationSnapshot as gn, DurableWorkerRequirements as gr, AdmissionNotAdmitted as gt, RecoveryDisposition as h, toolCallResolutionBatchId as ha, LifecyclePublicationBatch as hi, SettlementReservation as hn, DurableWorkerFailure as hr, AdmissionIndeterminate as ht, ExplainedUnknownCall as i, subagentJoinBatchId as ia, ThreadStoreError as ii, RenewOwnershipRequest as in, DurableObligationFailure as ir, RevertJoining as it, AwaitHostSettlement as j, workerInputRecordId as ja, RunJournalError as ji, SuspensionSnapshot as jn, FenceRejected as jr, ChildReservationId as jt, AwaitChildAdmissionResolution as k, turnResultsBatch as ka, SubmissionStatus_d_exports as ki, SuspensionOutcome as kn, AppendResult as kr, ChildBudgetReservationSnapshot as kt, ObligationBlockedOn as l, subagentRequestedRecordId as la, ThreadWorkerStateRequest as li, ResolutionNeverHappened as ln, DurableRuntimeConfig as lr, AbortIntent as lt, RECOVERY_DECISION_MEANINGS as m, toolCallPreparedRecordId as ma, LifecyclePublication as mi, SettlementFinalization as mn, DurableVerifyFailure as mr, AdmissionGroup as mt, ExplainedEvidence as n, runStartedBatchId as na, ThreadStore as ni, ReleaseChildBudgetRequest as nn, DurableAwaitFailure as nr, ResumeSuspended as nt, IntegrityCheckName as o, subagentLineageBatchId as oa, ThreadStore_d_exports as oi, ReservedSettlement as on, DurableProgressFailure as or, SettleJoinedWithHost as ot, ObligationThresholds as p, toolApprovalRequestRecordId as pa, readWorkerState as pi, SettlementConflict as pn, DurableSubmitOptions as pr, AdmissionFence as pt, RecoveryEvidence as q, definitionDigestsEqual as qa, peerMessageRecordId as qi, submissionSettlementRecordId as qn, ThreadOutstanding as qr, MarkReadyRequest as qt, ExplainedSubmission as r, runStartedRecordId as ra, ThreadStoreDiagnostic as ri, ReleaseOwnershipRequest as rn, DurableExplainFailure as rr, ResumeWaitingParent as rt, IntegrityCheckStatus as s, subagentLineageRecordId as sa, ThreadTail as si, ResolutionAbortSubmission as sn, DurableResolveFailure as sr, classifyRecovery as st, Admin_d_exports as t, runIdForSubmission as ta, ThreadSelection as ti, RecoverySnapshotRequest as tn, DurableApprovalSuspension as tr, ResumePendingToolBatch as tt, ObligationEntry as u, subagentStartedBatchId as ua, getRecord as ui, ResolutionSafeToRetry as un, DurableRuntimeConfigOptions as ur, AbortIntentRequest as ut, RetryRefusalReason as v, toolCallSettledRecordId as va, LifecyclePublicationFact as vi, SubmissionLedger as vn, RecoveryFailure as vr, AdmissionRequest as vt, AppendReservedSettlement as w, turnCanonicalBatch as wa, lifecyclePublicationBatchMaxFacts as wi, SubmissionScheduling as wn, recoveryRepairBatchId as wr, ApprovalPendingSuspension as wt, predictRecoveryDisposition as x, toolStepSettledRecordId as xa, LifecyclePublicationStorage as xi, SubmissionLookup as xn, RecoverySweepResult as xr, ApprovalConflict as xt, RetryRefused as y, toolCallUnknownRecordId as ya, LifecyclePublicationHandler as yi, SubmissionLedgerFailure as yn, RecoveryReport as yr, AdmissionResolution as yt, FinalizeLedgerFromHistory as z, CurrentBindingSelection as za, childThreadIdFor as zi, WorkerStopCommand as zn, ThreadCheckpoints as zr, DEFAULT_OWNERSHIP_LEASE_DURATION as zt };
|
|
4270
|
-
//# sourceMappingURL=Admin-
|
|
4278
|
+
//# sourceMappingURL=Admin-Vhz6NdaH.d.mts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { k as PersistedJson } from "./Records-Bm4Qt70a.mjs";
|
|
2
|
-
import { E as SubscriptionSourceError, b as SubscriptionRecord, i as EventSourceVersion, t as AcceptedEvent } from "./Subscription-
|
|
2
|
+
import { E as SubscriptionSourceError, b as SubscriptionRecord, i as EventSourceVersion, t as AcceptedEvent } from "./Subscription-nbSNY6Hs.mjs";
|
|
3
3
|
import { Context, Effect, Schema, Scope } from "effect";
|
|
4
4
|
declare namespace EventSource_d_exports {
|
|
5
5
|
export { EventSource, EventSources, NormalizedEvent, makeEventSource };
|
|
@@ -48,4 +48,4 @@ declare const makeEventSource: <Event extends Schema.Top, Parameters extends Sch
|
|
|
48
48
|
}) => Effect.Effect<EventSource, never, Exclude<R, Scope.Scope> | Exclude<Event["DecodingServices"], Scope.Scope> | Exclude<Event["EncodingServices"], Scope.Scope> | Exclude<Parameters["DecodingServices"], Scope.Scope> | Exclude<Parameters["EncodingServices"], Scope.Scope>>;
|
|
49
49
|
//#endregion
|
|
50
50
|
export { makeEventSource as a, NormalizedEvent as i, EventSource_d_exports as n, EventSources as r, EventSource as t };
|
|
51
|
-
//# sourceMappingURL=EventSource-
|
|
51
|
+
//# sourceMappingURL=EventSource-CtS0RBM7.d.mts.map
|
package/dist/{PreparedInputAdmission-B7r401xJ.d.mts → PreparedInputAdmission-CS_zlCvD.d.mts}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as Receipt } from "./Receipt-BAHyigAF.mjs";
|
|
2
2
|
import { a as FailureDiagnostic_d_exports, r as Diagnostic } from "./FailureDiagnostic-CaAkzGHL.mjs";
|
|
3
|
-
import { Oi as SubmissionStatus } from "./Admin-
|
|
3
|
+
import { Oi as SubmissionStatus } from "./Admin-Vhz6NdaH.mjs";
|
|
4
4
|
import { H as ScheduledInputRefused, V as ScheduledInputFailure, j as ScheduleStorageError } from "./Schedule-Bi_XVKLF.mjs";
|
|
5
|
-
import { a as PreparedInput } from "./Subscription-
|
|
5
|
+
import { a as PreparedInput } from "./Subscription-nbSNY6Hs.mjs";
|
|
6
6
|
import { Context, Effect } from "effect";
|
|
7
7
|
declare namespace PreparedInputAdmission_d_exports {
|
|
8
8
|
export { PreparedInputAdmission, admitPreparedInput };
|
|
@@ -39,4 +39,4 @@ declare const admitPreparedInput: <R>(submit: Effect.Effect<Receipt, ScheduledIn
|
|
|
39
39
|
}, ScheduleStorageError, R>;
|
|
40
40
|
//#endregion
|
|
41
41
|
export { PreparedInputAdmission_d_exports as n, admitPreparedInput as r, PreparedInputAdmission as t };
|
|
42
|
-
//# sourceMappingURL=PreparedInputAdmission-
|
|
42
|
+
//# sourceMappingURL=PreparedInputAdmission-CS_zlCvD.d.mts.map
|
|
@@ -3,7 +3,7 @@ import { a as Receipt, r as Principal } from "./Receipt-BAHyigAF.mjs";
|
|
|
3
3
|
import { r as Update } from "./AgentUpdates-DMJ-_xow.mjs";
|
|
4
4
|
import { t as AgentPolicy } from "./AgentPolicy-B4oH8TbG.mjs";
|
|
5
5
|
import { _ as Digest, h as DefinitionDigests } from "./Records-Bm4Qt70a.mjs";
|
|
6
|
-
import "./Admin-
|
|
6
|
+
import "./Admin-Vhz6NdaH.mjs";
|
|
7
7
|
import { t as ScheduleAuthorizationDecision } from "./Schedule-Bi_XVKLF.mjs";
|
|
8
8
|
import { Context, Effect, Schema } from "effect";
|
|
9
9
|
declare namespace Subscription_d_exports {
|
|
@@ -976,4 +976,4 @@ declare const subscriptionKeyString: (key: SubscriptionKey) => string;
|
|
|
976
976
|
declare const subscriptionDeliveryKeyString: (key: SubscriptionDeliveryKey) => string;
|
|
977
977
|
//#endregion
|
|
978
978
|
export { defaultSubscriptionLimits as A, SubscriptionScanCursors as C, SubscriptionStore as D, SubscriptionSourceError as E, subscriptionKeyString as M, SubscriptionStoreFailure as O, SubscriptionRetentionPolicy as S, SubscriptionSnapshot as T, SubscriptionKey as _, PreparedInput as a, SubscriptionRecord as b, SubscriptionAuthorizer as c, SubscriptionDelivery as d, SubscriptionDeliveryKey as f, SubscriptionFailpointError as g, SubscriptionFailpoint as h, EventSourceVersion as i, subscriptionDeliveryKeyString as j, Subscription_d_exports as k, SubscriptionChange as l, SubscriptionError as m, DeliveryChange as n, SourcePartition as o, SubscriptionDeliverySnapshot as p, EventAcknowledgement as r, SourceRecovery as s, AcceptedEvent as t, SubscriptionConfiguration as u, SubscriptionLimits as v, SubscriptionScope as w, SubscriptionRefusal as x, SubscriptionName as y };
|
|
979
|
-
//# sourceMappingURL=Subscription-
|
|
979
|
+
//# sourceMappingURL=Subscription-nbSNY6Hs.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as AgentId } from "./Identifiers-CN2s30fF.mjs";
|
|
2
2
|
import { h as DefinitionDigests, k as PersistedJson } from "./Records-Bm4Qt70a.mjs";
|
|
3
|
-
import { E as SubscriptionSourceError, b as SubscriptionRecord, i as EventSourceVersion, m as SubscriptionError, t as AcceptedEvent, u as SubscriptionConfiguration } from "./Subscription-
|
|
3
|
+
import { E as SubscriptionSourceError, b as SubscriptionRecord, i as EventSourceVersion, m as SubscriptionError, t as AcceptedEvent, u as SubscriptionConfiguration } from "./Subscription-nbSNY6Hs.mjs";
|
|
4
4
|
import { Context, Effect, Schema, Scope } from "effect";
|
|
5
5
|
declare namespace SubscriptionInput_d_exports {
|
|
6
6
|
export { SubscriptionInputBinding, SubscriptionInputBindings, makeSubscriptionInputBinding, resolveSubscriptionInput };
|
|
@@ -38,4 +38,4 @@ declare const makeSubscriptionInputBinding: <Event extends Schema.Top, Parameter
|
|
|
38
38
|
}) => Effect.Effect<SubscriptionInputBinding, never, Exclude<R, Scope.Scope> | Exclude<Continuation["DecodingServices"], Scope.Scope> | Exclude<Continuation["EncodingServices"], Scope.Scope> | Exclude<Event["DecodingServices"], Scope.Scope> | Exclude<Input["EncodingServices"], Scope.Scope> | Exclude<Parameters["DecodingServices"], Scope.Scope>>;
|
|
39
39
|
//#endregion
|
|
40
40
|
export { resolveSubscriptionInput as a, makeSubscriptionInputBinding as i, SubscriptionInputBindings as n, SubscriptionInput_d_exports as r, SubscriptionInputBinding as t };
|
|
41
|
-
//# sourceMappingURL=SubscriptionInput-
|
|
41
|
+
//# sourceMappingURL=SubscriptionInput-DbXnOMS2.d.mts.map
|
package/dist/durable/Admin.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as renderRecoveryExplanation, S as recoveryDecisionMeaning, _ as RetryCommand, a as IntegrityCheck, b as obligationSeverityOf, c as IntegrityReport, d as ObligationReport, f as ObligationSeverity, g as RecoveryExplanation, h as RecoveryDisposition, i as ExplainedUnknownCall, l as ObligationBlockedOn, m as RECOVERY_DECISION_MEANINGS, n as ExplainedEvidence, o as IntegrityCheckName, p as ObligationThresholds, r as ExplainedSubmission, s as IntegrityCheckStatus, u as ObligationEntry, v as RetryRefusalReason, x as predictRecoveryDisposition, y as RetryRefused } from "../Admin-
|
|
1
|
+
import { C as renderRecoveryExplanation, S as recoveryDecisionMeaning, _ as RetryCommand, a as IntegrityCheck, b as obligationSeverityOf, c as IntegrityReport, d as ObligationReport, f as ObligationSeverity, g as RecoveryExplanation, h as RecoveryDisposition, i as ExplainedUnknownCall, l as ObligationBlockedOn, m as RECOVERY_DECISION_MEANINGS, n as ExplainedEvidence, o as IntegrityCheckName, p as ObligationThresholds, r as ExplainedSubmission, s as IntegrityCheckStatus, u as ObligationEntry, v as RetryRefusalReason, x as predictRecoveryDisposition, y as RetryRefused } from "../Admin-Vhz6NdaH.mjs";
|
|
2
2
|
export { ExplainedEvidence, ExplainedSubmission, ExplainedUnknownCall, IntegrityCheck, IntegrityCheckName, IntegrityCheckStatus, IntegrityReport, ObligationBlockedOn, ObligationEntry, ObligationReport, ObligationSeverity, ObligationThresholds, RECOVERY_DECISION_MEANINGS, RecoveryDisposition, RecoveryExplanation, RetryCommand, RetryRefusalReason, RetryRefused, obligationSeverityOf, predictRecoveryDisposition, recoveryDecisionMeaning, renderRecoveryExplanation };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Ba as DurableBindingFailure, Fa as AgentAttemptContext, Ga as compileBindingContracts, Ha as ExecutableAgentBinding, Ia as AgentRegistration, Ka as compileRegistrations, La as BindingSelection, Ra as BindingUnavailable, Ua as ReplayVersions, Va as DurableWorkerBinding, Wa as ResolvedBinding, qa as definitionDigestsEqual, za as CurrentBindingSelection } from "../Admin-
|
|
1
|
+
import { Ba as DurableBindingFailure, Fa as AgentAttemptContext, Ga as compileBindingContracts, Ha as ExecutableAgentBinding, Ia as AgentRegistration, Ka as compileRegistrations, La as BindingSelection, Ra as BindingUnavailable, Ua as ReplayVersions, Va as DurableWorkerBinding, Wa as ResolvedBinding, qa as definitionDigestsEqual, za as CurrentBindingSelection } from "../Admin-Vhz6NdaH.mjs";
|
|
2
2
|
export { type AgentAttemptContext, type AgentRegistration, type BindingSelection, BindingUnavailable, CurrentBindingSelection, type DurableBindingFailure, DurableWorkerBinding, type ExecutableAgentBinding, type ReplayVersions, type ResolvedBinding, compileBindingContracts, compileRegistrations, definitionDigestsEqual };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ni as ThreadStore, vn as SubmissionLedger } from "../Admin-
|
|
1
|
+
import { ni as ThreadStore, vn as SubmissionLedger } from "../Admin-Vhz6NdaH.mjs";
|
|
2
2
|
import { Crypto, Effect, Schema } from "effect";
|
|
3
3
|
//#region src/durable/Certification.d.ts
|
|
4
4
|
declare const CertifiedAdapterIdentity_base: Schema.Class<CertifiedAdapterIdentity, Schema.Struct<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { k as PersistedJson, l as CanonicalRecordEnvelope } from "../Records-Bm4Qt70a.mjs";
|
|
2
2
|
import { ActivityProcessorKey, ActivityProcessorStore, ActivityStoreFailure, PreparedActivity } from "./ActivityStore.mjs";
|
|
3
3
|
import { t as DigestError } from "../Digest-COAt3Orl.mjs";
|
|
4
|
-
import { Gr as ThreadNotMaterialized, ii as ThreadStoreError, ni as ThreadStore } from "../Admin-
|
|
4
|
+
import { Gr as ThreadNotMaterialized, ii as ThreadStoreError, ni as ThreadStore } from "../Admin-Vhz6NdaH.mjs";
|
|
5
5
|
import { Crypto, Effect, Schema, Scope } from "effect";
|
|
6
6
|
declare namespace CommittedActivity_d_exports {
|
|
7
7
|
export { ActivityPassLimits, ActivityPassResult, ActivityProcessingError, CommittedActivityProcessor, activityWorkId, processCommittedActivity };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as Receipt } from "../Receipt-BAHyigAF.mjs";
|
|
2
|
-
import { $n as DurableApprovalFailure, Cr as isolateRecovery, Dr as threadCreatedRecordId, Er as threadCreatedBatchId, Sr as childReservationIdFor, Tr as recoveryRepairRecordId, Xn as DurableAbortFailure, Yn as ApprovalSuspensionError, Zn as DurableAgentRuntime, _r as RecoveryBlocked, ar as DurableObserveOptions, br as RecoverySweepOptions, cr as DurableRetryFailure, dr as DurableSubmitAgent, er as DurableApprovalResolver, fr as DurableSubmitFailure, gr as DurableWorkerRequirements, hr as DurableWorkerFailure, ir as DurableObligationFailure, lr as DurableRuntimeConfig, mr as DurableVerifyFailure, nr as DurableAwaitFailure, or as DurableProgressFailure, pr as DurableSubmitOptions, rr as DurableExplainFailure, sr as DurableResolveFailure, tr as DurableApprovalSuspension, ur as DurableRuntimeConfigOptions, vr as RecoveryFailure, wr as recoveryRepairBatchId, xr as RecoverySweepResult, yr as RecoveryReport } from "../Admin-
|
|
2
|
+
import { $n as DurableApprovalFailure, Cr as isolateRecovery, Dr as threadCreatedRecordId, Er as threadCreatedBatchId, Sr as childReservationIdFor, Tr as recoveryRepairRecordId, Xn as DurableAbortFailure, Yn as ApprovalSuspensionError, Zn as DurableAgentRuntime, _r as RecoveryBlocked, ar as DurableObserveOptions, br as RecoverySweepOptions, cr as DurableRetryFailure, dr as DurableSubmitAgent, er as DurableApprovalResolver, fr as DurableSubmitFailure, gr as DurableWorkerRequirements, hr as DurableWorkerFailure, ir as DurableObligationFailure, lr as DurableRuntimeConfig, mr as DurableVerifyFailure, nr as DurableAwaitFailure, or as DurableProgressFailure, pr as DurableSubmitOptions, rr as DurableExplainFailure, sr as DurableResolveFailure, tr as DurableApprovalSuspension, ur as DurableRuntimeConfigOptions, vr as RecoveryFailure, wr as recoveryRepairBatchId, xr as RecoverySweepResult, yr as RecoveryReport } from "../Admin-Vhz6NdaH.mjs";
|
|
3
3
|
export { ApprovalSuspensionError, DurableAbortFailure, DurableAgentRuntime, DurableApprovalFailure, DurableApprovalResolver, DurableApprovalSuspension, DurableAwaitFailure, DurableExplainFailure, DurableObligationFailure, DurableObserveOptions, DurableProgressFailure, DurableResolveFailure, DurableRetryFailure, DurableRuntimeConfig, DurableRuntimeConfigOptions, DurableSubmitAgent, DurableSubmitFailure, DurableSubmitOptions, DurableVerifyFailure, DurableWorkerFailure, DurableWorkerRequirements, Receipt, RecoveryBlocked, RecoveryFailure, RecoveryReport, RecoverySweepOptions, RecoverySweepResult, childReservationIdFor, isolateRecovery, recoveryRepairBatchId, recoveryRepairRecordId, threadCreatedBatchId, threadCreatedRecordId };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as makeEventSource, i as NormalizedEvent, r as EventSources, t as EventSource } from "../EventSource-
|
|
1
|
+
import { a as makeEventSource, i as NormalizedEvent, r as EventSources, t as EventSource } from "../EventSource-CtS0RBM7.mjs";
|
|
2
2
|
export { EventSource, EventSources, NormalizedEvent, makeEventSource };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as Principal } from "../Receipt-BAHyigAF.mjs";
|
|
2
|
-
import "../Admin-
|
|
3
|
-
import { E as SubscriptionSourceError } from "../Subscription-
|
|
4
|
-
import { t as EventSource } from "../EventSource-
|
|
2
|
+
import "../Admin-Vhz6NdaH.mjs";
|
|
3
|
+
import { E as SubscriptionSourceError } from "../Subscription-nbSNY6Hs.mjs";
|
|
4
|
+
import { t as EventSource } from "../EventSource-CtS0RBM7.mjs";
|
|
5
5
|
import { SubscriptionFailure, SubscriptionIntake } from "./Subscriptions.mjs";
|
|
6
6
|
import { Context, Effect, Layer, Redacted, Schema } from "effect";
|
|
7
7
|
import { HttpClient } from "effect/unstable/http";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Ci as drainLifecyclePublications, Ti as lifecyclePublicationLayer, _i as LifecyclePublicationError, bi as LifecyclePublicationSource, gi as LifecyclePublicationConfig, hi as LifecyclePublicationBatch, mi as LifecyclePublication, vi as LifecyclePublicationFact, wi as lifecyclePublicationBatchMaxFacts, xi as LifecyclePublicationStorage, yi as LifecyclePublicationHandler } from "../Admin-
|
|
1
|
+
import { Ci as drainLifecyclePublications, Ti as lifecyclePublicationLayer, _i as LifecyclePublicationError, bi as LifecyclePublicationSource, gi as LifecyclePublicationConfig, hi as LifecyclePublicationBatch, mi as LifecyclePublication, vi as LifecyclePublicationFact, wi as lifecyclePublicationBatchMaxFacts, xi as LifecyclePublicationStorage, yi as LifecyclePublicationHandler } from "../Admin-Vhz6NdaH.mjs";
|
|
2
2
|
export { LifecyclePublication, LifecyclePublicationBatch, LifecyclePublicationConfig, LifecyclePublicationError, LifecyclePublicationFact, LifecyclePublicationHandler, LifecyclePublicationSource, LifecyclePublicationStorage, drainLifecyclePublications, lifecyclePublicationBatchMaxFacts, lifecyclePublicationLayer };
|
|
@@ -160,28 +160,37 @@ const withSource = Effect.fn("LifecyclePublication.withSource")(function* (publi
|
|
|
160
160
|
* One finite wave for the host's existing maintenance coordinator. Persist the next deadline
|
|
161
161
|
* before dispatch, so interruption and process loss retain the same facts without another timer.
|
|
162
162
|
* Finish independent owner batches before surfacing failures; interruption stops the wave.
|
|
163
|
-
* Acknowledgements are exact and idempotent.
|
|
163
|
+
* Acknowledgements are exact and idempotent. An optional storage wave acknowledgement commits
|
|
164
|
+
* completed batches in groups of up to 100, including when a later dispatch is interrupted. No producer or
|
|
165
|
+
* external Tool is re-executed here.
|
|
164
166
|
*/
|
|
165
167
|
const drainLifecyclePublications = Effect.fn("LifecyclePublication.drain")(function* (storage, timeoutMillis = 1e4, limit = 4, options) {
|
|
166
168
|
const handler = yield* LifecyclePublicationHandler;
|
|
167
169
|
const pending = yield* storage.pending(yield* Clock.currentTimeMillis, limit, options);
|
|
170
|
+
const acknowledgeMany = storage.acknowledgeMany;
|
|
171
|
+
const published = [];
|
|
168
172
|
let failures = Cause.empty;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
return yield* Effect.gen(function* () {
|
|
174
|
+
for (const batch of pending) yield* Effect.gen(function* () {
|
|
175
|
+
if (!(yield* storage.claim(batch, yield* Clock.currentTimeMillis, timeoutMillis))) return;
|
|
176
|
+
yield* Effect.scoped(Effect.gen(function* () {
|
|
177
|
+
const publications = yield* Effect.forEach(batch, withSource);
|
|
178
|
+
yield* handler.publish(publications);
|
|
179
|
+
})).pipe(Effect.timeoutOrElse({
|
|
180
|
+
duration: timeoutMillis,
|
|
181
|
+
orElse: () => LifecyclePublicationError.make({ reason: "unavailable" })
|
|
182
|
+
}));
|
|
183
|
+
if (acknowledgeMany === void 0) yield* storage.acknowledge(batch);
|
|
184
|
+
else published.push(batch);
|
|
185
|
+
}).pipe(Effect.catchCauseIf((cause) => !Cause.hasInterrupts(cause), (cause) => {
|
|
186
|
+
failures = Cause.combine(failures, cause);
|
|
187
|
+
return Effect.void;
|
|
177
188
|
}));
|
|
178
|
-
yield*
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}));
|
|
183
|
-
if (failures.reasons.length > 0) return yield* Effect.failCause(failures);
|
|
184
|
-
return pending.length;
|
|
189
|
+
if (failures.reasons.length > 0) return yield* Effect.failCause(failures);
|
|
190
|
+
return pending.length;
|
|
191
|
+
}).pipe(Effect.onExit(() => acknowledgeMany === void 0 || published.length === 0 ? Effect.void : Effect.gen(function* () {
|
|
192
|
+
for (let offset = 0; offset < published.length; offset += 100) yield* acknowledgeMany(published.slice(offset, offset + 100));
|
|
193
|
+
})));
|
|
185
194
|
});
|
|
186
195
|
//#endregion
|
|
187
196
|
export { LifecyclePublication, LifecyclePublicationBatch, LifecyclePublicationConfig, LifecyclePublicationError, LifecyclePublicationFact, LifecyclePublicationHandler, LifecyclePublicationSource, drainLifecyclePublications, lifecyclePublicationBatchMaxFacts, lifecyclePublicationLayer, LifecyclePublication_exports as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LifecyclePublication.mjs","names":[],"sources":["../../src/durable/LifecyclePublication.ts"],"sourcesContent":["import { Cause, Clock, Context, Crypto, Effect, Layer, Option, Schema, type Scope } from \"effect\";\n\nimport { SubmissionId, ThreadId } from \"../core/Identifiers.ts\";\nimport { Receipt } from \"../core/Receipt.ts\";\nimport { AssignmentTerminal } from \"../core/Worker.ts\";\nimport { MessageDeliveryKey } from \"./MessageDelivery.ts\";\nimport {\n AbortRequested,\n AgentUpdateEmitted,\n CanonicalSequence,\n RunStartedRecord,\n SubagentJoined,\n SubagentRequested,\n SubagentStarted,\n SubmissionSettledRecord,\n ToolApprovalDecided,\n ToolApprovalRequested,\n UserInputRecorded,\n WorkerInputCompleted,\n WorkerInputRequested,\n WorkerStopRequested,\n} from \"./Records.ts\";\nimport {\n AbortIntent,\n Settlement,\n SubmissionLedger,\n SubmissionLookupById,\n SubmissionSnapshot,\n SuspensionReason,\n} from \"./SubmissionLedger.ts\";\nimport { PreparedInput } from \"./Subscription.ts\";\nimport { getRunInput } from \"./ThreadStore.ts\";\n\n/** Immutable native admission evidence. It is private and grants no application authority. */\nexport const LifecyclePublicationSource = SubmissionSnapshot.mapFields((fields) => ({\n submissionId: fields.submissionId,\n threadId: fields.threadId,\n queueSequence: fields.queueSequence,\n principal: fields.principal,\n idempotencyKey: fields.idempotencyKey,\n agentId: fields.agentId,\n agentDigests: fields.agentDigests,\n inputPayload: fields.inputPayload,\n inputDigest: fields.inputDigest,\n receiptId: fields.receiptId,\n parentLinkage: fields.parentLinkage,\n workerAdmission: fields.workerAdmission,\n messageAdmission: fields.messageAdmission,\n createdAt: fields.createdAt,\n}));\n\nexport type LifecyclePublicationSource = typeof LifecyclePublicationSource.Type;\n\n/** Closed producer facts; model history, Tool payloads and diagnostics are not a publication API. */\nexport const LifecyclePublicationFact = Schema.Union([\n Schema.TaggedStruct(\"DeliveryRetained\", {\n key: MessageDeliveryKey,\n envelope: PreparedInput,\n createdAtMillis: Schema.Natural,\n }),\n Schema.TaggedStruct(\"DeliveryChanged\", {\n key: MessageDeliveryKey,\n envelope: PreparedInput,\n status: Schema.Literals([\"pending\", \"accepted\", \"processed\", \"refused\", \"parked\"]),\n receipt: Schema.NullOr(Receipt),\n settlement: Schema.NullOr(Settlement),\n version: Schema.Natural,\n }),\n Schema.TaggedStruct(\"WorkerInboxSealed\", {\n threadId: ThreadId,\n activeSubmissionIds: Schema.Array(SubmissionId),\n /** First native seal winner; null is an explicit stop rather than assignment completion. */\n terminal: Schema.NullOr(AssignmentTerminal),\n }),\n Schema.TaggedStruct(\"SubmissionReady\", { submissionId: SubmissionId }),\n Schema.TaggedStruct(\"SubmissionSuspended\", {\n submissionId: SubmissionId,\n reason: SuspensionReason,\n }),\n Schema.TaggedStruct(\"SubmissionUnknown\", { submissionId: SubmissionId }),\n Schema.TaggedStruct(\"SubmissionResumed\", { submissionId: SubmissionId }),\n Schema.TaggedStruct(\"AbortIntentRecorded\", { intent: AbortIntent }),\n UserInputRecorded,\n RunStartedRecord,\n AgentUpdateEmitted,\n ToolApprovalRequested,\n ToolApprovalDecided,\n AbortRequested,\n WorkerInputCompleted,\n WorkerInputRequested,\n WorkerStopRequested,\n SubagentRequested,\n SubagentStarted,\n SubagentJoined,\n SubmissionSettledRecord,\n]);\n\nexport type LifecyclePublicationFact = typeof LifecyclePublicationFact.Type;\n\n/**\n * An exact undelivered native fact. `id` is stable across retries and lost acknowledgements.\n * Ordinals order facts only within ownerThreadId. Accepted input order is source.queueSequence;\n * never compare ordinals from the launching Thread and its worker Thread.\n */\nexport class LifecyclePublication extends Schema.Class<LifecyclePublication>(\n \"@effect-agent/thread/LifecyclePublication\",\n)({\n id: Schema.NonEmptyString.check(Schema.isMaxLength(4096)),\n ownerThreadId: ThreadId,\n ordinal: Schema.Int.check(Schema.isGreaterThan(0)),\n createdAt: Schema.DateTimeUtcFromString,\n canonicalSequence: Schema.optionalKey(CanonicalSequence),\n source: Schema.optionalKey(LifecyclePublicationSource),\n fact: LifecyclePublicationFact,\n}) {}\n\nexport class LifecyclePublicationError extends Schema.TaggedError<LifecyclePublicationError>()(\n \"LifecyclePublicationError\",\n {\n reason: Schema.Literals([\"unavailable\", \"conflict\", \"corrupt\", \"capacity\"]),\n cause: Schema.optionalKey(Schema.Defect()),\n },\n) {}\n\n/** Bound both retained facts and the immutable admission evidence resolved before dispatch. */\nexport const lifecyclePublicationBatchMaxFacts = 8;\n\n/** One owner's bounded pending prefix, strictly ordered by its durable ordinals. */\nexport const LifecyclePublicationBatch = Schema.NonEmptyArray(LifecyclePublication).check(\n Schema.isMaxLength(lifecyclePublicationBatchMaxFacts),\n Schema.makeFilter(\n (facts) =>\n facts.every((fact, index) => {\n const previous = facts[index - 1];\n\n return (\n fact.ownerThreadId === facts[0].ownerThreadId &&\n (previous === undefined || fact.ordinal > previous.ordinal)\n );\n }),\n { expected: \"One owner with strictly increasing publication ordinals\" },\n ),\n);\n\nexport type LifecyclePublicationBatch = typeof LifecyclePublicationBatch.Type;\n\n/** Native recovery state, independent of Attempts. Hosts serialize drains per storage owner. */\nexport interface LifecyclePublicationStorage {\n /** Select up to `limit` due owners, with a bounded pending prefix for each selected owner.\n * `retainedOnly` excludes unmaterialized source facts, for a precommitted start prefix.\n */\n readonly pending: (\n nowMillis: number,\n limit: number,\n options?: { readonly retainedOnly?: boolean },\n ) => Effect.Effect<ReadonlyArray<LifecyclePublicationBatch>, LifecyclePublicationError>;\n /** Atomically acknowledge the exact batch, retaining its identities and fingerprints. */\n readonly acknowledge: (\n publications: LifecyclePublicationBatch,\n ) => Effect.Effect<void, LifecyclePublicationError>;\n /**\n * Claim a due owner batch and persist its retry before dispatch. Eight automatic attempts;\n * 1s exponential backoff capped at 60s, after the dispatch timeout. The final attempt parks\n * the payload before dispatch so process loss cannot renew its budget. False means not due.\n */\n readonly claim: (\n publications: LifecyclePublicationBatch,\n nowMillis: number,\n timeoutMillis: number,\n ) => Effect.Effect<boolean, LifecyclePublicationError>;\n readonly pendingDeadline: Effect.Effect<Option.Option<number>, LifecyclePublicationError>;\n /**\n * Deadline for `pending(..., { retainedOnly: true })`, excluding unmaterialized source facts.\n * Source-backed stores provide this when `pendingDeadline` also includes source intent.\n * Otherwise `pendingDeadline` already describes retained work.\n */\n readonly retainedPendingDeadline?: Effect.Effect<\n Option.Option<number>,\n LifecyclePublicationError\n >;\n /** Explicit operator retry after repairing a parked owner's destination. */\n readonly retryParked: (\n ownerThreadId: ThreadId,\n nowMillis: number,\n ) => Effect.Effect<void, LifecyclePublicationError>;\n}\n\n/**\n * Publish one owner's ordered batch in one idempotent host transaction, including authorization,\n * records, receipts and delivery intents. Larger backlogs continue in later batches.\n * Return only after the entire batch commits. Retries\n * may include already committed identities plus later facts; deduplicate each fact's `id`.\n * Private input/update/result fields remain private; select declared public fields explicitly.\n * Revocation/deletion is an acknowledged domain decision, not an infrastructure retry.\n */\nexport class LifecyclePublicationHandler extends Context.Service<\n LifecyclePublicationHandler,\n {\n readonly publish: (\n publications: LifecyclePublicationBatch,\n ) => Effect.Effect<void, LifecyclePublicationError, Scope.Scope>;\n }\n>()(\"@effect-agent/thread/LifecyclePublicationHandler\") {}\n\n/** Adapter configuration; the opt-in layer captures its explicit Crypto requirement once. */\nexport const LifecyclePublicationConfig = Context.Reference<Option.Option<Crypto.Crypto>>(\n \"@effect-agent/thread/LifecyclePublicationConfig\",\n { defaultValue: () => Option.none() },\n);\n\n/** Enable native SQL obligations without changing dependencies of disabled storage assemblies. */\nexport const lifecyclePublicationLayer = Layer.effect(LifecyclePublicationConfig)(\n Effect.map(Crypto.Crypto, Option.some),\n);\n\n/** Resolve immutable evidence by its exact native identity, never by scanning execution history. */\nconst withSource = Effect.fn(\"LifecyclePublication.withSource\")(\n function* (publication: LifecyclePublication) {\n if (\n publication.source !== undefined ||\n (publication.fact._tag === \"WorkerInputCompleted\" &&\n publication.fact.workerThreadId !== publication.ownerThreadId)\n )\n return publication;\n const fact = publication.fact;\n\n let submissionId =\n fact._tag === \"AbortIntentRecorded\"\n ? fact.intent.submissionId\n : \"submissionId\" in fact\n ? fact.submissionId\n : undefined;\n\n const runId =\n fact._tag === \"AgentUpdateEmitted\"\n ? fact.update.runId\n : \"runId\" in fact\n ? fact.runId\n : undefined;\n\n if (submissionId === undefined && runId !== undefined) {\n const input = yield* getRunInput({ threadId: publication.ownerThreadId, runId });\n\n if (Option.isNone(input) || input.value.record.payload._tag !== \"UserInputRecorded\")\n return yield* LifecyclePublicationError.make({ reason: \"unavailable\" });\n submissionId = input.value.record.payload.submissionId;\n }\n if (submissionId === undefined) return publication;\n const ledger = yield* SubmissionLedger;\n const found = yield* ledger.lookup(SubmissionLookupById.make({ submissionId }));\n\n if (Option.isNone(found))\n return yield* LifecyclePublicationError.make({ reason: \"unavailable\" });\n\n const source = yield* Schema.decodeEffect(Schema.toType(LifecyclePublicationSource))(\n found.value,\n );\n\n return LifecyclePublication.make({ ...publication, source });\n },\n Effect.mapError((cause) => LifecyclePublicationError.make({ reason: \"unavailable\", cause })),\n);\n\n/**\n * One finite wave for the host's existing maintenance coordinator. Persist the next deadline\n * before dispatch, so interruption and process loss retain the same facts without another timer.\n * Finish independent owner batches before surfacing failures; interruption stops the wave.\n * Acknowledgements are exact and idempotent. No producer or external Tool is re-executed here.\n */\nexport const drainLifecyclePublications = Effect.fn(\"LifecyclePublication.drain\")(function* (\n storage: LifecyclePublicationStorage,\n timeoutMillis = 10_000,\n limit = 4,\n options?: { readonly retainedOnly?: boolean },\n) {\n const handler = yield* LifecyclePublicationHandler;\n const pending = yield* storage.pending(yield* Clock.currentTimeMillis, limit, options);\n\n let failures: Cause.Cause<LifecyclePublicationError> = Cause.empty;\n\n for (const batch of pending) {\n yield* Effect.gen(function* () {\n if (!(yield* storage.claim(batch, yield* Clock.currentTimeMillis, timeoutMillis))) return;\n yield* Effect.scoped(\n Effect.gen(function* () {\n const publications = yield* Effect.forEach(batch, withSource);\n\n yield* handler.publish(publications);\n }),\n ).pipe(\n Effect.timeoutOrElse({\n duration: timeoutMillis,\n orElse: () => LifecyclePublicationError.make({ reason: \"unavailable\" }),\n }),\n );\n yield* storage.acknowledge(batch);\n }).pipe(\n Effect.catchCauseIf(\n (cause) => !Cause.hasInterrupts(cause),\n (cause) => {\n failures = Cause.combine(failures, cause);\n\n return Effect.void;\n },\n ),\n );\n }\n if (failures.reasons.length > 0) return yield* Effect.failCause(failures);\n\n return pending.length;\n});\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"LifecyclePublication.mjs","names":[],"sources":["../../src/durable/LifecyclePublication.ts"],"sourcesContent":["import { Cause, Clock, Context, Crypto, Effect, Layer, Option, Schema, type Scope } from \"effect\";\n\nimport { SubmissionId, ThreadId } from \"../core/Identifiers.ts\";\nimport { Receipt } from \"../core/Receipt.ts\";\nimport { AssignmentTerminal } from \"../core/Worker.ts\";\nimport { MessageDeliveryKey } from \"./MessageDelivery.ts\";\nimport {\n AbortRequested,\n AgentUpdateEmitted,\n CanonicalSequence,\n RunStartedRecord,\n SubagentJoined,\n SubagentRequested,\n SubagentStarted,\n SubmissionSettledRecord,\n ToolApprovalDecided,\n ToolApprovalRequested,\n UserInputRecorded,\n WorkerInputCompleted,\n WorkerInputRequested,\n WorkerStopRequested,\n} from \"./Records.ts\";\nimport {\n AbortIntent,\n Settlement,\n SubmissionLedger,\n SubmissionLookupById,\n SubmissionSnapshot,\n SuspensionReason,\n} from \"./SubmissionLedger.ts\";\nimport { PreparedInput } from \"./Subscription.ts\";\nimport { getRunInput } from \"./ThreadStore.ts\";\n\n/** Immutable native admission evidence. It is private and grants no application authority. */\nexport const LifecyclePublicationSource = SubmissionSnapshot.mapFields((fields) => ({\n submissionId: fields.submissionId,\n threadId: fields.threadId,\n queueSequence: fields.queueSequence,\n principal: fields.principal,\n idempotencyKey: fields.idempotencyKey,\n agentId: fields.agentId,\n agentDigests: fields.agentDigests,\n inputPayload: fields.inputPayload,\n inputDigest: fields.inputDigest,\n receiptId: fields.receiptId,\n parentLinkage: fields.parentLinkage,\n workerAdmission: fields.workerAdmission,\n messageAdmission: fields.messageAdmission,\n createdAt: fields.createdAt,\n}));\n\nexport type LifecyclePublicationSource = typeof LifecyclePublicationSource.Type;\n\n/** Closed producer facts; model history, Tool payloads and diagnostics are not a publication API. */\nexport const LifecyclePublicationFact = Schema.Union([\n Schema.TaggedStruct(\"DeliveryRetained\", {\n key: MessageDeliveryKey,\n envelope: PreparedInput,\n createdAtMillis: Schema.Natural,\n }),\n Schema.TaggedStruct(\"DeliveryChanged\", {\n key: MessageDeliveryKey,\n envelope: PreparedInput,\n status: Schema.Literals([\"pending\", \"accepted\", \"processed\", \"refused\", \"parked\"]),\n receipt: Schema.NullOr(Receipt),\n settlement: Schema.NullOr(Settlement),\n version: Schema.Natural,\n }),\n Schema.TaggedStruct(\"WorkerInboxSealed\", {\n threadId: ThreadId,\n activeSubmissionIds: Schema.Array(SubmissionId),\n /** First native seal winner; null is an explicit stop rather than assignment completion. */\n terminal: Schema.NullOr(AssignmentTerminal),\n }),\n Schema.TaggedStruct(\"SubmissionReady\", { submissionId: SubmissionId }),\n Schema.TaggedStruct(\"SubmissionSuspended\", {\n submissionId: SubmissionId,\n reason: SuspensionReason,\n }),\n Schema.TaggedStruct(\"SubmissionUnknown\", { submissionId: SubmissionId }),\n Schema.TaggedStruct(\"SubmissionResumed\", { submissionId: SubmissionId }),\n Schema.TaggedStruct(\"AbortIntentRecorded\", { intent: AbortIntent }),\n UserInputRecorded,\n RunStartedRecord,\n AgentUpdateEmitted,\n ToolApprovalRequested,\n ToolApprovalDecided,\n AbortRequested,\n WorkerInputCompleted,\n WorkerInputRequested,\n WorkerStopRequested,\n SubagentRequested,\n SubagentStarted,\n SubagentJoined,\n SubmissionSettledRecord,\n]);\n\nexport type LifecyclePublicationFact = typeof LifecyclePublicationFact.Type;\n\n/**\n * An exact undelivered native fact. `id` is stable across retries and lost acknowledgements.\n * Ordinals order facts only within ownerThreadId. Accepted input order is source.queueSequence;\n * never compare ordinals from the launching Thread and its worker Thread.\n */\nexport class LifecyclePublication extends Schema.Class<LifecyclePublication>(\n \"@effect-agent/thread/LifecyclePublication\",\n)({\n id: Schema.NonEmptyString.check(Schema.isMaxLength(4096)),\n ownerThreadId: ThreadId,\n ordinal: Schema.Int.check(Schema.isGreaterThan(0)),\n createdAt: Schema.DateTimeUtcFromString,\n canonicalSequence: Schema.optionalKey(CanonicalSequence),\n source: Schema.optionalKey(LifecyclePublicationSource),\n fact: LifecyclePublicationFact,\n}) {}\n\nexport class LifecyclePublicationError extends Schema.TaggedError<LifecyclePublicationError>()(\n \"LifecyclePublicationError\",\n {\n reason: Schema.Literals([\"unavailable\", \"conflict\", \"corrupt\", \"capacity\"]),\n cause: Schema.optionalKey(Schema.Defect()),\n },\n) {}\n\n/** Bound both retained facts and the immutable admission evidence resolved before dispatch. */\nexport const lifecyclePublicationBatchMaxFacts = 8;\n\n/** One owner's bounded pending prefix, strictly ordered by its durable ordinals. */\nexport const LifecyclePublicationBatch = Schema.NonEmptyArray(LifecyclePublication).check(\n Schema.isMaxLength(lifecyclePublicationBatchMaxFacts),\n Schema.makeFilter(\n (facts) =>\n facts.every((fact, index) => {\n const previous = facts[index - 1];\n\n return (\n fact.ownerThreadId === facts[0].ownerThreadId &&\n (previous === undefined || fact.ordinal > previous.ordinal)\n );\n }),\n { expected: \"One owner with strictly increasing publication ordinals\" },\n ),\n);\n\nexport type LifecyclePublicationBatch = typeof LifecyclePublicationBatch.Type;\n\n/** Native recovery state, independent of Attempts. Hosts serialize drains per storage owner. */\nexport interface LifecyclePublicationStorage {\n /** Select up to `limit` due owners, with a bounded pending prefix for each selected owner.\n * `retainedOnly` excludes unmaterialized source facts, for a precommitted start prefix.\n */\n readonly pending: (\n nowMillis: number,\n limit: number,\n options?: { readonly retainedOnly?: boolean },\n ) => Effect.Effect<ReadonlyArray<LifecyclePublicationBatch>, LifecyclePublicationError>;\n /** Atomically acknowledge the exact batch, retaining its identities and fingerprints. */\n readonly acknowledge: (\n publications: LifecyclePublicationBatch,\n ) => Effect.Effect<void, LifecyclePublicationError>;\n /** Optional atomic acknowledgement of up to 100 successfully published owner batches.\n * Validate every exact batch before consuming any debt. Empty waves succeed without writes.\n * Wrappers that validate acknowledgement authority must wrap this method too.\n * Custom services may omit this; drains then acknowledge each batch immediately.\n */\n readonly acknowledgeMany?: (\n batches: ReadonlyArray<LifecyclePublicationBatch>,\n ) => Effect.Effect<void, LifecyclePublicationError>;\n /**\n * Claim a due owner batch and persist its retry before dispatch. Eight automatic attempts;\n * 1s exponential backoff capped at 60s, after the dispatch timeout. The final attempt parks\n * the payload before dispatch so process loss cannot renew its budget. False means not due.\n */\n readonly claim: (\n publications: LifecyclePublicationBatch,\n nowMillis: number,\n timeoutMillis: number,\n ) => Effect.Effect<boolean, LifecyclePublicationError>;\n readonly pendingDeadline: Effect.Effect<Option.Option<number>, LifecyclePublicationError>;\n /**\n * Deadline for `pending(..., { retainedOnly: true })`, excluding unmaterialized source facts.\n * Source-backed stores provide this when `pendingDeadline` also includes source intent.\n * Otherwise `pendingDeadline` already describes retained work.\n */\n readonly retainedPendingDeadline?: Effect.Effect<\n Option.Option<number>,\n LifecyclePublicationError\n >;\n /** Explicit operator retry after repairing a parked owner's destination. */\n readonly retryParked: (\n ownerThreadId: ThreadId,\n nowMillis: number,\n ) => Effect.Effect<void, LifecyclePublicationError>;\n}\n\n/**\n * Publish one owner's ordered batch in one idempotent host transaction, including authorization,\n * records, receipts and delivery intents. Larger backlogs continue in later batches.\n * Return only after the entire batch commits. Retries\n * may include already committed identities plus later facts; deduplicate each fact's `id`.\n * Private input/update/result fields remain private; select declared public fields explicitly.\n * Revocation/deletion is an acknowledged domain decision, not an infrastructure retry.\n */\nexport class LifecyclePublicationHandler extends Context.Service<\n LifecyclePublicationHandler,\n {\n readonly publish: (\n publications: LifecyclePublicationBatch,\n ) => Effect.Effect<void, LifecyclePublicationError, Scope.Scope>;\n }\n>()(\"@effect-agent/thread/LifecyclePublicationHandler\") {}\n\n/** Adapter configuration; the opt-in layer captures its explicit Crypto requirement once. */\nexport const LifecyclePublicationConfig = Context.Reference<Option.Option<Crypto.Crypto>>(\n \"@effect-agent/thread/LifecyclePublicationConfig\",\n { defaultValue: () => Option.none() },\n);\n\n/** Enable native SQL obligations without changing dependencies of disabled storage assemblies. */\nexport const lifecyclePublicationLayer = Layer.effect(LifecyclePublicationConfig)(\n Effect.map(Crypto.Crypto, Option.some),\n);\n\n/** Resolve immutable evidence by its exact native identity, never by scanning execution history. */\nconst withSource = Effect.fn(\"LifecyclePublication.withSource\")(\n function* (publication: LifecyclePublication) {\n if (\n publication.source !== undefined ||\n (publication.fact._tag === \"WorkerInputCompleted\" &&\n publication.fact.workerThreadId !== publication.ownerThreadId)\n )\n return publication;\n const fact = publication.fact;\n\n let submissionId =\n fact._tag === \"AbortIntentRecorded\"\n ? fact.intent.submissionId\n : \"submissionId\" in fact\n ? fact.submissionId\n : undefined;\n\n const runId =\n fact._tag === \"AgentUpdateEmitted\"\n ? fact.update.runId\n : \"runId\" in fact\n ? fact.runId\n : undefined;\n\n if (submissionId === undefined && runId !== undefined) {\n const input = yield* getRunInput({ threadId: publication.ownerThreadId, runId });\n\n if (Option.isNone(input) || input.value.record.payload._tag !== \"UserInputRecorded\")\n return yield* LifecyclePublicationError.make({ reason: \"unavailable\" });\n submissionId = input.value.record.payload.submissionId;\n }\n if (submissionId === undefined) return publication;\n const ledger = yield* SubmissionLedger;\n const found = yield* ledger.lookup(SubmissionLookupById.make({ submissionId }));\n\n if (Option.isNone(found))\n return yield* LifecyclePublicationError.make({ reason: \"unavailable\" });\n\n const source = yield* Schema.decodeEffect(Schema.toType(LifecyclePublicationSource))(\n found.value,\n );\n\n return LifecyclePublication.make({ ...publication, source });\n },\n Effect.mapError((cause) => LifecyclePublicationError.make({ reason: \"unavailable\", cause })),\n);\n\n/**\n * One finite wave for the host's existing maintenance coordinator. Persist the next deadline\n * before dispatch, so interruption and process loss retain the same facts without another timer.\n * Finish independent owner batches before surfacing failures; interruption stops the wave.\n * Acknowledgements are exact and idempotent. An optional storage wave acknowledgement commits\n * completed batches in groups of up to 100, including when a later dispatch is interrupted. No producer or\n * external Tool is re-executed here.\n */\nexport const drainLifecyclePublications = Effect.fn(\"LifecyclePublication.drain\")(function* (\n storage: LifecyclePublicationStorage,\n timeoutMillis = 10_000,\n limit = 4,\n options?: { readonly retainedOnly?: boolean },\n) {\n const handler = yield* LifecyclePublicationHandler;\n const pending = yield* storage.pending(yield* Clock.currentTimeMillis, limit, options);\n const acknowledgeMany = storage.acknowledgeMany;\n const published: Array<LifecyclePublicationBatch> = [];\n let failures: Cause.Cause<LifecyclePublicationError> = Cause.empty;\n\n return yield* Effect.gen(function* () {\n for (const batch of pending) {\n yield* Effect.gen(function* () {\n if (!(yield* storage.claim(batch, yield* Clock.currentTimeMillis, timeoutMillis))) return;\n yield* Effect.scoped(\n Effect.gen(function* () {\n const publications = yield* Effect.forEach(batch, withSource);\n\n yield* handler.publish(publications);\n }),\n ).pipe(\n Effect.timeoutOrElse({\n duration: timeoutMillis,\n orElse: () => LifecyclePublicationError.make({ reason: \"unavailable\" }),\n }),\n );\n if (acknowledgeMany === undefined) yield* storage.acknowledge(batch);\n else published.push(batch);\n }).pipe(\n Effect.catchCauseIf(\n (cause) => !Cause.hasInterrupts(cause),\n (cause) => {\n failures = Cause.combine(failures, cause);\n\n return Effect.void;\n },\n ),\n );\n }\n if (failures.reasons.length > 0) return yield* Effect.failCause(failures);\n\n return pending.length;\n }).pipe(\n Effect.onExit(() =>\n acknowledgeMany === undefined || published.length === 0\n ? Effect.void\n : Effect.gen(function* () {\n for (let offset = 0; offset < published.length; offset += 100)\n yield* acknowledgeMany(published.slice(offset, offset + 100));\n }),\n ),\n );\n});\n"],"mappings":"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"}
|
|
@@ -5,9 +5,9 @@ import { r as Update } from "../AgentUpdates-DMJ-_xow.mjs";
|
|
|
5
5
|
import { a as FailureDiagnostic_d_exports, r as Diagnostic } from "../FailureDiagnostic-CaAkzGHL.mjs";
|
|
6
6
|
import { t as AgentPolicy } from "../AgentPolicy-B4oH8TbG.mjs";
|
|
7
7
|
import { h as DefinitionDigests } from "../Records-Bm4Qt70a.mjs";
|
|
8
|
-
import { fn as Settlement, xi as LifecyclePublicationStorage } from "../Admin-
|
|
9
|
-
import { a as PreparedInput } from "../Subscription-
|
|
10
|
-
import { t as PreparedInputAdmission } from "../PreparedInputAdmission-
|
|
8
|
+
import { fn as Settlement, xi as LifecyclePublicationStorage } from "../Admin-Vhz6NdaH.mjs";
|
|
9
|
+
import { a as PreparedInput } from "../Subscription-nbSNY6Hs.mjs";
|
|
10
|
+
import { t as PreparedInputAdmission } from "../PreparedInputAdmission-CS_zlCvD.mjs";
|
|
11
11
|
import { Context, Crypto, Effect, Layer, Result, Schema } from "effect";
|
|
12
12
|
declare namespace MessageDelivery_d_exports {
|
|
13
13
|
export { MessageDeliveryChange, MessageDeliveryCompletion, MessageDeliveryDriver, MessageDeliveryDriverLimits, MessageDeliveryError, MessageDeliveryFailpoint, MessageDeliveryFailpointError, MessageDeliveryFailure, MessageDeliveryKey, MessageDeliveryPage, MessageDeliveryPageRequest, MessageDeliveryPolicy, MessageDeliveryRecord, MessageDeliveryStore, MessageDeliveryStoreLimits, applyMessageDeliveryChange, defaultMessageDeliveryPolicy, defaultMessageDeliveryStoreLimits, isWorkerUpdateDelivery, messageDeliveryCapacity, messageDeliveryDeadline, messageDeliveryKeyString, messageDeliveryUsesCapacity, prepareMessageDelivery, readPending, sameMessageDeliveryIdentity, validateMessageDelivery };
|
|
@@ -5,7 +5,7 @@ import { r as Diagnostic } from "../FailureDiagnostic-CaAkzGHL.mjs";
|
|
|
5
5
|
import { t as AgentPolicy } from "../AgentPolicy-B4oH8TbG.mjs";
|
|
6
6
|
import { h as DefinitionDigests } from "../Records-Bm4Qt70a.mjs";
|
|
7
7
|
import { t as DigestError } from "../Digest-COAt3Orl.mjs";
|
|
8
|
-
import { fn as Settlement } from "../Admin-
|
|
8
|
+
import { fn as Settlement } from "../Admin-Vhz6NdaH.mjs";
|
|
9
9
|
import { MessageDeliveryError, MessageDeliveryFailure, MessageDeliveryStore } from "./MessageDelivery.mjs";
|
|
10
10
|
import { Effect, Schema } from "effect";
|
|
11
11
|
//#region src/durable/MessageDeliveryStoreConformance.d.ts
|
|
@@ -105,25 +105,6 @@ export declare const makeMessageDeliveryFixture: (messageId?: any, owner?: any,
|
|
|
105
105
|
readonly reportKind?: "update" | undefined;
|
|
106
106
|
} | undefined;
|
|
107
107
|
readonly messageAdmission?: {
|
|
108
|
-
readonly schemaVersion: 1;
|
|
109
|
-
readonly message: {
|
|
110
|
-
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
111
|
-
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
112
|
-
};
|
|
113
|
-
readonly peerName: string;
|
|
114
|
-
readonly sender: {
|
|
115
|
-
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
116
|
-
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
117
|
-
};
|
|
118
|
-
readonly returnAddress: {
|
|
119
|
-
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
120
|
-
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
121
|
-
};
|
|
122
|
-
readonly inReplyTo?: {
|
|
123
|
-
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
124
|
-
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
125
|
-
} | undefined;
|
|
126
|
-
} | {
|
|
127
108
|
readonly _tag: "WorkerCompletion";
|
|
128
109
|
readonly budgetExhausted: boolean;
|
|
129
110
|
readonly schemaVersion: 1;
|
|
@@ -164,6 +145,25 @@ export declare const makeMessageDeliveryFixture: (messageId?: any, owner?: any,
|
|
|
164
145
|
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
165
146
|
};
|
|
166
147
|
readonly update: Update;
|
|
148
|
+
} | {
|
|
149
|
+
readonly schemaVersion: 1;
|
|
150
|
+
readonly message: {
|
|
151
|
+
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
152
|
+
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
153
|
+
};
|
|
154
|
+
readonly peerName: string;
|
|
155
|
+
readonly sender: {
|
|
156
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
157
|
+
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
158
|
+
};
|
|
159
|
+
readonly returnAddress: {
|
|
160
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
161
|
+
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
162
|
+
};
|
|
163
|
+
readonly inReplyTo?: {
|
|
164
|
+
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
165
|
+
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
166
|
+
} | undefined;
|
|
167
167
|
} | undefined;
|
|
168
168
|
};
|
|
169
169
|
readonly envelopeDigest: string & import("effect/Brand").Brand<"@effect-agent/thread/Digest">;
|
|
@@ -288,25 +288,6 @@ export declare const makeWorkerUpdateDeliveryFixture: (id: string) => Effect.Eff
|
|
|
288
288
|
readonly reportKind?: "update" | undefined;
|
|
289
289
|
} | undefined;
|
|
290
290
|
readonly messageAdmission?: {
|
|
291
|
-
readonly schemaVersion: 1;
|
|
292
|
-
readonly message: {
|
|
293
|
-
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
294
|
-
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
295
|
-
};
|
|
296
|
-
readonly peerName: string;
|
|
297
|
-
readonly sender: {
|
|
298
|
-
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
299
|
-
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
300
|
-
};
|
|
301
|
-
readonly returnAddress: {
|
|
302
|
-
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
303
|
-
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
304
|
-
};
|
|
305
|
-
readonly inReplyTo?: {
|
|
306
|
-
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
307
|
-
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
308
|
-
} | undefined;
|
|
309
|
-
} | {
|
|
310
291
|
readonly _tag: "WorkerCompletion";
|
|
311
292
|
readonly budgetExhausted: boolean;
|
|
312
293
|
readonly schemaVersion: 1;
|
|
@@ -347,6 +328,25 @@ export declare const makeWorkerUpdateDeliveryFixture: (id: string) => Effect.Eff
|
|
|
347
328
|
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
348
329
|
};
|
|
349
330
|
readonly update: Update;
|
|
331
|
+
} | {
|
|
332
|
+
readonly schemaVersion: 1;
|
|
333
|
+
readonly message: {
|
|
334
|
+
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
335
|
+
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
336
|
+
};
|
|
337
|
+
readonly peerName: string;
|
|
338
|
+
readonly sender: {
|
|
339
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
340
|
+
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
341
|
+
};
|
|
342
|
+
readonly returnAddress: {
|
|
343
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
344
|
+
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
345
|
+
};
|
|
346
|
+
readonly inReplyTo?: {
|
|
347
|
+
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
348
|
+
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
349
|
+
} | undefined;
|
|
350
350
|
} | undefined;
|
|
351
351
|
};
|
|
352
352
|
readonly envelopeDigest: string & import("effect/Brand").Brand<"@effect-agent/thread/Digest">;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as ThreadHistory } from "../ThreadHistory-FD-o4TsR.mjs";
|
|
2
|
-
import { ni as ThreadStore } from "../Admin-
|
|
2
|
+
import { ni as ThreadStore } from "../Admin-Vhz6NdaH.mjs";
|
|
3
3
|
import { Layer } from "effect";
|
|
4
4
|
declare namespace PersistentHistory_d_exports {
|
|
5
5
|
export { layer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as admitPreparedInput, t as PreparedInputAdmission } from "../PreparedInputAdmission-
|
|
1
|
+
import { r as admitPreparedInput, t as PreparedInputAdmission } from "../PreparedInputAdmission-CS_zlCvD.mjs";
|
|
2
2
|
export { PreparedInputAdmission, admitPreparedInput };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as RepairSubagentStartLink, A as AwaitChildSettlement, B as MarkUnknown, D as ApplyUnknownResolutions, E as ApplyJoinAccounting, F as CompleteMaterialization, G as PropagateChildAbort, H as OpenDelegationCallEvidence, I as DeclaredPendingBatchEvidence, K as RecoveryDecision, L as DelegationAdmissionEvidence, M as AwaitParentEstablishment, N as AwaitUnknownResolution, O as AwaitApprovalDecision, P as CompleteChildAdmission, Q as RepairReadiness, R as EnsureWaitingForChild, T as ApplyInput, U as OpenToolCallEvidence, V as NoAction, W as PendingApprovalEvidence, X as RepairInputMarker, Y as ReleaseOrphanChildReservation, Z as RepairJoinMarker, at as SettleAborted, et as ResumeFromTurnBoundary, it as RevertJoining, j as AwaitHostSettlement, k as AwaitChildAdmissionResolution, nt as ResumeSuspended, ot as SettleJoinedWithHost, q as RecoveryEvidence, rt as ResumeWaitingParent, st as classifyRecovery, tt as ResumePendingToolBatch, w as AppendReservedSettlement, z as FinalizeLedgerFromHistory } from "../Admin-
|
|
1
|
+
import { $ as RepairSubagentStartLink, A as AwaitChildSettlement, B as MarkUnknown, D as ApplyUnknownResolutions, E as ApplyJoinAccounting, F as CompleteMaterialization, G as PropagateChildAbort, H as OpenDelegationCallEvidence, I as DeclaredPendingBatchEvidence, K as RecoveryDecision, L as DelegationAdmissionEvidence, M as AwaitParentEstablishment, N as AwaitUnknownResolution, O as AwaitApprovalDecision, P as CompleteChildAdmission, Q as RepairReadiness, R as EnsureWaitingForChild, T as ApplyInput, U as OpenToolCallEvidence, V as NoAction, W as PendingApprovalEvidence, X as RepairInputMarker, Y as ReleaseOrphanChildReservation, Z as RepairJoinMarker, at as SettleAborted, et as ResumeFromTurnBoundary, it as RevertJoining, j as AwaitHostSettlement, k as AwaitChildAdmissionResolution, nt as ResumeSuspended, ot as SettleJoinedWithHost, q as RecoveryEvidence, rt as ResumeWaitingParent, st as classifyRecovery, tt as ResumePendingToolBatch, w as AppendReservedSettlement, z as FinalizeLedgerFromHistory } from "../Admin-Vhz6NdaH.mjs";
|
|
2
2
|
export { AppendReservedSettlement, ApplyInput, ApplyJoinAccounting, ApplyUnknownResolutions, AwaitApprovalDecision, AwaitChildAdmissionResolution, AwaitChildSettlement, AwaitHostSettlement, AwaitParentEstablishment, AwaitUnknownResolution, CompleteChildAdmission, CompleteMaterialization, DeclaredPendingBatchEvidence, DelegationAdmissionEvidence, EnsureWaitingForChild, FinalizeLedgerFromHistory, MarkUnknown, NoAction, OpenDelegationCallEvidence, OpenToolCallEvidence, PendingApprovalEvidence, PropagateChildAbort, RecoveryDecision, RecoveryEvidence, ReleaseOrphanChildReservation, RepairInputMarker, RepairJoinMarker, RepairReadiness, RepairSubagentStartLink, ResumeFromTurnBoundary, ResumePendingToolBatch, ResumeSuspended, ResumeWaitingParent, RevertJoining, SettleAborted, SettleJoinedWithHost, classifyRecovery };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $i as runDurationBatchId, Aa as turnResultsBatchId, Ai as JournalBoundary, Bi as compactionBatchId, Ca as turnBatchId, Da as turnResponseBatch, Ea as turnPreparedBatchId, Fi as TurnCommitInput, Gi as modelResponseInterruptedRecordId, Hi as firstWorkerInputRecordId, Ii as agentUpdateRecordId, Ji as projectRunJournal, Ki as modelResponseRecordId, Li as approvalDecisionBatchId, Ma as workerOriginRecordId, Mi as RunJournalProjection, Na as workerReportRecordId, Ni as RunJournalUsage, Oa as turnResponseBatchId, Qi as runCompletionDigest, Ri as childIdempotencyKeyFor, Sa as turnApprovalsBatchId, Ta as turnIdForRun, Ui as markUnknownBatchId, Vi as compactionRecordId, Wi as modelResponseInterruptedBatchId, Xi as promptFromCanonicalRecords, Yi as projectRunJournalStream, Zi as runCompletedRecordId, _a as toolCallResultBatchId, aa as subagentJoinedRecordId, ba as toolStepSettledBatchId, ca as subagentRequestedBatchId, da as subagentStartedRecordId, ea as runDurationRecordId, fa as toolApprovalDecisionRecordId, ga as toolCallResolvedRecordId, ha as toolCallResolutionBatchId, ia as subagentJoinBatchId, ja as workerInputRecordId, ji as RunJournalError, ka as turnResultsBatch, la as subagentRequestedRecordId, ma as toolCallPreparedRecordId, na as runStartedBatchId, oa as subagentLineageBatchId, pa as toolApprovalRequestRecordId, qi as peerMessageRecordId, ra as runStartedRecordId, sa as subagentLineageRecordId, ta as runIdForSubmission, ua as subagentStartedBatchId, va as toolCallSettledRecordId, wa as turnCanonicalBatch, xa as toolStepSettledRecordId, ya as toolCallUnknownRecordId, zi as childThreadIdFor } from "../Admin-
|
|
1
|
+
import { $i as runDurationBatchId, Aa as turnResultsBatchId, Ai as JournalBoundary, Bi as compactionBatchId, Ca as turnBatchId, Da as turnResponseBatch, Ea as turnPreparedBatchId, Fi as TurnCommitInput, Gi as modelResponseInterruptedRecordId, Hi as firstWorkerInputRecordId, Ii as agentUpdateRecordId, Ji as projectRunJournal, Ki as modelResponseRecordId, Li as approvalDecisionBatchId, Ma as workerOriginRecordId, Mi as RunJournalProjection, Na as workerReportRecordId, Ni as RunJournalUsage, Oa as turnResponseBatchId, Qi as runCompletionDigest, Ri as childIdempotencyKeyFor, Sa as turnApprovalsBatchId, Ta as turnIdForRun, Ui as markUnknownBatchId, Vi as compactionRecordId, Wi as modelResponseInterruptedBatchId, Xi as promptFromCanonicalRecords, Yi as projectRunJournalStream, Zi as runCompletedRecordId, _a as toolCallResultBatchId, aa as subagentJoinedRecordId, ba as toolStepSettledBatchId, ca as subagentRequestedBatchId, da as subagentStartedRecordId, ea as runDurationRecordId, fa as toolApprovalDecisionRecordId, ga as toolCallResolvedRecordId, ha as toolCallResolutionBatchId, ia as subagentJoinBatchId, ja as workerInputRecordId, ji as RunJournalError, ka as turnResultsBatch, la as subagentRequestedRecordId, ma as toolCallPreparedRecordId, na as runStartedBatchId, oa as subagentLineageBatchId, pa as toolApprovalRequestRecordId, qi as peerMessageRecordId, ra as runStartedRecordId, sa as subagentLineageRecordId, ta as runIdForSubmission, ua as subagentStartedBatchId, va as toolCallSettledRecordId, wa as turnCanonicalBatch, xa as toolStepSettledRecordId, ya as toolCallUnknownRecordId, zi as childThreadIdFor } from "../Admin-Vhz6NdaH.mjs";
|
|
2
2
|
export { JournalBoundary, RunJournalError, RunJournalProjection, RunJournalUsage, TurnCommitInput, agentUpdateRecordId, approvalDecisionBatchId, childIdempotencyKeyFor, childThreadIdFor, compactionBatchId, compactionRecordId, firstWorkerInputRecordId, markUnknownBatchId, modelResponseInterruptedBatchId, modelResponseInterruptedRecordId, modelResponseRecordId, peerMessageRecordId, projectRunJournal, projectRunJournalStream, promptFromCanonicalRecords, runCompletedRecordId, runCompletionDigest, runDurationBatchId, runDurationRecordId, runIdForSubmission, runStartedBatchId, runStartedRecordId, subagentJoinBatchId, subagentJoinedRecordId, subagentLineageBatchId, subagentLineageRecordId, subagentRequestedBatchId, subagentRequestedRecordId, subagentStartedBatchId, subagentStartedRecordId, toolApprovalDecisionRecordId, toolApprovalRequestRecordId, toolCallPreparedRecordId, toolCallResolutionBatchId, toolCallResolvedRecordId, toolCallResultBatchId, toolCallSettledRecordId, toolCallUnknownRecordId, toolStepSettledBatchId, toolStepSettledRecordId, turnApprovalsBatchId, turnBatchId, turnCanonicalBatch, turnIdForRun, turnPreparedBatchId, turnResponseBatch, turnResponseBatchId, turnResultsBatch, turnResultsBatchId, workerInputRecordId, workerOriginRecordId, workerReportRecordId };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as Principal } from "../Receipt-BAHyigAF.mjs";
|
|
2
2
|
import { h as DefinitionDigests } from "../Records-Bm4Qt70a.mjs";
|
|
3
|
-
import { dr as DurableSubmitAgent, pt as AdmissionFence } from "../Admin-
|
|
3
|
+
import { dr as DurableSubmitAgent, pt as AdmissionFence } from "../Admin-Vhz6NdaH.mjs";
|
|
4
4
|
import { A as ScheduleSnapshotPage, B as ScheduledInputAdmission, C as ScheduleRecord, D as ScheduleScope, F as ScheduleTimingRequest, I as ScheduleValidationError, L as ScheduleWake, M as ScheduleStore, N as ScheduleStoreFailure, W as SchedulingLimits, c as ScheduleDestination, f as ScheduleId, j as ScheduleStorageError, k as ScheduleSnapshot, m as ScheduleKey, n as ScheduleAuthorizationError, r as ScheduleAuthorizer, y as ScheduleOwner } from "../Schedule-Bi_XVKLF.mjs";
|
|
5
5
|
import { Context, Crypto, Effect, Layer, Schema } from "effect";
|
|
6
6
|
declare namespace Scheduling_d_exports {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { i as QueueSequence, n as JoinedToHost, r as Principal, t as IdempotencyKey } from "../Receipt-BAHyigAF.mjs";
|
|
2
|
-
import { $t as ParentLinkage, An as SuspensionReason, At as ChildReservationConflict, Bn as settlementFailureFromRecord, Bt as InputAppliedMarker, Cn as SubmissionLookupByKey, Ct as ApprovalDecisionIntent, Dn as SubmissionWorkItem, Dt as ChildAttachmentSnapshot, En as SubmissionState, Et as BeginChildBudgetReleaseRequest, Fn as UnknownResolutionIntent, Ft as Claim, Gn as submissionSettlementBatchId, Gt as MarkInputAppliedRequest, Hn as submissionAbortRecordId, Ht as JoiningClaim, In as WaitingChild, It as ClaimHandoff, Jn as workerTerminalFromRecord, Jt as MarkUnknownRequest, Kn as submissionSettlementId, Kt as MarkJoinedRequest, Ln as WaitingForChildSuspension, Lt as ClaimJoiningRequest, Mn as UnknownResolution, Mt as ChildReservationStatus, Nn as UnknownResolutionCommand, Nt as ChildSettledNotification, On as SuspendRequest, Ot as ChildBudgetReservationRequest, Pn as UnknownResolutionConflict, Pt as ChildSettledOutcome, Qt as OwnershipToken, Rn as WorkerLedgerState, Rt as ClaimRequest, Sn as SubmissionLookupById, St as ApprovalDecisionCommand, Tn as SubmissionSnapshot, Tt as AttachChildToReservationRequest, Un as submissionInputBatchId, Ut as LedgerCapabilities, Vn as submissionAbortBatchId, Vt as JoinSnapshot, Wn as submissionInputRecordId, Wt as LedgerError, Xt as OwnershipRenewal, Yt as OwnershipLost, Zt as OwnershipSnapshot, _n as SubmissionAdmissionFence, _t as AdmissionPolicyError, an as ReservedChildBudget, bt as AdmissionResult, cn as ResolutionCompletedWithResult, ct as AbortCommand, dn as RevertJoiningRequest, dt as AdmissionAdmitted, en as RecoverySnapshot, fn as Settlement, ft as AdmissionConflict, gn as SettlementReservationSnapshot, gt as AdmissionNotAdmitted, hn as SettlementReservation, ht as AdmissionIndeterminate, in as RenewOwnershipRequest, jn as SuspensionSnapshot, jt as ChildReservationId, kn as SuspensionOutcome, kt as ChildBudgetReservationSnapshot, ln as ResolutionNeverHappened, lt as AbortIntent, mn as SettlementFinalization, mt as AdmissionGroup, nn as ReleaseChildBudgetRequest, on as ReservedSettlement, pn as SettlementConflict, pt as AdmissionFence, qn as submissionSettlementRecordId, qt as MarkReadyRequest, rn as ReleaseOwnershipRequest, sn as ResolutionAbortSubmission, tn as RecoverySnapshotRequest, un as ResolutionSafeToRetry, ut as AbortIntentRequest, vn as SubmissionLedger, vt as AdmissionRequest, wn as SubmissionScheduling, wt as ApprovalPendingSuspension, xn as SubmissionLookup, xt as ApprovalConflict, yn as SubmissionLedgerFailure, yt as AdmissionResolution, zn as WorkerStopCommand, zt as DEFAULT_OWNERSHIP_LEASE_DURATION } from "../Admin-
|
|
2
|
+
import { $t as ParentLinkage, An as SuspensionReason, At as ChildReservationConflict, Bn as settlementFailureFromRecord, Bt as InputAppliedMarker, Cn as SubmissionLookupByKey, Ct as ApprovalDecisionIntent, Dn as SubmissionWorkItem, Dt as ChildAttachmentSnapshot, En as SubmissionState, Et as BeginChildBudgetReleaseRequest, Fn as UnknownResolutionIntent, Ft as Claim, Gn as submissionSettlementBatchId, Gt as MarkInputAppliedRequest, Hn as submissionAbortRecordId, Ht as JoiningClaim, In as WaitingChild, It as ClaimHandoff, Jn as workerTerminalFromRecord, Jt as MarkUnknownRequest, Kn as submissionSettlementId, Kt as MarkJoinedRequest, Ln as WaitingForChildSuspension, Lt as ClaimJoiningRequest, Mn as UnknownResolution, Mt as ChildReservationStatus, Nn as UnknownResolutionCommand, Nt as ChildSettledNotification, On as SuspendRequest, Ot as ChildBudgetReservationRequest, Pn as UnknownResolutionConflict, Pt as ChildSettledOutcome, Qt as OwnershipToken, Rn as WorkerLedgerState, Rt as ClaimRequest, Sn as SubmissionLookupById, St as ApprovalDecisionCommand, Tn as SubmissionSnapshot, Tt as AttachChildToReservationRequest, Un as submissionInputBatchId, Ut as LedgerCapabilities, Vn as submissionAbortBatchId, Vt as JoinSnapshot, Wn as submissionInputRecordId, Wt as LedgerError, Xt as OwnershipRenewal, Yt as OwnershipLost, Zt as OwnershipSnapshot, _n as SubmissionAdmissionFence, _t as AdmissionPolicyError, an as ReservedChildBudget, bt as AdmissionResult, cn as ResolutionCompletedWithResult, ct as AbortCommand, dn as RevertJoiningRequest, dt as AdmissionAdmitted, en as RecoverySnapshot, fn as Settlement, ft as AdmissionConflict, gn as SettlementReservationSnapshot, gt as AdmissionNotAdmitted, hn as SettlementReservation, ht as AdmissionIndeterminate, in as RenewOwnershipRequest, jn as SuspensionSnapshot, jt as ChildReservationId, kn as SuspensionOutcome, kt as ChildBudgetReservationSnapshot, ln as ResolutionNeverHappened, lt as AbortIntent, mn as SettlementFinalization, mt as AdmissionGroup, nn as ReleaseChildBudgetRequest, on as ReservedSettlement, pn as SettlementConflict, pt as AdmissionFence, qn as submissionSettlementRecordId, qt as MarkReadyRequest, rn as ReleaseOwnershipRequest, sn as ResolutionAbortSubmission, tn as RecoverySnapshotRequest, un as ResolutionSafeToRetry, ut as AbortIntentRequest, vn as SubmissionLedger, vt as AdmissionRequest, wn as SubmissionScheduling, wt as ApprovalPendingSuspension, xn as SubmissionLookup, xt as ApprovalConflict, yn as SubmissionLedgerFailure, yt as AdmissionResolution, zn as WorkerStopCommand, zt as DEFAULT_OWNERSHIP_LEASE_DURATION } from "../Admin-Vhz6NdaH.mjs";
|
|
3
3
|
export { AbortCommand, AbortIntent, AbortIntentRequest, AdmissionAdmitted, AdmissionConflict, AdmissionFence, AdmissionGroup, AdmissionIndeterminate, AdmissionNotAdmitted, AdmissionPolicyError, AdmissionRequest, AdmissionResolution, AdmissionResult, ApprovalConflict, ApprovalDecisionCommand, ApprovalDecisionIntent, ApprovalPendingSuspension, AttachChildToReservationRequest, BeginChildBudgetReleaseRequest, ChildAttachmentSnapshot, ChildBudgetReservationRequest, ChildBudgetReservationSnapshot, ChildReservationConflict, ChildReservationId, ChildReservationStatus, ChildSettledNotification, ChildSettledOutcome, Claim, ClaimHandoff, ClaimJoiningRequest, ClaimRequest, DEFAULT_OWNERSHIP_LEASE_DURATION, IdempotencyKey, InputAppliedMarker, JoinSnapshot, JoinedToHost, JoiningClaim, LedgerCapabilities, LedgerError, MarkInputAppliedRequest, MarkJoinedRequest, MarkReadyRequest, MarkUnknownRequest, OwnershipLost, OwnershipRenewal, OwnershipSnapshot, OwnershipToken, ParentLinkage, Principal, QueueSequence, RecoverySnapshot, RecoverySnapshotRequest, ReleaseChildBudgetRequest, ReleaseOwnershipRequest, RenewOwnershipRequest, ReservedChildBudget, ReservedSettlement, ResolutionAbortSubmission, ResolutionCompletedWithResult, ResolutionNeverHappened, ResolutionSafeToRetry, RevertJoiningRequest, Settlement, SettlementConflict, SettlementFinalization, SettlementReservation, SettlementReservationSnapshot, SubmissionAdmissionFence, SubmissionLedger, SubmissionLedgerFailure, SubmissionLookup, SubmissionLookupById, SubmissionLookupByKey, SubmissionScheduling, SubmissionSnapshot, SubmissionState, SubmissionWorkItem, SuspendRequest, SuspensionOutcome, SuspensionReason, SuspensionSnapshot, UnknownResolution, UnknownResolutionCommand, UnknownResolutionConflict, UnknownResolutionIntent, WaitingChild, WaitingForChildSuspension, WorkerLedgerState, WorkerStopCommand, settlementFailureFromRecord, submissionAbortBatchId, submissionAbortRecordId, submissionInputBatchId, submissionInputRecordId, submissionSettlementBatchId, submissionSettlementId, submissionSettlementRecordId, workerTerminalFromRecord };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as DigestError } from "../Digest-COAt3Orl.mjs";
|
|
2
|
-
import { vn as SubmissionLedger, yn as SubmissionLedgerFailure } from "../Admin-
|
|
2
|
+
import { vn as SubmissionLedger, yn as SubmissionLedgerFailure } from "../Admin-Vhz6NdaH.mjs";
|
|
3
3
|
import { Crypto, Effect, Schema } from "effect";
|
|
4
4
|
//#region src/durable/SubmissionLedgerConformance.d.ts
|
|
5
5
|
declare const SubmissionLedgerConformanceViolation_base: Schema.Class<SubmissionLedgerConformanceViolation, Schema.TaggedStruct<"SubmissionLedgerConformanceViolation", {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Di as SettledSubmission, Ei as PendingSubmission, Oi as SubmissionStatus } from "../Admin-
|
|
1
|
+
import { Di as SettledSubmission, Ei as PendingSubmission, Oi as SubmissionStatus } from "../Admin-Vhz6NdaH.mjs";
|
|
2
2
|
export { PendingSubmission, SettledSubmission, SubmissionStatus };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as defaultSubscriptionLimits, C as SubscriptionScanCursors, D as SubscriptionStore, E as SubscriptionSourceError, M as subscriptionKeyString, O as SubscriptionStoreFailure, S as SubscriptionRetentionPolicy, T as SubscriptionSnapshot, _ as SubscriptionKey, a as PreparedInput, b as SubscriptionRecord, c as SubscriptionAuthorizer, d as SubscriptionDelivery, f as SubscriptionDeliveryKey, g as SubscriptionFailpointError, h as SubscriptionFailpoint, i as EventSourceVersion, j as subscriptionDeliveryKeyString, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, s as SourceRecovery, t as AcceptedEvent, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope, x as SubscriptionRefusal, y as SubscriptionName } from "../Subscription-
|
|
1
|
+
import { A as defaultSubscriptionLimits, C as SubscriptionScanCursors, D as SubscriptionStore, E as SubscriptionSourceError, M as subscriptionKeyString, O as SubscriptionStoreFailure, S as SubscriptionRetentionPolicy, T as SubscriptionSnapshot, _ as SubscriptionKey, a as PreparedInput, b as SubscriptionRecord, c as SubscriptionAuthorizer, d as SubscriptionDelivery, f as SubscriptionDeliveryKey, g as SubscriptionFailpointError, h as SubscriptionFailpoint, i as EventSourceVersion, j as subscriptionDeliveryKeyString, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, s as SourceRecovery, t as AcceptedEvent, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope, x as SubscriptionRefusal, y as SubscriptionName } from "../Subscription-nbSNY6Hs.mjs";
|
|
2
2
|
export { AcceptedEvent, DeliveryChange, EventAcknowledgement, EventSourceVersion, PreparedInput, SourcePartition, SourceRecovery, SubscriptionAuthorizer, SubscriptionChange, SubscriptionConfiguration, SubscriptionDelivery, SubscriptionDeliveryKey, SubscriptionDeliverySnapshot, SubscriptionError, SubscriptionFailpoint, SubscriptionFailpointError, SubscriptionKey, SubscriptionLimits, SubscriptionName, SubscriptionRecord, SubscriptionRefusal, SubscriptionRetentionPolicy, SubscriptionScanCursors, SubscriptionScope, SubscriptionSnapshot, SubscriptionSourceError, SubscriptionStore, SubscriptionStoreFailure, defaultSubscriptionLimits, subscriptionDeliveryKeyString, subscriptionKeyString };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as resolveSubscriptionInput, i as makeSubscriptionInputBinding, n as SubscriptionInputBindings, t as SubscriptionInputBinding } from "../SubscriptionInput-
|
|
1
|
+
import { a as resolveSubscriptionInput, i as makeSubscriptionInputBinding, n as SubscriptionInputBindings, t as SubscriptionInputBinding } from "../SubscriptionInput-DbXnOMS2.mjs";
|
|
2
2
|
export { SubscriptionInputBinding, SubscriptionInputBindings, makeSubscriptionInputBinding, resolveSubscriptionInput };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as SubscriptionStore, O as SubscriptionStoreFailure, o as SourcePartition } from "../Subscription-
|
|
1
|
+
import { D as SubscriptionStore, O as SubscriptionStoreFailure, o as SourcePartition } from "../Subscription-nbSNY6Hs.mjs";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
//#region src/durable/SubscriptionStoreConformance.d.ts
|
|
4
4
|
declare const SubscriptionStoreConformanceViolation_base: Schema.Class<SubscriptionStoreConformanceViolation, Schema.TaggedStruct<"SubscriptionStoreConformanceViolation", {
|
|
@@ -2,9 +2,9 @@ import { t as AgentId, u as ThreadId } from "../Identifiers-CN2s30fF.mjs";
|
|
|
2
2
|
import { r as Principal } from "../Receipt-BAHyigAF.mjs";
|
|
3
3
|
import { t as DurableStep } from "../DurableStep-Cry_iol4.mjs";
|
|
4
4
|
import { h as DefinitionDigests } from "../Records-Bm4Qt70a.mjs";
|
|
5
|
-
import "../Admin-
|
|
5
|
+
import "../Admin-Vhz6NdaH.mjs";
|
|
6
6
|
import { c as ScheduleDestination } from "../Schedule-Bi_XVKLF.mjs";
|
|
7
|
-
import { E as SubscriptionSourceError, g as SubscriptionFailpointError, i as EventSourceVersion, m as SubscriptionError, w as SubscriptionScope } from "../Subscription-
|
|
7
|
+
import { E as SubscriptionSourceError, g as SubscriptionFailpointError, i as EventSourceVersion, m as SubscriptionError, w as SubscriptionScope } from "../Subscription-nbSNY6Hs.mjs";
|
|
8
8
|
import { Subscriptions } from "./Subscriptions.mjs";
|
|
9
9
|
import { Tool, Toolkit } from "effect/unstable/ai";
|
|
10
10
|
import { Crypto, Layer, Schema } from "effect";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as SubscriptionRecord, d as SubscriptionDelivery, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, t as AcceptedEvent, v as SubscriptionLimits } from "../Subscription-
|
|
1
|
+
import { b as SubscriptionRecord, d as SubscriptionDelivery, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, t as AcceptedEvent, v as SubscriptionLimits } from "../Subscription-nbSNY6Hs.mjs";
|
|
2
2
|
import { Result } from "effect";
|
|
3
3
|
declare namespace SubscriptionTransition_d_exports {
|
|
4
4
|
export { applySubscriptionChange, applySubscriptionDeliveryChange, sameAcceptedEventIdentity, sameSourcePartition, sameSubscriptionDelivery, subscriptionCanSelect, subscriptionDeliveryCanSelect, subscriptionMatchesEvent, validateEventRetention };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as Principal } from "../Receipt-BAHyigAF.mjs";
|
|
2
2
|
import { k as PersistedJson } from "../Records-Bm4Qt70a.mjs";
|
|
3
|
-
import { pt as AdmissionFence } from "../Admin-
|
|
4
|
-
import { D as SubscriptionStore, E as SubscriptionSourceError, O as SubscriptionStoreFailure, T as SubscriptionSnapshot, _ as SubscriptionKey, c as SubscriptionAuthorizer, f as SubscriptionDeliveryKey, i as EventSourceVersion, m as SubscriptionError, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope } from "../Subscription-
|
|
5
|
-
import { r as EventSources } from "../EventSource-
|
|
6
|
-
import { t as PreparedInputAdmission } from "../PreparedInputAdmission-
|
|
7
|
-
import { n as SubscriptionInputBindings } from "../SubscriptionInput-
|
|
3
|
+
import { pt as AdmissionFence } from "../Admin-Vhz6NdaH.mjs";
|
|
4
|
+
import { D as SubscriptionStore, E as SubscriptionSourceError, O as SubscriptionStoreFailure, T as SubscriptionSnapshot, _ as SubscriptionKey, c as SubscriptionAuthorizer, f as SubscriptionDeliveryKey, i as EventSourceVersion, m as SubscriptionError, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope } from "../Subscription-nbSNY6Hs.mjs";
|
|
5
|
+
import { r as EventSources } from "../EventSource-CtS0RBM7.mjs";
|
|
6
|
+
import { t as PreparedInputAdmission } from "../PreparedInputAdmission-CS_zlCvD.mjs";
|
|
7
|
+
import { n as SubscriptionInputBindings } from "../SubscriptionInput-DbXnOMS2.mjs";
|
|
8
8
|
import { Context, Crypto, Effect, Layer } from "effect";
|
|
9
9
|
declare namespace Subscriptions_d_exports {
|
|
10
10
|
export { SubscribeOptions, SubscriptionDriver, SubscriptionFailure, SubscriptionIntake, Subscriptions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContextHistory, ContextHistoryError } from "../engine/ContextHistory.mjs";
|
|
2
|
-
import { ni as ThreadStore } from "../Admin-
|
|
2
|
+
import { ni as ThreadStore } from "../Admin-Vhz6NdaH.mjs";
|
|
3
3
|
import { Layer, Schema } from "effect";
|
|
4
4
|
declare namespace ThreadContextHistory_d_exports {
|
|
5
5
|
export { ThreadContextHistoryOptions, layer };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as BatchId, j as ProducerId } from "../Records-Bm4Qt70a.mjs";
|
|
2
|
-
import { Br as ThreadExport, Rr as ThreadCheckpoint, Tn as SubmissionSnapshot, c as IntegrityReport } from "../Admin-
|
|
2
|
+
import { Br as ThreadExport, Rr as ThreadCheckpoint, Tn as SubmissionSnapshot, c as IntegrityReport } from "../Admin-Vhz6NdaH.mjs";
|
|
3
3
|
import { Crypto, Effect } from "effect";
|
|
4
4
|
declare namespace ThreadInvariants_d_exports {
|
|
5
5
|
export { ThreadInvariantInput, verifyThreadInvariants };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mr as FencedAppendRequest, kr as AppendResult } from "../Admin-
|
|
1
|
+
import { Mr as FencedAppendRequest, kr as AppendResult } from "../Admin-Vhz6NdaH.mjs";
|
|
2
2
|
import { Context, Effect, Layer, Option, Schema } from "effect";
|
|
3
3
|
declare namespace ThreadProjectionMaintenance_d_exports {
|
|
4
4
|
export { ThreadProjectionError, ThreadProjectionMaintenance, ThreadProjectionMaintenanceService, drainDue };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $r as ThreadRecoveryCheckpoints, Ar as CheckpointRejected, Br as ThreadExport, Fr as SaveCheckpointRequest, Gr as ThreadNotMaterialized, Hr as ThreadIdentity, Ir as SaveRecoveryCheckpointRequest, Jr as ThreadOutstandingRequest, Kr as ThreadObservation, Lr as SelectedThreadRead, Mr as FencedAppendRequest, Nr as LoadCheckpointRequest, Or as AppendConflict, Pr as MAX_THREAD_EXPORT_RECORDS, Qr as ThreadRecordRequest, Rr as ThreadCheckpoint, Ur as ThreadIdentityRequest, Vr as ThreadExportRequest, Wr as ThreadMaterialization, Xr as ThreadRead, Yr as ThreadPeerCountRequest, Zr as ThreadReadRequest, ai as ThreadStoreFailure, ci as ThreadTailRequest, di as getRunInput, ei as ThreadRunInputRequest, fi as readOutstanding, ii as ThreadStoreError, jr as FenceRejected, kr as AppendResult, li as ThreadWorkerStateRequest, ni as ThreadStore, pi as readWorkerState, qr as ThreadOutstanding, ri as ThreadStoreDiagnostic, si as ThreadTail, ti as ThreadSelection, ui as getRecord, zr as ThreadCheckpoints } from "../Admin-
|
|
1
|
+
import { $r as ThreadRecoveryCheckpoints, Ar as CheckpointRejected, Br as ThreadExport, Fr as SaveCheckpointRequest, Gr as ThreadNotMaterialized, Hr as ThreadIdentity, Ir as SaveRecoveryCheckpointRequest, Jr as ThreadOutstandingRequest, Kr as ThreadObservation, Lr as SelectedThreadRead, Mr as FencedAppendRequest, Nr as LoadCheckpointRequest, Or as AppendConflict, Pr as MAX_THREAD_EXPORT_RECORDS, Qr as ThreadRecordRequest, Rr as ThreadCheckpoint, Ur as ThreadIdentityRequest, Vr as ThreadExportRequest, Wr as ThreadMaterialization, Xr as ThreadRead, Yr as ThreadPeerCountRequest, Zr as ThreadReadRequest, ai as ThreadStoreFailure, ci as ThreadTailRequest, di as getRunInput, ei as ThreadRunInputRequest, fi as readOutstanding, ii as ThreadStoreError, jr as FenceRejected, kr as AppendResult, li as ThreadWorkerStateRequest, ni as ThreadStore, pi as readWorkerState, qr as ThreadOutstanding, ri as ThreadStoreDiagnostic, si as ThreadTail, ti as ThreadSelection, ui as getRecord, zr as ThreadCheckpoints } from "../Admin-Vhz6NdaH.mjs";
|
|
2
2
|
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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ar as CheckpointRejected, ai as ThreadStoreFailure, ni as ThreadStore } from "../Admin-
|
|
1
|
+
import { Ar as CheckpointRejected, ai as ThreadStoreFailure, ni as ThreadStore } from "../Admin-Vhz6NdaH.mjs";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
//#region src/durable/ThreadStoreConformance.d.ts
|
|
4
4
|
declare const ThreadStoreConformanceViolation_base: Schema.Class<ThreadStoreConformanceViolation, Schema.TaggedStruct<"ThreadStoreConformanceViolation", {
|
|
@@ -3,7 +3,7 @@ import { a as Receipt } from "../Receipt-BAHyigAF.mjs";
|
|
|
3
3
|
import { r as Update } from "../AgentUpdates-DMJ-_xow.mjs";
|
|
4
4
|
import { t as AgentPolicy } from "../AgentPolicy-B4oH8TbG.mjs";
|
|
5
5
|
import { h as DefinitionDigests } from "../Records-Bm4Qt70a.mjs";
|
|
6
|
-
import { $t as ParentLinkage, Gr as ThreadNotMaterialized, Or as AppendConflict, Wt as LedgerError, _t as AdmissionPolicyError, bt as AdmissionResult, ft as AdmissionConflict, ii as ThreadStoreError, jr as FenceRejected, ni as ThreadStore, vn as SubmissionLedger } from "../Admin-
|
|
6
|
+
import { $t as ParentLinkage, Gr as ThreadNotMaterialized, Or as AppendConflict, Wt as LedgerError, _t as AdmissionPolicyError, bt as AdmissionResult, ft as AdmissionConflict, ii as ThreadStoreError, jr as FenceRejected, ni as ThreadStore, vn as SubmissionLedger } from "../Admin-Vhz6NdaH.mjs";
|
|
7
7
|
import { n as DurableRuntimeFailpoint, r as DurableRuntimeFailpointError } from "../DurableFailpoint-Cnr3wx1L.mjs";
|
|
8
8
|
import { t as WakeScheduler } from "../WakeScheduler-EjUF-GhC.mjs";
|
|
9
9
|
import { Context, Effect, Schema } from "effect";
|
|
@@ -5,7 +5,7 @@ import { t as AgentPolicy } from "../AgentPolicy-B4oH8TbG.mjs";
|
|
|
5
5
|
import { r as AnyDefinition, t as Agent_d_exports } from "../Agent-ZfnNCQXs.mjs";
|
|
6
6
|
import { c as WorkerError, f as WorkerRef, h as WorkerSource } from "../Worker-XEBYxRQv.mjs";
|
|
7
7
|
import { _ as Digest, d as CanonicalSequence, h as DefinitionDigests, k as PersistedJson, pt as WorkerOrigin, ut as WorkerContinuation } from "../Records-Bm4Qt70a.mjs";
|
|
8
|
-
import { Tn as SubmissionSnapshot } from "../Admin-
|
|
8
|
+
import { Tn as SubmissionSnapshot } from "../Admin-Vhz6NdaH.mjs";
|
|
9
9
|
import { Context, Effect, Option, Schema } from "effect";
|
|
10
10
|
declare namespace WorkerHost_d_exports {
|
|
11
11
|
export { WorkerBudgetAuthorizer, WorkerConcurrencyLimit, WorkerConcurrencyResolver, WorkerHostAuthorizationRequest, WorkerHostAuthorizer, WorkerHostConfig, WorkerHostLimits, WorkerPolicyResolver, WorkerPolicySource, WorkerPolicyTarget, WorkerStartAdmission };
|
package/dist/index.d.mts
CHANGED
|
@@ -60,17 +60,17 @@ import { t as Memory_d_exports } from "./core/Memory.mjs";
|
|
|
60
60
|
import { P as Records_d_exports } from "./Records-Bm4Qt70a.mjs";
|
|
61
61
|
import { t as ActivityStore_d_exports } from "./durable/ActivityStore.mjs";
|
|
62
62
|
import { n as Digest_d_exports } from "./Digest-COAt3Orl.mjs";
|
|
63
|
-
import { J as Recovery_d_exports, Pa as AgentRegistration_d_exports, Pi as RunJournal_d_exports, Qn as DurableAgentRuntime_d_exports, Si as LifecyclePublication_d_exports, bn as SubmissionLedger_d_exports, ki as SubmissionStatus_d_exports, oi as ThreadStore_d_exports, t as Admin_d_exports } from "./Admin-
|
|
63
|
+
import { J as Recovery_d_exports, Pa as AgentRegistration_d_exports, Pi as RunJournal_d_exports, Qn as DurableAgentRuntime_d_exports, Si as LifecyclePublication_d_exports, bn as SubmissionLedger_d_exports, ki as SubmissionStatus_d_exports, oi as ThreadStore_d_exports, t as Admin_d_exports } from "./Admin-Vhz6NdaH.mjs";
|
|
64
64
|
import { t as DurableFailpoint_d_exports } from "./DurableFailpoint-Cnr3wx1L.mjs";
|
|
65
65
|
import { a as OperationAuthorizer_d_exports } from "./OperationAuthorizer-TzcQtpX5.mjs";
|
|
66
66
|
import { l as ToolReconciler_d_exports } from "./ToolReconciler-BmVRAHKs.mjs";
|
|
67
67
|
import { n as WakeScheduler_d_exports } from "./WakeScheduler-EjUF-GhC.mjs";
|
|
68
68
|
import { t as CommittedActivity_d_exports } from "./durable/CommittedActivity.mjs";
|
|
69
69
|
import { R as Schedule_d_exports } from "./Schedule-Bi_XVKLF.mjs";
|
|
70
|
-
import { k as Subscription_d_exports } from "./Subscription-
|
|
71
|
-
import { n as EventSource_d_exports } from "./EventSource-
|
|
72
|
-
import { n as PreparedInputAdmission_d_exports } from "./PreparedInputAdmission-
|
|
73
|
-
import { r as SubscriptionInput_d_exports } from "./SubscriptionInput-
|
|
70
|
+
import { k as Subscription_d_exports } from "./Subscription-nbSNY6Hs.mjs";
|
|
71
|
+
import { n as EventSource_d_exports } from "./EventSource-CtS0RBM7.mjs";
|
|
72
|
+
import { n as PreparedInputAdmission_d_exports } from "./PreparedInputAdmission-CS_zlCvD.mjs";
|
|
73
|
+
import { r as SubscriptionInput_d_exports } from "./SubscriptionInput-DbXnOMS2.mjs";
|
|
74
74
|
import { t as Subscriptions_d_exports } from "./durable/Subscriptions.mjs";
|
|
75
75
|
import { t as MessageDelivery_d_exports } from "./durable/MessageDelivery.mjs";
|
|
76
76
|
import { t as PersistentHistory_d_exports } from "./durable/PersistentHistory.mjs";
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"effect-agent","version":"0.1.0-beta.161","devDependencies":{"@effect/platform-node":"4.0.0-rc.117","@effect/vitest":"4.0.0-rc.117","effect":"4.0.0-rc.117","typescript":"7.0.2","vite-plus":"0.3.3"},"peerDependencies":{"effect":"^4.0.0-rc.117"},"exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./activity-store":{"types":"./dist/durable/ActivityStore.d.mts","default":"./dist/durable/ActivityStore.mjs"},"./admin":{"types":"./dist/durable/Admin.d.mts","default":"./dist/durable/Admin.mjs"},"./agent":{"types":"./dist/core/Agent.d.mts","default":"./dist/core/Agent.mjs"},"./agent-error":{"types":"./dist/core/AgentError.d.mts","default":"./dist/core/AgentError.mjs"},"./agent-policy":{"types":"./dist/core/AgentPolicy.d.mts","default":"./dist/core/AgentPolicy.mjs"},"./agent-registration":{"types":"./dist/durable/AgentRegistration.d.mts","default":"./dist/durable/AgentRegistration.mjs"},"./agent-runtime":{"types":"./dist/engine/AgentRuntime.d.mts","default":"./dist/engine/AgentRuntime.mjs"},"./agent-updates":{"types":"./dist/core/AgentUpdates.d.mts","default":"./dist/core/AgentUpdates.mjs"},"./approval":{"types":"./dist/capabilities/Approval.d.mts","default":"./dist/capabilities/Approval.mjs"},"./browser-use":{"types":"./dist/capabilities/BrowserUse.d.mts","default":"./dist/capabilities/BrowserUse.mjs"},"./budget":{"types":"./dist/capabilities/Budget.d.mts","default":"./dist/capabilities/Budget.mjs"},"./code-executor":{"types":"./dist/sandbox/CodeExecutor.d.mts","default":"./dist/sandbox/CodeExecutor.mjs"},"./code-mode":{"types":"./dist/capabilities/CodeMode.d.mts","default":"./dist/capabilities/CodeMode.mjs"},"./commands":{"types":"./dist/capabilities/Commands.d.mts","default":"./dist/capabilities/Commands.mjs"},"./committed-activity":{"types":"./dist/durable/CommittedActivity.d.mts","default":"./dist/durable/CommittedActivity.mjs"},"./compaction":{"types":"./dist/engine/Compaction.d.mts","default":"./dist/engine/Compaction.mjs"},"./context-compactor":{"types":"./dist/engine/ContextCompactor.d.mts","default":"./dist/engine/ContextCompactor.mjs"},"./context-history":{"types":"./dist/engine/ContextHistory.d.mts","default":"./dist/engine/ContextHistory.mjs"},"./context-tools":{"types":"./dist/capabilities/ContextTools.d.mts","default":"./dist/capabilities/ContextTools.mjs"},"./context-window":{"types":"./dist/engine/ContextWindow.d.mts","default":"./dist/engine/ContextWindow.mjs"},"./digest":{"types":"./dist/durable/Digest.d.mts","default":"./dist/durable/Digest.mjs"},"./durable-agent-runtime":{"types":"./dist/durable/DurableAgentRuntime.d.mts","default":"./dist/durable/DurableAgentRuntime.mjs"},"./durable-failpoint":{"types":"./dist/durable/DurableFailpoint.d.mts","default":"./dist/durable/DurableFailpoint.mjs"},"./durable-step":{"types":"./dist/engine/DurableStep.d.mts","default":"./dist/engine/DurableStep.mjs"},"./event-source":{"types":"./dist/durable/EventSource.d.mts","default":"./dist/durable/EventSource.mjs"},"./failure-diagnostic":{"types":"./dist/core/FailureDiagnostic.d.mts","default":"./dist/core/FailureDiagnostic.mjs"},"./git-hub-workflow-source":{"types":"./dist/durable/GitHubWorkflowSource.d.mts","default":"./dist/durable/GitHubWorkflowSource.mjs"},"./id-generator":{"types":"./dist/core/IdGenerator.d.mts","default":"./dist/core/IdGenerator.mjs"},"./identifiers":{"types":"./dist/core/Identifiers.d.mts","default":"./dist/core/Identifiers.mjs"},"./in-memory":{"types":"./dist/InMemory.d.mts","default":"./dist/InMemory.mjs"},"./interactive-browser":{"types":"./dist/sandbox/InteractiveBrowser.d.mts","default":"./dist/sandbox/InteractiveBrowser.mjs"},"./mcp":{"types":"./dist/capabilities/Mcp.d.mts","default":"./dist/capabilities/Mcp.mjs"},"./mcp-client":{"types":"./dist/capabilities/McpClient.d.mts","default":"./dist/capabilities/McpClient.mjs"},"./memory":{"types":"./dist/core/Memory.d.mts","default":"./dist/core/Memory.mjs"},"./memory-namespace":{"types":"./dist/core/MemoryNamespace.d.mts","default":"./dist/core/MemoryNamespace.mjs"},"./memory-notes":{"types":"./dist/capabilities/MemoryNotes.d.mts","default":"./dist/capabilities/MemoryNotes.mjs"},"./memory-reference":{"types":"./dist/core/MemoryReference.d.mts","default":"./dist/core/MemoryReference.mjs"},"./memory-revalidation":{"types":"./dist/core/MemoryRevalidation.d.mts","default":"./dist/core/MemoryRevalidation.mjs"},"./memory-store":{"types":"./dist/core/MemoryStore.d.mts","default":"./dist/core/MemoryStore.mjs"},"./message-delivery":{"types":"./dist/durable/MessageDelivery.d.mts","default":"./dist/durable/MessageDelivery.mjs"},"./messaging":{"types":"./dist/capabilities/Messaging.d.mts","default":"./dist/capabilities/Messaging.mjs"},"./messaging-host":{"types":"./dist/engine/MessagingHost.d.mts","default":"./dist/engine/MessagingHost.mjs"},"./model-context":{"types":"./dist/capabilities/ModelContext.d.mts","default":"./dist/capabilities/ModelContext.mjs"},"./operation-authorizer":{"types":"./dist/durable/OperationAuthorizer.d.mts","default":"./dist/durable/OperationAuthorizer.mjs"},"./output":{"types":"./dist/engine/Output.d.mts","default":"./dist/engine/Output.mjs"},"./page-capture":{"types":"./dist/sandbox/PageCapture.d.mts","default":"./dist/sandbox/PageCapture.mjs"},"./page-crawl":{"types":"./dist/sandbox/PageCrawl.d.mts","default":"./dist/sandbox/PageCrawl.mjs"},"./page-screenshot":{"types":"./dist/sandbox/PageScreenshot.d.mts","default":"./dist/sandbox/PageScreenshot.mjs"},"./persistent-history":{"types":"./dist/durable/PersistentHistory.d.mts","default":"./dist/durable/PersistentHistory.mjs"},"./prepared-input-admission":{"types":"./dist/durable/PreparedInputAdmission.d.mts","default":"./dist/durable/PreparedInputAdmission.mjs"},"./receipt":{"types":"./dist/core/Receipt.d.mts","default":"./dist/core/Receipt.mjs"},"./records":{"types":"./dist/durable/Records.d.mts","default":"./dist/durable/Records.mjs"},"./recovery":{"types":"./dist/durable/Recovery.d.mts","default":"./dist/durable/Recovery.mjs"},"./redaction":{"types":"./dist/capabilities/Redaction.d.mts","default":"./dist/capabilities/Redaction.mjs"},"./remembering":{"types":"./dist/capabilities/Remembering.d.mts","default":"./dist/capabilities/Remembering.mjs"},"./remembering-store":{"types":"./dist/core/RememberingStore.d.mts","default":"./dist/core/RememberingStore.mjs"},"./run-event":{"types":"./dist/core/RunEvent.d.mts","default":"./dist/core/RunEvent.mjs"},"./run-event-sink":{"types":"./dist/engine/RunEventSink.d.mts","default":"./dist/engine/RunEventSink.mjs"},"./run-hooks":{"types":"./dist/capabilities/RunHooks.d.mts","default":"./dist/capabilities/RunHooks.mjs"},"./run-journal":{"types":"./dist/durable/RunJournal.d.mts","default":"./dist/durable/RunJournal.mjs"},"./run-options":{"types":"./dist/engine/RunOptions.d.mts","default":"./dist/engine/RunOptions.mjs"},"./run-policy-usage":{"types":"./dist/core/RunPolicyUsage.d.mts","default":"./dist/core/RunPolicyUsage.mjs"},"./sandbox":{"types":"./dist/sandbox/Sandbox.d.mts","default":"./dist/sandbox/Sandbox.mjs"},"./schedule":{"types":"./dist/durable/Schedule.d.mts","default":"./dist/durable/Schedule.mjs"},"./schedule-transition":{"types":"./dist/durable/ScheduleTransition.d.mts","default":"./dist/durable/ScheduleTransition.mjs"},"./scheduling":{"types":"./dist/durable/Scheduling.d.mts","default":"./dist/durable/Scheduling.mjs"},"./semantic-memory":{"types":"./dist/capabilities/SemanticMemory.d.mts","default":"./dist/capabilities/SemanticMemory.mjs"},"./semantic-memory-index":{"types":"./dist/core/SemanticMemoryIndex.d.mts","default":"./dist/core/SemanticMemoryIndex.mjs"},"./semantic-memory-revalidation":{"types":"./dist/core/SemanticMemoryRevalidation.d.mts","default":"./dist/core/SemanticMemoryRevalidation.mjs"},"./sql-memory-store":{"types":"./dist/durable/SqlMemoryStore.d.mts","default":"./dist/durable/SqlMemoryStore.mjs"},"./subagent":{"types":"./dist/capabilities/Subagent.d.mts","default":"./dist/capabilities/Subagent.mjs"},"./subagent-contract":{"types":"./dist/core/SubagentContract.d.mts","default":"./dist/core/SubagentContract.mjs"},"./subagent-host":{"types":"./dist/engine/SubagentHost.d.mts","default":"./dist/engine/SubagentHost.mjs"},"./subagent-reservations":{"types":"./dist/capabilities/SubagentReservations.d.mts","default":"./dist/capabilities/SubagentReservations.mjs"},"./submission-ledger":{"types":"./dist/durable/SubmissionLedger.d.mts","default":"./dist/durable/SubmissionLedger.mjs"},"./submission-status":{"types":"./dist/durable/SubmissionStatus.d.mts","default":"./dist/durable/SubmissionStatus.mjs"},"./subscription":{"types":"./dist/durable/Subscription.d.mts","default":"./dist/durable/Subscription.mjs"},"./subscription-input":{"types":"./dist/durable/SubscriptionInput.d.mts","default":"./dist/durable/SubscriptionInput.mjs"},"./subscription-tools":{"types":"./dist/durable/SubscriptionTools.d.mts","default":"./dist/durable/SubscriptionTools.mjs"},"./subscription-transition":{"types":"./dist/durable/SubscriptionTransition.d.mts","default":"./dist/durable/SubscriptionTransition.mjs"},"./subscriptions":{"types":"./dist/durable/Subscriptions.d.mts","default":"./dist/durable/Subscriptions.mjs"},"./testing/certification":{"types":"./dist/durable/Certification.d.mts","default":"./dist/durable/Certification.mjs"},"./testing/durable-failpoint-test-control":{"types":"./dist/durable/DurableFailpointTestControl.d.mts","default":"./dist/durable/DurableFailpointTestControl.mjs"},"./testing/message-delivery-store-conformance":{"types":"./dist/durable/MessageDeliveryStoreConformance.d.mts","default":"./dist/durable/MessageDeliveryStoreConformance.mjs"},"./testing/schedule-store-conformance":{"types":"./dist/durable/ScheduleStoreConformance.d.mts","default":"./dist/durable/ScheduleStoreConformance.mjs"},"./testing/submission-ledger-conformance":{"types":"./dist/durable/SubmissionLedgerConformance.d.mts","default":"./dist/durable/SubmissionLedgerConformance.mjs"},"./testing/subscription-store-conformance":{"types":"./dist/durable/SubscriptionStoreConformance.d.mts","default":"./dist/durable/SubscriptionStoreConformance.mjs"},"./testing/thread-store-conformance":{"types":"./dist/durable/ThreadStoreConformance.d.mts","default":"./dist/durable/ThreadStoreConformance.mjs"},"./thread":{"types":"./dist/core/Thread.d.mts","default":"./dist/core/Thread.mjs"},"./thread-context-history":{"types":"./dist/durable/ThreadContextHistory.d.mts","default":"./dist/durable/ThreadContextHistory.mjs"},"./thread-context-history-projection":{"types":"./dist/durable/ThreadContextHistoryProjection.d.mts","default":"./dist/durable/ThreadContextHistoryProjection.mjs"},"./thread-history":{"types":"./dist/engine/ThreadHistory.d.mts","default":"./dist/engine/ThreadHistory.mjs"},"./thread-invariants":{"types":"./dist/durable/ThreadInvariants.d.mts","default":"./dist/durable/ThreadInvariants.mjs"},"./thread-projection":{"types":"./dist/durable/ThreadProjection.d.mts","default":"./dist/durable/ThreadProjection.mjs"},"./thread-projection-maintenance":{"types":"./dist/durable/ThreadProjectionMaintenance.d.mts","default":"./dist/durable/ThreadProjectionMaintenance.mjs"},"./thread-store":{"types":"./dist/durable/ThreadStore.d.mts","default":"./dist/durable/ThreadStore.mjs"},"./tool-broker":{"types":"./dist/engine/ToolBroker.d.mts","default":"./dist/engine/ToolBroker.mjs"},"./tool-discovery":{"types":"./dist/capabilities/ToolDiscovery.d.mts","default":"./dist/capabilities/ToolDiscovery.mjs"},"./tool-exposure":{"types":"./dist/ToolExposure.d.mts","default":"./dist/ToolExposure.mjs"},"./tool-reconciler":{"types":"./dist/durable/ToolReconciler.d.mts","default":"./dist/durable/ToolReconciler.mjs"},"./tool-result":{"types":"./dist/core/ToolResult.d.mts","default":"./dist/core/ToolResult.mjs"},"./usage":{"types":"./dist/core/Usage.d.mts","default":"./dist/core/Usage.mjs"},"./wake-scheduler":{"types":"./dist/durable/WakeScheduler.d.mts","default":"./dist/durable/WakeScheduler.mjs"},"./web-capture":{"types":"./dist/capabilities/WebCapture.d.mts","default":"./dist/capabilities/WebCapture.mjs"},"./web-search":{"types":"./dist/capabilities/WebSearch.d.mts","default":"./dist/capabilities/WebSearch.mjs"},"./worker":{"types":"./dist/core/Worker.d.mts","default":"./dist/core/Worker.mjs"},"./worker-admission":{"types":"./dist/durable/WorkerAdmission.d.mts","default":"./dist/durable/WorkerAdmission.mjs"},"./worker-host":{"types":"./dist/durable/WorkerHost.d.mts","default":"./dist/durable/WorkerHost.mjs"},"./lifecycle-publication":{"types":"./dist/durable/LifecyclePublication.d.mts","default":"./dist/durable/LifecyclePublication.mjs"}},"description":"Effect-native agents, execution, subagents, and sandbox contracts in one tree-shakeable package.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/danieljvdm/effect-agent.git","directory":"packages/effect-agent"},"files":["dist","src"],"type":"module","sideEffects":[],"publishConfig":{"access":"public"},"scripts":{"build":"vp pack","check":"tsc --noEmit -p tsconfig.json","test":"vp test --passWithNoTests"}}
|
|
1
|
+
{"name":"effect-agent","version":"0.1.0-beta.162","devDependencies":{"@effect/platform-node":"4.0.0-rc.117","@effect/vitest":"4.0.0-rc.117","effect":"4.0.0-rc.117","typescript":"7.0.2","vite-plus":"0.3.3"},"peerDependencies":{"effect":"^4.0.0-rc.117"},"exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./activity-store":{"types":"./dist/durable/ActivityStore.d.mts","default":"./dist/durable/ActivityStore.mjs"},"./admin":{"types":"./dist/durable/Admin.d.mts","default":"./dist/durable/Admin.mjs"},"./agent":{"types":"./dist/core/Agent.d.mts","default":"./dist/core/Agent.mjs"},"./agent-error":{"types":"./dist/core/AgentError.d.mts","default":"./dist/core/AgentError.mjs"},"./agent-policy":{"types":"./dist/core/AgentPolicy.d.mts","default":"./dist/core/AgentPolicy.mjs"},"./agent-registration":{"types":"./dist/durable/AgentRegistration.d.mts","default":"./dist/durable/AgentRegistration.mjs"},"./agent-runtime":{"types":"./dist/engine/AgentRuntime.d.mts","default":"./dist/engine/AgentRuntime.mjs"},"./agent-updates":{"types":"./dist/core/AgentUpdates.d.mts","default":"./dist/core/AgentUpdates.mjs"},"./approval":{"types":"./dist/capabilities/Approval.d.mts","default":"./dist/capabilities/Approval.mjs"},"./browser-use":{"types":"./dist/capabilities/BrowserUse.d.mts","default":"./dist/capabilities/BrowserUse.mjs"},"./budget":{"types":"./dist/capabilities/Budget.d.mts","default":"./dist/capabilities/Budget.mjs"},"./code-executor":{"types":"./dist/sandbox/CodeExecutor.d.mts","default":"./dist/sandbox/CodeExecutor.mjs"},"./code-mode":{"types":"./dist/capabilities/CodeMode.d.mts","default":"./dist/capabilities/CodeMode.mjs"},"./commands":{"types":"./dist/capabilities/Commands.d.mts","default":"./dist/capabilities/Commands.mjs"},"./committed-activity":{"types":"./dist/durable/CommittedActivity.d.mts","default":"./dist/durable/CommittedActivity.mjs"},"./compaction":{"types":"./dist/engine/Compaction.d.mts","default":"./dist/engine/Compaction.mjs"},"./context-compactor":{"types":"./dist/engine/ContextCompactor.d.mts","default":"./dist/engine/ContextCompactor.mjs"},"./context-history":{"types":"./dist/engine/ContextHistory.d.mts","default":"./dist/engine/ContextHistory.mjs"},"./context-tools":{"types":"./dist/capabilities/ContextTools.d.mts","default":"./dist/capabilities/ContextTools.mjs"},"./context-window":{"types":"./dist/engine/ContextWindow.d.mts","default":"./dist/engine/ContextWindow.mjs"},"./digest":{"types":"./dist/durable/Digest.d.mts","default":"./dist/durable/Digest.mjs"},"./durable-agent-runtime":{"types":"./dist/durable/DurableAgentRuntime.d.mts","default":"./dist/durable/DurableAgentRuntime.mjs"},"./durable-failpoint":{"types":"./dist/durable/DurableFailpoint.d.mts","default":"./dist/durable/DurableFailpoint.mjs"},"./durable-step":{"types":"./dist/engine/DurableStep.d.mts","default":"./dist/engine/DurableStep.mjs"},"./event-source":{"types":"./dist/durable/EventSource.d.mts","default":"./dist/durable/EventSource.mjs"},"./failure-diagnostic":{"types":"./dist/core/FailureDiagnostic.d.mts","default":"./dist/core/FailureDiagnostic.mjs"},"./git-hub-workflow-source":{"types":"./dist/durable/GitHubWorkflowSource.d.mts","default":"./dist/durable/GitHubWorkflowSource.mjs"},"./id-generator":{"types":"./dist/core/IdGenerator.d.mts","default":"./dist/core/IdGenerator.mjs"},"./identifiers":{"types":"./dist/core/Identifiers.d.mts","default":"./dist/core/Identifiers.mjs"},"./in-memory":{"types":"./dist/InMemory.d.mts","default":"./dist/InMemory.mjs"},"./interactive-browser":{"types":"./dist/sandbox/InteractiveBrowser.d.mts","default":"./dist/sandbox/InteractiveBrowser.mjs"},"./mcp":{"types":"./dist/capabilities/Mcp.d.mts","default":"./dist/capabilities/Mcp.mjs"},"./mcp-client":{"types":"./dist/capabilities/McpClient.d.mts","default":"./dist/capabilities/McpClient.mjs"},"./memory":{"types":"./dist/core/Memory.d.mts","default":"./dist/core/Memory.mjs"},"./memory-namespace":{"types":"./dist/core/MemoryNamespace.d.mts","default":"./dist/core/MemoryNamespace.mjs"},"./memory-notes":{"types":"./dist/capabilities/MemoryNotes.d.mts","default":"./dist/capabilities/MemoryNotes.mjs"},"./memory-reference":{"types":"./dist/core/MemoryReference.d.mts","default":"./dist/core/MemoryReference.mjs"},"./memory-revalidation":{"types":"./dist/core/MemoryRevalidation.d.mts","default":"./dist/core/MemoryRevalidation.mjs"},"./memory-store":{"types":"./dist/core/MemoryStore.d.mts","default":"./dist/core/MemoryStore.mjs"},"./message-delivery":{"types":"./dist/durable/MessageDelivery.d.mts","default":"./dist/durable/MessageDelivery.mjs"},"./messaging":{"types":"./dist/capabilities/Messaging.d.mts","default":"./dist/capabilities/Messaging.mjs"},"./messaging-host":{"types":"./dist/engine/MessagingHost.d.mts","default":"./dist/engine/MessagingHost.mjs"},"./model-context":{"types":"./dist/capabilities/ModelContext.d.mts","default":"./dist/capabilities/ModelContext.mjs"},"./operation-authorizer":{"types":"./dist/durable/OperationAuthorizer.d.mts","default":"./dist/durable/OperationAuthorizer.mjs"},"./output":{"types":"./dist/engine/Output.d.mts","default":"./dist/engine/Output.mjs"},"./page-capture":{"types":"./dist/sandbox/PageCapture.d.mts","default":"./dist/sandbox/PageCapture.mjs"},"./page-crawl":{"types":"./dist/sandbox/PageCrawl.d.mts","default":"./dist/sandbox/PageCrawl.mjs"},"./page-screenshot":{"types":"./dist/sandbox/PageScreenshot.d.mts","default":"./dist/sandbox/PageScreenshot.mjs"},"./persistent-history":{"types":"./dist/durable/PersistentHistory.d.mts","default":"./dist/durable/PersistentHistory.mjs"},"./prepared-input-admission":{"types":"./dist/durable/PreparedInputAdmission.d.mts","default":"./dist/durable/PreparedInputAdmission.mjs"},"./receipt":{"types":"./dist/core/Receipt.d.mts","default":"./dist/core/Receipt.mjs"},"./records":{"types":"./dist/durable/Records.d.mts","default":"./dist/durable/Records.mjs"},"./recovery":{"types":"./dist/durable/Recovery.d.mts","default":"./dist/durable/Recovery.mjs"},"./redaction":{"types":"./dist/capabilities/Redaction.d.mts","default":"./dist/capabilities/Redaction.mjs"},"./remembering":{"types":"./dist/capabilities/Remembering.d.mts","default":"./dist/capabilities/Remembering.mjs"},"./remembering-store":{"types":"./dist/core/RememberingStore.d.mts","default":"./dist/core/RememberingStore.mjs"},"./run-event":{"types":"./dist/core/RunEvent.d.mts","default":"./dist/core/RunEvent.mjs"},"./run-event-sink":{"types":"./dist/engine/RunEventSink.d.mts","default":"./dist/engine/RunEventSink.mjs"},"./run-hooks":{"types":"./dist/capabilities/RunHooks.d.mts","default":"./dist/capabilities/RunHooks.mjs"},"./run-journal":{"types":"./dist/durable/RunJournal.d.mts","default":"./dist/durable/RunJournal.mjs"},"./run-options":{"types":"./dist/engine/RunOptions.d.mts","default":"./dist/engine/RunOptions.mjs"},"./run-policy-usage":{"types":"./dist/core/RunPolicyUsage.d.mts","default":"./dist/core/RunPolicyUsage.mjs"},"./sandbox":{"types":"./dist/sandbox/Sandbox.d.mts","default":"./dist/sandbox/Sandbox.mjs"},"./schedule":{"types":"./dist/durable/Schedule.d.mts","default":"./dist/durable/Schedule.mjs"},"./schedule-transition":{"types":"./dist/durable/ScheduleTransition.d.mts","default":"./dist/durable/ScheduleTransition.mjs"},"./scheduling":{"types":"./dist/durable/Scheduling.d.mts","default":"./dist/durable/Scheduling.mjs"},"./semantic-memory":{"types":"./dist/capabilities/SemanticMemory.d.mts","default":"./dist/capabilities/SemanticMemory.mjs"},"./semantic-memory-index":{"types":"./dist/core/SemanticMemoryIndex.d.mts","default":"./dist/core/SemanticMemoryIndex.mjs"},"./semantic-memory-revalidation":{"types":"./dist/core/SemanticMemoryRevalidation.d.mts","default":"./dist/core/SemanticMemoryRevalidation.mjs"},"./sql-memory-store":{"types":"./dist/durable/SqlMemoryStore.d.mts","default":"./dist/durable/SqlMemoryStore.mjs"},"./subagent":{"types":"./dist/capabilities/Subagent.d.mts","default":"./dist/capabilities/Subagent.mjs"},"./subagent-contract":{"types":"./dist/core/SubagentContract.d.mts","default":"./dist/core/SubagentContract.mjs"},"./subagent-host":{"types":"./dist/engine/SubagentHost.d.mts","default":"./dist/engine/SubagentHost.mjs"},"./subagent-reservations":{"types":"./dist/capabilities/SubagentReservations.d.mts","default":"./dist/capabilities/SubagentReservations.mjs"},"./submission-ledger":{"types":"./dist/durable/SubmissionLedger.d.mts","default":"./dist/durable/SubmissionLedger.mjs"},"./submission-status":{"types":"./dist/durable/SubmissionStatus.d.mts","default":"./dist/durable/SubmissionStatus.mjs"},"./subscription":{"types":"./dist/durable/Subscription.d.mts","default":"./dist/durable/Subscription.mjs"},"./subscription-input":{"types":"./dist/durable/SubscriptionInput.d.mts","default":"./dist/durable/SubscriptionInput.mjs"},"./subscription-tools":{"types":"./dist/durable/SubscriptionTools.d.mts","default":"./dist/durable/SubscriptionTools.mjs"},"./subscription-transition":{"types":"./dist/durable/SubscriptionTransition.d.mts","default":"./dist/durable/SubscriptionTransition.mjs"},"./subscriptions":{"types":"./dist/durable/Subscriptions.d.mts","default":"./dist/durable/Subscriptions.mjs"},"./testing/certification":{"types":"./dist/durable/Certification.d.mts","default":"./dist/durable/Certification.mjs"},"./testing/durable-failpoint-test-control":{"types":"./dist/durable/DurableFailpointTestControl.d.mts","default":"./dist/durable/DurableFailpointTestControl.mjs"},"./testing/message-delivery-store-conformance":{"types":"./dist/durable/MessageDeliveryStoreConformance.d.mts","default":"./dist/durable/MessageDeliveryStoreConformance.mjs"},"./testing/schedule-store-conformance":{"types":"./dist/durable/ScheduleStoreConformance.d.mts","default":"./dist/durable/ScheduleStoreConformance.mjs"},"./testing/submission-ledger-conformance":{"types":"./dist/durable/SubmissionLedgerConformance.d.mts","default":"./dist/durable/SubmissionLedgerConformance.mjs"},"./testing/subscription-store-conformance":{"types":"./dist/durable/SubscriptionStoreConformance.d.mts","default":"./dist/durable/SubscriptionStoreConformance.mjs"},"./testing/thread-store-conformance":{"types":"./dist/durable/ThreadStoreConformance.d.mts","default":"./dist/durable/ThreadStoreConformance.mjs"},"./thread":{"types":"./dist/core/Thread.d.mts","default":"./dist/core/Thread.mjs"},"./thread-context-history":{"types":"./dist/durable/ThreadContextHistory.d.mts","default":"./dist/durable/ThreadContextHistory.mjs"},"./thread-context-history-projection":{"types":"./dist/durable/ThreadContextHistoryProjection.d.mts","default":"./dist/durable/ThreadContextHistoryProjection.mjs"},"./thread-history":{"types":"./dist/engine/ThreadHistory.d.mts","default":"./dist/engine/ThreadHistory.mjs"},"./thread-invariants":{"types":"./dist/durable/ThreadInvariants.d.mts","default":"./dist/durable/ThreadInvariants.mjs"},"./thread-projection":{"types":"./dist/durable/ThreadProjection.d.mts","default":"./dist/durable/ThreadProjection.mjs"},"./thread-projection-maintenance":{"types":"./dist/durable/ThreadProjectionMaintenance.d.mts","default":"./dist/durable/ThreadProjectionMaintenance.mjs"},"./thread-store":{"types":"./dist/durable/ThreadStore.d.mts","default":"./dist/durable/ThreadStore.mjs"},"./tool-broker":{"types":"./dist/engine/ToolBroker.d.mts","default":"./dist/engine/ToolBroker.mjs"},"./tool-discovery":{"types":"./dist/capabilities/ToolDiscovery.d.mts","default":"./dist/capabilities/ToolDiscovery.mjs"},"./tool-exposure":{"types":"./dist/ToolExposure.d.mts","default":"./dist/ToolExposure.mjs"},"./tool-reconciler":{"types":"./dist/durable/ToolReconciler.d.mts","default":"./dist/durable/ToolReconciler.mjs"},"./tool-result":{"types":"./dist/core/ToolResult.d.mts","default":"./dist/core/ToolResult.mjs"},"./usage":{"types":"./dist/core/Usage.d.mts","default":"./dist/core/Usage.mjs"},"./wake-scheduler":{"types":"./dist/durable/WakeScheduler.d.mts","default":"./dist/durable/WakeScheduler.mjs"},"./web-capture":{"types":"./dist/capabilities/WebCapture.d.mts","default":"./dist/capabilities/WebCapture.mjs"},"./web-search":{"types":"./dist/capabilities/WebSearch.d.mts","default":"./dist/capabilities/WebSearch.mjs"},"./worker":{"types":"./dist/core/Worker.d.mts","default":"./dist/core/Worker.mjs"},"./worker-admission":{"types":"./dist/durable/WorkerAdmission.d.mts","default":"./dist/durable/WorkerAdmission.mjs"},"./worker-host":{"types":"./dist/durable/WorkerHost.d.mts","default":"./dist/durable/WorkerHost.mjs"},"./lifecycle-publication":{"types":"./dist/durable/LifecyclePublication.d.mts","default":"./dist/durable/LifecyclePublication.mjs"}},"description":"Effect-native agents, execution, subagents, and sandbox contracts in one tree-shakeable package.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/danieljvdm/effect-agent.git","directory":"packages/effect-agent"},"files":["dist","src"],"type":"module","sideEffects":[],"publishConfig":{"access":"public"},"scripts":{"build":"vp pack","check":"tsc --noEmit -p tsconfig.json","test":"vp test --passWithNoTests"}}
|
|
@@ -158,6 +158,14 @@ export interface LifecyclePublicationStorage {
|
|
|
158
158
|
readonly acknowledge: (
|
|
159
159
|
publications: LifecyclePublicationBatch,
|
|
160
160
|
) => Effect.Effect<void, LifecyclePublicationError>;
|
|
161
|
+
/** Optional atomic acknowledgement of up to 100 successfully published owner batches.
|
|
162
|
+
* Validate every exact batch before consuming any debt. Empty waves succeed without writes.
|
|
163
|
+
* Wrappers that validate acknowledgement authority must wrap this method too.
|
|
164
|
+
* Custom services may omit this; drains then acknowledge each batch immediately.
|
|
165
|
+
*/
|
|
166
|
+
readonly acknowledgeMany?: (
|
|
167
|
+
batches: ReadonlyArray<LifecyclePublicationBatch>,
|
|
168
|
+
) => Effect.Effect<void, LifecyclePublicationError>;
|
|
161
169
|
/**
|
|
162
170
|
* Claim a due owner batch and persist its retry before dispatch. Eight automatic attempts;
|
|
163
171
|
* 1s exponential backoff capped at 60s, after the dispatch timeout. The final attempt parks
|
|
@@ -265,7 +273,9 @@ const withSource = Effect.fn("LifecyclePublication.withSource")(
|
|
|
265
273
|
* One finite wave for the host's existing maintenance coordinator. Persist the next deadline
|
|
266
274
|
* before dispatch, so interruption and process loss retain the same facts without another timer.
|
|
267
275
|
* Finish independent owner batches before surfacing failures; interruption stops the wave.
|
|
268
|
-
* Acknowledgements are exact and idempotent.
|
|
276
|
+
* Acknowledgements are exact and idempotent. An optional storage wave acknowledgement commits
|
|
277
|
+
* completed batches in groups of up to 100, including when a later dispatch is interrupted. No producer or
|
|
278
|
+
* external Tool is re-executed here.
|
|
269
279
|
*/
|
|
270
280
|
export const drainLifecyclePublications = Effect.fn("LifecyclePublication.drain")(function* (
|
|
271
281
|
storage: LifecyclePublicationStorage,
|
|
@@ -275,37 +285,50 @@ export const drainLifecyclePublications = Effect.fn("LifecyclePublication.drain"
|
|
|
275
285
|
) {
|
|
276
286
|
const handler = yield* LifecyclePublicationHandler;
|
|
277
287
|
const pending = yield* storage.pending(yield* Clock.currentTimeMillis, limit, options);
|
|
278
|
-
|
|
288
|
+
const acknowledgeMany = storage.acknowledgeMany;
|
|
289
|
+
const published: Array<LifecyclePublicationBatch> = [];
|
|
279
290
|
let failures: Cause.Cause<LifecyclePublicationError> = Cause.empty;
|
|
280
291
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
Effect.
|
|
286
|
-
|
|
292
|
+
return yield* Effect.gen(function* () {
|
|
293
|
+
for (const batch of pending) {
|
|
294
|
+
yield* Effect.gen(function* () {
|
|
295
|
+
if (!(yield* storage.claim(batch, yield* Clock.currentTimeMillis, timeoutMillis))) return;
|
|
296
|
+
yield* Effect.scoped(
|
|
297
|
+
Effect.gen(function* () {
|
|
298
|
+
const publications = yield* Effect.forEach(batch, withSource);
|
|
287
299
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
300
|
+
yield* handler.publish(publications);
|
|
301
|
+
}),
|
|
302
|
+
).pipe(
|
|
303
|
+
Effect.timeoutOrElse({
|
|
304
|
+
duration: timeoutMillis,
|
|
305
|
+
orElse: () => LifecyclePublicationError.make({ reason: "unavailable" }),
|
|
306
|
+
}),
|
|
307
|
+
);
|
|
308
|
+
if (acknowledgeMany === undefined) yield* storage.acknowledge(batch);
|
|
309
|
+
else published.push(batch);
|
|
310
|
+
}).pipe(
|
|
311
|
+
Effect.catchCauseIf(
|
|
312
|
+
(cause) => !Cause.hasInterrupts(cause),
|
|
313
|
+
(cause) => {
|
|
314
|
+
failures = Cause.combine(failures, cause);
|
|
302
315
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
316
|
+
return Effect.void;
|
|
317
|
+
},
|
|
318
|
+
),
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
if (failures.reasons.length > 0) return yield* Effect.failCause(failures);
|
|
309
322
|
|
|
310
|
-
|
|
323
|
+
return pending.length;
|
|
324
|
+
}).pipe(
|
|
325
|
+
Effect.onExit(() =>
|
|
326
|
+
acknowledgeMany === undefined || published.length === 0
|
|
327
|
+
? Effect.void
|
|
328
|
+
: Effect.gen(function* () {
|
|
329
|
+
for (let offset = 0; offset < published.length; offset += 100)
|
|
330
|
+
yield* acknowledgeMany(published.slice(offset, offset + 100));
|
|
331
|
+
}),
|
|
332
|
+
),
|
|
333
|
+
);
|
|
311
334
|
});
|