effect-durable-agent 0.1.0-alpha.1 → 0.1.0-alpha.11
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/README.md +140 -136
- package/dist/{command-queues-CQ9cwRP7.d.ts → command-queues-B45Xa1Dl.d.ts} +109 -21
- package/dist/{commands-Ce1ec6kH.d.ts → commands-p8venTWs.d.ts} +10 -2
- package/dist/compaction-0k8zCJgB.js +473 -0
- package/dist/compaction-0k8zCJgB.js.map +1 -0
- package/dist/{compaction-YayFKo_1.d.ts → compaction-DoTyQf6k.d.ts} +28 -7
- package/dist/context-projection-CCoN8m9W.d.ts +140 -0
- package/dist/{core-Hv3cFydL.d.ts → core-C-6xHzRx.d.ts} +6 -3
- package/dist/domain/command-queues.d.ts +1 -1
- package/dist/domain/command-queues.js +1 -1
- package/dist/domain/command-queues.js.map +1 -1
- package/dist/domain/context-projection.d.ts +2 -0
- package/dist/domain/context-projection.js +32 -0
- package/dist/domain/context-projection.js.map +1 -0
- package/dist/domain/message-transcript.d.ts +1 -1
- package/dist/domain/model-usage.d.ts +2 -0
- package/dist/domain/model-usage.js +59 -0
- package/dist/domain/model-usage.js.map +1 -0
- package/dist/domain/reduced-state-schema.d.ts +14 -18
- package/dist/domain/reduced-state-schema.js +7 -11
- package/dist/domain/reduced-state-schema.js.map +1 -1
- package/dist/domain/reduced-state.d.ts +3 -2
- package/dist/domain/reduced-state.js +3 -2
- package/dist/domain/run-scheduling.d.ts +2 -0
- package/dist/domain/run-scheduling.js +127 -0
- package/dist/domain/run-scheduling.js.map +1 -0
- package/dist/{durable-C3Rz7kg3.js → durable-BPHVFVvV.js} +74 -83
- package/dist/durable-BPHVFVvV.js.map +1 -0
- package/dist/{durable-DlScwmCy.d.ts → durable-DeLCAvbw.d.ts} +1256 -104
- package/dist/envelope-DkZyMIgp.d.ts +191 -0
- package/dist/envelope-DxQzo5rN.js +82 -0
- package/dist/envelope-DxQzo5rN.js.map +1 -0
- package/dist/{keep-alive-DYDsH6qN.d.ts → event-factory-EL4szNWm.d.ts} +10 -30
- package/dist/{keep-alive-p8dIcSVy.js → event-factory-QuC_UvyP.js} +8 -10
- package/dist/event-factory-QuC_UvyP.js.map +1 -0
- package/dist/{events-Bb9-Cu-7.d.ts → events-LZFNoESe.d.ts} +2 -188
- package/dist/{id-generator-C2Q15uZM.d.ts → id-generator--x6itQZ2.d.ts} +3 -2
- package/dist/index.d.ts +7 -6
- package/dist/index.js +5 -4
- package/dist/keep-alive-Chl5SJxy.d.ts +29 -0
- package/dist/{message-transcript-BCHdHAe2.d.ts → message-transcript-Dr6Rk-re.d.ts} +4 -4
- package/dist/model-resolver-BPPJAsuh.d.ts +18 -0
- package/dist/model-usage-CdBEkTwU.d.ts +55 -0
- package/dist/{prompt-projector-9_02lk5-.d.ts → prompt-projector-BpRH-Ec-.d.ts} +15 -16
- package/dist/{reduced-state-C4nVVzz9.js → reduced-state-Bz68V2H8.js} +65 -32
- package/dist/reduced-state-Bz68V2H8.js.map +1 -0
- package/dist/{reducer-registry-C0svUa63.d.ts → reducer-registry-DjP1qqbs.d.ts} +16 -6
- package/dist/run-scheduler-DvHWwWBJ.d.ts +43 -0
- package/dist/run-scheduling-wakeup-CGgJ7RNe.d.ts +25 -0
- package/dist/{runtime-C56FQxiL.d.ts → runtime-BFsU92E7.d.ts} +15 -6
- package/dist/services/compaction.d.ts +1 -1
- package/dist/services/compaction.js +1 -425
- package/dist/services/id-generator.d.ts +1 -1
- package/dist/services/id-generator.js +2 -1
- package/dist/services/id-generator.js.map +1 -1
- package/dist/services/keep-alive.d.ts +2 -0
- package/dist/services/keep-alive.js +13 -0
- package/dist/services/keep-alive.js.map +1 -0
- package/dist/services/model-resolver.d.ts +2 -0
- package/dist/services/model-resolver.js +17 -0
- package/dist/services/model-resolver.js.map +1 -0
- package/dist/services/prompt-projector.d.ts +2 -2
- package/dist/services/prompt-projector.js +20 -10
- package/dist/services/prompt-projector.js.map +1 -1
- package/dist/services/reducer-registry.d.ts +2 -2
- package/dist/services/reducer-registry.js +7 -3
- package/dist/services/reducer-registry.js.map +1 -1
- package/dist/services/run-scheduler.d.ts +3 -0
- package/dist/services/run-scheduler.js +25 -0
- package/dist/services/run-scheduler.js.map +1 -0
- package/dist/services/run-scheduling-wakeup.d.ts +2 -0
- package/dist/services/run-scheduling-wakeup.js +13 -0
- package/dist/services/run-scheduling-wakeup.js.map +1 -0
- package/dist/services/runtime-layer.d.ts +67 -0
- package/dist/services/runtime-layer.js +47 -0
- package/dist/services/runtime-layer.js.map +1 -0
- package/dist/services/runtime.d.ts +1 -1
- package/dist/services/runtime.js +21 -14
- package/dist/services/runtime.js.map +1 -1
- package/dist/services/session-event-observer.d.ts +2 -0
- package/dist/services/session-event-observer.js +13 -0
- package/dist/services/session-event-observer.js.map +1 -0
- package/dist/services/session-query.d.ts +2 -2
- package/dist/services/session-query.js +140 -1
- package/dist/services/session-query.js.map +1 -0
- package/dist/services/session-state.d.ts +2 -0
- package/dist/services/session-state.js +2 -0
- package/dist/services/session-store.d.ts +2 -2
- package/dist/services/session-store.js +182 -2
- package/dist/services/session-store.js.map +1 -0
- package/dist/services/sink-checkpoint-store.d.ts +2 -0
- package/dist/services/sink-checkpoint-store.js +49 -0
- package/dist/services/sink-checkpoint-store.js.map +1 -0
- package/dist/services/sink-registry.d.ts +1 -1
- package/dist/services/sink-registry.js +1 -1
- package/dist/services/span-names.d.ts +1 -1
- package/dist/services/span-names.js +3 -0
- package/dist/services/span-names.js.map +1 -1
- package/dist/services/tool-registry.d.ts +1 -1
- package/dist/services/tracing.d.ts +1 -1
- package/dist/services/tracing.js +23 -2
- package/dist/services/tracing.js.map +1 -1
- package/dist/session-event-observer-DaFMKKNc.d.ts +24 -0
- package/dist/session-query-Bo_wroPS.d.ts +47 -0
- package/dist/{session-query-DlRo5Ufc.d.ts → session-state-5uD0FqQ8.d.ts} +143 -45
- package/dist/{session-query-DOc1KanA.js → session-state-CN7DcLal.js} +353 -186
- package/dist/session-state-CN7DcLal.js.map +1 -0
- package/dist/{session-store-D2Ore1QC.d.ts → session-store-BIr-xfJ7.d.ts} +7 -96
- package/dist/sink-checkpoint-store-Cr9_GmOw.d.ts +40 -0
- package/dist/{sink-registry-CFC6xjsN.js → sink-registry-6CNeeRTt.js} +41 -82
- package/dist/sink-registry-6CNeeRTt.js.map +1 -0
- package/dist/{sink-registry-CIU0LD3m.d.ts → sink-registry-Bz4bBJaC.d.ts} +24 -49
- package/dist/testkit/layers.d.ts +24 -14
- package/dist/testkit/layers.js +18 -11
- package/dist/testkit/layers.js.map +1 -1
- package/dist/{tool-registry-CcnkAAQK.d.ts → tool-registry-Dhs2KmYK.d.ts} +4 -4
- package/dist/types/commands.d.ts +2 -2
- package/dist/types/commands.js +7 -2
- package/dist/types/commands.js.map +1 -1
- package/dist/types/core.d.ts +2 -2
- package/dist/types/core.js +4 -2
- package/dist/types/core.js.map +1 -1
- package/dist/types/events/durable.d.ts +2 -2
- package/dist/types/events/durable.js +2 -2
- package/dist/types/events.d.ts +4 -3
- package/dist/types/events.js +3 -2
- package/dist/types/events.js.map +1 -1
- package/dist/websocket.d.ts +2776 -0
- package/dist/websocket.js +498 -0
- package/dist/websocket.js.map +1 -0
- package/package.json +68 -43
- package/testing/offline-trace/README.md +2 -1
- package/CHANGELOG.md +0 -10
- package/CONTRIBUTING.md +0 -26
- package/SECURITY.md +0 -8
- package/dist/durable-C3Rz7kg3.js.map +0 -1
- package/dist/durable-object-runtime-B7jwBY2R.js +0 -1494
- package/dist/durable-object-runtime-B7jwBY2R.js.map +0 -1
- package/dist/durable-object-runtime-pWv0ohlz.d.ts +0 -257
- package/dist/durable-object-storage-Czy7IPrh.d.ts +0 -41
- package/dist/host/durable-object-runtime.d.ts +0 -2
- package/dist/host/durable-object-runtime.js +0 -2
- package/dist/host/durable-object-storage.d.ts +0 -2
- package/dist/host/durable-object-storage.js +0 -0
- package/dist/host/durable-object.d.ts +0 -83
- package/dist/host/durable-object.js +0 -191
- package/dist/host/durable-object.js.map +0 -1
- package/dist/host/websocket-wire.d.ts +0 -2
- package/dist/host/websocket-wire.js +0 -88
- package/dist/host/websocket-wire.js.map +0 -1
- package/dist/keep-alive-p8dIcSVy.js.map +0 -1
- package/dist/reduced-state-C4nVVzz9.js.map +0 -1
- package/dist/services/compaction.js.map +0 -1
- package/dist/session-query-DOc1KanA.js.map +0 -1
- package/dist/session-store-pYxQW9qh.js +0 -214
- package/dist/session-store-pYxQW9qh.js.map +0 -1
- package/dist/sink-registry-CFC6xjsN.js.map +0 -1
- package/dist/websocket-wire-DvOu_6BJ.d.ts +0 -16773
- package/docs/assets/architecture.svg +0 -106
- package/docs/assets/event-sequence.svg +0 -143
- package/docs/assets/gcp-trace.png +0 -0
- package/docs/message-steering.md +0 -831
- package/docs/releasing.md +0 -57
- package/docs/spec.md +0 -774
- package/docs/subagents.md +0 -725
- package/docs/testing.md +0 -64
- package/docs/ui-projection.md +0 -742
- package/docs/websocket-protocol.md +0 -613
- package/examples/001-no-tools/README.md +0 -65
- package/examples/001-no-tools/worker.ts +0 -79
- package/examples/002-slack-bridge/README.md +0 -134
- package/examples/002-slack-bridge/events.ts +0 -115
- package/examples/002-slack-bridge/reducer.ts +0 -216
- package/examples/002-slack-bridge/scenario.test.ts +0 -223
- package/examples/002-slack-bridge/sinks.ts +0 -109
- package/examples/002-slack-bridge/worker.ts +0 -140
- package/examples/003-sandbox-lifecycle/README.md +0 -78
- package/examples/003-sandbox-lifecycle/events.ts +0 -203
- package/examples/003-sandbox-lifecycle/reducer.ts +0 -305
- package/examples/003-sandbox-lifecycle/scenario.test.ts +0 -202
- package/examples/_shared/event-id.ts +0 -12
- package/examples/_shared/http.ts +0 -27
- package/examples/_shared/openai.ts +0 -33
|
@@ -1,426 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { cr as FailurePayload } from "../durable-C3Rz7kg3.js";
|
|
3
|
-
import { d as CompactionSummaryArtifact, l as CompactionExecutorId, u as CompactionPolicyId } from "../session-store-pYxQW9qh.js";
|
|
4
|
-
import { durableMessageTranscript } from "../domain/message-transcript.js";
|
|
5
|
-
import { IdGenerator } from "./id-generator.js";
|
|
6
|
-
import { n as EventFactory, t as EDAKeepAlive } from "../keep-alive-p8dIcSVy.js";
|
|
7
|
-
import { annotateEdaSpan, committedBatchAttributes } from "./tracing.js";
|
|
8
|
-
import * as Context from "effect/Context";
|
|
9
|
-
import * as Effect from "effect/Effect";
|
|
10
|
-
import * as Layer from "effect/Layer";
|
|
11
|
-
import * as Schema from "effect/Schema";
|
|
12
|
-
import * as Prompt from "effect/unstable/ai/Prompt";
|
|
13
|
-
import * as LanguageModel from "effect/unstable/ai/LanguageModel";
|
|
14
|
-
//#region src/services/compaction.ts
|
|
15
|
-
/** Candidate durable range and retained cursor selected by compaction policy. */
|
|
16
|
-
const CompactionPlan = Schema.Struct({
|
|
17
|
-
policyId: CompactionPolicyId,
|
|
18
|
-
sourceFromSeq: SequenceNumber,
|
|
19
|
-
sourceToSeq: SequenceNumber,
|
|
20
|
-
retainedFromContextSeq: SequenceNumber
|
|
21
|
-
});
|
|
22
|
-
/** Rough token heuristic used by the built-in compaction presets. */
|
|
23
|
-
const defaultCompactionCharsPerToken = 4;
|
|
24
|
-
/** Production-oriented context threshold for the built-in approximate-token policy. */
|
|
25
|
-
const defaultCompactionThresholdTokens = 22e4;
|
|
26
|
-
/** Recent model-facing tail retained verbatim by the built-in approximate-token policy. */
|
|
27
|
-
const defaultCompactionRetainTailTokens = 4e4;
|
|
28
|
-
/** Minimum newly summarizable prefix needed before the approximate-token policy plans work. */
|
|
29
|
-
const defaultCompactionMinSummarizableTokens = 1e4;
|
|
30
|
-
/** Result produced by the summary executor before the framework commits it. */
|
|
31
|
-
const CompactionOutput = Schema.Struct({
|
|
32
|
-
text: Schema.NonEmptyString,
|
|
33
|
-
promptMessage: Prompt.UserMessage,
|
|
34
|
-
executorId: Schema.optionalKey(CompactionExecutorId)
|
|
35
|
-
});
|
|
36
|
-
/** Typed failure from policy planning or summary generation. */
|
|
37
|
-
var CompactionError = class extends Schema.TaggedErrorClass()("CompactionError", { message: Schema.String }) {};
|
|
38
|
-
/** Decides whether a safe prompt-context rebase should be attempted. */
|
|
39
|
-
var CompactionPolicy = class CompactionPolicy extends Context.Service()("@effect-durable-agent/CompactionPolicy") {
|
|
40
|
-
/** Default policy: compaction is disabled and commits no skip events. */
|
|
41
|
-
static Disabled = Layer.succeed(CompactionPolicy, {
|
|
42
|
-
id: CompactionPolicyId.make("disabled"),
|
|
43
|
-
plan: () => Effect.succeed(void 0)
|
|
44
|
-
});
|
|
45
|
-
/** Test/app hook for replacing the policy with a concrete planner. */
|
|
46
|
-
static FromFunction = (id, plan) => Layer.succeed(CompactionPolicy, {
|
|
47
|
-
id: CompactionPolicyId.make(id),
|
|
48
|
-
plan
|
|
49
|
-
});
|
|
50
|
-
/**
|
|
51
|
-
* Common production policy: compact when approximate prompt context exceeds a token threshold.
|
|
52
|
-
*
|
|
53
|
-
* The policy keeps a recent tail verbatim, summarizes the older prefix, and advances from the
|
|
54
|
-
* current summary cursor so repeated compactions behave like the first one.
|
|
55
|
-
*/
|
|
56
|
-
static ApproximateTokenThreshold = (options = {}) => {
|
|
57
|
-
const normalized = normalizeApproximateTokenPolicyOptions(options);
|
|
58
|
-
return Layer.succeed(CompactionPolicy, {
|
|
59
|
-
id: normalized.policyId,
|
|
60
|
-
plan: ({ state, context }) => Effect.sync(() => planApproximateTokenCompaction(state, context, normalized))
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
/** Produces a cumulative summary artifact for a selected compaction plan. */
|
|
65
|
-
var CompactionExecutor = class CompactionExecutor extends Context.Service()("@effect-durable-agent/CompactionExecutor") {
|
|
66
|
-
/** Placeholder executor for the disabled default policy. It should never be called. */
|
|
67
|
-
static Disabled = Layer.succeed(CompactionExecutor, {
|
|
68
|
-
id: CompactionExecutorId.make("disabled"),
|
|
69
|
-
execute: () => Effect.die(/* @__PURE__ */ new Error("CompactionExecutor.Disabled was called"))
|
|
70
|
-
});
|
|
71
|
-
/** Test/app hook for replacing summary generation. */
|
|
72
|
-
static FromFunction = (id, execute) => Layer.succeed(CompactionExecutor, {
|
|
73
|
-
id: CompactionExecutorId.make(id),
|
|
74
|
-
execute
|
|
75
|
-
});
|
|
76
|
-
/** Summary executor backed by the configured Effect AI LanguageModel. */
|
|
77
|
-
static LanguageModelSummary = (options = {}) => Layer.effect(CompactionExecutor, Effect.gen(function* () {
|
|
78
|
-
const languageModel = yield* LanguageModel.LanguageModel;
|
|
79
|
-
const executorId = CompactionExecutorId.make(options.executorId ?? "language-model-summary");
|
|
80
|
-
const summaryMessagePrefix = options.summaryMessagePrefix ?? "Conversation summary:";
|
|
81
|
-
return {
|
|
82
|
-
id: executorId,
|
|
83
|
-
execute: Effect.fn("agent.compaction")(function* (input) {
|
|
84
|
-
yield* annotateEdaSpan({
|
|
85
|
-
"eda.compaction.policy_id": input.plan.policyId,
|
|
86
|
-
"eda.compaction.source_from_seq": input.plan.sourceFromSeq,
|
|
87
|
-
"eda.compaction.source_to_seq": input.plan.sourceToSeq,
|
|
88
|
-
"eda.compaction.retained_from_context_seq": input.plan.retainedFromContextSeq,
|
|
89
|
-
"eda.compaction.executor_id": executorId
|
|
90
|
-
});
|
|
91
|
-
const promptText = buildSummaryPrompt(input);
|
|
92
|
-
if (promptText === void 0) return yield* new CompactionError({ message: "compaction plan selected no source messages" });
|
|
93
|
-
const text = (yield* languageModel.generateText({
|
|
94
|
-
prompt: Prompt.fromMessages([Prompt.makeMessage("system", { content: summarizationSystemPrompt }), Prompt.makeMessage("user", { content: [Prompt.textPart({ text: promptText })] })]),
|
|
95
|
-
toolChoice: "none"
|
|
96
|
-
}).pipe(Effect.mapError((error) => new CompactionError({ message: `summary model failed: ${formatUnknownError(error)}` })))).text.trim();
|
|
97
|
-
if (text.length === 0) return yield* new CompactionError({ message: "summary model returned no text" });
|
|
98
|
-
return CompactionOutput.make({
|
|
99
|
-
text,
|
|
100
|
-
promptMessage: Prompt.makeMessage("user", { content: [Prompt.textPart({ text: `${summaryMessagePrefix}\n\n${text}` })] }),
|
|
101
|
-
executorId
|
|
102
|
-
});
|
|
103
|
-
})
|
|
104
|
-
};
|
|
105
|
-
}));
|
|
106
|
-
};
|
|
107
|
-
/** Framework-owned compaction lifecycle runner. */
|
|
108
|
-
var CompactionRunner = class CompactionRunner extends Context.Service()("@effect-durable-agent/CompactionRunner") {
|
|
109
|
-
static Live = Layer.effect(CompactionRunner, Effect.suspend(() => makeLiveCompactionRunner));
|
|
110
|
-
};
|
|
111
|
-
const makeLiveCompactionRunner = Effect.gen(function* () {
|
|
112
|
-
const ids = yield* IdGenerator;
|
|
113
|
-
const events = yield* EventFactory;
|
|
114
|
-
const policy = yield* CompactionPolicy;
|
|
115
|
-
const executor = yield* CompactionExecutor;
|
|
116
|
-
const keepAlive = yield* EDAKeepAlive;
|
|
117
|
-
return { maybeCompact: Effect.fnUntraced(function* (input) {
|
|
118
|
-
const plan = yield* policy.plan({
|
|
119
|
-
state: input.state,
|
|
120
|
-
context: input.context
|
|
121
|
-
}).pipe(Effect.catchTag("CompactionError", (error) => Effect.logError("compaction policy failed", { error }).pipe(Effect.as(void 0))));
|
|
122
|
-
if (plan === void 0) {
|
|
123
|
-
yield* annotateEdaSpan({ "eda.compaction.selected": false });
|
|
124
|
-
return [];
|
|
125
|
-
}
|
|
126
|
-
yield* annotateEdaSpan({
|
|
127
|
-
"eda.compaction.selected": true,
|
|
128
|
-
"eda.compaction.policy_id": plan.policyId,
|
|
129
|
-
"eda.compaction.source_from_seq": plan.sourceFromSeq,
|
|
130
|
-
"eda.compaction.source_to_seq": plan.sourceToSeq,
|
|
131
|
-
"eda.compaction.retained_from_context_seq": plan.retainedFromContextSeq
|
|
132
|
-
});
|
|
133
|
-
const invalidPlan = validatePlan(plan, input.state, input.context);
|
|
134
|
-
if (invalidPlan !== void 0) {
|
|
135
|
-
yield* Effect.logError("compaction policy returned invalid plan", { reason: invalidPlan });
|
|
136
|
-
return [];
|
|
137
|
-
}
|
|
138
|
-
const compactionId = yield* ids.makeCompactionId();
|
|
139
|
-
const summaryId = yield* ids.makeSummaryId();
|
|
140
|
-
yield* annotateEdaSpan({
|
|
141
|
-
"eda.compaction.id": compactionId,
|
|
142
|
-
"eda.summary.id": summaryId
|
|
143
|
-
});
|
|
144
|
-
const requested = yield* events.compactionRequested({
|
|
145
|
-
compactionId,
|
|
146
|
-
sourceFromSeq: plan.sourceFromSeq,
|
|
147
|
-
sourceToSeq: plan.sourceToSeq
|
|
148
|
-
});
|
|
149
|
-
const started = yield* events.compactionStarted({ compactionId });
|
|
150
|
-
const startedEvents = yield* input.appendDurableEntries([{ event: requested }, { event: started }]);
|
|
151
|
-
const output = yield* keepAlive.withActiveWork(`compaction:${compactionId}`, executor.execute({
|
|
152
|
-
plan,
|
|
153
|
-
state: input.state,
|
|
154
|
-
context: input.context
|
|
155
|
-
})).pipe(Effect.catchTag("CompactionError", (error) => Effect.gen(function* () {
|
|
156
|
-
const failed = yield* events.compactionFailed({
|
|
157
|
-
compactionId,
|
|
158
|
-
error: FailurePayload.make({ message: error.message })
|
|
159
|
-
});
|
|
160
|
-
return {
|
|
161
|
-
_tag: "Failed",
|
|
162
|
-
committed: yield* input.appendDurableEntries([{ event: failed }])
|
|
163
|
-
};
|
|
164
|
-
})), Effect.map((result) => "_tag" in result ? result : {
|
|
165
|
-
_tag: "Output",
|
|
166
|
-
output: result
|
|
167
|
-
}));
|
|
168
|
-
if (output._tag === "Failed") return [...startedEvents, ...output.committed];
|
|
169
|
-
const artifact = CompactionSummaryArtifact.make({
|
|
170
|
-
compactionId,
|
|
171
|
-
summaryId,
|
|
172
|
-
...input.context.currentSummary === void 0 ? {} : { previousSummaryId: input.context.currentSummary.summaryId },
|
|
173
|
-
sourceFromSeq: plan.sourceFromSeq,
|
|
174
|
-
sourceToSeq: plan.sourceToSeq,
|
|
175
|
-
retainedFromContextSeq: plan.retainedFromContextSeq,
|
|
176
|
-
text: output.output.text,
|
|
177
|
-
promptMessage: output.output.promptMessage,
|
|
178
|
-
policyId: plan.policyId,
|
|
179
|
-
...output.output.executorId === void 0 ? {} : { executorId: output.output.executorId }
|
|
180
|
-
});
|
|
181
|
-
const summaryCreated = yield* events.summaryCreated({
|
|
182
|
-
compactionId,
|
|
183
|
-
summaryId,
|
|
184
|
-
sourceFromSeq: plan.sourceFromSeq,
|
|
185
|
-
sourceToSeq: plan.sourceToSeq,
|
|
186
|
-
summary: artifact
|
|
187
|
-
});
|
|
188
|
-
const contextRebased = yield* events.contextRebased({
|
|
189
|
-
compactionId,
|
|
190
|
-
summaryId,
|
|
191
|
-
contextVersion: ContextVersion.make(input.context.contextVersion + 1),
|
|
192
|
-
retainedFromContextSeq: plan.retainedFromContextSeq
|
|
193
|
-
});
|
|
194
|
-
const completed = yield* events.compactionCompleted({ compactionId });
|
|
195
|
-
const committed = yield* input.appendDurableEntries([
|
|
196
|
-
{ event: summaryCreated },
|
|
197
|
-
{ event: contextRebased },
|
|
198
|
-
{ event: completed }
|
|
199
|
-
]);
|
|
200
|
-
yield* annotateEdaSpan(committedBatchAttributes([...startedEvents, ...committed]));
|
|
201
|
-
return [...startedEvents, ...committed];
|
|
202
|
-
}) };
|
|
203
|
-
});
|
|
204
|
-
const validatePlan = (plan, state, context) => {
|
|
205
|
-
const currentRetainedFromSeq = context.currentSummary?.retainedFromContextSeq ?? SequenceNumber.make(0);
|
|
206
|
-
if (plan.retainedFromContextSeq <= currentRetainedFromSeq) return "retainedFromContextSeq must advance beyond the current summary cursor";
|
|
207
|
-
if (plan.sourceToSeq > state.lastSeq) return "sourceToSeq must not exceed the current durable head";
|
|
208
|
-
if (plan.retainedFromContextSeq > state.lastSeq + 1) return "retainedFromContextSeq must not skip unsummarized future context";
|
|
209
|
-
if (plan.sourceFromSeq > plan.sourceToSeq) return "sourceFromSeq must be less than or equal to sourceToSeq";
|
|
210
|
-
if (plan.retainedFromContextSeq <= plan.sourceToSeq) return "retainedFromContextSeq must start after the summarized source range";
|
|
211
|
-
};
|
|
212
|
-
const normalizeApproximateTokenPolicyOptions = (options) => ({
|
|
213
|
-
policyId: CompactionPolicyId.make(options.policyId ?? "approximate-token-threshold"),
|
|
214
|
-
thresholdTokens: positiveNumber(options.thresholdTokens ?? 22e4, "thresholdTokens"),
|
|
215
|
-
retainTailTokens: nonNegativeNumber(options.retainTailTokens ?? 4e4, "retainTailTokens"),
|
|
216
|
-
minSummarizableTokens: nonNegativeNumber(options.minSummarizableTokens ?? 1e4, "minSummarizableTokens"),
|
|
217
|
-
charsPerToken: positiveNumber(options.charsPerToken ?? 4, "charsPerToken")
|
|
218
|
-
});
|
|
219
|
-
const positiveNumber = (value, name) => {
|
|
220
|
-
if (!Number.isFinite(value) || value <= 0) throw new Error(`${name} must be a positive finite number`);
|
|
221
|
-
return value;
|
|
222
|
-
};
|
|
223
|
-
const nonNegativeNumber = (value, name) => {
|
|
224
|
-
if (!Number.isFinite(value) || value < 0) throw new Error(`${name} must be a non-negative finite number`);
|
|
225
|
-
return value;
|
|
226
|
-
};
|
|
227
|
-
/** Plan one Pi-style approximate-token compaction while keeping a recent tail verbatim. */
|
|
228
|
-
const planApproximateTokenCompaction = (state, context, options) => {
|
|
229
|
-
const messages = estimatedContextMessages(state);
|
|
230
|
-
if (estimateCurrentPromptChars(state, context, messages) <= options.thresholdTokens * options.charsPerToken) return;
|
|
231
|
-
const currentRetainedFromSeq = context.currentSummary?.retainedFromContextSeq ?? SequenceNumber.make(0);
|
|
232
|
-
const retainedFromSeq = selectRetainedFromSeq(messages, state.lastSeq, options);
|
|
233
|
-
if (retainedFromSeq <= currentRetainedFromSeq) return;
|
|
234
|
-
const sourceMessages = messages.filter((message) => message.seq < retainedFromSeq);
|
|
235
|
-
if (sourceMessages.length === 0) return;
|
|
236
|
-
if (charsToTokens(sourceMessages.reduce((sum, message) => sum + message.chars, 0), options.charsPerToken) < options.minSummarizableTokens) return;
|
|
237
|
-
const sourceFromSeq = currentRetainedFromSeq > 0 ? currentRetainedFromSeq : sourceMessages[0].seq;
|
|
238
|
-
const sourceToSeq = SequenceNumber.make(retainedFromSeq - 1);
|
|
239
|
-
if (sourceFromSeq > sourceToSeq) return;
|
|
240
|
-
return CompactionPlan.make({
|
|
241
|
-
policyId: options.policyId,
|
|
242
|
-
sourceFromSeq,
|
|
243
|
-
sourceToSeq,
|
|
244
|
-
retainedFromContextSeq: retainedFromSeq
|
|
245
|
-
});
|
|
246
|
-
};
|
|
247
|
-
const selectRetainedFromSeq = (messages, lastSeq, options) => {
|
|
248
|
-
if (options.retainTailTokens === 0) return SequenceNumber.make(lastSeq + 1);
|
|
249
|
-
const retainTailChars = options.retainTailTokens * options.charsPerToken;
|
|
250
|
-
let tailChars = 0;
|
|
251
|
-
let retainedIndex = messages.length;
|
|
252
|
-
for (let index = messages.length - 1; index >= 0; index--) {
|
|
253
|
-
tailChars += messages[index].chars;
|
|
254
|
-
retainedIndex = index;
|
|
255
|
-
if (tailChars >= retainTailChars) break;
|
|
256
|
-
}
|
|
257
|
-
return retainedIndex >= messages.length ? SequenceNumber.make(lastSeq + 1) : messages[retainedIndex].seq;
|
|
258
|
-
};
|
|
259
|
-
const estimateCurrentPromptChars = (state, context, messages) => {
|
|
260
|
-
const systemChars = Array.from(state.messages.values()).reduce((sum, message) => message._tag === "System" ? sum + message.content.length : sum, 0);
|
|
261
|
-
const summaryChars = context.currentSummary === void 0 ? 0 : estimatePromptMessageChars(context.currentSummary.promptMessage);
|
|
262
|
-
const messageChars = messages.reduce((sum, message) => sum + message.chars, 0);
|
|
263
|
-
return systemChars + summaryChars + messageChars;
|
|
264
|
-
};
|
|
265
|
-
const estimatedContextMessages = (state) => durableMessageTranscript(state).map((message) => ({
|
|
266
|
-
message,
|
|
267
|
-
seq: messageSeq(message),
|
|
268
|
-
chars: estimateDurableMessageChars(message) + estimateAssociatedToolChars(message, state)
|
|
269
|
-
}));
|
|
270
|
-
const estimateDurableMessageChars = (message) => {
|
|
271
|
-
switch (message._tag) {
|
|
272
|
-
case "User":
|
|
273
|
-
case "Steering": return estimateUserContentChars(message.content);
|
|
274
|
-
case "Assistant":
|
|
275
|
-
case "AssistantPartial": return estimateAssistantPromptChars(message.promptParts, message.content);
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
const estimateAssociatedToolChars = (message, state) => {
|
|
279
|
-
if (message._tag !== "Assistant" && message._tag !== "AssistantPartial") return 0;
|
|
280
|
-
return toolPromptPartsForInference(message.inferenceId, state.toolCalls).reduce((sum, part) => sum + estimatePromptPartChars(part), 0);
|
|
281
|
-
};
|
|
282
|
-
const messageSeq = (message) => message._tag === "Steering" ? message.consumedSeq : message.seq;
|
|
283
|
-
const charsToTokens = (chars, charsPerToken) => Math.ceil(chars / charsPerToken);
|
|
284
|
-
const buildSummaryPrompt = (input) => {
|
|
285
|
-
const sourceText = serializeCompactionSource(input);
|
|
286
|
-
if (sourceText.trim().length === 0) return;
|
|
287
|
-
return `${input.context.currentSummary === void 0 ? "" : `<previous-summary>\n${input.context.currentSummary.text}\n</previous-summary>\n\n`}<conversation>\n${sourceText}\n</conversation>\n\n${summaryPromptText}`;
|
|
288
|
-
};
|
|
289
|
-
const serializeCompactionSource = (input) => {
|
|
290
|
-
const lines = [];
|
|
291
|
-
for (const message of durableMessageTranscript(input.state)) {
|
|
292
|
-
const seq = messageSeq(message);
|
|
293
|
-
if (seq < input.plan.sourceFromSeq || seq > input.plan.sourceToSeq) continue;
|
|
294
|
-
lines.push(serializeDurableMessage(message));
|
|
295
|
-
if (message._tag === "Assistant" || message._tag === "AssistantPartial") for (const part of toolPromptPartsForInference(message.inferenceId, input.state.toolCalls)) lines.push(serializeToolResultPart(part));
|
|
296
|
-
}
|
|
297
|
-
return lines.filter((line) => line.trim().length > 0).join("\n\n");
|
|
298
|
-
};
|
|
299
|
-
const serializeDurableMessage = (message) => {
|
|
300
|
-
switch (message._tag) {
|
|
301
|
-
case "User": return `[User]: ${userContentText(message.content)}`;
|
|
302
|
-
case "Steering": return `[User steering]: ${userContentText(message.content)}`;
|
|
303
|
-
case "Assistant":
|
|
304
|
-
case "AssistantPartial": return serializeAssistantMessage(message.promptParts, message.content);
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
const serializeAssistantMessage = (promptParts, content) => {
|
|
308
|
-
const parts = promptParts ?? assistantContentToPromptParts(content);
|
|
309
|
-
const text = [];
|
|
310
|
-
const reasoning = [];
|
|
311
|
-
const toolCalls = [];
|
|
312
|
-
const sideband = [];
|
|
313
|
-
for (const part of parts) switch (part.type) {
|
|
314
|
-
case "text":
|
|
315
|
-
text.push(part.text);
|
|
316
|
-
break;
|
|
317
|
-
case "reasoning":
|
|
318
|
-
reasoning.push(part.text);
|
|
319
|
-
break;
|
|
320
|
-
case "tool-call":
|
|
321
|
-
toolCalls.push(`${part.name}(${safeJsonStringify(part.params)})`);
|
|
322
|
-
break;
|
|
323
|
-
case "file":
|
|
324
|
-
sideband.push(`file(${part.fileName ?? "unnamed"}, ${part.mediaType})`);
|
|
325
|
-
break;
|
|
326
|
-
case "tool-result":
|
|
327
|
-
sideband.push(`tool-result(${part.name}, ${truncateForSummary(safeJsonStringify(part.result))})`);
|
|
328
|
-
break;
|
|
329
|
-
case "tool-approval-request":
|
|
330
|
-
sideband.push(`tool-approval-request(${part.approvalId}, ${part.toolCallId})`);
|
|
331
|
-
break;
|
|
332
|
-
}
|
|
333
|
-
return [
|
|
334
|
-
reasoning.length === 0 ? "" : `[Assistant reasoning]: ${reasoning.join("\n")}`,
|
|
335
|
-
text.length === 0 ? "" : `[Assistant]: ${text.join("\n")}`,
|
|
336
|
-
toolCalls.length === 0 ? "" : `[Assistant tool calls]: ${toolCalls.join("; ")}`,
|
|
337
|
-
sideband.length === 0 ? "" : `[Assistant context]: ${sideband.join("; ")}`
|
|
338
|
-
].filter((line) => line.length > 0).join("\n");
|
|
339
|
-
};
|
|
340
|
-
const serializeToolResultPart = (part) => `[Tool result ${part.name}${part.isFailure ? " failed" : ""}]: ${truncateForSummary(safeJsonStringify(part.result))}`;
|
|
341
|
-
const toolPromptPartsForInference = (inferenceId, toolCalls) => Array.from(toolCalls.values()).flatMap((tool) => {
|
|
342
|
-
const { decision } = tool;
|
|
343
|
-
if (decision === void 0 || decision.inferenceId !== inferenceId) return [];
|
|
344
|
-
if (decision._tag === "Rejected") return decision.promptPart === void 0 ? [] : [decision.promptPart];
|
|
345
|
-
const terminal = tool.terminal;
|
|
346
|
-
if (terminal === void 0 || terminal.promptPart === void 0) return [];
|
|
347
|
-
return [terminal.promptPart];
|
|
348
|
-
});
|
|
349
|
-
const assistantContentToPromptParts = (content) => [...content.reasoning === void 0 ? [] : [Prompt.reasoningPart({ text: content.reasoning })], ...content.text.length === 0 ? [] : [Prompt.textPart({ text: content.text })]];
|
|
350
|
-
const estimateAssistantPromptChars = (promptParts, content) => (promptParts ?? assistantContentToPromptParts(content)).reduce((sum, part) => sum + estimatePromptPartChars(part), 0);
|
|
351
|
-
const estimateUserContentChars = (content) => typeof content === "string" ? content.length : content.reduce((sum, part) => sum + estimatePromptPartChars(part), 0);
|
|
352
|
-
const estimatePromptMessageChars = (message) => {
|
|
353
|
-
if (!("content" in message)) return 0;
|
|
354
|
-
const { content } = message;
|
|
355
|
-
return typeof content === "string" ? content.length : content.reduce((sum, part) => sum + estimatePromptPartChars(part), 0);
|
|
356
|
-
};
|
|
357
|
-
const estimatePromptPartChars = (part) => {
|
|
358
|
-
switch (part.type) {
|
|
359
|
-
case "text": return part.text.length;
|
|
360
|
-
case "reasoning": return part.text.length;
|
|
361
|
-
case "file": return part.mediaType.length + (part.fileName?.length ?? 0) + (typeof part.data === "string" ? part.data.length : part.data instanceof URL ? part.data.toString().length : estimatedBinaryFileChars);
|
|
362
|
-
case "tool-call": return part.name.length + safeJsonStringify(part.params).length;
|
|
363
|
-
case "tool-result": return part.name.length + safeJsonStringify(part.result).length;
|
|
364
|
-
case "tool-approval-response": return part.approvalId.length + (part.reason?.length ?? 0) + 8;
|
|
365
|
-
case "tool-approval-request": return part.approvalId.length + part.toolCallId.length;
|
|
366
|
-
default: return safeJsonStringify(part).length;
|
|
367
|
-
}
|
|
368
|
-
};
|
|
369
|
-
const userContentText = (content) => typeof content === "string" ? content : content.map((part) => {
|
|
370
|
-
switch (part.type) {
|
|
371
|
-
case "text": return part.text;
|
|
372
|
-
case "file": return `[file ${part.fileName ?? "unnamed"} ${part.mediaType}]`;
|
|
373
|
-
}
|
|
374
|
-
}).join("\n");
|
|
375
|
-
const safeJsonStringify = (value) => {
|
|
376
|
-
try {
|
|
377
|
-
return JSON.stringify(value) ?? String(value);
|
|
378
|
-
} catch {
|
|
379
|
-
return String(value);
|
|
380
|
-
}
|
|
381
|
-
};
|
|
382
|
-
const truncateForSummary = (text, maxChars = 2e3) => {
|
|
383
|
-
if (text.length <= maxChars) return text;
|
|
384
|
-
return `${text.slice(0, maxChars)}\n\n[... ${text.length - maxChars} more characters truncated]`;
|
|
385
|
-
};
|
|
386
|
-
const formatUnknownError = (error) => error instanceof Error ? error.message : String(error);
|
|
387
|
-
const estimatedBinaryFileChars = 4800;
|
|
388
|
-
const summarizationSystemPrompt = "You are a context summarization assistant. Do not continue the conversation. Only output the requested structured summary.";
|
|
389
|
-
const summaryPromptText = `The messages above are conversation history selected for compaction. Create a cumulative context checkpoint summary that another LLM will use to continue the work.
|
|
390
|
-
|
|
391
|
-
Use this exact structure:
|
|
392
|
-
|
|
393
|
-
## Goal
|
|
394
|
-
[What the user is trying to accomplish]
|
|
395
|
-
|
|
396
|
-
## Constraints & Preferences
|
|
397
|
-
- [Requirements, constraints, and preferences]
|
|
398
|
-
|
|
399
|
-
## Progress
|
|
400
|
-
### Done
|
|
401
|
-
- [x] [Completed work]
|
|
402
|
-
|
|
403
|
-
### In Progress
|
|
404
|
-
- [ ] [Current unfinished work]
|
|
405
|
-
|
|
406
|
-
### Blocked
|
|
407
|
-
- [Current blockers, or "(none)"]
|
|
408
|
-
|
|
409
|
-
## Key Decisions
|
|
410
|
-
- **[Decision]**: [Rationale]
|
|
411
|
-
|
|
412
|
-
## Next Steps
|
|
413
|
-
1. [Concrete next step]
|
|
414
|
-
|
|
415
|
-
## Critical Context
|
|
416
|
-
- [Important facts, data, IDs, file paths, function names, and exact errors needed to continue]
|
|
417
|
-
|
|
418
|
-
Rules:
|
|
419
|
-
- If <previous-summary> is present, preserve important existing facts and update it with the new conversation.
|
|
420
|
-
- Keep the summary concise but sufficient to replace the compacted history.
|
|
421
|
-
- Preserve exact file paths, tool names, identifiers, and error messages.
|
|
422
|
-
- Do not answer questions from the conversation.`;
|
|
423
|
-
//#endregion
|
|
1
|
+
import { a as CompactionPolicy, c as defaultCompactionMinSummarizableTokens, i as CompactionPlan, l as defaultCompactionRetainTailTokens, n as CompactionExecutor, o as CompactionRunner, r as CompactionOutput, s as defaultCompactionCharsPerToken, t as CompactionError, u as defaultCompactionThresholdTokens } from "../compaction-0k8zCJgB.js";
|
|
424
2
|
export { CompactionError, CompactionExecutor, CompactionOutput, CompactionPlan, CompactionPolicy, CompactionRunner, defaultCompactionCharsPerToken, defaultCompactionMinSummarizableTokens, defaultCompactionRetainTailTokens, defaultCompactionThresholdTokens };
|
|
425
|
-
|
|
426
|
-
//# sourceMappingURL=compaction.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as IdGeneratorShape, r as sequentialUuidV7, t as IdGenerator } from "../id-generator
|
|
1
|
+
import { n as IdGeneratorShape, r as sequentialUuidV7, t as IdGenerator } from "../id-generator--x6itQZ2.js";
|
|
2
2
|
export { IdGenerator, IdGeneratorShape, sequentialUuidV7 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandId, CompactionId, CorrelationId, EventId, InferenceId, MessageId, RunId, SessionId, SummaryId, ToolCallId, TurnId } from "../types/core.js";
|
|
1
|
+
import { CommandId, CompactionId, CorrelationId, EventId, InferenceId, MessageId, RunId, RunRequestId, SessionId, SummaryId, ToolCallId, TurnId } from "../types/core.js";
|
|
2
2
|
import * as Context from "effect/Context";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
@@ -42,6 +42,7 @@ const makeIdGenerator = (nextUuidV7) => ({
|
|
|
42
42
|
makeEventId: () => nextUuidV7.pipe(Effect.map((id) => EventId.make(id))),
|
|
43
43
|
makeCommandId: () => nextUuidV7.pipe(Effect.map((id) => CommandId.make(id))),
|
|
44
44
|
makeRunId: () => nextUuidV7.pipe(Effect.map((id) => RunId.make(id))),
|
|
45
|
+
makeRunRequestId: () => nextUuidV7.pipe(Effect.map((id) => RunRequestId.make(id))),
|
|
45
46
|
makeTurnId: () => nextUuidV7.pipe(Effect.map((id) => TurnId.make(id))),
|
|
46
47
|
makeInferenceId: () => nextUuidV7.pipe(Effect.map((id) => InferenceId.make(id))),
|
|
47
48
|
makeToolCallId: () => nextUuidV7.pipe(Effect.map((id) => ToolCallId.make(id))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id-generator.js","names":[],"sources":["../../src/services/id-generator.ts"],"sourcesContent":["import * as Context from \"effect/Context\";\nimport * as Crypto from \"effect/Crypto\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\n\nimport {\n InferenceId,\n CommandId,\n CompactionId,\n CorrelationId,\n EventId,\n MessageId,\n RunId,\n SessionId,\n SummaryId,\n ToolCallId,\n TurnId,\n} from \"../types/core\";\n\n/** UUIDv7 minting capability for all framework-owned lifecycle identities. */\nexport interface IdGeneratorShape {\n readonly makeSessionId: () => Effect.Effect<SessionId>;\n readonly makeEventId: () => Effect.Effect<EventId>;\n readonly makeCommandId: () => Effect.Effect<CommandId>;\n readonly makeRunId: () => Effect.Effect<RunId>;\n readonly makeTurnId: () => Effect.Effect<TurnId>;\n readonly makeInferenceId: () => Effect.Effect<InferenceId>;\n readonly makeToolCallId: () => Effect.Effect<ToolCallId>;\n readonly makeMessageId: () => Effect.Effect<MessageId>;\n readonly makeCompactionId: () => Effect.Effect<CompactionId>;\n readonly makeSummaryId: () => Effect.Effect<SummaryId>;\n readonly makeCorrelationId: () => Effect.Effect<CorrelationId>;\n}\n\nconst WebCryptoLive = Layer.succeed(\n Crypto.Crypto,\n Crypto.make({\n randomBytes: (size) => {\n const bytes = new Uint8Array(size);\n globalThis.crypto.getRandomValues(bytes);\n return bytes;\n },\n digest: () => Effect.die(new Error(\"IdGenerator does not use Crypto.digest\")),\n }),\n);\n\n/** Mints framework-owned UUIDv7 lifecycle IDs for effect-durable-agent. */\nexport class IdGenerator extends Context.Service<IdGenerator, IdGeneratorShape>()(\n \"@effect-durable-agent/IdGenerator\",\n) {\n static readonly Live = Layer.effect(\n IdGenerator,\n Effect.gen(function* () {\n const crypto = yield* Crypto.Crypto;\n return makeIdGenerator(crypto.randomUUIDv7.pipe(Effect.orDie));\n }),\n ).pipe(Layer.provide(WebCryptoLive));\n\n static readonly Deterministic = (ids: ReadonlyArray<string>) =>\n Layer.sync(IdGenerator, () => {\n let index = 0;\n return makeIdGenerator(\n Effect.sync(() => {\n const next = ids[index];\n if (next === undefined) {\n throw new Error(\"deterministic IdGenerator exhausted\");\n }\n index += 1;\n return next;\n }),\n );\n });\n\n /** Counter-based deterministic IDs; the nth minted ID is `sequentialUuidV7(n)`. */\n static readonly Sequential = Layer.sync(IdGenerator, () => {\n let counter = 0;\n return makeIdGenerator(\n Effect.sync(() => {\n counter += 1;\n return sequentialUuidV7(counter);\n }),\n );\n });\n}\n\n/** The UUIDv7-shaped value minted by `IdGenerator.Sequential` for counter `n` (1-based). */\nexport const sequentialUuidV7 = (n: number): string =>\n `00000000-0000-7000-8000-${n.toString(16).padStart(12, \"0\")}`;\n\nconst makeIdGenerator = (nextUuidV7: Effect.Effect<string>): IdGeneratorShape => ({\n makeSessionId: () => nextUuidV7.pipe(Effect.map((id) => SessionId.make(id))),\n makeEventId: () => nextUuidV7.pipe(Effect.map((id) => EventId.make(id))),\n makeCommandId: () => nextUuidV7.pipe(Effect.map((id) => CommandId.make(id))),\n makeRunId: () => nextUuidV7.pipe(Effect.map((id) => RunId.make(id))),\n makeTurnId: () => nextUuidV7.pipe(Effect.map((id) => TurnId.make(id))),\n makeInferenceId: () => nextUuidV7.pipe(Effect.map((id) => InferenceId.make(id))),\n makeToolCallId: () => nextUuidV7.pipe(Effect.map((id) => ToolCallId.make(id))),\n makeMessageId: () => nextUuidV7.pipe(Effect.map((id) => MessageId.make(id))),\n makeCompactionId: () => nextUuidV7.pipe(Effect.map((id) => CompactionId.make(id))),\n makeSummaryId: () => nextUuidV7.pipe(Effect.map((id) => SummaryId.make(id))),\n makeCorrelationId: () => nextUuidV7.pipe(Effect.map((id) => CorrelationId.make(id))),\n});\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"id-generator.js","names":[],"sources":["../../src/services/id-generator.ts"],"sourcesContent":["import * as Context from \"effect/Context\";\nimport * as Crypto from \"effect/Crypto\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\n\nimport {\n InferenceId,\n CommandId,\n CompactionId,\n CorrelationId,\n EventId,\n MessageId,\n RunId,\n RunRequestId,\n SessionId,\n SummaryId,\n ToolCallId,\n TurnId,\n} from \"../types/core\";\n\n/** UUIDv7 minting capability for all framework-owned lifecycle identities. */\nexport interface IdGeneratorShape {\n readonly makeSessionId: () => Effect.Effect<SessionId>;\n readonly makeEventId: () => Effect.Effect<EventId>;\n readonly makeCommandId: () => Effect.Effect<CommandId>;\n readonly makeRunId: () => Effect.Effect<RunId>;\n readonly makeRunRequestId: () => Effect.Effect<RunRequestId>;\n readonly makeTurnId: () => Effect.Effect<TurnId>;\n readonly makeInferenceId: () => Effect.Effect<InferenceId>;\n readonly makeToolCallId: () => Effect.Effect<ToolCallId>;\n readonly makeMessageId: () => Effect.Effect<MessageId>;\n readonly makeCompactionId: () => Effect.Effect<CompactionId>;\n readonly makeSummaryId: () => Effect.Effect<SummaryId>;\n readonly makeCorrelationId: () => Effect.Effect<CorrelationId>;\n}\n\nconst WebCryptoLive = Layer.succeed(\n Crypto.Crypto,\n Crypto.make({\n randomBytes: (size) => {\n const bytes = new Uint8Array(size);\n globalThis.crypto.getRandomValues(bytes);\n return bytes;\n },\n digest: () => Effect.die(new Error(\"IdGenerator does not use Crypto.digest\")),\n }),\n);\n\n/** Mints framework-owned UUIDv7 lifecycle IDs for effect-durable-agent. */\nexport class IdGenerator extends Context.Service<IdGenerator, IdGeneratorShape>()(\n \"@effect-durable-agent/IdGenerator\",\n) {\n static readonly Live = Layer.effect(\n IdGenerator,\n Effect.gen(function* () {\n const crypto = yield* Crypto.Crypto;\n return makeIdGenerator(crypto.randomUUIDv7.pipe(Effect.orDie));\n }),\n ).pipe(Layer.provide(WebCryptoLive));\n\n static readonly Deterministic = (ids: ReadonlyArray<string>) =>\n Layer.sync(IdGenerator, () => {\n let index = 0;\n return makeIdGenerator(\n Effect.sync(() => {\n const next = ids[index];\n if (next === undefined) {\n throw new Error(\"deterministic IdGenerator exhausted\");\n }\n index += 1;\n return next;\n }),\n );\n });\n\n /** Counter-based deterministic IDs; the nth minted ID is `sequentialUuidV7(n)`. */\n static readonly Sequential = Layer.sync(IdGenerator, () => {\n let counter = 0;\n return makeIdGenerator(\n Effect.sync(() => {\n counter += 1;\n return sequentialUuidV7(counter);\n }),\n );\n });\n}\n\n/** The UUIDv7-shaped value minted by `IdGenerator.Sequential` for counter `n` (1-based). */\nexport const sequentialUuidV7 = (n: number): string =>\n `00000000-0000-7000-8000-${n.toString(16).padStart(12, \"0\")}`;\n\nconst makeIdGenerator = (nextUuidV7: Effect.Effect<string>): IdGeneratorShape => ({\n makeSessionId: () => nextUuidV7.pipe(Effect.map((id) => SessionId.make(id))),\n makeEventId: () => nextUuidV7.pipe(Effect.map((id) => EventId.make(id))),\n makeCommandId: () => nextUuidV7.pipe(Effect.map((id) => CommandId.make(id))),\n makeRunId: () => nextUuidV7.pipe(Effect.map((id) => RunId.make(id))),\n makeRunRequestId: () => nextUuidV7.pipe(Effect.map((id) => RunRequestId.make(id))),\n makeTurnId: () => nextUuidV7.pipe(Effect.map((id) => TurnId.make(id))),\n makeInferenceId: () => nextUuidV7.pipe(Effect.map((id) => InferenceId.make(id))),\n makeToolCallId: () => nextUuidV7.pipe(Effect.map((id) => ToolCallId.make(id))),\n makeMessageId: () => nextUuidV7.pipe(Effect.map((id) => MessageId.make(id))),\n makeCompactionId: () => nextUuidV7.pipe(Effect.map((id) => CompactionId.make(id))),\n makeSummaryId: () => nextUuidV7.pipe(Effect.map((id) => SummaryId.make(id))),\n makeCorrelationId: () => nextUuidV7.pipe(Effect.map((id) => CorrelationId.make(id))),\n});\n"],"mappings":";;;;;;AAoCA,MAAM,gBAAgB,MAAM,QAC1B,OAAO,QACP,OAAO,KAAK;CACV,cAAc,SAAS;EACrB,MAAM,QAAQ,IAAI,WAAW,IAAI;EACjC,WAAW,OAAO,gBAAgB,KAAK;EACvC,OAAO;CACT;CACA,cAAc,OAAO,oBAAI,IAAI,MAAM,wCAAwC,CAAC;AAC9E,CAAC,CACH;;AAGA,IAAa,cAAb,MAAa,oBAAoB,QAAQ,QAAuC,EAC9E,mCACF,EAAE;CACA,OAAgB,OAAO,MAAM,OAC3B,aACA,OAAO,IAAI,aAAa;EAEtB,OAAO,iBAAgB,OADD,OAAO,QACC,aAAa,KAAK,OAAO,KAAK,CAAC;CAC/D,CAAC,CACH,EAAE,KAAK,MAAM,QAAQ,aAAa,CAAC;CAEnC,OAAgB,iBAAiB,QAC/B,MAAM,KAAK,mBAAmB;EAC5B,IAAI,QAAQ;EACZ,OAAO,gBACL,OAAO,WAAW;GAChB,MAAM,OAAO,IAAI;GACjB,IAAI,SAAS,KAAA,GACX,MAAM,IAAI,MAAM,qCAAqC;GAEvD,SAAS;GACT,OAAO;EACT,CAAC,CACH;CACF,CAAC;;CAGH,OAAgB,aAAa,MAAM,KAAK,mBAAmB;EACzD,IAAI,UAAU;EACd,OAAO,gBACL,OAAO,WAAW;GAChB,WAAW;GACX,OAAO,iBAAiB,OAAO;EACjC,CAAC,CACH;CACF,CAAC;AACH;;AAGA,MAAa,oBAAoB,MAC/B,2BAA2B,EAAE,SAAS,EAAE,EAAE,SAAS,IAAI,GAAG;AAE5D,MAAM,mBAAmB,gBAAyD;CAChF,qBAAqB,WAAW,KAAK,OAAO,KAAK,OAAO,UAAU,KAAK,EAAE,CAAC,CAAC;CAC3E,mBAAmB,WAAW,KAAK,OAAO,KAAK,OAAO,QAAQ,KAAK,EAAE,CAAC,CAAC;CACvE,qBAAqB,WAAW,KAAK,OAAO,KAAK,OAAO,UAAU,KAAK,EAAE,CAAC,CAAC;CAC3E,iBAAiB,WAAW,KAAK,OAAO,KAAK,OAAO,MAAM,KAAK,EAAE,CAAC,CAAC;CACnE,wBAAwB,WAAW,KAAK,OAAO,KAAK,OAAO,aAAa,KAAK,EAAE,CAAC,CAAC;CACjF,kBAAkB,WAAW,KAAK,OAAO,KAAK,OAAO,OAAO,KAAK,EAAE,CAAC,CAAC;CACrE,uBAAuB,WAAW,KAAK,OAAO,KAAK,OAAO,YAAY,KAAK,EAAE,CAAC,CAAC;CAC/E,sBAAsB,WAAW,KAAK,OAAO,KAAK,OAAO,WAAW,KAAK,EAAE,CAAC,CAAC;CAC7E,qBAAqB,WAAW,KAAK,OAAO,KAAK,OAAO,UAAU,KAAK,EAAE,CAAC,CAAC;CAC3E,wBAAwB,WAAW,KAAK,OAAO,KAAK,OAAO,aAAa,KAAK,EAAE,CAAC,CAAC;CACjF,qBAAqB,WAAW,KAAK,OAAO,KAAK,OAAO,UAAU,KAAK,EAAE,CAAC,CAAC;CAC3E,yBAAyB,WAAW,KAAK,OAAO,KAAK,OAAO,cAAc,KAAK,EAAE,CAAC,CAAC;AACrF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
//#region src/services/keep-alive.ts
|
|
5
|
+
/** Host keep-alive service for finite active EDA work roots. */
|
|
6
|
+
var EDAKeepAlive = class EDAKeepAlive extends Context.Service()("@effect-durable-agent/EDAKeepAlive") {
|
|
7
|
+
static Noop = Layer.succeed(EDAKeepAlive, { withActiveWork: (_label, effect) => effect });
|
|
8
|
+
static FromAcquire = (acquire) => Layer.succeed(EDAKeepAlive, { withActiveWork: (label, effect) => Effect.acquireUseRelease(Effect.promise(() => acquire(label)), () => effect, (lease) => Effect.promise(() => lease.release())) });
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { EDAKeepAlive };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=keep-alive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keep-alive.js","names":[],"sources":["../../src/services/keep-alive.ts"],"sourcesContent":["import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\n\n/** Host lifecycle lease held while finite EDA work is actively running. */\nexport interface EDAKeepAliveLease {\n readonly release: () => Promise<void>;\n}\n\n/** Host-provided wrapper for keeping finite active work alive. */\nexport interface EDAKeepAliveShape {\n /**\n * A host may suspend an idle session after ingress returns while model turns,\n * recovery drains, and durable sink catch-up still run in Effect fibers. Wrap\n * those finite active-work regions so the host can retain or schedule the\n * session until work completes, parks durably, fails, or is interrupted.\n * Long-lived fibers blocked on queues should not hold a lease.\n */\n readonly withActiveWork: <A, E, R>(\n label: string,\n effect: Effect.Effect<A, E, R>,\n ) => Effect.Effect<A, E, R>;\n}\n\n/** Host keep-alive service for finite active EDA work roots. */\nexport class EDAKeepAlive extends Context.Service<EDAKeepAlive, EDAKeepAliveShape>()(\n \"@effect-durable-agent/EDAKeepAlive\",\n) {\n static readonly Noop = Layer.succeed(EDAKeepAlive, {\n withActiveWork: (_label, effect) => effect,\n } satisfies EDAKeepAliveShape);\n\n static readonly FromAcquire = (\n acquire: (label: string) => Promise<EDAKeepAliveLease>,\n ): Layer.Layer<EDAKeepAlive> =>\n Layer.succeed(EDAKeepAlive, {\n withActiveWork: (label, effect) =>\n Effect.acquireUseRelease(\n Effect.promise(() => acquire(label)),\n () => effect,\n (lease) => Effect.promise(() => lease.release()),\n ),\n } satisfies EDAKeepAliveShape);\n}\n"],"mappings":";;;;;AAyBA,IAAa,eAAb,MAAa,qBAAqB,QAAQ,QAAyC,EACjF,oCACF,EAAE;CACA,OAAgB,OAAO,MAAM,QAAQ,cAAc,EACjD,iBAAiB,QAAQ,WAAW,OACtC,CAA6B;CAE7B,OAAgB,eACd,YAEA,MAAM,QAAQ,cAAc,EAC1B,iBAAiB,OAAO,WACtB,OAAO,kBACL,OAAO,cAAc,QAAQ,KAAK,CAAC,SAC7B,SACL,UAAU,OAAO,cAAc,MAAM,QAAQ,CAAC,CACjD,EACJ,CAA6B;AACjC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import * as LanguageModel from "effect/unstable/ai/LanguageModel";
|
|
5
|
+
//#region src/services/model-resolver.ts
|
|
6
|
+
/** Resolves a recorded selection into an executable provider service at a model-call boundary. */
|
|
7
|
+
var ModelResolver = class ModelResolver extends Context.Service()("@effect-durable-agent/ModelResolver") {
|
|
8
|
+
/** Fixed provider implementation for deterministic tests and single-model hosts. */
|
|
9
|
+
static Fixed = Layer.effect(ModelResolver, Effect.gen(function* () {
|
|
10
|
+
const model = yield* LanguageModel.LanguageModel;
|
|
11
|
+
return { resolve: () => Effect.succeed(model) };
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { ModelResolver };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=model-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-resolver.js","names":[],"sources":["../../src/services/model-resolver.ts"],"sourcesContent":["import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as LanguageModel from \"effect/unstable/ai/LanguageModel\";\nimport type { ModelSelectionPayload } from \"../types/events\";\n\n/** Resolves a recorded selection into an executable provider service at a model-call boundary. */\nexport class ModelResolver extends Context.Service<\n ModelResolver,\n {\n readonly resolve: (\n selection: ModelSelectionPayload | undefined,\n ) => Effect.Effect<LanguageModel.Service>;\n }\n>()(\"@effect-durable-agent/ModelResolver\") {\n /** Fixed provider implementation for deterministic tests and single-model hosts. */\n static readonly Fixed = Layer.effect(\n ModelResolver,\n Effect.gen(function* () {\n const model = yield* LanguageModel.LanguageModel;\n return { resolve: () => Effect.succeed(model) };\n }),\n );\n}\n"],"mappings":";;;;;;AAOA,IAAa,gBAAb,MAAa,sBAAsB,QAAQ,QAOzC,EAAE,qCAAqC,EAAE;;CAEzC,OAAgB,QAAQ,MAAM,OAC5B,eACA,OAAO,IAAI,aAAa;EACtB,MAAM,QAAQ,OAAO,cAAc;EACnC,OAAO,EAAE,eAAe,OAAO,QAAQ,KAAK,EAAE;CAChD,CAAC,CACH;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as buildEDAPrompt, i as
|
|
2
|
-
export { EDAPromptProjectionInput, EDAPromptProjector, EDAPromptProjectorShape,
|
|
1
|
+
import { a as buildEDAPrompt, i as EDAPromptProjectorShape, n as EDAPromptProjectionInput, r as EDAPromptProjector, t as EDAProjectedPromptContext } from "../prompt-projector-BpRH-Ec-.js";
|
|
2
|
+
export { EDAProjectedPromptContext, EDAPromptProjectionInput, EDAPromptProjector, EDAPromptProjectorShape, buildEDAPrompt };
|
|
@@ -1,24 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { contextProjectionPrompt } from "../domain/message-transcript.js";
|
|
2
2
|
import * as Context from "effect/Context";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
5
|
+
import * as Prompt from "effect/unstable/ai/Prompt";
|
|
5
6
|
//#region src/services/prompt-projector.ts
|
|
6
|
-
/** Build a provider prompt
|
|
7
|
+
/** Build a provider prompt entirely from the current durable state projection. */
|
|
7
8
|
const buildEDAPrompt = (projector, input) => Effect.gen(function* () {
|
|
8
9
|
const state = yield* projector.projectState(input);
|
|
9
|
-
const
|
|
10
|
-
|
|
10
|
+
const context = yield* projector.projectContext(input);
|
|
11
|
+
const transcript = contextProjectionPrompt(state, input.context);
|
|
12
|
+
const instructionBoundary = firstNonSystemMessageIndex(transcript.content);
|
|
13
|
+
return Prompt.fromMessages([
|
|
14
|
+
...transcript.content.slice(0, instructionBoundary),
|
|
15
|
+
...context.instructions,
|
|
16
|
+
...transcript.content.slice(instructionBoundary),
|
|
17
|
+
...context.messages
|
|
18
|
+
]);
|
|
11
19
|
});
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
return durable?._tag === "User" && durable.requestedDisposition === void 0;
|
|
20
|
+
const firstNonSystemMessageIndex = (messages) => {
|
|
21
|
+
const index = messages.findIndex((message) => message.role !== "system");
|
|
22
|
+
return index === -1 ? messages.length : index;
|
|
16
23
|
};
|
|
17
24
|
/** Service that lets apps derive LLM context independently from UI projections. */
|
|
18
25
|
var EDAPromptProjector = class EDAPromptProjector extends Context.Service()("@effect-durable-agent/EDAPromptProjector") {
|
|
19
26
|
static Default = Layer.succeed(EDAPromptProjector, {
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
projectContext: () => Effect.succeed({
|
|
28
|
+
instructions: [],
|
|
29
|
+
messages: []
|
|
30
|
+
}),
|
|
31
|
+
projectState: (input) => Effect.succeed(input.state)
|
|
22
32
|
});
|
|
23
33
|
};
|
|
24
34
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-projector.js","names":[],"sources":["../../src/services/prompt-projector.ts"],"sourcesContent":["import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport
|
|
1
|
+
{"version":3,"file":"prompt-projector.js","names":[],"sources":["../../src/services/prompt-projector.ts"],"sourcesContent":["import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Prompt from \"effect/unstable/ai/Prompt\";\n\nimport { contextProjectionPrompt } from \"../domain/message-transcript\";\nimport type { ContextProjection } from \"../domain/context-projection\";\nimport type { ReducedState } from \"../domain/reduced-state\";\nimport type { SessionId } from \"../types/core\";\nimport type { EDAReducerStateSnapshot } from \"./reducer-registry\";\n\n/** Input for app-extensible state-to-LLM prompt projection. */\nexport interface EDAPromptProjectionInput {\n readonly sessionId: SessionId;\n readonly state: ReducedState;\n readonly reducerStates: EDAReducerStateSnapshot;\n readonly context?: ContextProjection;\n}\n\n/** App-derived instructions and data inserted around the durable transcript. */\nexport interface EDAProjectedPromptContext {\n /** Instruction messages placed after durable system context and before transcript history. */\n readonly instructions: ReadonlyArray<Prompt.SystemMessage>;\n /** Data messages placed after transcript history and before scheduler-selected user messages. */\n readonly messages: ReadonlyArray<Prompt.UserMessage>;\n}\n\n/** Host-extensible projection from durable state into provider prompt context. */\nexport interface EDAPromptProjectorShape {\n readonly projectContext: (\n input: EDAPromptProjectionInput,\n ) => Effect.Effect<EDAProjectedPromptContext>;\n readonly projectState: (input: EDAPromptProjectionInput) => Effect.Effect<ReducedState>;\n}\n\n/** Build a provider prompt entirely from the current durable state projection. */\nexport const buildEDAPrompt = (\n projector: EDAPromptProjectorShape,\n input: EDAPromptProjectionInput,\n): Effect.Effect<Prompt.Prompt> =>\n Effect.gen(function* () {\n const state = yield* projector.projectState(input);\n const context = yield* projector.projectContext(input);\n const transcript = contextProjectionPrompt(state, input.context);\n const instructionBoundary = firstNonSystemMessageIndex(transcript.content);\n return Prompt.fromMessages([\n ...transcript.content.slice(0, instructionBoundary),\n ...context.instructions,\n ...transcript.content.slice(instructionBoundary),\n ...context.messages,\n ]);\n });\n\nconst firstNonSystemMessageIndex = (messages: ReadonlyArray<Prompt.Message>): number => {\n const index = messages.findIndex((message) => message.role !== \"system\");\n return index === -1 ? messages.length : index;\n};\n\n/** Service that lets apps derive LLM context independently from UI projections. */\nexport class EDAPromptProjector extends Context.Service<\n EDAPromptProjector,\n EDAPromptProjectorShape\n>()(\"@effect-durable-agent/EDAPromptProjector\") {\n static readonly Default = Layer.succeed(EDAPromptProjector, {\n projectContext: () => Effect.succeed({ instructions: [], messages: [] }),\n projectState: (input) => Effect.succeed(input.state),\n } satisfies EDAPromptProjectorShape);\n}\n"],"mappings":";;;;;;;AAoCA,MAAa,kBACX,WACA,UAEA,OAAO,IAAI,aAAa;CACtB,MAAM,QAAQ,OAAO,UAAU,aAAa,KAAK;CACjD,MAAM,UAAU,OAAO,UAAU,eAAe,KAAK;CACrD,MAAM,aAAa,wBAAwB,OAAO,MAAM,OAAO;CAC/D,MAAM,sBAAsB,2BAA2B,WAAW,OAAO;CACzE,OAAO,OAAO,aAAa;EACzB,GAAG,WAAW,QAAQ,MAAM,GAAG,mBAAmB;EAClD,GAAG,QAAQ;EACX,GAAG,WAAW,QAAQ,MAAM,mBAAmB;EAC/C,GAAG,QAAQ;CACb,CAAC;AACH,CAAC;AAEH,MAAM,8BAA8B,aAAoD;CACtF,MAAM,QAAQ,SAAS,WAAW,YAAY,QAAQ,SAAS,QAAQ;CACvE,OAAO,UAAU,KAAK,SAAS,SAAS;AAC1C;;AAGA,IAAa,qBAAb,MAAa,2BAA2B,QAAQ,QAG9C,EAAE,0CAA0C,EAAE;CAC9C,OAAgB,UAAU,MAAM,QAAQ,oBAAoB;EAC1D,sBAAsB,OAAO,QAAQ;GAAE,cAAc,CAAC;GAAG,UAAU,CAAC;EAAE,CAAC;EACvE,eAAe,UAAU,OAAO,QAAQ,MAAM,KAAK;CACrD,CAAmC;AACrC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { EDAReducer, EDAReducerRegistry, EDAReducerRegistryShape, EDAReducerStateSnapshot, EDAReducersFor, EDATypedReducerRegistry, decodeReducerState, defineEDAReducerRegistry, edaReservedReducerNamePrefix, encodeReducerState, getEDAReducerState, reducerSchemaVersion };
|
|
1
|
+
import { a as EDAReducerStateSnapshot, c as decodeReducerState, d as encodeReducerState, f as getEDAReducerState, i as EDAReducerRegistryShape, l as defineEDAReducerRegistry, n as EDAReducerDefinition, o as EDAReducersFor, p as reducerSchemaVersion, r as EDAReducerRegistry, s as EDATypedReducerRegistry, t as EDAReducer, u as edaReservedReducerNamePrefix } from "../reducer-registry-DjP1qqbs.js";
|
|
2
|
+
export { EDAReducer, EDAReducerDefinition, EDAReducerRegistry, EDAReducerRegistryShape, EDAReducerStateSnapshot, EDAReducersFor, EDATypedReducerRegistry, decodeReducerState, defineEDAReducerRegistry, edaReservedReducerNamePrefix, encodeReducerState, getEDAReducerState, reducerSchemaVersion };
|