effect-agent 0.1.0-beta.144 → 0.1.0-beta.149

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.
Files changed (83) hide show
  1. package/dist/{Admin-CQMppCcy.d.mts → Admin-B8ISZyYf.d.mts} +37 -22
  2. package/dist/Agent-1DMSO_Fl.mjs.map +1 -1
  3. package/dist/{Agent-BWhD4Dvu.d.mts → Agent-Cjd_ZveM.d.mts} +7 -3
  4. package/dist/{AgentRuntime-xeCUXutN.mjs → AgentRuntime-D8U9gl9Q.mjs} +23 -18
  5. package/dist/AgentRuntime-D8U9gl9Q.mjs.map +1 -0
  6. package/dist/{AgentRuntime-B4kIzmSF.d.mts → AgentRuntime-sXpKcyxu.d.mts} +5 -5
  7. package/dist/{DurableAgentRuntime-D8GI66mP.mjs → DurableAgentRuntime-DLa4IwFi.mjs} +87 -49
  8. package/dist/DurableAgentRuntime-DLa4IwFi.mjs.map +1 -0
  9. package/dist/{EventSource-w9PonN9X.d.mts → EventSource-CkN05NT3.d.mts} +2 -2
  10. package/dist/{Messaging-Dnmk31yq.d.mts → Messaging-ccQURKCf.d.mts} +3 -3
  11. package/dist/{MessagingHost-CajpPDPG.d.mts → MessagingHost-D04wE-7W.d.mts} +2 -2
  12. package/dist/{Output-DhtWbBcw.d.mts → Output-CFD1CPfU.d.mts} +2 -2
  13. package/dist/{PreparedInputAdmission-BfcLy_k4.d.mts → PreparedInputAdmission-fctZOTnn.d.mts} +3 -3
  14. package/dist/{RunOptions-IlEXLG5F.d.mts → RunOptions-Bv9NpkPZ.d.mts} +10 -2
  15. package/dist/{Subagent-Cl8D1mFM.d.mts → Subagent-VHrANXFy.d.mts} +5 -5
  16. package/dist/{Subagent-8RzJkqJ9.mjs → Subagent-hG9lJ7tJ.mjs} +2 -2
  17. package/dist/{Subagent-8RzJkqJ9.mjs.map → Subagent-hG9lJ7tJ.mjs.map} +1 -1
  18. package/dist/{SubagentHost-B6f4PBC2.d.mts → SubagentHost-C-4A7tA2.d.mts} +2 -2
  19. package/dist/{Subscription-ClkC4_T0.d.mts → Subscription-B16A-48F.d.mts} +2 -2
  20. package/dist/{SubscriptionInput-CMjEKL1z.d.mts → SubscriptionInput-DIU7CiXE.d.mts} +2 -2
  21. package/dist/capabilities/Commands.d.mts +1 -1
  22. package/dist/capabilities/Messaging.d.mts +1 -1
  23. package/dist/capabilities/RunHooks.d.mts +1 -1
  24. package/dist/capabilities/Subagent.d.mts +1 -1
  25. package/dist/capabilities/Subagent.mjs +1 -1
  26. package/dist/core/Agent.d.mts +1 -1
  27. package/dist/durable/Admin.d.mts +1 -1
  28. package/dist/durable/AgentRegistration.d.mts +1 -1
  29. package/dist/durable/Certification.d.mts +1 -1
  30. package/dist/durable/CommittedActivity.d.mts +1 -1
  31. package/dist/durable/DurableAgentRuntime.d.mts +1 -1
  32. package/dist/durable/DurableAgentRuntime.mjs +1 -1
  33. package/dist/durable/EventSource.d.mts +1 -1
  34. package/dist/durable/GitHubWorkflowSource.d.mts +3 -3
  35. package/dist/durable/LifecyclePublication.d.mts +2 -2
  36. package/dist/durable/LifecyclePublication.mjs +32 -12
  37. package/dist/durable/LifecyclePublication.mjs.map +1 -1
  38. package/dist/durable/MessageDelivery.d.mts +3 -3
  39. package/dist/durable/MessageDeliveryStoreConformance.d.mts +1 -1
  40. package/dist/durable/PersistentHistory.d.mts +1 -1
  41. package/dist/durable/PreparedInputAdmission.d.mts +1 -1
  42. package/dist/durable/Recovery.d.mts +1 -1
  43. package/dist/durable/RunJournal.d.mts +1 -1
  44. package/dist/durable/Scheduling.d.mts +1 -1
  45. package/dist/durable/SubmissionLedger.d.mts +1 -1
  46. package/dist/durable/SubmissionLedgerConformance.d.mts +1 -1
  47. package/dist/durable/SubmissionStatus.d.mts +1 -1
  48. package/dist/durable/Subscription.d.mts +1 -1
  49. package/dist/durable/SubscriptionInput.d.mts +1 -1
  50. package/dist/durable/SubscriptionStoreConformance.d.mts +1 -1
  51. package/dist/durable/SubscriptionTools.d.mts +2 -2
  52. package/dist/durable/SubscriptionTransition.d.mts +1 -1
  53. package/dist/durable/Subscriptions.d.mts +5 -5
  54. package/dist/durable/ThreadContextHistory.d.mts +1 -1
  55. package/dist/durable/ThreadInvariants.d.mts +1 -1
  56. package/dist/durable/ThreadProjectionMaintenance.d.mts +1 -1
  57. package/dist/durable/ThreadStore.d.mts +1 -1
  58. package/dist/durable/ThreadStoreConformance.d.mts +1 -1
  59. package/dist/durable/WorkerHost.d.mts +25 -5
  60. package/dist/durable/WorkerHost.mjs.map +1 -1
  61. package/dist/engine/AgentRuntime.d.mts +1 -1
  62. package/dist/engine/AgentRuntime.mjs +1 -1
  63. package/dist/engine/MessagingHost.d.mts +1 -1
  64. package/dist/engine/Output.d.mts +1 -1
  65. package/dist/engine/Output.mjs +1 -1
  66. package/dist/engine/RunOptions.d.mts +1 -1
  67. package/dist/engine/RunOptions.mjs.map +1 -1
  68. package/dist/engine/SubagentHost.d.mts +1 -1
  69. package/dist/index.d.mts +13 -13
  70. package/dist/index.mjs +3 -3
  71. package/dist/{output-contract-CANJJGA5.mjs → output-contract-DS-S8mTv.mjs} +46 -10
  72. package/dist/{output-contract-CANJJGA5.mjs.map → output-contract-DS-S8mTv.mjs.map} +1 -1
  73. package/package.json +1 -1
  74. package/src/core/Agent.ts +6 -2
  75. package/src/durable/DurableAgentRuntime.ts +86 -78
  76. package/src/durable/LifecyclePublication.ts +79 -25
  77. package/src/durable/WorkerHost.ts +23 -1
  78. package/src/durable/internal/worker-host.ts +169 -17
  79. package/src/engine/RunOptions.ts +8 -0
  80. package/src/engine/internal/agent-runtime.ts +80 -18
  81. package/src/engine/internal/output-contract.ts +67 -8
  82. package/dist/AgentRuntime-xeCUXutN.mjs.map +0 -1
  83. package/dist/DurableAgentRuntime-D8GI66mP.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { O as PersistedJson } from "./Records-B5GFWCpn.mjs";
2
- import { E as SubscriptionSourceError, b as SubscriptionRecord, i as EventSourceVersion, t as AcceptedEvent } from "./Subscription-ClkC4_T0.mjs";
2
+ import { E as SubscriptionSourceError, b as SubscriptionRecord, i as EventSourceVersion, t as AcceptedEvent } from "./Subscription-B16A-48F.mjs";
3
3
  import { Context, Effect, Schema, Scope } from "effect";
4
4
  declare namespace EventSource_d_exports {
5
5
  export { EventSource, EventSources, NormalizedEvent, makeEventSource };
@@ -48,4 +48,4 @@ declare const makeEventSource: <Event extends Schema.Top, Parameters extends Sch
48
48
  }) => Effect.Effect<EventSource, never, Exclude<R, Scope.Scope> | Exclude<Event["DecodingServices"], Scope.Scope> | Exclude<Event["EncodingServices"], Scope.Scope> | Exclude<Parameters["DecodingServices"], Scope.Scope> | Exclude<Parameters["EncodingServices"], Scope.Scope>>;
49
49
  //#endregion
50
50
  export { makeEventSource as a, NormalizedEvent as i, EventSource_d_exports as n, EventSources as r, EventSource as t };
51
- //# sourceMappingURL=EventSource-w9PonN9X.d.mts.map
51
+ //# sourceMappingURL=EventSource-CkN05NT3.d.mts.map
@@ -1,7 +1,7 @@
1
1
  import { a as Receipt, t as IdempotencyKey } from "./Receipt-BAHyigAF.mjs";
2
- import { r as AnyDefinition } from "./Agent-BWhD4Dvu.mjs";
2
+ import { r as AnyDefinition } from "./Agent-Cjd_ZveM.mjs";
3
3
  import { a as MessageAdmission, c as MessageRef, i as MessageAddress, l as MessageStatus, n as InboxPage, o as MessagingError, r as InputMessage, s as PeerName, t as InboxEntry } from "./Messaging-Dkg87ebg.mjs";
4
- import { t as MessagingHost } from "./MessagingHost-CajpPDPG.mjs";
4
+ import { t as MessagingHost } from "./MessagingHost-D04wE-7W.mjs";
5
5
  import { Tool, Toolkit } from "effect/unstable/ai";
6
6
  import { Crypto, Effect, Schema } from "effect";
7
7
  declare namespace Messaging_d_exports {
@@ -1064,4 +1064,4 @@ declare const retryTool: <const Name extends string, Input extends Schema.Top>(d
1064
1064
  };
1065
1065
  //#endregion
1066
1066
  export { inspect as a, reply as c, retryTool as d, send as f, inboxTool as i, replyTool as l, Peer as n, inspectTool as o, sendTool as p, inbox as r, peer as s, Messaging_d_exports as t, retry as u };
1067
- //# sourceMappingURL=Messaging-Dnmk31yq.d.mts.map
1067
+ //# sourceMappingURL=Messaging-ccQURKCf.d.mts.map
@@ -1,6 +1,6 @@
1
1
  import { u as ThreadId } from "./Identifiers-CN2s30fF.mjs";
2
2
  import { r as Principal, t as IdempotencyKey } from "./Receipt-BAHyigAF.mjs";
3
- import { r as AnyDefinition } from "./Agent-BWhD4Dvu.mjs";
3
+ import { r as AnyDefinition } from "./Agent-Cjd_ZveM.mjs";
4
4
  import { h as WorkerSource } from "./Worker-fwWkBg12.mjs";
5
5
  import { c as MessageRef, i as MessageAddress, l as MessageStatus, n as InboxPage, o as MessagingError } from "./Messaging-Dkg87ebg.mjs";
6
6
  import { Context, Effect } from "effect";
@@ -71,4 +71,4 @@ declare const PeerDeliveryLifetime: Context.Reference<number>;
71
71
  declare const PeerMessageCapacity: Context.Reference<number>;
72
72
  //#endregion
73
73
  export { PeerDeliveryLifetime as a, PeerTarget as c, PeerAuthorizer as i, SendPeerMessage as l, MessagingHost_d_exports as n, PeerMessageCapacity as o, PeerAuthorizationRequest as r, PeerRoutes as s, MessagingHost as t };
74
- //# sourceMappingURL=MessagingHost-CajpPDPG.d.mts.map
74
+ //# sourceMappingURL=MessagingHost-D04wE-7W.d.mts.map
@@ -1,4 +1,4 @@
1
- import "./Agent-BWhD4Dvu.mjs";
1
+ import "./Agent-Cjd_ZveM.mjs";
2
2
  import { Prompt } from "effect/unstable/ai";
3
3
  import { Schema } from "effect";
4
4
  //#region src/engine/internal/output-contract.d.ts
@@ -22,4 +22,4 @@ declare namespace Output_d_exports {
22
22
  }
23
23
  //#endregion
24
24
  export { textOutput as n, Output_d_exports as t };
25
- //# sourceMappingURL=Output-DhtWbBcw.d.mts.map
25
+ //# sourceMappingURL=Output-CFD1CPfU.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { a as Receipt } from "./Receipt-BAHyigAF.mjs";
2
2
  import { a as FailureDiagnostic_d_exports, r as Diagnostic } from "./FailureDiagnostic-CaAkzGHL.mjs";
3
- import { Ei as SubmissionStatus } from "./Admin-CQMppCcy.mjs";
3
+ import { Oi as SubmissionStatus } from "./Admin-B8ISZyYf.mjs";
4
4
  import { H as ScheduledInputRefused, V as ScheduledInputFailure, j as ScheduleStorageError } from "./Schedule-CtYREFnz.mjs";
5
- import { a as PreparedInput } from "./Subscription-ClkC4_T0.mjs";
5
+ import { a as PreparedInput } from "./Subscription-B16A-48F.mjs";
6
6
  import { Context, Effect } from "effect";
7
7
  declare namespace PreparedInputAdmission_d_exports {
8
8
  export { PreparedInputAdmission, admitPreparedInput };
@@ -39,4 +39,4 @@ declare const admitPreparedInput: <R>(submit: Effect.Effect<Receipt, ScheduledIn
39
39
  }, ScheduleStorageError, R>;
40
40
  //#endregion
41
41
  export { PreparedInputAdmission_d_exports as n, admitPreparedInput as r, PreparedInputAdmission as t };
42
- //# sourceMappingURL=PreparedInputAdmission-BfcLy_k4.d.mts.map
42
+ //# sourceMappingURL=PreparedInputAdmission-fctZOTnn.d.mts.map
@@ -6,7 +6,7 @@ import { r as ModelCallUsage, s as RunTotals, t as ChildRunUsage } from "./Usage
6
6
  import { a as AgentInputError, u as AgentToolAuthorizationCheckError } from "./AgentError-Bn1ytXRD.mjs";
7
7
  import { t as ToolParameterRejection } from "./ToolResult-BKdqWRff.mjs";
8
8
  import { t as AgentPolicy } from "./AgentPolicy-BqDoSXO6.mjs";
9
- import { r as AnyDefinition } from "./Agent-BWhD4Dvu.mjs";
9
+ import { r as AnyDefinition } from "./Agent-Cjd_ZveM.mjs";
10
10
  import { o as MemoryRecallError } from "./MemoryReference-B8Q3UJoJ.mjs";
11
11
  import { t as RunPolicyUsage } from "./RunPolicyUsage-ClZxyR46.mjs";
12
12
  import { a as WorkerBudgetScope, r as FrameworkMessage } from "./Worker-fwWkBg12.mjs";
@@ -155,6 +155,14 @@ interface RunContextRequest {
155
155
  * identities rather than infer durable state from this Prompt alone.
156
156
  */
157
157
  readonly source: Prompt.Prompt;
158
+ /**
159
+ * Durable coordinator's exact prior-Run prefix length in `source`. A preparation hook
160
+ * can replace `source.content.slice(0, priorRunPrefixLength)` with application context
161
+ * while preserving this Run's instructions, input, updates and recovered Tool exchanges.
162
+ * This is a model-only transformation: canonical records and retry receipts are retained.
163
+ * Absent for non-durable Runs; never infer this boundary from message roles or text.
164
+ */
165
+ readonly priorRunPrefixLength?: number | undefined;
158
166
  /**
159
167
  * The exact model-visible final-output contract the engine appends to the
160
168
  * prepared prompt after this hook returns (RUN-028), or
@@ -932,4 +940,4 @@ type RunOptionsError<Options> = Options extends RunOptions<infer Error, infer _R
932
940
  type RunOptionsRequirements<Options> = Options extends RunOptions<infer _Error, infer Requirements> ? Requirements : never;
933
941
  //#endregion
934
942
  export { RunTurnResponseCommit as $, RunInputCommand as A, RunSubagentChildIdentity as B, RunContextPreparationPassthrough as C, RunCostEstimateValue as D, RunCostEstimateRequest as E, RunOptions_d_exports as F, RunToolAuthorization as G, RunSubagentEstablishRequest as H, RunResumeUsage as I, RunToolAuthorizationRequest as J, RunToolAuthorizationDecision as K, RunResumeUsageSchema as L, RunOptions as M, RunOptionsError as N, RunCostEstimator as O, RunOptionsRequirements as P, RunTransientContextHook as Q, RunSchedulingHook as R, RunContextPreparationError as S, RunCostEstimate as T, RunSubagentHook as U, RunSubagentDigests as V, RunSubagentJoinRequest as W, RunToolFailureObserver as X, RunToolCallDescriptor as Y, RunToolScheduling as Z, RunBudgetHook as _, ChildEstablishWaiting as a, RunUsageDelta as at, RunContextHook as b, ModelToolFailure as c, ProgrammaticPreflightFailure as d, RunTurnResume as et, ProgrammaticToolFailure as f, RunApprovalRequest as g, RunApprovalHook as h, ChildEstablishStatus as i, RunTurnUsage as it, RunInputHook as j, RunDurabilityHook as k, ModelUsageAccounting as l, RunApprovalDecision as m, ChildEstablishDenied as n, RunTurnResumeSettledCall as nt, CommandDrainPolicy as o, ToolFailureObservation as ot, ResolvedModelCall as p, RunToolAuthorizationHook as q, ChildEstablishSettled as r, RunTurnResumeSettledCallSchema as rt, CurrentToolFailureObserver as s, toolFailureObserverLayer as st, AgentUpdateAcceptance as t, RunTurnResumeCall as tt, PreparedRunContext as u, RunBufferLimits as v, RunContextRequest as w, RunContextPreparation as x, RunCompactionCommit as y, RunSchedulingOverride as z };
935
- //# sourceMappingURL=RunOptions-IlEXLG5F.d.mts.map
943
+ //# sourceMappingURL=RunOptions-Bv9NpkPZ.d.mts.map
@@ -6,12 +6,12 @@ import { r as Update } from "./AgentUpdates-DMJ-_xow.mjs";
6
6
  import { s as RunTotals } from "./Usage-Dx0aknfk.mjs";
7
7
  import { t as ThreadHistory } from "./ThreadHistory-tS1KwxHR.mjs";
8
8
  import { a as FailureDiagnostic_d_exports, r as Diagnostic } from "./FailureDiagnostic-CaAkzGHL.mjs";
9
- import { E as RunDispositionDeclaration, _ as InstructionSource, c as Definition, m as InputPromptSource, r as AnyDefinition, y as ModelServices } from "./Agent-BWhD4Dvu.mjs";
9
+ import { E as RunDispositionDeclaration, _ as InstructionSource, c as Definition, m as InputPromptSource, r as AnyDefinition, y as ModelServices } from "./Agent-Cjd_ZveM.mjs";
10
10
  import { a as WorkerBudgetScope, c as WorkerError, f as WorkerRef, o as WorkerCompletion, p as WorkerReport } from "./Worker-fwWkBg12.mjs";
11
- import { V as RunSubagentDigests, x as RunContextPreparation } from "./RunOptions-IlEXLG5F.mjs";
11
+ import { V as RunSubagentDigests, x as RunContextPreparation } from "./RunOptions-Bv9NpkPZ.mjs";
12
12
  import { c as MessageRef, l as MessageStatus } from "./Messaging-Dkg87ebg.mjs";
13
- import { f as WorkerReporting, o as SubagentHost } from "./SubagentHost-B6f4PBC2.mjs";
14
- import { S as ToolCallWaiting, _ as SubagentDurability, b as SubagentDurabilityError, c as AgentSpawner, h as SpawnRunOptions, l as AgentSpawnerParent, o as AgentRuntimeFailure, p as RuntimeBinding, s as AgentRuntimeRequirements } from "./AgentRuntime-B4kIzmSF.mjs";
13
+ import { f as WorkerReporting, o as SubagentHost } from "./SubagentHost-C-4A7tA2.mjs";
14
+ import { S as ToolCallWaiting, _ as SubagentDurability, b as SubagentDurabilityError, c as AgentSpawner, h as SpawnRunOptions, l as AgentSpawnerParent, o as AgentRuntimeFailure, p as RuntimeBinding, s as AgentRuntimeRequirements } from "./AgentRuntime-sXpKcyxu.mjs";
15
15
  import { t as RunEventSink } from "./RunEventSink-D5aVhISG.mjs";
16
16
  import { Tool, Toolkit } from "effect/unstable/ai";
17
17
  import { Crypto, Duration, Effect, Layer, Schema, Scope, Stream } from "effect";
@@ -1649,4 +1649,4 @@ declare function background<const Name extends string, Input extends Schema.Top,
1649
1649
  declare function background<const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project, const Selected extends BackgroundOptions>(declaration: Declaration<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>, selected: Selected): ReturnType<typeof background$1<Name, Input, Output, Parameters, Success, Failure, Prepare, Project, Selected>>;
1650
1650
  //#endregion
1651
1651
  export { inspect as A, delegationCapsFromPolicy as B, BackgroundOptions as C, awaitWorker as D, WorkerObservation as E, SubagentPolicy as F, SubagentPolicyInput as I, SubagentPrestartDenied as L, observe as M, start as N, cancel as O, stop as P, SubagentProjectionFailure as R, make as S, Worker as T, SubagentTools as _, SubagentDelegation as a, define as b, SubagentFailureMode as c, SubagentResult as d, SubagentResultContext as f, SubagentToolFailure as g, SubagentTool as h, SubagentDefineOptions as i, list as j, followUp as k, SubagentLayerRequirements as l, SubagentRuntimeOptions as m, SubagentContainedFailure as n, SubagentDurableAccounting as o, SubagentReturnModeFailure as p, SubagentDeclarationOptions as r, SubagentDurableOptions as s, SubagentChildRunFailure as t, SubagentPrepareContext as u, Subagent_d_exports as v, BackgroundTools as w, layer as x, background as y, delegationAllocationFromPolicy as z };
1652
- //# sourceMappingURL=Subagent-Cl8D1mFM.d.mts.map
1652
+ //# sourceMappingURL=Subagent-VHrANXFy.d.mts.map
@@ -9,7 +9,7 @@ import { BackgroundSpawnTool, DelegationTool, SubagentBudgetReservation, Subagen
9
9
  import { RunUsageReport, unknownRunTotals } from "./core/Usage.mjs";
10
10
  import { C as MessageStatus, S as MessageRef, _ as WorkerStop, c as WorkerError, d as WorkerPage, f as WorkerRef, g as WorkerStarted, o as WorkerCompletion, p as WorkerReport, s as WorkerContext, v as WorkerStopped, y as WorkerSummary } from "./Worker-CfwzMZEK.mjs";
11
11
  import { BackgroundReporting, SubagentHost, WorkerReportPreparationFailure } from "./engine/SubagentHost.mjs";
12
- import { a as SubagentDurability, i as AgentSpawner, o as SubagentDurabilityError, s as ToolCallWaiting } from "./AgentRuntime-xeCUXutN.mjs";
12
+ import { a as SubagentDurability, i as AgentSpawner, o as SubagentDurabilityError, s as ToolCallWaiting } from "./AgentRuntime-D8U9gl9Q.mjs";
13
13
  import { RunEventSink } from "./engine/RunEventSink.mjs";
14
14
  import { SubagentBudgetExhausted, SubagentObservedUsage, SubagentReservationRequest, SubagentReservations, makeBudgetReservationId } from "./capabilities/SubagentReservations.mjs";
15
15
  import { t as utf8Bytes } from "./utf8-BYfhEkcj.mjs";
@@ -1499,4 +1499,4 @@ function background(targetOrDeclaration, selected) {
1499
1499
  //#endregion
1500
1500
  export { delegationCapsFromPolicy as S, stop as _, define as a, SubagentProjectionFailure as b, Worker as c, cancel as d, followUp as f, start as g, observe as h, background as i, WorkerObservation as l, list as m, SubagentResult as n, layer as o, inspect as p, Subagent_exports as r, make as s, SubagentDurableAccounting as t, awaitWorker as u, SubagentPolicy as v, delegationAllocationFromPolicy as x, SubagentPrestartDenied as y };
1501
1501
 
1502
- //# sourceMappingURL=Subagent-8RzJkqJ9.mjs.map
1502
+ //# sourceMappingURL=Subagent-hG9lJ7tJ.mjs.map