effect-agent 0.1.0-beta.113 → 0.1.0-beta.115
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/Agent-1DMSO_Fl.mjs.map +1 -1
- package/dist/{Agent-DriBcXBN.d.mts → Agent-D9cXqfF3.d.mts} +9 -2
- package/dist/{AgentRuntime-DLwPoEVH.mjs → AgentRuntime-Cp1hAb-W.mjs} +8 -4
- package/dist/AgentRuntime-Cp1hAb-W.mjs.map +1 -0
- package/dist/{AgentRuntime-CWkHuzyt.d.mts → AgentRuntime-DyZv8uu2.d.mts} +6 -6
- package/dist/{DurableAgentRuntime-BIrgxwRl.mjs → DurableAgentRuntime-tNrkJZNo.mjs} +254 -162
- package/dist/DurableAgentRuntime-tNrkJZNo.mjs.map +1 -0
- package/dist/{DurableFailpoint-mx3-nsxU.d.mts → DurableFailpoint-Cnr3wx1L.d.mts} +3 -3
- package/dist/{EventSource-ARs56eBq.d.mts → EventSource-DPRdlvhV.d.mts} +3 -3
- package/dist/{Messaging-DaZDlBqh.d.mts → Messaging-JYYN3oYS.d.mts} +3 -3
- package/dist/{MessagingHost-e1Sbzfao.d.mts → MessagingHost-CqzpxbGz.d.mts} +3 -3
- package/dist/{MessagingHost-D89X7ma8.mjs → MessagingHost-DfsbMPvq.mjs} +2 -2
- package/dist/{MessagingHost-D89X7ma8.mjs.map → MessagingHost-DfsbMPvq.mjs.map} +1 -1
- package/dist/{Output-CAFJTAbP.d.mts → Output-V-6YL1_Z.d.mts} +2 -2
- package/dist/{PreparedInputAdmission-_WYg-D0f.d.mts → PreparedInputAdmission-DqQUjA9k.d.mts} +4 -4
- package/dist/{Records-BtxMy8xD.d.mts → Records-Byeb70tt.d.mts} +89 -31
- package/dist/{RunOptions-BoESJrxw.d.mts → RunOptions-CSBsSj0X.d.mts} +3 -3
- package/dist/{Schedule-DGPyXBzK.d.mts → Schedule-krSnBcbU.d.mts} +2 -2
- package/dist/{Subagent-D9eYdGTl.mjs → Subagent-Di8EEjWZ.mjs} +67 -105
- package/dist/Subagent-Di8EEjWZ.mjs.map +1 -0
- package/dist/{Subagent-F72tuaxy.d.mts → Subagent-gw9KD6eb.d.mts} +310 -35
- package/dist/{SubagentHost-CmiNTOBZ.d.mts → SubagentHost-P9zB_TfV.d.mts} +24 -18
- package/dist/{Subscription-B9VszlF9.d.mts → Subscription-Xnwd42Sm.d.mts} +6 -3
- package/dist/{SubscriptionInput-BJWZqCWP.d.mts → SubscriptionInput-CqtJ58vl.d.mts} +3 -3
- package/dist/{Worker-T_3RbaKc.mjs → Worker-CfwzMZEK.mjs} +66 -5
- package/dist/Worker-CfwzMZEK.mjs.map +1 -0
- package/dist/{Worker-Du9dhVnp.d.mts → Worker-fwWkBg12.d.mts} +199 -6
- package/dist/{agent-registration-B5CI-Ygk.mjs → agent-registration-CKNsrpwo.mjs} +7 -7
- package/dist/agent-registration-CKNsrpwo.mjs.map +1 -0
- package/dist/capabilities/Commands.d.mts +1 -1
- package/dist/capabilities/Messaging.d.mts +1 -1
- package/dist/capabilities/Messaging.mjs +2 -2
- package/dist/capabilities/RunHooks.d.mts +1 -1
- package/dist/capabilities/Subagent.d.mts +3 -3
- package/dist/capabilities/Subagent.mjs +3 -3
- package/dist/core/Agent.d.mts +1 -1
- package/dist/core/Worker.d.mts +2 -2
- package/dist/core/Worker.mjs +2 -2
- package/dist/durable/ActivityStore.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 +1 -1
- package/dist/durable/Certification.d.mts +2 -2
- package/dist/durable/CommittedActivity.d.mts +1 -1
- package/dist/durable/Digest.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.mjs +1 -1
- package/dist/durable/DurableFailpoint.d.mts +1 -1
- package/dist/durable/DurableFailpoint.mjs +4 -0
- package/dist/durable/DurableFailpoint.mjs.map +1 -1
- package/dist/durable/DurableFailpointTestControl.d.mts +1 -1
- package/dist/durable/EventSource.d.mts +1 -1
- package/dist/durable/GitHubWorkflowSource.d.mts +3 -3
- package/dist/durable/MessageDelivery.d.mts +20 -3
- package/dist/durable/MessageDelivery.mjs +12 -4
- package/dist/durable/MessageDelivery.mjs.map +1 -1
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +41 -39
- package/dist/durable/MessageDeliveryStoreConformance.mjs +1 -1
- package/dist/durable/PersistentHistory.d.mts +1 -1
- package/dist/durable/PreparedInputAdmission.d.mts +1 -1
- package/dist/durable/Records.d.mts +2 -2
- package/dist/durable/Records.mjs +12 -5
- package/dist/durable/Records.mjs.map +1 -1
- package/dist/durable/Recovery.d.mts +1 -1
- package/dist/durable/RunJournal.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 +2 -2
- package/dist/durable/SqlMessageDeliveryStore.mjs +7 -1
- package/dist/durable/SqlMessageDeliveryStore.mjs.map +1 -1
- package/dist/durable/SqlStorageV2Upgrade.d.mts +2 -2
- package/dist/durable/SqlSubscriptionStore.d.mts +2 -2
- package/dist/durable/SqlThreadNativeReads.d.mts +5 -1
- package/dist/durable/SqlThreadNativeReads.mjs +6 -0
- package/dist/durable/SqlThreadNativeReads.mjs.map +1 -1
- package/dist/durable/SubmissionLedger.d.mts +2 -2
- package/dist/durable/SubmissionLedger.mjs +34 -4
- package/dist/durable/SubmissionLedger.mjs.map +1 -1
- package/dist/durable/SubmissionLedgerConformance.d.mts +1 -1
- package/dist/durable/SubmissionLedgerConformance.mjs +899 -706
- package/dist/durable/SubmissionLedgerConformance.mjs.map +1 -1
- package/dist/durable/SubmissionStatus.d.mts +1 -1
- package/dist/durable/Subscription.d.mts +1 -1
- package/dist/durable/Subscription.mjs +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/SubscriptionTools.d.mts +3 -3
- package/dist/durable/SubscriptionTransition.d.mts +1 -1
- package/dist/durable/Subscriptions.d.mts +5 -5
- package/dist/durable/ThreadContextHistory.d.mts +1 -1
- package/dist/durable/ThreadContextHistoryProjection.d.mts +1 -1
- package/dist/durable/ThreadInvariants.d.mts +1 -1
- package/dist/durable/ThreadProjection.d.mts +1 -1
- package/dist/durable/ThreadProjectionMaintenance.d.mts +1 -1
- package/dist/durable/ThreadStore.d.mts +1 -1
- package/dist/durable/ThreadStore.mjs +5 -0
- package/dist/durable/ThreadStore.mjs.map +1 -1
- package/dist/durable/ThreadStoreConformance.d.mts +1 -1
- package/dist/durable/WorkerHost.d.mts +3 -3
- package/dist/durable/WorkerHost.mjs +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/MessagingHost.mjs +1 -1
- package/dist/engine/Output.d.mts +1 -1
- package/dist/engine/RunOptions.d.mts +1 -1
- package/dist/engine/SubagentHost.d.mts +2 -2
- package/dist/engine/SubagentHost.mjs +5 -1
- package/dist/engine/SubagentHost.mjs.map +1 -1
- package/dist/index.d.mts +16 -16
- package/dist/index.mjs +5 -5
- package/package.json +1 -1
- package/src/capabilities/Subagent.ts +2 -1
- package/src/capabilities/internal/subagent-background.ts +86 -57
- package/src/capabilities/internal/subagent-reporting.ts +3 -128
- package/src/core/Agent.ts +8 -1
- package/src/core/Worker.ts +58 -2
- package/src/durable/DurableAgentRuntime.ts +2 -0
- package/src/durable/DurableFailpoint.ts +4 -0
- package/src/durable/MessageDelivery.ts +17 -2
- package/src/durable/Records.ts +12 -2
- package/src/durable/SqlMessageDeliveryStore.ts +15 -1
- package/src/durable/SqlThreadNativeReads.ts +14 -0
- package/src/durable/SubmissionLedger.ts +48 -1
- package/src/durable/SubmissionLedgerConformance.ts +260 -42
- package/src/durable/ThreadStore.ts +5 -0
- package/src/durable/internal/agent-registration.ts +13 -48
- package/src/durable/internal/worker-host.ts +490 -341
- package/src/engine/SubagentHost.ts +37 -13
- package/src/engine/internal/agent-runtime.ts +17 -2
- package/dist/AgentRuntime-DLwPoEVH.mjs.map +0 -1
- package/dist/DurableAgentRuntime-BIrgxwRl.mjs.map +0 -1
- package/dist/Subagent-D9eYdGTl.mjs.map +0 -1
- package/dist/Worker-T_3RbaKc.mjs.map +0 -1
- package/dist/agent-registration-B5CI-Ygk.mjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Mn as
|
|
1
|
+
import { Mn as PendingSubmission, Nn as SettledSubmission, Pn as SubmissionStatus } from "../Records-Byeb70tt.mjs";
|
|
2
2
|
export { PendingSubmission, SettledSubmission, SubmissionStatus };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as defaultSubscriptionLimits, C as SubscriptionScanCursors, D as SubscriptionStore, E as SubscriptionSourceError, M as subscriptionKeyString, O as SubscriptionStoreFailure, S as SubscriptionRetentionPolicy, T as SubscriptionSnapshot, _ as SubscriptionKey, a as PreparedInput, b as SubscriptionRecord, c as SubscriptionAuthorizer, d as SubscriptionDelivery, f as SubscriptionDeliveryKey, g as SubscriptionFailpointError, h as SubscriptionFailpoint, i as EventSourceVersion, j as subscriptionDeliveryKeyString, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, s as SourceRecovery, t as AcceptedEvent, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope, x as SubscriptionRefusal, y as SubscriptionName } from "../Subscription-
|
|
1
|
+
import { A as defaultSubscriptionLimits, C as SubscriptionScanCursors, D as SubscriptionStore, E as SubscriptionSourceError, M as subscriptionKeyString, O as SubscriptionStoreFailure, S as SubscriptionRetentionPolicy, T as SubscriptionSnapshot, _ as SubscriptionKey, a as PreparedInput, b as SubscriptionRecord, c as SubscriptionAuthorizer, d as SubscriptionDelivery, f as SubscriptionDeliveryKey, g as SubscriptionFailpointError, h as SubscriptionFailpoint, i as EventSourceVersion, j as subscriptionDeliveryKeyString, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, s as SourceRecovery, t as AcceptedEvent, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope, x as SubscriptionRefusal, y as SubscriptionName } from "../Subscription-Xnwd42Sm.mjs";
|
|
2
2
|
export { AcceptedEvent, DeliveryChange, EventAcknowledgement, EventSourceVersion, PreparedInput, SourcePartition, SourceRecovery, SubscriptionAuthorizer, SubscriptionChange, SubscriptionConfiguration, SubscriptionDelivery, SubscriptionDeliveryKey, SubscriptionDeliverySnapshot, SubscriptionError, SubscriptionFailpoint, SubscriptionFailpointError, SubscriptionKey, SubscriptionLimits, SubscriptionName, SubscriptionRecord, SubscriptionRefusal, SubscriptionRetentionPolicy, SubscriptionScanCursors, SubscriptionScope, SubscriptionSnapshot, SubscriptionSourceError, SubscriptionStore, SubscriptionStoreFailure, defaultSubscriptionLimits, subscriptionDeliveryKeyString, subscriptionKeyString };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { AgentId, ThreadId } from "../core/Identifiers.mjs";
|
|
3
3
|
import { IdempotencyKey, Principal, Receipt } from "../core/Receipt.mjs";
|
|
4
|
-
import { l as InputMessage } from "../MessagingHost-
|
|
4
|
+
import { l as InputMessage } from "../MessagingHost-DfsbMPvq.mjs";
|
|
5
5
|
import { DefinitionDigests, Digest, PersistedJson, WorkerAdmission } from "./Records.mjs";
|
|
6
6
|
import { AdmissionFence, AdmissionGroup } from "./SubmissionLedger.mjs";
|
|
7
7
|
import { ScheduleAuthorizationDecision, ScheduleDestination, ScheduleInstant, ScheduleRetry } from "./Schedule.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as resolveSubscriptionInput, i as makeSubscriptionInputBinding, n as SubscriptionInputBindings, t as SubscriptionInputBinding } from "../SubscriptionInput-
|
|
1
|
+
import { a as resolveSubscriptionInput, i as makeSubscriptionInputBinding, n as SubscriptionInputBindings, t as SubscriptionInputBinding } from "../SubscriptionInput-CqtJ58vl.mjs";
|
|
2
2
|
export { SubscriptionInputBinding, SubscriptionInputBindings, makeSubscriptionInputBinding, resolveSubscriptionInput };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { PersistedJson } from "./Records.mjs";
|
|
3
|
-
import { a as definitionDigestsEqual } from "../agent-registration-
|
|
3
|
+
import { a as definitionDigestsEqual } from "../agent-registration-CKNsrpwo.mjs";
|
|
4
4
|
import { SubscriptionError, SubscriptionSourceError } from "./Subscription.mjs";
|
|
5
5
|
import { Context, Effect, Schema } from "effect";
|
|
6
6
|
//#region src/durable/SubscriptionInput.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as SubscriptionStore, O as SubscriptionStoreFailure, o as SourcePartition } from "../Subscription-
|
|
1
|
+
import { D as SubscriptionStore, O as SubscriptionStoreFailure, o as SourcePartition } from "../Subscription-Xnwd42Sm.mjs";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
//#region src/durable/SubscriptionStoreConformance.d.ts
|
|
4
4
|
declare const SubscriptionStoreConformanceViolation_base: Schema.Class<SubscriptionStoreConformanceViolation, Schema.TaggedStruct<"SubscriptionStoreConformanceViolation", {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as AgentId, u as ThreadId } from "../Identifiers-CN2s30fF.mjs";
|
|
2
2
|
import { r as Principal } from "../Receipt-BAHyigAF.mjs";
|
|
3
3
|
import { t as DurableStep } from "../DurableStep-Cry_iol4.mjs";
|
|
4
|
-
import { h as DefinitionDigests } from "../Records-
|
|
5
|
-
import { c as ScheduleDestination } from "../Schedule-
|
|
6
|
-
import { E as SubscriptionSourceError, g as SubscriptionFailpointError, i as EventSourceVersion, m as SubscriptionError, w as SubscriptionScope } from "../Subscription-
|
|
4
|
+
import { h as DefinitionDigests } from "../Records-Byeb70tt.mjs";
|
|
5
|
+
import { c as ScheduleDestination } from "../Schedule-krSnBcbU.mjs";
|
|
6
|
+
import { E as SubscriptionSourceError, g as SubscriptionFailpointError, i as EventSourceVersion, m as SubscriptionError, w as SubscriptionScope } from "../Subscription-Xnwd42Sm.mjs";
|
|
7
7
|
import { Subscriptions } from "./Subscriptions.mjs";
|
|
8
8
|
import { Tool, Toolkit } from "effect/unstable/ai";
|
|
9
9
|
import { Crypto, Layer, Schema } from "effect";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as SubscriptionRecord, d as SubscriptionDelivery, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, t as AcceptedEvent, v as SubscriptionLimits } from "../Subscription-
|
|
1
|
+
import { b as SubscriptionRecord, d as SubscriptionDelivery, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, t as AcceptedEvent, v as SubscriptionLimits } from "../Subscription-Xnwd42Sm.mjs";
|
|
2
2
|
import { Result } from "effect";
|
|
3
3
|
declare namespace SubscriptionTransition_d_exports {
|
|
4
4
|
export { applySubscriptionChange, applySubscriptionDeliveryChange, sameAcceptedEventIdentity, sameSourcePartition, sameSubscriptionDelivery, subscriptionCanSelect, subscriptionDeliveryCanSelect, subscriptionMatchesEvent, validateEventRetention };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as Principal } from "../Receipt-BAHyigAF.mjs";
|
|
2
|
-
import { O as PersistedJson,
|
|
3
|
-
import { D as SubscriptionStore, E as SubscriptionSourceError, O as SubscriptionStoreFailure, T as SubscriptionSnapshot, _ as SubscriptionKey, c as SubscriptionAuthorizer, f as SubscriptionDeliveryKey, i as EventSourceVersion, m as SubscriptionError, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope } from "../Subscription-
|
|
4
|
-
import { r as EventSources } from "../EventSource-
|
|
5
|
-
import { t as PreparedInputAdmission } from "../PreparedInputAdmission-
|
|
6
|
-
import { n as SubscriptionInputBindings } from "../SubscriptionInput-
|
|
2
|
+
import { O as PersistedJson, _a as AdmissionFence } from "../Records-Byeb70tt.mjs";
|
|
3
|
+
import { D as SubscriptionStore, E as SubscriptionSourceError, O as SubscriptionStoreFailure, T as SubscriptionSnapshot, _ as SubscriptionKey, c as SubscriptionAuthorizer, f as SubscriptionDeliveryKey, i as EventSourceVersion, m as SubscriptionError, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope } from "../Subscription-Xnwd42Sm.mjs";
|
|
4
|
+
import { r as EventSources } from "../EventSource-DPRdlvhV.mjs";
|
|
5
|
+
import { t as PreparedInputAdmission } from "../PreparedInputAdmission-DqQUjA9k.mjs";
|
|
6
|
+
import { n as SubscriptionInputBindings } from "../SubscriptionInput-CqtJ58vl.mjs";
|
|
7
7
|
import { Context, Crypto, Effect, Layer } from "effect";
|
|
8
8
|
declare namespace Subscriptions_d_exports {
|
|
9
9
|
export { SubscribeOptions, SubscriptionDriver, SubscriptionFailure, SubscriptionIntake, Subscriptions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContextHistory, ContextHistoryError } from "../engine/ContextHistory.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { bn as ThreadStore } from "../Records-Byeb70tt.mjs";
|
|
3
3
|
import { Layer, Schema } from "effect";
|
|
4
4
|
declare namespace ThreadContextHistory_d_exports {
|
|
5
5
|
export { ThreadContextHistoryOptions, layer };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContextHistoryError } from "../engine/ContextHistory.mjs";
|
|
2
|
-
import { l as CanonicalRecordEnvelope } from "../Records-
|
|
2
|
+
import { l as CanonicalRecordEnvelope } from "../Records-Byeb70tt.mjs";
|
|
3
3
|
import { Effect, Schema } from "effect";
|
|
4
4
|
declare namespace ThreadContextHistoryProjection_d_exports {
|
|
5
5
|
export { ContextHistoryBoundary, ContextHistoryEvidence, ContextHistoryProjection, matchText, normalizeQuery, normalizeText, project, windowIdFor };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ProducerId,
|
|
1
|
+
import { A as ProducerId, Do as SubmissionSnapshot, a as BatchId, in as ThreadCheckpoint, on as ThreadExport, qr as IntegrityReport } from "../Records-Byeb70tt.mjs";
|
|
2
2
|
import { Crypto, Effect } from "effect";
|
|
3
3
|
declare namespace ThreadInvariants_d_exports {
|
|
4
4
|
export { ThreadInvariantInput, verifyThreadInvariants };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { u as ThreadId } from "../Identifiers-CN2s30fF.mjs";
|
|
2
|
-
import { G as SubagentRequested, J as SubmissionSettledRecord, K as SubagentStarted, Q as ToolApprovalRequested, U as SubagentJoined, W as SubagentLineageRecorded, Z as ToolApprovalDecided, _ as Digest, l as CanonicalRecordEnvelope, q as SubmissionSettled, rt as ToolCallUnknown, t as AbortRequested } from "../Records-
|
|
2
|
+
import { G as SubagentRequested, J as SubmissionSettledRecord, K as SubagentStarted, Q as ToolApprovalRequested, U as SubagentJoined, W as SubagentLineageRecorded, Z as ToolApprovalDecided, _ as Digest, l as CanonicalRecordEnvelope, q as SubmissionSettled, rt as ToolCallUnknown, t as AbortRequested } from "../Records-Byeb70tt.mjs";
|
|
3
3
|
import { Schema } from "effect";
|
|
4
4
|
declare namespace ThreadProjection_d_exports {
|
|
5
5
|
export { ApprovalRecord, OpenToolCallState, SubagentInvocationState, ThreadProjection, initialThreadProjection, reduceThreadRecord, replayThread, replayThreadFromCheckpoint };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Qt as FencedAppendRequest, Yt as AppendResult } from "../Records-Byeb70tt.mjs";
|
|
2
2
|
import { Context, Effect, Layer, Option, Schema } from "effect";
|
|
3
3
|
declare namespace ThreadProjectionMaintenance_d_exports {
|
|
4
4
|
export { ThreadProjectionError, ThreadProjectionMaintenance, ThreadProjectionMaintenanceService, drainDue };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $t as
|
|
1
|
+
import { $t as LoadCheckpointRequest, An as readOutstanding, Cn as ThreadStoreFailure, Dn as ThreadWorkerStateRequest, En as ThreadTailRequest, Jt as AppendConflict, On as getRecord, Qt as FencedAppendRequest, Sn as ThreadStoreError, Tn as ThreadTail, Xt as CheckpointRejected, Yt as AppendResult, Zt as FenceRejected, _n as ThreadRecoveryCheckpoints, an as ThreadCheckpoints, bn as ThreadStore, cn as ThreadMaterialization, dn as ThreadOutstanding, en as MAX_THREAD_EXPORT_RECORDS, fn as ThreadOutstandingRequest, gn as ThreadRecordRequest, hn as ThreadReadRequest, in as ThreadCheckpoint, jn as readWorkerState, kn as getRunInput, ln as ThreadNotMaterialized, mn as ThreadRead, nn as SaveRecoveryCheckpointRequest, on as ThreadExport, pn as ThreadPeerCountRequest, rn as SelectedThreadRead, sn as ThreadExportRequest, tn as SaveCheckpointRequest, un as ThreadObservation, vn as ThreadRunInputRequest, xn as ThreadStoreDiagnostic, yn as ThreadSelection } from "../Records-Byeb70tt.mjs";
|
|
2
2
|
export { AppendConflict, AppendResult, CheckpointRejected, FenceRejected, FencedAppendRequest, LoadCheckpointRequest, MAX_THREAD_EXPORT_RECORDS, SaveCheckpointRequest, SaveRecoveryCheckpointRequest, SelectedThreadRead, ThreadCheckpoint, ThreadCheckpoints, ThreadExport, ThreadExportRequest, ThreadMaterialization, ThreadNotMaterialized, ThreadObservation, ThreadOutstanding, ThreadOutstandingRequest, ThreadPeerCountRequest, ThreadRead, ThreadReadRequest, ThreadRecordRequest, ThreadRecoveryCheckpoints, ThreadRunInputRequest, ThreadSelection, ThreadStore, ThreadStoreDiagnostic, ThreadStoreError, ThreadStoreFailure, ThreadTail, ThreadTailRequest, ThreadWorkerStateRequest, getRecord, getRunInput, readOutstanding, readWorkerState };
|
|
@@ -221,6 +221,11 @@ const ThreadSelection = Schema.Union([
|
|
|
221
221
|
expectedTailSequence: CanonicalSequence,
|
|
222
222
|
expectedTailDigest: Digest
|
|
223
223
|
}),
|
|
224
|
+
Schema.Struct({
|
|
225
|
+
_tag: Schema.Literal("WorkerExecution"),
|
|
226
|
+
expectedTailSequence: CanonicalSequence,
|
|
227
|
+
expectedTailDigest: Digest
|
|
228
|
+
}),
|
|
224
229
|
Schema.Struct({
|
|
225
230
|
_tag: Schema.Literal("WorkerState"),
|
|
226
231
|
expectedTailSequence: CanonicalSequence,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadStore.mjs","names":[],"sources":["../../src/durable/ThreadStore.ts"],"sourcesContent":["import { Context, Effect, Option, Schema, Stream } from \"effect\";\n\nimport { RunId, SubmissionId, ThreadId } from \"../core/Identifiers.ts\";\nimport type { ToolCallPrepared, WorkerInputRequested } from \"./Records.ts\";\nimport {\n BatchId,\n CanonicalBatch,\n CanonicalRecordEnvelope,\n CanonicalSequence,\n Digest,\n ObservationOffset,\n PersistedJson,\n ProducerEpoch,\n RecordId,\n} from \"./Records.ts\";\nimport { runIdForSubmission, toolCallPreparedRecordId } from \"./RunJournal.ts\";\nimport { SubmissionLedger, SubmissionLookupById } from \"./SubmissionLedger.ts\";\n\nexport const MAX_THREAD_EXPORT_RECORDS = 131_072;\n\n/** Exact canonical identity; absence is not proof that an admission was never accepted. */\nexport const ThreadRecordRequest = Schema.Struct({ threadId: ThreadId, recordId: RecordId });\nexport type ThreadRecordRequest = typeof ThreadRecordRequest.Type;\n\n/** The original user input for a Run, excluding later joined inputs. */\nexport const ThreadRunInputRequest = Schema.Struct({ threadId: ThreadId, runId: RunId });\nexport type ThreadRunInputRequest = typeof ThreadRunInputRequest.Type;\n\nexport const ThreadOutstandingRequest = Schema.Struct({\n threadId: ThreadId,\n /** Exceeding this bound fails; a truncated inventory never grants authority. */\n limit: Schema.Int.check(Schema.isGreaterThan(0), Schema.isLessThanOrEqualTo(4_096)),\n});\n\nexport type ThreadOutstandingRequest = typeof ThreadOutstandingRequest.Type;\n\nexport interface ThreadOutstanding {\n readonly threadId: ThreadId;\n readonly throughSequence: CanonicalSequence;\n readonly complete: true;\n readonly operations: ReadonlyArray<{\n readonly submissionId: SubmissionId;\n readonly prepared: ToolCallPrepared;\n /** Prepared is not an unknown outcome or a grant to execute. */\n readonly state: \"prepared\" | \"unknown\";\n }>;\n /** Source reservations without proof that external effects are resolved. */\n readonly workerInputs: ReadonlyArray<WorkerInputRequested>;\n}\n\n/** Native worker reservation/accounting snapshot at a captured canonical tail. */\nexport const ThreadWorkerStateRequest = Schema.Struct({\n threadId: ThreadId,\n sourceSubmissionId: Schema.optionalKey(SubmissionId),\n limit: Schema.Int.check(\n Schema.isGreaterThan(0),\n Schema.isLessThanOrEqualTo(MAX_THREAD_EXPORT_RECORDS),\n ),\n});\n\nexport type ThreadWorkerStateRequest = typeof ThreadWorkerStateRequest.Type;\n\n/** Saturating lifetime peer-message count: the result is at most the requested cap. */\nexport const ThreadPeerCountRequest = Schema.Struct({\n threadId: ThreadId,\n limit: Schema.Int.check(Schema.isGreaterThan(0), Schema.isLessThanOrEqualTo(1000)),\n});\n\nexport type ThreadPeerCountRequest = typeof ThreadPeerCountRequest.Type;\n\nconst incomplete = (operation: string) =>\n ThreadStoreError.make({\n operation,\n message: \"Native canonical read is incomplete or corrupt\",\n });\n\n/** Collect a complete bounded selection, using canonical sequence as a sparse cursor. */\nconst selectedRecords = Effect.fnUntraced(function* (\n threadId: ThreadId,\n selection: ThreadSelection,\n limit: number,\n) {\n const store = yield* ThreadStore;\n const records: Array<CanonicalRecordEnvelope> = [];\n let afterSequence: CanonicalSequence | undefined;\n\n while (true) {\n const pageLimit = Math.min(1024, limit + 1 - records.length);\n\n const page = yield* Stream.runCollect(\n store.read({\n threadId,\n selection,\n page: { limit: pageLimit, ...(afterSequence === undefined ? {} : { afterSequence }) },\n }),\n );\n\n for (const entry of page) {\n if (\n entry.threadId !== threadId ||\n entry.sequence <= (afterSequence ?? 0) ||\n (\"expectedTailSequence\" in selection && entry.sequence > selection.expectedTailSequence)\n )\n return yield* incomplete(\"read selection identity\");\n afterSequence = entry.sequence;\n records.push(entry);\n }\n if (page.length > pageLimit || records.length > limit)\n return yield* incomplete(\"read selection limit\");\n if (page.length < pageLimit) return records;\n }\n});\n\n/** Host-owned read: authenticate the Thread and exact locator before calling. */\nexport const getRecord = Effect.fn(\"ThreadStore.getRecord\")(function* (\n request: ThreadRecordRequest,\n) {\n yield* Schema.decodeEffect(ThreadRecordRequest)(request).pipe(\n Effect.mapError(() => incomplete(\"getRecord request\")),\n );\n\n const records = yield* selectedRecords(\n request.threadId,\n { _tag: \"RecordId\", recordId: request.recordId },\n 1,\n );\n\n if (records.some((entry) => entry.record.recordId !== request.recordId))\n return yield* incomplete(\"getRecord identity\");\n\n return Option.fromUndefinedOr(records[0]);\n});\n\nexport const getRunInput = Effect.fn(\"ThreadStore.getRunInput\")(function* (\n request: ThreadRunInputRequest,\n) {\n yield* Schema.decodeEffect(ThreadRunInputRequest)(request).pipe(\n Effect.mapError(() => incomplete(\"getRunInput request\")),\n );\n\n const records = yield* selectedRecords(\n request.threadId,\n { _tag: \"RunInput\", runId: request.runId },\n 1,\n );\n\n if (\n records.some(\n ({ record: { payload } }) =>\n payload._tag !== \"UserInputRecorded\" ||\n payload.kind !== \"user\" ||\n payload.runId !== request.runId,\n )\n )\n return yield* incomplete(\"getRunInput identity\");\n\n return Option.fromUndefinedOr(records[0]);\n});\n\n/** A bounded snapshot of native lifetime and source-submission worker accounting. */\nexport const readWorkerState = Effect.fn(\"ThreadStore.readWorkerState\")(function* (\n request: ThreadWorkerStateRequest,\n) {\n yield* Schema.decodeEffect(ThreadWorkerStateRequest)(request).pipe(\n Effect.mapError(() => incomplete(\"readWorkerState request\")),\n );\n const store = yield* ThreadStore;\n const tail = yield* store.inspectTail(ThreadTailRequest.make({ threadId: request.threadId }));\n\n const records = yield* selectedRecords(\n request.threadId,\n {\n _tag: \"WorkerState\",\n expectedTailSequence: tail.tailSequence,\n expectedTailDigest: tail.tailDigest,\n ...(request.sourceSubmissionId === undefined\n ? {}\n : { sourceSubmissionId: request.sourceSubmissionId }),\n },\n request.limit,\n );\n\n return {\n threadId: request.threadId,\n tailSequence: tail.tailSequence,\n tailDigest: tail.tailDigest,\n records,\n };\n});\n\n/**\n * Work is proportional to outstanding records, independent of completed history. Unknown\n * effects survive abort and resolution intent; only canonical closure removes them. A\n * preparation from another Run still requires native recovery before it can be treated as\n * safe. This snapshot grants no execution authority and does not freeze other owners.\n */\nexport const readOutstanding = Effect.fn(\"ThreadStore.readOutstanding\")(function* (\n request: ThreadOutstandingRequest,\n) {\n yield* Schema.decodeEffect(ThreadOutstandingRequest)(request).pipe(\n Effect.mapError(() => incomplete(\"readOutstanding request\")),\n );\n const store = yield* ThreadStore;\n const ledger = yield* SubmissionLedger;\n const tail = yield* store.inspectTail(ThreadTailRequest.make({ threadId: request.threadId }));\n\n const records = yield* selectedRecords(\n request.threadId,\n {\n _tag: \"Outstanding\",\n expectedTailSequence: tail.tailSequence,\n expectedTailDigest: tail.tailDigest,\n },\n request.limit,\n );\n\n const operations: Array<ThreadOutstanding[\"operations\"][number]> = [];\n const workerInputs: Array<WorkerInputRequested> = [];\n\n for (const entry of records) {\n const payload = entry.record.payload;\n\n if (payload._tag === \"WorkerInputRequested\") {\n workerInputs.push(payload);\n continue;\n }\n if (payload._tag !== \"ToolCallPrepared\" && payload._tag !== \"ToolCallUnknown\")\n return yield* incomplete(\"readOutstanding record\");\n\n const preparedEntry =\n payload._tag === \"ToolCallPrepared\"\n ? entry\n : Option.getOrUndefined(\n yield* getRecord({\n threadId: request.threadId,\n recordId: toolCallPreparedRecordId(payload.runId, payload.turn, payload.toolCallId),\n }),\n );\n\n const inputEntry = Option.getOrUndefined(\n yield* getRunInput({ threadId: request.threadId, runId: payload.runId }),\n );\n\n if (\n preparedEntry === undefined ||\n inputEntry === undefined ||\n preparedEntry.sequence > tail.tailSequence ||\n inputEntry.sequence > tail.tailSequence\n )\n return yield* incomplete(\"readOutstanding proof beyond snapshot\");\n const prepared = preparedEntry.record.payload;\n const input = inputEntry.record.payload;\n\n if (\n prepared?._tag !== \"ToolCallPrepared\" ||\n prepared.runId !== payload.runId ||\n prepared.turn !== payload.turn ||\n prepared.toolCallId !== payload.toolCallId ||\n prepared.toolName !== payload.toolName ||\n input?._tag !== \"UserInputRecorded\" ||\n input.submissionId === undefined ||\n runIdForSubmission(input.submissionId) !== prepared.runId\n )\n return yield* incomplete(\"readOutstanding canonical ownership\");\n\n const submission = yield* ledger.lookup(\n SubmissionLookupById.make({ submissionId: input.submissionId }),\n );\n\n if (Option.isNone(submission) || submission.value.threadId !== request.threadId)\n return yield* incomplete(\"readOutstanding native admission\");\n operations.push({\n submissionId: input.submissionId,\n prepared,\n state: payload._tag === \"ToolCallUnknown\" ? \"unknown\" : \"prepared\",\n });\n }\n\n return {\n threadId: request.threadId,\n throughSequence: tail.tailSequence,\n complete: true as const,\n operations,\n workerInputs,\n };\n});\n\nexport class ThreadMaterialization extends Schema.Class<ThreadMaterialization>(\n \"@effect-agent/thread/ThreadMaterialization\",\n)({\n threadId: ThreadId,\n producerEpoch: ProducerEpoch,\n}) {}\n\nexport class FencedAppendRequest extends Schema.Class<FencedAppendRequest>(\n \"@effect-agent/thread/FencedAppendRequest\",\n)({\n threadId: ThreadId,\n batch: CanonicalBatch,\n expectedTailSequence: CanonicalSequence,\n expectedTailDigest: Digest,\n producerEpoch: ProducerEpoch,\n}) {}\n\nexport class AppendResult extends Schema.Class<AppendResult>(\"@effect-agent/thread/AppendResult\")({\n firstSequence: CanonicalSequence,\n lastSequence: CanonicalSequence,\n tailDigest: Digest,\n replayed: Schema.Boolean,\n}) {}\n\nexport class ThreadRead extends Schema.Class<ThreadRead>(\"@effect-agent/thread/ThreadRead\")({\n threadId: ThreadId,\n afterSequence: Schema.optionalKey(CanonicalSequence),\n limit: Schema.Natural.check(Schema.isGreaterThan(0), Schema.isLessThanOrEqualTo(1_024)),\n}) {}\n\n/** Closed native selections; mutable metadata is read at this exact canonical tail. */\nexport const ThreadSelection = Schema.Union([\n Schema.Struct({ _tag: Schema.Literal(\"RecordId\"), recordId: RecordId }),\n Schema.Struct({ _tag: Schema.Literal(\"RunInput\"), runId: RunId }),\n Schema.Struct({\n _tag: Schema.Literal(\"Outstanding\"),\n expectedTailSequence: CanonicalSequence,\n expectedTailDigest: Digest,\n }),\n Schema.Struct({\n _tag: Schema.Literal(\"WorkerState\"),\n expectedTailSequence: CanonicalSequence,\n expectedTailDigest: Digest,\n sourceSubmissionId: Schema.optionalKey(SubmissionId),\n }),\n]);\n\nexport type ThreadSelection = typeof ThreadSelection.Type;\n\n/** Nested page makes an old ThreadRead decoder reject, never strip a selection into history. */\nexport const SelectedThreadRead = Schema.Struct({\n threadId: ThreadId,\n selection: ThreadSelection,\n page: Schema.Struct({\n afterSequence: Schema.optionalKey(CanonicalSequence),\n limit: ThreadRead.fields.limit,\n }),\n});\n\nexport type SelectedThreadRead = typeof SelectedThreadRead.Type;\nexport const ThreadReadRequest = Schema.Union([SelectedThreadRead, ThreadRead]);\nexport type ThreadReadRequest = typeof ThreadReadRequest.Type;\n\nexport class ThreadObservation extends Schema.Class<ThreadObservation>(\n \"@effect-agent/thread/ThreadObservation\",\n)({\n threadId: ThreadId,\n afterOffset: Schema.optionalKey(ObservationOffset),\n}) {}\n\nexport class ThreadExportRequest extends Schema.Class<ThreadExportRequest>(\n \"@effect-agent/thread/ThreadExportRequest\",\n)({\n threadId: ThreadId,\n}) {}\n\nexport class ThreadTailRequest extends Schema.Class<ThreadTailRequest>(\n \"@effect-agent/thread/ThreadTailRequest\",\n)({\n threadId: ThreadId,\n}) {}\n\n/**\n * The committed tail of one Thread Log. A resuming producer composes its next\n * FencedAppendRequest from this value instead of exporting the whole log.\n */\nexport class ThreadTail extends Schema.Class<ThreadTail>(\"@effect-agent/thread/ThreadTail\")({\n threadId: ThreadId,\n tailSequence: CanonicalSequence,\n tailDigest: Digest,\n producerEpoch: ProducerEpoch,\n}) {}\n\n/** Maximum canonical records represented by one Thread export. */\n\nexport class ThreadExport extends Schema.Class<ThreadExport>(\"@effect-agent/thread/ThreadExport\")({\n format: Schema.Literal(\"effect-agent/thread@1\"),\n threadId: ThreadId,\n tailSequence: CanonicalSequence,\n tailDigest: Digest,\n records: Schema.Array(CanonicalRecordEnvelope).check(\n Schema.isMaxLength(MAX_THREAD_EXPORT_RECORDS),\n ),\n}) {}\n\n/**\n * A disposable projection snapshot. Adapters bind its sequence and digest to the canonical\n * log; consumers decode `state` and decide projection compatibility before suffix replay.\n * Legacy metadata is optional for application projections and preserved when supplied.\n * Runtime-owned recovery checkpoints populate and compare it before using cached state.\n */\nexport class ThreadCheckpoint extends Schema.Class<ThreadCheckpoint>(\n \"@effect-agent/thread/ThreadCheckpoint\",\n)({\n schemaVersion: Schema.Literal(1),\n threadId: ThreadId,\n throughSequence: CanonicalSequence,\n tailDigest: Digest,\n /** @deprecated For application projections; retained for existing data and runtime recovery. */\n engineVersion: Schema.optionalKey(Schema.NonEmptyString),\n /** @deprecated For application projections; retained for existing data and runtime recovery. */\n agentDefinitionDigest: Schema.optionalKey(Digest),\n /** @deprecated For application projections; retained for existing data and runtime recovery. */\n modelDigest: Schema.optionalKey(Digest),\n /** @deprecated For application projections; retained for existing data and runtime recovery. */\n toolDigest: Schema.optionalKey(Digest),\n state: PersistedJson,\n createdAt: Schema.DateTimeUtcFromString,\n}) {}\n\nexport class SaveCheckpointRequest extends Schema.Class<SaveCheckpointRequest>(\n \"@effect-agent/thread/SaveCheckpointRequest\",\n)({\n checkpoint: ThreadCheckpoint,\n}) {}\n\n/** Replace the disposable recovery view only under the current canonical producer fence. */\nexport class SaveRecoveryCheckpointRequest extends Schema.Class<SaveRecoveryCheckpointRequest>(\n \"@effect-agent/thread/SaveRecoveryCheckpointRequest\",\n)({\n checkpoint: ThreadCheckpoint,\n producerEpoch: ProducerEpoch,\n}) {}\n\nexport class LoadCheckpointRequest extends Schema.Class<LoadCheckpointRequest>(\n \"@effect-agent/thread/LoadCheckpointRequest\",\n)({\n threadId: ThreadId,\n atOrBeforeSequence: Schema.optionalKey(CanonicalSequence),\n}) {}\n\n/**\n * Content-free storage provenance constructed by adapters from source-authored labels.\n * Raw foreign lookalikes are not trusted diagnostics. Never include rejected values, SQL,\n * or schema messages.\n */\nexport class ThreadStoreDiagnostic extends Schema.Class<ThreadStoreDiagnostic>(\n \"@effect-agent/thread/ThreadStoreDiagnostic\",\n)({\n causeTag: Schema.String.check(Schema.isMaxLength(128)),\n operation: Schema.String.check(Schema.isMaxLength(256)),\n decoder: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(128))),\n issueTag: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(128))),\n sequence: Schema.optionalKey(CanonicalSequence),\n}) {}\n\nexport class ThreadStoreError extends Schema.TaggedError<ThreadStoreError>()(\"ThreadStoreError\", {\n operation: Schema.String,\n message: Schema.String,\n cause: Schema.optionalKey(Schema.Defect()),\n diagnostic: Schema.optionalKey(ThreadStoreDiagnostic),\n}) {}\n\nexport class ThreadNotMaterialized extends Schema.TaggedError<ThreadNotMaterialized>()(\n \"ThreadNotMaterialized\",\n { threadId: ThreadId },\n) {}\n\n/**\n * A canonical append that cannot commit: `batch-digest` replays a batch ID with different\n * content, `record-identity` reuses a canonical record ID, and `tail` declares a stale expected\n * tail. Tail conflicts carry the actual committed tail as a diagnostic resume hint.\n */\nexport class AppendConflict extends Schema.TaggedError<AppendConflict>()(\"AppendConflict\", {\n threadId: ThreadId,\n batchId: BatchId,\n reason: Schema.Literals([\"batch-digest\", \"record-identity\", \"tail\"]),\n actualTailSequence: Schema.optionalKey(CanonicalSequence),\n actualTailDigest: Schema.optionalKey(Digest),\n}) {}\n\nexport class FenceRejected extends Schema.TaggedError<FenceRejected>()(\"FenceRejected\", {\n threadId: ThreadId,\n actualEpoch: ProducerEpoch,\n attemptedEpoch: ProducerEpoch,\n}) {}\n\nexport class CheckpointRejected extends Schema.TaggedError<CheckpointRejected>()(\n \"CheckpointRejected\",\n {\n threadId: ThreadId,\n reason: Schema.Literals([\"ahead-of-tail\", \"digest-mismatch\", \"unsupported-version\", \"corrupt\"]),\n },\n) {}\n\nexport type ThreadStoreFailure =\n | ThreadStoreError\n | ThreadNotMaterialized\n | AppendConflict\n | FenceRejected;\n\n/**\n * Optional, disposable projection storage. Neither history execution nor durable recovery\n * requires it. Adapters that offer it must bind every checkpoint to a canonical batch tail.\n * Application consumers own projection compatibility; this port does not interpret metadata.\n */\nexport interface ThreadCheckpoints {\n readonly save: (\n request: SaveCheckpointRequest,\n ) => Effect.Effect<void, ThreadStoreError | ThreadNotMaterialized | CheckpointRejected>;\n readonly load: (\n request: LoadCheckpointRequest,\n ) => Effect.Effect<\n Option.Option<ThreadCheckpoint>,\n ThreadStoreError | ThreadNotMaterialized | CheckpointRejected\n >;\n}\n\n/**\n * Optional latest-only recovery cache, independent of application projection checkpoints.\n * Saves atomically validate the producer epoch and canonical batch tail. An older snapshot\n * cannot replace a newer one; equal-tail replacement repairs disposable state. Invalid cached\n * data fails with CheckpointRejected, while infrastructure failures remain ThreadStoreError.\n * Loading at an earlier tail or outside the adapter's cache locality may return none so callers\n * can replay canonical records. Canonical records and the ledger remain authority.\n */\nexport interface ThreadRecoveryCheckpoints {\n readonly save: (\n request: SaveRecoveryCheckpointRequest,\n ) => Effect.Effect<\n void,\n ThreadStoreError | ThreadNotMaterialized | CheckpointRejected | FenceRejected\n >;\n readonly load: ThreadCheckpoints[\"load\"];\n}\n\nexport class ThreadStore extends Context.Service<\n ThreadStore,\n {\n readonly materialize: (\n request: ThreadMaterialization,\n ) => Effect.Effect<void, ThreadStoreError | FenceRejected>;\n readonly append: (\n request: FencedAppendRequest,\n ) => Effect.Effect<\n AppendResult,\n ThreadStoreError | ThreadNotMaterialized | AppendConflict | FenceRejected\n >;\n readonly read: (\n request: ThreadReadRequest,\n ) => Stream.Stream<CanonicalRecordEnvelope, ThreadStoreError | ThreadNotMaterialized>;\n readonly observe: (\n request: ThreadObservation,\n ) => Stream.Stream<CanonicalRecordEnvelope, ThreadStoreError | ThreadNotMaterialized>;\n readonly export: (\n request: ThreadExportRequest,\n ) => Effect.Effect<ThreadExport, ThreadStoreError | ThreadNotMaterialized>;\n readonly inspectTail: (\n request: ThreadTailRequest,\n ) => Effect.Effect<ThreadTail, ThreadStoreError | ThreadNotMaterialized>;\n /** Absent when this adapter does not support disposable checkpoints. */\n readonly checkpoints?: ThreadCheckpoints | undefined;\n readonly recoveryCheckpoints?: ThreadRecoveryCheckpoints | undefined;\n /** Indexed scalar count; unsupported adapters fail closed at the caller. */\n readonly countPeerMessages?:\n | ((\n request: ThreadPeerCountRequest,\n ) => Effect.Effect<number, ThreadStoreError | ThreadNotMaterialized>)\n | undefined;\n }\n>()(\"@effect-agent/thread/ThreadStore\") {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAa,4BAA4B;;AAGzC,MAAa,sBAAsB,OAAO,OAAO;CAAE,UAAU;CAAU,UAAU;AAAS,CAAC;;AAI3F,MAAa,wBAAwB,OAAO,OAAO;CAAE,UAAU;CAAU,OAAO;AAAM,CAAC;AAGvF,MAAa,2BAA2B,OAAO,OAAO;CACpD,UAAU;;CAEV,OAAO,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,GAAG,OAAO,oBAAoB,IAAK,CAAC;AACpF,CAAC;;AAmBD,MAAa,2BAA2B,OAAO,OAAO;CACpD,UAAU;CACV,oBAAoB,OAAO,YAAY,YAAY;CACnD,OAAO,OAAO,IAAI,MAChB,OAAO,cAAc,CAAC,GACtB,OAAO,oBAAoB,yBAAyB,CACtD;AACF,CAAC;;AAKD,MAAa,yBAAyB,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H,IAAa,iBAAb,cAAoC,OAAO,YAA4B,CAAC,CAAC,kBAAkB;CACzF,UAAU;CACV,SAAS;CACT,QAAQ,OAAO,SAAS;EAAC;EAAgB;EAAmB;CAAM,CAAC;CACnE,oBAAoB,OAAO,YAAY,iBAAiB;CACxD,kBAAkB,OAAO,YAAY,MAAM;AAC7C,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,gBAAb,cAAmC,OAAO,YAA2B,CAAC,CAAC,iBAAiB;CACtF,UAAU;CACV,aAAa;CACb,gBAAgB;AAClB,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,qBAAb,cAAwC,OAAO,YAAgC,CAAC,CAC9E,sBACA;CACE,UAAU;CACV,QAAQ,OAAO,SAAS;EAAC;EAAiB;EAAmB;EAAuB;CAAS,CAAC;AAChG,CACF,CAAC,CAAC,CAAC;AA2CH,IAAa,cAAb,cAAiC,QAAQ,QAkCvC,CAAC,CAAC,kCAAkC,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"ThreadStore.mjs","names":[],"sources":["../../src/durable/ThreadStore.ts"],"sourcesContent":["import { Context, Effect, Option, Schema, Stream } from \"effect\";\n\nimport { RunId, SubmissionId, ThreadId } from \"../core/Identifiers.ts\";\nimport type { ToolCallPrepared, WorkerInputRequested } from \"./Records.ts\";\nimport {\n BatchId,\n CanonicalBatch,\n CanonicalRecordEnvelope,\n CanonicalSequence,\n Digest,\n ObservationOffset,\n PersistedJson,\n ProducerEpoch,\n RecordId,\n} from \"./Records.ts\";\nimport { runIdForSubmission, toolCallPreparedRecordId } from \"./RunJournal.ts\";\nimport { SubmissionLedger, SubmissionLookupById } from \"./SubmissionLedger.ts\";\n\nexport const MAX_THREAD_EXPORT_RECORDS = 131_072;\n\n/** Exact canonical identity; absence is not proof that an admission was never accepted. */\nexport const ThreadRecordRequest = Schema.Struct({ threadId: ThreadId, recordId: RecordId });\nexport type ThreadRecordRequest = typeof ThreadRecordRequest.Type;\n\n/** The original user input for a Run, excluding later joined inputs. */\nexport const ThreadRunInputRequest = Schema.Struct({ threadId: ThreadId, runId: RunId });\nexport type ThreadRunInputRequest = typeof ThreadRunInputRequest.Type;\n\nexport const ThreadOutstandingRequest = Schema.Struct({\n threadId: ThreadId,\n /** Exceeding this bound fails; a truncated inventory never grants authority. */\n limit: Schema.Int.check(Schema.isGreaterThan(0), Schema.isLessThanOrEqualTo(4_096)),\n});\n\nexport type ThreadOutstandingRequest = typeof ThreadOutstandingRequest.Type;\n\nexport interface ThreadOutstanding {\n readonly threadId: ThreadId;\n readonly throughSequence: CanonicalSequence;\n readonly complete: true;\n readonly operations: ReadonlyArray<{\n readonly submissionId: SubmissionId;\n readonly prepared: ToolCallPrepared;\n /** Prepared is not an unknown outcome or a grant to execute. */\n readonly state: \"prepared\" | \"unknown\";\n }>;\n /** Source reservations without proof that external effects are resolved. */\n readonly workerInputs: ReadonlyArray<WorkerInputRequested>;\n}\n\n/** Native worker reservation/accounting snapshot at a captured canonical tail. */\nexport const ThreadWorkerStateRequest = Schema.Struct({\n threadId: ThreadId,\n sourceSubmissionId: Schema.optionalKey(SubmissionId),\n limit: Schema.Int.check(\n Schema.isGreaterThan(0),\n Schema.isLessThanOrEqualTo(MAX_THREAD_EXPORT_RECORDS),\n ),\n});\n\nexport type ThreadWorkerStateRequest = typeof ThreadWorkerStateRequest.Type;\n\n/** Saturating lifetime peer-message count: the result is at most the requested cap. */\nexport const ThreadPeerCountRequest = Schema.Struct({\n threadId: ThreadId,\n limit: Schema.Int.check(Schema.isGreaterThan(0), Schema.isLessThanOrEqualTo(1000)),\n});\n\nexport type ThreadPeerCountRequest = typeof ThreadPeerCountRequest.Type;\n\nconst incomplete = (operation: string) =>\n ThreadStoreError.make({\n operation,\n message: \"Native canonical read is incomplete or corrupt\",\n });\n\n/** Collect a complete bounded selection, using canonical sequence as a sparse cursor. */\nconst selectedRecords = Effect.fnUntraced(function* (\n threadId: ThreadId,\n selection: ThreadSelection,\n limit: number,\n) {\n const store = yield* ThreadStore;\n const records: Array<CanonicalRecordEnvelope> = [];\n let afterSequence: CanonicalSequence | undefined;\n\n while (true) {\n const pageLimit = Math.min(1024, limit + 1 - records.length);\n\n const page = yield* Stream.runCollect(\n store.read({\n threadId,\n selection,\n page: { limit: pageLimit, ...(afterSequence === undefined ? {} : { afterSequence }) },\n }),\n );\n\n for (const entry of page) {\n if (\n entry.threadId !== threadId ||\n entry.sequence <= (afterSequence ?? 0) ||\n (\"expectedTailSequence\" in selection && entry.sequence > selection.expectedTailSequence)\n )\n return yield* incomplete(\"read selection identity\");\n afterSequence = entry.sequence;\n records.push(entry);\n }\n if (page.length > pageLimit || records.length > limit)\n return yield* incomplete(\"read selection limit\");\n if (page.length < pageLimit) return records;\n }\n});\n\n/** Host-owned read: authenticate the Thread and exact locator before calling. */\nexport const getRecord = Effect.fn(\"ThreadStore.getRecord\")(function* (\n request: ThreadRecordRequest,\n) {\n yield* Schema.decodeEffect(ThreadRecordRequest)(request).pipe(\n Effect.mapError(() => incomplete(\"getRecord request\")),\n );\n\n const records = yield* selectedRecords(\n request.threadId,\n { _tag: \"RecordId\", recordId: request.recordId },\n 1,\n );\n\n if (records.some((entry) => entry.record.recordId !== request.recordId))\n return yield* incomplete(\"getRecord identity\");\n\n return Option.fromUndefinedOr(records[0]);\n});\n\nexport const getRunInput = Effect.fn(\"ThreadStore.getRunInput\")(function* (\n request: ThreadRunInputRequest,\n) {\n yield* Schema.decodeEffect(ThreadRunInputRequest)(request).pipe(\n Effect.mapError(() => incomplete(\"getRunInput request\")),\n );\n\n const records = yield* selectedRecords(\n request.threadId,\n { _tag: \"RunInput\", runId: request.runId },\n 1,\n );\n\n if (\n records.some(\n ({ record: { payload } }) =>\n payload._tag !== \"UserInputRecorded\" ||\n payload.kind !== \"user\" ||\n payload.runId !== request.runId,\n )\n )\n return yield* incomplete(\"getRunInput identity\");\n\n return Option.fromUndefinedOr(records[0]);\n});\n\n/** A bounded snapshot of native lifetime and source-submission worker accounting. */\nexport const readWorkerState = Effect.fn(\"ThreadStore.readWorkerState\")(function* (\n request: ThreadWorkerStateRequest,\n) {\n yield* Schema.decodeEffect(ThreadWorkerStateRequest)(request).pipe(\n Effect.mapError(() => incomplete(\"readWorkerState request\")),\n );\n const store = yield* ThreadStore;\n const tail = yield* store.inspectTail(ThreadTailRequest.make({ threadId: request.threadId }));\n\n const records = yield* selectedRecords(\n request.threadId,\n {\n _tag: \"WorkerState\",\n expectedTailSequence: tail.tailSequence,\n expectedTailDigest: tail.tailDigest,\n ...(request.sourceSubmissionId === undefined\n ? {}\n : { sourceSubmissionId: request.sourceSubmissionId }),\n },\n request.limit,\n );\n\n return {\n threadId: request.threadId,\n tailSequence: tail.tailSequence,\n tailDigest: tail.tailDigest,\n records,\n };\n});\n\n/**\n * Work is proportional to outstanding records, independent of completed history. Unknown\n * effects survive abort and resolution intent; only canonical closure removes them. A\n * preparation from another Run still requires native recovery before it can be treated as\n * safe. This snapshot grants no execution authority and does not freeze other owners.\n */\nexport const readOutstanding = Effect.fn(\"ThreadStore.readOutstanding\")(function* (\n request: ThreadOutstandingRequest,\n) {\n yield* Schema.decodeEffect(ThreadOutstandingRequest)(request).pipe(\n Effect.mapError(() => incomplete(\"readOutstanding request\")),\n );\n const store = yield* ThreadStore;\n const ledger = yield* SubmissionLedger;\n const tail = yield* store.inspectTail(ThreadTailRequest.make({ threadId: request.threadId }));\n\n const records = yield* selectedRecords(\n request.threadId,\n {\n _tag: \"Outstanding\",\n expectedTailSequence: tail.tailSequence,\n expectedTailDigest: tail.tailDigest,\n },\n request.limit,\n );\n\n const operations: Array<ThreadOutstanding[\"operations\"][number]> = [];\n const workerInputs: Array<WorkerInputRequested> = [];\n\n for (const entry of records) {\n const payload = entry.record.payload;\n\n if (payload._tag === \"WorkerInputRequested\") {\n workerInputs.push(payload);\n continue;\n }\n if (payload._tag !== \"ToolCallPrepared\" && payload._tag !== \"ToolCallUnknown\")\n return yield* incomplete(\"readOutstanding record\");\n\n const preparedEntry =\n payload._tag === \"ToolCallPrepared\"\n ? entry\n : Option.getOrUndefined(\n yield* getRecord({\n threadId: request.threadId,\n recordId: toolCallPreparedRecordId(payload.runId, payload.turn, payload.toolCallId),\n }),\n );\n\n const inputEntry = Option.getOrUndefined(\n yield* getRunInput({ threadId: request.threadId, runId: payload.runId }),\n );\n\n if (\n preparedEntry === undefined ||\n inputEntry === undefined ||\n preparedEntry.sequence > tail.tailSequence ||\n inputEntry.sequence > tail.tailSequence\n )\n return yield* incomplete(\"readOutstanding proof beyond snapshot\");\n const prepared = preparedEntry.record.payload;\n const input = inputEntry.record.payload;\n\n if (\n prepared?._tag !== \"ToolCallPrepared\" ||\n prepared.runId !== payload.runId ||\n prepared.turn !== payload.turn ||\n prepared.toolCallId !== payload.toolCallId ||\n prepared.toolName !== payload.toolName ||\n input?._tag !== \"UserInputRecorded\" ||\n input.submissionId === undefined ||\n runIdForSubmission(input.submissionId) !== prepared.runId\n )\n return yield* incomplete(\"readOutstanding canonical ownership\");\n\n const submission = yield* ledger.lookup(\n SubmissionLookupById.make({ submissionId: input.submissionId }),\n );\n\n if (Option.isNone(submission) || submission.value.threadId !== request.threadId)\n return yield* incomplete(\"readOutstanding native admission\");\n operations.push({\n submissionId: input.submissionId,\n prepared,\n state: payload._tag === \"ToolCallUnknown\" ? \"unknown\" : \"prepared\",\n });\n }\n\n return {\n threadId: request.threadId,\n throughSequence: tail.tailSequence,\n complete: true as const,\n operations,\n workerInputs,\n };\n});\n\nexport class ThreadMaterialization extends Schema.Class<ThreadMaterialization>(\n \"@effect-agent/thread/ThreadMaterialization\",\n)({\n threadId: ThreadId,\n producerEpoch: ProducerEpoch,\n}) {}\n\nexport class FencedAppendRequest extends Schema.Class<FencedAppendRequest>(\n \"@effect-agent/thread/FencedAppendRequest\",\n)({\n threadId: ThreadId,\n batch: CanonicalBatch,\n expectedTailSequence: CanonicalSequence,\n expectedTailDigest: Digest,\n producerEpoch: ProducerEpoch,\n}) {}\n\nexport class AppendResult extends Schema.Class<AppendResult>(\"@effect-agent/thread/AppendResult\")({\n firstSequence: CanonicalSequence,\n lastSequence: CanonicalSequence,\n tailDigest: Digest,\n replayed: Schema.Boolean,\n}) {}\n\nexport class ThreadRead extends Schema.Class<ThreadRead>(\"@effect-agent/thread/ThreadRead\")({\n threadId: ThreadId,\n afterSequence: Schema.optionalKey(CanonicalSequence),\n limit: Schema.Natural.check(Schema.isGreaterThan(0), Schema.isLessThanOrEqualTo(1_024)),\n}) {}\n\n/** Closed native selections; mutable metadata is read at this exact canonical tail. */\nexport const ThreadSelection = Schema.Union([\n Schema.Struct({ _tag: Schema.Literal(\"RecordId\"), recordId: RecordId }),\n Schema.Struct({ _tag: Schema.Literal(\"RunInput\"), runId: RunId }),\n Schema.Struct({\n _tag: Schema.Literal(\"Outstanding\"),\n expectedTailSequence: CanonicalSequence,\n expectedTailDigest: Digest,\n }),\n Schema.Struct({\n _tag: Schema.Literal(\"WorkerExecution\"),\n expectedTailSequence: CanonicalSequence,\n expectedTailDigest: Digest,\n }),\n Schema.Struct({\n _tag: Schema.Literal(\"WorkerState\"),\n expectedTailSequence: CanonicalSequence,\n expectedTailDigest: Digest,\n sourceSubmissionId: Schema.optionalKey(SubmissionId),\n }),\n]);\n\nexport type ThreadSelection = typeof ThreadSelection.Type;\n\n/** Nested page makes an old ThreadRead decoder reject, never strip a selection into history. */\nexport const SelectedThreadRead = Schema.Struct({\n threadId: ThreadId,\n selection: ThreadSelection,\n page: Schema.Struct({\n afterSequence: Schema.optionalKey(CanonicalSequence),\n limit: ThreadRead.fields.limit,\n }),\n});\n\nexport type SelectedThreadRead = typeof SelectedThreadRead.Type;\nexport const ThreadReadRequest = Schema.Union([SelectedThreadRead, ThreadRead]);\nexport type ThreadReadRequest = typeof ThreadReadRequest.Type;\n\nexport class ThreadObservation extends Schema.Class<ThreadObservation>(\n \"@effect-agent/thread/ThreadObservation\",\n)({\n threadId: ThreadId,\n afterOffset: Schema.optionalKey(ObservationOffset),\n}) {}\n\nexport class ThreadExportRequest extends Schema.Class<ThreadExportRequest>(\n \"@effect-agent/thread/ThreadExportRequest\",\n)({\n threadId: ThreadId,\n}) {}\n\nexport class ThreadTailRequest extends Schema.Class<ThreadTailRequest>(\n \"@effect-agent/thread/ThreadTailRequest\",\n)({\n threadId: ThreadId,\n}) {}\n\n/**\n * The committed tail of one Thread Log. A resuming producer composes its next\n * FencedAppendRequest from this value instead of exporting the whole log.\n */\nexport class ThreadTail extends Schema.Class<ThreadTail>(\"@effect-agent/thread/ThreadTail\")({\n threadId: ThreadId,\n tailSequence: CanonicalSequence,\n tailDigest: Digest,\n producerEpoch: ProducerEpoch,\n}) {}\n\n/** Maximum canonical records represented by one Thread export. */\n\nexport class ThreadExport extends Schema.Class<ThreadExport>(\"@effect-agent/thread/ThreadExport\")({\n format: Schema.Literal(\"effect-agent/thread@1\"),\n threadId: ThreadId,\n tailSequence: CanonicalSequence,\n tailDigest: Digest,\n records: Schema.Array(CanonicalRecordEnvelope).check(\n Schema.isMaxLength(MAX_THREAD_EXPORT_RECORDS),\n ),\n}) {}\n\n/**\n * A disposable projection snapshot. Adapters bind its sequence and digest to the canonical\n * log; consumers decode `state` and decide projection compatibility before suffix replay.\n * Legacy metadata is optional for application projections and preserved when supplied.\n * Runtime-owned recovery checkpoints populate and compare it before using cached state.\n */\nexport class ThreadCheckpoint extends Schema.Class<ThreadCheckpoint>(\n \"@effect-agent/thread/ThreadCheckpoint\",\n)({\n schemaVersion: Schema.Literal(1),\n threadId: ThreadId,\n throughSequence: CanonicalSequence,\n tailDigest: Digest,\n /** @deprecated For application projections; retained for existing data and runtime recovery. */\n engineVersion: Schema.optionalKey(Schema.NonEmptyString),\n /** @deprecated For application projections; retained for existing data and runtime recovery. */\n agentDefinitionDigest: Schema.optionalKey(Digest),\n /** @deprecated For application projections; retained for existing data and runtime recovery. */\n modelDigest: Schema.optionalKey(Digest),\n /** @deprecated For application projections; retained for existing data and runtime recovery. */\n toolDigest: Schema.optionalKey(Digest),\n state: PersistedJson,\n createdAt: Schema.DateTimeUtcFromString,\n}) {}\n\nexport class SaveCheckpointRequest extends Schema.Class<SaveCheckpointRequest>(\n \"@effect-agent/thread/SaveCheckpointRequest\",\n)({\n checkpoint: ThreadCheckpoint,\n}) {}\n\n/** Replace the disposable recovery view only under the current canonical producer fence. */\nexport class SaveRecoveryCheckpointRequest extends Schema.Class<SaveRecoveryCheckpointRequest>(\n \"@effect-agent/thread/SaveRecoveryCheckpointRequest\",\n)({\n checkpoint: ThreadCheckpoint,\n producerEpoch: ProducerEpoch,\n}) {}\n\nexport class LoadCheckpointRequest extends Schema.Class<LoadCheckpointRequest>(\n \"@effect-agent/thread/LoadCheckpointRequest\",\n)({\n threadId: ThreadId,\n atOrBeforeSequence: Schema.optionalKey(CanonicalSequence),\n}) {}\n\n/**\n * Content-free storage provenance constructed by adapters from source-authored labels.\n * Raw foreign lookalikes are not trusted diagnostics. Never include rejected values, SQL,\n * or schema messages.\n */\nexport class ThreadStoreDiagnostic extends Schema.Class<ThreadStoreDiagnostic>(\n \"@effect-agent/thread/ThreadStoreDiagnostic\",\n)({\n causeTag: Schema.String.check(Schema.isMaxLength(128)),\n operation: Schema.String.check(Schema.isMaxLength(256)),\n decoder: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(128))),\n issueTag: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(128))),\n sequence: Schema.optionalKey(CanonicalSequence),\n}) {}\n\nexport class ThreadStoreError extends Schema.TaggedError<ThreadStoreError>()(\"ThreadStoreError\", {\n operation: Schema.String,\n message: Schema.String,\n cause: Schema.optionalKey(Schema.Defect()),\n diagnostic: Schema.optionalKey(ThreadStoreDiagnostic),\n}) {}\n\nexport class ThreadNotMaterialized extends Schema.TaggedError<ThreadNotMaterialized>()(\n \"ThreadNotMaterialized\",\n { threadId: ThreadId },\n) {}\n\n/**\n * A canonical append that cannot commit: `batch-digest` replays a batch ID with different\n * content, `record-identity` reuses a canonical record ID, and `tail` declares a stale expected\n * tail. Tail conflicts carry the actual committed tail as a diagnostic resume hint.\n */\nexport class AppendConflict extends Schema.TaggedError<AppendConflict>()(\"AppendConflict\", {\n threadId: ThreadId,\n batchId: BatchId,\n reason: Schema.Literals([\"batch-digest\", \"record-identity\", \"tail\"]),\n actualTailSequence: Schema.optionalKey(CanonicalSequence),\n actualTailDigest: Schema.optionalKey(Digest),\n}) {}\n\nexport class FenceRejected extends Schema.TaggedError<FenceRejected>()(\"FenceRejected\", {\n threadId: ThreadId,\n actualEpoch: ProducerEpoch,\n attemptedEpoch: ProducerEpoch,\n}) {}\n\nexport class CheckpointRejected extends Schema.TaggedError<CheckpointRejected>()(\n \"CheckpointRejected\",\n {\n threadId: ThreadId,\n reason: Schema.Literals([\"ahead-of-tail\", \"digest-mismatch\", \"unsupported-version\", \"corrupt\"]),\n },\n) {}\n\nexport type ThreadStoreFailure =\n | ThreadStoreError\n | ThreadNotMaterialized\n | AppendConflict\n | FenceRejected;\n\n/**\n * Optional, disposable projection storage. Neither history execution nor durable recovery\n * requires it. Adapters that offer it must bind every checkpoint to a canonical batch tail.\n * Application consumers own projection compatibility; this port does not interpret metadata.\n */\nexport interface ThreadCheckpoints {\n readonly save: (\n request: SaveCheckpointRequest,\n ) => Effect.Effect<void, ThreadStoreError | ThreadNotMaterialized | CheckpointRejected>;\n readonly load: (\n request: LoadCheckpointRequest,\n ) => Effect.Effect<\n Option.Option<ThreadCheckpoint>,\n ThreadStoreError | ThreadNotMaterialized | CheckpointRejected\n >;\n}\n\n/**\n * Optional latest-only recovery cache, independent of application projection checkpoints.\n * Saves atomically validate the producer epoch and canonical batch tail. An older snapshot\n * cannot replace a newer one; equal-tail replacement repairs disposable state. Invalid cached\n * data fails with CheckpointRejected, while infrastructure failures remain ThreadStoreError.\n * Loading at an earlier tail or outside the adapter's cache locality may return none so callers\n * can replay canonical records. Canonical records and the ledger remain authority.\n */\nexport interface ThreadRecoveryCheckpoints {\n readonly save: (\n request: SaveRecoveryCheckpointRequest,\n ) => Effect.Effect<\n void,\n ThreadStoreError | ThreadNotMaterialized | CheckpointRejected | FenceRejected\n >;\n readonly load: ThreadCheckpoints[\"load\"];\n}\n\nexport class ThreadStore extends Context.Service<\n ThreadStore,\n {\n readonly materialize: (\n request: ThreadMaterialization,\n ) => Effect.Effect<void, ThreadStoreError | FenceRejected>;\n readonly append: (\n request: FencedAppendRequest,\n ) => Effect.Effect<\n AppendResult,\n ThreadStoreError | ThreadNotMaterialized | AppendConflict | FenceRejected\n >;\n readonly read: (\n request: ThreadReadRequest,\n ) => Stream.Stream<CanonicalRecordEnvelope, ThreadStoreError | ThreadNotMaterialized>;\n readonly observe: (\n request: ThreadObservation,\n ) => Stream.Stream<CanonicalRecordEnvelope, ThreadStoreError | ThreadNotMaterialized>;\n readonly export: (\n request: ThreadExportRequest,\n ) => Effect.Effect<ThreadExport, ThreadStoreError | ThreadNotMaterialized>;\n readonly inspectTail: (\n request: ThreadTailRequest,\n ) => Effect.Effect<ThreadTail, ThreadStoreError | ThreadNotMaterialized>;\n /** Absent when this adapter does not support disposable checkpoints. */\n readonly checkpoints?: ThreadCheckpoints | undefined;\n readonly recoveryCheckpoints?: ThreadRecoveryCheckpoints | undefined;\n /** Indexed scalar count; unsupported adapters fail closed at the caller. */\n readonly countPeerMessages?:\n | ((\n request: ThreadPeerCountRequest,\n ) => Effect.Effect<number, ThreadStoreError | ThreadNotMaterialized>)\n | undefined;\n }\n>()(\"@effect-agent/thread/ThreadStore\") {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAa,4BAA4B;;AAGzC,MAAa,sBAAsB,OAAO,OAAO;CAAE,UAAU;CAAU,UAAU;AAAS,CAAC;;AAI3F,MAAa,wBAAwB,OAAO,OAAO;CAAE,UAAU;CAAU,OAAO;AAAM,CAAC;AAGvF,MAAa,2BAA2B,OAAO,OAAO;CACpD,UAAU;;CAEV,OAAO,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,GAAG,OAAO,oBAAoB,IAAK,CA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mBAAb,cAAsC,OAAO,YAA8B,CAAC,CAAC,oBAAoB;CAC/F,WAAW,OAAO;CAClB,SAAS,OAAO;CAChB,OAAO,OAAO,YAAY,OAAO,OAAO,CAAC;CACzC,YAAY,OAAO,YAAY,qBAAqB;AACtD,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,wBAAb,cAA2C,OAAO,YAAmC,CAAC,CACpF,yBACA,EAAE,UAAU,SAAS,CACvB,CAAC,CAAC,CAAC;;;;;;AAOH,IAAa,iBAAb,cAAoC,OAAO,YAA4B,CAAC,CAAC,kBAAkB;CACzF,UAAU;CACV,SAAS;CACT,QAAQ,OAAO,SAAS;EAAC;EAAgB;EAAmB;CAAM,CAAC;CACnE,oBAAoB,OAAO,YAAY,iBAAiB;CACxD,kBAAkB,OAAO,YAAY,MAAM;AAC7C,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,gBAAb,cAAmC,OAAO,YAA2B,CAAC,CAAC,iBAAiB;CACtF,UAAU;CACV,aAAa;CACb,gBAAgB;AAClB,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,qBAAb,cAAwC,OAAO,YAAgC,CAAC,CAC9E,sBACA;CACE,UAAU;CACV,QAAQ,OAAO,SAAS;EAAC;EAAiB;EAAmB;EAAuB;CAAS,CAAC;AAChG,CACF,CAAC,CAAC,CAAC;AA2CH,IAAa,cAAb,cAAiC,QAAQ,QAkCvC,CAAC,CAAC,kCAAkC,CAAC,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cn as ThreadStoreFailure, Xt as CheckpointRejected, bn as ThreadStore } from "../Records-Byeb70tt.mjs";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
//#region src/durable/ThreadStoreConformance.d.ts
|
|
4
4
|
declare const ThreadStoreConformanceViolation_base: Schema.Class<ThreadStoreConformanceViolation, Schema.TaggedStruct<"ThreadStoreConformanceViolation", {
|
|
@@ -2,9 +2,9 @@ import { l as SubmissionId, u as ThreadId } from "../Identifiers-CN2s30fF.mjs";
|
|
|
2
2
|
import { i as SubagentBudgetReservation } from "../SubagentContract-DdT7Cqe6.mjs";
|
|
3
3
|
import { r as Principal } from "../Receipt-BAHyigAF.mjs";
|
|
4
4
|
import { t as AgentPolicy } from "../AgentPolicy-BqDoSXO6.mjs";
|
|
5
|
-
import { r as AnyDefinition, t as Agent_d_exports } from "../Agent-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { r as AnyDefinition, t as Agent_d_exports } from "../Agent-D9cXqfF3.mjs";
|
|
6
|
+
import { c as WorkerError, f as WorkerRef, h as WorkerSource } from "../Worker-fwWkBg12.mjs";
|
|
7
|
+
import { Do as SubmissionSnapshot, O as PersistedJson, _ as Digest, dt as WorkerOrigin, h as DefinitionDigests } from "../Records-Byeb70tt.mjs";
|
|
8
8
|
import { Context, Effect, Option, Schema } from "effect";
|
|
9
9
|
declare namespace WorkerHost_d_exports {
|
|
10
10
|
export { WorkerBudgetAuthorizer, WorkerConcurrencyLimit, WorkerConcurrencyResolver, WorkerHostAuthorizationRequest, WorkerHostAuthorizer, WorkerHostConfig, WorkerHostLimits, WorkerPolicyResolver, WorkerPolicySource, WorkerPolicyTarget };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { c as WorkerError } from "../Worker-CfwzMZEK.mjs";
|
|
3
3
|
import { Context, Effect, Option, Schema } from "effect";
|
|
4
4
|
//#region src/durable/WorkerHost.ts
|
|
5
5
|
var WorkerHost_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as start, C as decodeFinalOutput, D as renderInputPrompt, E as projectCompletionOutput, F as withTerminalDefectEvent, M as stream, N as streamUnknown, O as run, P as streamWithUsageAccountingUnknown, S as ToolCallWaiting, T as projectCompletionFromToolOutput, _ as SubagentDurability, a as AgentResultSchema, b as SubagentDurabilityError, c as AgentSpawner, d as DetachedRun, f as EngineProvidedToolServices, g as SpawnedChildRun, h as SpawnRunOptions, i as AgentResult, j as startUnknown, k as runUnknown, l as AgentSpawnerParent, m as SpawnDelegation, n as AgentChildPending, o as AgentRuntimeFailure, p as RuntimeBinding, r as AgentCompletionProjectionRequirements, s as AgentRuntimeRequirements, u as AgentSpawnerService, v as SubagentDurabilityDurable, w as encodeRunDisposition, x as SubagentDurabilityService, y as SubagentDurabilityEphemeral } from "../AgentRuntime-
|
|
1
|
+
import { A as start, C as decodeFinalOutput, D as renderInputPrompt, E as projectCompletionOutput, F as withTerminalDefectEvent, M as stream, N as streamUnknown, O as run, P as streamWithUsageAccountingUnknown, S as ToolCallWaiting, T as projectCompletionFromToolOutput, _ as SubagentDurability, a as AgentResultSchema, b as SubagentDurabilityError, c as AgentSpawner, d as DetachedRun, f as EngineProvidedToolServices, g as SpawnedChildRun, h as SpawnRunOptions, i as AgentResult, j as startUnknown, k as runUnknown, l as AgentSpawnerParent, m as SpawnDelegation, n as AgentChildPending, o as AgentRuntimeFailure, p as RuntimeBinding, r as AgentCompletionProjectionRequirements, s as AgentRuntimeRequirements, u as AgentSpawnerService, v as SubagentDurabilityDurable, w as encodeRunDisposition, x as SubagentDurabilityService, y as SubagentDurabilityEphemeral } from "../AgentRuntime-DyZv8uu2.mjs";
|
|
2
2
|
export { AgentChildPending, type AgentCompletionProjectionRequirements, type AgentResult, AgentResultSchema, type AgentRuntimeFailure, type AgentRuntimeRequirements, AgentSpawner, type AgentSpawnerParent, type AgentSpawnerService, type DetachedRun, type EngineProvidedToolServices, type RuntimeBinding, type SpawnDelegation, type SpawnRunOptions, type SpawnedChildRun, SubagentDurability, type SubagentDurabilityDurable, type SubagentDurabilityEphemeral, SubagentDurabilityError, type SubagentDurabilityService, ToolCallWaiting, decodeFinalOutput, encodeRunDisposition, projectCompletionFromToolOutput, projectCompletionOutput, renderInputPrompt, run, runUnknown, start, startUnknown, stream, streamUnknown, streamWithUsageAccountingUnknown, withTerminalDefectEvent };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as stream, a as SubagentDurability, b as withTerminalDefectEvent, c as decodeFinalOutput, d as projectCompletionOutput, f as renderInputPrompt, g as startUnknown, h as start, i as AgentSpawner, l as encodeRunDisposition, m as runUnknown, n as AgentChildPending, o as SubagentDurabilityError, p as run, r as AgentResultSchema, s as ToolCallWaiting, u as projectCompletionFromToolOutput, v as streamUnknown, y as streamWithUsageAccountingUnknown } from "../AgentRuntime-
|
|
1
|
+
import { _ as stream, a as SubagentDurability, b as withTerminalDefectEvent, c as decodeFinalOutput, d as projectCompletionOutput, f as renderInputPrompt, g as startUnknown, h as start, i as AgentSpawner, l as encodeRunDisposition, m as runUnknown, n as AgentChildPending, o as SubagentDurabilityError, p as run, r as AgentResultSchema, s as ToolCallWaiting, u as projectCompletionFromToolOutput, v as streamUnknown, y as streamWithUsageAccountingUnknown } from "../AgentRuntime-Cp1hAb-W.mjs";
|
|
2
2
|
export { AgentChildPending, AgentResultSchema, AgentSpawner, SubagentDurability, SubagentDurabilityError, ToolCallWaiting, decodeFinalOutput, encodeRunDisposition, projectCompletionFromToolOutput, projectCompletionOutput, renderInputPrompt, run, runUnknown, start, startUnknown, stream, streamUnknown, streamWithUsageAccountingUnknown, withTerminalDefectEvent };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PeerDeliveryLifetime, c as PeerTarget, i as PeerAuthorizer, l as SendPeerMessage, o as PeerMessageCapacity, r as PeerAuthorizationRequest, s as PeerRoutes, t as MessagingHost } from "../MessagingHost-
|
|
1
|
+
import { a as PeerDeliveryLifetime, c as PeerTarget, i as PeerAuthorizer, l as SendPeerMessage, o as PeerMessageCapacity, r as PeerAuthorizationRequest, s as PeerRoutes, t as MessagingHost } from "../MessagingHost-CqzpxbGz.mjs";
|
|
2
2
|
export { MessagingHost, PeerAuthorizationRequest, PeerAuthorizer, PeerDeliveryLifetime, PeerMessageCapacity, PeerRoutes, PeerTarget, SendPeerMessage };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PeerMessageCapacity, i as PeerDeliveryLifetime, o as PeerRoutes, r as PeerAuthorizer, t as MessagingHost } from "../MessagingHost-
|
|
1
|
+
import { a as PeerMessageCapacity, i as PeerDeliveryLifetime, o as PeerRoutes, r as PeerAuthorizer, t as MessagingHost } from "../MessagingHost-DfsbMPvq.mjs";
|
|
2
2
|
export { MessagingHost, PeerAuthorizer, PeerDeliveryLifetime, PeerMessageCapacity, PeerRoutes };
|
package/dist/engine/Output.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as textOutput } from "../Output-
|
|
1
|
+
import { n as textOutput } from "../Output-V-6YL1_Z.mjs";
|
|
2
2
|
export { textOutput as text };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as RunTurnResponseCommit, A as RunInputCommand, B as RunSubagentChildIdentity, C as RunContextPreparationPassthrough, D as RunCostEstimateValue, E as RunCostEstimateRequest, G as RunToolAuthorization, H as RunSubagentEstablishRequest, I as RunResumeUsage, J as RunToolAuthorizationRequest, K as RunToolAuthorizationDecision, L as RunResumeUsageSchema, M as RunOptions, N as RunOptionsError, O as RunCostEstimator, P as RunOptionsRequirements, Q as RunTransientContextHook, R as RunSchedulingHook, S as RunContextPreparationError, T as RunCostEstimate, U as RunSubagentHook, V as RunSubagentDigests, W as RunSubagentJoinRequest, X as RunToolFailureObserver, Y as RunToolCallDescriptor, Z as RunToolScheduling, _ as RunBudgetHook, a as ChildEstablishWaiting, at as RunUsageDelta, b as RunContextHook, c as ModelToolFailure, d as ProgrammaticPreflightFailure, et as RunTurnResume, f as ProgrammaticToolFailure, g as RunApprovalRequest, h as RunApprovalHook, i as ChildEstablishStatus, it as RunTurnUsage, j as RunInputHook, k as RunDurabilityHook, l as ModelUsageAccounting, m as RunApprovalDecision, n as ChildEstablishDenied, nt as RunTurnResumeSettledCall, o as CommandDrainPolicy, ot as ToolFailureObservation, p as ResolvedModelCall, q as RunToolAuthorizationHook, r as ChildEstablishSettled, rt as RunTurnResumeSettledCallSchema, s as CurrentToolFailureObserver, st as toolFailureObserverLayer, t as AgentUpdateAcceptance, tt as RunTurnResumeCall, u as PreparedRunContext, v as RunBufferLimits, w as RunContextRequest, x as RunContextPreparation, y as RunCompactionCommit, z as RunSchedulingOverride } from "../RunOptions-
|
|
1
|
+
import { $ as RunTurnResponseCommit, A as RunInputCommand, B as RunSubagentChildIdentity, C as RunContextPreparationPassthrough, D as RunCostEstimateValue, E as RunCostEstimateRequest, G as RunToolAuthorization, H as RunSubagentEstablishRequest, I as RunResumeUsage, J as RunToolAuthorizationRequest, K as RunToolAuthorizationDecision, L as RunResumeUsageSchema, M as RunOptions, N as RunOptionsError, O as RunCostEstimator, P as RunOptionsRequirements, Q as RunTransientContextHook, R as RunSchedulingHook, S as RunContextPreparationError, T as RunCostEstimate, U as RunSubagentHook, V as RunSubagentDigests, W as RunSubagentJoinRequest, X as RunToolFailureObserver, Y as RunToolCallDescriptor, Z as RunToolScheduling, _ as RunBudgetHook, a as ChildEstablishWaiting, at as RunUsageDelta, b as RunContextHook, c as ModelToolFailure, d as ProgrammaticPreflightFailure, et as RunTurnResume, f as ProgrammaticToolFailure, g as RunApprovalRequest, h as RunApprovalHook, i as ChildEstablishStatus, it as RunTurnUsage, j as RunInputHook, k as RunDurabilityHook, l as ModelUsageAccounting, m as RunApprovalDecision, n as ChildEstablishDenied, nt as RunTurnResumeSettledCall, o as CommandDrainPolicy, ot as ToolFailureObservation, p as ResolvedModelCall, q as RunToolAuthorizationHook, r as ChildEstablishSettled, rt as RunTurnResumeSettledCallSchema, s as CurrentToolFailureObserver, st as toolFailureObserverLayer, t as AgentUpdateAcceptance, tt as RunTurnResumeCall, u as PreparedRunContext, v as RunBufferLimits, w as RunContextRequest, x as RunContextPreparation, y as RunCompactionCommit, z as RunSchedulingOverride } from "../RunOptions-CSBsSj0X.mjs";
|
|
2
2
|
export { AgentUpdateAcceptance, ChildEstablishDenied, ChildEstablishSettled, ChildEstablishStatus, ChildEstablishWaiting, CommandDrainPolicy, CurrentToolFailureObserver, ModelToolFailure, ModelUsageAccounting, PreparedRunContext, ProgrammaticPreflightFailure, ProgrammaticToolFailure, ResolvedModelCall, RunApprovalDecision, RunApprovalHook, RunApprovalRequest, RunBudgetHook, RunBufferLimits, RunCompactionCommit, RunContextHook, RunContextPreparation, RunContextPreparationError, RunContextPreparationPassthrough, RunContextRequest, RunCostEstimate, RunCostEstimateRequest, RunCostEstimateValue, RunCostEstimator, RunDurabilityHook, RunInputCommand, RunInputHook, RunOptions, RunOptionsError, RunOptionsRequirements, RunResumeUsage, RunResumeUsageSchema, RunSchedulingHook, RunSchedulingOverride, RunSubagentChildIdentity, RunSubagentDigests, RunSubagentEstablishRequest, RunSubagentHook, RunSubagentJoinRequest, RunToolAuthorization, RunToolAuthorizationDecision, RunToolAuthorizationHook, RunToolAuthorizationRequest, RunToolCallDescriptor, RunToolFailureObserver, RunToolScheduling, RunTransientContextHook, RunTurnResponseCommit, RunTurnResume, RunTurnResumeCall, RunTurnResumeSettledCall, RunTurnResumeSettledCallSchema, RunTurnUsage, RunUsageDelta, ToolFailureObservation, toolFailureObserverLayer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
export { BackgroundReporting, FollowUpWorkerRequest, StartWorkerRequest, SubagentHost, WorkerMessageRequest, WorkerObservation, WorkerReceiptRequest, WorkerReportPreparationFailure, WorkerReporting, WorkerRunReport };
|
|
1
|
+
import { a as SubagentHost, c as WorkerObservation, d as WorkerReporting, f as WorkerRunReport, i as StartWorkerRequest, l as WorkerReceiptRequest, n as DeferredStartWorkerRequest, r as FollowUpWorkerRequest, s as WorkerMessageRequest, t as BackgroundReporting, u as WorkerReportPreparationFailure } from "../SubagentHost-P9zB_TfV.mjs";
|
|
2
|
+
export { BackgroundReporting, DeferredStartWorkerRequest, FollowUpWorkerRequest, StartWorkerRequest, SubagentHost, WorkerMessageRequest, WorkerObservation, WorkerReceiptRequest, WorkerReportPreparationFailure, WorkerReporting, WorkerRunReport };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { c as WorkerError } from "../Worker-CfwzMZEK.mjs";
|
|
3
3
|
import { Context, Schema, Stream } from "effect";
|
|
4
4
|
//#region src/engine/SubagentHost.ts
|
|
5
5
|
var SubagentHost_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -58,6 +58,10 @@ var SubagentHost = class SubagentHost extends Context.Service()("@effect-agent/e
|
|
|
58
58
|
operation: "list",
|
|
59
59
|
reason: "unavailable"
|
|
60
60
|
}),
|
|
61
|
+
stop: () => WorkerError.make({
|
|
62
|
+
operation: "stop",
|
|
63
|
+
reason: "unavailable"
|
|
64
|
+
}),
|
|
61
65
|
cancel: () => WorkerError.make({
|
|
62
66
|
operation: "cancel",
|
|
63
67
|
reason: "unavailable"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubagentHost.mjs","names":[],"sources":["../../src/engine/SubagentHost.ts"],"sourcesContent":["import type { Effect, Option } from \"effect\";\nimport { Context, Schema, Stream } from \"effect\";\n\nimport type * as Agent from \"../core/Agent.ts\";\nimport type { AgentPolicy } from \"../core/AgentPolicy.ts\";\nimport type * as FailureDiagnostic from \"../core/FailureDiagnostic.ts\";\nimport type { DelegationId, RunId, SettlementId, ThreadId } from \"../core/Identifiers.ts\";\nimport type { MessageRef, MessageStatus } from \"../core/Messaging.ts\";\nimport { type IdempotencyKey, type JoinedToHost, type Receipt } from \"../core/Receipt.ts\";\nimport type { SubagentBudgetReservation } from \"../core/SubagentContract.ts\";\nimport {\n WorkerError,\n type WorkerCompletion,\n type WorkerHistoryEntry,\n type WorkerContext,\n type WorkerBudgetScope,\n type WorkerSource,\n type WorkerPage,\n type WorkerRef,\n type WorkerStarted,\n type WorkerSummary,\n} from \"../core/Worker.ts\";\n\n/** Prepared values cross this port only to be Schema-decoded before durable storage. */\nexport interface StartWorkerRequest {\n readonly delegationId: DelegationId;\n readonly target: Agent.AnyDefinition;\n readonly idempotencyKey: IdempotencyKey;\n readonly encodedInput: unknown;\n readonly encodedParameters: unknown;\n readonly policy: AgentPolicy;\n readonly budget: SubagentBudgetReservation;\n readonly encodedGrant: unknown;\n readonly toolCallAllowance?: number;\n /** Author-owned request; the durable host must separately authorize worker-run funding. */\n readonly budgetScope?: WorkerBudgetScope;\n}\n\nexport interface FollowUpWorkerRequest {\n readonly worker: WorkerRef;\n readonly target: Agent.AnyDefinition;\n readonly idempotencyKey: IdempotencyKey;\n readonly encodedInput: unknown;\n readonly encodedParameters: unknown;\n}\n\nexport interface WorkerReceiptRequest {\n readonly worker: WorkerRef;\n readonly target: Agent.AnyDefinition;\n readonly receipt: Receipt;\n}\n\nexport interface WorkerMessageRequest {\n readonly worker: WorkerRef;\n readonly target: Agent.AnyDefinition;\n readonly message: MessageRef;\n}\n\n/**\n * Canonical terminal values remain encoded until the capability decodes the saved parameters\n * and target output and applies its declared result projection. Child E does not survive settlement.\n */\nexport type WorkerObservation =\n | { readonly _tag: \"Pending\"; readonly receipt: Receipt }\n | {\n readonly _tag: \"Settled\";\n readonly receipt: Receipt;\n /** Absent when an input failed or was cancelled before any Run started. */\n readonly runId?: RunId;\n readonly settlementId: SettlementId;\n readonly outcome: \"completed\" | \"failed\" | \"aborted\";\n readonly encodedParameters: unknown;\n readonly encodedResult: unknown;\n /** Operator-private failed-settlement evidence; never part of a model Tool result. */\n readonly diagnostic?: FailureDiagnostic.Failure;\n readonly budgetExhausted: boolean;\n };\n\n/** One actual canonical Run, independent of how many input Receipts joined it. */\nexport interface WorkerRunReport {\n readonly worker: WorkerRef;\n readonly context: WorkerContext;\n readonly observation: Extract<WorkerObservation, { readonly _tag: \"Settled\" }> & {\n readonly runId: RunId;\n };\n}\n\n/** A bounded projection failure; raw application errors never enter durable report records. */\nexport class WorkerReportPreparationFailure extends Schema.TaggedError<WorkerReportPreparationFailure>()(\n \"WorkerReportPreparationFailure\",\n { stage: Schema.Literals([\"projection\", \"input\", \"preparation\"]) },\n) {}\n\n/**\n * Source-owned projection discovered from background tools or supplied by a custom registration.\n * The concrete descriptor retains its E/R; durable registration captures R and records\n * bounded preparation failure rather than serializing arbitrary application errors.\n */\nexport interface WorkerReporting<E = never, R = never> {\n readonly delegationId: DelegationId;\n readonly target: Agent.AnyDefinition;\n /** Standard messages retain the parent's original application input. */\n readonly mode?: \"standard\";\n readonly input?: Schema.Top;\n /** Required for custom mapping when the receiving coordinator is itself an established worker. */\n readonly destination?: {\n readonly delegationId: DelegationId;\n readonly target: Agent.AnyDefinition;\n };\n readonly prepare: (report: WorkerRunReport) => Effect.Effect<\n {\n readonly encodedInput: Schema.Json;\n readonly encodedParameters?: Schema.Json;\n readonly message?: WorkerCompletion;\n },\n E | WorkerReportPreparationFailure,\n R\n >;\n}\n\n/** Descriptor carried by background tools; registration discovers it without an app handoff. */\nexport const BackgroundReporting = Context.Reference<\n WorkerReporting<WorkerReportPreparationFailure> | undefined\n>(\"@effect-agent/engine/BackgroundReporting\", { defaultValue: () => undefined });\n\n/**\n * Trusted, caller-bound host port. The interpreter supplies a fresh facet for each Tool Call;\n * programmatic callers acquire a separately authorized Thread facet. Request values cannot\n * choose the source identity, replace worker provenance or expand its authority and budgets.\n */\nexport class SubagentHost extends Context.Service<\n SubagentHost,\n {\n readonly context: Effect.Effect<WorkerContext, WorkerError>;\n /** Resolve prepared input through host authority; None retains legacy target inheritance. */\n readonly resolveTargetPolicy: (request: {\n readonly target: Agent.AnyDefinition;\n readonly encodedInput: unknown;\n }) => Effect.Effect<Option.Option<AgentPolicy>, WorkerError>;\n readonly start: (request: StartWorkerRequest) => Effect.Effect<WorkerStarted, WorkerError>;\n readonly followUp: (\n request: FollowUpWorkerRequest,\n ) => Effect.Effect<MessageStatus, WorkerError>;\n readonly inspect: (\n request: WorkerReceiptRequest | WorkerMessageRequest,\n ) => Effect.Effect<WorkerObservation | MessageStatus, WorkerError>;\n /** Inspect the continuing worker using the same summary contract as discovery. */\n readonly summary: (request: {\n readonly worker: WorkerRef;\n readonly target: Agent.AnyDefinition;\n }) => Effect.Effect<WorkerSummary, WorkerError>;\n /** A finite snapshot through the captured tail; resume with the last sequence as `after`. */\n readonly observe: (request: {\n readonly worker: WorkerRef;\n readonly target: Agent.AnyDefinition;\n readonly after?: number;\n }) => Stream.Stream<WorkerHistoryEntry, WorkerError>;\n /** Interrupting this wait never requests cancellation of accepted work. */\n readonly await: (\n request: WorkerReceiptRequest,\n ) => Effect.Effect<WorkerObservation, WorkerError>;\n readonly list: (request: {\n readonly delegationId: DelegationId;\n readonly target: Agent.AnyDefinition;\n readonly limit: number;\n readonly after?: ThreadId;\n }) => Effect.Effect<WorkerPage, WorkerError>;\n /** Cancel exactly this Receipt; preserve JoinedToHost without broadening its target. */\n readonly cancel: (\n request: WorkerReceiptRequest,\n ) => Effect.Effect<void, WorkerError | JoinedToHost>;\n }\n>()(\"@effect-agent/engine/SubagentHost\") {\n static readonly unavailable: SubagentHost[\"Service\"] = {\n context: WorkerError.make({ operation: \"context\", reason: \"unavailable\" }),\n resolveTargetPolicy: () => WorkerError.make({ operation: \"start\", reason: \"unavailable\" }),\n start: () => WorkerError.make({ operation: \"start\", reason: \"unavailable\" }),\n followUp: () => WorkerError.make({ operation: \"followUp\", reason: \"unavailable\" }),\n inspect: () => WorkerError.make({ operation: \"inspect\", reason: \"unavailable\" }),\n summary: () => WorkerError.make({ operation: \"inspect\", reason: \"unavailable\" }),\n observe: () => Stream.fail(WorkerError.make({ operation: \"observe\", reason: \"unavailable\" })),\n await: () => WorkerError.make({ operation: \"await\", reason: \"unavailable\" }),\n list: () => WorkerError.make({ operation: \"list\", reason: \"unavailable\" }),\n cancel: () => WorkerError.make({ operation: \"cancel\", reason: \"unavailable\" }),\n };\n\n /** Runtime-owned per-call binding. Unconfigured Runs deny background operations. */\n static readonly forTool = Context.Reference<\n (source: Extract<WorkerSource, { readonly _tag: \"tool\" }>) => SubagentHost[\"Service\"]\n >(\"@effect-agent/engine/SubagentHost/forTool\", {\n defaultValue: () => () => SubagentHost.unavailable,\n });\n}\n"],"mappings":";;;;;;;;;;AAwFA,IAAa,iCAAb,cAAoD,OAAO,YAA4C,CAAC,CACtG,kCACA,EAAE,OAAO,OAAO,SAAS;CAAC;CAAc;CAAS;AAAa,CAAC,EAAE,CACnE,CAAC,CAAC,CAAC;;AA8BH,MAAa,sBAAsB,QAAQ,UAEzC,4CAA4C,EAAE,oBAAoB,KAAA,EAAU,CAAC;;;;;;AAO/E,IAAa,eAAb,MAAa,qBAAqB,QAAQ,QA0CxC,CAAC,CAAC,mCAAmC,CAAC,CAAC;CACvC,OAAgB,cAAuC;EACrD,SAAS,YAAY,KAAK;GAAE,WAAW;GAAW,QAAQ;EAAc,CAAC;EACzE,2BAA2B,YAAY,KAAK;GAAE,WAAW;GAAS,QAAQ;EAAc,CAAC;EACzF,aAAa,YAAY,KAAK;GAAE,WAAW;GAAS,QAAQ;EAAc,CAAC;EAC3E,gBAAgB,YAAY,KAAK;GAAE,WAAW;GAAY,QAAQ;EAAc,CAAC;EACjF,eAAe,YAAY,KAAK;GAAE,WAAW;GAAW,QAAQ;EAAc,CAAC;EAC/E,eAAe,YAAY,KAAK;GAAE,WAAW;GAAW,QAAQ;EAAc,CAAC;EAC/E,eAAe,OAAO,KAAK,YAAY,KAAK;GAAE,WAAW;GAAW,QAAQ;EAAc,CAAC,CAAC;EAC5F,aAAa,YAAY,KAAK;GAAE,WAAW;GAAS,QAAQ;EAAc,CAAC;EAC3E,YAAY,YAAY,KAAK;GAAE,WAAW;GAAQ,QAAQ;EAAc,CAAC;EACzE,cAAc,YAAY,KAAK;GAAE,WAAW;GAAU,QAAQ;EAAc,CAAC;CAC/E;;CAGA,OAAgB,UAAU,QAAQ,UAEhC,6CAA6C,EAC7C,0BAA0B,aAAa,YACzC,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"SubagentHost.mjs","names":[],"sources":["../../src/engine/SubagentHost.ts"],"sourcesContent":["import type { Effect, Option } from \"effect\";\nimport { Context, Schema, Stream } from \"effect\";\n\nimport type * as Agent from \"../core/Agent.ts\";\nimport type { AgentPolicy } from \"../core/AgentPolicy.ts\";\nimport type * as FailureDiagnostic from \"../core/FailureDiagnostic.ts\";\nimport type { DelegationId, RunId, SettlementId, ThreadId } from \"../core/Identifiers.ts\";\nimport type { MessageRef, MessageStatus } from \"../core/Messaging.ts\";\nimport { type IdempotencyKey, type JoinedToHost, type Receipt } from \"../core/Receipt.ts\";\nimport type { SubagentBudgetReservation } from \"../core/SubagentContract.ts\";\nimport {\n WorkerError,\n type WorkerStop,\n type WorkerStopped,\n type WorkerCompletion,\n type WorkerHistoryEntry,\n type WorkerContext,\n type WorkerBudgetScope,\n type WorkerSource,\n type WorkerPage,\n type WorkerRef,\n type WorkerStarted,\n type WorkerSummary,\n} from \"../core/Worker.ts\";\n\n/** Prepared values cross this port only to be Schema-decoded before durable storage. */\nexport interface StartWorkerRequest {\n readonly delegationId: DelegationId;\n readonly target: Agent.AnyDefinition;\n readonly idempotencyKey: IdempotencyKey;\n readonly encodedInput: unknown;\n readonly encodedParameters: unknown;\n readonly policy: AgentPolicy;\n readonly budget: SubagentBudgetReservation;\n readonly encodedGrant: unknown;\n readonly toolCallAllowance?: number;\n /** Author-owned request; the durable host must separately authorize worker-run funding. */\n readonly budgetScope?: WorkerBudgetScope;\n}\n\n/**\n * First-admission preparation stays lazy until the owner authorizes the caller and checks the\n * retained command. Replays compare declared parameters/options and reuse the original capture.\n * Prepared policy, budget, and allowance are frozen first-admission configuration, not replay\n * arguments; changing them requires a new command key. Current caller authorization still applies.\n * Preparation must be free of external effects: concurrent first admissions can prepare before\n * the retained delivery chooses its first writer.\n */\nexport interface DeferredStartWorkerRequest<E = never, R = never> extends Pick<\n StartWorkerRequest,\n | \"delegationId\"\n | \"target\"\n | \"idempotencyKey\"\n | \"encodedParameters\"\n | \"encodedGrant\"\n | \"budgetScope\"\n> {\n readonly prepare: Effect.Effect<\n Pick<StartWorkerRequest, \"encodedInput\" | \"policy\" | \"budget\" | \"toolCallAllowance\">,\n E,\n R\n >;\n}\n\nexport interface FollowUpWorkerRequest {\n readonly worker: WorkerRef;\n readonly target: Agent.AnyDefinition;\n readonly idempotencyKey: IdempotencyKey;\n readonly encodedInput: unknown;\n readonly encodedParameters: unknown;\n}\n\nexport interface WorkerReceiptRequest {\n readonly worker: WorkerRef;\n readonly target: Agent.AnyDefinition;\n readonly receipt: Receipt;\n}\n\nexport interface WorkerMessageRequest {\n readonly worker: WorkerRef;\n readonly target: Agent.AnyDefinition;\n readonly message: MessageRef;\n}\n\n/**\n * Canonical terminal values remain encoded until the capability decodes the saved parameters\n * and target output and applies its declared result projection. Child E does not survive settlement.\n */\nexport type WorkerObservation =\n | { readonly _tag: \"Pending\"; readonly receipt: Receipt }\n | {\n readonly _tag: \"Settled\";\n readonly receipt: Receipt;\n /** Absent when an input failed or was cancelled before any Run started. */\n readonly runId?: RunId;\n readonly settlementId: SettlementId;\n readonly outcome: \"completed\" | \"failed\" | \"aborted\";\n readonly encodedParameters: unknown;\n readonly encodedResult: unknown;\n /** Operator-private failed-settlement evidence; never part of a model Tool result. */\n readonly diagnostic?: FailureDiagnostic.Failure;\n readonly budgetExhausted: boolean;\n };\n\n/** One actual canonical Run, independent of how many input Receipts joined it. */\nexport interface WorkerRunReport {\n readonly worker: WorkerRef;\n readonly context: WorkerContext;\n readonly observation: Extract<WorkerObservation, { readonly _tag: \"Settled\" }> & {\n readonly runId: RunId;\n };\n}\n\n/** A bounded projection failure; raw application errors never enter durable report records. */\nexport class WorkerReportPreparationFailure extends Schema.TaggedError<WorkerReportPreparationFailure>()(\n \"WorkerReportPreparationFailure\",\n { stage: Schema.Literals([\"projection\", \"input\", \"preparation\"]) },\n) {}\n\n/**\n * Source-owned standard projection discovered from background tools.\n * The concrete descriptor retains its E/R; durable registration captures R and records\n * bounded preparation failure rather than serializing arbitrary application errors.\n */\nexport interface WorkerReporting<E = never, R = never> {\n readonly delegationId: DelegationId;\n readonly target: Agent.AnyDefinition;\n readonly prepare: (report: WorkerRunReport) => Effect.Effect<\n {\n readonly message: WorkerCompletion;\n },\n E | WorkerReportPreparationFailure,\n R\n >;\n}\n\n/** Descriptor carried by background tools; registration discovers it without an app handoff. */\nexport const BackgroundReporting = Context.Reference<\n WorkerReporting<WorkerReportPreparationFailure> | undefined\n>(\"@effect-agent/engine/BackgroundReporting\", { defaultValue: () => undefined });\n\n/**\n * Trusted, caller-bound host port. The interpreter supplies a fresh facet for each Tool Call;\n * programmatic callers acquire a separately authorized Thread facet. Request values cannot\n * choose the source identity, replace worker provenance or expand its authority and budgets.\n */\nexport class SubagentHost extends Context.Service<\n SubagentHost,\n {\n readonly context: Effect.Effect<WorkerContext, WorkerError>;\n /** Resolve prepared input through host authority; None retains legacy target inheritance. */\n readonly resolveTargetPolicy: (request: {\n readonly target: Agent.AnyDefinition;\n readonly encodedInput: unknown;\n }) => Effect.Effect<Option.Option<AgentPolicy>, WorkerError>;\n /** Prepared callers retain strict input/policy conflicts; deferred callers replay the saved capture. */\n readonly start: <E = never, R = never>(\n request: StartWorkerRequest | DeferredStartWorkerRequest<E, R>,\n ) => Effect.Effect<WorkerStarted, WorkerError | E, R>;\n readonly followUp: (\n request: FollowUpWorkerRequest,\n ) => Effect.Effect<MessageStatus, WorkerError>;\n readonly inspect: (\n request: WorkerReceiptRequest | WorkerMessageRequest,\n ) => Effect.Effect<WorkerObservation | MessageStatus, WorkerError>;\n /** Inspect the continuing worker using the same summary contract as discovery. */\n readonly summary: (request: {\n readonly worker: WorkerRef;\n readonly target: Agent.AnyDefinition;\n }) => Effect.Effect<WorkerSummary, WorkerError>;\n /** A finite snapshot through the captured tail; resume with the last sequence as `after`. */\n readonly observe: (request: {\n readonly worker: WorkerRef;\n readonly target: Agent.AnyDefinition;\n readonly after?: number;\n }) => Stream.Stream<WorkerHistoryEntry, WorkerError>;\n /** Interrupting this wait never requests cancellation of accepted work. */\n readonly await: (\n request: WorkerReceiptRequest,\n ) => Effect.Effect<WorkerObservation, WorkerError>;\n readonly list: (request: {\n readonly delegationId: DelegationId;\n readonly target: Agent.AnyDefinition;\n readonly limit: number;\n readonly after?: ThreadId;\n }) => Effect.Effect<WorkerPage, WorkerError>;\n /** Seal the whole worker; retries reconcile the same command, including a lost acknowledgement. */\n readonly stop: (\n request: WorkerStop & { readonly target: Agent.AnyDefinition },\n ) => Effect.Effect<WorkerStopped, WorkerError>;\n /** Cancel exactly this Receipt; preserve JoinedToHost without broadening its target. */\n readonly cancel: (\n request: WorkerReceiptRequest,\n ) => Effect.Effect<void, WorkerError | JoinedToHost>;\n }\n>()(\"@effect-agent/engine/SubagentHost\") {\n static readonly unavailable: SubagentHost[\"Service\"] = {\n context: WorkerError.make({ operation: \"context\", reason: \"unavailable\" }),\n resolveTargetPolicy: () => WorkerError.make({ operation: \"start\", reason: \"unavailable\" }),\n start: () => WorkerError.make({ operation: \"start\", reason: \"unavailable\" }),\n followUp: () => WorkerError.make({ operation: \"followUp\", reason: \"unavailable\" }),\n inspect: () => WorkerError.make({ operation: \"inspect\", reason: \"unavailable\" }),\n summary: () => WorkerError.make({ operation: \"inspect\", reason: \"unavailable\" }),\n observe: () => Stream.fail(WorkerError.make({ operation: \"observe\", reason: \"unavailable\" })),\n await: () => WorkerError.make({ operation: \"await\", reason: \"unavailable\" }),\n list: () => WorkerError.make({ operation: \"list\", reason: \"unavailable\" }),\n stop: () => WorkerError.make({ operation: \"stop\", reason: \"unavailable\" }),\n cancel: () => WorkerError.make({ operation: \"cancel\", reason: \"unavailable\" }),\n };\n\n /** Runtime-owned per-call binding. Unconfigured Runs deny background operations. */\n static readonly forTool = Context.Reference<\n (source: Extract<WorkerSource, { readonly _tag: \"tool\" }>) => SubagentHost[\"Service\"]\n >(\"@effect-agent/engine/SubagentHost/forTool\", {\n defaultValue: () => () => Subagent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exports } from "./FailureDiagnostic-CaAkzGHL.m
|
|
|
20
20
|
import { i as AgentError_d_exports } from "./AgentError-Bn1ytXRD.mjs";
|
|
21
21
|
import { r as ToolResult_d_exports } from "./ToolResult-BKdqWRff.mjs";
|
|
22
22
|
import { r as AgentPolicy_d_exports } from "./AgentPolicy-BqDoSXO6.mjs";
|
|
23
|
-
import { t as Agent_d_exports } from "./Agent-
|
|
23
|
+
import { t as Agent_d_exports } from "./Agent-D9cXqfF3.mjs";
|
|
24
24
|
import { c as MemoryReference_d_exports } from "./MemoryReference-B8Q3UJoJ.mjs";
|
|
25
25
|
import { n as RunPolicyUsage_d_exports } from "./RunPolicyUsage-ClZxyR46.mjs";
|
|
26
|
-
import {
|
|
26
|
+
import { x as Worker_d_exports } from "./Worker-fwWkBg12.mjs";
|
|
27
27
|
import { s as ContextWindow_d_exports } from "./ContextWindow-DRQ5Mbm2.mjs";
|
|
28
28
|
import { s as ContextCompactor_d_exports } from "./ContextCompactor-WwSIG_Z2.mjs";
|
|
29
29
|
import { i as DurableStep_d_exports } from "./DurableStep-Cry_iol4.mjs";
|
|
30
|
-
import { F as RunOptions_d_exports } from "./RunOptions-
|
|
30
|
+
import { F as RunOptions_d_exports } from "./RunOptions-CSBsSj0X.mjs";
|
|
31
31
|
import { t as Commands_d_exports } from "./capabilities/Commands.mjs";
|
|
32
32
|
import { t as ContextHistory_d_exports } from "./engine/ContextHistory.mjs";
|
|
33
33
|
import { t as ContextTools_d_exports } from "./capabilities/ContextTools.mjs";
|
|
@@ -36,8 +36,8 @@ import { t as McpClient_d_exports } from "./capabilities/McpClient.mjs";
|
|
|
36
36
|
import { i as MemoryNamespace_d_exports } from "./MemoryNamespace-BbRW5p71.mjs";
|
|
37
37
|
import { t as MemoryStore_d_exports } from "./core/MemoryStore.mjs";
|
|
38
38
|
import { t as MemoryNotes_d_exports } from "./capabilities/MemoryNotes.mjs";
|
|
39
|
-
import { n as MessagingHost_d_exports } from "./MessagingHost-
|
|
40
|
-
import { t as Messaging_d_exports } from "./Messaging-
|
|
39
|
+
import { n as MessagingHost_d_exports } from "./MessagingHost-CqzpxbGz.mjs";
|
|
40
|
+
import { t as Messaging_d_exports } from "./Messaging-JYYN3oYS.mjs";
|
|
41
41
|
import { t as ModelContext_d_exports } from "./capabilities/ModelContext.mjs";
|
|
42
42
|
import { t as RememberingStore_d_exports } from "./core/RememberingStore.mjs";
|
|
43
43
|
import { t as Remembering_d_exports } from "./capabilities/Remembering.mjs";
|
|
@@ -46,28 +46,28 @@ import { t as MemoryRevalidation_d_exports } from "./core/MemoryRevalidation.mjs
|
|
|
46
46
|
import { t as SemanticMemoryIndex_d_exports } from "./core/SemanticMemoryIndex.mjs";
|
|
47
47
|
import { t as SemanticMemoryRevalidation_d_exports } from "./core/SemanticMemoryRevalidation.mjs";
|
|
48
48
|
import { t as SemanticMemory_d_exports } from "./capabilities/SemanticMemory.mjs";
|
|
49
|
-
import {
|
|
50
|
-
import { t as AgentRuntime_d_exports } from "./AgentRuntime-
|
|
49
|
+
import { o as SubagentHost_d_exports } from "./SubagentHost-P9zB_TfV.mjs";
|
|
50
|
+
import { t as AgentRuntime_d_exports } from "./AgentRuntime-DyZv8uu2.mjs";
|
|
51
51
|
import { i as RunEventSink_d_exports } from "./RunEventSink-D5aVhISG.mjs";
|
|
52
|
-
import { v as Subagent_d_exports } from "./Subagent-
|
|
52
|
+
import { v as Subagent_d_exports } from "./Subagent-gw9KD6eb.mjs";
|
|
53
53
|
import { t as ToolDiscovery_d_exports } from "./capabilities/ToolDiscovery.mjs";
|
|
54
54
|
import { D as PageCapture_d_exports } from "./PageCapture-Df8Xwskw.mjs";
|
|
55
55
|
import { t as WebCapture_d_exports } from "./capabilities/WebCapture.mjs";
|
|
56
56
|
import { t as WebSearch_d_exports } from "./capabilities/WebSearch.mjs";
|
|
57
57
|
import { t as IdGenerator_d_exports } from "./core/IdGenerator.mjs";
|
|
58
58
|
import { t as Memory_d_exports } from "./core/Memory.mjs";
|
|
59
|
-
import {
|
|
60
|
-
import { t as DurableFailpoint_d_exports } from "./DurableFailpoint-
|
|
59
|
+
import { Bn as RunJournal_d_exports, Br as Admin_d_exports, Co as SubmissionLedger_d_exports, Fn as SubmissionStatus_d_exports, N as Records_d_exports, Qi as Recovery_d_exports, Si as Digest_d_exports, li as AgentRegistration_d_exports, wn as ThreadStore_d_exports, yt as DurableAgentRuntime_d_exports } from "./Records-Byeb70tt.mjs";
|
|
60
|
+
import { t as DurableFailpoint_d_exports } from "./DurableFailpoint-Cnr3wx1L.mjs";
|
|
61
61
|
import { a as OperationAuthorizer_d_exports } from "./OperationAuthorizer-TzcQtpX5.mjs";
|
|
62
62
|
import { l as ToolReconciler_d_exports } from "./ToolReconciler-BmVRAHKs.mjs";
|
|
63
63
|
import { n as WakeScheduler_d_exports } from "./WakeScheduler-EjUF-GhC.mjs";
|
|
64
64
|
import { t as ActivityStore_d_exports } from "./durable/ActivityStore.mjs";
|
|
65
65
|
import { t as CommittedActivity_d_exports } from "./durable/CommittedActivity.mjs";
|
|
66
|
-
import { R as Schedule_d_exports } from "./Schedule-
|
|
67
|
-
import { k as Subscription_d_exports } from "./Subscription-
|
|
68
|
-
import { n as EventSource_d_exports } from "./EventSource-
|
|
69
|
-
import { n as PreparedInputAdmission_d_exports } from "./PreparedInputAdmission-
|
|
70
|
-
import { r as SubscriptionInput_d_exports } from "./SubscriptionInput-
|
|
66
|
+
import { R as Schedule_d_exports } from "./Schedule-krSnBcbU.mjs";
|
|
67
|
+
import { k as Subscription_d_exports } from "./Subscription-Xnwd42Sm.mjs";
|
|
68
|
+
import { n as EventSource_d_exports } from "./EventSource-DPRdlvhV.mjs";
|
|
69
|
+
import { n as PreparedInputAdmission_d_exports } from "./PreparedInputAdmission-DqQUjA9k.mjs";
|
|
70
|
+
import { r as SubscriptionInput_d_exports } from "./SubscriptionInput-CqtJ58vl.mjs";
|
|
71
71
|
import { t as Subscriptions_d_exports } from "./durable/Subscriptions.mjs";
|
|
72
72
|
import { t as MessageDelivery_d_exports } from "./durable/MessageDelivery.mjs";
|
|
73
73
|
import { t as PersistentHistory_d_exports } from "./durable/PersistentHistory.mjs";
|
|
@@ -83,7 +83,7 @@ import { t as ThreadProjection_d_exports } from "./durable/ThreadProjection.mjs"
|
|
|
83
83
|
import { t as ThreadProjectionMaintenance_d_exports } from "./durable/ThreadProjectionMaintenance.mjs";
|
|
84
84
|
import { t as WorkerHost_d_exports } from "./durable/WorkerHost.mjs";
|
|
85
85
|
import { t as Compaction_d_exports } from "./engine/Compaction.mjs";
|
|
86
|
-
import { t as Output_d_exports } from "./Output-
|
|
86
|
+
import { t as Output_d_exports } from "./Output-V-6YL1_Z.mjs";
|
|
87
87
|
import { c as PageScreenshot_d_exports } from "./PageScreenshot-BpgZKAxl.mjs";
|
|
88
88
|
import { t as InteractiveBrowser_d_exports } from "./sandbox/InteractiveBrowser.mjs";
|
|
89
89
|
import { t as PageCrawl_d_exports } from "./sandbox/PageCrawl.mjs";
|
package/dist/index.mjs
CHANGED
|
@@ -10,12 +10,12 @@ import { t as IdGenerator_exports } from "./core/IdGenerator.mjs";
|
|
|
10
10
|
import { t as SubagentContract_exports } from "./core/SubagentContract.mjs";
|
|
11
11
|
import { t as Usage_exports } from "./core/Usage.mjs";
|
|
12
12
|
import { t as RunEvent_exports } from "./core/RunEvent.mjs";
|
|
13
|
-
import {
|
|
14
|
-
import { n as MessagingHost_exports } from "./MessagingHost-
|
|
13
|
+
import { x as Worker_exports } from "./Worker-CfwzMZEK.mjs";
|
|
14
|
+
import { n as MessagingHost_exports } from "./MessagingHost-DfsbMPvq.mjs";
|
|
15
15
|
import { t as SubagentHost_exports } from "./engine/SubagentHost.mjs";
|
|
16
16
|
import { t as Thread_exports } from "./core/Thread.mjs";
|
|
17
17
|
import { t as ThreadHistory_exports } from "./engine/ThreadHistory.mjs";
|
|
18
|
-
import { t as AgentRuntime_exports } from "./AgentRuntime-
|
|
18
|
+
import { t as AgentRuntime_exports } from "./AgentRuntime-Cp1hAb-W.mjs";
|
|
19
19
|
import { t as ContextWindow_exports } from "./engine/ContextWindow.mjs";
|
|
20
20
|
import { t as DurableStep_exports } from "./engine/DurableStep.mjs";
|
|
21
21
|
import { t as ContextCompactor_exports } from "./engine/ContextCompactor.mjs";
|
|
@@ -57,7 +57,7 @@ import { t as RunHooks_exports } from "./capabilities/RunHooks.mjs";
|
|
|
57
57
|
import { t as SemanticMemoryIndex_exports } from "./core/SemanticMemoryIndex.mjs";
|
|
58
58
|
import { t as SemanticMemoryRevalidation_exports } from "./core/SemanticMemoryRevalidation.mjs";
|
|
59
59
|
import { t as SemanticMemory_exports } from "./capabilities/SemanticMemory.mjs";
|
|
60
|
-
import { r as Subagent_exports } from "./Subagent-
|
|
60
|
+
import { r as Subagent_exports } from "./Subagent-Di8EEjWZ.mjs";
|
|
61
61
|
import { t as ToolDiscovery_exports } from "./capabilities/ToolDiscovery.mjs";
|
|
62
62
|
import { t as ToolExposure_exports } from "./ToolExposure.mjs";
|
|
63
63
|
import { t as WebCapture_exports } from "./capabilities/WebCapture.mjs";
|
|
@@ -69,7 +69,7 @@ import { t as Recovery_exports } from "./durable/Recovery.mjs";
|
|
|
69
69
|
import { t as Admin_exports } from "./durable/Admin.mjs";
|
|
70
70
|
import { t as Digest_exports } from "./durable/Digest.mjs";
|
|
71
71
|
import { t as AgentRegistration_exports } from "./durable/AgentRegistration.mjs";
|
|
72
|
-
import { n as DurableAgentRuntime_exports } from "./DurableAgentRuntime-
|
|
72
|
+
import { n as DurableAgentRuntime_exports } from "./DurableAgentRuntime-tNrkJZNo.mjs";
|
|
73
73
|
import { n as RunJournal_exports } from "./RunJournal-BXrq0VIK.mjs";
|
|
74
74
|
import { t as ThreadStore_exports } from "./durable/ThreadStore.mjs";
|
|
75
75
|
import { t as CommittedActivity_exports } from "./durable/CommittedActivity.mjs";
|