effect-agent 0.1.0-beta.163 → 0.1.0-beta.165
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-Vhz6NdaH.d.mts → Admin-CbwoQEm8.d.mts} +24 -24
- package/dist/{Agent-BMATXYsI.mjs → Agent-B0WrUcHy.mjs} +9 -9
- package/dist/Agent-B0WrUcHy.mjs.map +1 -0
- package/dist/{Agent-ZfnNCQXs.d.mts → Agent-D0fbFT2d.d.mts} +27 -24
- package/dist/{AgentError-Bn1ytXRD.d.mts → AgentError-BMqPzIVt.d.mts} +3 -3
- package/dist/{AgentPolicy-B4oH8TbG.d.mts → AgentPolicy-CclAEpHn.d.mts} +2 -2
- package/dist/{AgentRuntime-D1MmB_0z.d.mts → AgentRuntime-BM36roNi.d.mts} +44 -30
- package/dist/{AgentRuntime-CVMHysXm.mjs → AgentRuntime-BTfPyMXN.mjs} +91 -30
- package/dist/AgentRuntime-BTfPyMXN.mjs.map +1 -0
- package/dist/{AgentUpdates-DMJ-_xow.d.mts → AgentUpdates-DksV4D0A.d.mts} +6 -3
- package/dist/{ContextCompactor-BoKQOjr5.d.mts → ContextCompactor-DLpX-HUG.d.mts} +18 -12
- package/dist/{ContextWindow-DRQ5Mbm2.d.mts → ContextWindow-aGZOPIPq.d.mts} +24 -22
- package/dist/{Digest-COAt3Orl.d.mts → Digest-3l_02jaM.d.mts} +2 -2
- package/dist/{DurableAgentRuntime-BpB5rBcu.mjs → DurableAgentRuntime-CWmWREPj.mjs} +11 -11
- package/dist/{DurableAgentRuntime-BpB5rBcu.mjs.map → DurableAgentRuntime-CWmWREPj.mjs.map} +1 -1
- package/dist/{DurableStep-Cry_iol4.d.mts → DurableStep-CTqx6DOV.d.mts} +13 -11
- package/dist/{EventSource-CtS0RBM7.d.mts → EventSource-D29Jsj5U.d.mts} +3 -3
- package/dist/{FailureDiagnostic-BElLOoED.mjs → FailureDiagnostic-D9oW23Cn.mjs} +16 -10
- package/dist/FailureDiagnostic-D9oW23Cn.mjs.map +1 -0
- package/dist/{FailureDiagnostic-CaAkzGHL.d.mts → FailureDiagnostic-DvHruCSJ.d.mts} +10 -9
- package/dist/InMemory.d.mts +28 -5
- package/dist/InMemory.mjs +37 -4
- package/dist/InMemory.mjs.map +1 -1
- package/dist/{Messaging-CICd_CSi.d.mts → Messaging-BbuaphiQ.d.mts} +6 -6
- package/dist/{Messaging-7VXQnWI3.d.mts → Messaging-DF_IWnxV.d.mts} +5 -5
- package/dist/{MessagingHost-DXwWnrMh.d.mts → MessagingHost-Bfbfkx6f.d.mts} +13 -12
- package/dist/{MessagingHost-DfsbMPvq.mjs → MessagingHost-DJZJZILu.mjs} +4 -3
- package/dist/MessagingHost-DJZJZILu.mjs.map +1 -0
- package/dist/{Output-CY7NZByV.d.mts → Output-UsQKiPhz.d.mts} +4 -4
- package/dist/{PreparedInputAdmission-CS_zlCvD.d.mts → PreparedInputAdmission-DXvjTe4U.d.mts} +6 -6
- package/dist/{Receipt-BAHyigAF.d.mts → Receipt-BkM21Qiu.d.mts} +2 -2
- package/dist/{Records-Bm4Qt70a.d.mts → Records-CAQktL0z.d.mts} +8 -8
- package/dist/{RunEvent-D0aepYwN.d.mts → RunEvent-B3CRIqIC.d.mts} +5 -5
- package/dist/{RunEventSink-9CUdI9Ar.d.mts → RunEventSink-sDXDkrAl.d.mts} +9 -7
- package/dist/{RunJournal-CA2bsvHn.mjs → RunJournal-NRgq1PNe.mjs} +3 -3
- package/dist/{RunJournal-CA2bsvHn.mjs.map → RunJournal-NRgq1PNe.mjs.map} +1 -1
- package/dist/{RunOptions-BHmBa05n.d.mts → RunOptions-CkSZSuIh.d.mts} +87 -83
- package/dist/{RunPolicyUsage-CUudVtg_.d.mts → RunPolicyUsage-QmYVw9z8.d.mts} +2 -2
- package/dist/{Schedule-Bi_XVKLF.d.mts → Schedule-rEIiYnRq.d.mts} +4 -4
- package/dist/{Subagent-DH6G120f.mjs → Subagent-C-fyHbcp.mjs} +5 -5
- package/dist/{Subagent-DH6G120f.mjs.map → Subagent-C-fyHbcp.mjs.map} +1 -1
- package/dist/{Subagent-D59om8SR.d.mts → Subagent-t3pJDZMN.d.mts} +15 -15
- package/dist/{SubagentContract-tyN9v-Jv.d.mts → SubagentContract-DdPzxYQj.d.mts} +3 -2
- package/dist/{SubagentHost-VTyf_wEF.d.mts → SubagentHost-CXFlEpj0.d.mts} +19 -16
- package/dist/{Subscription-nbSNY6Hs.d.mts → Subscription-BJj-R-6V.d.mts} +8 -8
- package/dist/{SubscriptionInput-DbXnOMS2.d.mts → SubscriptionInput-DyQtODg2.d.mts} +3 -3
- package/dist/Thread-DT8RTLIQ.d.mts +117 -0
- package/dist/{ThreadHistory-FD-o4TsR.d.mts → ThreadHistory-DQ-IC1hU.d.mts} +12 -9
- package/dist/{ToolBroker-DWs4tZra.d.mts → ToolBroker-DXwv2aUT.d.mts} +14 -12
- package/dist/{ToolExposure-UCN12eCd.d.mts → ToolExposure-BsaSH15e.d.mts} +5 -4
- package/dist/{ToolExposure-r2eOWk4F.d.mts → ToolExposure-Ckg3-sTf.d.mts} +3 -2
- package/dist/{ToolExposure-9uF_Yo0T.mjs → ToolExposure-DBATXxmL.mjs} +2 -2
- package/dist/ToolExposure-DBATXxmL.mjs.map +1 -0
- package/dist/{ToolExposure-C93U1sPu.mjs → ToolExposure-hTJT2ekj.mjs} +3 -2
- package/dist/ToolExposure-hTJT2ekj.mjs.map +1 -0
- package/dist/ToolExposure.d.mts +2 -2
- package/dist/ToolExposure.mjs +2 -2
- package/dist/{ToolResult-BKdqWRff.d.mts → ToolResult-DqyEhJLF.d.mts} +2 -2
- package/dist/{Usage-BNjPR7Zr.d.mts → Usage-CzZJ6A2n.d.mts} +3 -2
- package/dist/{Worker-XEBYxRQv.d.mts → Worker-DH5SAVIK.d.mts} +7 -7
- package/dist/{Worker-CfwzMZEK.mjs → Worker-DZjdMjZn.mjs} +3 -3
- package/dist/Worker-DZjdMjZn.mjs.map +1 -0
- package/dist/{WorkerAdmission-Cmcxd6nS.mjs → WorkerAdmission-DJ76C2b-.mjs} +4 -4
- package/dist/{WorkerAdmission-Cmcxd6nS.mjs.map → WorkerAdmission-DJ76C2b-.mjs.map} +1 -1
- package/dist/{agent-registration-BIOzAej4.mjs → agent-registration-D1dWV7KK.mjs} +3 -3
- package/dist/{agent-registration-BIOzAej4.mjs.map → agent-registration-D1dWV7KK.mjs.map} +1 -1
- package/dist/capabilities/BrowserUse.d.mts +1 -1
- package/dist/capabilities/BrowserUse.mjs +1 -1
- package/dist/capabilities/CodeMode.d.mts +2 -2
- package/dist/capabilities/CodeMode.mjs +3 -3
- package/dist/capabilities/Commands.d.mts +1 -1
- package/dist/capabilities/ContextTools.d.mts +2 -2
- package/dist/capabilities/ContextTools.mjs +1 -1
- package/dist/capabilities/Mcp.d.mts +1 -1
- package/dist/capabilities/Mcp.mjs +1 -1
- package/dist/capabilities/McpClient.d.mts +1 -1
- package/dist/capabilities/McpClient.mjs +1 -1
- package/dist/capabilities/MemoryNotes.d.mts +2 -2
- package/dist/capabilities/MemoryNotes.mjs +1 -1
- package/dist/capabilities/Messaging.d.mts +2 -2
- package/dist/capabilities/Messaging.mjs +3 -3
- package/dist/capabilities/ModelContext.d.mts +1 -1
- package/dist/capabilities/Redaction.d.mts +1 -1
- package/dist/capabilities/RunHooks.d.mts +7 -6
- package/dist/capabilities/RunHooks.mjs +2 -1
- package/dist/capabilities/RunHooks.mjs.map +1 -1
- package/dist/capabilities/SemanticMemory.d.mts +1 -1
- package/dist/capabilities/SemanticMemory.mjs +1 -1
- package/dist/capabilities/Subagent.d.mts +3 -3
- package/dist/capabilities/Subagent.mjs +2 -2
- package/dist/capabilities/SubagentReservations.d.mts +64 -60
- package/dist/capabilities/SubagentReservations.mjs +6 -1
- package/dist/capabilities/SubagentReservations.mjs.map +1 -1
- package/dist/capabilities/ToolDiscovery.d.mts +2 -2
- package/dist/capabilities/ToolDiscovery.mjs +3 -3
- package/dist/capabilities/WebCapture.d.mts +1 -1
- package/dist/capabilities/WebCapture.mjs +1 -1
- package/dist/capabilities/WebSearch.d.mts +1 -1
- package/dist/capabilities/WebSearch.mjs +1 -1
- package/dist/{compaction-C2OTceKw.mjs → compaction-FDJhjbzH.mjs} +7 -6
- package/dist/compaction-FDJhjbzH.mjs.map +1 -0
- package/dist/core/Agent.d.mts +1 -1
- package/dist/core/Agent.mjs +1 -1
- package/dist/core/AgentError.d.mts +1 -1
- package/dist/core/AgentError.mjs +4 -4
- package/dist/core/AgentError.mjs.map +1 -1
- package/dist/core/AgentPolicy.d.mts +1 -1
- package/dist/core/AgentUpdates.d.mts +1 -1
- package/dist/core/AgentUpdates.mjs +5 -1
- package/dist/core/AgentUpdates.mjs.map +1 -1
- package/dist/core/FailureDiagnostic.d.mts +1 -1
- package/dist/core/FailureDiagnostic.mjs +1 -1
- package/dist/core/IdGenerator.d.mts +3 -1
- package/dist/core/IdGenerator.mjs +8 -5
- package/dist/core/IdGenerator.mjs.map +1 -1
- package/dist/core/Receipt.d.mts +1 -1
- package/dist/core/Receipt.mjs +1 -1
- package/dist/core/Receipt.mjs.map +1 -1
- package/dist/core/RunEvent.d.mts +1 -1
- package/dist/core/RunEvent.mjs +2 -2
- package/dist/core/RunEvent.mjs.map +1 -1
- package/dist/core/RunPolicyUsage.d.mts +1 -1
- package/dist/core/RunPolicyUsage.mjs +1 -1
- package/dist/core/RunPolicyUsage.mjs.map +1 -1
- package/dist/core/SubagentContract.d.mts +1 -1
- package/dist/core/SubagentContract.mjs +2 -1
- package/dist/core/SubagentContract.mjs.map +1 -1
- package/dist/core/Thread.d.mts +2 -2
- package/dist/core/Thread.mjs +82 -33
- package/dist/core/Thread.mjs.map +1 -1
- package/dist/core/ToolResult.d.mts +1 -1
- package/dist/core/ToolResult.mjs +1 -1
- package/dist/core/ToolResult.mjs.map +1 -1
- package/dist/core/Usage.d.mts +1 -1
- package/dist/core/Usage.mjs +2 -1
- package/dist/core/Usage.mjs.map +1 -1
- package/dist/core/Worker.d.mts +2 -2
- package/dist/core/Worker.mjs +1 -1
- package/dist/durable/ActivityStore.d.mts +1 -1
- package/dist/durable/Admin.d.mts +1 -1
- package/dist/durable/AgentRegistration.d.mts +1 -1
- package/dist/durable/AgentRegistration.mjs +1 -1
- package/dist/durable/Certification.d.mts +1 -1
- package/dist/durable/CommittedActivity.d.mts +3 -3
- package/dist/durable/Digest.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.d.mts +2 -2
- package/dist/durable/DurableAgentRuntime.mjs +2 -2
- package/dist/durable/EventSource.d.mts +1 -1
- package/dist/durable/GitHubWorkflowSource.d.mts +4 -4
- package/dist/durable/GitHubWorkflowSource.mjs +1 -1
- package/dist/durable/LifecyclePublication.d.mts +1 -1
- package/dist/durable/LifecyclePublication.mjs +1 -1
- package/dist/durable/MessageDelivery.d.mts +9 -9
- package/dist/durable/MessageDelivery.mjs +2 -2
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +28 -28
- package/dist/durable/MessageDeliveryStoreConformance.mjs +1 -1
- package/dist/durable/PersistentHistory.d.mts +2 -2
- package/dist/durable/PersistentHistory.mjs +2 -2
- package/dist/durable/PreparedInputAdmission.d.mts +1 -1
- package/dist/durable/PreparedInputAdmission.mjs +1 -1
- package/dist/durable/Records.d.mts +1 -1
- package/dist/durable/Records.mjs +5 -5
- package/dist/durable/Recovery.d.mts +1 -1
- package/dist/durable/RunJournal.d.mts +1 -1
- package/dist/durable/RunJournal.mjs +1 -1
- package/dist/durable/Schedule.d.mts +1 -1
- package/dist/durable/Schedule.mjs +1 -1
- package/dist/durable/ScheduleStoreConformance.d.mts +1 -1
- package/dist/durable/ScheduleTransition.d.mts +1 -1
- package/dist/durable/Scheduling.d.mts +4 -4
- package/dist/durable/SubmissionLedger.d.mts +2 -2
- package/dist/durable/SubmissionLedger.mjs +3 -3
- package/dist/durable/SubmissionLedgerConformance.d.mts +2 -2
- package/dist/durable/SubmissionLedgerConformance.mjs +3 -3
- package/dist/durable/SubmissionStatus.d.mts +1 -1
- package/dist/durable/Subscription.d.mts +1 -1
- package/dist/durable/Subscription.mjs +1 -1
- package/dist/durable/SubscriptionInput.d.mts +1 -1
- package/dist/durable/SubscriptionInput.mjs +1 -1
- package/dist/durable/SubscriptionStoreConformance.d.mts +1 -1
- package/dist/durable/SubscriptionTools.d.mts +7 -7
- package/dist/durable/SubscriptionTools.mjs +1 -1
- package/dist/durable/SubscriptionTransition.d.mts +1 -1
- package/dist/durable/Subscriptions.d.mts +7 -7
- package/dist/durable/ThreadContextHistory.d.mts +1 -1
- package/dist/durable/ThreadContextHistoryProjection.d.mts +1 -1
- package/dist/durable/ThreadContextHistoryProjection.mjs +2 -2
- package/dist/durable/ThreadInvariants.d.mts +2 -2
- package/dist/durable/ThreadInvariants.mjs +1 -1
- package/dist/durable/ThreadProjection.d.mts +1 -1
- package/dist/durable/ThreadProjectionMaintenance.d.mts +1 -1
- package/dist/durable/ThreadStore.d.mts +1 -1
- package/dist/durable/ThreadStore.mjs +1 -1
- package/dist/durable/ThreadStoreConformance.d.mts +1 -1
- package/dist/durable/ThreadStoreConformance.mjs +1 -1
- package/dist/durable/WorkerAdmission.d.mts +6 -6
- package/dist/durable/WorkerAdmission.mjs +1 -1
- package/dist/durable/WorkerHost.d.mts +7 -7
- package/dist/durable/WorkerHost.mjs +1 -1
- package/dist/engine/AgentRuntime.d.mts +1 -1
- package/dist/engine/AgentRuntime.mjs +1 -1
- package/dist/engine/Compaction.d.mts +1 -1
- package/dist/engine/Compaction.mjs +1 -1
- package/dist/engine/ContextCompactor.d.mts +1 -1
- package/dist/engine/ContextCompactor.mjs +8 -3
- package/dist/engine/ContextCompactor.mjs.map +1 -1
- package/dist/engine/ContextWindow.d.mts +1 -1
- package/dist/engine/ContextWindow.mjs +3 -1
- package/dist/engine/ContextWindow.mjs.map +1 -1
- package/dist/engine/DurableStep.d.mts +1 -1
- package/dist/engine/DurableStep.mjs +2 -1
- package/dist/engine/DurableStep.mjs.map +1 -1
- package/dist/engine/MessagingHost.d.mts +1 -1
- package/dist/engine/MessagingHost.mjs +1 -1
- package/dist/engine/Output.d.mts +1 -1
- package/dist/engine/Output.mjs +1 -1
- package/dist/engine/RunEventSink.d.mts +1 -1
- package/dist/engine/RunEventSink.mjs +2 -1
- package/dist/engine/RunEventSink.mjs.map +1 -1
- package/dist/engine/RunOptions.d.mts +1 -1
- package/dist/engine/RunOptions.mjs +5 -2
- package/dist/engine/RunOptions.mjs.map +1 -1
- package/dist/engine/SubagentHost.d.mts +1 -1
- package/dist/engine/SubagentHost.mjs +4 -2
- package/dist/engine/SubagentHost.mjs.map +1 -1
- package/dist/engine/ThreadHistory.d.mts +1 -1
- package/dist/engine/ThreadHistory.mjs +12 -10
- package/dist/engine/ThreadHistory.mjs.map +1 -1
- package/dist/engine/ToolBroker.d.mts +1 -1
- package/dist/engine/ToolBroker.mjs +2 -1
- package/dist/engine/ToolBroker.mjs.map +1 -1
- package/dist/index.d.mts +34 -34
- package/dist/index.mjs +9 -9
- package/dist/{output-contract-DS-S8mTv.mjs → output-contract-DUNIO6as.mjs} +4 -3
- package/dist/output-contract-DUNIO6as.mjs.map +1 -0
- package/package.json +1 -1
- package/src/InMemory.ts +61 -2
- package/src/capabilities/RunHooks.ts +6 -3
- package/src/capabilities/SubagentReservations.ts +7 -1
- package/src/core/Agent.ts +3 -8
- package/src/core/AgentError.ts +1 -1
- package/src/core/AgentUpdates.ts +5 -1
- package/src/core/FailureDiagnostic.ts +6 -8
- package/src/core/IdGenerator.ts +5 -2
- package/src/core/Messaging.ts +1 -1
- package/src/core/Receipt.ts +1 -1
- package/src/core/RunEvent.ts +1 -1
- package/src/core/RunPolicyUsage.ts +1 -1
- package/src/core/SubagentContract.ts +2 -1
- package/src/core/Thread.ts +163 -61
- package/src/core/ToolExposure.ts +2 -1
- package/src/core/ToolResult.ts +1 -1
- package/src/core/Usage.ts +2 -1
- package/src/core/Worker.ts +1 -1
- package/src/core/internal/agent-updates.ts +3 -2
- package/src/core/internal/message-status.ts +1 -1
- package/src/core/internal/strict-schema.ts +3 -1
- package/src/engine/ContextCompactor.ts +8 -2
- package/src/engine/ContextWindow.ts +4 -1
- package/src/engine/DurableStep.ts +2 -1
- package/src/engine/MessagingHost.ts +2 -1
- package/src/engine/RunEventSink.ts +2 -1
- package/src/engine/RunOptions.ts +5 -1
- package/src/engine/SubagentHost.ts +3 -1
- package/src/engine/ThreadHistory.ts +20 -10
- package/src/engine/ToolBroker.ts +2 -1
- package/src/engine/ToolExposure.ts +2 -1
- package/src/engine/internal/agent-runtime.ts +41 -49
- package/src/engine/internal/bounded-value.ts +2 -1
- package/src/engine/internal/compaction.ts +12 -7
- package/src/engine/internal/output-contract.ts +3 -2
- package/src/engine/internal/primitive-delta.ts +51 -10
- package/src/engine/internal/tool-derivative.ts +5 -1
- package/src/engine/internal/tool-exposure.ts +5 -2
- package/src/engine/internal/tool-telemetry.ts +12 -13
- package/dist/Agent-BMATXYsI.mjs.map +0 -1
- package/dist/AgentRuntime-CVMHysXm.mjs.map +0 -1
- package/dist/FailureDiagnostic-BElLOoED.mjs.map +0 -1
- package/dist/MessagingHost-DfsbMPvq.mjs.map +0 -1
- package/dist/Thread-DOBQ0QUY.d.mts +0 -96
- package/dist/ToolExposure-9uF_Yo0T.mjs.map +0 -1
- package/dist/ToolExposure-C93U1sPu.mjs.map +0 -1
- package/dist/Worker-CfwzMZEK.mjs.map +0 -1
- package/dist/compaction-C2OTceKw.mjs.map +0 -1
- package/dist/output-contract-DS-S8mTv.mjs.map +0 -1
|
@@ -4,28 +4,60 @@ import { n as utf8ByteLength } from "./utf8-DchGZRBd.mjs";
|
|
|
4
4
|
import { ToolParameterRejection, TruncatedToolResult, applyToolResultBounds, unserializableToolResult } from "./core/ToolResult.mjs";
|
|
5
5
|
import { IdempotencyKey } from "./core/Receipt.mjs";
|
|
6
6
|
import { Emitter, Update, UpdateError } from "./core/AgentUpdates.mjs";
|
|
7
|
-
import { i as isModelResolver } from "./Agent-
|
|
7
|
+
import { i as isModelResolver } from "./Agent-B0WrUcHy.mjs";
|
|
8
8
|
import { AgentApprovalDenied, AgentApprovalPending, AgentInputError, AgentOutputError, AgentPolicyError, AgentRunDispositionError, AgentToolAuthorizationDenied, ContextBudgetError, ContextOverflowError, ModelProtocolError } from "./core/AgentError.mjs";
|
|
9
|
-
import { IdGenerator
|
|
9
|
+
import { IdGenerator } from "./core/IdGenerator.mjs";
|
|
10
10
|
import { DelegationDepth, SubagentParentLink, getToolExecutionKind, isSubagentToolAllowed } from "./core/SubagentContract.mjs";
|
|
11
|
-
import { a as PinnedTool, c as ToolNames, i as Limits, l as ToolNamespace, n as DiscoveryTool, o as Selection, r as IncludesCatalogDocumentation, s as Snapshot, t as AdditionalToolCatalog } from "./ToolExposure-
|
|
11
|
+
import { a as PinnedTool, c as ToolNames, i as Limits, l as ToolNamespace, n as DiscoveryTool, o as Selection, r as IncludesCatalogDocumentation, s as Snapshot, t as AdditionalToolCatalog } from "./ToolExposure-hTJT2ekj.mjs";
|
|
12
12
|
import { InputTokenUsage, ModelCallUsage, ModelResponseIdentity, OutputTokenUsage, RunTotals, RunUsageReport, emptyRunTotals, sumRunTotals, unknownRunTotals } from "./core/Usage.mjs";
|
|
13
13
|
import { AgentUpdateEmitted, ApprovalRequested, BudgetWarning, CompactionPerformed, ModelRestarted, ModelStarted, ReasoningDelta, RunCompleted, RunFailed, RunStarted, RunSuspended, SubagentCompleted, SubagentFailed, SubagentInterrupted, SubagentJoined, SubagentProgress, SubagentRequested, SubagentStarted, TextDelta, ToolCallDeclared, ToolCallFailed, ToolCallStarted, ToolCallSucceeded, ToolProgress, TurnCompleted, TurnStarted } from "./core/RunEvent.mjs";
|
|
14
|
-
import { r as FrameworkMessage, t as AssignmentDisposition } from "./Worker-
|
|
15
|
-
import { t as MessagingHost } from "./MessagingHost-
|
|
14
|
+
import { r as FrameworkMessage, t as AssignmentDisposition } from "./Worker-DZjdMjZn.mjs";
|
|
15
|
+
import { t as MessagingHost } from "./MessagingHost-DJZJZILu.mjs";
|
|
16
16
|
import { SubagentHost } from "./engine/SubagentHost.mjs";
|
|
17
17
|
import { ThreadHistory, ThreadHistoryError } from "./engine/ThreadHistory.mjs";
|
|
18
|
-
import { n as RunToolVisibility, t as CurrentToolCatalog } from "./ToolExposure-
|
|
19
|
-
import { n as outputSchemaContract, r as prepareModelPrompt, t as isTextOutput } from "./output-contract-
|
|
20
|
-
import { _ as initialCompactionState, b as boundedCanonicalJsonSnapshot, d as collectCoveredMessages, f as contextWindowId, g as evaluateMessageTokenEstimates, h as estimatePromptTokens, s as buildCompactedView, v as isContextOverflowMessage, x as boundedJsonSnapshot } from "./compaction-
|
|
18
|
+
import { n as RunToolVisibility, t as CurrentToolCatalog } from "./ToolExposure-DBATXxmL.mjs";
|
|
19
|
+
import { n as outputSchemaContract, r as prepareModelPrompt, t as isTextOutput } from "./output-contract-DUNIO6as.mjs";
|
|
20
|
+
import { _ as initialCompactionState, b as boundedCanonicalJsonSnapshot, d as collectCoveredMessages, f as contextWindowId, g as evaluateMessageTokenEstimates, h as estimatePromptTokens, s as buildCompactedView, v as isContextOverflowMessage, x as boundedJsonSnapshot } from "./compaction-FDJhjbzH.mjs";
|
|
21
21
|
import { ContextRolloverRequest, ContextRolloverSelection, ContextRolloverTool, ContextWindow, ContextWindowStatus, ModelCallContext } from "./engine/ContextWindow.mjs";
|
|
22
22
|
import { DurableStep, DurableStepError, getToolExecutionClass } from "./engine/DurableStep.mjs";
|
|
23
23
|
import { CompactionDecision, CompactionError, ContextCompactor } from "./engine/ContextCompactor.mjs";
|
|
24
24
|
import { RunEventSink, RunEventSinkClosedError } from "./engine/RunEventSink.mjs";
|
|
25
25
|
import { AgentUpdateAcceptance, CurrentToolFailureObserver, ModelUsageAccounting, RunContextPreparation, RunResumeUsageSchema, RunToolAuthorization, RunToolScheduling, RunTurnResumeSettledCallSchema } from "./engine/RunOptions.mjs";
|
|
26
26
|
import { ToolBroker, ToolBrokerConfigurationError, ToolBrokerUnavailableError } from "./engine/ToolBroker.mjs";
|
|
27
|
-
import
|
|
28
|
-
import
|
|
27
|
+
import * as Schema from "effect/Schema";
|
|
28
|
+
import * as Tool from "effect/unstable/ai/Tool";
|
|
29
|
+
import * as Toolkit from "effect/unstable/ai/Toolkit";
|
|
30
|
+
import * as Duration from "effect/Duration";
|
|
31
|
+
import * as AiError from "effect/unstable/ai/AiError";
|
|
32
|
+
import * as Context from "effect/Context";
|
|
33
|
+
import * as Effect from "effect/Effect";
|
|
34
|
+
import * as Option from "effect/Option";
|
|
35
|
+
import * as Stream from "effect/Stream";
|
|
36
|
+
import * as Cause from "effect/Cause";
|
|
37
|
+
import * as Exit from "effect/Exit";
|
|
38
|
+
import * as Redacted from "effect/Redacted";
|
|
39
|
+
import * as Channel from "effect/Channel";
|
|
40
|
+
import * as Clock from "effect/Clock";
|
|
41
|
+
import * as DateTime from "effect/DateTime";
|
|
42
|
+
import * as Equal from "effect/Equal";
|
|
43
|
+
import * as Fiber from "effect/Fiber";
|
|
44
|
+
import * as Layer from "effect/Layer";
|
|
45
|
+
import * as Metric from "effect/Metric";
|
|
46
|
+
import * as PubSub from "effect/PubSub";
|
|
47
|
+
import * as Queue from "effect/Queue";
|
|
48
|
+
import * as Result from "effect/Result";
|
|
49
|
+
import * as Schedule from "effect/Schedule";
|
|
50
|
+
import * as SchemaAST from "effect/SchemaAST";
|
|
51
|
+
import * as SchemaGetter from "effect/SchemaGetter";
|
|
52
|
+
import * as Scope from "effect/Scope";
|
|
53
|
+
import * as Semaphore from "effect/Semaphore";
|
|
54
|
+
import * as Tracer from "effect/Tracer";
|
|
55
|
+
import * as LanguageModel from "effect/unstable/ai/LanguageModel";
|
|
56
|
+
import * as Model from "effect/unstable/ai/Model";
|
|
57
|
+
import * as Prompt from "effect/unstable/ai/Prompt";
|
|
58
|
+
import * as Response from "effect/unstable/ai/Response";
|
|
59
|
+
import * as ResponseIdTracker from "effect/unstable/ai/ResponseIdTracker";
|
|
60
|
+
import * as ErrorReporter from "effect/ErrorReporter";
|
|
29
61
|
//#region src/engine/internal/bounded-value.ts
|
|
30
62
|
const DEFAULT_MAX_DEPTH = 128;
|
|
31
63
|
const OBJECT_OVERHEAD_BYTES = 32;
|
|
@@ -223,14 +255,28 @@ const boundedValueFootprint = (root, maxBytes, knownSafePrototypes = /* @__PURE_
|
|
|
223
255
|
};
|
|
224
256
|
//#endregion
|
|
225
257
|
//#region src/engine/internal/primitive-delta.ts
|
|
258
|
+
const brand = "~effect/ai/Response/Part";
|
|
226
259
|
const keys = [
|
|
227
|
-
|
|
260
|
+
brand,
|
|
228
261
|
"type",
|
|
229
262
|
"id",
|
|
230
263
|
"delta",
|
|
231
264
|
"metadata"
|
|
232
265
|
];
|
|
233
|
-
const
|
|
266
|
+
const boundaryKeys = [
|
|
267
|
+
brand,
|
|
268
|
+
"type",
|
|
269
|
+
"id",
|
|
270
|
+
"metadata"
|
|
271
|
+
];
|
|
272
|
+
const decode = Schema.decodeUnknownOption(Schema.toType(Schema.Union([
|
|
273
|
+
Response.TextDeltaPart,
|
|
274
|
+
Response.ReasoningDeltaPart,
|
|
275
|
+
Response.TextStartPart,
|
|
276
|
+
Response.TextEndPart,
|
|
277
|
+
Response.ReasoningStartPart,
|
|
278
|
+
Response.ReasoningEndPart
|
|
279
|
+
])));
|
|
234
280
|
const overhead = (type) => ({
|
|
235
281
|
source: boundedValueFootprint(Response.makePart(type, {
|
|
236
282
|
id: "",
|
|
@@ -243,33 +289,50 @@ const overhead = (type) => ({
|
|
|
243
289
|
metadata: {}
|
|
244
290
|
}, Number.MAX_SAFE_INTEGER)
|
|
245
291
|
});
|
|
292
|
+
const boundaryOverhead = (type) => ({
|
|
293
|
+
source: boundedValueFootprint(Response.makePart(type, { id: "" }), Number.MAX_SAFE_INTEGER),
|
|
294
|
+
encoded: boundedValueFootprint({
|
|
295
|
+
type,
|
|
296
|
+
id: "",
|
|
297
|
+
metadata: {}
|
|
298
|
+
}, Number.MAX_SAFE_INTEGER)
|
|
299
|
+
});
|
|
246
300
|
const overheads = {
|
|
247
301
|
"text-delta": overhead("text-delta"),
|
|
248
|
-
"reasoning-delta": overhead("reasoning-delta")
|
|
302
|
+
"reasoning-delta": overhead("reasoning-delta"),
|
|
303
|
+
"text-start": boundaryOverhead("text-start"),
|
|
304
|
+
"text-end": boundaryOverhead("text-end"),
|
|
305
|
+
"reasoning-start": boundaryOverhead("reasoning-start"),
|
|
306
|
+
"reasoning-end": boundaryOverhead("reasoning-end")
|
|
249
307
|
};
|
|
250
308
|
/**
|
|
251
|
-
* Copy
|
|
309
|
+
* Copy primitive text and reasoning parts into owned data before native Schema validation.
|
|
252
310
|
* Descriptor checks select this optimization; they do not replace the native codec.
|
|
253
311
|
* Extra fields, accessors, and nonempty metadata use the general ownership path.
|
|
254
312
|
* No provider object survives, including an empty metadata object's hidden storage.
|
|
255
313
|
* Unlike a generic footprint shortcut, this cannot retain an exotic backing buffer.
|
|
256
314
|
*/
|
|
257
|
-
const
|
|
315
|
+
const ownPrimitiveTextPart = (part, maxBytes) => {
|
|
258
316
|
try {
|
|
259
317
|
if (part === null || typeof part !== "object") return void 0;
|
|
260
318
|
if (Array.isArray(part) || ArrayBuffer.isView(part)) return void 0;
|
|
261
319
|
const prototype = Object.getPrototypeOf(part);
|
|
262
320
|
if (prototype !== Object.prototype && prototype !== null) return void 0;
|
|
263
|
-
|
|
321
|
+
const typeDescriptor = Object.getOwnPropertyDescriptor(part, "type");
|
|
322
|
+
if (typeDescriptor === void 0 || !("value" in typeDescriptor)) return void 0;
|
|
323
|
+
const isDelta = typeDescriptor.value === "text-delta" || typeDescriptor.value === "reasoning-delta";
|
|
324
|
+
const selectedKeys = isDelta ? keys : boundaryKeys;
|
|
325
|
+
if (Reflect.ownKeys(part).length !== selectedKeys.length) return void 0;
|
|
264
326
|
const snapshot = {};
|
|
265
|
-
for (const key of
|
|
327
|
+
for (const key of selectedKeys) {
|
|
266
328
|
const descriptor = Object.getOwnPropertyDescriptor(part, key);
|
|
267
329
|
if (descriptor === void 0 || !("value" in descriptor)) return void 0;
|
|
268
330
|
snapshot[key] = descriptor.value;
|
|
269
331
|
}
|
|
270
332
|
const { type, id, delta, metadata } = snapshot;
|
|
271
|
-
if (type !== "text-delta" && type !== "reasoning-delta") return
|
|
272
|
-
if (
|
|
333
|
+
if (type !== "text-delta" && type !== "reasoning-delta" && type !== "text-start" && type !== "text-end" && type !== "reasoning-start" && type !== "reasoning-end") return;
|
|
334
|
+
if (isDelta !== (type === "text-delta" || type === "reasoning-delta")) return void 0;
|
|
335
|
+
if (typeof id !== "string" || isDelta && typeof delta !== "string") return void 0;
|
|
273
336
|
if (metadata === null || typeof metadata !== "object") return void 0;
|
|
274
337
|
if (Array.isArray(metadata) || ArrayBuffer.isView(metadata)) return void 0;
|
|
275
338
|
const metadataPrototype = Object.getPrototypeOf(metadata);
|
|
@@ -277,7 +340,7 @@ const ownPrimitiveDelta = (part, maxBytes) => {
|
|
|
277
340
|
if (Reflect.ownKeys(metadata).length !== 0) return void 0;
|
|
278
341
|
const fixed = overheads[type];
|
|
279
342
|
if (fixed.source === void 0 || fixed.encoded === void 0) return void 0;
|
|
280
|
-
const bytes = utf8ByteLength(id) + utf8ByteLength(delta);
|
|
343
|
+
const bytes = utf8ByteLength(id) + (typeof delta === "string" ? utf8ByteLength(delta) : 0);
|
|
281
344
|
if (bytes + fixed.source > maxBytes || bytes + fixed.encoded > maxBytes) return void 0;
|
|
282
345
|
snapshot.metadata = {};
|
|
283
346
|
const validated = decode(snapshot);
|
|
@@ -910,8 +973,7 @@ const ownModelResponsePartGeneral = Effect.fnUntraced(function* (part, toolkit,
|
|
|
910
973
|
yield* inspectModelResponsePartCapacity(usage, preflight ?? part, limits);
|
|
911
974
|
}
|
|
912
975
|
const codec = modelResponseCodecFor(toolkit);
|
|
913
|
-
const
|
|
914
|
-
const encoded = yield* Schema.encodeUnknownEffect(codec)(part).pipe(Effect.mapError(() => encodingFailure));
|
|
976
|
+
const encoded = yield* Schema.encodeUnknownEffect(codec)(part).pipe(Effect.mapError(() => ModelProtocolError.make({ message: "Model response part failed canonical encoding" })));
|
|
915
977
|
const retainedBytes = yield* inspectModelResponsePartCapacity(usage, encoded, limits);
|
|
916
978
|
const ownedEncoded = yield* Effect.try({
|
|
917
979
|
try: () => {
|
|
@@ -920,14 +982,13 @@ const ownModelResponsePartGeneral = Effect.fnUntraced(function* (part, toolkit,
|
|
|
920
982
|
},
|
|
921
983
|
catch: () => ModelProtocolError.make({ message: "Model response part could not be converted into engine-owned data" })
|
|
922
984
|
});
|
|
923
|
-
const decodingFailure = ModelProtocolError.make({ message: "Model response part failed canonical decoding" });
|
|
924
985
|
return {
|
|
925
|
-
ownedPart: yield* Schema.decodeUnknownEffect(codec)(ownedEncoded).pipe(Effect.mapError(() =>
|
|
986
|
+
ownedPart: yield* Schema.decodeUnknownEffect(codec)(ownedEncoded).pipe(Effect.mapError(() => ModelProtocolError.make({ message: "Model response part failed canonical decoding" }))),
|
|
926
987
|
retainedBytes
|
|
927
988
|
};
|
|
928
989
|
});
|
|
929
990
|
const ownModelResponsePart = (part, toolkit, usage, limits) => Effect.suspend(() => {
|
|
930
|
-
const primitive = usage.responsePartCount < limits.maxModelResponseParts ?
|
|
991
|
+
const primitive = usage.responsePartCount < limits.maxModelResponseParts ? ownPrimitiveTextPart(part, limits.maxModelResponseBytes - usage.responsePartBytes) : void 0;
|
|
931
992
|
return primitive === void 0 ? ownModelResponsePartGeneral(part, toolkit, usage, limits) : Effect.succeed(primitive);
|
|
932
993
|
});
|
|
933
994
|
const consumeModelResponsePart = (usage, retainedBytes, limits) => Effect.suspend(() => {
|
|
@@ -1386,7 +1447,7 @@ const toolTelemetryAttributes = (descriptor) => ({
|
|
|
1386
1447
|
toolName: descriptor.toolName
|
|
1387
1448
|
});
|
|
1388
1449
|
/** Canonical content-free terminal signal for any application Tool handler attempt. */
|
|
1389
|
-
const terminalToolTelemetry = (descriptor, outcome, failureMarker, failureHandling) => annotateToolSpanTerminalOutcome(outcome, failureMarker, failureHandling, descriptor.failureMode).pipe(Effect.andThen((outcome === "success" ? Effect.
|
|
1450
|
+
const terminalToolTelemetry = (descriptor, outcome, failureMarker, failureHandling) => annotateToolSpanTerminalOutcome(outcome, failureMarker, failureHandling, descriptor.failureMode).pipe(Effect.andThen((outcome === "success" ? Effect.logDebug("agent tool execution completed") : Effect.logWarning("agent tool execution failed")).pipe(Effect.annotateLogs({
|
|
1390
1451
|
...toolTelemetryAttributes(descriptor),
|
|
1391
1452
|
"effect_agent.tool.outcome": outcome,
|
|
1392
1453
|
...failureHandling === void 0 ? {} : { "effect_agent.tool.failure_handling": failureHandling },
|
|
@@ -2820,7 +2881,7 @@ const makeTurn = (agent, context, prompt, turn, priorToolCalls, options, restart
|
|
|
2820
2881
|
limit: turn > bounds.maxTurns ? "turns" : priorToolCalls + context.programmaticToolCalls > bounds.maxToolCalls ? "tool-calls" : "tokens",
|
|
2821
2882
|
message: "Agent already used its one grace finalization"
|
|
2822
2883
|
}));
|
|
2823
|
-
const turnId = yield* (yield* IdGenerator
|
|
2884
|
+
const turnId = yield* (yield* IdGenerator).nextTurnId;
|
|
2824
2885
|
const outputContract = outputSchemaContract(agent.definition);
|
|
2825
2886
|
const outputContractMessage = outputContract._tag === "rendered" ? outputContract.message : void 0;
|
|
2826
2887
|
const contextRequest = {
|
|
@@ -3717,7 +3778,7 @@ function streamWithCompletion(agentValue, input, runOptions = {}, onCompleted, o
|
|
|
3717
3778
|
const preparation = yield* Effect.serviceOption(RunContextPreparation).pipe(Effect.map(Option.getOrElse(() => RunContextPreparation.of({}))));
|
|
3718
3779
|
const authorization = yield* Effect.serviceOption(RunToolAuthorization).pipe(Effect.map(Option.getOrUndefined));
|
|
3719
3780
|
const visibility = yield* RunToolVisibility;
|
|
3720
|
-
const ids = yield* IdGenerator
|
|
3781
|
+
const ids = yield* IdGenerator;
|
|
3721
3782
|
const threadId = runOptions.threadId ?? (yield* ids.nextThreadId);
|
|
3722
3783
|
const runId = runOptions.runId ?? (yield* ids.nextRunId);
|
|
3723
3784
|
const retained = history.retention === "incremental" && runOptions.durability !== void 0 ? void 0 : yield* history.open({
|
|
@@ -4726,7 +4787,7 @@ const waitingFromCause = (cause) => {
|
|
|
4726
4787
|
* services; delegation handlers do not select separate host policies.
|
|
4727
4788
|
*/
|
|
4728
4789
|
const spawnWithParent = (parent, depth, history, preparation, onChild) => Effect.fn("AgentSpawner.spawn")(function* (binding, input, delegation, options) {
|
|
4729
|
-
const ids = yield* IdGenerator
|
|
4790
|
+
const ids = yield* IdGenerator;
|
|
4730
4791
|
const threadId = yield* ids.nextThreadId;
|
|
4731
4792
|
const runId = yield* ids.nextRunId;
|
|
4732
4793
|
const childDepth = yield* Schema.decodeEffect(DelegationDepth)(depth + 1).pipe(Effect.orDie);
|
|
@@ -4841,4 +4902,4 @@ var AgentRuntime_exports = /* @__PURE__ */ __exportAll({
|
|
|
4841
4902
|
//#endregion
|
|
4842
4903
|
export { stream as _, SubagentDurability as a, withTerminalDefectEvent as b, decodeFinalOutput as c, projectCompletionOutput as d, renderInputPrompt as f, startUnknown as g, start as h, AgentSpawner as i, encodeRunDisposition as l, runUnknown as m, AgentChildPending as n, SubagentDurabilityError as o, run as p, AgentResultSchema as r, ToolCallWaiting as s, AgentRuntime_exports as t, projectCompletionFromToolOutput as u, streamUnknown as v, streamWithUsageAccountingUnknown as y };
|
|
4843
4904
|
|
|
4844
|
-
//# sourceMappingURL=AgentRuntime-
|
|
4905
|
+
//# sourceMappingURL=AgentRuntime-BTfPyMXN.mjs.map
|