effect-agent 0.1.0-beta.143 → 0.1.0-beta.148
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-CQMppCcy.d.mts → Admin-BzPfXvzC.d.mts} +37 -22
- package/dist/Agent-1DMSO_Fl.mjs.map +1 -1
- package/dist/{Agent-BWhD4Dvu.d.mts → Agent-Cjd_ZveM.d.mts} +7 -3
- package/dist/{AgentRuntime-xeCUXutN.mjs → AgentRuntime-D8U9gl9Q.mjs} +23 -18
- package/dist/AgentRuntime-D8U9gl9Q.mjs.map +1 -0
- package/dist/{AgentRuntime-B4kIzmSF.d.mts → AgentRuntime-DZdgNcBk.d.mts} +5 -5
- package/dist/{DurableAgentRuntime-D8GI66mP.mjs → DurableAgentRuntime-N5Meflyt.mjs} +70 -42
- package/dist/DurableAgentRuntime-N5Meflyt.mjs.map +1 -0
- package/dist/{EventSource-w9PonN9X.d.mts → EventSource-DJW_1kPY.d.mts} +2 -2
- package/dist/{Messaging-Dnmk31yq.d.mts → Messaging-ccQURKCf.d.mts} +3 -3
- package/dist/{MessagingHost-CajpPDPG.d.mts → MessagingHost-D04wE-7W.d.mts} +2 -2
- package/dist/{Output-DhtWbBcw.d.mts → Output-CFD1CPfU.d.mts} +2 -2
- package/dist/{PreparedInputAdmission-BfcLy_k4.d.mts → PreparedInputAdmission-CNRSDoYu.d.mts} +3 -3
- package/dist/{RunOptions-IlEXLG5F.d.mts → RunOptions-Cy7CjrjS.d.mts} +2 -2
- package/dist/{Subagent-8RzJkqJ9.mjs → Subagent-hG9lJ7tJ.mjs} +2 -2
- package/dist/{Subagent-8RzJkqJ9.mjs.map → Subagent-hG9lJ7tJ.mjs.map} +1 -1
- package/dist/{Subagent-Cl8D1mFM.d.mts → Subagent-zS6prSK6.d.mts} +5 -5
- package/dist/{SubagentHost-B6f4PBC2.d.mts → SubagentHost-C-4A7tA2.d.mts} +2 -2
- package/dist/{Subscription-ClkC4_T0.d.mts → Subscription-C279AjM6.d.mts} +2 -2
- package/dist/{SubscriptionInput-CMjEKL1z.d.mts → SubscriptionInput-7R-Xrpxd.d.mts} +2 -2
- package/dist/capabilities/Commands.d.mts +1 -1
- package/dist/capabilities/Messaging.d.mts +1 -1
- package/dist/capabilities/RunHooks.d.mts +1 -1
- package/dist/capabilities/Subagent.d.mts +1 -1
- package/dist/capabilities/Subagent.mjs +1 -1
- package/dist/core/Agent.d.mts +1 -1
- package/dist/durable/Admin.d.mts +1 -1
- package/dist/durable/AgentRegistration.d.mts +1 -1
- package/dist/durable/Certification.d.mts +1 -1
- package/dist/durable/CommittedActivity.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.mjs +1 -1
- package/dist/durable/EventSource.d.mts +1 -1
- package/dist/durable/GitHubWorkflowSource.d.mts +3 -3
- package/dist/durable/LifecyclePublication.d.mts +2 -2
- package/dist/durable/LifecyclePublication.mjs +32 -12
- package/dist/durable/LifecyclePublication.mjs.map +1 -1
- package/dist/durable/MessageDelivery.d.mts +41 -41
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +39 -39
- package/dist/durable/PersistentHistory.d.mts +1 -1
- package/dist/durable/PreparedInputAdmission.d.mts +1 -1
- package/dist/durable/Recovery.d.mts +1 -1
- package/dist/durable/RunJournal.d.mts +1 -1
- package/dist/durable/Scheduling.d.mts +1 -1
- package/dist/durable/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/WorkerHost.d.mts +25 -5
- package/dist/durable/WorkerHost.mjs.map +1 -1
- package/dist/engine/AgentRuntime.d.mts +1 -1
- package/dist/engine/AgentRuntime.mjs +1 -1
- package/dist/engine/MessagingHost.d.mts +1 -1
- package/dist/engine/Output.d.mts +1 -1
- package/dist/engine/Output.mjs +1 -1
- package/dist/engine/RunOptions.d.mts +1 -1
- package/dist/engine/SubagentHost.d.mts +1 -1
- package/dist/index.d.mts +13 -13
- package/dist/index.mjs +3 -3
- package/dist/{output-contract-CANJJGA5.mjs → output-contract-DS-S8mTv.mjs} +46 -10
- package/dist/{output-contract-CANJJGA5.mjs.map → output-contract-DS-S8mTv.mjs.map} +1 -1
- package/package.json +1 -1
- package/src/core/Agent.ts +6 -2
- package/src/durable/DurableAgentRuntime.ts +50 -58
- package/src/durable/LifecyclePublication.ts +79 -25
- package/src/durable/WorkerHost.ts +23 -1
- package/src/durable/internal/worker-host.ts +169 -17
- package/src/engine/internal/agent-runtime.ts +80 -18
- package/src/engine/internal/output-contract.ts +67 -8
- package/dist/AgentRuntime-xeCUXutN.mjs.map +0 -1
- package/dist/DurableAgentRuntime-D8GI66mP.mjs.map +0 -1
|
@@ -6,12 +6,12 @@ import { r as Update } from "./AgentUpdates-DMJ-_xow.mjs";
|
|
|
6
6
|
import { s as RunTotals } from "./Usage-Dx0aknfk.mjs";
|
|
7
7
|
import { t as ThreadHistory } from "./ThreadHistory-tS1KwxHR.mjs";
|
|
8
8
|
import { a as FailureDiagnostic_d_exports, r as Diagnostic } from "./FailureDiagnostic-CaAkzGHL.mjs";
|
|
9
|
-
import { E as RunDispositionDeclaration, _ as InstructionSource, c as Definition, m as InputPromptSource, r as AnyDefinition, y as ModelServices } from "./Agent-
|
|
9
|
+
import { E as RunDispositionDeclaration, _ as InstructionSource, c as Definition, m as InputPromptSource, r as AnyDefinition, y as ModelServices } from "./Agent-Cjd_ZveM.mjs";
|
|
10
10
|
import { a as WorkerBudgetScope, c as WorkerError, f as WorkerRef, o as WorkerCompletion, p as WorkerReport } from "./Worker-fwWkBg12.mjs";
|
|
11
|
-
import { V as RunSubagentDigests, x as RunContextPreparation } from "./RunOptions-
|
|
11
|
+
import { V as RunSubagentDigests, x as RunContextPreparation } from "./RunOptions-Cy7CjrjS.mjs";
|
|
12
12
|
import { c as MessageRef, l as MessageStatus } from "./Messaging-Dkg87ebg.mjs";
|
|
13
|
-
import { f as WorkerReporting, o as SubagentHost } from "./SubagentHost-
|
|
14
|
-
import { S as ToolCallWaiting, _ as SubagentDurability, b as SubagentDurabilityError, c as AgentSpawner, h as SpawnRunOptions, l as AgentSpawnerParent, o as AgentRuntimeFailure, p as RuntimeBinding, s as AgentRuntimeRequirements } from "./AgentRuntime-
|
|
13
|
+
import { f as WorkerReporting, o as SubagentHost } from "./SubagentHost-C-4A7tA2.mjs";
|
|
14
|
+
import { S as ToolCallWaiting, _ as SubagentDurability, b as SubagentDurabilityError, c as AgentSpawner, h as SpawnRunOptions, l as AgentSpawnerParent, o as AgentRuntimeFailure, p as RuntimeBinding, s as AgentRuntimeRequirements } from "./AgentRuntime-DZdgNcBk.mjs";
|
|
15
15
|
import { t as RunEventSink } from "./RunEventSink-D5aVhISG.mjs";
|
|
16
16
|
import { Tool, Toolkit } from "effect/unstable/ai";
|
|
17
17
|
import { Crypto, Duration, Effect, Layer, Schema, Scope, Stream } from "effect";
|
|
@@ -1649,4 +1649,4 @@ declare function background<const Name extends string, Input extends Schema.Top,
|
|
|
1649
1649
|
declare function background<const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project, const Selected extends BackgroundOptions>(declaration: Declaration<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>, selected: Selected): ReturnType<typeof background$1<Name, Input, Output, Parameters, Success, Failure, Prepare, Project, Selected>>;
|
|
1650
1650
|
//#endregion
|
|
1651
1651
|
export { inspect as A, delegationCapsFromPolicy as B, BackgroundOptions as C, awaitWorker as D, WorkerObservation as E, SubagentPolicy as F, SubagentPolicyInput as I, SubagentPrestartDenied as L, observe as M, start as N, cancel as O, stop as P, SubagentProjectionFailure as R, make as S, Worker as T, SubagentTools as _, SubagentDelegation as a, define as b, SubagentFailureMode as c, SubagentResult as d, SubagentResultContext as f, SubagentToolFailure as g, SubagentTool as h, SubagentDefineOptions as i, list as j, followUp as k, SubagentLayerRequirements as l, SubagentRuntimeOptions as m, SubagentContainedFailure as n, SubagentDurableAccounting as o, SubagentReturnModeFailure as p, SubagentDeclarationOptions as r, SubagentDurableOptions as s, SubagentChildRunFailure as t, SubagentPrepareContext as u, Subagent_d_exports as v, BackgroundTools as w, layer as x, background as y, delegationAllocationFromPolicy as z };
|
|
1652
|
-
//# sourceMappingURL=Subagent-
|
|
1652
|
+
//# sourceMappingURL=Subagent-zS6prSK6.d.mts.map
|
|
@@ -4,7 +4,7 @@ import { a as Receipt, n as JoinedToHost, t as IdempotencyKey } from "./Receipt-
|
|
|
4
4
|
import { r as Update } from "./AgentUpdates-DMJ-_xow.mjs";
|
|
5
5
|
import { a as FailureDiagnostic_d_exports, i as Failure } from "./FailureDiagnostic-CaAkzGHL.mjs";
|
|
6
6
|
import { t as AgentPolicy } from "./AgentPolicy-BqDoSXO6.mjs";
|
|
7
|
-
import { r as AnyDefinition, t as Agent_d_exports } from "./Agent-
|
|
7
|
+
import { r as AnyDefinition, t as Agent_d_exports } from "./Agent-Cjd_ZveM.mjs";
|
|
8
8
|
import { _ as WorkerStop, a as WorkerBudgetScope, c as WorkerError, d as WorkerPage, f as WorkerRef, g as WorkerStarted, h as WorkerSource, l as WorkerHistoryEntry, o as WorkerCompletion, s as WorkerContext, v as WorkerStopped, y as WorkerSummary } from "./Worker-fwWkBg12.mjs";
|
|
9
9
|
import { c as MessageRef, l as MessageStatus } from "./Messaging-Dkg87ebg.mjs";
|
|
10
10
|
import { Context, Effect, Option, Schema, Stream } from "effect";
|
|
@@ -169,4 +169,4 @@ declare class SubagentHost extends SubagentHost_base {
|
|
|
169
169
|
}
|
|
170
170
|
//#endregion
|
|
171
171
|
export { StartWorkerRequest as a, WorkerMessageRequest as c, WorkerReportPreparationFailure as d, WorkerReporting as f, FollowUpWorkerRequest as i, WorkerObservation as l, DeferredFollowUpWorkerRequest as n, SubagentHost as o, WorkerRunReport as p, DeferredStartWorkerRequest as r, SubagentHost_d_exports as s, BackgroundReporting as t, WorkerReceiptRequest as u };
|
|
172
|
-
//# sourceMappingURL=SubagentHost-
|
|
172
|
+
//# sourceMappingURL=SubagentHost-C-4A7tA2.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-BqDoSXO6.mjs";
|
|
5
5
|
import { _ as Digest, h as DefinitionDigests } from "./Records-B5GFWCpn.mjs";
|
|
6
|
-
import "./Admin-
|
|
6
|
+
import "./Admin-BzPfXvzC.mjs";
|
|
7
7
|
import { t as ScheduleAuthorizationDecision } from "./Schedule-CtYREFnz.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-C279AjM6.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as AgentId } from "./Identifiers-CN2s30fF.mjs";
|
|
2
2
|
import { O as PersistedJson, h as DefinitionDigests } from "./Records-B5GFWCpn.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-C279AjM6.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-7R-Xrpxd.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as CommandDrainPolicy } from "../RunOptions-
|
|
1
|
+
import { o as CommandDrainPolicy } from "../RunOptions-Cy7CjrjS.mjs";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
declare namespace Commands_d_exports {
|
|
4
4
|
export { FollowUpCommand, RunCommand, RunCommandQueue, RunCommandQueueClosed, RunCommandQueueConfig, SteeringCommand, makeRunCommandQueue };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as MessageAdmission, c as MessageRef, i as MessageAddress, l as MessageStatus, n as InboxPage, o as MessagingError, r as InputMessage, s as PeerName, t as InboxEntry } from "../Messaging-Dkg87ebg.mjs";
|
|
2
|
-
import { a as inspect, c as reply, d as retryTool, f as send, i as inboxTool, l as replyTool, n as Peer, o as inspectTool, p as sendTool, r as inbox, s as peer, u as retry } from "../Messaging-
|
|
2
|
+
import { a as inspect, c as reply, d as retryTool, f as send, i as inboxTool, l as replyTool, n as Peer, o as inspectTool, p as sendTool, r as inbox, s as peer, u as retry } from "../Messaging-ccQURKCf.mjs";
|
|
3
3
|
export { InboxEntry, InboxPage, InputMessage, MessageAddress, MessageAdmission, MessageRef, MessageStatus, MessagingError, Peer, PeerName, inbox, inboxTool, inspect, inspectTool, peer, reply, replyTool, retry, retryTool, send, sendTool };
|
|
@@ -2,7 +2,7 @@ import { c as ThreadLimitExceeded, i as ThreadEncodingError, s as ThreadHistoryD
|
|
|
2
2
|
import { RedactionError, Redactor } from "./Redaction.mjs";
|
|
3
3
|
import { ApprovalAudit, ApprovalAuditLimitExceeded, ApprovalDecisionMismatch, ApprovalRequestDraft, ApprovalResolver, ApprovalResolverError } from "./Approval.mjs";
|
|
4
4
|
import { BudgetExceeded, UsageBudgetNode } from "./Budget.mjs";
|
|
5
|
-
import { M as RunOptions, R as RunSchedulingHook, _ as RunBudgetHook, b as RunContextHook, g as RunApprovalRequest, h as RunApprovalHook, j as RunInputHook, w as RunContextRequest } from "../RunOptions-
|
|
5
|
+
import { M as RunOptions, R as RunSchedulingHook, _ as RunBudgetHook, b as RunContextHook, g as RunApprovalRequest, h as RunApprovalHook, j as RunInputHook, w as RunContextRequest } from "../RunOptions-Cy7CjrjS.mjs";
|
|
6
6
|
import { RunCommandQueue } from "./Commands.mjs";
|
|
7
7
|
import { Prompt } from "effect/unstable/ai";
|
|
8
8
|
import { Effect, Schema } from "effect";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { c as SubagentExecutionFailureClassification, l as SubagentGrant, s as SubagentExecutionFailure } from "../SubagentContract-DdT7Cqe6.mjs";
|
|
2
2
|
import { o as WorkerCompletion, p as WorkerReport } from "../Worker-fwWkBg12.mjs";
|
|
3
|
-
import { A as inspect, B as delegationCapsFromPolicy, C as BackgroundOptions, D as awaitWorker, E as WorkerObservation, F as SubagentPolicy, I as SubagentPolicyInput, L as SubagentPrestartDenied, M as observe, N as start, O as cancel, P as stop, R as SubagentProjectionFailure, S as make, T as Worker, _ as SubagentTools, a as SubagentDelegation, b as define, c as SubagentFailureMode, d as SubagentResult, f as SubagentResultContext, g as SubagentToolFailure, h as SubagentTool, i as SubagentDefineOptions, j as list, k as followUp, l as SubagentLayerRequirements, m as SubagentRuntimeOptions, n as SubagentContainedFailure, o as SubagentDurableAccounting, p as SubagentReturnModeFailure, r as SubagentDeclarationOptions, s as SubagentDurableOptions, t as SubagentChildRunFailure, u as SubagentPrepareContext, w as BackgroundTools, x as layer, y as background, z as delegationAllocationFromPolicy } from "../Subagent-
|
|
3
|
+
import { A as inspect, B as delegationCapsFromPolicy, C as BackgroundOptions, D as awaitWorker, E as WorkerObservation, F as SubagentPolicy, I as SubagentPolicyInput, L as SubagentPrestartDenied, M as observe, N as start, O as cancel, P as stop, R as SubagentProjectionFailure, S as make, T as Worker, _ as SubagentTools, a as SubagentDelegation, b as define, c as SubagentFailureMode, d as SubagentResult, f as SubagentResultContext, g as SubagentToolFailure, h as SubagentTool, i as SubagentDefineOptions, j as list, k as followUp, l as SubagentLayerRequirements, m as SubagentRuntimeOptions, n as SubagentContainedFailure, o as SubagentDurableAccounting, p as SubagentReturnModeFailure, r as SubagentDeclarationOptions, s as SubagentDurableOptions, t as SubagentChildRunFailure, u as SubagentPrepareContext, w as BackgroundTools, x as layer, y as background, z as delegationAllocationFromPolicy } from "../Subagent-zS6prSK6.mjs";
|
|
4
4
|
export { type BackgroundOptions, type BackgroundTools, SubagentChildRunFailure, SubagentContainedFailure, SubagentDeclarationOptions, SubagentDefineOptions, SubagentDelegation, SubagentDurableAccounting, SubagentDurableOptions, SubagentExecutionFailure, SubagentExecutionFailureClassification, SubagentFailureMode, SubagentGrant, SubagentLayerRequirements, SubagentPolicy, type SubagentPolicyInput, SubagentPrepareContext, SubagentPrestartDenied, SubagentProjectionFailure, SubagentResult, SubagentResultContext, SubagentReturnModeFailure, SubagentRuntimeOptions, SubagentTool, SubagentToolFailure, SubagentTools, Worker, WorkerCompletion, WorkerObservation, WorkerReport, awaitWorker as await, background, cancel, define, delegationAllocationFromPolicy, delegationCapsFromPolicy, followUp, inspect, layer, list, make, observe, start, stop };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SubagentExecutionFailure, SubagentExecutionFailureClassification, SubagentGrant } from "../core/SubagentContract.mjs";
|
|
2
2
|
import { o as WorkerCompletion, p as WorkerReport } from "../Worker-CfwzMZEK.mjs";
|
|
3
3
|
import "./SubagentReservations.mjs";
|
|
4
|
-
import { S as delegationCapsFromPolicy, _ as stop, a as define, b as SubagentProjectionFailure, c as Worker, d as cancel, f as followUp, g as start, h as observe, i as background, l as WorkerObservation, m as list, n as SubagentResult, o as layer, p as inspect, s as make, t as SubagentDurableAccounting, u as awaitWorker, v as SubagentPolicy, x as delegationAllocationFromPolicy, y as SubagentPrestartDenied } from "../Subagent-
|
|
4
|
+
import { S as delegationCapsFromPolicy, _ as stop, a as define, b as SubagentProjectionFailure, c as Worker, d as cancel, f as followUp, g as start, h as observe, i as background, l as WorkerObservation, m as list, n as SubagentResult, o as layer, p as inspect, s as make, t as SubagentDurableAccounting, u as awaitWorker, v as SubagentPolicy, x as delegationAllocationFromPolicy, y as SubagentPrestartDenied } from "../Subagent-hG9lJ7tJ.mjs";
|
|
5
5
|
export { SubagentDurableAccounting, SubagentExecutionFailure, SubagentExecutionFailureClassification, SubagentGrant, SubagentPolicy, SubagentPrestartDenied, SubagentProjectionFailure, SubagentResult, Worker, WorkerCompletion, WorkerObservation, WorkerReport, awaitWorker as await, background, cancel, define, delegationAllocationFromPolicy, delegationCapsFromPolicy, followUp, inspect, layer, list, make, observe, start, stop };
|
package/dist/core/Agent.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as ToolUnion, C as OutputSchema, D as RunDispositionFailure, E as RunDispositionDeclaration, F as isModelResolver, I as make, L as withModel, M as Update, N as UpdatesSchema, O as RunDispositionSchema, P as inspectTools, S as Output, T as RunDisposition, _ as InstructionSource, a as CompletionFromToolDeclaration, b as Name, c as Definition, d as EncodedInput, f as Failure, g as InstructionResult, h as InputSchema, i as Binding, j as Tools, k as ToolInspection, l as DefinitionOptions, m as InputPromptSource, n as Any, o as CompletionProjectionInput, p as Input, r as AnyDefinition, s as CompletionToolDeclaration, u as DefinitionRequirements, v as ModelResolver, w as Requirements, x as NativeModel, y as ModelServices } from "../Agent-
|
|
1
|
+
import { A as ToolUnion, C as OutputSchema, D as RunDispositionFailure, E as RunDispositionDeclaration, F as isModelResolver, I as make, L as withModel, M as Update, N as UpdatesSchema, O as RunDispositionSchema, P as inspectTools, S as Output, T as RunDisposition, _ as InstructionSource, a as CompletionFromToolDeclaration, b as Name, c as Definition, d as EncodedInput, f as Failure, g as InstructionResult, h as InputSchema, i as Binding, j as Tools, k as ToolInspection, l as DefinitionOptions, m as InputPromptSource, n as Any, o as CompletionProjectionInput, p as Input, r as AnyDefinition, s as CompletionToolDeclaration, u as DefinitionRequirements, v as ModelResolver, w as Requirements, x as NativeModel, y as ModelServices } from "../Agent-Cjd_ZveM.mjs";
|
|
2
2
|
export { Any, AnyDefinition, Binding, CompletionFromToolDeclaration, CompletionProjectionInput, CompletionToolDeclaration, Definition, DefinitionOptions, DefinitionRequirements, EncodedInput, Failure, Input, InputPromptSource, InputSchema, InstructionResult, InstructionSource, ModelResolver, ModelServices, Name, NativeModel, Output, OutputSchema, Requirements, RunDisposition, RunDispositionDeclaration, RunDispositionFailure, RunDispositionSchema, ToolInspection, ToolUnion, Tools, Update, UpdatesSchema, inspectTools, isModelResolver, make, withModel };
|
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-BzPfXvzC.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
|
|
1
|
+
import { Ba as ExecutableAgentBinding, Fa as AgentAttemptContext, Ga as definitionDigestsEqual, Ha as ResolvedBinding, Ia as AgentRegistration, La as BindingUnavailable, Ra as DurableBindingFailure, Ua as compileBindingContracts, Va as ReplayVersions, Wa as compileRegistrations, za as DurableWorkerBinding } from "../Admin-BzPfXvzC.mjs";
|
|
2
2
|
export { type AgentAttemptContext, type AgentRegistration, BindingUnavailable, 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-BzPfXvzC.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 { O as PersistedJson, l as CanonicalRecordEnvelope } from "../Records-B5GFWCpn.mjs";
|
|
2
2
|
import { ActivityProcessorKey, ActivityProcessorStore, ActivityStoreFailure, PreparedActivity } from "./ActivityStore.mjs";
|
|
3
3
|
import { t as DigestError } from "../Digest-U69rDHuO.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-BzPfXvzC.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-BzPfXvzC.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,3 +1,3 @@
|
|
|
1
1
|
import { Receipt } from "../core/Receipt.mjs";
|
|
2
|
-
import { a as DurableApprovalSuspension, c as RecoveryFailure, d as childReservationIdFor, f as isolateRecovery, g as threadCreatedRecordId, h as threadCreatedBatchId, i as DurableApprovalResolver, l as RecoveryReport, m as recoveryRepairRecordId, n as DurableAgentRuntime, o as DurableRuntimeConfig, p as recoveryRepairBatchId, s as RecoveryBlocked, t as ApprovalSuspensionError, u as RecoverySweepResult } from "../DurableAgentRuntime-
|
|
2
|
+
import { a as DurableApprovalSuspension, c as RecoveryFailure, d as childReservationIdFor, f as isolateRecovery, g as threadCreatedRecordId, h as threadCreatedBatchId, i as DurableApprovalResolver, l as RecoveryReport, m as recoveryRepairRecordId, n as DurableAgentRuntime, o as DurableRuntimeConfig, p as recoveryRepairBatchId, s as RecoveryBlocked, t as ApprovalSuspensionError, u as RecoverySweepResult } from "../DurableAgentRuntime-N5Meflyt.mjs";
|
|
3
3
|
export { ApprovalSuspensionError, DurableAgentRuntime, DurableApprovalResolver, DurableApprovalSuspension, DurableRuntimeConfig, Receipt, RecoveryBlocked, RecoveryFailure, RecoveryReport, 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-DJW_1kPY.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-BzPfXvzC.mjs";
|
|
3
|
+
import { E as SubscriptionSourceError } from "../Subscription-C279AjM6.mjs";
|
|
4
|
+
import { t as EventSource } from "../EventSource-DJW_1kPY.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
|
|
2
|
-
export { LifecyclePublication, LifecyclePublicationConfig, LifecyclePublicationError, LifecyclePublicationFact, LifecyclePublicationHandler, LifecyclePublicationSource, LifecyclePublicationStorage, drainLifecyclePublications, lifecyclePublicationLayer };
|
|
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-BzPfXvzC.mjs";
|
|
2
|
+
export { LifecyclePublication, LifecyclePublicationBatch, LifecyclePublicationConfig, LifecyclePublicationError, LifecyclePublicationFact, LifecyclePublicationHandler, LifecyclePublicationSource, LifecyclePublicationStorage, drainLifecyclePublications, lifecyclePublicationBatchMaxFacts, lifecyclePublicationLayer };
|
|
@@ -7,16 +7,18 @@ import { AbortIntent, Settlement, SubmissionLedger, SubmissionLookupById, Submis
|
|
|
7
7
|
import { getRunInput } from "./ThreadStore.mjs";
|
|
8
8
|
import { PreparedInput } from "./Subscription.mjs";
|
|
9
9
|
import { MessageDeliveryKey } from "./MessageDelivery.mjs";
|
|
10
|
-
import { Clock, Context, Crypto, Effect, Layer, Option, Schema } from "effect";
|
|
10
|
+
import { Cause, Clock, Context, Crypto, Effect, Layer, Option, Schema } from "effect";
|
|
11
11
|
//#region src/durable/LifecyclePublication.ts
|
|
12
12
|
var LifecyclePublication_exports = /* @__PURE__ */ __exportAll({
|
|
13
13
|
LifecyclePublication: () => LifecyclePublication,
|
|
14
|
+
LifecyclePublicationBatch: () => LifecyclePublicationBatch,
|
|
14
15
|
LifecyclePublicationConfig: () => LifecyclePublicationConfig,
|
|
15
16
|
LifecyclePublicationError: () => LifecyclePublicationError,
|
|
16
17
|
LifecyclePublicationFact: () => LifecyclePublicationFact,
|
|
17
18
|
LifecyclePublicationHandler: () => LifecyclePublicationHandler,
|
|
18
19
|
LifecyclePublicationSource: () => LifecyclePublicationSource,
|
|
19
20
|
drainLifecyclePublications: () => drainLifecyclePublications,
|
|
21
|
+
lifecyclePublicationBatchMaxFacts: () => 8,
|
|
20
22
|
lifecyclePublicationLayer: () => lifecyclePublicationLayer
|
|
21
23
|
});
|
|
22
24
|
/** Immutable native admission evidence. It is private and grants no application authority. */
|
|
@@ -108,11 +110,20 @@ var LifecyclePublicationError = class extends Schema.TaggedError()("LifecyclePub
|
|
|
108
110
|
]),
|
|
109
111
|
cause: Schema.optionalKey(Schema.Defect())
|
|
110
112
|
}) {};
|
|
113
|
+
/** Bound both retained facts and the immutable admission evidence resolved before dispatch. */
|
|
114
|
+
const lifecyclePublicationBatchMaxFacts = 8;
|
|
115
|
+
/** One owner's bounded pending prefix, strictly ordered by its durable ordinals. */
|
|
116
|
+
const LifecyclePublicationBatch = Schema.NonEmptyArray(LifecyclePublication).check(Schema.isMaxLength(8), Schema.makeFilter((facts) => facts.every((fact, index) => {
|
|
117
|
+
const previous = facts[index - 1];
|
|
118
|
+
return fact.ownerThreadId === facts[0].ownerThreadId && (previous === void 0 || fact.ordinal > previous.ordinal);
|
|
119
|
+
}), { expected: "One owner with strictly increasing publication ordinals" }));
|
|
111
120
|
/**
|
|
112
|
-
* Publish
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
121
|
+
* Publish one owner's ordered batch in one idempotent host transaction, including authorization,
|
|
122
|
+
* records, receipts and delivery intents. Larger backlogs continue in later batches.
|
|
123
|
+
* Return only after the entire batch commits. Retries
|
|
124
|
+
* may include already committed identities plus later facts; deduplicate each fact's `id`.
|
|
125
|
+
* Private input/update/result fields remain private; select declared public fields explicitly.
|
|
126
|
+
* Revocation/deletion is an acknowledged domain decision, not an infrastructure retry.
|
|
116
127
|
*/
|
|
117
128
|
var LifecyclePublicationHandler = class extends Context.Service()("@effect-agent/thread/LifecyclePublicationHandler") {};
|
|
118
129
|
/** Adapter configuration; the opt-in layer captures its explicit Crypto requirement once. */
|
|
@@ -147,23 +158,32 @@ const withSource = Effect.fn("LifecyclePublication.withSource")(function* (publi
|
|
|
147
158
|
})));
|
|
148
159
|
/**
|
|
149
160
|
* One finite wave for the host's existing maintenance coordinator. Persist the next deadline
|
|
150
|
-
* before dispatch, so interruption and process loss retain the same
|
|
161
|
+
* before dispatch, so interruption and process loss retain the same facts without another timer.
|
|
162
|
+
* Finish independent owner batches before surfacing failures; interruption stops the wave.
|
|
151
163
|
* Acknowledgements are exact and idempotent. No producer or external Tool is re-executed here.
|
|
152
164
|
*/
|
|
153
165
|
const drainLifecyclePublications = Effect.fn("LifecyclePublication.drain")(function* (storage, timeoutMillis = 1e4, limit = 4) {
|
|
154
166
|
const handler = yield* LifecyclePublicationHandler;
|
|
155
167
|
const pending = yield* storage.pending(yield* Clock.currentTimeMillis, limit);
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
yield*
|
|
168
|
+
let failures = Cause.empty;
|
|
169
|
+
for (const batch of pending) yield* Effect.gen(function* () {
|
|
170
|
+
if (!(yield* storage.claim(batch, yield* Clock.currentTimeMillis, timeoutMillis))) return;
|
|
171
|
+
yield* Effect.scoped(Effect.gen(function* () {
|
|
172
|
+
const publications = yield* Effect.forEach(batch, withSource);
|
|
173
|
+
yield* handler.publish(publications);
|
|
174
|
+
})).pipe(Effect.timeoutOrElse({
|
|
159
175
|
duration: timeoutMillis,
|
|
160
176
|
orElse: () => LifecyclePublicationError.make({ reason: "unavailable" })
|
|
161
177
|
}));
|
|
162
|
-
yield* storage.acknowledge(
|
|
163
|
-
}
|
|
178
|
+
yield* storage.acknowledge(batch);
|
|
179
|
+
}).pipe(Effect.catchCauseIf((cause) => !Cause.hasInterrupts(cause), (cause) => {
|
|
180
|
+
failures = Cause.combine(failures, cause);
|
|
181
|
+
return Effect.void;
|
|
182
|
+
}));
|
|
183
|
+
if (failures.reasons.length > 0) return yield* Effect.failCause(failures);
|
|
164
184
|
return pending.length;
|
|
165
185
|
});
|
|
166
186
|
//#endregion
|
|
167
|
-
export { LifecyclePublication, LifecyclePublicationConfig, LifecyclePublicationError, LifecyclePublicationFact, LifecyclePublicationHandler, LifecyclePublicationSource, drainLifecyclePublications, lifecyclePublicationLayer, LifecyclePublication_exports as t };
|
|
187
|
+
export { LifecyclePublication, LifecyclePublicationBatch, LifecyclePublicationConfig, LifecyclePublicationError, LifecyclePublicationFact, LifecyclePublicationHandler, LifecyclePublicationSource, drainLifecyclePublications, lifecyclePublicationBatchMaxFacts, lifecyclePublicationLayer, LifecyclePublication_exports as t };
|
|
168
188
|
|
|
169
189
|
//# sourceMappingURL=LifecyclePublication.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LifecyclePublication.mjs","names":[],"sources":["../../src/durable/LifecyclePublication.ts"],"sourcesContent":["import { 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/** Native recovery state, not a second application record or launch queue. */\nexport interface LifecyclePublicationStorage {\n readonly pending: (\n nowMillis: number,\n limit: number,\n ) => Effect.Effect<ReadonlyArray<LifecyclePublication>, LifecyclePublicationError>;\n readonly acknowledge: (\n publication: LifecyclePublication,\n ) => Effect.Effect<void, LifecyclePublicationError>;\n readonly defer: (\n publication: LifecyclePublication,\n untilMillis: number,\n ) => Effect.Effect<void, LifecyclePublicationError>;\n readonly pendingDeadline: Effect.Effect<Option.Option<number>, LifecyclePublicationError>;\n /** Earliest retained owner obligation, including deferred facts that still gate execution. */\n readonly pendingDeadlineFor: (\n ownerThreadId: ThreadId,\n ) => Effect.Effect<Option.Option<number>, LifecyclePublicationError>;\n}\n\n/**\n * Publish an idempotent domain command, including its authorization, exact receipt and delivery\n * intent. Return only after that command commits. Treat private input/update/result fields as\n * private; the application must select its declared public fields. Revocation/deletion is an\n * acknowledged domain decision, not an indefinitely retryable infrastructure failure.\n */\nexport class LifecyclePublicationHandler extends Context.Service<\n LifecyclePublicationHandler,\n {\n readonly publish: (\n publication: LifecyclePublication,\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 fact without another timer.\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) {\n const handler = yield* LifecyclePublicationHandler;\n const pending = yield* storage.pending(yield* Clock.currentTimeMillis, limit);\n\n for (const publication of pending) {\n yield* storage.defer(publication, (yield* Clock.currentTimeMillis) + timeoutMillis);\n yield* Effect.scoped(withSource(publication).pipe(Effect.flatMap(handler.publish))).pipe(\n Effect.timeoutOrElse({\n duration: timeoutMillis,\n orElse: () => LifecyclePublicationError.make({ reason: \"unavailable\" }),\n }),\n );\n yield* storage.acknowledge(publication);\n }\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 readonly pending: (\n nowMillis: number,\n limit: number,\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 /** 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) {\n const handler = yield* LifecyclePublicationHandler;\n const pending = yield* storage.pending(yield* Clock.currentTimeMillis, limit);\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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"}
|
|
@@ -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-BqDoSXO6.mjs";
|
|
7
7
|
import { h as DefinitionDigests } from "../Records-B5GFWCpn.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import { a as PreparedInput } from "../Subscription-
|
|
10
|
-
import { t as PreparedInputAdmission } from "../PreparedInputAdmission-
|
|
8
|
+
import { fn as Settlement, xi as LifecyclePublicationStorage } from "../Admin-BzPfXvzC.mjs";
|
|
9
|
+
import { a as PreparedInput } from "../Subscription-C279AjM6.mjs";
|
|
10
|
+
import { t as PreparedInputAdmission } from "../PreparedInputAdmission-CNRSDoYu.mjs";
|
|
11
11
|
import { Context, Crypto, Effect, Layer, Result, Schema } from "effect";
|
|
12
12
|
declare namespace MessageDelivery_d_exports {
|
|
13
13
|
export { MessageDeliveryChange, 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 };
|
|
@@ -617,6 +617,25 @@ export declare const readPending: (request: Pick<{
|
|
|
617
617
|
readonly reportKind?: "update" | undefined;
|
|
618
618
|
} | undefined;
|
|
619
619
|
readonly messageAdmission?: {
|
|
620
|
+
readonly schemaVersion: 1;
|
|
621
|
+
readonly message: {
|
|
622
|
+
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
623
|
+
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
624
|
+
};
|
|
625
|
+
readonly peerName: string;
|
|
626
|
+
readonly sender: {
|
|
627
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
628
|
+
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
629
|
+
};
|
|
630
|
+
readonly returnAddress: {
|
|
631
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
632
|
+
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
633
|
+
};
|
|
634
|
+
readonly inReplyTo?: {
|
|
635
|
+
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
636
|
+
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
637
|
+
} | undefined;
|
|
638
|
+
} | {
|
|
620
639
|
readonly _tag: "WorkerCompletion";
|
|
621
640
|
readonly budgetExhausted: boolean;
|
|
622
641
|
readonly schemaVersion: 1;
|
|
@@ -657,25 +676,6 @@ export declare const readPending: (request: Pick<{
|
|
|
657
676
|
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
658
677
|
};
|
|
659
678
|
readonly update: Update;
|
|
660
|
-
} | {
|
|
661
|
-
readonly schemaVersion: 1;
|
|
662
|
-
readonly message: {
|
|
663
|
-
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
664
|
-
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
665
|
-
};
|
|
666
|
-
readonly peerName: string;
|
|
667
|
-
readonly sender: {
|
|
668
|
-
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
669
|
-
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
670
|
-
};
|
|
671
|
-
readonly returnAddress: {
|
|
672
|
-
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
673
|
-
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
674
|
-
};
|
|
675
|
-
readonly inReplyTo?: {
|
|
676
|
-
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
677
|
-
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
678
|
-
} | undefined;
|
|
679
679
|
} | undefined;
|
|
680
680
|
};
|
|
681
681
|
readonly envelopeDigest: string & import("effect/Brand").Brand<"@effect-agent/thread/Digest">;
|
|
@@ -818,6 +818,25 @@ export declare const prepareMessageDelivery: (options: {
|
|
|
818
818
|
readonly reportKind?: "update" | undefined;
|
|
819
819
|
} | undefined;
|
|
820
820
|
readonly messageAdmission?: {
|
|
821
|
+
readonly schemaVersion: 1;
|
|
822
|
+
readonly message: {
|
|
823
|
+
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
824
|
+
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
825
|
+
};
|
|
826
|
+
readonly peerName: string;
|
|
827
|
+
readonly sender: {
|
|
828
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
829
|
+
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
830
|
+
};
|
|
831
|
+
readonly returnAddress: {
|
|
832
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
833
|
+
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
834
|
+
};
|
|
835
|
+
readonly inReplyTo?: {
|
|
836
|
+
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
837
|
+
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
838
|
+
} | undefined;
|
|
839
|
+
} | {
|
|
821
840
|
readonly _tag: "WorkerCompletion";
|
|
822
841
|
readonly budgetExhausted: boolean;
|
|
823
842
|
readonly schemaVersion: 1;
|
|
@@ -858,25 +877,6 @@ export declare const prepareMessageDelivery: (options: {
|
|
|
858
877
|
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
859
878
|
};
|
|
860
879
|
readonly update: Update;
|
|
861
|
-
} | {
|
|
862
|
-
readonly schemaVersion: 1;
|
|
863
|
-
readonly message: {
|
|
864
|
-
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
865
|
-
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
866
|
-
};
|
|
867
|
-
readonly peerName: string;
|
|
868
|
-
readonly sender: {
|
|
869
|
-
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
870
|
-
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
871
|
-
};
|
|
872
|
-
readonly returnAddress: {
|
|
873
|
-
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
874
|
-
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
875
|
-
};
|
|
876
|
-
readonly inReplyTo?: {
|
|
877
|
-
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
878
|
-
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
879
|
-
} | undefined;
|
|
880
880
|
} | undefined;
|
|
881
881
|
};
|
|
882
882
|
readonly envelopeDigest: string & import("effect/Brand").Brand<"@effect-agent/thread/Digest">;
|
|
@@ -5,7 +5,7 @@ import { r as Diagnostic } from "../FailureDiagnostic-CaAkzGHL.mjs";
|
|
|
5
5
|
import { t as AgentPolicy } from "../AgentPolicy-BqDoSXO6.mjs";
|
|
6
6
|
import { h as DefinitionDigests } from "../Records-B5GFWCpn.mjs";
|
|
7
7
|
import { t as DigestError } from "../Digest-U69rDHuO.mjs";
|
|
8
|
-
import { fn as Settlement } from "../Admin-
|
|
8
|
+
import { fn as Settlement } from "../Admin-BzPfXvzC.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,6 +105,25 @@ 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
|
+
} | {
|
|
108
127
|
readonly _tag: "WorkerCompletion";
|
|
109
128
|
readonly budgetExhausted: boolean;
|
|
110
129
|
readonly schemaVersion: 1;
|
|
@@ -145,25 +164,6 @@ export declare const makeMessageDeliveryFixture: (messageId?: any, owner?: any,
|
|
|
145
164
|
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
146
165
|
};
|
|
147
166
|
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,6 +288,25 @@ 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
|
+
} | {
|
|
291
310
|
readonly _tag: "WorkerCompletion";
|
|
292
311
|
readonly budgetExhausted: boolean;
|
|
293
312
|
readonly schemaVersion: 1;
|
|
@@ -328,25 +347,6 @@ export declare const makeWorkerUpdateDeliveryFixture: (id: string) => Effect.Eff
|
|
|
328
347
|
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
329
348
|
};
|
|
330
349
|
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">;
|