effect-agent 0.1.0-beta.144 → 0.1.0-beta.148
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Admin-CQMppCcy.d.mts → Admin-BzPfXvzC.d.mts} +37 -22
- package/dist/Agent-1DMSO_Fl.mjs.map +1 -1
- package/dist/{Agent-BWhD4Dvu.d.mts → Agent-Cjd_ZveM.d.mts} +7 -3
- package/dist/{AgentRuntime-xeCUXutN.mjs → AgentRuntime-D8U9gl9Q.mjs} +23 -18
- package/dist/AgentRuntime-D8U9gl9Q.mjs.map +1 -0
- package/dist/{AgentRuntime-B4kIzmSF.d.mts → AgentRuntime-DZdgNcBk.d.mts} +5 -5
- package/dist/{DurableAgentRuntime-D8GI66mP.mjs → DurableAgentRuntime-N5Meflyt.mjs} +70 -42
- package/dist/DurableAgentRuntime-N5Meflyt.mjs.map +1 -0
- package/dist/{EventSource-w9PonN9X.d.mts → EventSource-DJW_1kPY.d.mts} +2 -2
- package/dist/{Messaging-Dnmk31yq.d.mts → Messaging-ccQURKCf.d.mts} +3 -3
- package/dist/{MessagingHost-CajpPDPG.d.mts → MessagingHost-D04wE-7W.d.mts} +2 -2
- package/dist/{Output-DhtWbBcw.d.mts → Output-CFD1CPfU.d.mts} +2 -2
- package/dist/{PreparedInputAdmission-BfcLy_k4.d.mts → PreparedInputAdmission-CNRSDoYu.d.mts} +3 -3
- package/dist/{RunOptions-IlEXLG5F.d.mts → RunOptions-Cy7CjrjS.d.mts} +2 -2
- package/dist/{Subagent-8RzJkqJ9.mjs → Subagent-hG9lJ7tJ.mjs} +2 -2
- package/dist/{Subagent-8RzJkqJ9.mjs.map → Subagent-hG9lJ7tJ.mjs.map} +1 -1
- package/dist/{Subagent-Cl8D1mFM.d.mts → Subagent-zS6prSK6.d.mts} +5 -5
- package/dist/{SubagentHost-B6f4PBC2.d.mts → SubagentHost-C-4A7tA2.d.mts} +2 -2
- package/dist/{Subscription-ClkC4_T0.d.mts → Subscription-C279AjM6.d.mts} +2 -2
- package/dist/{SubscriptionInput-CMjEKL1z.d.mts → SubscriptionInput-7R-Xrpxd.d.mts} +2 -2
- package/dist/capabilities/Commands.d.mts +1 -1
- package/dist/capabilities/Messaging.d.mts +1 -1
- package/dist/capabilities/RunHooks.d.mts +1 -1
- package/dist/capabilities/Subagent.d.mts +1 -1
- package/dist/capabilities/Subagent.mjs +1 -1
- package/dist/core/Agent.d.mts +1 -1
- package/dist/durable/Admin.d.mts +1 -1
- package/dist/durable/AgentRegistration.d.mts +1 -1
- package/dist/durable/Certification.d.mts +1 -1
- package/dist/durable/CommittedActivity.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.mjs +1 -1
- package/dist/durable/EventSource.d.mts +1 -1
- package/dist/durable/GitHubWorkflowSource.d.mts +3 -3
- package/dist/durable/LifecyclePublication.d.mts +2 -2
- package/dist/durable/LifecyclePublication.mjs +32 -12
- package/dist/durable/LifecyclePublication.mjs.map +1 -1
- package/dist/durable/MessageDelivery.d.mts +41 -41
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +39 -39
- package/dist/durable/PersistentHistory.d.mts +1 -1
- package/dist/durable/PreparedInputAdmission.d.mts +1 -1
- package/dist/durable/Recovery.d.mts +1 -1
- package/dist/durable/RunJournal.d.mts +1 -1
- package/dist/durable/Scheduling.d.mts +1 -1
- package/dist/durable/SubmissionLedger.d.mts +1 -1
- package/dist/durable/SubmissionLedgerConformance.d.mts +1 -1
- package/dist/durable/SubmissionStatus.d.mts +1 -1
- package/dist/durable/Subscription.d.mts +1 -1
- package/dist/durable/SubscriptionInput.d.mts +1 -1
- package/dist/durable/SubscriptionStoreConformance.d.mts +1 -1
- package/dist/durable/SubscriptionTools.d.mts +2 -2
- package/dist/durable/SubscriptionTransition.d.mts +1 -1
- package/dist/durable/Subscriptions.d.mts +5 -5
- package/dist/durable/ThreadContextHistory.d.mts +1 -1
- package/dist/durable/ThreadInvariants.d.mts +1 -1
- package/dist/durable/ThreadProjectionMaintenance.d.mts +1 -1
- package/dist/durable/ThreadStore.d.mts +1 -1
- package/dist/durable/ThreadStoreConformance.d.mts +1 -1
- package/dist/durable/WorkerHost.d.mts +25 -5
- package/dist/durable/WorkerHost.mjs.map +1 -1
- package/dist/engine/AgentRuntime.d.mts +1 -1
- package/dist/engine/AgentRuntime.mjs +1 -1
- package/dist/engine/MessagingHost.d.mts +1 -1
- package/dist/engine/Output.d.mts +1 -1
- package/dist/engine/Output.mjs +1 -1
- package/dist/engine/RunOptions.d.mts +1 -1
- package/dist/engine/SubagentHost.d.mts +1 -1
- package/dist/index.d.mts +13 -13
- package/dist/index.mjs +3 -3
- package/dist/{output-contract-CANJJGA5.mjs → output-contract-DS-S8mTv.mjs} +46 -10
- package/dist/{output-contract-CANJJGA5.mjs.map → output-contract-DS-S8mTv.mjs.map} +1 -1
- package/package.json +1 -1
- package/src/core/Agent.ts +6 -2
- package/src/durable/DurableAgentRuntime.ts +50 -58
- package/src/durable/LifecyclePublication.ts +79 -25
- package/src/durable/WorkerHost.ts +23 -1
- package/src/durable/internal/worker-host.ts +169 -17
- package/src/engine/internal/agent-runtime.ts +80 -18
- package/src/engine/internal/output-contract.ts +67 -8
- package/dist/AgentRuntime-xeCUXutN.mjs.map +0 -1
- package/dist/DurableAgentRuntime-D8GI66mP.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as ThreadHistory } from "../ThreadHistory-tS1KwxHR.mjs";
|
|
2
|
-
import { ni as ThreadStore } from "../Admin-
|
|
2
|
+
import { ni as ThreadStore } from "../Admin-BzPfXvzC.mjs";
|
|
3
3
|
import { Layer } from "effect";
|
|
4
4
|
declare namespace PersistentHistory_d_exports {
|
|
5
5
|
export { layer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as admitPreparedInput, t as PreparedInputAdmission } from "../PreparedInputAdmission-
|
|
1
|
+
import { r as admitPreparedInput, t as PreparedInputAdmission } from "../PreparedInputAdmission-CNRSDoYu.mjs";
|
|
2
2
|
export { PreparedInputAdmission, admitPreparedInput };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as RepairSubagentStartLink, A as AwaitChildSettlement, B as MarkUnknown, D as ApplyUnknownResolutions, E as ApplyJoinAccounting, F as CompleteMaterialization, G as PropagateChildAbort, H as OpenDelegationCallEvidence, I as DeclaredPendingBatchEvidence, K as RecoveryDecision, L as DelegationAdmissionEvidence, M as AwaitParentEstablishment, N as AwaitUnknownResolution, O as AwaitApprovalDecision, P as CompleteChildAdmission, Q as RepairReadiness, R as EnsureWaitingForChild, T as ApplyInput, U as OpenToolCallEvidence, V as NoAction, W as PendingApprovalEvidence, X as RepairInputMarker, Y as ReleaseOrphanChildReservation, Z as RepairJoinMarker, at as SettleAborted, et as ResumeFromTurnBoundary, it as RevertJoining, j as AwaitHostSettlement, k as AwaitChildAdmissionResolution, nt as ResumeSuspended, ot as SettleJoinedWithHost, q as RecoveryEvidence, rt as ResumeWaitingParent, st as classifyRecovery, tt as ResumePendingToolBatch, w as AppendReservedSettlement, z as FinalizeLedgerFromHistory } from "../Admin-
|
|
1
|
+
import { $ as RepairSubagentStartLink, A as AwaitChildSettlement, B as MarkUnknown, D as ApplyUnknownResolutions, E as ApplyJoinAccounting, F as CompleteMaterialization, G as PropagateChildAbort, H as OpenDelegationCallEvidence, I as DeclaredPendingBatchEvidence, K as RecoveryDecision, L as DelegationAdmissionEvidence, M as AwaitParentEstablishment, N as AwaitUnknownResolution, O as AwaitApprovalDecision, P as CompleteChildAdmission, Q as RepairReadiness, R as EnsureWaitingForChild, T as ApplyInput, U as OpenToolCallEvidence, V as NoAction, W as PendingApprovalEvidence, X as RepairInputMarker, Y as ReleaseOrphanChildReservation, Z as RepairJoinMarker, at as SettleAborted, et as ResumeFromTurnBoundary, it as RevertJoining, j as AwaitHostSettlement, k as AwaitChildAdmissionResolution, nt as ResumeSuspended, ot as SettleJoinedWithHost, q as RecoveryEvidence, rt as ResumeWaitingParent, st as classifyRecovery, tt as ResumePendingToolBatch, w as AppendReservedSettlement, z as FinalizeLedgerFromHistory } from "../Admin-BzPfXvzC.mjs";
|
|
2
2
|
export { AppendReservedSettlement, ApplyInput, ApplyJoinAccounting, ApplyUnknownResolutions, AwaitApprovalDecision, AwaitChildAdmissionResolution, AwaitChildSettlement, AwaitHostSettlement, AwaitParentEstablishment, AwaitUnknownResolution, CompleteChildAdmission, CompleteMaterialization, DeclaredPendingBatchEvidence, DelegationAdmissionEvidence, EnsureWaitingForChild, FinalizeLedgerFromHistory, MarkUnknown, NoAction, OpenDelegationCallEvidence, OpenToolCallEvidence, PendingApprovalEvidence, PropagateChildAbort, RecoveryDecision, RecoveryEvidence, ReleaseOrphanChildReservation, RepairInputMarker, RepairJoinMarker, RepairReadiness, RepairSubagentStartLink, ResumeFromTurnBoundary, ResumePendingToolBatch, ResumeSuspended, ResumeWaitingParent, RevertJoining, SettleAborted, SettleJoinedWithHost, classifyRecovery };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $i as
|
|
1
|
+
import { $i as runDurationBatchId, Aa as turnResultsBatchId, Ai as JournalBoundary, Bi as compactionBatchId, Ca as turnBatchId, Da as turnResponseBatch, Ea as turnPreparedBatchId, Fi as TurnCommitInput, Gi as modelResponseInterruptedRecordId, Hi as firstWorkerInputRecordId, Ii as agentUpdateRecordId, Ji as projectRunJournal, Ki as modelResponseRecordId, Li as approvalDecisionBatchId, Ma as workerOriginRecordId, Mi as RunJournalProjection, Na as workerReportRecordId, Ni as RunJournalUsage, Oa as turnResponseBatchId, Qi as runCompletionDigest, Ri as childIdempotencyKeyFor, Sa as turnApprovalsBatchId, Ta as turnIdForRun, Ui as markUnknownBatchId, Vi as compactionRecordId, Wi as modelResponseInterruptedBatchId, Xi as promptFromCanonicalRecords, Yi as projectRunJournalStream, Zi as runCompletedRecordId, _a as toolCallResultBatchId, aa as subagentJoinedRecordId, ba as toolStepSettledBatchId, ca as subagentRequestedBatchId, da as subagentStartedRecordId, ea as runDurationRecordId, fa as toolApprovalDecisionRecordId, ga as toolCallResolvedRecordId, ha as toolCallResolutionBatchId, ia as subagentJoinBatchId, ja as workerInputRecordId, ji as RunJournalError, ka as turnResultsBatch, la as subagentRequestedRecordId, ma as toolCallPreparedRecordId, na as runStartedBatchId, oa as subagentLineageBatchId, pa as toolApprovalRequestRecordId, qi as peerMessageRecordId, ra as runStartedRecordId, sa as subagentLineageRecordId, ta as runIdForSubmission, ua as subagentStartedBatchId, va as toolCallSettledRecordId, wa as turnCanonicalBatch, xa as toolStepSettledRecordId, ya as toolCallUnknownRecordId, zi as childThreadIdFor } from "../Admin-BzPfXvzC.mjs";
|
|
2
2
|
export { JournalBoundary, RunJournalError, RunJournalProjection, RunJournalUsage, TurnCommitInput, agentUpdateRecordId, approvalDecisionBatchId, childIdempotencyKeyFor, childThreadIdFor, compactionBatchId, compactionRecordId, firstWorkerInputRecordId, markUnknownBatchId, modelResponseInterruptedBatchId, modelResponseInterruptedRecordId, modelResponseRecordId, peerMessageRecordId, projectRunJournal, projectRunJournalStream, promptFromCanonicalRecords, runCompletedRecordId, runCompletionDigest, runDurationBatchId, runDurationRecordId, runIdForSubmission, runStartedBatchId, runStartedRecordId, subagentJoinBatchId, subagentJoinedRecordId, subagentLineageBatchId, subagentLineageRecordId, subagentRequestedBatchId, subagentRequestedRecordId, subagentStartedBatchId, subagentStartedRecordId, toolApprovalDecisionRecordId, toolApprovalRequestRecordId, toolCallPreparedRecordId, toolCallResolutionBatchId, toolCallResolvedRecordId, toolCallResultBatchId, toolCallSettledRecordId, toolCallUnknownRecordId, toolStepSettledBatchId, toolStepSettledRecordId, turnApprovalsBatchId, turnBatchId, turnCanonicalBatch, turnIdForRun, turnPreparedBatchId, turnResponseBatch, turnResponseBatchId, turnResultsBatch, turnResultsBatchId, workerInputRecordId, workerOriginRecordId, workerReportRecordId };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as Principal } from "../Receipt-BAHyigAF.mjs";
|
|
2
2
|
import { h as DefinitionDigests } from "../Records-B5GFWCpn.mjs";
|
|
3
|
-
import { dr as DurableSubmitAgent, pt as AdmissionFence } from "../Admin-
|
|
3
|
+
import { dr as DurableSubmitAgent, pt as AdmissionFence } from "../Admin-BzPfXvzC.mjs";
|
|
4
4
|
import { A as ScheduleSnapshotPage, B as ScheduledInputAdmission, C as ScheduleRecord, D as ScheduleScope, F as ScheduleTimingRequest, I as ScheduleValidationError, L as ScheduleWake, M as ScheduleStore, N as ScheduleStoreFailure, W as SchedulingLimits, c as ScheduleDestination, f as ScheduleId, j as ScheduleStorageError, k as ScheduleSnapshot, m as ScheduleKey, n as ScheduleAuthorizationError, r as ScheduleAuthorizer, y as ScheduleOwner } from "../Schedule-CtYREFnz.mjs";
|
|
5
5
|
import { Context, Crypto, Effect, Layer, Schema } from "effect";
|
|
6
6
|
declare namespace Scheduling_d_exports {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { i as QueueSequence, n as JoinedToHost, r as Principal, t as IdempotencyKey } from "../Receipt-BAHyigAF.mjs";
|
|
2
|
-
import { $t as ParentLinkage, An as SuspensionReason, At as ChildReservationConflict, Bn as settlementFailureFromRecord, Bt as InputAppliedMarker, Cn as SubmissionLookupByKey, Ct as ApprovalDecisionIntent, Dn as SubmissionWorkItem, Dt as ChildAttachmentSnapshot, En as SubmissionState, Et as BeginChildBudgetReleaseRequest, Fn as UnknownResolutionIntent, Ft as Claim, Gn as submissionSettlementBatchId, Gt as MarkInputAppliedRequest, Hn as submissionAbortRecordId, Ht as JoiningClaim, In as WaitingChild, It as ClaimHandoff, Jn as workerTerminalFromRecord, Jt as MarkUnknownRequest, Kn as submissionSettlementId, Kt as MarkJoinedRequest, Ln as WaitingForChildSuspension, Lt as ClaimJoiningRequest, Mn as UnknownResolution, Mt as ChildReservationStatus, Nn as UnknownResolutionCommand, Nt as ChildSettledNotification, On as SuspendRequest, Ot as ChildBudgetReservationRequest, Pn as UnknownResolutionConflict, Pt as ChildSettledOutcome, Qt as OwnershipToken, Rn as WorkerLedgerState, Rt as ClaimRequest, Sn as SubmissionLookupById, St as ApprovalDecisionCommand, Tn as SubmissionSnapshot, Tt as AttachChildToReservationRequest, Un as submissionInputBatchId, Ut as LedgerCapabilities, Vn as submissionAbortBatchId, Vt as JoinSnapshot, Wn as submissionInputRecordId, Wt as LedgerError, Xt as OwnershipRenewal, Yt as OwnershipLost, Zt as OwnershipSnapshot, _n as SubmissionAdmissionFence, _t as AdmissionPolicyError, an as ReservedChildBudget, bt as AdmissionResult, cn as ResolutionCompletedWithResult, ct as AbortCommand, dn as RevertJoiningRequest, dt as AdmissionAdmitted, en as RecoverySnapshot, fn as Settlement, ft as AdmissionConflict, gn as SettlementReservationSnapshot, gt as AdmissionNotAdmitted, hn as SettlementReservation, ht as AdmissionIndeterminate, in as RenewOwnershipRequest, jn as SuspensionSnapshot, jt as ChildReservationId, kn as SuspensionOutcome, kt as ChildBudgetReservationSnapshot, ln as ResolutionNeverHappened, lt as AbortIntent, mn as SettlementFinalization, mt as AdmissionGroup, nn as ReleaseChildBudgetRequest, on as ReservedSettlement, pn as SettlementConflict, pt as AdmissionFence, qn as submissionSettlementRecordId, qt as MarkReadyRequest, rn as ReleaseOwnershipRequest, sn as ResolutionAbortSubmission, tn as RecoverySnapshotRequest, un as ResolutionSafeToRetry, ut as AbortIntentRequest, vn as SubmissionLedger, vt as AdmissionRequest, wn as SubmissionScheduling, wt as ApprovalPendingSuspension, xn as SubmissionLookup, xt as ApprovalConflict, yn as SubmissionLedgerFailure, yt as AdmissionResolution, zn as WorkerStopCommand, zt as DEFAULT_OWNERSHIP_LEASE_DURATION } from "../Admin-
|
|
2
|
+
import { $t as ParentLinkage, An as SuspensionReason, At as ChildReservationConflict, Bn as settlementFailureFromRecord, Bt as InputAppliedMarker, Cn as SubmissionLookupByKey, Ct as ApprovalDecisionIntent, Dn as SubmissionWorkItem, Dt as ChildAttachmentSnapshot, En as SubmissionState, Et as BeginChildBudgetReleaseRequest, Fn as UnknownResolutionIntent, Ft as Claim, Gn as submissionSettlementBatchId, Gt as MarkInputAppliedRequest, Hn as submissionAbortRecordId, Ht as JoiningClaim, In as WaitingChild, It as ClaimHandoff, Jn as workerTerminalFromRecord, Jt as MarkUnknownRequest, Kn as submissionSettlementId, Kt as MarkJoinedRequest, Ln as WaitingForChildSuspension, Lt as ClaimJoiningRequest, Mn as UnknownResolution, Mt as ChildReservationStatus, Nn as UnknownResolutionCommand, Nt as ChildSettledNotification, On as SuspendRequest, Ot as ChildBudgetReservationRequest, Pn as UnknownResolutionConflict, Pt as ChildSettledOutcome, Qt as OwnershipToken, Rn as WorkerLedgerState, Rt as ClaimRequest, Sn as SubmissionLookupById, St as ApprovalDecisionCommand, Tn as SubmissionSnapshot, Tt as AttachChildToReservationRequest, Un as submissionInputBatchId, Ut as LedgerCapabilities, Vn as submissionAbortBatchId, Vt as JoinSnapshot, Wn as submissionInputRecordId, Wt as LedgerError, Xt as OwnershipRenewal, Yt as OwnershipLost, Zt as OwnershipSnapshot, _n as SubmissionAdmissionFence, _t as AdmissionPolicyError, an as ReservedChildBudget, bt as AdmissionResult, cn as ResolutionCompletedWithResult, ct as AbortCommand, dn as RevertJoiningRequest, dt as AdmissionAdmitted, en as RecoverySnapshot, fn as Settlement, ft as AdmissionConflict, gn as SettlementReservationSnapshot, gt as AdmissionNotAdmitted, hn as SettlementReservation, ht as AdmissionIndeterminate, in as RenewOwnershipRequest, jn as SuspensionSnapshot, jt as ChildReservationId, kn as SuspensionOutcome, kt as ChildBudgetReservationSnapshot, ln as ResolutionNeverHappened, lt as AbortIntent, mn as SettlementFinalization, mt as AdmissionGroup, nn as ReleaseChildBudgetRequest, on as ReservedSettlement, pn as SettlementConflict, pt as AdmissionFence, qn as submissionSettlementRecordId, qt as MarkReadyRequest, rn as ReleaseOwnershipRequest, sn as ResolutionAbortSubmission, tn as RecoverySnapshotRequest, un as ResolutionSafeToRetry, ut as AbortIntentRequest, vn as SubmissionLedger, vt as AdmissionRequest, wn as SubmissionScheduling, wt as ApprovalPendingSuspension, xn as SubmissionLookup, xt as ApprovalConflict, yn as SubmissionLedgerFailure, yt as AdmissionResolution, zn as WorkerStopCommand, zt as DEFAULT_OWNERSHIP_LEASE_DURATION } from "../Admin-BzPfXvzC.mjs";
|
|
3
3
|
export { AbortCommand, AbortIntent, AbortIntentRequest, AdmissionAdmitted, AdmissionConflict, AdmissionFence, AdmissionGroup, AdmissionIndeterminate, AdmissionNotAdmitted, AdmissionPolicyError, AdmissionRequest, AdmissionResolution, AdmissionResult, ApprovalConflict, ApprovalDecisionCommand, ApprovalDecisionIntent, ApprovalPendingSuspension, AttachChildToReservationRequest, BeginChildBudgetReleaseRequest, ChildAttachmentSnapshot, ChildBudgetReservationRequest, ChildBudgetReservationSnapshot, ChildReservationConflict, ChildReservationId, ChildReservationStatus, ChildSettledNotification, ChildSettledOutcome, Claim, ClaimHandoff, ClaimJoiningRequest, ClaimRequest, DEFAULT_OWNERSHIP_LEASE_DURATION, IdempotencyKey, InputAppliedMarker, JoinSnapshot, JoinedToHost, JoiningClaim, LedgerCapabilities, LedgerError, MarkInputAppliedRequest, MarkJoinedRequest, MarkReadyRequest, MarkUnknownRequest, OwnershipLost, OwnershipRenewal, OwnershipSnapshot, OwnershipToken, ParentLinkage, Principal, QueueSequence, RecoverySnapshot, RecoverySnapshotRequest, ReleaseChildBudgetRequest, ReleaseOwnershipRequest, RenewOwnershipRequest, ReservedChildBudget, ReservedSettlement, ResolutionAbortSubmission, ResolutionCompletedWithResult, ResolutionNeverHappened, ResolutionSafeToRetry, RevertJoiningRequest, Settlement, SettlementConflict, SettlementFinalization, SettlementReservation, SettlementReservationSnapshot, SubmissionAdmissionFence, SubmissionLedger, SubmissionLedgerFailure, SubmissionLookup, SubmissionLookupById, SubmissionLookupByKey, SubmissionScheduling, SubmissionSnapshot, SubmissionState, SubmissionWorkItem, SuspendRequest, SuspensionOutcome, SuspensionReason, SuspensionSnapshot, UnknownResolution, UnknownResolutionCommand, UnknownResolutionConflict, UnknownResolutionIntent, WaitingChild, WaitingForChildSuspension, WorkerLedgerState, WorkerStopCommand, settlementFailureFromRecord, submissionAbortBatchId, submissionAbortRecordId, submissionInputBatchId, submissionInputRecordId, submissionSettlementBatchId, submissionSettlementId, submissionSettlementRecordId, workerTerminalFromRecord };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as DigestError } from "../Digest-U69rDHuO.mjs";
|
|
2
|
-
import { vn as SubmissionLedger, yn as SubmissionLedgerFailure } from "../Admin-
|
|
2
|
+
import { vn as SubmissionLedger, yn as SubmissionLedgerFailure } from "../Admin-BzPfXvzC.mjs";
|
|
3
3
|
import { Crypto, Effect, Schema } from "effect";
|
|
4
4
|
//#region src/durable/SubmissionLedgerConformance.d.ts
|
|
5
5
|
declare const SubmissionLedgerConformanceViolation_base: Schema.Class<SubmissionLedgerConformanceViolation, Schema.TaggedStruct<"SubmissionLedgerConformanceViolation", {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Di as SettledSubmission, Ei as PendingSubmission, Oi as SubmissionStatus } from "../Admin-BzPfXvzC.mjs";
|
|
2
2
|
export { PendingSubmission, SettledSubmission, SubmissionStatus };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as defaultSubscriptionLimits, C as SubscriptionScanCursors, D as SubscriptionStore, E as SubscriptionSourceError, M as subscriptionKeyString, O as SubscriptionStoreFailure, S as SubscriptionRetentionPolicy, T as SubscriptionSnapshot, _ as SubscriptionKey, a as PreparedInput, b as SubscriptionRecord, c as SubscriptionAuthorizer, d as SubscriptionDelivery, f as SubscriptionDeliveryKey, g as SubscriptionFailpointError, h as SubscriptionFailpoint, i as EventSourceVersion, j as subscriptionDeliveryKeyString, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, s as SourceRecovery, t as AcceptedEvent, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope, x as SubscriptionRefusal, y as SubscriptionName } from "../Subscription-
|
|
1
|
+
import { A as defaultSubscriptionLimits, C as SubscriptionScanCursors, D as SubscriptionStore, E as SubscriptionSourceError, M as subscriptionKeyString, O as SubscriptionStoreFailure, S as SubscriptionRetentionPolicy, T as SubscriptionSnapshot, _ as SubscriptionKey, a as PreparedInput, b as SubscriptionRecord, c as SubscriptionAuthorizer, d as SubscriptionDelivery, f as SubscriptionDeliveryKey, g as SubscriptionFailpointError, h as SubscriptionFailpoint, i as EventSourceVersion, j as subscriptionDeliveryKeyString, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, s as SourceRecovery, t as AcceptedEvent, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope, x as SubscriptionRefusal, y as SubscriptionName } from "../Subscription-C279AjM6.mjs";
|
|
2
2
|
export { AcceptedEvent, DeliveryChange, EventAcknowledgement, EventSourceVersion, PreparedInput, SourcePartition, SourceRecovery, SubscriptionAuthorizer, SubscriptionChange, SubscriptionConfiguration, SubscriptionDelivery, SubscriptionDeliveryKey, SubscriptionDeliverySnapshot, SubscriptionError, SubscriptionFailpoint, SubscriptionFailpointError, SubscriptionKey, SubscriptionLimits, SubscriptionName, SubscriptionRecord, SubscriptionRefusal, SubscriptionRetentionPolicy, SubscriptionScanCursors, SubscriptionScope, SubscriptionSnapshot, SubscriptionSourceError, SubscriptionStore, SubscriptionStoreFailure, defaultSubscriptionLimits, subscriptionDeliveryKeyString, subscriptionKeyString };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as resolveSubscriptionInput, i as makeSubscriptionInputBinding, n as SubscriptionInputBindings, t as SubscriptionInputBinding } from "../SubscriptionInput-
|
|
1
|
+
import { a as resolveSubscriptionInput, i as makeSubscriptionInputBinding, n as SubscriptionInputBindings, t as SubscriptionInputBinding } from "../SubscriptionInput-7R-Xrpxd.mjs";
|
|
2
2
|
export { SubscriptionInputBinding, SubscriptionInputBindings, makeSubscriptionInputBinding, resolveSubscriptionInput };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as SubscriptionStore, O as SubscriptionStoreFailure, o as SourcePartition } from "../Subscription-
|
|
1
|
+
import { D as SubscriptionStore, O as SubscriptionStoreFailure, o as SourcePartition } from "../Subscription-C279AjM6.mjs";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
//#region src/durable/SubscriptionStoreConformance.d.ts
|
|
4
4
|
declare const SubscriptionStoreConformanceViolation_base: Schema.Class<SubscriptionStoreConformanceViolation, Schema.TaggedStruct<"SubscriptionStoreConformanceViolation", {
|
|
@@ -2,9 +2,9 @@ import { t as AgentId, u as ThreadId } from "../Identifiers-CN2s30fF.mjs";
|
|
|
2
2
|
import { r as Principal } from "../Receipt-BAHyigAF.mjs";
|
|
3
3
|
import { t as DurableStep } from "../DurableStep-Cry_iol4.mjs";
|
|
4
4
|
import { h as DefinitionDigests } from "../Records-B5GFWCpn.mjs";
|
|
5
|
-
import "../Admin-
|
|
5
|
+
import "../Admin-BzPfXvzC.mjs";
|
|
6
6
|
import { c as ScheduleDestination } from "../Schedule-CtYREFnz.mjs";
|
|
7
|
-
import { E as SubscriptionSourceError, g as SubscriptionFailpointError, i as EventSourceVersion, m as SubscriptionError, w as SubscriptionScope } from "../Subscription-
|
|
7
|
+
import { E as SubscriptionSourceError, g as SubscriptionFailpointError, i as EventSourceVersion, m as SubscriptionError, w as SubscriptionScope } from "../Subscription-C279AjM6.mjs";
|
|
8
8
|
import { Subscriptions } from "./Subscriptions.mjs";
|
|
9
9
|
import { Tool, Toolkit } from "effect/unstable/ai";
|
|
10
10
|
import { Crypto, Layer, Schema } from "effect";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as SubscriptionRecord, d as SubscriptionDelivery, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, t as AcceptedEvent, v as SubscriptionLimits } from "../Subscription-
|
|
1
|
+
import { b as SubscriptionRecord, d as SubscriptionDelivery, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, t as AcceptedEvent, v as SubscriptionLimits } from "../Subscription-C279AjM6.mjs";
|
|
2
2
|
import { Result } from "effect";
|
|
3
3
|
declare namespace SubscriptionTransition_d_exports {
|
|
4
4
|
export { applySubscriptionChange, applySubscriptionDeliveryChange, sameAcceptedEventIdentity, sameSourcePartition, sameSubscriptionDelivery, subscriptionCanSelect, subscriptionDeliveryCanSelect, subscriptionMatchesEvent, validateEventRetention };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as Principal } from "../Receipt-BAHyigAF.mjs";
|
|
2
2
|
import { O as PersistedJson } from "../Records-B5GFWCpn.mjs";
|
|
3
|
-
import { pt as AdmissionFence } from "../Admin-
|
|
4
|
-
import { D as SubscriptionStore, E as SubscriptionSourceError, O as SubscriptionStoreFailure, T as SubscriptionSnapshot, _ as SubscriptionKey, c as SubscriptionAuthorizer, f as SubscriptionDeliveryKey, i as EventSourceVersion, m as SubscriptionError, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope } from "../Subscription-
|
|
5
|
-
import { r as EventSources } from "../EventSource-
|
|
6
|
-
import { t as PreparedInputAdmission } from "../PreparedInputAdmission-
|
|
7
|
-
import { n as SubscriptionInputBindings } from "../SubscriptionInput-
|
|
3
|
+
import { pt as AdmissionFence } from "../Admin-BzPfXvzC.mjs";
|
|
4
|
+
import { D as SubscriptionStore, E as SubscriptionSourceError, O as SubscriptionStoreFailure, T as SubscriptionSnapshot, _ as SubscriptionKey, c as SubscriptionAuthorizer, f as SubscriptionDeliveryKey, i as EventSourceVersion, m as SubscriptionError, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope } from "../Subscription-C279AjM6.mjs";
|
|
5
|
+
import { r as EventSources } from "../EventSource-DJW_1kPY.mjs";
|
|
6
|
+
import { t as PreparedInputAdmission } from "../PreparedInputAdmission-CNRSDoYu.mjs";
|
|
7
|
+
import { n as SubscriptionInputBindings } from "../SubscriptionInput-7R-Xrpxd.mjs";
|
|
8
8
|
import { Context, Crypto, Effect, Layer } from "effect";
|
|
9
9
|
declare namespace Subscriptions_d_exports {
|
|
10
10
|
export { SubscribeOptions, SubscriptionDriver, SubscriptionFailure, SubscriptionIntake, Subscriptions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContextHistory, ContextHistoryError } from "../engine/ContextHistory.mjs";
|
|
2
|
-
import { ni as ThreadStore } from "../Admin-
|
|
2
|
+
import { ni as ThreadStore } from "../Admin-BzPfXvzC.mjs";
|
|
3
3
|
import { Layer, Schema } from "effect";
|
|
4
4
|
declare namespace ThreadContextHistory_d_exports {
|
|
5
5
|
export { ThreadContextHistoryOptions, layer };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as ProducerId, a as BatchId } from "../Records-B5GFWCpn.mjs";
|
|
2
|
-
import { Br as ThreadExport, Rr as ThreadCheckpoint, Tn as SubmissionSnapshot, c as IntegrityReport } from "../Admin-
|
|
2
|
+
import { Br as ThreadExport, Rr as ThreadCheckpoint, Tn as SubmissionSnapshot, c as IntegrityReport } from "../Admin-BzPfXvzC.mjs";
|
|
3
3
|
import { Crypto, Effect } from "effect";
|
|
4
4
|
declare namespace ThreadInvariants_d_exports {
|
|
5
5
|
export { ThreadInvariantInput, verifyThreadInvariants };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mr as FencedAppendRequest, kr as AppendResult } from "../Admin-
|
|
1
|
+
import { Mr as FencedAppendRequest, kr as AppendResult } from "../Admin-BzPfXvzC.mjs";
|
|
2
2
|
import { Context, Effect, Layer, Option, Schema } from "effect";
|
|
3
3
|
declare namespace ThreadProjectionMaintenance_d_exports {
|
|
4
4
|
export { ThreadProjectionError, ThreadProjectionMaintenance, ThreadProjectionMaintenanceService, drainDue };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $r as ThreadRecoveryCheckpoints, Ar as CheckpointRejected, Br as ThreadExport, Fr as SaveCheckpointRequest, Gr as ThreadNotMaterialized, Hr as ThreadIdentity, Ir as SaveRecoveryCheckpointRequest, Jr as ThreadOutstandingRequest, Kr as ThreadObservation, Lr as SelectedThreadRead, Mr as FencedAppendRequest, Nr as LoadCheckpointRequest, Or as AppendConflict, Pr as MAX_THREAD_EXPORT_RECORDS, Qr as ThreadRecordRequest, Rr as ThreadCheckpoint, Ur as ThreadIdentityRequest, Vr as ThreadExportRequest, Wr as ThreadMaterialization, Xr as ThreadRead, Yr as ThreadPeerCountRequest, Zr as ThreadReadRequest, ai as ThreadStoreFailure, ci as ThreadTailRequest, di as getRunInput, ei as ThreadRunInputRequest, fi as readOutstanding, ii as ThreadStoreError, jr as FenceRejected, kr as AppendResult, li as ThreadWorkerStateRequest, ni as ThreadStore, pi as readWorkerState, qr as ThreadOutstanding, ri as ThreadStoreDiagnostic, si as ThreadTail, ti as ThreadSelection, ui as getRecord, zr as ThreadCheckpoints } from "../Admin-
|
|
1
|
+
import { $r as ThreadRecoveryCheckpoints, Ar as CheckpointRejected, Br as ThreadExport, Fr as SaveCheckpointRequest, Gr as ThreadNotMaterialized, Hr as ThreadIdentity, Ir as SaveRecoveryCheckpointRequest, Jr as ThreadOutstandingRequest, Kr as ThreadObservation, Lr as SelectedThreadRead, Mr as FencedAppendRequest, Nr as LoadCheckpointRequest, Or as AppendConflict, Pr as MAX_THREAD_EXPORT_RECORDS, Qr as ThreadRecordRequest, Rr as ThreadCheckpoint, Ur as ThreadIdentityRequest, Vr as ThreadExportRequest, Wr as ThreadMaterialization, Xr as ThreadRead, Yr as ThreadPeerCountRequest, Zr as ThreadReadRequest, ai as ThreadStoreFailure, ci as ThreadTailRequest, di as getRunInput, ei as ThreadRunInputRequest, fi as readOutstanding, ii as ThreadStoreError, jr as FenceRejected, kr as AppendResult, li as ThreadWorkerStateRequest, ni as ThreadStore, pi as readWorkerState, qr as ThreadOutstanding, ri as ThreadStoreDiagnostic, si as ThreadTail, ti as ThreadSelection, ui as getRecord, zr as ThreadCheckpoints } from "../Admin-BzPfXvzC.mjs";
|
|
2
2
|
export { AppendConflict, AppendResult, CheckpointRejected, FenceRejected, FencedAppendRequest, LoadCheckpointRequest, MAX_THREAD_EXPORT_RECORDS, SaveCheckpointRequest, SaveRecoveryCheckpointRequest, SelectedThreadRead, ThreadCheckpoint, ThreadCheckpoints, ThreadExport, ThreadExportRequest, ThreadIdentity, ThreadIdentityRequest, ThreadMaterialization, ThreadNotMaterialized, ThreadObservation, ThreadOutstanding, ThreadOutstandingRequest, ThreadPeerCountRequest, ThreadRead, ThreadReadRequest, ThreadRecordRequest, ThreadRecoveryCheckpoints, ThreadRunInputRequest, ThreadSelection, ThreadStore, ThreadStoreDiagnostic, ThreadStoreError, ThreadStoreFailure, ThreadTail, ThreadTailRequest, ThreadWorkerStateRequest, getRecord, getRunInput, readOutstanding, readWorkerState };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ar as CheckpointRejected, ai as ThreadStoreFailure, ni as ThreadStore } from "../Admin-
|
|
1
|
+
import { Ar as CheckpointRejected, ai as ThreadStoreFailure, ni as ThreadStore } from "../Admin-BzPfXvzC.mjs";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
//#region src/durable/ThreadStoreConformance.d.ts
|
|
4
4
|
declare const ThreadStoreConformanceViolation_base: Schema.Class<ThreadStoreConformanceViolation, Schema.TaggedStruct<"ThreadStoreConformanceViolation", {
|
|
@@ -1,14 +1,31 @@
|
|
|
1
|
-
import { l as SubmissionId, u as ThreadId } from "../Identifiers-CN2s30fF.mjs";
|
|
1
|
+
import { l as SubmissionId, t as AgentId, u as ThreadId } from "../Identifiers-CN2s30fF.mjs";
|
|
2
2
|
import { i as SubagentBudgetReservation } from "../SubagentContract-DdT7Cqe6.mjs";
|
|
3
3
|
import { r as Principal } from "../Receipt-BAHyigAF.mjs";
|
|
4
4
|
import { t as AgentPolicy } from "../AgentPolicy-BqDoSXO6.mjs";
|
|
5
|
-
import { r as AnyDefinition, t as Agent_d_exports } from "../Agent-
|
|
5
|
+
import { r as AnyDefinition, t as Agent_d_exports } from "../Agent-Cjd_ZveM.mjs";
|
|
6
6
|
import { c as WorkerError, f as WorkerRef, h as WorkerSource } from "../Worker-fwWkBg12.mjs";
|
|
7
|
-
import { O as PersistedJson, _ as Digest, ft as WorkerOrigin, h as DefinitionDigests, lt as WorkerContinuation } from "../Records-B5GFWCpn.mjs";
|
|
8
|
-
import { Tn as SubmissionSnapshot } from "../Admin-
|
|
7
|
+
import { O as PersistedJson, _ as Digest, d as CanonicalSequence, ft as WorkerOrigin, h as DefinitionDigests, lt as WorkerContinuation } from "../Records-B5GFWCpn.mjs";
|
|
8
|
+
import { Tn as SubmissionSnapshot } from "../Admin-BzPfXvzC.mjs";
|
|
9
9
|
import { Context, Effect, Option, Schema } from "effect";
|
|
10
10
|
declare namespace WorkerHost_d_exports {
|
|
11
|
-
export { WorkerBudgetAuthorizer, WorkerConcurrencyLimit, WorkerConcurrencyResolver, WorkerHostAuthorizationRequest, WorkerHostAuthorizer, WorkerHostConfig, WorkerHostLimits, WorkerPolicyResolver, WorkerPolicySource, WorkerPolicyTarget };
|
|
11
|
+
export { WorkerBudgetAuthorizer, WorkerConcurrencyLimit, WorkerConcurrencyResolver, WorkerHostAuthorizationRequest, WorkerHostAuthorizer, WorkerHostConfig, WorkerHostLimits, WorkerPolicyResolver, WorkerPolicySource, WorkerPolicyTarget, WorkerStartAdmission };
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* One successful start authorization at an exact source tail. This host-created hint is
|
|
15
|
+
* available only during that start's preparation and synchronous admission; it is never
|
|
16
|
+
* persisted or transported. Hooks may reuse their admission decision, but must retain
|
|
17
|
+
* current access checks at commit boundaries. A retry or changed tail gets no old grant.
|
|
18
|
+
*/
|
|
19
|
+
export interface WorkerStartAdmission {
|
|
20
|
+
readonly sourceThreadId: ThreadId;
|
|
21
|
+
readonly sourceSubmissionId?: SubmissionId;
|
|
22
|
+
readonly requestedPrincipal: Principal;
|
|
23
|
+
readonly principal: Principal;
|
|
24
|
+
readonly targetAgentId: AgentId;
|
|
25
|
+
readonly continuationOf?: WorkerContinuation;
|
|
26
|
+
readonly access: "send";
|
|
27
|
+
readonly tailSequence: CanonicalSequence;
|
|
28
|
+
readonly tailDigest: Digest;
|
|
12
29
|
}
|
|
13
30
|
/** Host-verified source input; absence never means the latest input in the Thread. */
|
|
14
31
|
export interface WorkerPolicySource {
|
|
@@ -24,6 +41,7 @@ export type WorkerPolicyTarget = {
|
|
|
24
41
|
readonly source: WorkerSource;
|
|
25
42
|
} & ({
|
|
26
43
|
readonly _tag: "InitialInput";
|
|
44
|
+
readonly admission?: WorkerStartAdmission;
|
|
27
45
|
readonly continuationOf?: WorkerContinuation;
|
|
28
46
|
readonly sourceSubmission?: SubmissionSnapshot;
|
|
29
47
|
readonly input: PersistedJson;
|
|
@@ -102,6 +120,7 @@ export declare const WorkerHostConfig: Context.Reference<{
|
|
|
102
120
|
* identifiers alone never confer any of them.
|
|
103
121
|
*/
|
|
104
122
|
export interface WorkerHostAuthorizationRequest {
|
|
123
|
+
readonly admission?: WorkerStartAdmission;
|
|
105
124
|
readonly sourceThreadId: ThreadId;
|
|
106
125
|
/** An explicitly selected owner input; authorize this locator as well as the Thread. */
|
|
107
126
|
readonly sourceSubmissionId?: SubmissionId;
|
|
@@ -124,6 +143,7 @@ export declare const WorkerHostAuthorizer: Context.Reference<{
|
|
|
124
143
|
export declare const WorkerBudgetAuthorizer: Context.Reference<{
|
|
125
144
|
readonly authorize: (request: {
|
|
126
145
|
readonly source: WorkerSource;
|
|
146
|
+
readonly admission?: WorkerStartAdmission;
|
|
127
147
|
readonly principal: Principal;
|
|
128
148
|
readonly worker: WorkerRef;
|
|
129
149
|
readonly continuationOf?: WorkerContinuation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkerHost.mjs","names":[],"sources":["../../src/durable/WorkerHost.ts"],"sourcesContent":["import { Context, Effect, Option, Schema } from \"effect\";\n\nimport type * as Agent from \"../core/Agent.ts\";\nimport type { AgentPolicy } from \"../core/AgentPolicy.ts\";\nimport type { SubmissionId, ThreadId } from \"../core/Identifiers.ts\";\nimport type { SubagentBudgetReservation } from \"../core/SubagentContract.ts\";\nimport { WorkerError, type WorkerRef, type WorkerSource } from \"../core/Worker.ts\";\nimport type {\n DefinitionDigests,\n Digest,\n PersistedJson,\n WorkerOrigin,\n WorkerContinuation,\n} from \"./Records.ts\";\nimport type { Principal, SubmissionSnapshot } from \"./SubmissionLedger.ts\";\n\n/** Host-verified source input; absence never means the latest input in the Thread. */\nexport interface WorkerPolicySource {\n readonly threadId: ThreadId;\n readonly definition: Agent.AnyDefinition;\n readonly definitions: DefinitionDigests;\n readonly submission?: SubmissionSnapshot;\n}\n\n/** Initial input is validated again at destination admission, including idempotent replay. */\nexport type WorkerPolicyTarget = {\n readonly definition: Agent.AnyDefinition;\n readonly definitions: DefinitionDigests;\n readonly source: WorkerSource;\n} & (\n | {\n readonly _tag: \"InitialInput\";\n readonly continuationOf?: WorkerContinuation;\n readonly sourceSubmission?: SubmissionSnapshot;\n readonly input: PersistedJson;\n readonly inputDigest: Digest;\n }\n | {\n readonly _tag: \"RetainedWorker\";\n /** Verified against canonical source history before this request reaches the resolver. */\n readonly origin: WorkerOrigin;\n }\n);\n\n/**\n * Opt-in host authority for policies captured in immutable application input. None preserves\n * the registered Definition's existing policy/override semantics. Some is a complete policy,\n * never merged with static overrides. Decode and authorize the exact captured revision; do not\n * read mutable settings or substitute a current capture for missing historical authority.\n * RetainedWorker may affirm only origin.policy, never replace a continuing worker's allowance.\n * Return WorkerError(unavailable) for temporarily unavailable authority so delivery can retry.\n * Implementations are acquired through Effect Layers; capture their dependencies in Layer R.\n */\nexport const WorkerPolicyResolver = Context.Reference<{\n readonly resolveSource: (\n request: WorkerPolicySource,\n ) => Effect.Effect<Option.Option<AgentPolicy>, WorkerError>;\n readonly resolveTarget: (\n request: WorkerPolicyTarget,\n ) => Effect.Effect<Option.Option<AgentPolicy>, WorkerError>;\n}>(\"@effect-agent/thread/WorkerPolicyResolver\", {\n defaultValue: () => ({\n resolveSource: () => Effect.succeed(Option.none()),\n resolveTarget: () => Effect.succeed(Option.none()),\n }),\n});\n\nconst Positive = Schema.Int.check(Schema.isGreaterThan(0));\n\n/** A host-authorized ceiling on active background workers, not retained workers or Run usage. */\nexport const WorkerConcurrencyLimit = Schema.Struct({\n maxActiveWorkersPerSource: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n});\n\nexport type WorkerConcurrencyLimit = typeof WorkerConcurrencyLimit.Type;\n\n/**\n * Optional source-aware operational authority. Resolution occurs inside every new source\n * reservation attempt, against the same canonical history used for the append CAS. None\n * preserves WorkerHostConfig; Some can only narrow it. The selected submission is exact,\n * never the latest input. Implementations must authorize that immutable capture and retain\n * construction dependencies in Layer R. Unavailable authority must return WorkerError(unavailable).\n *\n * One worker occupies a slot while any of its inputs remain unacknowledged. Steering an active\n * worker does not acquire another slot. Decreases (including zero) do not cancel incumbents;\n * an idle worker needs a slot again. Idempotent retained reservations do not reacquire slots.\n */\nexport const WorkerConcurrencyResolver = Context.Reference<{\n readonly resolve: (request: {\n readonly source: WorkerSource;\n readonly sourceSubmission?: SubmissionSnapshot;\n readonly worker: WorkerRef;\n readonly continuationOf?: WorkerContinuation;\n readonly principal: Principal;\n }) => Effect.Effect<Option.Option<WorkerConcurrencyLimit>, WorkerError>;\n}>(\"@effect-agent/thread/WorkerConcurrencyResolver\", {\n defaultValue: () => ({ resolve: () => Effect.succeed(Option.none()) }),\n});\n\n/** Host ceilings apply across all declarations owned by one source Thread. */\nexport const WorkerHostLimits = Schema.Struct({\n maxWorkersPerSource: Positive.check(Schema.isLessThanOrEqualTo(100)),\n /** Active background workers across declarations; omission retains source Tool concurrency. */\n maxActiveWorkersPerSource: Schema.optionalKey(Positive.check(Schema.isLessThanOrEqualTo(100))),\n maxInputsPerWorker: Positive.check(Schema.isLessThanOrEqualTo(1_000)),\n maxPendingInputsPerWorker: Positive.check(Schema.isLessThanOrEqualTo(100)),\n maxUpdateInputsPerWorker: Schema.optionalKey(Positive.check(Schema.isLessThanOrEqualTo(1_000))),\n maxPendingUpdateInputsPerWorker: Schema.optionalKey(\n Positive.check(Schema.isLessThanOrEqualTo(100)),\n ),\n lifetimeMillis: Positive.check(Schema.isLessThanOrEqualTo(604_800_000)),\n /** Preparation may repeat after loss before its decision commits; keep callbacks side-effect free. */\n reportPreparationTimeoutMillis: Schema.optionalKey(\n Positive.check(Schema.isLessThanOrEqualTo(30_000)),\n ),\n});\n\nexport type WorkerHostLimits = typeof WorkerHostLimits.Type;\n\nexport const WorkerHostConfig = Context.Reference<WorkerHostLimits>(\n \"@effect-agent/thread/WorkerHostConfig\",\n {\n defaultValue: () => ({\n maxWorkersPerSource: 32,\n maxInputsPerWorker: 64,\n maxPendingInputsPerWorker: 8,\n lifetimeMillis: 86_400_000,\n }),\n },\n);\n\n/**\n * Authenticate every acquisition/operation and authorize its exact source Thread. A returned\n * Principal is host-owned admission identity. Context access authenticates source metadata;\n * read, send and control remain separate grants. WorkerRefs and caller-supplied Thread\n * identifiers alone never confer any of them.\n */\nexport interface WorkerHostAuthorizationRequest {\n readonly sourceThreadId: ThreadId;\n /** An explicitly selected owner input; authorize this locator as well as the Thread. */\n readonly sourceSubmissionId?: SubmissionId;\n readonly principal: Principal;\n readonly operation: WorkerError[\"operation\"];\n /** Report access follows native frozen-message proof and preserves the destination principal. */\n readonly access: \"context\" | \"read\" | \"send\" | \"control\" | \"report\";\n readonly worker?: WorkerRef;\n /** Native-verified successful predecessor, never a caller-supplied authorization grant. */\n readonly continuationOf?: WorkerContinuation;\n}\n\nexport const WorkerHostAuthorizer = Context.Reference<{\n readonly authorize: (\n request: WorkerHostAuthorizationRequest,\n ) => Effect.Effect<Principal, WorkerError>;\n}>(\"@effect-agent/thread/WorkerHostAuthorizer\", {\n defaultValue: () => ({\n authorize: (request) =>\n WorkerError.make({\n operation: request.operation,\n reason: \"denied\",\n }),\n }),\n});\n\n/**\n * Deployment-owned permission to fund a root's background worker independently. The decision\n * covers the exact immutable origin and is checked again before each input admission. It never\n * changes delegation depth or Tool authority. Omission denies independent funding.\n */\nexport const WorkerBudgetAuthorizer = Context.Reference<{\n readonly authorize: (request: {\n readonly source: WorkerSource;\n readonly principal: Principal;\n readonly worker: WorkerRef;\n readonly continuationOf?: WorkerContinuation;\n readonly policy: AgentPolicy;\n readonly budget: SubagentBudgetReservation;\n }) => Effect.Effect<void, WorkerError>;\n}>(\"@effect-agent/thread/WorkerBudgetAuthorizer\", {\n defaultValue: () => ({\n authorize: () => WorkerError.make({ operation: \"start\", reason: \"denied\" }),\n }),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAa,uBAAuB,QAAQ,UAOzC,6CAA6C,EAC9C,qBAAqB;CACnB,qBAAqB,OAAO,QAAQ,OAAO,KAAK,CAAC;CACjD,qBAAqB,OAAO,QAAQ,OAAO,KAAK,CAAC;AACnD,GACF,CAAC;AAED,MAAM,WAAW,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;;AAGzD,MAAa,yBAAyB,OAAO,OAAO,EAClD,2BAA2B,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC,EAC9E,CAAC;;;;;;;;;;;;AAeD,MAAa,4BAA4B,QAAQ,UAQ9C,kDAAkD,EACnD,qBAAqB,EAAE,eAAe,OAAO,QAAQ,OAAO,KAAK,CAAC,EAAE,GACtE,CAAC;;AAGD,MAAa,mBAAmB,OAAO,OAAO;CAC5C,qBAAqB,SAAS,MAAM,OAAO,oBAAoB,GAAG,CAAC;;CAEnE,2BAA2B,OAAO,YAAY,SAAS,MAAM,OAAO,oBAAoB,GAAG,CAAC,CAAC;CAC7F,oBAAoB,SAAS,MAAM,OAAO,oBAAoB,GAAK,CAAC;CACpE,2BAA2B,SAAS,MAAM,OAAO,oBAAoB,GAAG,CAAC;CACzE,0BAA0B,OAAO,YAAY,SAAS,MAAM,OAAO,oBAAoB,GAAK,CAAC,CAAC;CAC9F,iCAAiC,OAAO,YACtC,SAAS,MAAM,OAAO,oBAAoB,GAAG,CAAC,CAChD;CACA,gBAAgB,SAAS,MAAM,OAAO,oBAAoB,MAAW,CAAC;;CAEtE,gCAAgC,OAAO,YACrC,SAAS,MAAM,OAAO,oBAAoB,GAAM,CAAC,CACnD;AACF,CAAC;AAID,MAAa,mBAAmB,QAAQ,UACtC,yCACA,EACE,qBAAqB;CACnB,qBAAqB;CACrB,oBAAoB;CACpB,2BAA2B;CAC3B,gBAAgB;AAClB,GACF,CACF;AAqBA,MAAa,uBAAuB,QAAQ,UAIzC,6CAA6C,EAC9C,qBAAqB,EACnB,YAAY,YACV,YAAY,KAAK;CACf,WAAW,QAAQ;CACnB,QAAQ;AACV,CAAC,EACL,GACF,CAAC;;;;;;AAOD,MAAa,yBAAyB,QAAQ,UAS3C,+CAA+C,EAChD,qBAAqB,EACnB,iBAAiB,YAAY,KAAK;CAAE,WAAW;CAAS,QAAQ;AAAS,CAAC,EAC5E,GACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"WorkerHost.mjs","names":[],"sources":["../../src/durable/WorkerHost.ts"],"sourcesContent":["import { Context, Effect, Option, Schema } from \"effect\";\n\nimport type * as Agent from \"../core/Agent.ts\";\nimport type { AgentPolicy } from \"../core/AgentPolicy.ts\";\nimport type { AgentId, SubmissionId, ThreadId } from \"../core/Identifiers.ts\";\nimport type { SubagentBudgetReservation } from \"../core/SubagentContract.ts\";\nimport { WorkerError, type WorkerRef, type WorkerSource } from \"../core/Worker.ts\";\nimport type {\n CanonicalSequence,\n DefinitionDigests,\n Digest,\n PersistedJson,\n WorkerOrigin,\n WorkerContinuation,\n} from \"./Records.ts\";\nimport type { Principal, SubmissionSnapshot } from \"./SubmissionLedger.ts\";\n\n/**\n * One successful start authorization at an exact source tail. This host-created hint is\n * available only during that start's preparation and synchronous admission; it is never\n * persisted or transported. Hooks may reuse their admission decision, but must retain\n * current access checks at commit boundaries. A retry or changed tail gets no old grant.\n */\nexport interface WorkerStartAdmission {\n readonly sourceThreadId: ThreadId;\n readonly sourceSubmissionId?: SubmissionId;\n readonly requestedPrincipal: Principal;\n readonly principal: Principal;\n readonly targetAgentId: AgentId;\n readonly continuationOf?: WorkerContinuation;\n readonly access: \"send\";\n readonly tailSequence: CanonicalSequence;\n readonly tailDigest: Digest;\n}\n\n/** Host-verified source input; absence never means the latest input in the Thread. */\nexport interface WorkerPolicySource {\n readonly threadId: ThreadId;\n readonly definition: Agent.AnyDefinition;\n readonly definitions: DefinitionDigests;\n readonly submission?: SubmissionSnapshot;\n}\n\n/** Initial input is validated again at destination admission, including idempotent replay. */\nexport type WorkerPolicyTarget = {\n readonly definition: Agent.AnyDefinition;\n readonly definitions: DefinitionDigests;\n readonly source: WorkerSource;\n} & (\n | {\n readonly _tag: \"InitialInput\";\n readonly admission?: WorkerStartAdmission;\n readonly continuationOf?: WorkerContinuation;\n readonly sourceSubmission?: SubmissionSnapshot;\n readonly input: PersistedJson;\n readonly inputDigest: Digest;\n }\n | {\n readonly _tag: \"RetainedWorker\";\n /** Verified against canonical source history before this request reaches the resolver. */\n readonly origin: WorkerOrigin;\n }\n);\n\n/**\n * Opt-in host authority for policies captured in immutable application input. None preserves\n * the registered Definition's existing policy/override semantics. Some is a complete policy,\n * never merged with static overrides. Decode and authorize the exact captured revision; do not\n * read mutable settings or substitute a current capture for missing historical authority.\n * RetainedWorker may affirm only origin.policy, never replace a continuing worker's allowance.\n * Return WorkerError(unavailable) for temporarily unavailable authority so delivery can retry.\n * Implementations are acquired through Effect Layers; capture their dependencies in Layer R.\n */\nexport const WorkerPolicyResolver = Context.Reference<{\n readonly resolveSource: (\n request: WorkerPolicySource,\n ) => Effect.Effect<Option.Option<AgentPolicy>, WorkerError>;\n readonly resolveTarget: (\n request: WorkerPolicyTarget,\n ) => Effect.Effect<Option.Option<AgentPolicy>, WorkerError>;\n}>(\"@effect-agent/thread/WorkerPolicyResolver\", {\n defaultValue: () => ({\n resolveSource: () => Effect.succeed(Option.none()),\n resolveTarget: () => Effect.succeed(Option.none()),\n }),\n});\n\nconst Positive = Schema.Int.check(Schema.isGreaterThan(0));\n\n/** A host-authorized ceiling on active background workers, not retained workers or Run usage. */\nexport const WorkerConcurrencyLimit = Schema.Struct({\n maxActiveWorkersPerSource: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n});\n\nexport type WorkerConcurrencyLimit = typeof WorkerConcurrencyLimit.Type;\n\n/**\n * Optional source-aware operational authority. Resolution occurs inside every new source\n * reservation attempt, against the same canonical history used for the append CAS. None\n * preserves WorkerHostConfig; Some can only narrow it. The selected submission is exact,\n * never the latest input. Implementations must authorize that immutable capture and retain\n * construction dependencies in Layer R. Unavailable authority must return WorkerError(unavailable).\n *\n * One worker occupies a slot while any of its inputs remain unacknowledged. Steering an active\n * worker does not acquire another slot. Decreases (including zero) do not cancel incumbents;\n * an idle worker needs a slot again. Idempotent retained reservations do not reacquire slots.\n */\nexport const WorkerConcurrencyResolver = Context.Reference<{\n readonly resolve: (request: {\n readonly source: WorkerSource;\n readonly sourceSubmission?: SubmissionSnapshot;\n readonly worker: WorkerRef;\n readonly continuationOf?: WorkerContinuation;\n readonly principal: Principal;\n }) => Effect.Effect<Option.Option<WorkerConcurrencyLimit>, WorkerError>;\n}>(\"@effect-agent/thread/WorkerConcurrencyResolver\", {\n defaultValue: () => ({ resolve: () => Effect.succeed(Option.none()) }),\n});\n\n/** Host ceilings apply across all declarations owned by one source Thread. */\nexport const WorkerHostLimits = Schema.Struct({\n maxWorkersPerSource: Positive.check(Schema.isLessThanOrEqualTo(100)),\n /** Active background workers across declarations; omission retains source Tool concurrency. */\n maxActiveWorkersPerSource: Schema.optionalKey(Positive.check(Schema.isLessThanOrEqualTo(100))),\n maxInputsPerWorker: Positive.check(Schema.isLessThanOrEqualTo(1_000)),\n maxPendingInputsPerWorker: Positive.check(Schema.isLessThanOrEqualTo(100)),\n maxUpdateInputsPerWorker: Schema.optionalKey(Positive.check(Schema.isLessThanOrEqualTo(1_000))),\n maxPendingUpdateInputsPerWorker: Schema.optionalKey(\n Positive.check(Schema.isLessThanOrEqualTo(100)),\n ),\n lifetimeMillis: Positive.check(Schema.isLessThanOrEqualTo(604_800_000)),\n /** Preparation may repeat after loss before its decision commits; keep callbacks side-effect free. */\n reportPreparationTimeoutMillis: Schema.optionalKey(\n Positive.check(Schema.isLessThanOrEqualTo(30_000)),\n ),\n});\n\nexport type WorkerHostLimits = typeof WorkerHostLimits.Type;\n\nexport const WorkerHostConfig = Context.Reference<WorkerHostLimits>(\n \"@effect-agent/thread/WorkerHostConfig\",\n {\n defaultValue: () => ({\n maxWorkersPerSource: 32,\n maxInputsPerWorker: 64,\n maxPendingInputsPerWorker: 8,\n lifetimeMillis: 86_400_000,\n }),\n },\n);\n\n/**\n * Authenticate every acquisition/operation and authorize its exact source Thread. A returned\n * Principal is host-owned admission identity. Context access authenticates source metadata;\n * read, send and control remain separate grants. WorkerRefs and caller-supplied Thread\n * identifiers alone never confer any of them.\n */\nexport interface WorkerHostAuthorizationRequest {\n readonly admission?: WorkerStartAdmission;\n readonly sourceThreadId: ThreadId;\n /** An explicitly selected owner input; authorize this locator as well as the Thread. */\n readonly sourceSubmissionId?: SubmissionId;\n readonly principal: Principal;\n readonly operation: WorkerError[\"operation\"];\n /** Report access follows native frozen-message proof and preserves the destination principal. */\n readonly access: \"context\" | \"read\" | \"send\" | \"control\" | \"report\";\n readonly worker?: WorkerRef;\n /** Native-verified successful predecessor, never a caller-supplied authorization grant. */\n readonly continuationOf?: WorkerContinuation;\n}\n\nexport const WorkerHostAuthorizer = Context.Reference<{\n readonly authorize: (\n request: WorkerHostAuthorizationRequest,\n ) => Effect.Effect<Principal, WorkerError>;\n}>(\"@effect-agent/thread/WorkerHostAuthorizer\", {\n defaultValue: () => ({\n authorize: (request) =>\n WorkerError.make({\n operation: request.operation,\n reason: \"denied\",\n }),\n }),\n});\n\n/**\n * Deployment-owned permission to fund a root's background worker independently. The decision\n * covers the exact immutable origin and is checked again before each input admission. It never\n * changes delegation depth or Tool authority. Omission denies independent funding.\n */\nexport const WorkerBudgetAuthorizer = Context.Reference<{\n readonly authorize: (request: {\n readonly source: WorkerSource;\n readonly admission?: WorkerStartAdmission;\n readonly principal: Principal;\n readonly worker: WorkerRef;\n readonly continuationOf?: WorkerContinuation;\n readonly policy: AgentPolicy;\n readonly budget: SubagentBudgetReservation;\n }) => Effect.Effect<void, WorkerError>;\n}>(\"@effect-agent/thread/WorkerBudgetAuthorizer\", {\n defaultValue: () => ({\n authorize: () => WorkerError.make({ operation: \"start\", reason: \"denied\" }),\n }),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyEA,MAAa,uBAAuB,QAAQ,UAOzC,6CAA6C,EAC9C,qBAAqB;CACnB,qBAAqB,OAAO,QAAQ,OAAO,KAAK,CAAC;CACjD,qBAAqB,OAAO,QAAQ,OAAO,KAAK,CAAC;AACnD,GACF,CAAC;AAED,MAAM,WAAW,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;;AAGzD,MAAa,yBAAyB,OAAO,OAAO,EAClD,2BAA2B,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC,EAC9E,CAAC;;;;;;;;;;;;AAeD,MAAa,4BAA4B,QAAQ,UAQ9C,kDAAkD,EACnD,qBAAqB,EAAE,eAAe,OAAO,QAAQ,OAAO,KAAK,CAAC,EAAE,GACtE,CAAC;;AAGD,MAAa,mBAAmB,OAAO,OAAO;CAC5C,qBAAqB,SAAS,MAAM,OAAO,oBAAoB,GAAG,CAAC;;CAEnE,2BAA2B,OAAO,YAAY,SAAS,MAAM,OAAO,oBAAoB,GAAG,CAAC,CAAC;CAC7F,oBAAoB,SAAS,MAAM,OAAO,oBAAoB,GAAK,CAAC;CACpE,2BAA2B,SAAS,MAAM,OAAO,oBAAoB,GAAG,CAAC;CACzE,0BAA0B,OAAO,YAAY,SAAS,MAAM,OAAO,oBAAoB,GAAK,CAAC,CAAC;CAC9F,iCAAiC,OAAO,YACtC,SAAS,MAAM,OAAO,oBAAoB,GAAG,CAAC,CAChD;CACA,gBAAgB,SAAS,MAAM,OAAO,oBAAoB,MAAW,CAAC;;CAEtE,gCAAgC,OAAO,YACrC,SAAS,MAAM,OAAO,oBAAoB,GAAM,CAAC,CACnD;AACF,CAAC;AAID,MAAa,mBAAmB,QAAQ,UACtC,yCACA,EACE,qBAAqB;CACnB,qBAAqB;CACrB,oBAAoB;CACpB,2BAA2B;CAC3B,gBAAgB;AAClB,GACF,CACF;AAsBA,MAAa,uBAAuB,QAAQ,UAIzC,6CAA6C,EAC9C,qBAAqB,EACnB,YAAY,YACV,YAAY,KAAK;CACf,WAAW,QAAQ;CACnB,QAAQ;AACV,CAAC,EACL,GACF,CAAC;;;;;;AAOD,MAAa,yBAAyB,QAAQ,UAU3C,+CAA+C,EAChD,qBAAqB,EACnB,iBAAiB,YAAY,KAAK;CAAE,WAAW;CAAS,QAAQ;AAAS,CAAC,EAC5E,GACF,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as start, C as decodeFinalOutput, D as renderInputPrompt, E as projectCompletionOutput, F as withTerminalDefectEvent, M as stream, N as streamUnknown, O as run, P as streamWithUsageAccountingUnknown, S as ToolCallWaiting, T as projectCompletionFromToolOutput, _ as SubagentDurability, a as AgentResultSchema, b as SubagentDurabilityError, c as AgentSpawner, d as DetachedRun, f as EngineProvidedToolServices, g as SpawnedChildRun, h as SpawnRunOptions, i as AgentResult, j as startUnknown, k as runUnknown, l as AgentSpawnerParent, m as SpawnDelegation, n as AgentChildPending, o as AgentRuntimeFailure, p as RuntimeBinding, r as AgentCompletionProjectionRequirements, s as AgentRuntimeRequirements, u as AgentSpawnerService, v as SubagentDurabilityDurable, w as encodeRunDisposition, x as SubagentDurabilityService, y as SubagentDurabilityEphemeral } from "../AgentRuntime-
|
|
1
|
+
import { A as start, C as decodeFinalOutput, D as renderInputPrompt, E as projectCompletionOutput, F as withTerminalDefectEvent, M as stream, N as streamUnknown, O as run, P as streamWithUsageAccountingUnknown, S as ToolCallWaiting, T as projectCompletionFromToolOutput, _ as SubagentDurability, a as AgentResultSchema, b as SubagentDurabilityError, c as AgentSpawner, d as DetachedRun, f as EngineProvidedToolServices, g as SpawnedChildRun, h as SpawnRunOptions, i as AgentResult, j as startUnknown, k as runUnknown, l as AgentSpawnerParent, m as SpawnDelegation, n as AgentChildPending, o as AgentRuntimeFailure, p as RuntimeBinding, r as AgentCompletionProjectionRequirements, s as AgentRuntimeRequirements, u as AgentSpawnerService, v as SubagentDurabilityDurable, w as encodeRunDisposition, x as SubagentDurabilityService, y as SubagentDurabilityEphemeral } from "../AgentRuntime-DZdgNcBk.mjs";
|
|
2
2
|
export { AgentChildPending, type AgentCompletionProjectionRequirements, type AgentResult, AgentResultSchema, type AgentRuntimeFailure, type AgentRuntimeRequirements, AgentSpawner, type AgentSpawnerParent, type AgentSpawnerService, type DetachedRun, type EngineProvidedToolServices, type RuntimeBinding, type SpawnDelegation, type SpawnRunOptions, type SpawnedChildRun, SubagentDurability, type SubagentDurabilityDurable, type SubagentDurabilityEphemeral, SubagentDurabilityError, type SubagentDurabilityService, ToolCallWaiting, decodeFinalOutput, encodeRunDisposition, projectCompletionFromToolOutput, projectCompletionOutput, renderInputPrompt, run, runUnknown, start, startUnknown, stream, streamUnknown, streamWithUsageAccountingUnknown, withTerminalDefectEvent };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as stream, a as SubagentDurability, b as withTerminalDefectEvent, c as decodeFinalOutput, d as projectCompletionOutput, f as renderInputPrompt, g as startUnknown, h as start, i as AgentSpawner, l as encodeRunDisposition, m as runUnknown, n as AgentChildPending, o as SubagentDurabilityError, p as run, r as AgentResultSchema, s as ToolCallWaiting, u as projectCompletionFromToolOutput, v as streamUnknown, y as streamWithUsageAccountingUnknown } from "../AgentRuntime-
|
|
1
|
+
import { _ as stream, a as SubagentDurability, b as withTerminalDefectEvent, c as decodeFinalOutput, d as projectCompletionOutput, f as renderInputPrompt, g as startUnknown, h as start, i as AgentSpawner, l as encodeRunDisposition, m as runUnknown, n as AgentChildPending, o as SubagentDurabilityError, p as run, r as AgentResultSchema, s as ToolCallWaiting, u as projectCompletionFromToolOutput, v as streamUnknown, y as streamWithUsageAccountingUnknown } from "../AgentRuntime-D8U9gl9Q.mjs";
|
|
2
2
|
export { AgentChildPending, AgentResultSchema, AgentSpawner, SubagentDurability, SubagentDurabilityError, ToolCallWaiting, decodeFinalOutput, encodeRunDisposition, projectCompletionFromToolOutput, projectCompletionOutput, renderInputPrompt, run, runUnknown, start, startUnknown, stream, streamUnknown, streamWithUsageAccountingUnknown, withTerminalDefectEvent };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PeerDeliveryLifetime, c as PeerTarget, i as PeerAuthorizer, l as SendPeerMessage, o as PeerMessageCapacity, r as PeerAuthorizationRequest, s as PeerRoutes, t as MessagingHost } from "../MessagingHost-
|
|
1
|
+
import { a as PeerDeliveryLifetime, c as PeerTarget, i as PeerAuthorizer, l as SendPeerMessage, o as PeerMessageCapacity, r as PeerAuthorizationRequest, s as PeerRoutes, t as MessagingHost } from "../MessagingHost-D04wE-7W.mjs";
|
|
2
2
|
export { MessagingHost, PeerAuthorizationRequest, PeerAuthorizer, PeerDeliveryLifetime, PeerMessageCapacity, PeerRoutes, PeerTarget, SendPeerMessage };
|
package/dist/engine/Output.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as textOutput } from "../Output-
|
|
1
|
+
import { n as textOutput } from "../Output-CFD1CPfU.mjs";
|
|
2
2
|
export { textOutput as text };
|
package/dist/engine/Output.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import { i as textOutput } from "../output-contract-
|
|
2
|
+
import { i as textOutput } from "../output-contract-DS-S8mTv.mjs";
|
|
3
3
|
//#region src/engine/Output.ts
|
|
4
4
|
var Output_exports = /* @__PURE__ */ __exportAll({ text: () => textOutput });
|
|
5
5
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as RunTurnResponseCommit, A as RunInputCommand, B as RunSubagentChildIdentity, C as RunContextPreparationPassthrough, D as RunCostEstimateValue, E as RunCostEstimateRequest, G as RunToolAuthorization, H as RunSubagentEstablishRequest, I as RunResumeUsage, J as RunToolAuthorizationRequest, K as RunToolAuthorizationDecision, L as RunResumeUsageSchema, M as RunOptions, N as RunOptionsError, O as RunCostEstimator, P as RunOptionsRequirements, Q as RunTransientContextHook, R as RunSchedulingHook, S as RunContextPreparationError, T as RunCostEstimate, U as RunSubagentHook, V as RunSubagentDigests, W as RunSubagentJoinRequest, X as RunToolFailureObserver, Y as RunToolCallDescriptor, Z as RunToolScheduling, _ as RunBudgetHook, a as ChildEstablishWaiting, at as RunUsageDelta, b as RunContextHook, c as ModelToolFailure, d as ProgrammaticPreflightFailure, et as RunTurnResume, f as ProgrammaticToolFailure, g as RunApprovalRequest, h as RunApprovalHook, i as ChildEstablishStatus, it as RunTurnUsage, j as RunInputHook, k as RunDurabilityHook, l as ModelUsageAccounting, m as RunApprovalDecision, n as ChildEstablishDenied, nt as RunTurnResumeSettledCall, o as CommandDrainPolicy, ot as ToolFailureObservation, p as ResolvedModelCall, q as RunToolAuthorizationHook, r as ChildEstablishSettled, rt as RunTurnResumeSettledCallSchema, s as CurrentToolFailureObserver, st as toolFailureObserverLayer, t as AgentUpdateAcceptance, tt as RunTurnResumeCall, u as PreparedRunContext, v as RunBufferLimits, w as RunContextRequest, x as RunContextPreparation, y as RunCompactionCommit, z as RunSchedulingOverride } from "../RunOptions-
|
|
1
|
+
import { $ as RunTurnResponseCommit, A as RunInputCommand, B as RunSubagentChildIdentity, C as RunContextPreparationPassthrough, D as RunCostEstimateValue, E as RunCostEstimateRequest, G as RunToolAuthorization, H as RunSubagentEstablishRequest, I as RunResumeUsage, J as RunToolAuthorizationRequest, K as RunToolAuthorizationDecision, L as RunResumeUsageSchema, M as RunOptions, N as RunOptionsError, O as RunCostEstimator, P as RunOptionsRequirements, Q as RunTransientContextHook, R as RunSchedulingHook, S as RunContextPreparationError, T as RunCostEstimate, U as RunSubagentHook, V as RunSubagentDigests, W as RunSubagentJoinRequest, X as RunToolFailureObserver, Y as RunToolCallDescriptor, Z as RunToolScheduling, _ as RunBudgetHook, a as ChildEstablishWaiting, at as RunUsageDelta, b as RunContextHook, c as ModelToolFailure, d as ProgrammaticPreflightFailure, et as RunTurnResume, f as ProgrammaticToolFailure, g as RunApprovalRequest, h as RunApprovalHook, i as ChildEstablishStatus, it as RunTurnUsage, j as RunInputHook, k as RunDurabilityHook, l as ModelUsageAccounting, m as RunApprovalDecision, n as ChildEstablishDenied, nt as RunTurnResumeSettledCall, o as CommandDrainPolicy, ot as ToolFailureObservation, p as ResolvedModelCall, q as RunToolAuthorizationHook, r as ChildEstablishSettled, rt as RunTurnResumeSettledCallSchema, s as CurrentToolFailureObserver, st as toolFailureObserverLayer, t as AgentUpdateAcceptance, tt as RunTurnResumeCall, u as PreparedRunContext, v as RunBufferLimits, w as RunContextRequest, x as RunContextPreparation, y as RunCompactionCommit, z as RunSchedulingOverride } from "../RunOptions-Cy7CjrjS.mjs";
|
|
2
2
|
export { AgentUpdateAcceptance, ChildEstablishDenied, ChildEstablishSettled, ChildEstablishStatus, ChildEstablishWaiting, CommandDrainPolicy, CurrentToolFailureObserver, ModelToolFailure, ModelUsageAccounting, PreparedRunContext, ProgrammaticPreflightFailure, ProgrammaticToolFailure, ResolvedModelCall, RunApprovalDecision, RunApprovalHook, RunApprovalRequest, RunBudgetHook, RunBufferLimits, RunCompactionCommit, RunContextHook, RunContextPreparation, RunContextPreparationError, RunContextPreparationPassthrough, RunContextRequest, RunCostEstimate, RunCostEstimateRequest, RunCostEstimateValue, RunCostEstimator, RunDurabilityHook, RunInputCommand, RunInputHook, RunOptions, RunOptionsError, RunOptionsRequirements, RunResumeUsage, RunResumeUsageSchema, RunSchedulingHook, RunSchedulingOverride, RunSubagentChildIdentity, RunSubagentDigests, RunSubagentEstablishRequest, RunSubagentHook, RunSubagentJoinRequest, RunToolAuthorization, RunToolAuthorizationDecision, RunToolAuthorizationHook, RunToolAuthorizationRequest, RunToolCallDescriptor, RunToolFailureObserver, RunToolScheduling, RunTransientContextHook, RunTurnResponseCommit, RunTurnResume, RunTurnResumeCall, RunTurnResumeSettledCall, RunTurnResumeSettledCallSchema, RunTurnUsage, RunUsageDelta, ToolFailureObservation, toolFailureObserverLayer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as StartWorkerRequest, c as WorkerMessageRequest, d as WorkerReportPreparationFailure, f as WorkerReporting, i as FollowUpWorkerRequest, l as WorkerObservation, n as DeferredFollowUpWorkerRequest, o as SubagentHost, p as WorkerRunReport, r as DeferredStartWorkerRequest, t as BackgroundReporting, u as WorkerReceiptRequest } from "../SubagentHost-
|
|
1
|
+
import { a as StartWorkerRequest, c as WorkerMessageRequest, d as WorkerReportPreparationFailure, f as WorkerReporting, i as FollowUpWorkerRequest, l as WorkerObservation, n as DeferredFollowUpWorkerRequest, o as SubagentHost, p as WorkerRunReport, r as DeferredStartWorkerRequest, t as BackgroundReporting, u as WorkerReceiptRequest } from "../SubagentHost-C-4A7tA2.mjs";
|
|
2
2
|
export { BackgroundReporting, DeferredFollowUpWorkerRequest, DeferredStartWorkerRequest, FollowUpWorkerRequest, StartWorkerRequest, SubagentHost, WorkerMessageRequest, WorkerObservation, WorkerReceiptRequest, WorkerReportPreparationFailure, WorkerReporting, WorkerRunReport };
|
package/dist/index.d.mts
CHANGED
|
@@ -20,14 +20,14 @@ import { a as FailureDiagnostic_d_exports } from "./FailureDiagnostic-CaAkzGHL.m
|
|
|
20
20
|
import { i as AgentError_d_exports } from "./AgentError-Bn1ytXRD.mjs";
|
|
21
21
|
import { r as ToolResult_d_exports } from "./ToolResult-BKdqWRff.mjs";
|
|
22
22
|
import { r as AgentPolicy_d_exports } from "./AgentPolicy-BqDoSXO6.mjs";
|
|
23
|
-
import { t as Agent_d_exports } from "./Agent-
|
|
23
|
+
import { t as Agent_d_exports } from "./Agent-Cjd_ZveM.mjs";
|
|
24
24
|
import { c as MemoryReference_d_exports } from "./MemoryReference-B8Q3UJoJ.mjs";
|
|
25
25
|
import { n as RunPolicyUsage_d_exports } from "./RunPolicyUsage-ClZxyR46.mjs";
|
|
26
26
|
import { x as Worker_d_exports } from "./Worker-fwWkBg12.mjs";
|
|
27
27
|
import { s as ContextWindow_d_exports } from "./ContextWindow-DRQ5Mbm2.mjs";
|
|
28
28
|
import { s as ContextCompactor_d_exports } from "./ContextCompactor-WwSIG_Z2.mjs";
|
|
29
29
|
import { i as DurableStep_d_exports } from "./DurableStep-Cry_iol4.mjs";
|
|
30
|
-
import { F as RunOptions_d_exports } from "./RunOptions-
|
|
30
|
+
import { F as RunOptions_d_exports } from "./RunOptions-Cy7CjrjS.mjs";
|
|
31
31
|
import { t as Commands_d_exports } from "./capabilities/Commands.mjs";
|
|
32
32
|
import { t as ContextHistory_d_exports } from "./engine/ContextHistory.mjs";
|
|
33
33
|
import { t as ContextTools_d_exports } from "./capabilities/ContextTools.mjs";
|
|
@@ -36,8 +36,8 @@ import { t as McpClient_d_exports } from "./capabilities/McpClient.mjs";
|
|
|
36
36
|
import { i as MemoryNamespace_d_exports } from "./MemoryNamespace-BbRW5p71.mjs";
|
|
37
37
|
import { t as MemoryStore_d_exports } from "./core/MemoryStore.mjs";
|
|
38
38
|
import { t as MemoryNotes_d_exports } from "./capabilities/MemoryNotes.mjs";
|
|
39
|
-
import { n as MessagingHost_d_exports } from "./MessagingHost-
|
|
40
|
-
import { t as Messaging_d_exports } from "./Messaging-
|
|
39
|
+
import { n as MessagingHost_d_exports } from "./MessagingHost-D04wE-7W.mjs";
|
|
40
|
+
import { t as Messaging_d_exports } from "./Messaging-ccQURKCf.mjs";
|
|
41
41
|
import { t as ModelContext_d_exports } from "./capabilities/ModelContext.mjs";
|
|
42
42
|
import { t as RememberingStore_d_exports } from "./core/RememberingStore.mjs";
|
|
43
43
|
import { t as Remembering_d_exports } from "./capabilities/Remembering.mjs";
|
|
@@ -46,10 +46,10 @@ import { t as MemoryRevalidation_d_exports } from "./core/MemoryRevalidation.mjs
|
|
|
46
46
|
import { t as SemanticMemoryIndex_d_exports } from "./core/SemanticMemoryIndex.mjs";
|
|
47
47
|
import { t as SemanticMemoryRevalidation_d_exports } from "./core/SemanticMemoryRevalidation.mjs";
|
|
48
48
|
import { t as SemanticMemory_d_exports } from "./capabilities/SemanticMemory.mjs";
|
|
49
|
-
import { s as SubagentHost_d_exports } from "./SubagentHost-
|
|
50
|
-
import { t as AgentRuntime_d_exports } from "./AgentRuntime-
|
|
49
|
+
import { s as SubagentHost_d_exports } from "./SubagentHost-C-4A7tA2.mjs";
|
|
50
|
+
import { t as AgentRuntime_d_exports } from "./AgentRuntime-DZdgNcBk.mjs";
|
|
51
51
|
import { i as RunEventSink_d_exports } from "./RunEventSink-D5aVhISG.mjs";
|
|
52
|
-
import { v as Subagent_d_exports } from "./Subagent-
|
|
52
|
+
import { v as Subagent_d_exports } from "./Subagent-zS6prSK6.mjs";
|
|
53
53
|
import { t as ToolDiscovery_d_exports } from "./capabilities/ToolDiscovery.mjs";
|
|
54
54
|
import { D as PageCapture_d_exports } from "./PageCapture-Df8Xwskw.mjs";
|
|
55
55
|
import { t as WebCapture_d_exports } from "./capabilities/WebCapture.mjs";
|
|
@@ -59,17 +59,17 @@ import { t as Memory_d_exports } from "./core/Memory.mjs";
|
|
|
59
59
|
import { N as Records_d_exports } from "./Records-B5GFWCpn.mjs";
|
|
60
60
|
import { t as ActivityStore_d_exports } from "./durable/ActivityStore.mjs";
|
|
61
61
|
import { n as Digest_d_exports } from "./Digest-U69rDHuO.mjs";
|
|
62
|
-
import {
|
|
62
|
+
import { J as Recovery_d_exports, Pa as AgentRegistration_d_exports, Pi as RunJournal_d_exports, Qn as DurableAgentRuntime_d_exports, Si as LifecyclePublication_d_exports, bn as SubmissionLedger_d_exports, ki as SubmissionStatus_d_exports, oi as ThreadStore_d_exports, t as Admin_d_exports } from "./Admin-BzPfXvzC.mjs";
|
|
63
63
|
import { t as DurableFailpoint_d_exports } from "./DurableFailpoint-Cnr3wx1L.mjs";
|
|
64
64
|
import { a as OperationAuthorizer_d_exports } from "./OperationAuthorizer-TzcQtpX5.mjs";
|
|
65
65
|
import { l as ToolReconciler_d_exports } from "./ToolReconciler-BmVRAHKs.mjs";
|
|
66
66
|
import { n as WakeScheduler_d_exports } from "./WakeScheduler-EjUF-GhC.mjs";
|
|
67
67
|
import { t as CommittedActivity_d_exports } from "./durable/CommittedActivity.mjs";
|
|
68
68
|
import { R as Schedule_d_exports } from "./Schedule-CtYREFnz.mjs";
|
|
69
|
-
import { k as Subscription_d_exports } from "./Subscription-
|
|
70
|
-
import { n as EventSource_d_exports } from "./EventSource-
|
|
71
|
-
import { n as PreparedInputAdmission_d_exports } from "./PreparedInputAdmission-
|
|
72
|
-
import { r as SubscriptionInput_d_exports } from "./SubscriptionInput-
|
|
69
|
+
import { k as Subscription_d_exports } from "./Subscription-C279AjM6.mjs";
|
|
70
|
+
import { n as EventSource_d_exports } from "./EventSource-DJW_1kPY.mjs";
|
|
71
|
+
import { n as PreparedInputAdmission_d_exports } from "./PreparedInputAdmission-CNRSDoYu.mjs";
|
|
72
|
+
import { r as SubscriptionInput_d_exports } from "./SubscriptionInput-7R-Xrpxd.mjs";
|
|
73
73
|
import { t as Subscriptions_d_exports } from "./durable/Subscriptions.mjs";
|
|
74
74
|
import { t as MessageDelivery_d_exports } from "./durable/MessageDelivery.mjs";
|
|
75
75
|
import { t as PersistentHistory_d_exports } from "./durable/PersistentHistory.mjs";
|
|
@@ -84,7 +84,7 @@ import { t as ThreadProjection_d_exports } from "./durable/ThreadProjection.mjs"
|
|
|
84
84
|
import { t as ThreadProjectionMaintenance_d_exports } from "./durable/ThreadProjectionMaintenance.mjs";
|
|
85
85
|
import { t as WorkerHost_d_exports } from "./durable/WorkerHost.mjs";
|
|
86
86
|
import { t as Compaction_d_exports } from "./engine/Compaction.mjs";
|
|
87
|
-
import { t as Output_d_exports } from "./Output-
|
|
87
|
+
import { t as Output_d_exports } from "./Output-CFD1CPfU.mjs";
|
|
88
88
|
import { t as PageScreenshot_d_exports } from "./sandbox/PageScreenshot.mjs";
|
|
89
89
|
import { t as InteractiveBrowser_d_exports } from "./sandbox/InteractiveBrowser.mjs";
|
|
90
90
|
import { t as PageCrawl_d_exports } from "./sandbox/PageCrawl.mjs";
|
package/dist/index.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import { n as MessagingHost_exports } from "./MessagingHost-DfsbMPvq.mjs";
|
|
|
15
15
|
import { t as SubagentHost_exports } from "./engine/SubagentHost.mjs";
|
|
16
16
|
import { t as Thread_exports } from "./core/Thread.mjs";
|
|
17
17
|
import { t as ThreadHistory_exports } from "./engine/ThreadHistory.mjs";
|
|
18
|
-
import { t as AgentRuntime_exports } from "./AgentRuntime-
|
|
18
|
+
import { t as AgentRuntime_exports } from "./AgentRuntime-D8U9gl9Q.mjs";
|
|
19
19
|
import { t as ContextWindow_exports } from "./engine/ContextWindow.mjs";
|
|
20
20
|
import { t as DurableStep_exports } from "./engine/DurableStep.mjs";
|
|
21
21
|
import { t as ContextCompactor_exports } from "./engine/ContextCompactor.mjs";
|
|
@@ -56,7 +56,7 @@ import { t as RunHooks_exports } from "./capabilities/RunHooks.mjs";
|
|
|
56
56
|
import { t as SemanticMemoryIndex_exports } from "./core/SemanticMemoryIndex.mjs";
|
|
57
57
|
import { t as SemanticMemoryRevalidation_exports } from "./core/SemanticMemoryRevalidation.mjs";
|
|
58
58
|
import { t as SemanticMemory_exports } from "./capabilities/SemanticMemory.mjs";
|
|
59
|
-
import { r as Subagent_exports } from "./Subagent-
|
|
59
|
+
import { r as Subagent_exports } from "./Subagent-hG9lJ7tJ.mjs";
|
|
60
60
|
import { t as ToolDiscovery_exports } from "./capabilities/ToolDiscovery.mjs";
|
|
61
61
|
import { t as ToolExposure_exports } from "./ToolExposure.mjs";
|
|
62
62
|
import { t as WebCapture_exports } from "./capabilities/WebCapture.mjs";
|
|
@@ -68,7 +68,7 @@ import { t as Recovery_exports } from "./durable/Recovery.mjs";
|
|
|
68
68
|
import { t as Admin_exports } from "./durable/Admin.mjs";
|
|
69
69
|
import { t as Digest_exports } from "./durable/Digest.mjs";
|
|
70
70
|
import { t as AgentRegistration_exports } from "./durable/AgentRegistration.mjs";
|
|
71
|
-
import { r as DurableAgentRuntime_exports } from "./DurableAgentRuntime-
|
|
71
|
+
import { r as DurableAgentRuntime_exports } from "./DurableAgentRuntime-N5Meflyt.mjs";
|
|
72
72
|
import { n as RunJournal_exports } from "./RunJournal-Gd83HYqG.mjs";
|
|
73
73
|
import { t as ThreadStore_exports } from "./durable/ThreadStore.mjs";
|
|
74
74
|
import { t as CommittedActivity_exports } from "./durable/CommittedActivity.mjs";
|
|
@@ -58,19 +58,55 @@ const outputSchemaContract = (definition) => {
|
|
|
58
58
|
};
|
|
59
59
|
const sameSystemMessage = Schema.toEquivalence(Prompt.SystemMessage);
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
61
|
+
* Keep supported system instructions in conversation order so changing late guidance
|
|
62
|
+
* cannot invalidate the preceding user/tool cache prefix. Omit an exact repeat
|
|
63
|
+
* only when no distinct system instruction intervened; returning to an earlier
|
|
64
|
+
* instruction after a different one must preserve the new directive's precedence.
|
|
65
|
+
* Anchor the immutable output contract after the initial system block.
|
|
66
|
+
* Restore leading static instructions for caller-supplied conversation-only history.
|
|
66
67
|
*
|
|
67
68
|
* This runs after preparation and compaction. Canonical messages, protected
|
|
68
69
|
* instruction/input spans and compaction coverage retain their original positions.
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
70
|
+
* Adapters without this capability retain the grouped-system projection: keep the
|
|
71
|
+
* last equivalent instruction with its native options, then the contract and
|
|
72
|
+
* conversation. This prevents older Anthropic adapters from discarding system groups.
|
|
72
73
|
*/
|
|
73
|
-
const prepareModelPrompt = (prompt, contract) => {
|
|
74
|
+
const prepareModelPrompt = (prompt, contract, systemMessagesInHistory, staticInstructions) => {
|
|
75
|
+
if (systemMessagesInHistory) {
|
|
76
|
+
const content = [];
|
|
77
|
+
let lastSystem;
|
|
78
|
+
let ordered = prompt.content;
|
|
79
|
+
if (staticInstructions !== void 0) {
|
|
80
|
+
const firstConversation = prompt.content.findIndex((message) => message.role !== "system");
|
|
81
|
+
const leading = prompt.content.slice(0, firstConversation === -1 ? prompt.content.length : firstConversation);
|
|
82
|
+
const restored = [];
|
|
83
|
+
const instructions = typeof staticInstructions === "string" ? [Prompt.systemMessage({ content: staticInstructions })] : Prompt.make(staticInstructions).content;
|
|
84
|
+
for (const message of instructions) {
|
|
85
|
+
if (message.role !== "system") break;
|
|
86
|
+
if (leading.some((candidate) => candidate.role === "system" && sameSystemMessage(candidate, message))) break;
|
|
87
|
+
const original = prompt.content.find((candidate) => candidate.role === "system" && sameSystemMessage(candidate, message));
|
|
88
|
+
if (original === void 0) break;
|
|
89
|
+
restored.push(original);
|
|
90
|
+
}
|
|
91
|
+
if (restored.length > 0) ordered = [
|
|
92
|
+
...leading,
|
|
93
|
+
...restored,
|
|
94
|
+
...prompt.content.slice(leading.length)
|
|
95
|
+
];
|
|
96
|
+
}
|
|
97
|
+
for (const message of ordered) {
|
|
98
|
+
if (message.role === "system") {
|
|
99
|
+
if (lastSystem !== void 0 && sameSystemMessage(lastSystem, message)) continue;
|
|
100
|
+
lastSystem = message;
|
|
101
|
+
}
|
|
102
|
+
content.push(message);
|
|
103
|
+
}
|
|
104
|
+
if (contract !== void 0) {
|
|
105
|
+
const firstConversation = content.findIndex((message) => message.role !== "system");
|
|
106
|
+
content.splice(firstConversation === -1 ? content.length : firstConversation, 0, contract);
|
|
107
|
+
}
|
|
108
|
+
return Prompt.fromMessages(content);
|
|
109
|
+
}
|
|
74
110
|
const systems = [];
|
|
75
111
|
const conversation = [];
|
|
76
112
|
const seen = /* @__PURE__ */ new Map();
|
|
@@ -96,4 +132,4 @@ const prepareModelPrompt = (prompt, contract) => {
|
|
|
96
132
|
//#endregion
|
|
97
133
|
export { textOutput as i, outputSchemaContract as n, prepareModelPrompt as r, isTextOutput as t };
|
|
98
134
|
|
|
99
|
-
//# sourceMappingURL=output-contract-
|
|
135
|
+
//# sourceMappingURL=output-contract-DS-S8mTv.mjs.map
|