@yielded/agent 0.1.0-beta.174 → 0.1.0-beta.175
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Admin-BHmp2V9p.d.mts → Admin-Qa3I1oA5.d.mts} +38 -7
- package/dist/{AgentRuntime-BD3ZHAMq.d.mts → AgentRuntime-CHDyRbSf.d.mts} +3 -3
- package/dist/{AgentRuntime-B6qZlD3f.mjs → AgentRuntime-DaDKMasp.mjs} +123 -114
- package/dist/AgentRuntime-DaDKMasp.mjs.map +1 -0
- package/dist/{Digest-EpeqWEdv.mjs → Digest-C3EODOee.mjs} +2 -2
- package/dist/{Digest-EpeqWEdv.mjs.map → Digest-C3EODOee.mjs.map} +1 -1
- package/dist/{DurableAgentRuntime-CBBjRNJN.mjs → DurableAgentRuntime-CPlw5_7e.mjs} +161 -85
- package/dist/DurableAgentRuntime-CPlw5_7e.mjs.map +1 -0
- package/dist/{EventSource-C9aaJaXT.d.mts → EventSource-BTu68yDW.d.mts} +2 -2
- package/dist/InMemory.d.mts +2 -2
- package/dist/{MessageDelivery-BGDm-c46.d.mts → MessageDelivery-DjAZJ4Fd.d.mts} +4 -4
- package/dist/{MessagingHost-CRUK4JBi.mjs → MessagingHost-CZCyrnvJ.mjs} +27 -26
- package/dist/MessagingHost-CZCyrnvJ.mjs.map +1 -0
- package/dist/{PreparedInputAdmission-BvDqlgiP.d.mts → PreparedInputAdmission-wgY4JMZY.d.mts} +3 -3
- package/dist/{Records-BiuJDWNe.mjs → Records-DzL4Kbtw.mjs} +2 -2
- package/dist/{Records-BiuJDWNe.mjs.map → Records-DzL4Kbtw.mjs.map} +1 -1
- package/dist/{RunContinuation-CTJ1jGrO.d.mts → RunContinuation-3jB5pULC.d.mts} +10 -4
- package/dist/{RunContinuation-4ZATcVLB.mjs → RunContinuation-BiyKJK32.mjs} +74 -40
- package/dist/RunContinuation-BiyKJK32.mjs.map +1 -0
- package/dist/{RunJournal-CNZqA3Ge.mjs → RunJournal-CPMKcfd0.mjs} +84 -79
- package/dist/RunJournal-CPMKcfd0.mjs.map +1 -0
- package/dist/{RunStorage-BHjuuERI.mjs → RunStorage-CzutHJBE.mjs} +3 -2
- package/dist/RunStorage-CzutHJBE.mjs.map +1 -0
- package/dist/{Scheduling-NG8slKdI.mjs → Scheduling-07_dsGED.mjs} +3 -3
- package/dist/{Scheduling-NG8slKdI.mjs.map → Scheduling-07_dsGED.mjs.map} +1 -1
- package/dist/{Subagent-CTIpnzlB.mjs → Subagent-CexndZSp.mjs} +2 -2
- package/dist/{Subagent-CTIpnzlB.mjs.map → Subagent-CexndZSp.mjs.map} +1 -1
- package/dist/{Subagent-DKhZA72u.d.mts → Subagent-xhN_aD1r.d.mts} +3 -3
- package/dist/{Subscription-BNg9VCRl.d.mts → Subscription-DmIHlOJK.d.mts} +2 -2
- package/dist/{SubscriptionInput-BUoXv-_K.d.mts → SubscriptionInput-DgcQhvbe.d.mts} +2 -2
- package/dist/{Thread-dk-QiNml.d.mts → Thread-DzdJAY4J.d.mts} +4 -3
- package/dist/{ThreadHistory-ByxS8HU1.d.mts → ThreadHistory-KPPBJLJb.d.mts} +12 -2
- package/dist/{ThreadImport-CodYoJoa.mjs → ThreadImport-CjlG57vH.mjs} +8 -8
- package/dist/{ThreadImport-CodYoJoa.mjs.map → ThreadImport-CjlG57vH.mjs.map} +1 -1
- package/dist/{ThreadImport-CMgzttvr.d.mts → ThreadImport-DP-vOk2F.d.mts} +4 -4
- package/dist/{ThreadStore-59uDGXul.mjs → ThreadStore-EuUilthA.mjs} +5 -7
- package/dist/ThreadStore-EuUilthA.mjs.map +1 -0
- package/dist/{ThreadTransfer-3jigUl3g.mjs → ThreadTransfer-DB_zsrtJ.mjs} +4 -4
- package/dist/{ThreadTransfer-3jigUl3g.mjs.map → ThreadTransfer-DB_zsrtJ.mjs.map} +1 -1
- package/dist/{WorkerAdmission-DDYJdOsU.mjs → WorkerAdmission-eBeXt_mu.mjs} +5 -5
- package/dist/{WorkerAdmission-DDYJdOsU.mjs.map → WorkerAdmission-eBeXt_mu.mjs.map} +1 -1
- package/dist/{agent-registration-DRbyhAu-.mjs → agent-registration-a6QYaG3h.mjs} +4 -4
- package/dist/{agent-registration-DRbyhAu-.mjs.map → agent-registration-a6QYaG3h.mjs.map} +1 -1
- package/dist/capabilities/Messaging.mjs +1 -1
- package/dist/capabilities/ModelContext.d.mts +1 -1
- package/dist/capabilities/RunHooks.d.mts +1 -1
- package/dist/capabilities/Subagent.d.mts +1 -1
- package/dist/capabilities/Subagent.mjs +1 -1
- package/dist/core/Thread.d.mts +2 -2
- package/dist/core/Thread.mjs +5 -3
- package/dist/core/Thread.mjs.map +1 -1
- package/dist/durable/ActivityStore.mjs +1 -1
- package/dist/durable/Admin.d.mts +1 -1
- package/dist/durable/Admin.mjs +1 -1
- package/dist/durable/AgentRegistration.d.mts +1 -1
- package/dist/durable/AgentRegistration.mjs +1 -1
- package/dist/durable/Certification.d.mts +1 -1
- package/dist/durable/CommittedActivity.d.mts +1 -1
- package/dist/durable/CommittedActivity.mjs +3 -3
- package/dist/durable/Digest.mjs +1 -1
- package/dist/durable/DurableAgentRuntime.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.mjs +2 -2
- package/dist/durable/EventSource.d.mts +1 -1
- package/dist/durable/EventSource.mjs +1 -1
- package/dist/durable/GitHubWorkflowSource.d.mts +3 -3
- package/dist/durable/LifecyclePublication.d.mts +1 -1
- package/dist/durable/LifecyclePublication.mjs +2 -2
- package/dist/durable/MessageDelivery.d.mts +1 -1
- package/dist/durable/MessageDelivery.mjs +2 -2
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +40 -40
- package/dist/durable/MessageDeliveryStoreConformance.mjs +2 -2
- package/dist/durable/PersistentHistory.d.mts +2 -2
- package/dist/durable/PersistentHistory.mjs +4 -4
- package/dist/durable/PreparedInputAdmission.d.mts +1 -1
- package/dist/durable/RecordFormat.mjs +1 -1
- package/dist/durable/Records.mjs +1 -1
- package/dist/durable/Recovery.d.mts +1 -1
- package/dist/durable/Recovery.mjs +1 -1
- package/dist/durable/RunContinuation.d.mts +2 -2
- package/dist/durable/RunContinuation.mjs +3 -3
- package/dist/durable/RunJournal.d.mts +2 -2
- package/dist/durable/RunJournal.mjs +2 -2
- package/dist/durable/RunStorage.d.mts +1 -1
- package/dist/durable/RunStorage.mjs +1 -1
- package/dist/durable/Schedule.mjs +1 -1
- package/dist/durable/ScheduleStoreConformance.mjs +1 -1
- package/dist/durable/ScheduleTransition.mjs +1 -1
- package/dist/durable/Scheduling.d.mts +1 -1
- package/dist/durable/Scheduling.mjs +1 -1
- package/dist/durable/SettlementPublisher.d.mts +1 -1
- package/dist/durable/SettlementPublisher.mjs +3 -3
- package/dist/durable/SqlMemoryStore.mjs +5 -3
- package/dist/durable/SqlMemoryStore.mjs.map +1 -1
- package/dist/durable/SubmissionLedger.d.mts +1 -1
- package/dist/durable/SubmissionLedger.mjs +7 -3
- package/dist/durable/SubmissionLedger.mjs.map +1 -1
- package/dist/durable/SubmissionLedgerConformance.d.mts +1 -1
- package/dist/durable/SubmissionLedgerConformance.mjs +6 -6
- package/dist/durable/SubmissionStatus.d.mts +1 -1
- package/dist/durable/Subscription.d.mts +1 -1
- package/dist/durable/Subscription.mjs +2 -2
- package/dist/durable/SubscriptionInput.d.mts +1 -1
- package/dist/durable/SubscriptionInput.mjs +2 -2
- package/dist/durable/SubscriptionStoreConformance.d.mts +1 -1
- package/dist/durable/SubscriptionStoreConformance.mjs +1 -1
- package/dist/durable/SubscriptionTools.d.mts +2 -2
- package/dist/durable/SubscriptionTransition.d.mts +1 -1
- package/dist/durable/SubscriptionTransition.mjs +1 -1
- package/dist/durable/Subscriptions.d.mts +5 -5
- package/dist/durable/Subscriptions.mjs +2 -2
- package/dist/durable/ThreadArchiveRange.d.mts +1 -1
- package/dist/durable/ThreadArchiveRange.mjs +1 -1
- package/dist/durable/ThreadContextHistory.d.mts +1 -1
- package/dist/durable/ThreadContextHistory.mjs +2 -2
- package/dist/durable/ThreadContextHistoryProjection.mjs +1 -1
- package/dist/durable/ThreadImport.d.mts +1 -1
- package/dist/durable/ThreadImport.mjs +1 -1
- package/dist/durable/ThreadInvariants.d.mts +3 -3
- package/dist/durable/ThreadInvariants.mjs +4 -4
- package/dist/durable/ThreadProjection.mjs +1 -1
- package/dist/durable/ThreadProjectionMaintenance.d.mts +1 -1
- package/dist/durable/ThreadReader.d.mts +1 -1
- package/dist/durable/ThreadReader.mjs +1 -1
- package/dist/durable/ThreadStore.d.mts +1 -1
- package/dist/durable/ThreadStore.mjs +2 -2
- package/dist/durable/ThreadStoreConformance.d.mts +1 -1
- package/dist/durable/ThreadStoreConformance.mjs +4 -4
- package/dist/durable/ThreadTransfer.d.mts +1 -1
- package/dist/durable/ThreadTransfer.mjs +1 -1
- package/dist/durable/ThreadWork.d.mts +2 -2
- package/dist/durable/ThreadWork.mjs +12 -6
- package/dist/durable/ThreadWork.mjs.map +1 -1
- package/dist/durable/ToolReconciler.mjs +1 -1
- package/dist/durable/WakeScheduler.mjs +23 -39
- package/dist/durable/WakeScheduler.mjs.map +1 -1
- package/dist/durable/WorkerAdmission.d.mts +1 -1
- package/dist/durable/WorkerAdmission.mjs +1 -1
- package/dist/durable/WorkerHost.d.mts +1 -1
- package/dist/engine/AgentRuntime.d.mts +1 -1
- package/dist/engine/AgentRuntime.mjs +1 -1
- package/dist/engine/MessagingHost.mjs +1 -1
- package/dist/engine/Output.mjs +1 -1
- package/dist/engine/ThreadHistory.d.mts +1 -1
- package/dist/engine/ThreadHistory.mjs +3 -2
- package/dist/engine/ThreadHistory.mjs.map +1 -1
- package/dist/index.d.mts +12 -12
- package/dist/index.mjs +13 -13
- package/dist/{output-contract-CMIhu4Cw.mjs → output-contract-DCnLYCdp.mjs} +12 -15
- package/dist/{output-contract-CMIhu4Cw.mjs.map → output-contract-DCnLYCdp.mjs.map} +1 -1
- package/dist/{run-context-reader-CC7ZD95F.d.mts → run-context-reader-DVhJZ1Qe.d.mts} +2 -2
- package/package.json +1 -1
- package/src/core/Thread.ts +143 -146
- package/src/durable/DurableAgentRuntime.ts +381 -206
- package/src/durable/RunContinuation.ts +113 -62
- package/src/durable/RunJournal.ts +99 -108
- package/src/durable/RunStorage.ts +7 -0
- package/src/durable/SqlMemoryStore.ts +8 -6
- package/src/durable/SubmissionLedger.ts +7 -0
- package/src/durable/ThreadStore.ts +9 -7
- package/src/durable/ThreadWork.ts +10 -0
- package/src/durable/WakeScheduler.ts +34 -66
- package/src/durable/internal/usage-totals.ts +28 -31
- package/src/engine/MessagingHost.ts +4 -2
- package/src/engine/ThreadHistory.ts +47 -48
- package/src/engine/internal/agent-runtime.ts +234 -202
- package/src/engine/internal/output-contract.ts +15 -15
- package/src/engine/internal/primitive-delta.ts +2 -3
- package/src/engine/internal/tool-telemetry.ts +3 -5
- package/dist/AgentRuntime-B6qZlD3f.mjs.map +0 -1
- package/dist/DurableAgentRuntime-CBBjRNJN.mjs.map +0 -1
- package/dist/MessagingHost-CRUK4JBi.mjs.map +0 -1
- package/dist/RunContinuation-4ZATcVLB.mjs.map +0 -1
- package/dist/RunJournal-CNZqA3Ge.mjs.map +0 -1
- package/dist/RunStorage-BHjuuERI.mjs.map +0 -1
- package/dist/ThreadStore-59uDGXul.mjs.map +0 -1
|
@@ -2,7 +2,7 @@ import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
|
2
2
|
import { IdempotencyKey } from "../core/Receipt.mjs";
|
|
3
3
|
import { WorkerOperationTool } from "../core/SubagentContract.mjs";
|
|
4
4
|
import { C as MessageStatus, S as MessageRef } from "../Worker-DZjdMjZn.mjs";
|
|
5
|
-
import { c as InboxPage, d as MessageAdmission, f as MessagingError, l as InputMessage, p as PeerName, s as InboxEntry, t as MessagingHost, u as MessageAddress } from "../MessagingHost-
|
|
5
|
+
import { c as InboxPage, d as MessageAdmission, f as MessagingError, l as InputMessage, p as PeerName, s as InboxEntry, t as MessagingHost, u as MessageAddress } from "../MessagingHost-CZCyrnvJ.mjs";
|
|
6
6
|
import { t as utf8Bytes } from "../utf8-B770uxC3.mjs";
|
|
7
7
|
import { Crypto, Effect, Option, Schema } from "effect";
|
|
8
8
|
import { Tool, Toolkit } from "effect/ai";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Thread } from "../Thread-
|
|
1
|
+
import { n as Thread } from "../Thread-DzdJAY4J.mjs";
|
|
2
2
|
import { Crypto, Effect, Schema } from "effect";
|
|
3
3
|
declare namespace ModelContext_d_exports {
|
|
4
4
|
export { CompactionArtifact, CompactionDigestError, ContextLimitExceeded, ContextTransform, ContextTransformError, InvalidCompactionArtifact, ModelContextMessage, PreparedModelContext, RetainedFact, applyCompaction, digestCompactionSource, prepareModelContext };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as ThreadLimitExceeded, d as ThreadOwnershipError, i as ThreadEncodingError, s as ThreadHistoryDiverged, t as Store, u as ThreadNotFound } from "../Thread-
|
|
1
|
+
import { c as ThreadLimitExceeded, d as ThreadOwnershipError, i as ThreadEncodingError, s as ThreadHistoryDiverged, t as Store, u as ThreadNotFound } from "../Thread-DzdJAY4J.mjs";
|
|
2
2
|
import { RedactionError, Redactor } from "./Redaction.mjs";
|
|
3
3
|
import { ApprovalAudit, ApprovalAuditLimitExceeded, ApprovalDecisionMismatch, ApprovalRequestDraft, ApprovalResolver, ApprovalResolverError } from "./Approval.mjs";
|
|
4
4
|
import { BudgetExceeded, UsageBudgetNode } from "./Budget.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { c as SubagentExecutionFailureClassification, l as SubagentGrant, s as SubagentExecutionFailure } from "../SubagentContract-DdPzxYQj.mjs";
|
|
2
2
|
import { o as WorkerCompletion, p as WorkerReport } from "../Worker-CHRaIsWu.mjs";
|
|
3
|
-
import { A as list, C as BackgroundTools, D as cancel, E as awaitWorker, F as SubagentPolicyInput, I as SubagentPrestartDenied, L as SubagentProjectionFailure, M as start, N as stop, O as followUp, P as SubagentPolicy, R as delegationAllocationFromPolicy, S as BackgroundOptions, T as WorkerObservation, _ as SubagentTools, a as SubagentDelegation, b as layer, c as SubagentFailureMode, d as SubagentResult, f as SubagentResultContext, g as SubagentToolFailure, h as SubagentTool, i as SubagentDefineOptions, j as observe, k as inspect, l as SubagentLayerRequirements, m as SubagentRuntimeOptions, n as SubagentContainedFailure, o as SubagentDurableAccounting, p as SubagentReturnModeFailure, r as SubagentDeclarationOptions, s as SubagentDurableOptions, t as SubagentChildRunFailure, u as SubagentPrepareContext, w as Worker, x as make, y as background, z as delegationCapsFromPolicy } from "../Subagent-
|
|
3
|
+
import { A as list, C as BackgroundTools, D as cancel, E as awaitWorker, F as SubagentPolicyInput, I as SubagentPrestartDenied, L as SubagentProjectionFailure, M as start, N as stop, O as followUp, P as SubagentPolicy, R as delegationAllocationFromPolicy, S as BackgroundOptions, T as WorkerObservation, _ as SubagentTools, a as SubagentDelegation, b as layer, c as SubagentFailureMode, d as SubagentResult, f as SubagentResultContext, g as SubagentToolFailure, h as SubagentTool, i as SubagentDefineOptions, j as observe, k as inspect, l as SubagentLayerRequirements, m as SubagentRuntimeOptions, n as SubagentContainedFailure, o as SubagentDurableAccounting, p as SubagentReturnModeFailure, r as SubagentDeclarationOptions, s as SubagentDurableOptions, t as SubagentChildRunFailure, u as SubagentPrepareContext, w as Worker, x as make, y as background, z as delegationCapsFromPolicy } from "../Subagent-xhN_aD1r.mjs";
|
|
4
4
|
export { type BackgroundOptions, type BackgroundTools, SubagentChildRunFailure, SubagentContainedFailure, SubagentDeclarationOptions, SubagentDefineOptions, SubagentDelegation, SubagentDurableAccounting, SubagentDurableOptions, SubagentExecutionFailure, SubagentExecutionFailureClassification, SubagentFailureMode, SubagentGrant, SubagentLayerRequirements, SubagentPolicy, type SubagentPolicyInput, SubagentPrepareContext, SubagentPrestartDenied, SubagentProjectionFailure, SubagentResult, SubagentResultContext, SubagentReturnModeFailure, SubagentRuntimeOptions, SubagentTool, SubagentToolFailure, SubagentTools, Worker, WorkerCompletion, WorkerObservation, WorkerReport, awaitWorker as await, background, cancel, delegationAllocationFromPolicy, delegationCapsFromPolicy, followUp, inspect, layer, list, make, observe, start, stop };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SubagentExecutionFailure, SubagentExecutionFailureClassification, SubagentGrant } from "../core/SubagentContract.mjs";
|
|
2
2
|
import { o as WorkerCompletion, p as WorkerReport } from "../Worker-DZjdMjZn.mjs";
|
|
3
3
|
import "./SubagentReservations.mjs";
|
|
4
|
-
import { _ as SubagentPolicy, a as layer, b as delegationAllocationFromPolicy, c as WorkerObservation, d as followUp, f as inspect, g as stop, h as start, i as background, l as awaitWorker, m as observe, n as SubagentResult, o as make, p as list, s as Worker, t as SubagentDurableAccounting, u as cancel, v as SubagentPrestartDenied, x as delegationCapsFromPolicy, y as SubagentProjectionFailure } from "../Subagent-
|
|
4
|
+
import { _ as SubagentPolicy, a as layer, b as delegationAllocationFromPolicy, c as WorkerObservation, d as followUp, f as inspect, g as stop, h as start, i as background, l as awaitWorker, m as observe, n as SubagentResult, o as make, p as list, s as Worker, t as SubagentDurableAccounting, u as cancel, v as SubagentPrestartDenied, x as delegationCapsFromPolicy, y as SubagentProjectionFailure } from "../Subagent-CexndZSp.mjs";
|
|
5
5
|
export { SubagentDurableAccounting, SubagentExecutionFailure, SubagentExecutionFailureClassification, SubagentGrant, SubagentPolicy, SubagentPrestartDenied, SubagentProjectionFailure, SubagentResult, Worker, WorkerCompletion, WorkerObservation, WorkerReport, awaitWorker as await, background, cancel, delegationAllocationFromPolicy, delegationCapsFromPolicy, followUp, inspect, layer, list, make, observe, start, stop };
|
package/dist/core/Thread.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ThreadError, c as ThreadLimitExceeded, d as ThreadOwnershipError, f as ThreadText,
|
|
2
|
-
export { Store, Thread, ThreadAppend, ThreadEncodingError, ThreadError, ThreadExport, ThreadHistoryDiverged, ThreadLimitExceeded, ThreadMessage, ThreadNotFound, ThreadOwnershipError, ThreadText, layerMemory, toPrompt };
|
|
1
|
+
import { a as ThreadError, c as ThreadLimitExceeded, d as ThreadOwnershipError, f as ThreadText, g as toPrompt, h as makeMemoryStore, i as ThreadEncodingError, l as ThreadMessage, m as layerMemory, n as Thread, o as ThreadExport, r as ThreadAppend, s as ThreadHistoryDiverged, t as Store, u as ThreadNotFound } from "../Thread-DzdJAY4J.mjs";
|
|
2
|
+
export { Store, Thread, ThreadAppend, ThreadEncodingError, ThreadError, ThreadExport, ThreadHistoryDiverged, ThreadLimitExceeded, ThreadMessage, ThreadNotFound, ThreadOwnershipError, ThreadText, layerMemory, makeMemoryStore, toPrompt };
|
package/dist/core/Thread.mjs
CHANGED
|
@@ -23,6 +23,7 @@ var Thread_exports = /* @__PURE__ */ __exportAll({
|
|
|
23
23
|
ThreadOwnershipError: () => ThreadOwnershipError,
|
|
24
24
|
ThreadText: () => ThreadText,
|
|
25
25
|
layerMemory: () => layerMemory,
|
|
26
|
+
makeMemoryStore: () => makeMemoryStore,
|
|
26
27
|
toPrompt: () => toPrompt
|
|
27
28
|
});
|
|
28
29
|
/** Bound applied to one text projection before it can enter a model context. */
|
|
@@ -161,7 +162,7 @@ const appendEncoded = Effect.fnUntraced(function* (state, owner, current, append
|
|
|
161
162
|
return [next, put(state, owner, next)];
|
|
162
163
|
});
|
|
163
164
|
/** In-memory storage shared for the consumer's Scope; it does not survive process loss. */
|
|
164
|
-
const
|
|
165
|
+
const makeMemoryStore = Effect.gen(function* () {
|
|
165
166
|
const state = yield* SynchronizedRef.make({
|
|
166
167
|
threads: /* @__PURE__ */ new Map(),
|
|
167
168
|
contentBytes: 0
|
|
@@ -275,8 +276,9 @@ const layerMemory = Layer.effect(Store, Effect.gen(function* () {
|
|
|
275
276
|
})
|
|
276
277
|
});
|
|
277
278
|
return view(root);
|
|
278
|
-
})
|
|
279
|
+
});
|
|
280
|
+
const layerMemory = Layer.effect(Store, makeMemoryStore);
|
|
279
281
|
//#endregion
|
|
280
|
-
export { Store, Thread, ThreadAppend, ThreadEncodingError, ThreadExport, ThreadHistoryDiverged, ThreadLimitExceeded, ThreadMessage, ThreadNotFound, ThreadOwnershipError, ThreadText, layerMemory, Thread_exports as t, toPrompt };
|
|
282
|
+
export { Store, Thread, ThreadAppend, ThreadEncodingError, ThreadExport, ThreadHistoryDiverged, ThreadLimitExceeded, ThreadMessage, ThreadNotFound, ThreadOwnershipError, ThreadText, layerMemory, makeMemoryStore, Thread_exports as t, toPrompt };
|
|
281
283
|
|
|
282
284
|
//# sourceMappingURL=Thread.mjs.map
|
package/dist/core/Thread.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Thread.mjs","names":[],"sources":["../../src/core/Thread.ts"],"sourcesContent":["import type { Scope } from \"effect\";\nimport * as Prompt from \"effect/ai/Prompt\";\nimport * as Clock from \"effect/Clock\";\nimport * as Context from \"effect/Context\";\nimport * as DateTime from \"effect/DateTime\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Schema from \"effect/Schema\";\nimport * as SynchronizedRef from \"effect/SynchronizedRef\";\n\nimport { ThreadId, RunId } from \"./Identifiers.ts\";\nimport { utf8ByteLength } from \"./internal/utf8.ts\";\n\n/** Bound applied to one text projection before it can enter a model context. */\nexport const ThreadText = Schema.String.check(Schema.isMaxLength(64 * 1024));\nconst MAX_MESSAGE_CONTENT_BYTES = 4 * 1024 * 1024;\nconst MAX_THREADS = 256;\nconst MAX_STORE_CONTENT_BYTES = 64 * 1024 * 1024;\n\n/** One append-only native Effect AI message in a conversation. */\nexport class ThreadMessage extends Schema.Class<ThreadMessage>(\n \"@effect-agent/capabilities/ThreadMessage\",\n)({\n threadId: ThreadId,\n sequence: Schema.Natural,\n runId: Schema.optionalKey(RunId),\n message: Prompt.Message,\n encodedBytes: Schema.Natural.check(Schema.isLessThanOrEqualTo(MAX_MESSAGE_CONTENT_BYTES)),\n timestamp: Schema.DateTimeUtcFromString,\n}) {}\n\n/** An identified, ordered conversation snapshot. Storage and execution recovery are separate concerns. */\nexport class Thread extends Schema.Class<Thread>(\"@effect-agent/capabilities/ThreadSnapshot\")({\n version: Schema.Literal(1),\n threadId: ThreadId,\n nextSequence: Schema.Natural,\n contentBytes: Schema.Natural,\n messages: Schema.Array(ThreadMessage),\n}) {}\n\n/** Portable conversation snapshot. Its format is independent of the durable execution journal. */\nexport class ThreadExport extends Schema.Class<ThreadExport>(\n \"@effect-agent/capabilities/ThreadExport\",\n)({\n format: Schema.Literal(\"effect-agent/ephemeral-thread@1\"),\n exportedAt: Schema.DateTimeUtcFromString,\n snapshot: Thread,\n}) {}\n\n/** Native message accepted by the append-only thread. */\nexport class ThreadAppend extends Schema.Class<ThreadAppend>(\n \"@effect-agent/capabilities/ThreadAppend\",\n)({\n runId: Schema.optionalKey(RunId),\n message: Prompt.Message,\n}) {}\n\n/** The requested Thread has not been created in this store. */\nexport class ThreadNotFound extends Schema.TaggedError<ThreadNotFound>()(\"ThreadNotFound\", {\n threadId: ThreadId,\n}) {}\n\n/** A message or the process-local host exceeded capacity; no bound counts a Thread's lifetime. */\nexport class ThreadLimitExceeded extends Schema.TaggedError<ThreadLimitExceeded>()(\n \"ThreadLimitExceeded\",\n {\n threadId: ThreadId,\n limit: Schema.Literals([\"content-bytes\", \"threads\", \"store-content-bytes\"]),\n limitValue: Schema.Natural,\n observedValue: Schema.Natural,\n },\n) {}\n\n/** Engine history was not an append-only extension of the official snapshot. */\nexport class ThreadHistoryDiverged extends Schema.TaggedError<ThreadHistoryDiverged>()(\n \"ThreadHistoryDiverged\",\n { threadId: ThreadId, message: Schema.String },\n) {}\n\n/** Native Prompt encoding failed before a bounded state mutation. */\nexport class ThreadEncodingError extends Schema.TaggedError<ThreadEncodingError>()(\n \"ThreadEncodingError\",\n { threadId: ThreadId, message: Schema.String },\n) {}\n\n/** A scoped view cannot access another owner's history or be used after closure. */\nexport class ThreadOwnershipError extends Schema.TaggedError<ThreadOwnershipError>()(\n \"ThreadOwnershipError\",\n { threadId: ThreadId, reason: Schema.Literals([\"closed\", \"foreign\"]), message: Schema.String },\n) {}\n\nexport type ThreadError =\n | ThreadNotFound\n | ThreadLimitExceeded\n | ThreadHistoryDiverged\n | ThreadEncodingError\n | ThreadOwnershipError;\n\n/** Reconstruct exact Effect AI Prompt history, including tools, reasoning, files, and options. */\nexport const toPrompt = (snapshot: Thread): Prompt.Prompt =>\n Prompt.fromMessages(snapshot.messages.map((entry) => entry.message));\n\n/**\n * Process-local state for conversation history. Updates remain visible even\n * when a Run later fails; this service has no successful-Run commit boundary or durable recovery.\n * ThreadHistory.layer uses this store for ordinary Runs and interactive history.\n * Scope closure releases all in-memory state.\n */\ninterface StoreService {\n /**\n * Acquire an isolated ownership view over this same bounded store. Newly created Threads\n * belong to the supplied Scope; closing it releases only that view's Threads and bytes.\n * Supplied by layerMemory; custom stores may omit this capability.\n * The view rejects foreign IDs and all access after closure. Keep its Scope open through\n * all users, including streams, child Runs, snapshots and history hooks.\n */\n readonly scoped?: Effect.Effect<StoreService, never, Scope.Scope>;\n readonly create: (\n threadId: ThreadId,\n ) => Effect.Effect<Thread, ThreadLimitExceeded | ThreadOwnershipError>;\n readonly append: (\n threadId: ThreadId,\n message: ThreadAppend,\n ) => Effect.Effect<\n Thread,\n ThreadNotFound | ThreadLimitExceeded | ThreadEncodingError | ThreadOwnershipError\n >;\n /**\n * Record an engine-emitted full history only when it is an append-only\n * extension of the exact official Prompt already stored. The entire\n * suffix commits in one transaction or not at all: concurrent writers are\n * serialized, a writer whose history no longer extends the committed\n * official history fails with ThreadHistoryDiverged, and a limit\n * failure inside the suffix records nothing. Earlier updates remain committed if the Run\n * later fails or is interrupted; this transaction covers one update, not the whole Run.\n */\n readonly recordHistory: (\n threadId: ThreadId,\n runId: RunId,\n history: Prompt.Prompt,\n ) => Effect.Effect<Thread, ThreadError>;\n readonly snapshot: (\n threadId: ThreadId,\n ) => Effect.Effect<Thread, ThreadNotFound | ThreadOwnershipError>;\n readonly export: (\n threadId: ThreadId,\n ) => Effect.Effect<ThreadExport, ThreadNotFound | ThreadOwnershipError>;\n}\n\n/** Process-local conversation store supplied by layerMemory. */\nexport class Store extends Context.Service<Store, StoreService>()(\n \"@effect-agent/capabilities/EphemeralThreads\",\n) {}\n\nconst encodeMessage = (\n threadId: ThreadId,\n message: Prompt.Message,\n): Effect.Effect<string, ThreadEncodingError> =>\n Schema.encodeEffect(Prompt.Message)(message).pipe(\n Effect.map((encoded) => JSON.stringify(encoded)),\n Effect.mapError((error) =>\n ThreadEncodingError.make({\n threadId,\n message: `Could not encode native Effect AI message: ${error.message}`,\n }),\n ),\n );\n\ninterface Owner {\n closed: boolean;\n readonly parent?: Owner;\n}\n\ninterface Entry {\n readonly snapshot: Thread;\n readonly owner: Owner;\n}\n\ninterface State {\n readonly threads: ReadonlyMap<ThreadId, Entry>;\n readonly contentBytes: number;\n}\n\nconst belongsTo = (owner: Owner, ancestor: Owner): boolean => {\n for (let current: Owner | undefined = owner; current !== undefined; current = current.parent) {\n if (current === ancestor) return true;\n }\n\n return false;\n};\n\nconst access = (state: State, owner: Owner, threadId: ThreadId) => {\n for (let current: Owner | undefined = owner; current !== undefined; current = current.parent) {\n if (current.closed) {\n return Effect.fail(\n ThreadOwnershipError.make({\n threadId,\n reason: \"closed\",\n message: \"The in-memory conversation owner is closed\",\n }),\n );\n }\n }\n const entry = state.threads.get(threadId);\n\n return entry !== undefined && entry.owner !== owner\n ? Effect.fail(\n ThreadOwnershipError.make({\n threadId,\n reason: \"foreign\",\n message: \"The Thread belongs to another in-memory conversation owner\",\n }),\n )\n : Effect.succeed(entry?.snapshot);\n};\n\nconst findSnapshot = Effect.fnUntraced(function* (state: State, owner: Owner, threadId: ThreadId) {\n const snapshot = yield* access(state, owner, threadId);\n\n return snapshot === undefined ? yield* ThreadNotFound.make({ threadId }) : snapshot;\n});\n\nconst put = (state: State, owner: Owner, snapshot: Thread): State => ({\n threads: new Map(state.threads).set(snapshot.threadId, { snapshot, owner }),\n contentBytes:\n state.contentBytes +\n snapshot.contentBytes -\n (state.threads.get(snapshot.threadId)?.snapshot.contentBytes ?? 0),\n});\n\nconst messageSize = (threadId: ThreadId, encoded: string) => {\n const observedValue = utf8ByteLength(encoded);\n\n return observedValue <= MAX_MESSAGE_CONTENT_BYTES\n ? Effect.succeed(observedValue)\n : Effect.fail(\n ThreadLimitExceeded.make({\n threadId,\n limit: \"content-bytes\",\n limitValue: MAX_MESSAGE_CONTENT_BYTES,\n observedValue,\n }),\n );\n};\n\nconst appendEncoded = Effect.fnUntraced(function* (\n state: State,\n owner: Owner,\n current: Thread,\n append: ThreadAppend,\n encoded: string,\n timestamp: DateTime.Utc,\n) {\n const threadId = current.threadId;\n\n const messageBytes = yield* messageSize(threadId, encoded);\n const contentBytes = current.contentBytes + messageBytes;\n const storeBytes = state.contentBytes + messageBytes;\n\n if (storeBytes > MAX_STORE_CONTENT_BYTES) {\n return yield* ThreadLimitExceeded.make({\n threadId,\n limit: \"store-content-bytes\",\n limitValue: MAX_STORE_CONTENT_BYTES,\n observedValue: storeBytes,\n });\n }\n\n const message = ThreadMessage.make({\n threadId,\n sequence: current.nextSequence,\n ...(append.runId === undefined ? {} : { runId: append.runId }),\n message: append.message,\n encodedBytes: messageBytes,\n timestamp,\n });\n\n const next = Thread.make({\n version: current.version,\n threadId: current.threadId,\n nextSequence: current.nextSequence + 1,\n contentBytes,\n messages: [...current.messages, message],\n });\n\n return [next, put(state, owner, next)] as const;\n});\n\n/** In-memory storage shared for the consumer's Scope; it does not survive process loss. */\nexport const layerMemory = Layer.effect(\n Store,\n Effect.gen(function* () {\n const state = yield* SynchronizedRef.make<State>({ threads: new Map(), contentBytes: 0 });\n const root: Owner = { closed: false };\n\n const release = (owner: Owner) =>\n SynchronizedRef.update(state, (current) => {\n owner.closed = true;\n const threads = new Map(current.threads);\n let contentBytes = current.contentBytes;\n\n for (const [id, entry] of threads) {\n if (belongsTo(entry.owner, owner)) {\n threads.delete(id);\n contentBytes -= entry.snapshot.contentBytes;\n }\n }\n\n return { threads, contentBytes };\n });\n\n yield* Effect.addFinalizer(() => release(root));\n\n const view = (owner: Owner): StoreService => ({\n scoped: Effect.acquireRelease(\n Effect.sync((): Owner => ({ closed: false, parent: owner })),\n release,\n ).pipe(Effect.map(view)),\n create: (threadId) =>\n SynchronizedRef.modifyEffect(\n state,\n Effect.fnUntraced(function* (threads) {\n const existing = yield* access(threads, owner, threadId);\n\n if (existing !== undefined) return [existing, threads] as const;\n if (threads.threads.size >= MAX_THREADS) {\n return yield* ThreadLimitExceeded.make({\n threadId,\n limit: \"threads\",\n limitValue: MAX_THREADS,\n observedValue: threads.threads.size + 1,\n });\n }\n\n const created = Thread.make({\n version: 1,\n threadId,\n nextSequence: 0,\n contentBytes: 0,\n messages: [],\n });\n\n return [created, put(threads, owner, created)] as const;\n }),\n ),\n append: Effect.fnUntraced(function* (threadId, message) {\n const encoded = yield* encodeMessage(threadId, message.message);\n const timestamp = DateTime.toUtc(DateTime.makeUnsafe(yield* Clock.currentTimeMillis));\n\n return yield* SynchronizedRef.modifyEffect(\n state,\n Effect.fnUntraced(function* (threads) {\n const current = yield* findSnapshot(threads, owner, threadId);\n\n return yield* appendEncoded(threads, owner, current, message, encoded, timestamp);\n }),\n );\n }),\n recordHistory: Effect.fnUntraced(function* (threadId, historyRunId, history) {\n const incoming = yield* Effect.forEach(history.content, (message) =>\n encodeMessage(threadId, message).pipe(Effect.map((encoded) => ({ message, encoded }))),\n );\n\n // Publish the complete suffix only after verification and every bounded append succeed.\n return yield* SynchronizedRef.modifyEffect(\n state,\n Effect.fnUntraced(function* (threads) {\n const current = yield* findSnapshot(threads, owner, threadId);\n\n const currentEncoded = yield* Effect.forEach(current.messages, (entry) =>\n encodeMessage(threadId, entry.message),\n );\n\n if (\n incoming.length < currentEncoded.length ||\n currentEncoded.some((encoded, index) => encoded !== incoming[index]?.encoded)\n ) {\n return yield* ThreadHistoryDiverged.make({\n threadId,\n message: \"Engine history is not an append-only extension of official history\",\n });\n }\n const timestamp = DateTime.toUtc(DateTime.makeUnsafe(yield* Clock.currentTimeMillis));\n\n if (incoming.length === currentEncoded.length) return [current, threads] as const;\n\n const messages = [...current.messages];\n let contentBytes = current.contentBytes;\n let storeBytes = threads.contentBytes;\n let nextSequence = current.nextSequence;\n\n for (const entry of incoming.slice(currentEncoded.length)) {\n const append = ThreadAppend.make({ runId: historyRunId, message: entry.message });\n\n const messageBytes = yield* messageSize(threadId, entry.encoded);\n\n contentBytes += messageBytes;\n storeBytes += messageBytes;\n if (storeBytes > MAX_STORE_CONTENT_BYTES) {\n return yield* ThreadLimitExceeded.make({\n threadId,\n limit: \"store-content-bytes\",\n limitValue: MAX_STORE_CONTENT_BYTES,\n observedValue: storeBytes,\n });\n }\n messages.push(\n ThreadMessage.make({\n threadId,\n sequence: nextSequence,\n ...(append.runId === undefined ? {} : { runId: append.runId }),\n message: append.message,\n encodedBytes: messageBytes,\n timestamp,\n }),\n );\n nextSequence += 1;\n }\n\n const snapshot = Thread.make({\n version: current.version,\n threadId,\n nextSequence,\n contentBytes,\n messages,\n });\n\n return [snapshot, put(threads, owner, snapshot)] as const;\n }),\n );\n }),\n snapshot: (threadId) =>\n SynchronizedRef.get(state).pipe(\n Effect.flatMap((all) => findSnapshot(all, owner, threadId)),\n ),\n export: Effect.fnUntraced(function* (threadId) {\n const snapshot = yield* findSnapshot(yield* SynchronizedRef.get(state), owner, threadId);\n\n return ThreadExport.make({\n format: \"effect-agent/ephemeral-thread@1\",\n exportedAt: DateTime.toUtc(DateTime.makeUnsafe(yield* Clock.currentTimeMillis)),\n snapshot,\n });\n }),\n });\n\n return view(root);\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAa,aAAa,OAAO,OAAO,MAAM,OAAO,YAAY,KAAS,CAAC;AAC3E,MAAM,4BAA4B;AAClC,MAAM,cAAc;AACpB,MAAM,0BAA0B;;AAGhC,IAAa,gBAAb,cAAmC,OAAO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,OAAO;KAE/D,gBAAgB;KAChB,cAAc;KACd,IAAI,aAAa,yBACf,OAAO,OAAO,oBAAoB,KAAK;MACrC;MACA,OAAO;MACP,YAAY;MACZ,eAAe;KACjB,CAAC;KAEH,SAAS,KACP,cAAc,KAAK;MACjB;MACA,UAAU;MACV,GAAI,OAAO,UAAU,KAAA,IAAY,CAAC,IAAI,EAAE,OAAO,OAAO,MAAM;MAC5D,SAAS,OAAO;MAChB,cAAc;MACd;KACF,CAAC,CACH;KACA,gBAAgB;IAClB;IAEA,MAAM,WAAW,OAAO,KAAK;KAC3B,SAAS,QAAQ;KACjB;KACA;KACA;KACA;IACF,CAAC;IAED,OAAO,CAAC,UAAU,IAAI,SAAS,OAAO,QAAQ,CAAC;GACjD,CAAC,CACH;EACF,CAAC;EACD,WAAW,aACT,gBAAgB,IAAI,KAAK,CAAC,CAAC,KACzB,OAAO,SAAS,QAAQ,aAAa,KAAK,OAAO,QAAQ,CAAC,CAC5D;EACF,QAAQ,OAAO,WAAW,WAAW,UAAU;GAC7C,MAAM,WAAW,OAAO,aAAa,OAAO,gBAAgB,IAAI,KAAK,GAAG,OAAO,QAAQ;GAEvF,OAAO,aAAa,KAAK;IACvB,QAAQ;IACR,YAAY,SAAS,MAAM,SAAS,WAAW,OAAO,MAAM,iBAAiB,CAAC;IAC9E;GACF,CAAC;EACH,CAAC;CACH;CAEA,OAAO,KAAK,IAAI;AAClB,CAAC,CACH"}
|
|
1
|
+
{"version":3,"file":"Thread.mjs","names":[],"sources":["../../src/core/Thread.ts"],"sourcesContent":["import type { Scope } from \"effect\";\nimport * as Prompt from \"effect/ai/Prompt\";\nimport * as Clock from \"effect/Clock\";\nimport * as Context from \"effect/Context\";\nimport * as DateTime from \"effect/DateTime\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Schema from \"effect/Schema\";\nimport * as SynchronizedRef from \"effect/SynchronizedRef\";\n\nimport { ThreadId, RunId } from \"./Identifiers.ts\";\nimport { utf8ByteLength } from \"./internal/utf8.ts\";\n\n/** Bound applied to one text projection before it can enter a model context. */\nexport const ThreadText = Schema.String.check(Schema.isMaxLength(64 * 1024));\nconst MAX_MESSAGE_CONTENT_BYTES = 4 * 1024 * 1024;\nconst MAX_THREADS = 256;\nconst MAX_STORE_CONTENT_BYTES = 64 * 1024 * 1024;\n\n/** One append-only native Effect AI message in a conversation. */\nexport class ThreadMessage extends Schema.Class<ThreadMessage>(\n \"@effect-agent/capabilities/ThreadMessage\",\n)({\n threadId: ThreadId,\n sequence: Schema.Natural,\n runId: Schema.optionalKey(RunId),\n message: Prompt.Message,\n encodedBytes: Schema.Natural.check(Schema.isLessThanOrEqualTo(MAX_MESSAGE_CONTENT_BYTES)),\n timestamp: Schema.DateTimeUtcFromString,\n}) {}\n\n/** An identified, ordered conversation snapshot. Storage and execution recovery are separate concerns. */\nexport class Thread extends Schema.Class<Thread>(\"@effect-agent/capabilities/ThreadSnapshot\")({\n version: Schema.Literal(1),\n threadId: ThreadId,\n nextSequence: Schema.Natural,\n contentBytes: Schema.Natural,\n messages: Schema.Array(ThreadMessage),\n}) {}\n\n/** Portable conversation snapshot. Its format is independent of the durable execution journal. */\nexport class ThreadExport extends Schema.Class<ThreadExport>(\n \"@effect-agent/capabilities/ThreadExport\",\n)({\n format: Schema.Literal(\"effect-agent/ephemeral-thread@1\"),\n exportedAt: Schema.DateTimeUtcFromString,\n snapshot: Thread,\n}) {}\n\n/** Native message accepted by the append-only thread. */\nexport class ThreadAppend extends Schema.Class<ThreadAppend>(\n \"@effect-agent/capabilities/ThreadAppend\",\n)({\n runId: Schema.optionalKey(RunId),\n message: Prompt.Message,\n}) {}\n\n/** The requested Thread has not been created in this store. */\nexport class ThreadNotFound extends Schema.TaggedError<ThreadNotFound>()(\"ThreadNotFound\", {\n threadId: ThreadId,\n}) {}\n\n/** A message or the process-local host exceeded capacity; no bound counts a Thread's lifetime. */\nexport class ThreadLimitExceeded extends Schema.TaggedError<ThreadLimitExceeded>()(\n \"ThreadLimitExceeded\",\n {\n threadId: ThreadId,\n limit: Schema.Literals([\"content-bytes\", \"threads\", \"store-content-bytes\"]),\n limitValue: Schema.Natural,\n observedValue: Schema.Natural,\n },\n) {}\n\n/** Engine history was not an append-only extension of the official snapshot. */\nexport class ThreadHistoryDiverged extends Schema.TaggedError<ThreadHistoryDiverged>()(\n \"ThreadHistoryDiverged\",\n { threadId: ThreadId, message: Schema.String },\n) {}\n\n/** Native Prompt encoding failed before a bounded state mutation. */\nexport class ThreadEncodingError extends Schema.TaggedError<ThreadEncodingError>()(\n \"ThreadEncodingError\",\n { threadId: ThreadId, message: Schema.String },\n) {}\n\n/** A scoped view cannot access another owner's history or be used after closure. */\nexport class ThreadOwnershipError extends Schema.TaggedError<ThreadOwnershipError>()(\n \"ThreadOwnershipError\",\n { threadId: ThreadId, reason: Schema.Literals([\"closed\", \"foreign\"]), message: Schema.String },\n) {}\n\nexport type ThreadError =\n | ThreadNotFound\n | ThreadLimitExceeded\n | ThreadHistoryDiverged\n | ThreadEncodingError\n | ThreadOwnershipError;\n\n/** Reconstruct exact Effect AI Prompt history, including tools, reasoning, files, and options. */\nexport const toPrompt = (snapshot: Thread): Prompt.Prompt =>\n Prompt.fromMessages(snapshot.messages.map((entry) => entry.message));\n\n/**\n * Process-local state for conversation history. Updates remain visible even\n * when a Run later fails; this service has no successful-Run commit boundary or durable recovery.\n * ThreadHistory.layer uses this store for ordinary Runs and interactive history.\n * Scope closure releases all in-memory state.\n */\ninterface StoreService {\n /**\n * Acquire an isolated ownership view over this same bounded store. Newly created Threads\n * belong to the supplied Scope; closing it releases only that view's Threads and bytes.\n * Supplied by layerMemory; custom stores may omit this capability.\n * The view rejects foreign IDs and all access after closure. Keep its Scope open through\n * all users, including streams, child Runs, snapshots and history hooks.\n */\n readonly scoped?: Effect.Effect<StoreService, never, Scope.Scope>;\n readonly create: (\n threadId: ThreadId,\n ) => Effect.Effect<Thread, ThreadLimitExceeded | ThreadOwnershipError>;\n readonly append: (\n threadId: ThreadId,\n message: ThreadAppend,\n ) => Effect.Effect<\n Thread,\n ThreadNotFound | ThreadLimitExceeded | ThreadEncodingError | ThreadOwnershipError\n >;\n /**\n * Record an engine-emitted full history only when it is an append-only\n * extension of the exact official Prompt already stored. The entire\n * suffix commits in one transaction or not at all: concurrent writers are\n * serialized, a writer whose history no longer extends the committed\n * official history fails with ThreadHistoryDiverged, and a limit\n * failure inside the suffix records nothing. Earlier updates remain committed if the Run\n * later fails or is interrupted; this transaction covers one update, not the whole Run.\n */\n readonly recordHistory: (\n threadId: ThreadId,\n runId: RunId,\n history: Prompt.Prompt,\n ) => Effect.Effect<Thread, ThreadError>;\n readonly snapshot: (\n threadId: ThreadId,\n ) => Effect.Effect<Thread, ThreadNotFound | ThreadOwnershipError>;\n readonly export: (\n threadId: ThreadId,\n ) => Effect.Effect<ThreadExport, ThreadNotFound | ThreadOwnershipError>;\n}\n\n/** Process-local conversation store supplied by layerMemory. */\nexport class Store extends Context.Service<Store, StoreService>()(\n \"@effect-agent/capabilities/EphemeralThreads\",\n) {}\n\nconst encodeMessage = (\n threadId: ThreadId,\n message: Prompt.Message,\n): Effect.Effect<string, ThreadEncodingError> =>\n Schema.encodeEffect(Prompt.Message)(message).pipe(\n Effect.map((encoded) => JSON.stringify(encoded)),\n Effect.mapError((error) =>\n ThreadEncodingError.make({\n threadId,\n message: `Could not encode native Effect AI message: ${error.message}`,\n }),\n ),\n );\n\ninterface Owner {\n closed: boolean;\n readonly parent?: Owner;\n}\n\ninterface Entry {\n readonly snapshot: Thread;\n readonly owner: Owner;\n}\n\ninterface State {\n readonly threads: ReadonlyMap<ThreadId, Entry>;\n readonly contentBytes: number;\n}\n\nconst belongsTo = (owner: Owner, ancestor: Owner): boolean => {\n for (let current: Owner | undefined = owner; current !== undefined; current = current.parent) {\n if (current === ancestor) return true;\n }\n\n return false;\n};\n\nconst access = (state: State, owner: Owner, threadId: ThreadId) => {\n for (let current: Owner | undefined = owner; current !== undefined; current = current.parent) {\n if (current.closed) {\n return Effect.fail(\n ThreadOwnershipError.make({\n threadId,\n reason: \"closed\",\n message: \"The in-memory conversation owner is closed\",\n }),\n );\n }\n }\n const entry = state.threads.get(threadId);\n\n return entry !== undefined && entry.owner !== owner\n ? Effect.fail(\n ThreadOwnershipError.make({\n threadId,\n reason: \"foreign\",\n message: \"The Thread belongs to another in-memory conversation owner\",\n }),\n )\n : Effect.succeed(entry?.snapshot);\n};\n\nconst findSnapshot = Effect.fnUntraced(function* (state: State, owner: Owner, threadId: ThreadId) {\n const snapshot = yield* access(state, owner, threadId);\n\n return snapshot === undefined ? yield* ThreadNotFound.make({ threadId }) : snapshot;\n});\n\nconst put = (state: State, owner: Owner, snapshot: Thread): State => ({\n threads: new Map(state.threads).set(snapshot.threadId, { snapshot, owner }),\n contentBytes:\n state.contentBytes +\n snapshot.contentBytes -\n (state.threads.get(snapshot.threadId)?.snapshot.contentBytes ?? 0),\n});\n\nconst messageSize = (threadId: ThreadId, encoded: string) => {\n const observedValue = utf8ByteLength(encoded);\n\n return observedValue <= MAX_MESSAGE_CONTENT_BYTES\n ? Effect.succeed(observedValue)\n : Effect.fail(\n ThreadLimitExceeded.make({\n threadId,\n limit: \"content-bytes\",\n limitValue: MAX_MESSAGE_CONTENT_BYTES,\n observedValue,\n }),\n );\n};\n\nconst appendEncoded = Effect.fnUntraced(function* (\n state: State,\n owner: Owner,\n current: Thread,\n append: ThreadAppend,\n encoded: string,\n timestamp: DateTime.Utc,\n) {\n const threadId = current.threadId;\n\n const messageBytes = yield* messageSize(threadId, encoded);\n const contentBytes = current.contentBytes + messageBytes;\n const storeBytes = state.contentBytes + messageBytes;\n\n if (storeBytes > MAX_STORE_CONTENT_BYTES) {\n return yield* ThreadLimitExceeded.make({\n threadId,\n limit: \"store-content-bytes\",\n limitValue: MAX_STORE_CONTENT_BYTES,\n observedValue: storeBytes,\n });\n }\n\n const message = ThreadMessage.make({\n threadId,\n sequence: current.nextSequence,\n ...(append.runId === undefined ? {} : { runId: append.runId }),\n message: append.message,\n encodedBytes: messageBytes,\n timestamp,\n });\n\n const next = Thread.make({\n version: current.version,\n threadId: current.threadId,\n nextSequence: current.nextSequence + 1,\n contentBytes,\n messages: [...current.messages, message],\n });\n\n return [next, put(state, owner, next)] as const;\n});\n\n/** In-memory storage shared for the consumer's Scope; it does not survive process loss. */\nexport const makeMemoryStore = Effect.gen(function* () {\n const state = yield* SynchronizedRef.make<State>({ threads: new Map(), contentBytes: 0 });\n const root: Owner = { closed: false };\n\n const release = (owner: Owner) =>\n SynchronizedRef.update(state, (current) => {\n owner.closed = true;\n const threads = new Map(current.threads);\n let contentBytes = current.contentBytes;\n\n for (const [id, entry] of threads) {\n if (belongsTo(entry.owner, owner)) {\n threads.delete(id);\n contentBytes -= entry.snapshot.contentBytes;\n }\n }\n\n return { threads, contentBytes };\n });\n\n yield* Effect.addFinalizer(() => release(root));\n\n const view = (owner: Owner): StoreService => ({\n scoped: Effect.acquireRelease(\n Effect.sync((): Owner => ({ closed: false, parent: owner })),\n release,\n ).pipe(Effect.map(view)),\n create: (threadId) =>\n SynchronizedRef.modifyEffect(\n state,\n Effect.fnUntraced(function* (threads) {\n const existing = yield* access(threads, owner, threadId);\n\n if (existing !== undefined) return [existing, threads] as const;\n if (threads.threads.size >= MAX_THREADS) {\n return yield* ThreadLimitExceeded.make({\n threadId,\n limit: \"threads\",\n limitValue: MAX_THREADS,\n observedValue: threads.threads.size + 1,\n });\n }\n\n const created = Thread.make({\n version: 1,\n threadId,\n nextSequence: 0,\n contentBytes: 0,\n messages: [],\n });\n\n return [created, put(threads, owner, created)] as const;\n }),\n ),\n append: Effect.fnUntraced(function* (threadId, message) {\n const encoded = yield* encodeMessage(threadId, message.message);\n const timestamp = DateTime.toUtc(DateTime.makeUnsafe(yield* Clock.currentTimeMillis));\n\n return yield* SynchronizedRef.modifyEffect(\n state,\n Effect.fnUntraced(function* (threads) {\n const current = yield* findSnapshot(threads, owner, threadId);\n\n return yield* appendEncoded(threads, owner, current, message, encoded, timestamp);\n }),\n );\n }),\n recordHistory: Effect.fnUntraced(function* (threadId, historyRunId, history) {\n const incoming = yield* Effect.forEach(history.content, (message) =>\n encodeMessage(threadId, message).pipe(Effect.map((encoded) => ({ message, encoded }))),\n );\n\n // Publish the complete suffix only after verification and every bounded append succeed.\n return yield* SynchronizedRef.modifyEffect(\n state,\n Effect.fnUntraced(function* (threads) {\n const current = yield* findSnapshot(threads, owner, threadId);\n\n const currentEncoded = yield* Effect.forEach(current.messages, (entry) =>\n encodeMessage(threadId, entry.message),\n );\n\n if (\n incoming.length < currentEncoded.length ||\n currentEncoded.some((encoded, index) => encoded !== incoming[index]?.encoded)\n ) {\n return yield* ThreadHistoryDiverged.make({\n threadId,\n message: \"Engine history is not an append-only extension of official history\",\n });\n }\n const timestamp = DateTime.toUtc(DateTime.makeUnsafe(yield* Clock.currentTimeMillis));\n\n if (incoming.length === currentEncoded.length) return [current, threads] as const;\n\n const messages = [...current.messages];\n let contentBytes = current.contentBytes;\n let storeBytes = threads.contentBytes;\n let nextSequence = current.nextSequence;\n\n for (const entry of incoming.slice(currentEncoded.length)) {\n const append = ThreadAppend.make({ runId: historyRunId, message: entry.message });\n\n const messageBytes = yield* messageSize(threadId, entry.encoded);\n\n contentBytes += messageBytes;\n storeBytes += messageBytes;\n if (storeBytes > MAX_STORE_CONTENT_BYTES) {\n return yield* ThreadLimitExceeded.make({\n threadId,\n limit: \"store-content-bytes\",\n limitValue: MAX_STORE_CONTENT_BYTES,\n observedValue: storeBytes,\n });\n }\n messages.push(\n ThreadMessage.make({\n threadId,\n sequence: nextSequence,\n ...(append.runId === undefined ? {} : { runId: append.runId }),\n message: append.message,\n encodedBytes: messageBytes,\n timestamp,\n }),\n );\n nextSequence += 1;\n }\n\n const snapshot = Thread.make({\n version: current.version,\n threadId,\n nextSequence,\n contentBytes,\n messages,\n });\n\n return [snapshot, put(threads, owner, snapshot)] as const;\n }),\n );\n }),\n snapshot: (threadId) =>\n SynchronizedRef.get(state).pipe(Effect.flatMap((all) => findSnapshot(all, owner, threadId))),\n export: Effect.fnUntraced(function* (threadId) {\n const snapshot = yield* findSnapshot(yield* SynchronizedRef.get(state), owner, threadId);\n\n return ThreadExport.make({\n format: \"effect-agent/ephemeral-thread@1\",\n exportedAt: DateTime.toUtc(DateTime.makeUnsafe(yield* Clock.currentTimeMillis)),\n snapshot,\n });\n }),\n });\n\n return view(root);\n});\n\nexport const layerMemory = Layer.effect(Store, makeMemoryStore);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAa,aAAa,OAAO,OAAO,MAAM,OAAO,YAAY,KAAS,CAAC;AAC3E,MAAM,4BAA4B;AAClC,MAAM,cAAc;AACpB,MAAM,0BAA0B;;AAGhC,IAAa,gBAAb,cAAmC,OAAO,MACxC,0CACF,CAAC,CAAC;CACA,UAAU;CACV,UAAU,OAAO;CACjB,OAAO,OAAO,YAAY,KAAK;CAC/B,SAAS,OAAO;CAChB,cAAc,OAAO,QAAQ,MAAM,OAAO,oBAAoB,yBAAyB,CAAC;CACxF,WAAW,OAAO;AACpB,CAAC,CAAC,CAAC,CAAC;;AAGJ,IAAa,SAAb,cAA4B,OAAO,MAAc,2CAA2C,CAAC,CAAC;CAC5F,SAAS,OAAO,QAAQ,CAAC;CACzB,UAAU;CACV,cAAc,OAAO;CACrB,cAAc,OAAO;CACrB,UAAU,OAAO,MAAM,aAAa;AACtC,CAAC,CAAC,CAAC,CAAC;;AAGJ,IAAa,eAAb,cAAkC,OAAO,MACvC,yCACF,CAAC,CAAC;CACA,QAAQ,OAAO,QAAQ,iCAAiC;CACxD,YAAY,OAAO;CACnB,UAAU;AACZ,CAAC,CAAC,CAAC,CAAC;;AAGJ,IAAa,eAAb,cAAkC,OAAO,MACvC,yCACF,CAAC,CAAC;CACA,OAAO,OAAO,YAAY,KAAK;CAC/B,SAAS,OAAO;AAClB,CAAC,CAAC,CAAC,CAAC;;AAGJ,IAAa,iBAAb,cAAoC,OAAO,YAA4B,CA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AAY,SAAS,MAAM,SAAS,WAAW,OAAO,MAAM,iBAAiB,CAAC;IAC9E;GACF,CAAC;EACH,CAAC;CACH;CAEA,OAAO,KAAK,IAAI;AAClB,CAAC;AAED,MAAa,cAAc,MAAM,OAAO,OAAO,eAAe"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { ThreadId } from "../core/Identifiers.mjs";
|
|
3
|
-
import { U as PersistedJson, Z as RecordId, b as Digest, f as CanonicalSequence } from "../Records-
|
|
3
|
+
import { U as PersistedJson, Z as RecordId, b as Digest, f as CanonicalSequence } from "../Records-DzL4Kbtw.mjs";
|
|
4
4
|
import { Context, Effect, Layer, Schema } from "effect";
|
|
5
5
|
//#region src/durable/ActivityStore.ts
|
|
6
6
|
var ActivityStore_exports = /* @__PURE__ */ __exportAll({
|
package/dist/durable/Admin.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as renderRecoveryExplanation, S as recoveryDecisionMeaning, _ as RetryCommand, a as IntegrityCheck, b as obligationSeverityOf, c as IntegrityReport, d as ObligationReport, f as ObligationSeverity, g as RecoveryExplanation, h as RecoveryDisposition, i as ExplainedUnknownCall, l as ObligationBlockedOn, m as RECOVERY_DECISION_MEANINGS, n as ExplainedEvidence, o as IntegrityCheckName, p as ObligationThresholds, r as ExplainedSubmission, s as IntegrityCheckStatus, u as ObligationEntry, v as RetryRefusalReason, x as predictRecoveryDisposition, y as RetryRefused } from "../Admin-
|
|
1
|
+
import { C as renderRecoveryExplanation, S as recoveryDecisionMeaning, _ as RetryCommand, a as IntegrityCheck, b as obligationSeverityOf, c as IntegrityReport, d as ObligationReport, f as ObligationSeverity, g as RecoveryExplanation, h as RecoveryDisposition, i as ExplainedUnknownCall, l as ObligationBlockedOn, m as RECOVERY_DECISION_MEANINGS, n as ExplainedEvidence, o as IntegrityCheckName, p as ObligationThresholds, r as ExplainedSubmission, s as IntegrityCheckStatus, u as ObligationEntry, v as RetryRefusalReason, x as predictRecoveryDisposition, y as RetryRefused } from "../Admin-Qa3I1oA5.mjs";
|
|
2
2
|
export { ExplainedEvidence, ExplainedSubmission, ExplainedUnknownCall, IntegrityCheck, IntegrityCheckName, IntegrityCheckStatus, IntegrityReport, ObligationBlockedOn, ObligationEntry, ObligationReport, ObligationSeverity, ObligationThresholds, RECOVERY_DECISION_MEANINGS, RecoveryDisposition, RecoveryExplanation, RetryCommand, RetryRefusalReason, RetryRefused, obligationSeverityOf, predictRecoveryDisposition, recoveryDecisionMeaning, renderRecoveryExplanation };
|
package/dist/durable/Admin.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { SubmissionId, ThreadId, ToolCallId } from "../core/Identifiers.mjs";
|
|
3
3
|
import { QueueSequence } from "../core/Receipt.mjs";
|
|
4
|
-
import { Tt as ToolCallUnknown, dt as SettlementOutcome, f as CanonicalSequence, g as DeclaredToolCall } from "../Records-
|
|
4
|
+
import { Tt as ToolCallUnknown, dt as SettlementOutcome, f as CanonicalSequence, g as DeclaredToolCall } from "../Records-DzL4Kbtw.mjs";
|
|
5
5
|
import { AbortCommand, AbortIntent, ApprovalDecisionIntent, ChildAttachmentSnapshot, JoinSnapshot, ParentLinkage, SubmissionState, SuspensionSnapshot, UnknownResolutionIntent } from "./SubmissionLedger.mjs";
|
|
6
6
|
import { OpenDelegationCallEvidence, OpenToolCallEvidence, PendingApprovalEvidence, RecoveryDecision } from "./Recovery.mjs";
|
|
7
7
|
import { DateTime, Effect, Schema } from "effect";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { As as
|
|
1
|
+
import { As as BindingUnavailable, Ds as AgentAttemptContext, Fs as ReplayVersions, Is as ResolvedBinding, Ls as compileBindingContracts, Ms as DurableBindingFailure, Ns as DurableWorkerBinding, Os as AgentRegistration, Ps as ExecutableAgentBinding, Rs as compileRegistrations, js as CurrentBindingSelection, ks as BindingSelection, zs as definitionDigestsEqual } from "../Admin-Qa3I1oA5.mjs";
|
|
2
2
|
export { type AgentAttemptContext, type AgentRegistration, type BindingSelection, BindingUnavailable, CurrentBindingSelection, type DurableBindingFailure, DurableWorkerBinding, type ExecutableAgentBinding, type ReplayVersions, type ResolvedBinding, compileBindingContracts, compileRegistrations, definitionDigestsEqual };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import { a as compileRegistrations, i as compileBindingContracts, n as CurrentBindingSelection, o as definitionDigestsEqual, r as DurableWorkerBinding, t as BindingUnavailable } from "../agent-registration-
|
|
2
|
+
import { a as compileRegistrations, i as compileBindingContracts, n as CurrentBindingSelection, o as definitionDigestsEqual, r as DurableWorkerBinding, t as BindingUnavailable } from "../agent-registration-a6QYaG3h.mjs";
|
|
3
3
|
//#region src/durable/AgentRegistration.ts
|
|
4
4
|
var AgentRegistration_exports = /* @__PURE__ */ __exportAll({
|
|
5
5
|
BindingUnavailable: () => BindingUnavailable,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ui as ThreadStore, Wr as SettlementPublisher, dn as SubmissionLedger,
|
|
1
|
+
import { Ui as ThreadStore, Wr as SettlementPublisher, dn as SubmissionLedger, yo as StorageOwner } from "../Admin-Qa3I1oA5.mjs";
|
|
2
2
|
import { Crypto, Effect, Schema } from "effect";
|
|
3
3
|
//#region src/durable/Certification.d.ts
|
|
4
4
|
declare const CertifiedAdapterIdentity_base: Schema.Class<CertifiedAdapterIdentity, Schema.Struct<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { K as PersistedJson, d as CanonicalRecordEnvelope, p as CanonicalSequence } from "../Records-BTnGRdcf.mjs";
|
|
2
2
|
import { ActivityProcessorKey, ActivityProcessorStore, ActivityStoreFailure, PreparedActivity } from "./ActivityStore.mjs";
|
|
3
3
|
import { t as DigestError } from "../Digest-DjUgS5PG.mjs";
|
|
4
|
-
import { Gi as ThreadStoreError, Mi as ThreadNotMaterialized, Ui as ThreadStore } from "../Admin-
|
|
4
|
+
import { Gi as ThreadStoreError, Mi as ThreadNotMaterialized, Ui as ThreadStore } from "../Admin-Qa3I1oA5.mjs";
|
|
5
5
|
import { Crypto, Effect, Schema, Scope } from "effect";
|
|
6
6
|
declare namespace CommittedActivity_d_exports {
|
|
7
7
|
export { ActivityPassLimits, ActivityPassResult, ActivityProcessingError, CommittedActivityProcessor, activityWorkId, processCommittedActivity };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import { U as PersistedJson, f as CanonicalSequence, u as CanonicalRecordEnvelope } from "../Records-
|
|
2
|
+
import { U as PersistedJson, f as CanonicalSequence, u as CanonicalRecordEnvelope } from "../Records-DzL4Kbtw.mjs";
|
|
3
3
|
import { ActivityProcessorKey, ActivityProcessorStore, ActivityProgress, PreparedActivity } from "./ActivityStore.mjs";
|
|
4
|
-
import { s as digestJson } from "../Digest-
|
|
5
|
-
import { $ as ThreadTailRequest, J as ThreadStore, Q as ThreadTail, V as ThreadRead } from "../ThreadStore-
|
|
4
|
+
import { s as digestJson } from "../Digest-C3EODOee.mjs";
|
|
5
|
+
import { $ as ThreadTailRequest, J as ThreadStore, Q as ThreadTail, V as ThreadRead } from "../ThreadStore-EuUilthA.mjs";
|
|
6
6
|
import { Clock, Effect, Schema, Stream } from "effect";
|
|
7
7
|
//#region src/durable/CommittedActivity.ts
|
|
8
8
|
var CommittedActivity_exports = /* @__PURE__ */ __exportAll({
|
package/dist/durable/Digest.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as utf8ByteLength } from "../utf8-B5pAmhTo.mjs";
|
|
2
|
-
import { a as digestDefinition, i as digestCanonicalJson, o as digestDefinitions, r as canonicalJson, s as digestJson, t as DigestError } from "../Digest-
|
|
2
|
+
import { a as digestDefinition, i as digestCanonicalJson, o as digestDefinitions, r as canonicalJson, s as digestJson, t as DigestError } from "../Digest-C3EODOee.mjs";
|
|
3
3
|
export { DigestError, canonicalJson, digestCanonicalJson, digestDefinition, digestDefinitions, digestJson, utf8ByteLength };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as Receipt } from "../Receipt-BkM21Qiu.mjs";
|
|
2
|
-
import { $n as DurableAwaitFailure, Cr as recoveryRepairBatchId, Er as threadCreatedRecordId, Jn as DurableAgentRuntime, Kn as ApprovalSuspensionError, Qn as DurableApprovalSuspension, Sr as isolateRecovery, Tr as threadCreatedBatchId, Xn as DurableApprovalFailure, Zn as DurableApprovalResolver, _r as RecoverySweepOptions, ar as DurableRetryFailure, br as WorkRecoveryRequest, cr as DurableSubmitAgent, dr as DurableVerifyFailure, er as DurableExplainFailure, fr as DurableWorkerFailure, gr as RecoveryReport, hr as RecoveryFailure, ir as DurableResolveFailure, lr as DurableSubmitFailure, mr as RecoveryBlocked, nr as DurableObserveOptions, or as DurableRuntimeConfig, pr as DurableWorkerRequirements, qn as DurableAbortFailure, rr as DurableProgressFailure, sr as DurableRuntimeConfigOptions, tr as DurableObligationFailure, ur as DurableSubmitOptions, vr as RecoverySweepResult, wr as recoveryRepairRecordId, xr as childReservationIdFor, yr as WorkRecoveryReport } from "../Admin-
|
|
2
|
+
import { $n as DurableAwaitFailure, Cr as recoveryRepairBatchId, Er as threadCreatedRecordId, Jn as DurableAgentRuntime, Kn as ApprovalSuspensionError, Qn as DurableApprovalSuspension, Sr as isolateRecovery, Tr as threadCreatedBatchId, Xn as DurableApprovalFailure, Zn as DurableApprovalResolver, _r as RecoverySweepOptions, ar as DurableRetryFailure, br as WorkRecoveryRequest, cr as DurableSubmitAgent, dr as DurableVerifyFailure, er as DurableExplainFailure, fr as DurableWorkerFailure, gr as RecoveryReport, hr as RecoveryFailure, ir as DurableResolveFailure, lr as DurableSubmitFailure, mr as RecoveryBlocked, nr as DurableObserveOptions, or as DurableRuntimeConfig, pr as DurableWorkerRequirements, qn as DurableAbortFailure, rr as DurableProgressFailure, sr as DurableRuntimeConfigOptions, tr as DurableObligationFailure, ur as DurableSubmitOptions, vr as RecoverySweepResult, wr as recoveryRepairRecordId, xr as childReservationIdFor, yr as WorkRecoveryReport } from "../Admin-Qa3I1oA5.mjs";
|
|
3
3
|
export { ApprovalSuspensionError, DurableAbortFailure, DurableAgentRuntime, DurableApprovalFailure, DurableApprovalResolver, DurableApprovalSuspension, DurableAwaitFailure, DurableExplainFailure, DurableObligationFailure, DurableObserveOptions, DurableProgressFailure, DurableResolveFailure, DurableRetryFailure, DurableRuntimeConfig, DurableRuntimeConfigOptions, DurableSubmitAgent, DurableSubmitFailure, DurableSubmitOptions, DurableVerifyFailure, DurableWorkerFailure, DurableWorkerRequirements, Receipt, RecoveryBlocked, RecoveryFailure, RecoveryReport, RecoverySweepOptions, RecoverySweepResult, WorkRecoveryReport, WorkRecoveryRequest, childReservationIdFor, isolateRecovery, recoveryRepairBatchId, recoveryRepairRecordId, threadCreatedBatchId, threadCreatedRecordId };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Receipt } from "../core/Receipt.mjs";
|
|
2
|
-
import { a as DurableApprovalSuspension, c as RecoveryFailure, d as WorkRecoveryReport, f as WorkRecoveryRequest, g as recoveryRepairRecordId, h as recoveryRepairBatchId, i as DurableApprovalResolver, l as RecoveryReport, m as isolateRecovery, n as DurableAgentRuntime, o as DurableRuntimeConfig, p as childReservationIdFor, s as RecoveryBlocked, t as ApprovalSuspensionError, u as RecoverySweepResult } from "../DurableAgentRuntime-
|
|
3
|
-
import { c as threadCreatedBatchId, l as threadCreatedRecordId } from "../WorkerAdmission-
|
|
2
|
+
import { a as DurableApprovalSuspension, c as RecoveryFailure, d as WorkRecoveryReport, f as WorkRecoveryRequest, g as recoveryRepairRecordId, h as recoveryRepairBatchId, i as DurableApprovalResolver, l as RecoveryReport, m as isolateRecovery, n as DurableAgentRuntime, o as DurableRuntimeConfig, p as childReservationIdFor, s as RecoveryBlocked, t as ApprovalSuspensionError, u as RecoverySweepResult } from "../DurableAgentRuntime-CPlw5_7e.mjs";
|
|
3
|
+
import { c as threadCreatedBatchId, l as threadCreatedRecordId } from "../WorkerAdmission-eBeXt_mu.mjs";
|
|
4
4
|
export { ApprovalSuspensionError, DurableAgentRuntime, DurableApprovalResolver, DurableApprovalSuspension, DurableRuntimeConfig, Receipt, RecoveryBlocked, RecoveryFailure, RecoveryReport, RecoverySweepResult, WorkRecoveryReport, WorkRecoveryRequest, childReservationIdFor, isolateRecovery, recoveryRepairBatchId, recoveryRepairRecordId, threadCreatedBatchId, threadCreatedRecordId };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as makeEventSource, i as NormalizedEvent, r as EventSources, t as EventSource } from "../EventSource-
|
|
1
|
+
import { a as makeEventSource, i as NormalizedEvent, r as EventSources, t as EventSource } from "../EventSource-BTu68yDW.mjs";
|
|
2
2
|
export { EventSource, EventSources, NormalizedEvent, makeEventSource };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import { U as PersistedJson } from "../Records-
|
|
2
|
+
import { U as PersistedJson } from "../Records-DzL4Kbtw.mjs";
|
|
3
3
|
import { SubscriptionSourceError } from "./Subscription.mjs";
|
|
4
4
|
import { Context, Effect, Schema } from "effect";
|
|
5
5
|
//#region src/durable/EventSource.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as Principal } from "../Receipt-BkM21Qiu.mjs";
|
|
2
|
-
import "../Admin-
|
|
3
|
-
import { E as SubscriptionSourceError } from "../Subscription-
|
|
4
|
-
import { t as EventSource } from "../EventSource-
|
|
2
|
+
import "../Admin-Qa3I1oA5.mjs";
|
|
3
|
+
import { E as SubscriptionSourceError } from "../Subscription-DmIHlOJK.mjs";
|
|
4
|
+
import { t as EventSource } from "../EventSource-BTu68yDW.mjs";
|
|
5
5
|
import { SubscriptionFailure, SubscriptionIntake } from "./Subscriptions.mjs";
|
|
6
6
|
import { Context, Effect, Layer, Redacted, Schema } from "effect";
|
|
7
7
|
import { HttpClient } from "effect/http";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ao as
|
|
1
|
+
import { ao as LifecyclePublicationBatch, co as LifecyclePublicationFact, do as LifecyclePublicationStorage, ho as lifecyclePublicationLayer, io as LifecyclePublication, lo as LifecyclePublicationHandler, mo as lifecyclePublicationBatchMaxFacts, oo as LifecyclePublicationConfig, po as drainLifecyclePublications, so as LifecyclePublicationError, uo as LifecyclePublicationSource } from "../Admin-Qa3I1oA5.mjs";
|
|
2
2
|
export { LifecyclePublication, LifecyclePublicationBatch, LifecyclePublicationConfig, LifecyclePublicationError, LifecyclePublicationFact, LifecyclePublicationHandler, LifecyclePublicationSource, LifecyclePublicationStorage, drainLifecyclePublications, lifecyclePublicationBatchMaxFacts, lifecyclePublicationLayer };
|
|
@@ -2,9 +2,9 @@ import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
|
2
2
|
import { SubmissionId, ThreadId } from "../core/Identifiers.mjs";
|
|
3
3
|
import { Receipt } from "../core/Receipt.mjs";
|
|
4
4
|
import { n as AssignmentTerminal } from "../Worker-DZjdMjZn.mjs";
|
|
5
|
-
import { Ft as WorkerInputRequested, Nt as WorkerInputCompleted, Vt as WorkerStopRequested, _t as SubmissionSettledRecord, bt as ToolApprovalDecided, f as CanonicalSequence, ft as SubagentJoined, ht as SubagentStarted, kt as UserInputRecorded, lt as RunStartedRecord, mt as SubagentRequested, n as AgentUpdateEmitted, t as AbortRequested, xt as ToolApprovalRequested } from "../Records-
|
|
5
|
+
import { Ft as WorkerInputRequested, Nt as WorkerInputCompleted, Vt as WorkerStopRequested, _t as SubmissionSettledRecord, bt as ToolApprovalDecided, f as CanonicalSequence, ft as SubagentJoined, ht as SubagentStarted, kt as UserInputRecorded, lt as RunStartedRecord, mt as SubagentRequested, n as AgentUpdateEmitted, t as AbortRequested, xt as ToolApprovalRequested } from "../Records-DzL4Kbtw.mjs";
|
|
6
6
|
import { AbortIntent, Settlement, SubmissionLedger, SubmissionLookupById, SubmissionSnapshot, SuspensionReason } from "./SubmissionLedger.mjs";
|
|
7
|
-
import { st as getRunInput } from "../ThreadStore-
|
|
7
|
+
import { st as getRunInput } from "../ThreadStore-EuUilthA.mjs";
|
|
8
8
|
import { PreparedInput } from "./Subscription.mjs";
|
|
9
9
|
import { MessageDeliveryKey } from "./MessageDelivery.mjs";
|
|
10
10
|
import { Cause, Clock, Context, Crypto, Effect, Layer, Option, Schema } from "effect";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as messageDeliveryKeyString, D as readPending, E as prepareMessageDelivery, O as sameMessageDeliveryIdentity, S as messageDeliveryDeadline, T as peerMessageRetentionDeadline, _ as applyMessageDeliveryChange, a as MessageDeliveryError, b as isWorkerUpdateDelivery, c as MessageDeliveryFailure, d as MessageDeliveryPageRequest, f as MessageDeliveryPolicy, h as MessageDeliveryStoreLimits, i as MessageDeliveryDriverLimits, k as validateMessageDelivery, l as MessageDeliveryKey, m as MessageDeliveryStore, n as MessageDeliveryCompletion, o as MessageDeliveryFailpoint, p as MessageDeliveryRecord, r as MessageDeliveryDriver, s as MessageDeliveryFailpointError, t as MessageDeliveryChange, u as MessageDeliveryPage, v as defaultMessageDeliveryPolicy, w as messageDeliveryUsesCapacity, x as messageDeliveryCapacity, y as defaultMessageDeliveryStoreLimits } from "../MessageDelivery-
|
|
1
|
+
import { C as messageDeliveryKeyString, D as readPending, E as prepareMessageDelivery, O as sameMessageDeliveryIdentity, S as messageDeliveryDeadline, T as peerMessageRetentionDeadline, _ as applyMessageDeliveryChange, a as MessageDeliveryError, b as isWorkerUpdateDelivery, c as MessageDeliveryFailure, d as MessageDeliveryPageRequest, f as MessageDeliveryPolicy, h as MessageDeliveryStoreLimits, i as MessageDeliveryDriverLimits, k as validateMessageDelivery, l as MessageDeliveryKey, m as MessageDeliveryStore, n as MessageDeliveryCompletion, o as MessageDeliveryFailpoint, p as MessageDeliveryRecord, r as MessageDeliveryDriver, s as MessageDeliveryFailpointError, t as MessageDeliveryChange, u as MessageDeliveryPage, v as defaultMessageDeliveryPolicy, w as messageDeliveryUsesCapacity, x as messageDeliveryCapacity, y as defaultMessageDeliveryStoreLimits } from "../MessageDelivery-DjAZJ4Fd.mjs";
|
|
2
2
|
export { MessageDeliveryChange, MessageDeliveryCompletion, MessageDeliveryDriver, MessageDeliveryDriverLimits, MessageDeliveryError, MessageDeliveryFailpoint, MessageDeliveryFailpointError, MessageDeliveryFailure, MessageDeliveryKey, MessageDeliveryPage, MessageDeliveryPageRequest, MessageDeliveryPolicy, MessageDeliveryRecord, MessageDeliveryStore, MessageDeliveryStoreLimits, applyMessageDeliveryChange, defaultMessageDeliveryPolicy, defaultMessageDeliveryStoreLimits, isWorkerUpdateDelivery, messageDeliveryCapacity, messageDeliveryDeadline, messageDeliveryKeyString, messageDeliveryUsesCapacity, peerMessageRetentionDeadline, prepareMessageDelivery, readPending, sameMessageDeliveryIdentity, validateMessageDelivery };
|
|
@@ -3,8 +3,8 @@ import { AgentId, DelegationId, ThreadId } from "../core/Identifiers.mjs";
|
|
|
3
3
|
import { IdempotencyKey, Receipt } from "../core/Receipt.mjs";
|
|
4
4
|
import { o as Value, r as Diagnostic, s as capture } from "../FailureDiagnostic-D9oW23Cn.mjs";
|
|
5
5
|
import { b as WorkerUpdate } from "../Worker-DZjdMjZn.mjs";
|
|
6
|
-
import { b as Digest } from "../Records-
|
|
7
|
-
import { s as digestJson } from "../Digest-
|
|
6
|
+
import { b as Digest } from "../Records-DzL4Kbtw.mjs";
|
|
7
|
+
import { s as digestJson } from "../Digest-C3EODOee.mjs";
|
|
8
8
|
import { Settlement } from "./SubmissionLedger.mjs";
|
|
9
9
|
import { ScheduleInstant, ScheduleRetry, ScheduleRetryReason } from "./Schedule.mjs";
|
|
10
10
|
import { PreparedInputAdmission, admitPreparedInput } from "./PreparedInputAdmission.mjs";
|
|
@@ -5,8 +5,8 @@ import { r as Diagnostic } from "../FailureDiagnostic-DvHruCSJ.mjs";
|
|
|
5
5
|
import { t as AgentPolicy } from "../AgentPolicy-B4lbCU2T.mjs";
|
|
6
6
|
import { b as DefinitionDigests } from "../Records-BTnGRdcf.mjs";
|
|
7
7
|
import { t as DigestError } from "../Digest-DjUgS5PG.mjs";
|
|
8
|
-
import { sn as Settlement } from "../Admin-
|
|
9
|
-
import { a as MessageDeliveryError, c as MessageDeliveryFailure, m as MessageDeliveryStore } from "../MessageDelivery-
|
|
8
|
+
import { sn as Settlement } from "../Admin-Qa3I1oA5.mjs";
|
|
9
|
+
import { a as MessageDeliveryError, c as MessageDeliveryFailure, m as MessageDeliveryStore } from "../MessageDelivery-DjAZJ4Fd.mjs";
|
|
10
10
|
import { Effect, Schema } from "effect";
|
|
11
11
|
//#region src/durable/MessageDeliveryStoreConformance.d.ts
|
|
12
12
|
declare const MessageDeliveryConformanceViolation_base: Schema.Class<MessageDeliveryConformanceViolation, Schema.TaggedStruct<"MessageDeliveryConformanceViolation", {
|
|
@@ -106,25 +106,6 @@ export declare const makeMessageDeliveryFixture: (messageId?: any, owner?: any,
|
|
|
106
106
|
readonly reportKind?: "update" | undefined;
|
|
107
107
|
} | undefined;
|
|
108
108
|
readonly messageAdmission?: {
|
|
109
|
-
readonly schemaVersion: 1;
|
|
110
|
-
readonly message: {
|
|
111
|
-
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
112
|
-
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
113
|
-
};
|
|
114
|
-
readonly peerName: string;
|
|
115
|
-
readonly sender: {
|
|
116
|
-
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
117
|
-
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
118
|
-
};
|
|
119
|
-
readonly returnAddress: {
|
|
120
|
-
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
121
|
-
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
122
|
-
};
|
|
123
|
-
readonly inReplyTo?: {
|
|
124
|
-
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
125
|
-
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
126
|
-
} | undefined;
|
|
127
|
-
} | {
|
|
128
109
|
readonly _tag: "WorkerCompletion";
|
|
129
110
|
readonly budgetExhausted: boolean;
|
|
130
111
|
readonly schemaVersion: 1;
|
|
@@ -165,6 +146,25 @@ export declare const makeMessageDeliveryFixture: (messageId?: any, owner?: any,
|
|
|
165
146
|
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
166
147
|
};
|
|
167
148
|
readonly update: Update;
|
|
149
|
+
} | {
|
|
150
|
+
readonly schemaVersion: 1;
|
|
151
|
+
readonly message: {
|
|
152
|
+
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
153
|
+
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
154
|
+
};
|
|
155
|
+
readonly peerName: string;
|
|
156
|
+
readonly sender: {
|
|
157
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
158
|
+
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
159
|
+
};
|
|
160
|
+
readonly returnAddress: {
|
|
161
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
162
|
+
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
163
|
+
};
|
|
164
|
+
readonly inReplyTo?: {
|
|
165
|
+
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
166
|
+
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
167
|
+
} | undefined;
|
|
168
168
|
} | undefined;
|
|
169
169
|
};
|
|
170
170
|
readonly envelopeDigest: string & import("effect/Brand").Brand<"@effect-agent/thread/Digest">;
|
|
@@ -290,25 +290,6 @@ export declare const makeWorkerUpdateDeliveryFixture: (id: string) => Effect.Eff
|
|
|
290
290
|
readonly reportKind?: "update" | undefined;
|
|
291
291
|
} | undefined;
|
|
292
292
|
readonly messageAdmission?: {
|
|
293
|
-
readonly schemaVersion: 1;
|
|
294
|
-
readonly message: {
|
|
295
|
-
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
296
|
-
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
297
|
-
};
|
|
298
|
-
readonly peerName: string;
|
|
299
|
-
readonly sender: {
|
|
300
|
-
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
301
|
-
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
302
|
-
};
|
|
303
|
-
readonly returnAddress: {
|
|
304
|
-
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
305
|
-
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
306
|
-
};
|
|
307
|
-
readonly inReplyTo?: {
|
|
308
|
-
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
309
|
-
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
310
|
-
} | undefined;
|
|
311
|
-
} | {
|
|
312
293
|
readonly _tag: "WorkerCompletion";
|
|
313
294
|
readonly budgetExhausted: boolean;
|
|
314
295
|
readonly schemaVersion: 1;
|
|
@@ -349,6 +330,25 @@ export declare const makeWorkerUpdateDeliveryFixture: (id: string) => Effect.Eff
|
|
|
349
330
|
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
350
331
|
};
|
|
351
332
|
readonly update: Update;
|
|
333
|
+
} | {
|
|
334
|
+
readonly schemaVersion: 1;
|
|
335
|
+
readonly message: {
|
|
336
|
+
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
337
|
+
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
338
|
+
};
|
|
339
|
+
readonly peerName: string;
|
|
340
|
+
readonly sender: {
|
|
341
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
342
|
+
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
343
|
+
};
|
|
344
|
+
readonly returnAddress: {
|
|
345
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
346
|
+
readonly agentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
|
|
347
|
+
};
|
|
348
|
+
readonly inReplyTo?: {
|
|
349
|
+
readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
350
|
+
readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
|
|
351
|
+
} | undefined;
|
|
352
352
|
} | undefined;
|
|
353
353
|
};
|
|
354
354
|
readonly envelopeDigest: string & import("effect/Brand").Brand<"@effect-agent/thread/Digest">;
|
|
@@ -2,8 +2,8 @@ import { AgentId, DelegationId, ReceiptId, RunId, SettlementId, SubmissionId, Th
|
|
|
2
2
|
import { IdempotencyKey, Principal, QueueSequence, Receipt } from "../core/Receipt.mjs";
|
|
3
3
|
import { Update } from "../core/AgentUpdates.mjs";
|
|
4
4
|
import { b as WorkerUpdate } from "../Worker-DZjdMjZn.mjs";
|
|
5
|
-
import { b as Digest, v as DefinitionDigests } from "../Records-
|
|
6
|
-
import { s as digestJson } from "../Digest-
|
|
5
|
+
import { b as Digest, v as DefinitionDigests } from "../Records-DzL4Kbtw.mjs";
|
|
6
|
+
import { s as digestJson } from "../Digest-C3EODOee.mjs";
|
|
7
7
|
import { Settlement } from "./SubmissionLedger.mjs";
|
|
8
8
|
import { MessageDeliveryStore, messageDeliveryCapacity, prepareMessageDelivery, readPending } from "./MessageDelivery.mjs";
|
|
9
9
|
import { DateTime, Effect, Equal, Result, Schema } from "effect";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as ThreadHistory } from "../ThreadHistory-
|
|
2
|
-
import { Ui as ThreadStore,
|
|
1
|
+
import { t as ThreadHistory } from "../ThreadHistory-KPPBJLJb.mjs";
|
|
2
|
+
import { Ui as ThreadStore, yo as StorageOwner } from "../Admin-Qa3I1oA5.mjs";
|
|
3
3
|
import { Layer } from "effect";
|
|
4
4
|
declare namespace PersistentHistory_d_exports {
|
|
5
5
|
export { layer };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { ThreadHistory, ThreadHistoryError } from "../engine/ThreadHistory.mjs";
|
|
3
|
-
import { L as ModelCompleted, U as PersistedJson, W as ProducerId, X as RecordEnvelope, Z as RecordId, c as CanonicalBatch, i as BatchId, kt as UserInputRecorded, nt as RunCompleted, y as DeploymentId } from "../Records-
|
|
4
|
-
import {
|
|
5
|
-
import { F as ThreadIdentityRequest, I as ThreadMaterialization, J as ThreadStore, b as SelectedThreadRead, n as AppendRequest } from "../ThreadStore-
|
|
6
|
-
import { s as StorageOwner } from "../RunStorage-
|
|
3
|
+
import { L as ModelCompleted, U as PersistedJson, W as ProducerId, X as RecordEnvelope, Z as RecordId, c as CanonicalBatch, i as BatchId, kt as UserInputRecorded, nt as RunCompleted, y as DeploymentId } from "../Records-DzL4Kbtw.mjs";
|
|
4
|
+
import { v as promptFromCanonicalRecords } from "../RunJournal-CPMKcfd0.mjs";
|
|
5
|
+
import { F as ThreadIdentityRequest, I as ThreadMaterialization, J as ThreadStore, b as SelectedThreadRead, n as AppendRequest } from "../ThreadStore-EuUilthA.mjs";
|
|
6
|
+
import { s as StorageOwner } from "../RunStorage-CzutHJBE.mjs";
|
|
7
7
|
import { DateTime, Effect, Layer, Schema, Stream } from "effect";
|
|
8
8
|
import { Prompt } from "effect/ai";
|
|
9
9
|
//#region src/durable/PersistentHistory.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as admitPreparedInput, t as PreparedInputAdmission } from "../PreparedInputAdmission-
|
|
1
|
+
import { r as admitPreparedInput, t as PreparedInputAdmission } from "../PreparedInputAdmission-wgY4JMZY.mjs";
|
|
2
2
|
export { PreparedInputAdmission, admitPreparedInput };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import { Q as RecordJson, X as RecordEnvelope, c as CanonicalBatch, u as CanonicalRecordEnvelope } from "../Records-
|
|
2
|
+
import { Q as RecordJson, X as RecordEnvelope, c as CanonicalBatch, u as CanonicalRecordEnvelope } from "../Records-DzL4Kbtw.mjs";
|
|
3
3
|
import { Effect, Schema, SchemaGetter, SchemaIssue } from "effect";
|
|
4
4
|
//#region src/durable/RecordFormat.ts
|
|
5
5
|
var RecordFormat_exports = /* @__PURE__ */ __exportAll({
|
package/dist/durable/Records.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as MAX_RUN_EVIDENCE_RECORDS, At as WorkHandoffCompleted, B as ObservationOffset, Bt as WorkerReportingIntent, C as MAX_CANONICAL_RECORD_BYTES, Ct as ToolCallResolved, D as MAX_PERSISTED_JSON_NODES, Dt as ToolStepSettled, E as MAX_PERSISTED_JSON_DEPTH, Et as ToolOperation, F as MAX_TURN_CANONICAL_BYTES, Ft as WorkerInputRequested, G as PromptRecord, H as PeerMessagePrepared, I as ModelCallAborted, It as WorkerOrigin, J as RUN_TERMINAL_RESERVE_BYTES, K as PromptRecordEnvelope, L as ModelCompleted, Lt as WorkerOriginRecorded, M as MAX_RUN_RECOVERY_SUFFIX_RECORDS, Mt as WorkerContinuation, N as MAX_RUN_TERMINAL_BYTES, Nt as WorkerInputCompleted, O as MAX_RUN_CONTINUATION_BYTES, Ot as ToolUnavailable, P as MAX_RUN_TOOL_CALL_IDENTITIES, Pt as WorkerInputRefused, Q as RecordJson, R as ModelResponseInterrupted, Rt as WorkerReportPrepared, S as KnownRecordPayload, St as ToolCallResolution, T as MAX_PERSISTED_JSON_COLLECTION_LENGTH, Tt as ToolCallUnknown, U as PersistedJson, V as PROMPT_EVIDENCE_TAGS, Vt as WorkerStopRequested, W as ProducerId, X as RecordEnvelope, Y as RUN_TERMINAL_RESERVE_RECORDS, Z as RecordId, _ as DefinitionDigestInput, _t as SubmissionSettledRecord, a as CURRENT_CANONICAL_SCHEMA_VERSION, at as RunDurationExhausted, b as Digest, bt as ToolApprovalDecided, c as CanonicalBatch, ct as RunPosition, d as CanonicalRecordPayload, dt as SettlementOutcome, et as RepairAnnotated, f as CanonicalSequence, ft as SubagentJoined, g as DeclaredToolCall, gt as SubmissionSettled, h as ContinuationAccounting, ht as SubagentStarted, i as BatchId, it as RunContinuation, j as MAX_RUN_RECOVERY_SUFFIX_BYTES, jt as WorkerAdmission, k as MAX_RUN_EVIDENCE_BYTES, kt as UserInputRecorded, l as CanonicalRecord, lt as RunStartedRecord, m as ContextEvidenceReference, mt as SubagentRequested, n as AgentUpdateEmitted, nt as RunCompleted, o as CURRENT_RECORD_FORMAT, ot as RunFailed, p as CompactionCreated, pt as SubagentLineageRecorded, q as PromptRecordPayload, r as ApprovalDecision, rt as RunContextRecorded, s as CURRENT_RECORD_VERSION, st as RunPolicyUsageReserved, t as AbortRequested, tt as ReplayContract, u as CanonicalRecordEnvelope, ut as SettlementFailureDiagnostic, v as DefinitionDigests, vt as SubtreeBudgetReserved, w as MAX_PERSISTED_JSON_BYTES, wt as ToolCallSettled, x as EvidenceReference, xt as ToolApprovalRequested, y as DeploymentId, yt as ThreadCreated, z as ModelResponseRecorded, zt as WorkerReportRefused } from "../Records-
|
|
1
|
+
import { A as MAX_RUN_EVIDENCE_RECORDS, At as WorkHandoffCompleted, B as ObservationOffset, Bt as WorkerReportingIntent, C as MAX_CANONICAL_RECORD_BYTES, Ct as ToolCallResolved, D as MAX_PERSISTED_JSON_NODES, Dt as ToolStepSettled, E as MAX_PERSISTED_JSON_DEPTH, Et as ToolOperation, F as MAX_TURN_CANONICAL_BYTES, Ft as WorkerInputRequested, G as PromptRecord, H as PeerMessagePrepared, I as ModelCallAborted, It as WorkerOrigin, J as RUN_TERMINAL_RESERVE_BYTES, K as PromptRecordEnvelope, L as ModelCompleted, Lt as WorkerOriginRecorded, M as MAX_RUN_RECOVERY_SUFFIX_RECORDS, Mt as WorkerContinuation, N as MAX_RUN_TERMINAL_BYTES, Nt as WorkerInputCompleted, O as MAX_RUN_CONTINUATION_BYTES, Ot as ToolUnavailable, P as MAX_RUN_TOOL_CALL_IDENTITIES, Pt as WorkerInputRefused, Q as RecordJson, R as ModelResponseInterrupted, Rt as WorkerReportPrepared, S as KnownRecordPayload, St as ToolCallResolution, T as MAX_PERSISTED_JSON_COLLECTION_LENGTH, Tt as ToolCallUnknown, U as PersistedJson, V as PROMPT_EVIDENCE_TAGS, Vt as WorkerStopRequested, W as ProducerId, X as RecordEnvelope, Y as RUN_TERMINAL_RESERVE_RECORDS, Z as RecordId, _ as DefinitionDigestInput, _t as SubmissionSettledRecord, a as CURRENT_CANONICAL_SCHEMA_VERSION, at as RunDurationExhausted, b as Digest, bt as ToolApprovalDecided, c as CanonicalBatch, ct as RunPosition, d as CanonicalRecordPayload, dt as SettlementOutcome, et as RepairAnnotated, f as CanonicalSequence, ft as SubagentJoined, g as DeclaredToolCall, gt as SubmissionSettled, h as ContinuationAccounting, ht as SubagentStarted, i as BatchId, it as RunContinuation, j as MAX_RUN_RECOVERY_SUFFIX_BYTES, jt as WorkerAdmission, k as MAX_RUN_EVIDENCE_BYTES, kt as UserInputRecorded, l as CanonicalRecord, lt as RunStartedRecord, m as ContextEvidenceReference, mt as SubagentRequested, n as AgentUpdateEmitted, nt as RunCompleted, o as CURRENT_RECORD_FORMAT, ot as RunFailed, p as CompactionCreated, pt as SubagentLineageRecorded, q as PromptRecordPayload, r as ApprovalDecision, rt as RunContextRecorded, s as CURRENT_RECORD_VERSION, st as RunPolicyUsageReserved, t as AbortRequested, tt as ReplayContract, u as CanonicalRecordEnvelope, ut as SettlementFailureDiagnostic, v as DefinitionDigests, vt as SubtreeBudgetReserved, w as MAX_PERSISTED_JSON_BYTES, wt as ToolCallSettled, x as EvidenceReference, xt as ToolApprovalRequested, y as DeploymentId, yt as ThreadCreated, z as ModelResponseRecorded, zt as WorkerReportRefused } from "../Records-DzL4Kbtw.mjs";
|
|
2
2
|
export { AbortRequested, AgentUpdateEmitted, ApprovalDecision, BatchId, CURRENT_CANONICAL_SCHEMA_VERSION, CURRENT_RECORD_FORMAT, CURRENT_RECORD_VERSION, CanonicalBatch, CanonicalRecord, CanonicalRecordEnvelope, CanonicalRecordPayload, CanonicalSequence, CompactionCreated, ContextEvidenceReference, ContinuationAccounting, DeclaredToolCall, DefinitionDigestInput, DefinitionDigests, DeploymentId, Digest, EvidenceReference, KnownRecordPayload, MAX_CANONICAL_RECORD_BYTES, MAX_PERSISTED_JSON_BYTES, MAX_PERSISTED_JSON_COLLECTION_LENGTH, MAX_PERSISTED_JSON_DEPTH, MAX_PERSISTED_JSON_NODES, MAX_RUN_CONTINUATION_BYTES, MAX_RUN_EVIDENCE_BYTES, MAX_RUN_EVIDENCE_RECORDS, MAX_RUN_RECOVERY_SUFFIX_BYTES, MAX_RUN_RECOVERY_SUFFIX_RECORDS, MAX_RUN_TERMINAL_BYTES, MAX_RUN_TOOL_CALL_IDENTITIES, MAX_TURN_CANONICAL_BYTES, ModelCallAborted, ModelCompleted, ModelResponseInterrupted, ModelResponseRecorded, ObservationOffset, PROMPT_EVIDENCE_TAGS, PeerMessagePrepared, PersistedJson, ProducerId, PromptRecord, PromptRecordEnvelope, PromptRecordPayload, RUN_TERMINAL_RESERVE_BYTES, RUN_TERMINAL_RESERVE_RECORDS, RecordEnvelope, RecordId, RecordJson, RepairAnnotated, ReplayContract, RunCompleted, RunContextRecorded, RunContinuation, RunDurationExhausted, RunFailed, RunPolicyUsageReserved, RunPosition, RunStartedRecord, SettlementFailureDiagnostic, SettlementOutcome, SubagentJoined, SubagentLineageRecorded, SubagentRequested, SubagentStarted, SubmissionSettled, SubmissionSettledRecord, SubtreeBudgetReserved, ThreadCreated, ToolApprovalDecided, ToolApprovalRequested, ToolCallResolution, ToolCallResolved, ToolCallSettled, ToolCallUnknown, ToolOperation, ToolStepSettled, ToolUnavailable, UserInputRecorded, WorkHandoffCompleted, WorkerAdmission, WorkerContinuation, WorkerInputCompleted, WorkerInputRefused, WorkerInputRequested, WorkerOrigin, WorkerOriginRecorded, WorkerReportPrepared, WorkerReportRefused, WorkerReportingIntent, WorkerStopRequested };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as ResumeFromTurnBoundary, A as AwaitHostSettlement, B as NoAction, D as AwaitApprovalDecision, E as ApplyUnknownResolutions, F as DeclaredPendingBatchEvidence, G as RecoveryDecision, H as OpenToolCallEvidence, I as DelegationAdmissionEvidence, J as ReleaseOrphanChildReservation, K as RecoveryEvidence, L as EnsureWaitingForChild, M as AwaitUnknownResolution, N as CompleteChildAdmission, O as AwaitChildAdmissionResolution, P as CompleteMaterialization, Q as RepairSubagentStartLink, R as FinalizeLedgerFromHistory, T as ApplyJoinAccounting, U as PendingApprovalEvidence, V as OpenDelegationCallEvidence, W as PropagateChildAbort, X as RepairJoinMarker, Y as RepairInputMarker, Z as RepairReadiness, at as SettleJoinedWithHost, et as ResumePendingToolBatch, it as SettleAborted, j as AwaitParentEstablishment, k as AwaitChildSettlement, nt as ResumeWaitingParent, ot as classifyRecovery, rt as RevertJoining, st as pendingApprovalForRecovery, tt as ResumeSuspended, w as ApplyInput, z as MarkUnknown } from "../Admin-
|
|
1
|
+
import { $ as ResumeFromTurnBoundary, A as AwaitHostSettlement, B as NoAction, D as AwaitApprovalDecision, E as ApplyUnknownResolutions, F as DeclaredPendingBatchEvidence, G as RecoveryDecision, H as OpenToolCallEvidence, I as DelegationAdmissionEvidence, J as ReleaseOrphanChildReservation, K as RecoveryEvidence, L as EnsureWaitingForChild, M as AwaitUnknownResolution, N as CompleteChildAdmission, O as AwaitChildAdmissionResolution, P as CompleteMaterialization, Q as RepairSubagentStartLink, R as FinalizeLedgerFromHistory, T as ApplyJoinAccounting, U as PendingApprovalEvidence, V as OpenDelegationCallEvidence, W as PropagateChildAbort, X as RepairJoinMarker, Y as RepairInputMarker, Z as RepairReadiness, at as SettleJoinedWithHost, et as ResumePendingToolBatch, it as SettleAborted, j as AwaitParentEstablishment, k as AwaitChildSettlement, nt as ResumeWaitingParent, ot as classifyRecovery, rt as RevertJoining, st as pendingApprovalForRecovery, tt as ResumeSuspended, w as ApplyInput, z as MarkUnknown } from "../Admin-Qa3I1oA5.mjs";
|
|
2
2
|
export { ApplyInput, ApplyJoinAccounting, ApplyUnknownResolutions, AwaitApprovalDecision, AwaitChildAdmissionResolution, AwaitChildSettlement, AwaitHostSettlement, AwaitParentEstablishment, AwaitUnknownResolution, CompleteChildAdmission, CompleteMaterialization, DeclaredPendingBatchEvidence, DelegationAdmissionEvidence, EnsureWaitingForChild, FinalizeLedgerFromHistory, MarkUnknown, NoAction, OpenDelegationCallEvidence, OpenToolCallEvidence, PendingApprovalEvidence, PropagateChildAbort, RecoveryDecision, RecoveryEvidence, ReleaseOrphanChildReservation, RepairInputMarker, RepairJoinMarker, RepairReadiness, RepairSubagentStartLink, ResumeFromTurnBoundary, ResumePendingToolBatch, ResumeSuspended, ResumeWaitingParent, RevertJoining, SettleAborted, SettleJoinedWithHost, classifyRecovery, pendingApprovalForRecovery };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { SettlementId, SubmissionId, ThreadId, ToolCallId } from "../core/Identifiers.mjs";
|
|
3
|
-
import { dt as SettlementOutcome, g as DeclaredToolCall, r as ApprovalDecision } from "../Records-
|
|
3
|
+
import { dt as SettlementOutcome, g as DeclaredToolCall, r as ApprovalDecision } from "../Records-DzL4Kbtw.mjs";
|
|
4
4
|
import { ChildReservationId, WaitingChild, submissionSettlementId } from "./SubmissionLedger.mjs";
|
|
5
5
|
import { Effect, Schema } from "effect";
|
|
6
6
|
//#region src/durable/Recovery.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { C as EvidenceReference, ot as RunContextRecorded, st as RunContinuation } from "../Records-BTnGRdcf.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { S as resolveEvidence, _ as executionRunIds, a as canonicalRecordBytes, b as terminalUsageCharge, c as prepareProgressAppend, d as resolveExecutionEvidence, f as runEvidence, g as canonicalRunIds, h as verifyRunContinuations, l as readContinuation, m as validateSuffix, n as CurrentRunWriter, o as isOperationalRecord, p as validateProgressAppend, r as ProgressAppendReader, s as makeProgressWriter, t as CurrentRunSettlement, u as readRunEvidenceSnapshot, v as isPreContinuationFact, x as reference, y as isWorkHandoff } from "../RunContinuation-
|
|
2
|
+
import { go as ProgressAppendRecord } from "../Admin-Qa3I1oA5.mjs";
|
|
3
|
+
import { S as resolveEvidence, _ as executionRunIds, a as canonicalRecordBytes, b as terminalUsageCharge, c as prepareProgressAppend, d as resolveExecutionEvidence, f as runEvidence, g as canonicalRunIds, h as verifyRunContinuations, l as readContinuation, m as validateSuffix, n as CurrentRunWriter, o as isOperationalRecord, p as validateProgressAppend, r as ProgressAppendReader, s as makeProgressWriter, t as CurrentRunSettlement, u as readRunEvidenceSnapshot, v as isPreContinuationFact, x as reference, y as isWorkHandoff } from "../RunContinuation-3jB5pULC.mjs";
|
|
4
4
|
export { CurrentRunSettlement, CurrentRunWriter, EvidenceReference, ProgressAppendReader, type ProgressAppendRecord, RunContextRecorded, RunContinuation, canonicalRecordBytes, canonicalRunIds, executionRunIds, isOperationalRecord, isPreContinuationFact, isWorkHandoff, makeProgressWriter, prepareProgressAppend, readContinuation, readRunEvidenceSnapshot, reference, resolveEvidence, resolveExecutionEvidence, runEvidence, terminalUsageCharge, validateProgressAppend, validateSuffix, verifyRunContinuations };
|