@systemfsoftware/agent 0.1.0-beta.192 → 0.1.0
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-BfolLkHj.d.mts → Admin-26pelcl9.d.mts} +5 -5
- package/dist/{Agent-DSVEpq4e.d.mts → Agent-BH_R6LOI.d.mts} +1 -1
- package/dist/{AgentRegistration-Dg53p6du.mjs → AgentRegistration-h07X1mZM.mjs} +2 -2
- package/dist/{AgentRegistration-Dg53p6du.mjs.map → AgentRegistration-h07X1mZM.mjs.map} +1 -1
- package/dist/{AgentRuntime-CoGy_5dm.d.mts → AgentRuntime-C3GQPdrv.d.mts} +3 -3
- package/dist/{AgentRuntime-CzP4I4RB.mjs → AgentRuntime-CrYYV9RF.mjs} +3 -28
- package/dist/AgentRuntime-CrYYV9RF.mjs.map +1 -0
- package/dist/{BrowserUse-C9vict2M.d.mts → BrowserUse-DgCEbTwW.d.mts} +10 -10
- package/dist/{CommittedActivity-LWOKXqdi.d.mts → CommittedActivity-DMfj2beT.d.mts} +1 -1
- package/dist/{ContextTools-917r7gpv.d.mts → ContextTools-D5jrWNNH.d.mts} +12 -12
- package/dist/{DurableAgentRuntime-BHXo8GPJ.mjs → DurableAgentRuntime-D3UTrNQg.mjs} +4 -4
- package/dist/{DurableAgentRuntime-BHXo8GPJ.mjs.map → DurableAgentRuntime-D3UTrNQg.mjs.map} +1 -1
- package/dist/{EventSource-C0TCBeIf.d.mts → EventSource-BWY08cyT.d.mts} +1 -1
- package/dist/{MemoryNotes-4CRzkPBD.d.mts → MemoryNotes-CPvcb5OX.d.mts} +6 -6
- package/dist/{MessageDelivery-Dh6GZBt_.d.mts → MessageDelivery-C0S-Cakt.d.mts} +2 -2
- package/dist/{Messaging-DhM-APnP.d.mts → Messaging-DnnpWe-H.d.mts} +17 -17
- package/dist/{MessagingHost-CubWeYKN.d.mts → MessagingHost-DPPHTLdT.d.mts} +1 -1
- package/dist/{Output-SbOdlBFL.d.mts → Output-CafxF31F.d.mts} +1 -1
- package/dist/{PersistentHistory-BrtZ0g2j.d.mts → PersistentHistory-h-C7avqL.d.mts} +1 -1
- package/dist/{PreparedInputAdmission-Ci18uY4s.d.mts → PreparedInputAdmission-DYugcCHR.d.mts} +1 -1
- package/dist/{RunContinuation-BVAHoYlN.d.mts → RunContinuation-Cy2W8ASl.d.mts} +2 -2
- package/dist/{ScheduleTransition-CjVP48I8.d.mts → ScheduleTransition-DcqokgFt.d.mts} +1 -1
- package/dist/{Scheduling-DYTM29s9.d.mts → Scheduling-BaJXJIVt.d.mts} +2 -2
- package/dist/{Subagent-CSIRUgUo.mjs → Subagent-BJJN6n0E.mjs} +2 -2
- package/dist/{Subagent-CSIRUgUo.mjs.map → Subagent-BJJN6n0E.mjs.map} +1 -1
- package/dist/{Subagent-CXEI5YZ8.d.mts → Subagent-GXU32fQt.d.mts} +18 -18
- package/dist/{SubagentHost-CKhz1vbH.d.mts → SubagentHost-BC9B9dNT.d.mts} +1 -1
- package/dist/{Subscription-CC--_OnU.d.mts → Subscription-BJ0TtZwM.d.mts} +2 -2
- package/dist/{SubscriptionInput-Xcd4JjEs.mjs → SubscriptionInput-BbV69oX_.mjs} +2 -2
- package/dist/{SubscriptionInput-Xcd4JjEs.mjs.map → SubscriptionInput-BbV69oX_.mjs.map} +1 -1
- package/dist/{SubscriptionInput-BEeB0Cj8.d.mts → SubscriptionInput-D6Okd6-z.d.mts} +1 -1
- package/dist/{SubscriptionTransition-CWt9UVH0.d.mts → SubscriptionTransition-Da9DmAr_.d.mts} +1 -1
- package/dist/{Subscriptions-4K_qu_2f.mjs → Subscriptions-BS3AXmQ0.mjs} +2 -2
- package/dist/{Subscriptions-4K_qu_2f.mjs.map → Subscriptions-BS3AXmQ0.mjs.map} +1 -1
- package/dist/{Subscriptions-BF3aSf8X.d.mts → Subscriptions-DgjahL6V.d.mts} +5 -5
- package/dist/{ThreadContextHistory-lTZ8Ftq1.d.mts → ThreadContextHistory-BVTD96Pe.d.mts} +1 -1
- package/dist/{ThreadImport-DaSmrlRi.d.mts → ThreadImport-BQDW9E_Y.d.mts} +3 -3
- package/dist/{ThreadInvariants-DyPhMeo-.d.mts → ThreadInvariants-w53c67YS.d.mts} +3 -3
- package/dist/{ThreadProjectionMaintenance-DjUy7kCa.d.mts → ThreadProjectionMaintenance-4ccU1auU.d.mts} +1 -1
- package/dist/{ThreadTransfer-BM02cbOo.d.mts → ThreadTransfer-D0KsqkSR.d.mts} +1 -1
- package/dist/{ToolDiscovery-VjamzX3q.d.mts → ToolDiscovery-DvcfbTBk.d.mts} +2 -2
- package/dist/{ToolResults-C4-HsMCp.d.mts → ToolResults-NUk_x837.d.mts} +2 -2
- package/dist/{WebSearch-CD0V--qh.d.mts → WebSearch-RBUUOfT8.d.mts} +1 -1
- package/dist/{WorkerAdmission-BnRuXLWF.d.mts → WorkerAdmission-CubQgpsl.d.mts} +1 -1
- package/dist/{WorkerAdmission-BhFjx86s.mjs → WorkerAdmission-D8tw_OmT.mjs} +2 -2
- package/dist/{WorkerAdmission-BhFjx86s.mjs.map → WorkerAdmission-D8tw_OmT.mjs.map} +1 -1
- package/dist/{WorkerHost-DtYzi54D.d.mts → WorkerHost-BciHCzHq.d.mts} +2 -2
- package/dist/{agent-registration-CNs2twrr.mjs → agent-registration-D9ofkoBa.mjs} +2 -2
- package/dist/{agent-registration-CNs2twrr.mjs.map → agent-registration-D9ofkoBa.mjs.map} +1 -1
- package/dist/capabilities/BrowserUse.d.mts +1 -1
- package/dist/capabilities/ContextTools.d.mts +1 -1
- package/dist/capabilities/MemoryNotes.d.mts +1 -1
- package/dist/capabilities/Messaging.d.mts +1 -1
- package/dist/capabilities/Subagent.d.mts +1 -1
- package/dist/capabilities/Subagent.mjs +1 -1
- package/dist/capabilities/ToolDiscovery.d.mts +1 -1
- package/dist/capabilities/ToolResults.d.mts +1 -1
- package/dist/capabilities/WebSearch.d.mts +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/AgentRegistration.mjs +2 -2
- package/dist/durable/CommittedActivity.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.mjs +2 -2
- package/dist/durable/EventSource.d.mts +1 -1
- package/dist/durable/LifecyclePublication.d.mts +1 -1
- package/dist/durable/MessageDelivery.d.mts +1 -1
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +2 -2
- 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/RunContinuation.d.mts +2 -2
- package/dist/durable/RunJournal.d.mts +1 -1
- package/dist/durable/RunStorage.d.mts +1 -1
- package/dist/durable/Schedule.d.mts +1 -1
- package/dist/durable/ScheduleStoreConformance.d.mts +1 -1
- package/dist/durable/ScheduleTransition.d.mts +1 -1
- package/dist/durable/Scheduling.d.mts +1 -1
- package/dist/durable/SettlementPublisher.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/SubscriptionInput.mjs +1 -1
- package/dist/durable/SubscriptionStoreConformance.d.mts +1 -1
- package/dist/durable/SubscriptionTransition.d.mts +1 -1
- package/dist/durable/Subscriptions.d.mts +1 -1
- package/dist/durable/Subscriptions.mjs +1 -1
- package/dist/durable/ThreadArchiveRange.d.mts +1 -1
- package/dist/durable/ThreadContextHistory.d.mts +1 -1
- package/dist/durable/ThreadImport.d.mts +1 -1
- package/dist/durable/ThreadInvariants.d.mts +1 -1
- package/dist/durable/ThreadProjectionMaintenance.d.mts +1 -1
- package/dist/durable/ThreadReader.d.mts +1 -1
- package/dist/durable/ThreadStore.d.mts +1 -1
- package/dist/durable/ThreadStoreConformance.d.mts +1 -1
- package/dist/durable/ThreadTransfer.d.mts +1 -1
- package/dist/durable/ThreadWork.d.mts +1 -1
- package/dist/durable/WorkerAdmission.d.mts +1 -1
- package/dist/durable/WorkerAdmission.mjs +1 -1
- package/dist/durable/WorkerHost.d.mts +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/SubagentHost.d.mts +1 -1
- package/dist/index.d.mts +33 -33
- package/dist/index.mjs +7 -7
- package/dist/{run-context-reader-CHox63hg.d.mts → run-context-reader-D1Tx1G6V.d.mts} +1 -1
- package/package.json +6 -6
- package/src/engine/internal/agent-runtime.ts +4 -58
- package/dist/AgentRuntime-CzP4I4RB.mjs.map +0 -1
|
@@ -3,12 +3,12 @@ import * as Context from "effect/Context";
|
|
|
3
3
|
import * as CryptoDigest from "effect/crypto/Digest";
|
|
4
4
|
import * as Effect from "effect/Effect";
|
|
5
5
|
import * as Layer from "effect/Layer";
|
|
6
|
-
import { r as EventSources } from "./EventSource-
|
|
7
|
-
import { n as PreparedInputAdmission } from "./PreparedInputAdmission-
|
|
6
|
+
import { r as EventSources } from "./EventSource-BWY08cyT.mjs";
|
|
7
|
+
import { n as PreparedInputAdmission } from "./PreparedInputAdmission-DYugcCHR.mjs";
|
|
8
8
|
import { K as PersistedJson } from "./Records-C9I1nCL9.mjs";
|
|
9
|
-
import { pt as AdmissionFence } from "./Admin-
|
|
10
|
-
import { C as SubscriptionScope, D as SubscriptionStoreFailure, E as SubscriptionStore, T as SubscriptionSourceError, _ as SubscriptionLimits, d as SubscriptionDeliveryKey, f as SubscriptionDeliverySnapshot, g as SubscriptionKey, i as EventSourceVersion, l as SubscriptionConfiguration, p as SubscriptionError, r as EventAcknowledgement, s as SubscriptionAuthorizer, w as SubscriptionSnapshot } from "./Subscription-
|
|
11
|
-
import { n as SubscriptionInputBindings } from "./SubscriptionInput-
|
|
9
|
+
import { pt as AdmissionFence } from "./Admin-26pelcl9.mjs";
|
|
10
|
+
import { C as SubscriptionScope, D as SubscriptionStoreFailure, E as SubscriptionStore, T as SubscriptionSourceError, _ as SubscriptionLimits, d as SubscriptionDeliveryKey, f as SubscriptionDeliverySnapshot, g as SubscriptionKey, i as EventSourceVersion, l as SubscriptionConfiguration, p as SubscriptionError, r as EventAcknowledgement, s as SubscriptionAuthorizer, w as SubscriptionSnapshot } from "./Subscription-BJ0TtZwM.mjs";
|
|
11
|
+
import { n as SubscriptionInputBindings } from "./SubscriptionInput-D6Okd6-z.mjs";
|
|
12
12
|
declare namespace Subscriptions_d_exports {
|
|
13
13
|
export { SubscribeOptions, SubscriptionDriver, SubscriptionFailure, SubscriptionIntake, Subscriptions };
|
|
14
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Layer from "effect/Layer";
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
3
|
import { n as ContextHistoryError, t as ContextHistory } from "./ContextHistory-akQ1Td7a.mjs";
|
|
4
|
-
import { zi as ThreadStore } from "./Admin-
|
|
4
|
+
import { zi as ThreadStore } from "./Admin-26pelcl9.mjs";
|
|
5
5
|
declare namespace ThreadContextHistory_d_exports {
|
|
6
6
|
export { ThreadContextHistoryOptions, layer };
|
|
7
7
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Ct as ApprovalDecisionIntent, Ni as ThreadReadRequest, On as UnknownResolutionIntent, Qr as ExecutionCheckpoint, Vi as ThreadStoreError, Vt as InputAppliedMarker, _i as ThreadExport, an as ResolutionSafeToRetry, gi as ThreadCommands, in as ResolutionNeverHappened, lt as AbortIntent, mi as ThreadAdmission, nn as ResolutionAbortSubmission, rn as ResolutionCompletedWithResult, sn as Settlement, wn as SuspensionSnapshot } from "./Admin-
|
|
1
|
+
import { Ct as ApprovalDecisionIntent, Ni as ThreadReadRequest, On as UnknownResolutionIntent, Qr as ExecutionCheckpoint, Vi as ThreadStoreError, Vt as InputAppliedMarker, _i as ThreadExport, an as ResolutionSafeToRetry, gi as ThreadCommands, in as ResolutionNeverHappened, lt as AbortIntent, mi as ThreadAdmission, nn as ResolutionAbortSubmission, rn as ResolutionCompletedWithResult, sn as Settlement, wn as SuspensionSnapshot } from "./Admin-26pelcl9.mjs";
|
|
2
2
|
import { $ as RecordEnvelope, b as DefinitionDigests, d as CanonicalRecordEnvelope, et as RecordId, l as CanonicalBatch, p as CanonicalSequence } from "./Records-C9I1nCL9.mjs";
|
|
3
3
|
import { t as AgentPolicy } from "./AgentPolicy-D-GmZQex.mjs";
|
|
4
4
|
import { l as SubagentGrant, o as SubagentDelegationCaps, p as SubagentReservationAmounts, s as SubagentExecutionFailure } from "./SubagentContract-B7vQPueI.mjs";
|
|
5
5
|
import { r as Update } from "./AgentUpdates-7xT0It_R.mjs";
|
|
6
6
|
import { r as Diagnostic } from "./FailureDiagnostic-DpzYNI8f.mjs";
|
|
7
|
-
import { t as RunContextReader } from "./run-context-reader-
|
|
7
|
+
import { t as RunContextReader } from "./run-context-reader-D1Tx1G6V.mjs";
|
|
8
8
|
import * as Context from "effect/Context";
|
|
9
9
|
import * as Effect from "effect/Effect";
|
|
10
10
|
import * as Schema from "effect/Schema";
|
|
@@ -13,7 +13,7 @@ import * as Stream from "effect/Stream";
|
|
|
13
13
|
import { l as SubmissionId, s as RunId, t as AgentId, u as ThreadId } from "./Identifiers-qafW4EP0.mjs";
|
|
14
14
|
import * as Layer from "effect/Layer";
|
|
15
15
|
import { a as Receipt, t as IdempotencyKey } from "./Receipt-B4feBxMY.mjs";
|
|
16
|
-
import { p as MessageDeliveryRecord } from "./MessageDelivery-
|
|
16
|
+
import { p as MessageDeliveryRecord } from "./MessageDelivery-C0S-Cakt.mjs";
|
|
17
17
|
declare const ThreadImportReader_base: Context.ServiceClass<ThreadImportReader, "@effect-agent/thread/ThreadImportReader", {
|
|
18
18
|
/** Full canonical history in this same snapshot, including archived facts. */
|
|
19
19
|
readonly read: (request: ThreadReadRequest) => Stream.Stream<CanonicalRecordEnvelope, ThreadStoreError>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as RunContextReader } from "./run-context-reader-
|
|
1
|
+
import { t as RunContextReader } from "./run-context-reader-D1Tx1G6V.mjs";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Stream from "effect/Stream";
|
|
4
4
|
import { s as RunId, u as ThreadId } from "./Identifiers-qafW4EP0.mjs";
|
|
5
|
-
import { Qr as ExecutionCheckpoint, Vi as ThreadStoreError, _i as ThreadExport, c as IntegrityReport, vn as SubmissionSnapshot } from "./Admin-
|
|
6
|
-
import { w as ThreadImportReader } from "./ThreadImport-
|
|
5
|
+
import { Qr as ExecutionCheckpoint, Vi as ThreadStoreError, _i as ThreadExport, c as IntegrityReport, vn as SubmissionSnapshot } from "./Admin-26pelcl9.mjs";
|
|
6
|
+
import { w as ThreadImportReader } from "./ThreadImport-BQDW9E_Y.mjs";
|
|
7
7
|
declare namespace ThreadInvariants_d_exports {
|
|
8
8
|
export { ThreadInvariantInput, verifyThreadInvariants };
|
|
9
9
|
}
|
|
@@ -3,7 +3,7 @@ import * as Effect from "effect/Effect";
|
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
4
|
import * as Option from "effect/Option";
|
|
5
5
|
import * as Schema from "effect/Schema";
|
|
6
|
-
import { Xr as AppendResult, Yr as AppendRequest } from "./Admin-
|
|
6
|
+
import { Xr as AppendResult, Yr as AppendRequest } from "./Admin-26pelcl9.mjs";
|
|
7
7
|
declare namespace ThreadProjectionMaintenance_d_exports {
|
|
8
8
|
export { ThreadProjectionError, ThreadProjectionMaintenance, ThreadProjectionMaintenanceService, drainDue };
|
|
9
9
|
}
|
|
@@ -3,7 +3,7 @@ import * as Effect from "effect/Effect";
|
|
|
3
3
|
import * as Schema from "effect/Schema";
|
|
4
4
|
import { u as ThreadId } from "./Identifiers-qafW4EP0.mjs";
|
|
5
5
|
import { d as CanonicalRecordEnvelope, et as RecordId } from "./Records-C9I1nCL9.mjs";
|
|
6
|
-
import { Oi as ThreadNotMaterialized, Si as ThreadExportRequest, Vi as ThreadStoreError, _i as ThreadExport, xi as ThreadExportRejected } from "./Admin-
|
|
6
|
+
import { Oi as ThreadNotMaterialized, Si as ThreadExportRequest, Vi as ThreadStoreError, _i as ThreadExport, xi as ThreadExportRejected } from "./Admin-26pelcl9.mjs";
|
|
7
7
|
declare namespace ThreadTransfer_d_exports {
|
|
8
8
|
export { ThreadExporterReader, TransferFacts, TransferManifest, TransferSection, checkExportSource, checkTransferPageBytes, exportThreadPage, sameTransferManifest, transferDependencies, transferSections };
|
|
9
9
|
}
|
|
@@ -97,7 +97,7 @@ declare const make: (options?: Options) => Readonly<{
|
|
|
97
97
|
}>;
|
|
98
98
|
readonly failure: typeof ToolDiscoveryError;
|
|
99
99
|
readonly failureMode: "error";
|
|
100
|
-
}, CurrentToolCatalog>;
|
|
100
|
+
}, CurrentToolCatalog, Tool.Execution>;
|
|
101
101
|
toolkit: Toolkit.Toolkit<{
|
|
102
102
|
readonly discover_tools: Tool.Tool<"discover_tools", {
|
|
103
103
|
readonly parameters: Schema.Struct<{
|
|
@@ -112,7 +112,7 @@ declare const make: (options?: Options) => Readonly<{
|
|
|
112
112
|
}>;
|
|
113
113
|
readonly failure: typeof ToolDiscoveryError;
|
|
114
114
|
readonly failureMode: "error";
|
|
115
|
-
}, CurrentToolCatalog>;
|
|
115
|
+
}, CurrentToolCatalog, Tool.Execution>;
|
|
116
116
|
}>;
|
|
117
117
|
handlers: import("effect/Layer").Layer<Tool.Handler<"discover_tools">, never, never>;
|
|
118
118
|
}>;
|
|
@@ -16,7 +16,7 @@ declare const ReadToolResult: Tool.Tool<"read_tool_result", {
|
|
|
16
16
|
readonly success: typeof ToolResultPage;
|
|
17
17
|
readonly failure: typeof ToolResultStorageError;
|
|
18
18
|
readonly failureMode: "return";
|
|
19
|
-
}, ContextWindow>;
|
|
19
|
+
}, ContextWindow, Tool.Execution>;
|
|
20
20
|
declare const toolkit: Toolkit.Toolkit<{
|
|
21
21
|
readonly read_tool_result: Tool.Tool<"read_tool_result", {
|
|
22
22
|
readonly parameters: Schema.Struct<{
|
|
@@ -27,7 +27,7 @@ declare const toolkit: Toolkit.Toolkit<{
|
|
|
27
27
|
readonly success: typeof ToolResultPage;
|
|
28
28
|
readonly failure: typeof ToolResultStorageError;
|
|
29
29
|
readonly failureMode: "return";
|
|
30
|
-
}, ContextWindow>;
|
|
30
|
+
}, ContextWindow, Tool.Execution>;
|
|
31
31
|
}>;
|
|
32
32
|
declare const layer: import("effect/Layer").Layer<Tool.Handler<"read_tool_result">, never, never>;
|
|
33
33
|
export { toolkit as i, ToolResults_d_exports as n, layer as r, ReadToolResult as t };
|
|
@@ -14,5 +14,5 @@ declare const Source: Schema.Struct<{
|
|
|
14
14
|
*/
|
|
15
15
|
declare const native: <T extends Tool.AnyProviderDefined>(options: {
|
|
16
16
|
readonly tool: T;
|
|
17
|
-
}) => Toolkit.Toolkit<
|
|
17
|
+
}) => Toolkit.Toolkit<{ readonly [Tool in T & Tool.ProviderDefined<`${string}.${string}`, string, any, false, never> as Tool["name"]]: Tool; }>;
|
|
18
18
|
export { WebSearch_d_exports as n, native as r, Source as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as DefinitionDigests } from "./Records-C9I1nCL9.mjs";
|
|
2
2
|
import { a as Receipt } from "./Receipt-B4feBxMY.mjs";
|
|
3
|
-
import { Gt as LedgerError, Jr as AppendConflict, Oi as ThreadNotMaterialized, Vi as ThreadStoreError, Xt as OwnershipLost, Zt as ParentLinkage, _t as AdmissionPolicyError, bt as AdmissionResult, dn as SubmissionLedger, ft as AdmissionConflict, zi as ThreadStore } from "./Admin-
|
|
3
|
+
import { Gt as LedgerError, Jr as AppendConflict, Oi as ThreadNotMaterialized, Vi as ThreadStoreError, Xt as OwnershipLost, Zt as ParentLinkage, _t as AdmissionPolicyError, bt as AdmissionResult, dn as SubmissionLedger, ft as AdmissionConflict, zi as ThreadStore } from "./Admin-26pelcl9.mjs";
|
|
4
4
|
import { l as SubagentGrant, o as SubagentDelegationCaps, p as SubagentReservationAmounts, s as SubagentExecutionFailure } from "./SubagentContract-B7vQPueI.mjs";
|
|
5
5
|
import { r as Update } from "./AgentUpdates-7xT0It_R.mjs";
|
|
6
6
|
import { t as AgentPolicy } from "./AgentPolicy-D-GmZQex.mjs";
|
|
@@ -9,7 +9,7 @@ import { It as WorkerOrigin, Lt as WorkerOriginRecorded, W as ProducerId, X as R
|
|
|
9
9
|
import { X as workerOriginRecordId } from "./RunJournal-C_1eqQdr.mjs";
|
|
10
10
|
import { G as ThreadStore, M as ThreadIdentityRequest, N as ThreadMaterialization, P as ThreadNotMaterialized, X as ThreadTailRequest, n as AppendRequest, q as ThreadStoreError, t as AppendConflict } from "./ThreadStore-BMUAp5Ta.mjs";
|
|
11
11
|
import { t as WakeScheduler } from "./WakeScheduler-DVYj66C-.mjs";
|
|
12
|
-
import { o as definitionDigestsEqual } from "./agent-registration-
|
|
12
|
+
import { o as definitionDigestsEqual } from "./agent-registration-D9ofkoBa.mjs";
|
|
13
13
|
import { R as LedgerError, V as MarkReadyRequest, a as AdmissionConflict, d as AdmissionRequest, it as SubmissionLedger, u as AdmissionPolicyError } from "./SubmissionLedger-WG0beEyt.mjs";
|
|
14
14
|
// src/durable/internal/thread-initialization.ts
|
|
15
15
|
/** Stable identities retained across admission retries and recovery. */
|
|
@@ -159,4 +159,4 @@ const admitWorker = Effect.fnUntraced(function* (request) {
|
|
|
159
159
|
const WorkerAdmissionPort = Context.Reference("@effect-agent/thread/WorkerAdmissionPort", { defaultValue: () => ({ admit: admitWorker }) });
|
|
160
160
|
export { admitWorker as a, threadCreatedBatchId as c, WorkerAdmission_exports as i, threadCreatedRecordId as l, WorkerAdmissionPort as n, ensureThreadCreated as o, WorkerAdmissionRequest as r, ensureWorkerOrigin as s, WorkerAdmissionFailure as t };
|
|
161
161
|
|
|
162
|
-
//# sourceMappingURL=WorkerAdmission-
|
|
162
|
+
//# sourceMappingURL=WorkerAdmission-D8tw_OmT.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkerAdmission-BhFjx86s.mjs","names":[],"sources":["../src/durable/internal/thread-initialization.ts","../src/durable/WorkerAdmission.ts"],"sourcesContent":["import * as DateTime from 'effect/DateTime'\nimport * as Effect from 'effect/Effect'\nimport * as Schema from 'effect/Schema'\n\nimport type { AgentId, ThreadId } from '../../core/Identifiers'\nimport { WorkerError } from '../../core/Worker'\nimport { DurableRuntimeFailpoint } from '../DurableFailpoint'\nimport {\n BatchId,\n CanonicalBatch,\n type DefinitionDigests,\n type DeploymentId,\n type ProducerId,\n RecordEnvelope,\n RecordId,\n ThreadCreated,\n WorkerOrigin,\n WorkerOriginRecorded,\n} from '../Records'\nimport { workerOriginRecordId } from '../RunJournal'\nimport type { OwnershipLost } from '../SubmissionLedger'\nimport type { AppendConflict, ThreadNotMaterialized, ThreadStoreError } from '../ThreadStore'\nimport { AppendRequest, ThreadIdentityRequest, ThreadStore, ThreadTailRequest } from '../ThreadStore'\nimport { WakeScheduler } from '../WakeScheduler'\nimport { definitionDigestsEqual } from './agent-registration'\n\ninterface InitializationConfig {\n readonly producerId: ProducerId\n readonly deploymentId: DeploymentId\n}\n\n/** Stable identities retained across admission retries and recovery. */\nexport const threadCreatedBatchId = (threadId: ThreadId): BatchId =>\n Schema.decodeSync(BatchId)(`thread-created:${threadId}`)\n\nexport const threadCreatedRecordId = (threadId: ThreadId): RecordId =>\n Schema.decodeSync(RecordId)(`thread-created:${threadId}`)\n\n/**\n * Coordinator invariant: every Thread's first canonical record is `ThreadCreated`,\n * so `tailSequence >= 1` is the deterministic already-created check. Concurrent admissions\n * re-read this invariant after a tail conflict before considering initialization complete.\n */\nexport const ensureThreadCreated = Effect.fnUntraced(\n function*(\n config: InitializationConfig,\n threadId: ThreadId,\n agentId: AgentId,\n definitions: DefinitionDigests,\n ): Effect.fn.Return<\n void,\n ThreadStoreError | ThreadNotMaterialized | AppendConflict | OwnershipLost,\n ThreadStore | WakeScheduler\n > {\n const store = yield* ThreadStore\n const wake = yield* WakeScheduler\n const tail = yield* store.inspectTail(ThreadTailRequest.make({ threadId }))\n\n if (tail.tailSequence > 0) return\n\n const record = yield* Effect.map(DateTime.now, (createdAt) =>\n RecordEnvelope.make({\n recordId: threadCreatedRecordId(threadId),\n family: 'thread',\n schemaVersion: 1,\n createdAt,\n deploymentId: config.deploymentId,\n payload: ThreadCreated.make({ agentId, definitions }),\n }))\n\n yield* store\n .append(\n AppendRequest.make({\n threadId,\n batch: CanonicalBatch.make({\n batchId: threadCreatedBatchId(threadId),\n producerId: config.producerId,\n records: [record],\n }),\n expectedTailSequence: tail.tailSequence,\n }),\n )\n .pipe(\n Effect.catchTag('AppendConflict', (error) =>\n store\n .inspectTail(ThreadTailRequest.make({ threadId }))\n .pipe(\n Effect.flatMap((current) => current.tailSequence > 0 ? Effect.void : Effect.fail(error)),\n )),\n Effect.andThen(wake.notify(threadId)),\n Effect.asVoid,\n )\n },\n (effect) =>\n effect.pipe(\n Effect.retry({\n times: 7,\n while: (error) => error._tag === 'AppendConflict',\n }),\n ),\n)\n\nconst sameOrigin = Schema.toEquivalence(WorkerOrigin)\n\nexport const ensureWorkerOrigin = Effect.fnUntraced(\n function*(config: InitializationConfig, origin: WorkerOrigin) {\n const store = yield* ThreadStore\n const failpoint = yield* DurableRuntimeFailpoint\n\n for (let attempt = 0; attempt < 16; attempt++) {\n const current = yield* store.readIdentity(\n ThreadIdentityRequest.make({ threadId: origin.worker.threadId }),\n )\n\n const existing = current.records.find(\n ({ record }) => record.payload._tag === 'WorkerOriginRecorded',\n )?.record.payload\n\n if (existing?._tag === 'WorkerOriginRecorded') {\n if (!sameOrigin(existing.origin, origin)) {\n return yield* WorkerError.make({ operation: 'start', reason: 'worker-mismatch' })\n }\n\n return\n }\n const first = current.records[0]?.record.payload\n\n if (\n first?._tag !== 'ThreadCreated' ||\n first.agentId !== origin.worker.targetAgentId ||\n !definitionDigestsEqual(first.definitions, origin.targetDigests) ||\n current.records.some(({ record }) => record.payload._tag === 'SubagentLineageRecorded')\n ) {\n return yield* WorkerError.make({ operation: 'start', reason: 'worker-mismatch' })\n }\n const id = workerOriginRecordId(origin.worker.threadId)\n\n yield* failpoint.hit('worker:before-origin-append')\n\n const appended = yield* store\n .append(\n AppendRequest.make({\n threadId: origin.worker.threadId,\n expectedTailSequence: current.tailSequence,\n\n batch: CanonicalBatch.make({\n batchId: yield* Schema.decodeEffect(BatchId)(id).pipe(Effect.orDie),\n producerId: config.producerId,\n records: [\n RecordEnvelope.make({\n recordId: id,\n family: 'thread',\n schemaVersion: 1,\n createdAt: DateTime.makeUnsafe(origin.createdAtMillis),\n deploymentId: config.deploymentId,\n payload: WorkerOriginRecorded.make({ origin }),\n }),\n ],\n }),\n }),\n )\n .pipe(\n Effect.as(true),\n Effect.catchTag('AppendConflict', () => Effect.succeed(false)),\n )\n\n if (appended) {\n yield* failpoint.hit('worker:after-origin-append')\n\n return\n }\n }\n\n return yield* WorkerError.make({ operation: 'start', reason: 'storage' })\n },\n Effect.mapError((cause) =>\n cause._tag === 'WorkerError'\n ? cause\n : WorkerError.make({ operation: 'start', reason: 'storage', cause })\n ),\n)\n","import * as Context from 'effect/Context'\nimport * as Effect from 'effect/Effect'\nimport * as Schema from 'effect/Schema'\n\nimport { DurableRuntimeFailpoint, DurableRuntimeFailpointError } from './DurableFailpoint'\nimport { ensureThreadCreated, ensureWorkerOrigin } from './internal/thread-initialization'\nimport { ProducerId, WorkerAdmission } from './Records'\nimport {\n AdmissionConflict,\n AdmissionPolicyError,\n AdmissionRequest,\n LedgerError,\n MarkReadyRequest,\n SubmissionLedger,\n} from './SubmissionLedger'\nimport {\n AppendConflict,\n ThreadMaterialization,\n ThreadNotMaterialized,\n ThreadStore,\n ThreadStoreError,\n} from './ThreadStore'\nimport { WakeScheduler } from './WakeScheduler'\n\n/**\n * Storage admission after source authorization, input validation and capacity reservation.\n * This is an internal host port, not an authorization entrypoint. Hosts route the whole\n * operation to the destination owner and enroll recovery before executing it.\n */\nexport class WorkerAdmissionRequest extends Schema.Class<WorkerAdmissionRequest>(\n '@effect-agent/thread/WorkerAdmissionRequest',\n)({\n ...AdmissionRequest.fields,\n workerAdmission: WorkerAdmission,\n producerId: ProducerId,\n}) {}\n\nexport const WorkerAdmissionFailure = Schema.Union([\n AdmissionConflict,\n AdmissionPolicyError,\n LedgerError,\n ThreadStoreError,\n ThreadNotMaterialized,\n AppendConflict,\n DurableRuntimeFailpointError,\n])\n\n/** Local implementation shared by every host; retries finish the same admitted row. */\nexport const admitWorker = Effect.fnUntraced(function*(request: WorkerAdmissionRequest) {\n const origin = request.workerAdmission.origin\n\n if (\n origin.worker.threadId !== request.threadId ||\n origin.worker.targetAgentId !== request.agentId ||\n request.parentLinkage !== undefined\n ) {\n return yield* LedgerError.make({\n operation: 'admit worker',\n message: 'Worker admission does not belong to the destination Thread',\n })\n }\n\n const ledger = yield* SubmissionLedger\n const store = yield* ThreadStore\n const wake = yield* WakeScheduler\n const failpoint = yield* DurableRuntimeFailpoint\n const admitted = yield* ledger.admit(AdmissionRequest.make(request))\n\n yield* failpoint.hit('submit:after-admit')\n if (admitted.replayed && admitted.state !== 'admitted') return admitted\n\n yield* store.materialize(\n ThreadMaterialization.make({\n threadId: request.threadId,\n }),\n )\n\n const config = {\n producerId: request.producerId,\n deploymentId: request.deploymentId,\n }\n\n yield* ensureThreadCreated(config, request.threadId, request.agentId, request.agentDigests)\n yield* ensureWorkerOrigin(config, origin).pipe(\n Effect.mapError((cause) => LedgerError.make({ operation: 'worker-origin', message: cause.reason, cause })),\n )\n yield* failpoint.hit('submit:after-materialize')\n yield* ledger.markReady(MarkReadyRequest.make({ submissionId: admitted.submissionId }))\n yield* wake.notify(request.threadId)\n\n return admitted\n})\n\n/** Placement adapter for the composite operation; local hosts use the same implementation. */\nexport const WorkerAdmissionPort = Context.Reference<{ readonly admit: typeof admitWorker }>(\n '@effect-agent/thread/WorkerAdmissionPort',\n { defaultValue: () => ({ admit: admitWorker }) },\n)\n"],"mappings":";;;;;;;;;;;;;;;AAgCA,MAAa,wBAAwB,aACnC,OAAO,WAAW,OAAO,CAAC,CAAC,kBAAkB,UAAU;AAEzD,MAAa,yBAAyB,aACpC,OAAO,WAAW,QAAQ,CAAC,CAAC,kBAAkB,UAAU;;;;;;AAO1D,MAAa,sBAAsB,OAAO,WACxC,WACE,QACA,UACA,SACA,aAKA;CACA,MAAM,QAAQ,OAAO;CACrB,MAAM,OAAO,OAAO;CACpB,MAAM,OAAO,OAAO,MAAM,YAAY,kBAAkB,KAAK,EAAE,SAAS,CAAC,CAAC;CAE1E,IAAI,KAAK,eAAe,GAAG;CAE3B,MAAM,SAAS,OAAO,OAAO,IAAI,SAAS,MAAM,cAC9C,eAAe,KAAK;EAClB,UAAU,sBAAsB,QAAQ;EACxC,QAAQ;EACR,eAAe;EACf;EACA,cAAc,OAAO;EACrB,SAAS,cAAc,KAAK;GAAE;GAAS;EAAY,CAAC;CACtD,CAAC,CAAC;CAEJ,OAAO,MACJ,OACC,cAAc,KAAK;EACjB;EACA,OAAO,eAAe,KAAK;GACzB,SAAS,qBAAqB,QAAQ;GACtC,YAAY,OAAO;GACnB,SAAS,CAAC,MAAM;EAClB,CAAC;EACD,sBAAsB,KAAK;CAC7B,CAAC,CACH,CAAC,CACA,KACC,OAAO,SAAS,mBAAmB,UACjC,MACG,YAAY,kBAAkB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CACjD,KACC,OAAO,SAAS,YAAY,QAAQ,eAAe,IAAI,OAAO,OAAO,OAAO,KAAK,KAAK,CAAC,CACzF,CAAC,GACL,OAAO,QAAQ,KAAK,OAAO,QAAQ,CAAC,GACpC,OAAO,MACT;AACJ,IACC,WACC,OAAO,KACL,OAAO,MAAM;CACX,OAAO;CACP,QAAQ,UAAU,MAAM,SAAS;AAC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C,CACH;CAEA,MAAM,SAAS;EACb,YAAY,QAAQ;EACpB,cAAc,QAAQ;CACxB;CAEA,OAAO,oBAAoB,QAAQ,QAAQ,UAAU,QAAQ,SAAS,QAAQ,YAAY;CAC1F,OAAO,mBAAmB,QAAQ,MAAM,CAAC,CAAC,KACxC,OAAO,UAAU,UAAU,YAAY,KAAK;EAAE,WAAW;EAAiB,SAAS,MAAM;EAAQ;CAAM,CAAC,CAAC,CAC3G;CACA,OAAO,UAAU,IAAI,0BAA0B;CAC/C,OAAO,OAAO,UAAU,iBAAiB,KAAK,EAAE,cAAc,SAAS,aAAa,CAAC,CAAC;CACtF,OAAO,KAAK,OAAO,QAAQ,QAAQ;CAEnC,OAAO;AACT,CAAC;;AAGD,MAAa,sBAAsB,QAAQ,UACzC,4CACA,EAAE,qBAAqB,EAAE,OAAO,YAAY,GAAG,CACjD"}
|
|
1
|
+
{"version":3,"file":"WorkerAdmission-D8tw_OmT.mjs","names":[],"sources":["../src/durable/internal/thread-initialization.ts","../src/durable/WorkerAdmission.ts"],"sourcesContent":["import * as DateTime from 'effect/DateTime'\nimport * as Effect from 'effect/Effect'\nimport * as Schema from 'effect/Schema'\n\nimport type { AgentId, ThreadId } from '../../core/Identifiers'\nimport { WorkerError } from '../../core/Worker'\nimport { DurableRuntimeFailpoint } from '../DurableFailpoint'\nimport {\n BatchId,\n CanonicalBatch,\n type DefinitionDigests,\n type DeploymentId,\n type ProducerId,\n RecordEnvelope,\n RecordId,\n ThreadCreated,\n WorkerOrigin,\n WorkerOriginRecorded,\n} from '../Records'\nimport { workerOriginRecordId } from '../RunJournal'\nimport type { OwnershipLost } from '../SubmissionLedger'\nimport type { AppendConflict, ThreadNotMaterialized, ThreadStoreError } from '../ThreadStore'\nimport { AppendRequest, ThreadIdentityRequest, ThreadStore, ThreadTailRequest } from '../ThreadStore'\nimport { WakeScheduler } from '../WakeScheduler'\nimport { definitionDigestsEqual } from './agent-registration'\n\ninterface InitializationConfig {\n readonly producerId: ProducerId\n readonly deploymentId: DeploymentId\n}\n\n/** Stable identities retained across admission retries and recovery. */\nexport const threadCreatedBatchId = (threadId: ThreadId): BatchId =>\n Schema.decodeSync(BatchId)(`thread-created:${threadId}`)\n\nexport const threadCreatedRecordId = (threadId: ThreadId): RecordId =>\n Schema.decodeSync(RecordId)(`thread-created:${threadId}`)\n\n/**\n * Coordinator invariant: every Thread's first canonical record is `ThreadCreated`,\n * so `tailSequence >= 1` is the deterministic already-created check. Concurrent admissions\n * re-read this invariant after a tail conflict before considering initialization complete.\n */\nexport const ensureThreadCreated = Effect.fnUntraced(\n function*(\n config: InitializationConfig,\n threadId: ThreadId,\n agentId: AgentId,\n definitions: DefinitionDigests,\n ): Effect.fn.Return<\n void,\n ThreadStoreError | ThreadNotMaterialized | AppendConflict | OwnershipLost,\n ThreadStore | WakeScheduler\n > {\n const store = yield* ThreadStore\n const wake = yield* WakeScheduler\n const tail = yield* store.inspectTail(ThreadTailRequest.make({ threadId }))\n\n if (tail.tailSequence > 0) return\n\n const record = yield* Effect.map(DateTime.now, (createdAt) =>\n RecordEnvelope.make({\n recordId: threadCreatedRecordId(threadId),\n family: 'thread',\n schemaVersion: 1,\n createdAt,\n deploymentId: config.deploymentId,\n payload: ThreadCreated.make({ agentId, definitions }),\n }))\n\n yield* store\n .append(\n AppendRequest.make({\n threadId,\n batch: CanonicalBatch.make({\n batchId: threadCreatedBatchId(threadId),\n producerId: config.producerId,\n records: [record],\n }),\n expectedTailSequence: tail.tailSequence,\n }),\n )\n .pipe(\n Effect.catchTag('AppendConflict', (error) =>\n store\n .inspectTail(ThreadTailRequest.make({ threadId }))\n .pipe(\n Effect.flatMap((current) => current.tailSequence > 0 ? Effect.void : Effect.fail(error)),\n )),\n Effect.andThen(wake.notify(threadId)),\n Effect.asVoid,\n )\n },\n (effect) =>\n effect.pipe(\n Effect.retry({\n times: 7,\n while: (error) => error._tag === 'AppendConflict',\n }),\n ),\n)\n\nconst sameOrigin = Schema.toEquivalence(WorkerOrigin)\n\nexport const ensureWorkerOrigin = Effect.fnUntraced(\n function*(config: InitializationConfig, origin: WorkerOrigin) {\n const store = yield* ThreadStore\n const failpoint = yield* DurableRuntimeFailpoint\n\n for (let attempt = 0; attempt < 16; attempt++) {\n const current = yield* store.readIdentity(\n ThreadIdentityRequest.make({ threadId: origin.worker.threadId }),\n )\n\n const existing = current.records.find(\n ({ record }) => record.payload._tag === 'WorkerOriginRecorded',\n )?.record.payload\n\n if (existing?._tag === 'WorkerOriginRecorded') {\n if (!sameOrigin(existing.origin, origin)) {\n return yield* WorkerError.make({ operation: 'start', reason: 'worker-mismatch' })\n }\n\n return\n }\n const first = current.records[0]?.record.payload\n\n if (\n first?._tag !== 'ThreadCreated' ||\n first.agentId !== origin.worker.targetAgentId ||\n !definitionDigestsEqual(first.definitions, origin.targetDigests) ||\n current.records.some(({ record }) => record.payload._tag === 'SubagentLineageRecorded')\n ) {\n return yield* WorkerError.make({ operation: 'start', reason: 'worker-mismatch' })\n }\n const id = workerOriginRecordId(origin.worker.threadId)\n\n yield* failpoint.hit('worker:before-origin-append')\n\n const appended = yield* store\n .append(\n AppendRequest.make({\n threadId: origin.worker.threadId,\n expectedTailSequence: current.tailSequence,\n\n batch: CanonicalBatch.make({\n batchId: yield* Schema.decodeEffect(BatchId)(id).pipe(Effect.orDie),\n producerId: config.producerId,\n records: [\n RecordEnvelope.make({\n recordId: id,\n family: 'thread',\n schemaVersion: 1,\n createdAt: DateTime.makeUnsafe(origin.createdAtMillis),\n deploymentId: config.deploymentId,\n payload: WorkerOriginRecorded.make({ origin }),\n }),\n ],\n }),\n }),\n )\n .pipe(\n Effect.as(true),\n Effect.catchTag('AppendConflict', () => Effect.succeed(false)),\n )\n\n if (appended) {\n yield* failpoint.hit('worker:after-origin-append')\n\n return\n }\n }\n\n return yield* WorkerError.make({ operation: 'start', reason: 'storage' })\n },\n Effect.mapError((cause) =>\n cause._tag === 'WorkerError'\n ? cause\n : WorkerError.make({ operation: 'start', reason: 'storage', cause })\n ),\n)\n","import * as Context from 'effect/Context'\nimport * as Effect from 'effect/Effect'\nimport * as Schema from 'effect/Schema'\n\nimport { DurableRuntimeFailpoint, DurableRuntimeFailpointError } from './DurableFailpoint'\nimport { ensureThreadCreated, ensureWorkerOrigin } from './internal/thread-initialization'\nimport { ProducerId, WorkerAdmission } from './Records'\nimport {\n AdmissionConflict,\n AdmissionPolicyError,\n AdmissionRequest,\n LedgerError,\n MarkReadyRequest,\n SubmissionLedger,\n} from './SubmissionLedger'\nimport {\n AppendConflict,\n ThreadMaterialization,\n ThreadNotMaterialized,\n ThreadStore,\n ThreadStoreError,\n} from './ThreadStore'\nimport { WakeScheduler } from './WakeScheduler'\n\n/**\n * Storage admission after source authorization, input validation and capacity reservation.\n * This is an internal host port, not an authorization entrypoint. Hosts route the whole\n * operation to the destination owner and enroll recovery before executing it.\n */\nexport class WorkerAdmissionRequest extends Schema.Class<WorkerAdmissionRequest>(\n '@effect-agent/thread/WorkerAdmissionRequest',\n)({\n ...AdmissionRequest.fields,\n workerAdmission: WorkerAdmission,\n producerId: ProducerId,\n}) {}\n\nexport const WorkerAdmissionFailure = Schema.Union([\n AdmissionConflict,\n AdmissionPolicyError,\n LedgerError,\n ThreadStoreError,\n ThreadNotMaterialized,\n AppendConflict,\n DurableRuntimeFailpointError,\n])\n\n/** Local implementation shared by every host; retries finish the same admitted row. */\nexport const admitWorker = Effect.fnUntraced(function*(request: WorkerAdmissionRequest) {\n const origin = request.workerAdmission.origin\n\n if (\n origin.worker.threadId !== request.threadId ||\n origin.worker.targetAgentId !== request.agentId ||\n request.parentLinkage !== undefined\n ) {\n return yield* LedgerError.make({\n operation: 'admit worker',\n message: 'Worker admission does not belong to the destination Thread',\n })\n }\n\n const ledger = yield* SubmissionLedger\n const store = yield* ThreadStore\n const wake = yield* WakeScheduler\n const failpoint = yield* DurableRuntimeFailpoint\n const admitted = yield* ledger.admit(AdmissionRequest.make(request))\n\n yield* failpoint.hit('submit:after-admit')\n if (admitted.replayed && admitted.state !== 'admitted') return admitted\n\n yield* store.materialize(\n ThreadMaterialization.make({\n threadId: request.threadId,\n }),\n )\n\n const config = {\n producerId: request.producerId,\n deploymentId: request.deploymentId,\n }\n\n yield* ensureThreadCreated(config, request.threadId, request.agentId, request.agentDigests)\n yield* ensureWorkerOrigin(config, origin).pipe(\n Effect.mapError((cause) => LedgerError.make({ operation: 'worker-origin', message: cause.reason, cause })),\n )\n yield* failpoint.hit('submit:after-materialize')\n yield* ledger.markReady(MarkReadyRequest.make({ submissionId: admitted.submissionId }))\n yield* wake.notify(request.threadId)\n\n return admitted\n})\n\n/** Placement adapter for the composite operation; local hosts use the same implementation. */\nexport const WorkerAdmissionPort = Context.Reference<{ readonly admit: typeof admitWorker }>(\n '@effect-agent/thread/WorkerAdmissionPort',\n { defaultValue: () => ({ admit: admitWorker }) },\n)\n"],"mappings":";;;;;;;;;;;;;;;AAgCA,MAAa,wBAAwB,aACnC,OAAO,WAAW,OAAO,CAAC,CAAC,kBAAkB,UAAU;AAEzD,MAAa,yBAAyB,aACpC,OAAO,WAAW,QAAQ,CAAC,CAAC,kBAAkB,UAAU;;;;;;AAO1D,MAAa,sBAAsB,OAAO,WACxC,WACE,QACA,UACA,SACA,aAKA;CACA,MAAM,QAAQ,OAAO;CACrB,MAAM,OAAO,OAAO;CACpB,MAAM,OAAO,OAAO,MAAM,YAAY,kBAAkB,KAAK,EAAE,SAAS,CAAC,CAAC;CAE1E,IAAI,KAAK,eAAe,GAAG;CAE3B,MAAM,SAAS,OAAO,OAAO,IAAI,SAAS,MAAM,cAC9C,eAAe,KAAK;EAClB,UAAU,sBAAsB,QAAQ;EACxC,QAAQ;EACR,eAAe;EACf;EACA,cAAc,OAAO;EACrB,SAAS,cAAc,KAAK;GAAE;GAAS;EAAY,CAAC;CACtD,CAAC,CAAC;CAEJ,OAAO,MACJ,OACC,cAAc,KAAK;EACjB;EACA,OAAO,eAAe,KAAK;GACzB,SAAS,qBAAqB,QAAQ;GACtC,YAAY,OAAO;GAC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Q,WACxC,QAAQ,kBAAkB,KAAA,GAE1B,OAAO,OAAO,YAAY,KAAK;EAC7B,WAAW;EACX,SAAS;CACX,CAAC;CAGH,MAAM,SAAS,OAAO;CACtB,MAAM,QAAQ,OAAO;CACrB,MAAM,OAAO,OAAO;CACpB,MAAM,YAAY,OAAO;CACzB,MAAM,WAAW,OAAO,OAAO,MAAM,iBAAiB,KAAK,OAAO,CAAC;CAEnE,OAAO,UAAU,IAAI,oBAAoB;CACzC,IAAI,SAAS,YAAY,SAAS,UAAU,YAAY,OAAO;CAE/D,OAAO,MAAM,YACX,sBAAsB,KAAK,EACzB,UAAU,QAAQ,SACpB,CAAC,CACH;CAEA,MAAM,SAAS;EACb,YAAY,QAAQ;EACpB,cAAc,QAAQ;CACxB;CAEA,OAAO,oBAAoB,QAAQ,QAAQ,UAAU,QAAQ,SAAS,QAAQ,YAAY;CAC1F,OAAO,mBAAmB,QAAQ,MAAM,CAAC,CAAC,KACxC,OAAO,UAAU,UAAU,YAAY,KAAK;EAAE,WAAW;EAAiB,SAAS,MAAM;EAAQ;CAAM,CAAC,CAAC,CAC3G;CACA,OAAO,UAAU,IAAI,0BAA0B;CAC/C,OAAO,OAAO,UAAU,iBAAiB,KAAK,EAAE,cAAc,SAAS,aAAa,CAAC,CAAC;CACtF,OAAO,KAAK,OAAO,QAAQ,QAAQ;CAEnC,OAAO;AACT,CAAC;;AAGD,MAAa,sBAAsB,QAAQ,UACzC,4CACA,EAAE,qBAAqB,EAAE,OAAO,YAAY,GAAG,CACjD"}
|
|
@@ -2,14 +2,14 @@ import * as Context from "effect/Context";
|
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Option from "effect/Option";
|
|
4
4
|
import * as Schema from "effect/Schema";
|
|
5
|
-
import { r as AnyDefinition } from "./Agent-
|
|
5
|
+
import { r as AnyDefinition } from "./Agent-BH_R6LOI.mjs";
|
|
6
6
|
import { t as AgentPolicy } from "./AgentPolicy-D-GmZQex.mjs";
|
|
7
7
|
import { r as Principal } from "./Receipt-B4feBxMY.mjs";
|
|
8
8
|
import { l as SubmissionId, t as AgentId, u as ThreadId } from "./Identifiers-qafW4EP0.mjs";
|
|
9
9
|
import { i as SubagentBudgetReservation } from "./SubagentContract-B7vQPueI.mjs";
|
|
10
10
|
import { c as WorkerError, f as WorkerRef, h as WorkerSource } from "./Worker-xxucY_0b.mjs";
|
|
11
11
|
import { Ft as WorkerContinuation, K as PersistedJson, S as Digest, b as DefinitionDigests, p as CanonicalSequence, zt as WorkerOrigin } from "./Records-C9I1nCL9.mjs";
|
|
12
|
-
import { vn as SubmissionSnapshot } from "./Admin-
|
|
12
|
+
import { vn as SubmissionSnapshot } from "./Admin-26pelcl9.mjs";
|
|
13
13
|
declare namespace WorkerHost_d_exports {
|
|
14
14
|
export { WorkerBudgetAuthorizer, WorkerConcurrencyLimit, WorkerConcurrencyResolver, WorkerHostAuthorizationRequest, WorkerHostAuthorizer, WorkerHostConfig, WorkerHostLimits, WorkerPolicyResolver, WorkerPolicySource, WorkerPolicyTarget, WorkerStartAdmission };
|
|
15
15
|
}
|
|
@@ -13,7 +13,7 @@ import { h as getToolExecutionKind } from "./SubagentContract-C-7AxTm_.mjs";
|
|
|
13
13
|
import { a as PinnedTool, l as ToolNamespace, n as DiscoveryTool, r as IncludesCatalogDocumentation, t as AdditionalToolCatalog } from "./ToolExposure-DPnq8Won.mjs";
|
|
14
14
|
import { i as ContextRolloverTool } from "./ContextWindow-kbFcs1IF.mjs";
|
|
15
15
|
import { n as getToolExecutionClass } from "./tool-execution-Cl7v8fXU.mjs";
|
|
16
|
-
import { g as withAttempt } from "./AgentRuntime-
|
|
16
|
+
import { g as withAttempt } from "./AgentRuntime-CrYYV9RF.mjs";
|
|
17
17
|
import { r as WorkerReportPreparationFailure } from "./SubagentHost-BEnICu7g.mjs";
|
|
18
18
|
import { o as digestDefinitions, s as digestJson, t as DigestError } from "./Digest-CU6IWj-2.mjs";
|
|
19
19
|
import { tt as ReplayContract, v as DefinitionDigests } from "./Records-C645aQks.mjs";
|
|
@@ -259,4 +259,4 @@ const compileRegistrations = (entries) => {
|
|
|
259
259
|
};
|
|
260
260
|
export { compileRegistrations as a, resolveDefinitionBinding as c, compileBindingContracts as i, resolveWorkerBinding as l, CurrentBindingSelection as n, definitionDigestsEqual as o, DurableWorkerBinding as r, makeLegacyWorkerBinding as s, BindingUnavailable as t, toolReplayContracts as u };
|
|
261
261
|
|
|
262
|
-
//# sourceMappingURL=agent-registration-
|
|
262
|
+
//# sourceMappingURL=agent-registration-D9ofkoBa.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-registration-CNs2twrr.mjs","names":["withProvisionalTextAttempt","run"],"sources":["../src/durable/internal/agent-registration.ts"],"sourcesContent":["import * as Tool from 'effect/ai/Tool'\nimport * as Context from 'effect/Context'\nimport * as CryptoDigest from 'effect/crypto/Digest'\nimport * as Effect from 'effect/Effect'\nimport * as Layer from 'effect/Layer'\nimport * as Option from 'effect/Option'\nimport * as References from 'effect/References'\nimport * as Schema from 'effect/Schema'\nimport * as Scope from 'effect/Scope'\nimport * as Tracer from 'effect/Tracer'\n\nimport type * as Agent from '../../core/Agent'\nimport {\n type InputPromptSource,\n type InstructionSource,\n type ModelServices,\n type RunDispositionDeclaration,\n} from '../../core/Agent'\nimport { AgentId, type ThreadId } from '../../core/Identifiers'\nimport { getToolExecutionKind } from '../../core/SubagentContract'\nimport {\n AdditionalToolCatalog,\n DiscoveryTool,\n IncludesCatalogDocumentation,\n PinnedTool,\n ToolNamespace,\n} from '../../core/ToolExposure'\nimport { type RuntimeBinding } from '../../engine/AgentRuntime'\nimport { ContextRolloverTool } from '../../engine/ContextWindow'\nimport { getToolExecutionClass } from '../../engine/DurableStep'\nimport { withAttempt as withProvisionalTextAttempt } from '../../engine/internal/provisional-text'\nimport { type WorkerReporting, WorkerReportPreparationFailure } from '../../engine/SubagentHost'\nimport { digestDefinitions, DigestError, digestJson } from '../Digest'\nimport type { DurableWorkerFailure, DurableWorkerRequirements } from '../DurableAgentRuntime'\nimport type { DefinitionDigestInput, Digest, PersistedJson } from '../Records'\nimport { DefinitionDigests, ReplayContract } from '../Records'\nimport type { Claim, Settlement, SubmissionSnapshot } from '../SubmissionLedger'\n\n/** No unique current Binding can execute the stable Agent identity or decode its accepted input. */\nexport class BindingUnavailable extends Schema.TaggedError<BindingUnavailable>()(\n 'BindingUnavailable',\n { agentId: AgentId, message: Schema.String },\n) {}\n\nexport type DurableBindingFailure = BindingUnavailable\n\n/**\n * Submission execution/recovery routing for stable identities shared by current Definitions.\n * Worker declarations and peer-messaging endpoints still require unique Agent identities.\n */\nexport interface BindingSelection {\n /** Change when routing changes, so hosts can retry parked work without rewriting admission. */\n readonly key: string\n /**\n * Select an exact registered Definition using the canonical Submission and authoritative host\n * state. Undefined retains unique-identity resolution. Never grant authority or mutate here;\n * input decoding, replay contracts and current Tool authorization still apply after selection.\n */\n readonly select: (\n submission: SubmissionSnapshot,\n ) => Effect.Effect<Agent.AnyDefinition | undefined, DurableWorkerFailure | BindingUnavailable>\n}\n\n/** Captured at runtime construction; callers cannot replace routing during an Attempt. */\nexport const CurrentBindingSelection = Context.Reference<BindingSelection | undefined>(\n '@effect-agent/thread/CurrentBindingSelection',\n { defaultValue: () => undefined },\n)\n\n/** Exact immutable admission, lineage and delivery evidence; never an executable-code gate. */\nexport const definitionDigestsEqual = (\n left: DefinitionDigests,\n right: DefinitionDigests,\n): boolean =>\n left.agent === right.agent &&\n left.model === right.model &&\n left.tools === right.tools &&\n Schema.toEquivalence(Schema.UndefinedOr(ReplayContract))(left.replay, right.replay)\n\n/**\n * Explicit versions must cover every current Tool. Change a version when handler meaning,\n * durable Step names/codecs, external idempotency keys, authorization, completion projection,\n * or child/report protocols change. JSON Schema cannot detect handler or codec-transform changes.\n */\nexport interface ReplayVersions {\n readonly tools: Readonly<Record<string, PersistedJson>>\n}\n\n// These are immutable declaration projections, never model or admission contexts.\nconst replaySchemaProjections = new WeakMap<Schema.Top, Schema.Json>()\n\ntype CachedFallbackContracts = {\n readonly tools: ReadonlyArray<Tool.Any>\n readonly completionTool: string | undefined\n readonly version: PersistedJson\n readonly contracts: Record<string, Digest>\n}\n\nconst fallbackContracts = new WeakMap<\n CryptoDigest.Digest['Service'],\n WeakMap<object, CachedFallbackContracts>\n>()\n\n/** Hash current operation contracts; no historical definitions or schemas are retained. */\nexport const toolReplayContracts = Effect.fnUntraced(function*(\n definition: Agent.AnyDefinition,\n versions?: ReplayVersions,\n fallbackVersion: PersistedJson = null,\n) {\n // Optional lookup preserves validation before a missing-service defect. A\n // different host Digest service must never inherit another host's digest map.\n const crypto = Option.getOrUndefined(yield* Effect.serviceOption(CryptoDigest.Digest))\n\n const invalidContracts = () =>\n DigestError.make({\n message: 'Operation contracts require serializable codecs and a version for every Tool',\n })\n\n const prepared = yield* Effect.try({\n try: () => {\n const tools = Object.values(definition.toolkit.tools)\n const completionTool = definition.completion?.tool\n // Object-valued versions may be mutable caller data. Only primitive fallback\n // versions can reuse a result, and only one result is retained per toolkit.\n\n const cacheable = versions === undefined && (fallbackVersion === null || typeof fallbackVersion !== 'object')\n\n const cached = cacheable && crypto !== undefined\n ? fallbackContracts.get(crypto)?.get(definition.toolkit.tools)\n : undefined\n\n if (\n cached !== undefined &&\n cached.version === fallbackVersion &&\n cached.completionTool === completionTool &&\n cached.tools.length === tools.length &&\n cached.tools.every((tool, index) => tool === tools[index])\n ) {\n return { _tag: 'Cached' as const, contracts: { ...cached.contracts } }\n }\n\n const jsonSchema = (schema: Schema.Top) => {\n const cached = replaySchemaProjections.get(schema)\n\n if (cached !== undefined) return cached\n\n const projection = Schema.decodeUnknownSync(Schema.Json)(\n Tool.getJsonSchemaFromSchema(schema),\n )\n\n replaySchemaProjections.set(schema, projection)\n\n return projection\n }\n\n return {\n _tag: 'Compile' as const,\n jsonSchema,\n cacheable,\n tools,\n completionTool,\n }\n },\n catch: () =>\n DigestError.make({\n message: 'Operation contracts require serializable codecs and a version for every Tool',\n }),\n })\n\n if (prepared._tag === 'Cached') return prepared.contracts\n\n const declarations = yield* Effect.forEach(\n prepared.tools,\n Effect.fnUntraced(function*(tool) {\n const { version, present } = yield* Effect.try({\n try: () => ({\n version: versions === undefined ? fallbackVersion : versions.tools[tool.name],\n present: versions === undefined || Object.hasOwn(versions.tools, tool.name),\n }),\n catch: invalidContracts,\n })\n\n if (version === undefined || !present) return yield* invalidContracts()\n\n const providerArgs = Tool.isProviderDefined(tool)\n ? yield* Schema.decodeUnknownEffect(Schema.Json)(tool.args ?? null).pipe(\n Effect.mapError(invalidContracts),\n )\n : undefined\n\n return yield* Effect.try({\n try: () => ({\n name: tool.name,\n contract: {\n version,\n ...(Tool.isProviderDefined(tool)\n ? {\n provider: {\n id: tool.id,\n providerName: tool.providerName,\n args: providerArgs ?? null,\n requiresHandler: tool.requiresHandler,\n },\n readonly: Context.get(tool.annotations, Tool.Readonly),\n }\n : {}),\n parameters: prepared.jsonSchema(tool.parametersSchema),\n success: prepared.jsonSchema(tool.successSchema),\n failure: prepared.jsonSchema(tool.failureSchema),\n failureMode: tool.failureMode,\n needsApproval: typeof tool.needsApproval === 'function' ? 'dynamic' : (tool.needsApproval ?? false),\n executionClass: getToolExecutionClass(tool),\n executionKind: getToolExecutionKind(tool.annotations),\n contextRollover: Context.get(tool.annotations, ContextRolloverTool),\n completion: definition.completion?.tool === tool.name,\n },\n }),\n catch: invalidContracts,\n })\n }),\n )\n\n const contracts = Object.fromEntries(\n yield* Effect.forEach(\n declarations,\n ({ name, contract }) => digestJson(contract).pipe(Effect.map((digest) => [name, digest] as const)),\n ),\n )\n\n if (prepared.cacheable && crypto !== undefined) {\n const cache = fallbackContracts.get(crypto) ?? new WeakMap<object, CachedFallbackContracts>()\n\n cache.set(definition.toolkit.tools, {\n tools: prepared.tools,\n completionTool: prepared.completionTool,\n version: fallbackVersion,\n contracts: { ...contracts },\n })\n fallbackContracts.set(crypto, cache)\n }\n\n return contracts\n})\n\n/** Compile current metadata without acquiring executable services. */\nexport const compileBindingContracts = Effect.fnUntraced(function*(\n definition: Agent.AnyDefinition,\n definitions: DefinitionDigestInput,\n versions?: ReplayVersions,\n): Effect.fn.Return<Pick<ResolvedBinding, 'digests'>, DigestError, CryptoDigest.Digest> {\n const digests = yield* digestDefinitions(definitions)\n const tools = yield* toolReplayContracts(definition, versions, definitions.tools)\n\n return {\n digests: DefinitionDigests.make({\n ...digests,\n replay: ReplayContract.make({ agent: digests.agent, tools }),\n }),\n }\n})\n\ntype ExecutableDefinition = Agent.AnyDefinition & {\n readonly instructions: InstructionSource<never, unknown, unknown>\n readonly inputPrompt?: InputPromptSource<never, unknown, unknown> | undefined\n}\n\n/** Executable model Binding accepted by durable registration descriptors. */\nexport type ExecutableAgentBinding = {\n readonly definition: ExecutableDefinition\n readonly model: Layer.Layer<ModelServices, never, unknown>\n}\n\n/**\n * Internal coordinator entry point for one fenced Attempt over an already-granted claim.\n * The generic signature matches `runAttempt` and is specialized for each captured Agent.\n */\ntype ResolvedAttemptDriver = <\n InputSchema extends Schema.Top,\n OutputSchema extends Schema.Top,\n Instructions,\n Tools extends Record<string, Tool.Any>,\n ModelProvides,\n ModelRequires,\n InstructionError,\n InstructionRequirements,\n RunDispositionValue extends\n | RunDispositionDeclaration<OutputSchema['Type'], Schema.Top>\n | undefined,\n InputPromptValue extends InputPromptSource<InputSchema['Type'], unknown, unknown> | undefined,\n UpdatesSchema extends Schema.Top | undefined,\n>(\n agent: RuntimeBinding<\n InputSchema,\n OutputSchema,\n Instructions,\n Tools,\n ModelProvides,\n ModelRequires,\n InstructionError,\n InstructionRequirements,\n RunDispositionValue,\n InputPromptValue,\n UpdatesSchema\n >,\n threadId: ThreadId,\n claim: Claim,\n) => Effect.Effect<\n Option.Option<Settlement>,\n DurableWorkerFailure | DurableBindingFailure,\n DurableWorkerRequirements<\n RuntimeBinding<\n InputSchema,\n OutputSchema,\n Instructions,\n Tools,\n ModelProvides,\n ModelRequires,\n InstructionError,\n InstructionRequirements,\n RunDispositionValue,\n InputPromptValue,\n UpdatesSchema\n >,\n InstructionRequirements\n >\n>\n\ntype CapturedAttempt<A extends ExecutableAgentBinding> = (\n agent: A,\n threadId: ThreadId,\n claim: Claim,\n) => Effect.Effect<\n Option.Option<Settlement>,\n DurableWorkerFailure | DurableBindingFailure,\n DurableWorkerRequirements<A>\n>\n\n/**\n * An Agent with its worker services captured, ready to drive a fenced Attempt.\n * Concrete Schema and model types stay inside this closure when registrations are collected.\n */\ninterface CapturedBinding {\n readonly agentId: AgentId\n /** Exact immutable definition whose codecs and behavior the worker captured. */\n readonly definition: Agent.AnyDefinition\n /** Captured independently from per-Attempt services: report preparation has no fenced Claim. */\n readonly reporting?: ReadonlyArray<WorkerReporting<WorkerReportPreparationFailure>>\n readonly attempt: (\n driver: ResolvedAttemptDriver,\n threadId: ThreadId,\n claim: Claim,\n ) => Effect.Effect<Option.Option<Settlement>, DurableWorkerFailure | DurableBindingFailure>\n}\n\n// Registrations outlive their construction span. Dependencies remain captured,\n// while every attempt/report inherits the invoking fiber's tracing state.\nconst omitTraceContext = Context.omit(\n Scope.Scope,\n Tracer.ParentSpan,\n Tracer.Tracer,\n Tracer.MinimumTraceLevel,\n Tracer.CurrentTraceLevel,\n References.TracerEnabled,\n References.TracerTimingEnabled,\n References.TracerSpanAnnotations,\n References.TracerSpanLinks,\n References.CurrentLoggers,\n References.CurrentLogLevel,\n References.MinimumLogLevel,\n References.CurrentStackFrame,\n References.CurrentLogAnnotations,\n References.CurrentLogSpans,\n)\n\n// R describes captured application services; ParentSpan is supplied by the\n// live invocation rather than stored as a registration dependency.\nconst withoutTraceContext = <R>(context: Context.Context<R>): Context.Context<R> =>\n omitTraceContext(context) as Context.Context<R>\n\nconst captureReporting = <E, R>(reports: ReadonlyArray<WorkerReporting<E, R>>) =>\n Effect.map(\n Effect.context<Exclude<R, Scope.Scope>>().pipe(Effect.map(withoutTraceContext)),\n (context) =>\n reports.map((report): WorkerReporting<WorkerReportPreparationFailure> => ({\n ...report,\n prepare: (value) =>\n Effect.scoped(Effect.suspend(() => report.prepare(value))).pipe(\n Effect.provide(context),\n Effect.mapError((error) =>\n Schema.is(WorkerReportPreparationFailure)(error)\n ? error\n : WorkerReportPreparationFailure.make({ stage: 'preparation' })\n ),\n ),\n })),\n )\n\n/** One exact executable registration used by durable claim-time resolution. */\nexport interface ResolvedBinding extends CapturedBinding {\n readonly digests: DefinitionDigests\n}\n\n/** Trusted claim identity for resolving per-Attempt application services. Not model input. */\nexport interface AgentAttemptContext {\n readonly threadId: ThreadId\n readonly submissionId: Claim['submissionId']\n readonly attemptId: Claim['attemptId']\n}\n\nconst capture = <A extends ExecutableAgentBinding, Requires>(\n agent: A,\n prepare: (\n execute: ReturnType<CapturedAttempt<A>>,\n context: AgentAttemptContext,\n ) => Effect.Effect<\n Option.Option<Settlement>,\n DurableWorkerFailure | DurableBindingFailure,\n Requires\n >,\n): Effect.Effect<CapturedBinding, never, Requires> =>\n Effect.map(\n Effect.context<Requires>().pipe(Effect.map(withoutTraceContext)),\n (context): CapturedBinding => ({\n agentId: agent.definition.id,\n definition: agent.definition,\n attempt: (driver, threadId, claim) => {\n // Registration closes one concrete Binding before heterogeneous registrations are\n // collected. TypeScript cannot instantiate the higher-rank RuntimeBinding parameters\n // from the intentionally erased public shape, so specialize the driver back to A here.\n const run = driver as unknown as CapturedAttempt<A>\n\n const execute = withProvisionalTextAttempt(\n run(agent, threadId, claim),\n threadId,\n claim.submissionId,\n claim.attemptId,\n )\n\n return prepare(execute, {\n threadId,\n submissionId: claim.submissionId,\n attemptId: claim.attemptId,\n }).pipe(Effect.provide(context))\n },\n }),\n )\n\nconst captureWithAttemptLayer = <A extends ExecutableAgentBinding, Provides, Requires>(\n agent: A,\n attemptLayer: (context: AgentAttemptContext) => Layer.Layer<Provides, never, Requires>,\n) => capture(agent, (execute, context) => execute.pipe(Effect.provide(Layer.fresh(attemptLayer(context)))))\n\n/**\n * Build one exact worker registration from an executable Agent Binding and\n * its already-computed definition digests.\n *\n * `make(agent, digests)` captures the binding plus its worker-requirement\n * Context at Layer/effect construction time. Hosts that start from application\n * version declarations should use `compileRegistrations`; low-level fixtures\n * may supply a previously computed digest triple directly.\n */\nexport const DurableWorkerBinding = {\n make: <A extends ExecutableAgentBinding, E = never, R = never>(\n agent: A,\n digests: DefinitionDigests,\n reports: ReadonlyArray<WorkerReporting<E, R>> = [],\n ): Effect.Effect<\n ResolvedBinding,\n never,\n // Infer report services from descriptors, not an enclosing Effect collection's context.\n DurableWorkerRequirements<A> | Exclude<NoInfer<R>, Scope.Scope>\n > =>\n Effect.gen(function*() {\n const binding = yield* capture(agent, (execute) => execute)\n const reporting = yield* captureReporting(reports)\n\n return { ...binding, digests, reporting }\n }),\n} as const\n\n/** INTERNAL identity-only capture retained for the legacy direct worker path. */\nexport const makeLegacyWorkerBinding = <A extends ExecutableAgentBinding>(agent: A) =>\n capture(agent, (execute) => execute)\n\nexport const resolveWorkerBinding = Effect.fnUntraced(function*(\n bindings: ReadonlyArray<ResolvedBinding>,\n submission: SubmissionSnapshot,\n) {\n const selection = yield* CurrentBindingSelection\n const definition = selection === undefined ? undefined : yield* selection.select(submission)\n\n const registered = bindings.filter(\n (binding) =>\n binding.agentId === submission.agentId &&\n (definition === undefined || Object.is(binding.definition, definition)),\n )\n\n const binding = registered[0]\n\n if (registered.length !== 1 || binding === undefined) {\n return yield* BindingUnavailable.make({\n agentId: submission.agentId,\n message: 'Exactly one current Agent Binding must match the accepted Submission',\n })\n }\n\n return binding\n})\n\n/** Resolve authoring-time admission through exact host registration, never by identity alone. */\nexport const resolveDefinitionBinding = (\n bindings: ReadonlyArray<ResolvedBinding>,\n definition: Pick<Agent.AnyDefinition, 'id'>,\n): Effect.Effect<ResolvedBinding, BindingUnavailable> => {\n const candidates = bindings.filter(\n (binding) => binding.agentId === definition.id && Object.is(binding.definition, definition),\n )\n\n const binding = candidates[0]\n\n return candidates.length === 1 && binding !== undefined\n ? Effect.succeed(binding)\n : Effect.fail(\n BindingUnavailable.make({\n agentId: definition.id,\n message: 'Registered admission requires exactly one registration of the exact Agent Definition',\n }),\n )\n}\n\n/** Application versions and a model Layer, supplied directly or through an existing Binding. */\nexport type AgentRegistration<A extends ExecutableAgentBinding = ExecutableAgentBinding> =\n & (\n | { readonly agent: A; readonly model?: never; readonly definitions: DefinitionDigestInput }\n | {\n readonly agent: A['definition']\n readonly model: A['model']\n readonly definitions: DefinitionDigestInput\n }\n )\n & {\n /** Parent-owned completion/update projections; services are captured independently of attempts. */\n readonly reporting?: ReadonlyArray<WorkerReporting<unknown, unknown>>\n /** Explicit operation versions let unchanged unfinished handlers survive toolbox changes. */\n readonly continuity?: {\n readonly versions: ReplayVersions\n }\n /**\n * Build fresh services for exactly one fenced Attempt, across all its Tool/model turns.\n * Finalizes on completion, suspension, failure and interruption. Never reused after eviction.\n * Resolve invocation authority from the trusted claim identity, not captured caller state.\n * Keep fallible resource acquisition lazy in typed Tool operations; this Layer cannot fail.\n * Provide DurableApprovalSuspension here when resources need retention before approval waits.\n */\n readonly attemptLayer?: (context: AgentAttemptContext) => Layer.Layer<never, never, unknown>\n }\n\ntype EntryWorkerRequirements<Entry> = Entry extends {\n readonly agent: infer A extends ExecutableAgentBinding\n} ? DurableWorkerRequirements<A>\n : Entry extends {\n readonly agent: infer D extends ExecutableDefinition\n readonly model: infer M extends ExecutableAgentBinding['model']\n } ? DurableWorkerRequirements<{ readonly definition: D; readonly model: M }>\n : never\n\ntype AttemptLayerRequirements<Requirements, AttemptLayer> = AttemptLayer extends (\n context: AgentAttemptContext,\n) => Layer.Layer<infer Provides, never, infer Requires> ? Exclude<Requirements, Provides> | Requires\n : Requirements\n\n// Conditional options retain every service they may consume. An absent attempt Layer\n// still needs the original worker services; only a definite Layer can remove them.\ntype EntryRequirements<Entry> = Entry extends unknown ?\n | ReportingRequirements<'reporting' extends keyof Entry ? Entry['reporting'] : undefined>\n | AttemptLayerRequirements<\n EntryWorkerRequirements<Entry>,\n 'attemptLayer' extends keyof Entry ? Entry['attemptLayer'] : undefined\n >\n : never\n\ntype ReportingRequirements<Reports> = Reports extends ReadonlyArray<WorkerReporting<infer _E, infer R>>\n ? Exclude<R, Scope.Scope>\n : never\n\ntype RegistrationRequirements<Entries extends ReadonlyArray<AgentRegistration>> = EntryRequirements<\n Entries[number]\n>\n\nconst registrationDefinitions = (entry: AgentRegistration): DefinitionDigestInput => {\n const definition = entry.model === undefined ? entry.agent.definition : entry.agent\n const reports = entry.reporting ?? []\n\n const declaredDefinitions = definition.updates === undefined\n ? entry.definitions\n : {\n ...entry.definitions,\n agent: {\n declaration: entry.definitions.agent,\n updates: Schema.decodeUnknownSync(Schema.Json)(\n Tool.getJsonSchemaFromSchema(definition.updates),\n ),\n updateProtocol: { schemaVersion: 1, tool: 'emit_update' },\n },\n }\n\n const definitions = reports.length === 0\n ? declaredDefinitions\n : {\n ...declaredDefinitions,\n agent: {\n declaration: declaredDefinitions.agent,\n backgroundReporting: reports.map((report) => ({\n delegationId: report.delegationId,\n targetAgentId: report.target.id,\n mode: 'standard',\n // Preserve the fingerprint of existing standard registrations.\n destinationDelegationId: null,\n })),\n },\n }\n\n const exposure = definition.toolExposure\n\n if (\n exposure === undefined &&\n !Object.values(definition.toolkit.tools).some(\n (tool) => Context.get(tool.annotations, DiscoveryTool) || Context.get(tool.annotations, PinnedTool),\n )\n ) {\n return definitions\n }\n\n return {\n ...definitions,\n agent: {\n declaration: definitions.agent,\n toolExposure: {\n initialToolNames: exposure === undefined ? null : [...(exposure.initialToolNames ?? [])],\n maxTools: exposure?.maxTools ?? 64,\n maxSchemaBytes: exposure?.maxSchemaBytes ?? 262_144,\n requiredCompletion: definition.completion?.tool ?? null,\n tools: Object.values(definition.toolkit.tools).map((tool) => ({\n name: tool.name,\n pinned: Context.get(tool.annotations, PinnedTool),\n discovery: Context.get(tool.annotations, DiscoveryTool),\n namespace: Context.get(tool.annotations, ToolNamespace) ?? null,\n includesCatalogDocumentation: Context.get(tool.annotations, IncludesCatalogDocumentation),\n additional: Context.get(tool.annotations, AdditionalToolCatalog).map((entry) => ({\n name: entry.tool.name,\n namespace: entry.namespace,\n method: entry.method,\n })),\n })),\n },\n },\n }\n}\n\n// The public signature distributes over descriptors, including optional attempt Layers.\n// The implementation consumes their erased union and captures the selected Layer's context.\nfunction compileRegistration<Entry extends AgentRegistration>(\n entry: Entry,\n): Effect.Effect<ResolvedBinding, DigestError, CryptoDigest.Digest | EntryRequirements<Entry>>\nfunction compileRegistration(entry: AgentRegistration) {\n return Effect.flatMap(\n Effect.try({\n try: () => registrationDefinitions(entry),\n catch: () => DigestError.make({ message: 'Agent update schema has no serializable wire contract' }),\n }),\n (definitions) =>\n Effect.gen(function*() {\n const agent =\n // The heterogeneous descriptor erases model services; the overload retains EntryRequirements.\n // @effect-diagnostics-next-line anyUnknownInErrorContext:off\n entry.model === undefined ? entry.agent : { definition: entry.agent, model: entry.model }\n\n // Omitted attempt services need no Layer construction or provisioning scope.\n const binding = yield* entry.attemptLayer === undefined\n // Capture closes the erased requirements over the registration's actual Context.\n // @effect-diagnostics-next-line anyUnknownInErrorContext:off\n ? capture(agent, (execute) => execute)\n // The selected Layer discharges its services before the remaining Context is captured.\n // @effect-diagnostics-next-line anyUnknownInErrorContext:off\n : captureWithAttemptLayer(agent, entry.attemptLayer)\n\n // The descriptor erases projection services; EntryRequirements retains them for callers.\n // @effect-diagnostics-next-line anyUnknownInErrorContext:off\n const reporting = yield* captureReporting(entry.reporting ?? [])\n\n return {\n ...binding,\n ...(yield* compileBindingContracts(\n binding.definition,\n definitions,\n entry.continuity?.versions,\n )),\n reporting,\n }\n }),\n )\n}\n\n/** Compile heterogeneous Agent descriptors into exact, dependency-closed worker registrations. */\nexport const compileRegistrations = <const Entries extends ReadonlyArray<AgentRegistration>>(\n entries: Entries,\n): Effect.Effect<\n ReadonlyArray<ResolvedBinding>,\n DigestError,\n CryptoDigest.Digest | RegistrationRequirements<Entries>\n> => {\n return Effect.forEach(entries, compileRegistration<Entries[number]>)\n}\n"],"mappings":";;;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Y,MAAM;GAAO,OAAO,MAAM;EAAM;EAG1F,MAAM,UAAU,OAAO,MAAM,iBAAiB,KAAA,IAG1C,QAAQ,QAAQ,YAAY,OAAO,IAGnC,wBAAwB,OAAO,MAAM,YAAY;EAIrD,MAAM,YAAY,OAAO,iBAAiB,MAAM,aAAa,CAAC,CAAC;EAE/D,OAAO;GACL,GAAG;GACH,GAAI,OAAO,wBACT,QAAQ,YACR,aACA,MAAM,YAAY,QACpB;GACA;EACF;CACF,CAAC,CACL;AACF;;AAGA,MAAa,wBACX,YAKG;CACH,OAAO,OAAO,QAAQ,SAAS,mBAAoC;AACrE"}
|
|
1
|
+
{"version":3,"file":"agent-registration-D9ofkoBa.mjs","names":["withProvisionalTextAttempt","run"],"sources":["../src/durable/internal/agent-registration.ts"],"sourcesContent":["import * as Tool from 'effect/ai/Tool'\nimport * as Context from 'effect/Context'\nimport * as CryptoDigest from 'effect/crypto/Digest'\nimport * as Effect from 'effect/Effect'\nimport * as Layer from 'effect/Layer'\nimport * as Option from 'effect/Option'\nimport * as References from 'effect/References'\nimport * as Schema from 'effect/Schema'\nimport * as Scope from 'effect/Scope'\nimport * as Tracer from 'effect/Tracer'\n\nimport type * as Agent from '../../core/Agent'\nimport {\n type InputPromptSource,\n type InstructionSource,\n type ModelServices,\n type RunDispositionDeclaration,\n} from '../../core/Agent'\nimport { AgentId, type ThreadId } from '../../core/Identifiers'\nimport { getToolExecutionKind } from '../../core/SubagentContract'\nimport {\n AdditionalToolCatalog,\n DiscoveryTool,\n IncludesCatalogDocumentation,\n PinnedTool,\n ToolNamespace,\n} from '../../core/ToolExposure'\nimport { type RuntimeBinding } from '../../engine/AgentRuntime'\nimport { ContextRolloverTool } from '../../engine/ContextWindow'\nimport { getToolExecutionClass } from '../../engine/DurableStep'\nimport { withAttempt as withProvisionalTextAttempt } from '../../engine/internal/provisional-text'\nimport { type WorkerReporting, WorkerReportPreparationFailure } from '../../engine/SubagentHost'\nimport { digestDefinitions, DigestError, digestJson } from '../Digest'\nimport type { DurableWorkerFailure, DurableWorkerRequirements } from '../DurableAgentRuntime'\nimport type { DefinitionDigestInput, Digest, PersistedJson } from '../Records'\nimport { DefinitionDigests, ReplayContract } from '../Records'\nimport type { Claim, Settlement, SubmissionSnapshot } from '../SubmissionLedger'\n\n/** No unique current Binding can execute the stable Agent identity or decode its accepted input. */\nexport class BindingUnavailable extends Schema.TaggedError<BindingUnavailable>()(\n 'BindingUnavailable',\n { agentId: AgentId, message: Schema.String },\n) {}\n\nexport type DurableBindingFailure = BindingUnavailable\n\n/**\n * Submission execution/recovery routing for stable identities shared by current Definitions.\n * Worker declarations and peer-messaging endpoints still require unique Agent identities.\n */\nexport interface BindingSelection {\n /** Change when routing changes, so hosts can retry parked work without rewriting admission. */\n readonly key: string\n /**\n * Select an exact registered Definition using the canonical Submission and authoritative host\n * state. Undefined retains unique-identity resolution. Never grant authority or mutate here;\n * input decoding, replay contracts and current Tool authorization still apply after selection.\n */\n readonly select: (\n submission: SubmissionSnapshot,\n ) => Effect.Effect<Agent.AnyDefinition | undefined, DurableWorkerFailure | BindingUnavailable>\n}\n\n/** Captured at runtime construction; callers cannot replace routing during an Attempt. */\nexport const CurrentBindingSelection = Context.Reference<BindingSelection | undefined>(\n '@effect-agent/thread/CurrentBindingSelection',\n { defaultValue: () => undefined },\n)\n\n/** Exact immutable admission, lineage and delivery evidence; never an executable-code gate. */\nexport const definitionDigestsEqual = (\n left: DefinitionDigests,\n right: DefinitionDigests,\n): boolean =>\n left.agent === right.agent &&\n left.model === right.model &&\n left.tools === right.tools &&\n Schema.toEquivalence(Schema.UndefinedOr(ReplayContract))(left.replay, right.replay)\n\n/**\n * Explicit versions must cover every current Tool. Change a version when handler meaning,\n * durable Step names/codecs, external idempotency keys, authorization, completion projection,\n * or child/report protocols change. JSON Schema cannot detect handler or codec-transform changes.\n */\nexport interface ReplayVersions {\n readonly tools: Readonly<Record<string, PersistedJson>>\n}\n\n// These are immutable declaration projections, never model or admission contexts.\nconst replaySchemaProjections = new WeakMap<Schema.Top, Schema.Json>()\n\ntype CachedFallbackContracts = {\n readonly tools: ReadonlyArray<Tool.Any>\n readonly completionTool: string | undefined\n readonly version: PersistedJson\n readonly contracts: Record<string, Digest>\n}\n\nconst fallbackContracts = new WeakMap<\n CryptoDigest.Digest['Service'],\n WeakMap<object, CachedFallbackContracts>\n>()\n\n/** Hash current operation contracts; no historical definitions or schemas are retained. */\nexport const toolReplayContracts = Effect.fnUntraced(function*(\n definition: Agent.AnyDefinition,\n versions?: ReplayVersions,\n fallbackVersion: PersistedJson = null,\n) {\n // Optional lookup preserves validation before a missing-service defect. A\n // different host Digest service must never inherit another host's digest map.\n const crypto = Option.getOrUndefined(yield* Effect.serviceOption(CryptoDigest.Digest))\n\n const invalidContracts = () =>\n DigestError.make({\n message: 'Operation contracts require serializable codecs and a version for every Tool',\n })\n\n const prepared = yield* Effect.try({\n try: () => {\n const tools = Object.values(definition.toolkit.tools)\n const completionTool = definition.completion?.tool\n // Object-valued versions may be mutable caller data. Only primitive fallback\n // versions can reuse a result, and only one result is retained per toolkit.\n\n const cacheable = versions === undefined && (fallbackVersion === null || typeof fallbackVersion !== 'object')\n\n const cached = cacheable && crypto !== undefined\n ? fallbackContracts.get(crypto)?.get(definition.toolkit.tools)\n : undefined\n\n if (\n cached !== undefined &&\n cached.version === fallbackVersion &&\n cached.completionTool === completionTool &&\n cached.tools.length === tools.length &&\n cached.tools.every((tool, index) => tool === tools[index])\n ) {\n return { _tag: 'Cached' as const, contracts: { ...cached.contracts } }\n }\n\n const jsonSchema = (schema: Schema.Top) => {\n const cached = replaySchemaProjections.get(schema)\n\n if (cached !== undefined) return cached\n\n const projection = Schema.decodeUnknownSync(Schema.Json)(\n Tool.getJsonSchemaFromSchema(schema),\n )\n\n replaySchemaProjections.set(schema, projection)\n\n return projection\n }\n\n return {\n _tag: 'Compile' as const,\n jsonSchema,\n cacheable,\n tools,\n completionTool,\n }\n },\n catch: () =>\n DigestError.make({\n message: 'Operation contracts require serializable codecs and a version for every Tool',\n }),\n })\n\n if (prepared._tag === 'Cached') return prepared.contracts\n\n const declarations = yield* Effect.forEach(\n prepared.tools,\n Effect.fnUntraced(function*(tool) {\n const { version, present } = yield* Effect.try({\n try: () => ({\n version: versions === undefined ? fallbackVersion : versions.tools[tool.name],\n present: versions === undefined || Object.hasOwn(versions.tools, tool.name),\n }),\n catch: invalidContracts,\n })\n\n if (version === undefined || !present) return yield* invalidContracts()\n\n const providerArgs = Tool.isProviderDefined(tool)\n ? yield* Schema.decodeUnknownEffect(Schema.Json)(tool.args ?? null).pipe(\n Effect.mapError(invalidContracts),\n )\n : undefined\n\n return yield* Effect.try({\n try: () => ({\n name: tool.name,\n contract: {\n version,\n ...(Tool.isProviderDefined(tool)\n ? {\n provider: {\n id: tool.id,\n providerName: tool.providerName,\n args: providerArgs ?? null,\n requiresHandler: tool.requiresHandler,\n },\n readonly: Context.get(tool.annotations, Tool.Readonly),\n }\n : {}),\n parameters: prepared.jsonSchema(tool.parametersSchema),\n success: prepared.jsonSchema(tool.successSchema),\n failure: prepared.jsonSchema(tool.failureSchema),\n failureMode: tool.failureMode,\n needsApproval: typeof tool.needsApproval === 'function' ? 'dynamic' : (tool.needsApproval ?? false),\n executionClass: getToolExecutionClass(tool),\n executionKind: getToolExecutionKind(tool.annotations),\n contextRollover: Context.get(tool.annotations, ContextRolloverTool),\n completion: definition.completion?.tool === tool.name,\n },\n }),\n catch: invalidContracts,\n })\n }),\n )\n\n const contracts = Object.fromEntries(\n yield* Effect.forEach(\n declarations,\n ({ name, contract }) => digestJson(contract).pipe(Effect.map((digest) => [name, digest] as const)),\n ),\n )\n\n if (prepared.cacheable && crypto !== undefined) {\n const cache = fallbackContracts.get(crypto) ?? new WeakMap<object, CachedFallbackContracts>()\n\n cache.set(definition.toolkit.tools, {\n tools: prepared.tools,\n completionTool: prepared.completionTool,\n version: fallbackVersion,\n contracts: { ...contracts },\n })\n fallbackContracts.set(crypto, cache)\n }\n\n return contracts\n})\n\n/** Compile current metadata without acquiring executable services. */\nexport const compileBindingContracts = Effect.fnUntraced(function*(\n definition: Agent.AnyDefinition,\n definitions: DefinitionDigestInput,\n versions?: ReplayVersions,\n): Effect.fn.Return<Pick<ResolvedBinding, 'digests'>, DigestError, CryptoDigest.Digest> {\n const digests = yield* digestDefinitions(definitions)\n const tools = yield* toolReplayContracts(definition, versions, definitions.tools)\n\n return {\n digests: DefinitionDigests.make({\n ...digests,\n replay: ReplayContract.make({ agent: digests.agent, tools }),\n }),\n }\n})\n\ntype ExecutableDefinition = Agent.AnyDefinition & {\n readonly instructions: InstructionSource<never, unknown, unknown>\n readonly inputPrompt?: InputPromptSource<never, unknown, unknown> | undefined\n}\n\n/** Executable model Binding accepted by durable registration descriptors. */\nexport type ExecutableAgentBinding = {\n readonly definition: ExecutableDefinition\n readonly model: Layer.Layer<ModelServices, never, unknown>\n}\n\n/**\n * Internal coordinator entry point for one fenced Attempt over an already-granted claim.\n * The generic signature matches `runAttempt` and is specialized for each captured Agent.\n */\ntype ResolvedAttemptDriver = <\n InputSchema extends Schema.Top,\n OutputSchema extends Schema.Top,\n Instructions,\n Tools extends Record<string, Tool.Any>,\n ModelProvides,\n ModelRequires,\n InstructionError,\n InstructionRequirements,\n RunDispositionValue extends\n | RunDispositionDeclaration<OutputSchema['Type'], Schema.Top>\n | undefined,\n InputPromptValue extends InputPromptSource<InputSchema['Type'], unknown, unknown> | undefined,\n UpdatesSchema extends Schema.Top | undefined,\n>(\n agent: RuntimeBinding<\n InputSchema,\n OutputSchema,\n Instructions,\n Tools,\n ModelProvides,\n ModelRequires,\n InstructionError,\n InstructionRequirements,\n RunDispositionValue,\n InputPromptValue,\n UpdatesSchema\n >,\n threadId: ThreadId,\n claim: Claim,\n) => Effect.Effect<\n Option.Option<Settlement>,\n DurableWorkerFailure | DurableBindingFailure,\n DurableWorkerRequirements<\n RuntimeBinding<\n InputSchema,\n OutputSchema,\n Instructions,\n Tools,\n ModelProvides,\n ModelRequires,\n InstructionError,\n InstructionRequirements,\n RunDispositionValue,\n InputPromptValue,\n UpdatesSchema\n >,\n InstructionRequirements\n >\n>\n\ntype CapturedAttempt<A extends ExecutableAgentBinding> = (\n agent: A,\n threadId: ThreadId,\n claim: Claim,\n) => Effect.Effect<\n Option.Option<Settlement>,\n DurableWorkerFailure | DurableBindingFailure,\n DurableWorkerRequirements<A>\n>\n\n/**\n * An Agent with its worker services captured, ready to drive a fenced Attempt.\n * Concrete Schema and model types stay inside this closure when registrations are collected.\n */\ninterface CapturedBinding {\n readonly agentId: AgentId\n /** Exact immutable definition whose codecs and behavior the worker captured. */\n readonly definition: Agent.AnyDefinition\n /** Captured independently from per-Attempt services: report preparation has no fenced Claim. */\n readonly reporting?: ReadonlyArray<WorkerReporting<WorkerReportPreparationFailure>>\n readonly attempt: (\n driver: ResolvedAttemptDriver,\n threadId: ThreadId,\n claim: Claim,\n ) => Effect.Effect<Option.Option<Settlement>, DurableWorkerFailure | DurableBindingFailure>\n}\n\n// Registrations outlive their construction span. Dependencies remain captured,\n// while every attempt/report inherits the invoking fiber's tracing state.\nconst omitTraceContext = Context.omit(\n Scope.Scope,\n Tracer.ParentSpan,\n Tracer.Tracer,\n Tracer.MinimumTraceLevel,\n Tracer.CurrentTraceLevel,\n References.TracerEnabled,\n References.TracerTimingEnabled,\n References.TracerSpanAnnotations,\n References.TracerSpanLinks,\n References.CurrentLoggers,\n References.CurrentLogLevel,\n References.MinimumLogLevel,\n References.CurrentStackFrame,\n References.CurrentLogAnnotations,\n References.CurrentLogSpans,\n)\n\n// R describes captured application services; ParentSpan is supplied by the\n// live invocation rather than stored as a registration dependency.\nconst withoutTraceContext = <R>(context: Context.Context<R>): Context.Context<R> =>\n omitTraceContext(context) as Context.Context<R>\n\nconst captureReporting = <E, R>(reports: ReadonlyArray<WorkerReporting<E, R>>) =>\n Effect.map(\n Effect.context<Exclude<R, Scope.Scope>>().pipe(Effect.map(withoutTraceContext)),\n (context) =>\n reports.map((report): WorkerReporting<WorkerReportPreparationFailure> => ({\n ...report,\n prepare: (value) =>\n Effect.scoped(Effect.suspend(() => report.prepare(value))).pipe(\n Effect.provide(context),\n Effect.mapError((error) =>\n Schema.is(WorkerReportPreparationFailure)(error)\n ? error\n : WorkerReportPreparationFailure.make({ stage: 'preparation' })\n ),\n ),\n })),\n )\n\n/** One exact executable registration used by durable claim-time resolution. */\nexport interface ResolvedBinding extends CapturedBinding {\n readonly digests: DefinitionDigests\n}\n\n/** Trusted claim identity for resolving per-Attempt application services. Not model input. */\nexport interface AgentAttemptContext {\n readonly threadId: ThreadId\n readonly submissionId: Claim['submissionId']\n readonly attemptId: Claim['attemptId']\n}\n\nconst capture = <A extends ExecutableAgentBinding, Requires>(\n agent: A,\n prepare: (\n execute: ReturnType<CapturedAttempt<A>>,\n context: AgentAttemptContext,\n ) => Effect.Effect<\n Option.Option<Settlement>,\n DurableWorkerFailure | DurableBindingFailure,\n Requires\n >,\n): Effect.Effect<CapturedBinding, never, Requires> =>\n Effect.map(\n Effect.context<Requires>().pipe(Effect.map(withoutTraceContext)),\n (context): CapturedBinding => ({\n agentId: agent.definition.id,\n definition: agent.definition,\n attempt: (driver, threadId, claim) => {\n // Registration closes one concrete Binding before heterogeneous registrations are\n // collected. TypeScript cannot instantiate the higher-rank RuntimeBinding parameters\n // from the intentionally erased public shape, so specialize the driver back to A here.\n const run = driver as unknown as CapturedAttempt<A>\n\n const execute = withProvisionalTextAttempt(\n run(agent, threadId, claim),\n threadId,\n claim.submissionId,\n claim.attemptId,\n )\n\n return prepare(execute, {\n threadId,\n submissionId: claim.submissionId,\n attemptId: claim.attemptId,\n }).pipe(Effect.provide(context))\n },\n }),\n )\n\nconst captureWithAttemptLayer = <A extends ExecutableAgentBinding, Provides, Requires>(\n agent: A,\n attemptLayer: (context: AgentAttemptContext) => Layer.Layer<Provides, never, Requires>,\n) => capture(agent, (execute, context) => execute.pipe(Effect.provide(Layer.fresh(attemptLayer(context)))))\n\n/**\n * Build one exact worker registration from an executable Agent Binding and\n * its already-computed definition digests.\n *\n * `make(agent, digests)` captures the binding plus its worker-requirement\n * Context at Layer/effect construction time. Hosts that start from application\n * version declarations should use `compileRegistrations`; low-level fixtures\n * may supply a previously computed digest triple directly.\n */\nexport const DurableWorkerBinding = {\n make: <A extends ExecutableAgentBinding, E = never, R = never>(\n agent: A,\n digests: DefinitionDigests,\n reports: ReadonlyArray<WorkerReporting<E, R>> = [],\n ): Effect.Effect<\n ResolvedBinding,\n never,\n // Infer report services from descriptors, not an enclosing Effect collection's context.\n DurableWorkerRequirements<A> | Exclude<NoInfer<R>, Scope.Scope>\n > =>\n Effect.gen(function*() {\n const binding = yield* capture(agent, (execute) => execute)\n const reporting = yield* captureReporting(reports)\n\n return { ...binding, digests, reporting }\n }),\n} as const\n\n/** INTERNAL identity-only capture retained for the legacy direct worker path. */\nexport const makeLegacyWorkerBinding = <A extends ExecutableAgentBinding>(agent: A) =>\n capture(agent, (execute) => execute)\n\nexport const resolveWorkerBinding = Effect.fnUntraced(function*(\n bindings: ReadonlyArray<ResolvedBinding>,\n submission: SubmissionSnapshot,\n) {\n const selection = yield* CurrentBindingSelection\n const definition = selection === undefined ? undefined : yield* selection.select(submission)\n\n const registered = bindings.filter(\n (binding) =>\n binding.agentId === submission.agentId &&\n (definition === undefined || Object.is(binding.definition, definition)),\n )\n\n const binding = registered[0]\n\n if (registered.length !== 1 || binding === undefined) {\n return yield* BindingUnavailable.make({\n agentId: submission.agentId,\n message: 'Exactly one current Agent Binding must match the accepted Submission',\n })\n }\n\n return binding\n})\n\n/** Resolve authoring-time admission through exact host registration, never by identity alone. */\nexport const resolveDefinitionBinding = (\n bindings: ReadonlyArray<ResolvedBinding>,\n definition: Pick<Agent.AnyDefinition, 'id'>,\n): Effect.Effect<ResolvedBinding, BindingUnavailable> => {\n const candidates = bindings.filter(\n (binding) => binding.agentId === definition.id && Object.is(binding.definition, definition),\n )\n\n const binding = candidates[0]\n\n return candidates.length === 1 && binding !== undefined\n ? Effect.succeed(binding)\n : Effect.fail(\n BindingUnavailable.make({\n agentId: definition.id,\n message: 'Registered admission requires exactly one registration of the exact Agent Definition',\n }),\n )\n}\n\n/** Application versions and a model Layer, supplied directly or through an existing Binding. */\nexport type AgentRegistration<A extends ExecutableAgentBinding = ExecutableAgentBinding> =\n & (\n | { readonly agent: A; readonly model?: never; readonly definitions: DefinitionDigestInput }\n | {\n readonly agent: A['definition']\n readonly model: A['model']\n readonly definitions: DefinitionDigestInput\n }\n )\n & {\n /** Parent-owned completion/update projections; services are captured independently of attempts. */\n readonly reporting?: ReadonlyArray<WorkerReporting<unknown, unknown>>\n /** Explicit operation versions let unchanged unfinished handlers survive toolbox changes. */\n readonly continuity?: {\n readonly versions: ReplayVersions\n }\n /**\n * Build fresh services for exactly one fenced Attempt, across all its Tool/model turns.\n * Finalizes on completion, suspension, failure and interruption. Never reused after eviction.\n * Resolve invocation authority from the trusted claim identity, not captured caller state.\n * Keep fallible resource acquisition lazy in typed Tool operations; this Layer cannot fail.\n * Provide DurableApprovalSuspension here when resources need retention before approval waits.\n */\n readonly attemptLayer?: (context: AgentAttemptContext) => Layer.Layer<never, never, unknown>\n }\n\ntype EntryWorkerRequirements<Entry> = Entry extends {\n readonly agent: infer A extends ExecutableAgentBinding\n} ? DurableWorkerRequirements<A>\n : Entry extends {\n readonly agent: infer D extends ExecutableDefinition\n readonly model: infer M extends ExecutableAgentBinding['model']\n } ? DurableWorkerRequirements<{ readonly definition: D; readonly model: M }>\n : never\n\ntype AttemptLayerRequirements<Requirements, AttemptLayer> = AttemptLayer extends (\n context: AgentAttemptContext,\n) => Layer.Layer<infer Provides, never, infer Requires> ? Exclude<Requirements, Provides> | Requires\n : Requirements\n\n// Conditional options retain every service they may consume. An absent attempt Layer\n// still needs the original worker services; only a definite Layer can remove them.\ntype EntryRequirements<Entry> = Entry extends unknown ?\n | ReportingRequirements<'reporting' extends keyof Entry ? Entry['reporting'] : undefined>\n | AttemptLayerRequirements<\n EntryWorkerRequirements<Entry>,\n 'attemptLayer' extends keyof Entry ? Entry['attemptLayer'] : undefined\n >\n : never\n\ntype ReportingRequirements<Reports> = Reports extends ReadonlyArray<WorkerReporting<infer _E, infer R>>\n ? Exclude<R, Scope.Scope>\n : never\n\ntype RegistrationRequirements<Entries extends ReadonlyArray<AgentRegistration>> = EntryRequirements<\n Entries[number]\n>\n\nconst registrationDefinitions = (entry: AgentRegistration): DefinitionDigestInput => {\n const definition = entry.model === undefined ? entry.agent.definition : entry.agent\n const reports = entry.reporting ?? []\n\n const declaredDefinitions = definition.updates === undefined\n ? entry.definitions\n : {\n ...entry.definitions,\n agent: {\n declaration: entry.definitions.agent,\n updates: Schema.decodeUnknownSync(Schema.Json)(\n Tool.getJsonSchemaFromSchema(definition.updates),\n ),\n updateProtocol: { schemaVersion: 1, tool: 'emit_update' },\n },\n }\n\n const definitions = reports.length === 0\n ? declaredDefinitions\n : {\n ...declaredDefinitions,\n agent: {\n declaration: declaredDefinitions.agent,\n backgroundReporting: reports.map((report) => ({\n delegationId: report.delegationId,\n targetAgentId: report.target.id,\n mode: 'standard',\n // Preserve the fingerprint of existing standard registrations.\n destinationDelegationId: null,\n })),\n },\n }\n\n const exposure = definition.toolExposure\n\n if (\n exposure === undefined &&\n !Object.values(definition.toolkit.tools).some(\n (tool) => Context.get(tool.annotations, DiscoveryTool) || Context.get(tool.annotations, PinnedTool),\n )\n ) {\n return definitions\n }\n\n return {\n ...definitions,\n agent: {\n declaration: definitions.agent,\n toolExposure: {\n initialToolNames: exposure === undefined ? null : [...(exposure.initialToolNames ?? [])],\n maxTools: exposure?.maxTools ?? 64,\n maxSchemaBytes: exposure?.maxSchemaBytes ?? 262_144,\n requiredCompletion: definition.completion?.tool ?? null,\n tools: Object.values(definition.toolkit.tools).map((tool) => ({\n name: tool.name,\n pinned: Context.get(tool.annotations, PinnedTool),\n discovery: Context.get(tool.annotations, DiscoveryTool),\n namespace: Context.get(tool.annotations, ToolNamespace) ?? null,\n includesCatalogDocumentation: Context.get(tool.annotations, IncludesCatalogDocumentation),\n additional: Context.get(tool.annotations, AdditionalToolCatalog).map((entry) => ({\n name: entry.tool.name,\n namespace: entry.namespace,\n method: entry.method,\n })),\n })),\n },\n },\n }\n}\n\n// The public signature distributes over descriptors, including optional attempt Layers.\n// The implementation consumes their erased union and captures the selected Layer's context.\nfunction compileRegistration<Entry extends AgentRegistration>(\n entry: Entry,\n): Effect.Effect<ResolvedBinding, DigestError, CryptoDigest.Digest | EntryRequirements<Entry>>\nfunction compileRegistration(entry: AgentRegistration) {\n return Effect.flatMap(\n Effect.try({\n try: () => registrationDefinitions(entry),\n catch: () => DigestError.make({ message: 'Agent update schema has no serializable wire contract' }),\n }),\n (definitions) =>\n Effect.gen(function*() {\n const agent =\n // The heterogeneous descriptor erases model services; the overload retains EntryRequirements.\n // @effect-diagnostics-next-line anyUnknownInErrorContext:off\n entry.model === undefined ? entry.agent : { definition: entry.agent, model: entry.model }\n\n // Omitted attempt services need no Layer construction or provisioning scope.\n const binding = yield* entry.attemptLayer === undefined\n // Capture closes the erased requirements over the registration's actual Context.\n // @effect-diagnostics-next-line anyUnknownInErrorContext:off\n ? capture(agent, (execute) => execute)\n // The selected Layer discharges its services before the remaining Context is captured.\n // @effect-diagnostics-next-line anyUnknownInErrorContext:off\n : captureWithAttemptLayer(agent, entry.attemptLayer)\n\n // The descriptor erases projection services; EntryRequirements retains them for callers.\n // @effect-diagnostics-next-line anyUnknownInErrorContext:off\n const reporting = yield* captureReporting(entry.reporting ?? [])\n\n return {\n ...binding,\n ...(yield* compileBindingContracts(\n binding.definition,\n definitions,\n entry.continuity?.versions,\n )),\n reporting,\n }\n }),\n )\n}\n\n/** Compile heterogeneous Agent descriptors into exact, dependency-closed worker registrations. */\nexport const compileRegistrations = <const Entries extends ReadonlyArray<AgentRegistration>>(\n entries: Entries,\n): Effect.Effect<\n ReadonlyArray<ResolvedBinding>,\n DigestError,\n CryptoDigest.Digest | RegistrationRequirements<Entries>\n> => {\n return Effect.forEach(entries, compileRegistration<Entries[number]>)\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QAAQ;GAAE,YAAY,MAAM;GAAO,OAAO,MAAM;EAAM;EAG1F,MAAM,UAAU,OAAO,MAAM,iBAAiB,KAAA,IAG1C,QAAQ,QAAQ,YAAY,OAAO,IAGnC,wBAAwB,OAAO,MAAM,YAAY;EAIrD,MAAM,YAAY,OAAO,iBAAiB,MAAM,aAAa,CAAC,CAAC;EAE/D,OAAO;GACL,GAAG;GACH,GAAI,OAAO,wBACT,QAAQ,YACR,aACA,MAAM,YAAY,QACpB;GACA;EACF;CACF,CAAC,CACL;AACF;;AAGA,MAAa,wBACX,YAKG;CACH,OAAO,OAAO,QAAQ,SAAS,mBAAoC;AACrE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as FramesRequest, d as TargetId, f as layer, i as BrowserUsePolicyError, l as SendRequest, n as BrowserUseError, o as CloseTabRequest, p as make, r as BrowserUseFailure, s as FrameInfo, t as BrowserCdp, u as Tab } from "../BrowserUse-
|
|
1
|
+
import { c as FramesRequest, d as TargetId, f as layer, i as BrowserUsePolicyError, l as SendRequest, n as BrowserUseError, o as CloseTabRequest, p as make, r as BrowserUseFailure, s as FrameInfo, t as BrowserCdp, u as Tab } from "../BrowserUse-DgCEbTwW.mjs";
|
|
2
2
|
export { BrowserCdp, BrowserUseError, BrowserUseFailure, BrowserUsePolicyError, CloseTabRequest, FrameInfo, FramesRequest, SendRequest, Tab, TargetId, layer, make };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SearchContextWindows, i as ReadContextWindow, n as GetContextRemaining, o as layer, r as NewContext, s as toolkit } from "../ContextTools-
|
|
1
|
+
import { a as SearchContextWindows, i as ReadContextWindow, n as GetContextRemaining, o as layer, r as NewContext, s as toolkit } from "../ContextTools-D5jrWNNH.mjs";
|
|
2
2
|
export { GetContextRemaining, NewContext, ReadContextWindow, SearchContextWindows, layer, toolkit };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ReadNotes, c as toolkit, i as Options, o as WriteNotes, r as NotesSnapshot, s as layer, t as MemoryNotesError } from "../MemoryNotes-
|
|
1
|
+
import { a as ReadNotes, c as toolkit, i as Options, o as WriteNotes, r as NotesSnapshot, s as layer, t as MemoryNotesError } from "../MemoryNotes-CPvcb5OX.mjs";
|
|
2
2
|
export { MemoryNotesError, NotesSnapshot, Options, ReadNotes, WriteNotes, layer, toolkit };
|
|
@@ -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-BqWHYf93.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-DnnpWe-H.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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { c as SubagentExecutionFailureClassification, d as SubagentPolicy, f as SubagentPolicyInput, l as SubagentGrant, s as SubagentExecutionFailure } from "../SubagentContract-B7vQPueI.mjs";
|
|
2
2
|
import { o as WorkerCompletion, p as WorkerReport } from "../Worker-xxucY_0b.mjs";
|
|
3
|
-
import { A as inspect, B as SubagentProjectionFailure, C as Worker, D as cancelTool, E as cancel, F as start, H as delegationCapsFromPolicy, I as startTool, L as stop, M as list, N as listTool, O as followUp, P as observe, R as summaryTool, S as StartToolOptions, T as awaitWorker, V as delegationAllocationFromPolicy, a as SubagentDelegation, b as ReportingOptions, c as SubagentLayerRequirements, d as SubagentResultContext, f as SubagentReturnModeFailure, g as SubagentTools, h as SubagentToolFailure, i as SubagentDefineOptions, j as inspectTool, k as followUpTool, l as SubagentPrepareContext, m as SubagentTool, n as SubagentContainedFailure, o as SubagentDurableAccounting, p as SubagentRuntimeOptions, r as SubagentDeclarationOptions, s as SubagentFailureMode, t as SubagentChildRunFailure, u as SubagentResult, v as layer, w as WorkerObservation, x as reporting, y as make, z as SubagentPrestartDenied } from "../Subagent-
|
|
3
|
+
import { A as inspect, B as SubagentProjectionFailure, C as Worker, D as cancelTool, E as cancel, F as start, H as delegationCapsFromPolicy, I as startTool, L as stop, M as list, N as listTool, O as followUp, P as observe, R as summaryTool, S as StartToolOptions, T as awaitWorker, V as delegationAllocationFromPolicy, a as SubagentDelegation, b as ReportingOptions, c as SubagentLayerRequirements, d as SubagentResultContext, f as SubagentReturnModeFailure, g as SubagentTools, h as SubagentToolFailure, i as SubagentDefineOptions, j as inspectTool, k as followUpTool, l as SubagentPrepareContext, m as SubagentTool, n as SubagentContainedFailure, o as SubagentDurableAccounting, p as SubagentRuntimeOptions, r as SubagentDeclarationOptions, s as SubagentFailureMode, t as SubagentChildRunFailure, u as SubagentResult, v as layer, w as WorkerObservation, x as reporting, y as make, z as SubagentPrestartDenied } from "../Subagent-GXU32fQt.mjs";
|
|
4
4
|
export { type ReportingOptions, type StartToolOptions, SubagentChildRunFailure, SubagentContainedFailure, SubagentDeclarationOptions, SubagentDefineOptions, SubagentDelegation, SubagentDurableAccounting, 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, cancel, cancelTool, delegationAllocationFromPolicy, delegationCapsFromPolicy, followUp, followUpTool, inspect, inspectTool, layer, list, listTool, make, observe, reporting, start, startTool, stop, summaryTool };
|
|
@@ -2,5 +2,5 @@ import { o as WorkerCompletion, p as WorkerReport } from "../Worker-CQu8Qp1j.mjs
|
|
|
2
2
|
import { c as SubagentExecutionFailureClassification, d as SubagentPolicy, l as SubagentGrant, s as SubagentExecutionFailure } from "../SubagentContract-C-7AxTm_.mjs";
|
|
3
3
|
import { a as delegationAllocationFromPolicy, i as SubagentProjectionFailure, o as delegationCapsFromPolicy, r as SubagentPrestartDenied } from "../subagent-policy-xRJhrc0a.mjs";
|
|
4
4
|
import "../SubagentReservations-BYNAHPpm.mjs";
|
|
5
|
-
import { S as summaryTool, _ as listTool, a as make, b as startTool, c as WorkerObservation, d as cancelTool, f as followUp, g as list, h as inspectTool, i as layer, l as awaitWorker, m as inspect, n as SubagentResult, o as reporting, p as followUpTool, s as Worker, t as SubagentDurableAccounting, u as cancel, v as observe, x as stop, y as start } from "../Subagent-
|
|
5
|
+
import { S as summaryTool, _ as listTool, a as make, b as startTool, c as WorkerObservation, d as cancelTool, f as followUp, g as list, h as inspectTool, i as layer, l as awaitWorker, m as inspect, n as SubagentResult, o as reporting, p as followUpTool, s as Worker, t as SubagentDurableAccounting, u as cancel, v as observe, x as stop, y as start } from "../Subagent-BJJN6n0E.mjs";
|
|
6
6
|
export { SubagentDurableAccounting, SubagentExecutionFailure, SubagentExecutionFailureClassification, SubagentGrant, SubagentPolicy, SubagentPrestartDenied, SubagentProjectionFailure, SubagentResult, Worker, WorkerCompletion, WorkerObservation, WorkerReport, awaitWorker as await, cancel, cancelTool, delegationAllocationFromPolicy, delegationCapsFromPolicy, followUp, followUpTool, inspect, inspectTool, layer, list, listTool, make, observe, reporting, start, startTool, stop, summaryTool };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Result, c as make, i as Parameters, n as Match, o as ToolDiscoveryError, r as Options, t as Descriptor } from "../ToolDiscovery-
|
|
1
|
+
import { a as Result, c as make, i as Parameters, n as Match, o as ToolDiscoveryError, r as Options, t as Descriptor } from "../ToolDiscovery-DvcfbTBk.mjs";
|
|
2
2
|
export { Descriptor, Match, Options, Parameters, Result, ToolDiscoveryError, make };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as toolkit, r as layer, t as ReadToolResult } from "../ToolResults-
|
|
1
|
+
import { i as toolkit, r as layer, t as ReadToolResult } from "../ToolResults-NUk_x837.mjs";
|
|
2
2
|
export { ReadToolResult, layer, toolkit };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as native, t as Source } from "../WebSearch-
|
|
1
|
+
import { r as native, t as Source } from "../WebSearch-RBUUOfT8.mjs";
|
|
2
2
|
export { Source, native };
|
package/dist/core/Agent.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as UpdatesSchema, C as RunDisposition, D as ToolUnion, E as RunDispositionSchema, M as withModel, O as Tools, S as Requirements, T as RunDispositionFailure, _ as ModelServices, a as CompletionProjectionInput, b as Output, c as DefinitionOptions, d as Failure, f as Input, g as InstructionSource, h as InstructionResult, i as Binding, j as make, k as Update, l as DefinitionRequirements, m as InputSchema, n as Any, o as CompletionToolDeclaration, p as InputPromptSource, r as AnyDefinition, s as Definition, u as EncodedInput, v as Name, w as RunDispositionDeclaration, x as OutputSchema, y as NativeModel } from "../Agent-
|
|
1
|
+
import { A as UpdatesSchema, C as RunDisposition, D as ToolUnion, E as RunDispositionSchema, M as withModel, O as Tools, S as Requirements, T as RunDispositionFailure, _ as ModelServices, a as CompletionProjectionInput, b as Output, c as DefinitionOptions, d as Failure, f as Input, g as InstructionSource, h as InstructionResult, i as Binding, j as make, k as Update, l as DefinitionRequirements, m as InputSchema, n as Any, o as CompletionToolDeclaration, p as InputPromptSource, r as AnyDefinition, s as Definition, u as EncodedInput, v as Name, w as RunDispositionDeclaration, x as OutputSchema, y as NativeModel } from "../Agent-BH_R6LOI.mjs";
|
|
2
2
|
export { Any, AnyDefinition, Binding, CompletionProjectionInput, CompletionToolDeclaration, Definition, DefinitionOptions, DefinitionRequirements, EncodedInput, Failure, Input, InputPromptSource, InputSchema, InstructionResult, InstructionSource, ModelServices, Name, NativeModel, Output, OutputSchema, Requirements, RunDisposition, RunDispositionDeclaration, RunDispositionFailure, RunDispositionSchema, ToolUnion, Tools, Update, UpdatesSchema, 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-26pelcl9.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,3 +1,3 @@
|
|
|
1
1
|
/** Public AgentRegistration API. Implementation helpers remain private. */
|
|
2
|
-
import { As as ExecutableAgentBinding, Cs as AgentAttemptContext, Ds as CurrentBindingSelection, Es as BindingUnavailable, Fs as definitionDigestsEqual, Ms as ResolvedBinding, Ns as compileBindingContracts, Os as DurableBindingFailure, Ps as compileRegistrations, Ts as BindingSelection, js as ReplayVersions, ks as DurableWorkerBinding, ws as AgentRegistration } from "../Admin-
|
|
2
|
+
import { As as ExecutableAgentBinding, Cs as AgentAttemptContext, Ds as CurrentBindingSelection, Es as BindingUnavailable, Fs as definitionDigestsEqual, Ms as ResolvedBinding, Ns as compileBindingContracts, Os as DurableBindingFailure, Ps as compileRegistrations, Ts as BindingSelection, js as ReplayVersions, ks as DurableWorkerBinding, ws as AgentRegistration } from "../Admin-26pelcl9.mjs";
|
|
3
3
|
export { type AgentAttemptContext, type AgentRegistration, type BindingSelection, BindingUnavailable, CurrentBindingSelection, type DurableBindingFailure, DurableWorkerBinding, type ExecutableAgentBinding, type ReplayVersions, type ResolvedBinding, compileBindingContracts, compileRegistrations, definitionDigestsEqual };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { t as BindingUnavailable, n as CurrentBindingSelection, r as DurableWorkerBinding, i as compileBindingContracts, a as compileRegistrations, o as definitionDigestsEqual } from "../agent-registration-
|
|
2
|
-
import "../AgentRegistration-
|
|
1
|
+
export { t as BindingUnavailable, n as CurrentBindingSelection, r as DurableWorkerBinding, i as compileBindingContracts, a as compileRegistrations, o as definitionDigestsEqual } from "../agent-registration-D9ofkoBa.mjs";
|
|
2
|
+
import "../AgentRegistration-h07X1mZM.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as CommittedActivityProcessor, n as ActivityPassResult, o as activityWorkId, r as ActivityProcessingError, s as processCommittedActivity, t as ActivityPassLimits } from "../CommittedActivity-
|
|
1
|
+
import { i as CommittedActivityProcessor, n as ActivityPassResult, o as activityWorkId, r as ActivityProcessingError, s as processCommittedActivity, t as ActivityPassLimits } from "../CommittedActivity-DMfj2beT.mjs";
|
|
2
2
|
export { ActivityPassLimits, ActivityPassResult, ActivityProcessingError, CommittedActivityProcessor, activityWorkId, processCommittedActivity };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as Receipt } from "../Receipt-B4feBxMY.mjs";
|
|
2
|
-
import { $n as DurableAwaitFailure, Cr as recoveryRepairBatchId, Er as threadCreatedRecordId, Jn as DurableAgentRuntime, Kn as ApprovalSuspensionError, Qn as DurableApprovalSuspension, Sr as isolateRecovery, Tr as threadCreatedBatchId, Xn as DurableApprovalFailure, Zn as DurableApprovalResolver, _r as RecoverySweepOptions, ar as DurableRetryFailure, br as WorkRecoveryRequest, cr as DurableSubmitAgent, dr as DurableVerifyFailure, er as DurableExplainFailure, fr as DurableWorkerFailure, gr as RecoveryReport, hr as RecoveryFailure, ir as DurableResolveFailure, lr as DurableSubmitFailure, mr as RecoveryBlocked, nr as DurableObserveOptions, or as DurableRuntimeConfig, pr as DurableWorkerRequirements, qn as DurableAbortFailure, rr as DurableProgressFailure, sr as DurableRuntimeConfigOptions, tr as DurableObligationFailure, ur as DurableSubmitOptions, vr as RecoverySweepResult, wr as recoveryRepairRecordId, xr as childReservationIdFor, yr as WorkRecoveryReport } from "../Admin-
|
|
2
|
+
import { $n as DurableAwaitFailure, Cr as recoveryRepairBatchId, Er as threadCreatedRecordId, Jn as DurableAgentRuntime, Kn as ApprovalSuspensionError, Qn as DurableApprovalSuspension, Sr as isolateRecovery, Tr as threadCreatedBatchId, Xn as DurableApprovalFailure, Zn as DurableApprovalResolver, _r as RecoverySweepOptions, ar as DurableRetryFailure, br as WorkRecoveryRequest, cr as DurableSubmitAgent, dr as DurableVerifyFailure, er as DurableExplainFailure, fr as DurableWorkerFailure, gr as RecoveryReport, hr as RecoveryFailure, ir as DurableResolveFailure, lr as DurableSubmitFailure, mr as RecoveryBlocked, nr as DurableObserveOptions, or as DurableRuntimeConfig, pr as DurableWorkerRequirements, qn as DurableAbortFailure, rr as DurableProgressFailure, sr as DurableRuntimeConfigOptions, tr as DurableObligationFailure, ur as DurableSubmitOptions, vr as RecoverySweepResult, wr as recoveryRepairRecordId, xr as childReservationIdFor, yr as WorkRecoveryReport } from "../Admin-26pelcl9.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, WorkRecoveryReport, WorkRecoveryRequest, childReservationIdFor, isolateRecovery, recoveryRepairBatchId, recoveryRepairRecordId, threadCreatedBatchId, threadCreatedRecordId };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as Receipt } from "../Receipt-B-FlCaNH.mjs";
|
|
2
|
-
import { a as DurableApprovalSuspension, c as RecoveryFailure, d as WorkRecoveryReport, f as WorkRecoveryRequest, g as recoveryRepairRecordId, h as recoveryRepairBatchId, i as DurableApprovalResolver, l as RecoveryReport, m as isolateRecovery, n as DurableAgentRuntime, o as DurableRuntimeConfig, p as childReservationIdFor, s as RecoveryBlocked, t as ApprovalSuspensionError, u as RecoverySweepResult } from "../DurableAgentRuntime-
|
|
3
|
-
import { c as threadCreatedBatchId, l as threadCreatedRecordId } from "../WorkerAdmission-
|
|
2
|
+
import { a as DurableApprovalSuspension, c as RecoveryFailure, d as WorkRecoveryReport, f as WorkRecoveryRequest, g as recoveryRepairRecordId, h as recoveryRepairBatchId, i as DurableApprovalResolver, l as RecoveryReport, m as isolateRecovery, n as DurableAgentRuntime, o as DurableRuntimeConfig, p as childReservationIdFor, s as RecoveryBlocked, t as ApprovalSuspensionError, u as RecoverySweepResult } from "../DurableAgentRuntime-D3UTrNQg.mjs";
|
|
3
|
+
import { c as threadCreatedBatchId, l as threadCreatedRecordId } from "../WorkerAdmission-D8tw_OmT.mjs";
|
|
4
4
|
export { ApprovalSuspensionError, DurableAgentRuntime, DurableApprovalResolver, DurableApprovalSuspension, DurableRuntimeConfig, Receipt, RecoveryBlocked, RecoveryFailure, RecoveryReport, RecoverySweepResult, WorkRecoveryReport, WorkRecoveryRequest, 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-BWY08cyT.mjs";
|
|
2
2
|
export { EventSource, EventSources, NormalizedEvent, makeEventSource };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ao as LifecyclePublicationHandler, do as lifecyclePublicationLayer, eo as LifecyclePublication, io as LifecyclePublicationFact, lo as drainLifecyclePublications, no as LifecyclePublicationConfig, oo as LifecyclePublicationSource, ro as LifecyclePublicationError, so as LifecyclePublicationStorage, to as LifecyclePublicationBatch, uo as lifecyclePublicationBatchMaxFacts } from "../Admin-
|
|
1
|
+
import { ao as LifecyclePublicationHandler, do as lifecyclePublicationLayer, eo as LifecyclePublication, io as LifecyclePublicationFact, lo as drainLifecyclePublications, no as LifecyclePublicationConfig, oo as LifecyclePublicationSource, ro as LifecyclePublicationError, so as LifecyclePublicationStorage, to as LifecyclePublicationBatch, uo as lifecyclePublicationBatchMaxFacts } from "../Admin-26pelcl9.mjs";
|
|
2
2
|
export { LifecyclePublication, LifecyclePublicationBatch, LifecyclePublicationConfig, LifecyclePublicationError, LifecyclePublicationFact, LifecyclePublicationHandler, LifecyclePublicationSource, LifecyclePublicationStorage, drainLifecyclePublications, lifecyclePublicationBatchMaxFacts, lifecyclePublicationLayer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as validateMessageDelivery, C as messageDeliveryKeyString, D as prepareMessageDelivery, E as prepareCanonicalMessageDeliveries, O as readPending, S as messageDeliveryDeadline, T as peerMessageRetentionDeadline, _ as applyMessageDeliveryChange, a as MessageDeliveryError, b as isWorkerUpdateDelivery, c as MessageDeliveryFailure, d as MessageDeliveryPageRequest, f as MessageDeliveryPolicy, h as MessageDeliveryStoreLimits, i as MessageDeliveryDriverLimits, k as sameMessageDeliveryIdentity, l as MessageDeliveryKey, m as MessageDeliveryStore, n as MessageDeliveryCompletion, o as MessageDeliveryFailpoint, p as MessageDeliveryRecord, r as MessageDeliveryDriver, s as MessageDeliveryFailpointError, t as MessageDeliveryChange, u as MessageDeliveryPage, v as defaultMessageDeliveryPolicy, w as messageDeliveryUsesCapacity, x as messageDeliveryCapacity, y as defaultMessageDeliveryStoreLimits } from "../MessageDelivery-
|
|
1
|
+
import { A as validateMessageDelivery, C as messageDeliveryKeyString, D as prepareMessageDelivery, E as prepareCanonicalMessageDeliveries, O as readPending, S as messageDeliveryDeadline, T as peerMessageRetentionDeadline, _ as applyMessageDeliveryChange, a as MessageDeliveryError, b as isWorkerUpdateDelivery, c as MessageDeliveryFailure, d as MessageDeliveryPageRequest, f as MessageDeliveryPolicy, h as MessageDeliveryStoreLimits, i as MessageDeliveryDriverLimits, k as sameMessageDeliveryIdentity, l as MessageDeliveryKey, m as MessageDeliveryStore, n as MessageDeliveryCompletion, o as MessageDeliveryFailpoint, p as MessageDeliveryRecord, r as MessageDeliveryDriver, s as MessageDeliveryFailpointError, t as MessageDeliveryChange, u as MessageDeliveryPage, v as defaultMessageDeliveryPolicy, w as messageDeliveryUsesCapacity, x as messageDeliveryCapacity, y as defaultMessageDeliveryStoreLimits } from "../MessageDelivery-C0S-Cakt.mjs";
|
|
2
2
|
export { MessageDeliveryChange, MessageDeliveryCompletion, MessageDeliveryDriver, MessageDeliveryDriverLimits, MessageDeliveryError, MessageDeliveryFailpoint, MessageDeliveryFailpointError, MessageDeliveryFailure, MessageDeliveryKey, MessageDeliveryPage, MessageDeliveryPageRequest, MessageDeliveryPolicy, MessageDeliveryRecord, MessageDeliveryStore, MessageDeliveryStoreLimits, applyMessageDeliveryChange, defaultMessageDeliveryPolicy, defaultMessageDeliveryStoreLimits, isWorkerUpdateDelivery, messageDeliveryCapacity, messageDeliveryDeadline, messageDeliveryKeyString, messageDeliveryUsesCapacity, peerMessageRetentionDeadline, prepareCanonicalMessageDeliveries, prepareMessageDelivery, readPending, sameMessageDeliveryIdentity, validateMessageDelivery };
|