effect-durable-agent 0.1.0-alpha.3 → 0.1.0-alpha.30
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 +43 -41
- package/dist/assert-never-CoyUpoRB.js +18 -0
- package/dist/assert-never-CoyUpoRB.js.map +1 -0
- package/dist/{commands-Ce1ec6kH.d.ts → commands-3OD-p8dD.d.ts} +16 -9
- package/dist/compaction-63iEDHHl.js +523 -0
- package/dist/compaction-63iEDHHl.js.map +1 -0
- package/dist/context-projection-D_uRtK3r.d.ts +139 -0
- package/dist/{core-Hv3cFydL.d.ts → core-BcimKMIv.d.ts} +6 -4
- package/dist/delivery-2ZILvoRD.js +507 -0
- package/dist/delivery-2ZILvoRD.js.map +1 -0
- package/dist/{websocket-wire-D3tLrhe2.d.ts → delivery-RjM1_NAE.d.ts} +1019 -200
- package/dist/domain/command-queues.d.ts +81 -2
- 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 +36 -2
- package/dist/domain/message-transcript.js +10 -2
- package/dist/domain/message-transcript.js.map +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 +3 -996
- package/dist/domain/reduced-state-schema.js +121 -12
- 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 +937 -2
- package/dist/domain/reduced-state.js.map +1 -0
- 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-DlScwmCy.d.ts → durable-Cqv5ZRFA.d.ts} +8505 -2497
- package/dist/{durable-C3Rz7kg3.js → durable-D13w1Qr3.js} +253 -91
- package/dist/durable-D13w1Qr3.js.map +1 -0
- package/dist/envelope-BCzKUq_z.js +91 -0
- package/dist/envelope-BCzKUq_z.js.map +1 -0
- package/dist/envelope-Che6KatU.d.ts +254 -0
- package/dist/{keep-alive-p8dIcSVy.js → event-factory-_vF1bIJ7.js} +8 -10
- package/dist/event-factory-_vF1bIJ7.js.map +1 -0
- package/dist/{events-Bb9-Cu-7.d.ts → events-Dg0o5wWs.d.ts} +140 -324
- package/dist/{id-generator-C2Q15uZM.d.ts → id-generator-BKGoKjt-.d.ts} +3 -3
- package/dist/in-memory-CeODnZhE.js +150 -0
- package/dist/in-memory-CeODnZhE.js.map +1 -0
- package/dist/index.d.ts +8 -7
- package/dist/index.js +6 -5
- package/dist/interpreter-DKGJ1sSx.js +1452 -0
- package/dist/interpreter-DKGJ1sSx.js.map +1 -0
- package/dist/keep-alive-_zFCUvt3.d.ts +28 -0
- package/dist/model-resolver-D0vcDZsU.d.ts +24 -0
- package/dist/model-usage-0GeHwaaU.d.ts +54 -0
- package/dist/records--54mZEBx.js +675 -0
- package/dist/records--54mZEBx.js.map +1 -0
- package/dist/reduced-state-DU2ECOUp.d.ts +47821 -0
- package/dist/reduced-state-schema-B2t3cobf.d.ts +2187 -0
- package/dist/{reducer-registry-C0svUa63.d.ts → reducer-registry-JLU1yptN.d.ts} +24 -8
- package/dist/run-scheduling-wakeup-D_bGdicf.d.ts +24 -0
- package/dist/services/compaction.d.ts +2 -2
- package/dist/services/compaction.js +2 -426
- package/dist/services/id-generator.d.ts +1 -1
- package/dist/services/id-generator.js +4 -2
- 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-call.d.ts +15 -0
- package/dist/services/model-call.js +15 -0
- package/dist/services/model-call.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 +49 -5
- package/dist/services/prompt-projector.js.map +1 -1
- package/dist/services/reducer-registry.d.ts +2 -2
- package/dist/services/reducer-registry.js +21 -4
- package/dist/services/reducer-registry.js.map +1 -1
- package/dist/services/run-scheduler.d.ts +2 -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 +48 -0
- package/dist/services/runtime-layer.js +51 -0
- package/dist/services/runtime-layer.js.map +1 -0
- package/dist/services/runtime.d.ts +1 -1
- package/dist/services/runtime.js +34 -20
- 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 +141 -2
- 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 +272 -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 +50 -0
- package/dist/services/sink-checkpoint-store.js.map +1 -0
- package/dist/services/sink-registry.d.ts +2 -2
- package/dist/services/sink-registry.js +1 -1
- package/dist/services/span-names.d.ts +1 -1
- package/dist/services/span-names.js +7 -1
- package/dist/services/span-names.js.map +1 -1
- package/dist/services/tool-registry.d.ts +2 -2
- package/dist/services/tool-registry.js +12 -3
- package/dist/services/tool-registry.js.map +1 -1
- package/dist/services/tracing.d.ts +3 -3
- package/dist/services/tracing.js +25 -4
- package/dist/services/tracing.js.map +1 -1
- package/dist/session-event-observer-HvrRckbC.d.ts +24 -0
- package/dist/{session-query-Cbf-e0rG.js → session-state-BQYsuBqi.js} +693 -251
- package/dist/session-state-BQYsuBqi.js.map +1 -0
- package/dist/session-store-CQxg9U82.d.ts +3302 -0
- package/dist/sink-checkpoint-store-DWGifxp0.d.ts +39 -0
- package/dist/sink-registry-DskRcyOS.js +345 -0
- package/dist/sink-registry-DskRcyOS.js.map +1 -0
- package/dist/subscription-DmO3BcdT.js +505 -0
- package/dist/subscription-DmO3BcdT.js.map +1 -0
- package/dist/subscription-rC35dAWn.d.ts +958 -0
- package/dist/testkit/layers.d.ts +34 -19
- package/dist/testkit/layers.js +30 -16
- package/dist/testkit/layers.js.map +1 -1
- package/dist/testkit/transcript.d.ts +226 -0
- package/dist/testkit/transcript.js +1475 -0
- package/dist/testkit/transcript.js.map +1 -0
- package/dist/{tool-registry-CcnkAAQK.d.ts → tool-registry-BzlMhwzj.d.ts} +44 -8
- package/dist/{tracing-BXHAkxkx.d.ts → tracing-BwjbF285.d.ts} +1 -2
- package/dist/transcript.d.ts +101 -0
- package/dist/transcript.js +107 -0
- package/dist/transcript.js.map +1 -0
- package/dist/types/commands.d.ts +2 -2
- package/dist/types/commands.js +8 -3
- 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 +5 -4
- package/dist/types/events.js +3 -2
- package/dist/types/events.js.map +1 -1
- package/dist/types/tracing.d.ts +1 -1
- package/dist/types/tracing.js.map +1 -1
- package/dist/websocket/events.d.ts +2 -0
- package/dist/websocket/events.js +2 -0
- package/dist/websocket.d.ts +2201 -0
- package/dist/websocket.js +684 -0
- package/dist/websocket.js.map +1 -0
- package/dist/window-read-CBZEJ84M.d.ts +113 -0
- package/dist/window-read-DPFAA1hM.js +264 -0
- package/dist/window-read-DPFAA1hM.js.map +1 -0
- package/package.json +87 -46
- package/testing/offline-trace/README.md +2 -1
- package/CHANGELOG.md +0 -25
- package/CONTRIBUTING.md +0 -26
- package/SECURITY.md +0 -7
- package/dist/command-queues-CQ9cwRP7.d.ts +0 -468
- package/dist/compaction-1LSZR944.d.ts +0 -144
- package/dist/durable-C3Rz7kg3.js.map +0 -1
- package/dist/durable-object-runtime-CiMKxGs6.d.ts +0 -257
- package/dist/durable-object-runtime-wKiqaAt2.js +0 -1494
- package/dist/durable-object-runtime-wKiqaAt2.js.map +0 -1
- 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 -105
- package/dist/host/websocket-wire.js.map +0 -1
- package/dist/index-BVVgDSdq.d.ts +0 -1
- package/dist/keep-alive-DYDsH6qN.d.ts +0 -111
- package/dist/keep-alive-p8dIcSVy.js.map +0 -1
- package/dist/message-transcript-BCHdHAe2.d.ts +0 -32
- package/dist/prompt-projector-DimXJPOJ.d.ts +0 -39
- package/dist/reduced-state-C4nVVzz9.js +0 -910
- package/dist/reduced-state-C4nVVzz9.js.map +0 -1
- package/dist/runtime-DcdPOEuE.d.ts +0 -60
- package/dist/services/compaction.js.map +0 -1
- package/dist/session-query-Cbf-e0rG.js.map +0 -1
- package/dist/session-query-hxfujxUH.d.ts +0 -769
- package/dist/session-store-D2Ore1QC.d.ts +0 -295
- package/dist/session-store-pYxQW9qh.js +0 -214
- package/dist/session-store-pYxQW9qh.js.map +0 -1
- package/dist/sink-registry-BziFpxoE.d.ts +0 -158
- package/dist/sink-registry-CFC6xjsN.js +0 -312
- package/dist/sink-registry-CFC6xjsN.js.map +0 -1
- package/docs/assets/architecture.svg +0 -216
- package/docs/assets/event-sequence.svg +0 -133
- package/docs/assets/gcp-trace.png +0 -0
- package/docs/assets/hero.svg +0 -33
- package/docs/message-steering.md +0 -831
- package/docs/releasing.md +0 -96
- package/docs/spec.md +0 -777
- 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 -639
- 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
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# effect-durable-agent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> ## EDA is a redux-inspired durable agent framework hosted on [Durable Objects](https://developers.cloudflare.com/durable-objects/) and [celld](https://celld.dev/)
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/effect-durable-agent)
|
|
6
6
|
[](https://github.com/advait/effect-durable-agent/actions/workflows/ci.yml)
|
|
@@ -21,7 +21,7 @@ the same event sequence.
|
|
|
21
21
|
EDA models the agent and the surrounding product as one application state machine. For example, a
|
|
22
22
|
coding-agent session might record:
|
|
23
23
|
|
|
24
|
-

|
|
25
25
|
|
|
26
26
|
Framework events and product events are not separate channels. They form the same history and
|
|
27
27
|
transition the same application state.
|
|
@@ -38,7 +38,7 @@ external conversations, delivery state, or anything else the product needs to re
|
|
|
38
38
|
|
|
39
39
|
Those events flow through the rest of the system as follows:
|
|
40
40
|
|
|
41
|
-

|
|
42
42
|
|
|
43
43
|
### 1. Session runtime: one state machine for the entire application
|
|
44
44
|
|
|
@@ -78,8 +78,8 @@ makes every state transition explicit, replayable, and testable.
|
|
|
78
78
|
### 5. State: a cached view of durable history
|
|
79
79
|
|
|
80
80
|
The reducers produce a complete snapshot of framework and application state through a known
|
|
81
|
-
sequence number. EDA caches that snapshot in
|
|
82
|
-
need to replay the entire history from the beginning.
|
|
81
|
+
sequence number. EDA caches that snapshot in host-provided durable storage so reads and restarts do
|
|
82
|
+
not need to replay the entire history from the beginning.
|
|
83
83
|
|
|
84
84
|
The cache is an optimization, not a second source of truth. If it is missing or incompatible, EDA
|
|
85
85
|
can rebuild it from the event log; the application is ultimately defined by its ordered events.
|
|
@@ -92,7 +92,7 @@ projection of state, and the LLM context is a separate pure projection of that s
|
|
|
92
92
|
The UI can preserve tool progress, approvals, sandbox status, and rich product history while the
|
|
93
93
|
LLM context selects and compacts only what the model should see. Applications can model each
|
|
94
94
|
consumer honestly instead of collapsing both into one constrained representation. See the
|
|
95
|
-
[
|
|
95
|
+
[transcript history proposal](https://github.com/advait/effect-durable-agent/blob/master/docs/transcript-history.md) for the planned user-visible projection.
|
|
96
96
|
|
|
97
97
|
### 7. Durable sinks: callbacks that survive failure
|
|
98
98
|
|
|
@@ -127,8 +127,8 @@ keeps moving. When Slack recovers, it receives the committed events and converge
|
|
|
127
127
|
history. External availability stays off the application's critical path without sacrificing
|
|
128
128
|
reliable delivery.
|
|
129
129
|
|
|
130
|
-
See the [Slack bridge example](
|
|
131
|
-
and durable outbound delivery.
|
|
130
|
+
See the [Slack bridge example](https://github.com/advait/effect-durable-agent/tree/master/examples/002-slack-bridge) for idempotent
|
|
131
|
+
ingress, a custom reducer, and durable outbound delivery.
|
|
132
132
|
|
|
133
133
|
**Durable state. Durable side effects.**
|
|
134
134
|
|
|
@@ -161,39 +161,40 @@ turns, model inference, tools, event streaming, durable sinks, and recovery. Tra
|
|
|
161
161
|
the durable boundaries that separate ingress, execution, and side effects, and Effect telemetry can
|
|
162
162
|
be exported through OpenTelemetry to Google Cloud Trace or another existing backend.
|
|
163
163
|
|
|
164
|
-

|
|
165
165
|
|
|
166
|
-
##
|
|
166
|
+
## Host-neutral core, pluggable deployment
|
|
167
167
|
|
|
168
|
-
EDA
|
|
169
|
-
|
|
170
|
-
durable coordinator for that session's state, execution, SQLite event log, live WebSockets, alarms,
|
|
171
|
-
and sink cursors.
|
|
168
|
+
EDA separates its state machine and Effect service graph from the platform that provides durable
|
|
169
|
+
storage, scheduling, identity, and live WebSockets. Applications select one host package:
|
|
172
170
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
-
|
|
176
|
-
|
|
177
|
-
-
|
|
178
|
-
- Alarms wake evicted sessions for recovery, keep-alive, and sink draining
|
|
171
|
+
| Package | Responsibility |
|
|
172
|
+
| --- | --- |
|
|
173
|
+
| `effect-durable-agent` | Host-independent commands, events, reducers, runtime, and adapter contracts. |
|
|
174
|
+
| `effect-durable-agent-cloudflare` | Cloudflare Durable Objects, SQLite, alarms, RPC, and hibernatable WebSockets. |
|
|
175
|
+
| `effect-durable-agent-celld` | [celld](https://celld.dev/) deployment of the Durable Objects contract on your infrastructure. |
|
|
179
176
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
with equivalent semantics.
|
|
177
|
+
All three packages are released together with the same version. A host and core from different
|
|
178
|
+
versions are not a supported combination; keep the versions identical when upgrading.
|
|
183
179
|
|
|
184
180
|
## Get started
|
|
185
181
|
|
|
186
|
-
Install the
|
|
187
|
-
|
|
182
|
+
Install the core and one host from the public alpha channel:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
pnpm add effect-durable-agent@alpha effect-durable-agent-cloudflare@alpha
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
For celld, select its host package at the same version instead:
|
|
188
189
|
|
|
189
190
|
```bash
|
|
190
|
-
pnpm add effect-durable-agent@alpha
|
|
191
|
+
pnpm add effect-durable-agent@alpha effect-durable-agent-celld@alpha
|
|
191
192
|
```
|
|
192
193
|
|
|
193
|
-
The smallest host is a concrete Durable Object subclass:
|
|
194
|
+
The smallest Cloudflare host is a concrete Durable Object subclass:
|
|
194
195
|
|
|
195
196
|
```ts
|
|
196
|
-
import { EDASessionDurableObject } from "effect-durable-agent
|
|
197
|
+
import { EDASessionDurableObject } from "effect-durable-agent-cloudflare"
|
|
197
198
|
|
|
198
199
|
export class MyAgentSession extends EDASessionDurableObject<MyEnv> {
|
|
199
200
|
constructor(ctx: DurableObjectState, env: MyEnv) {
|
|
@@ -209,9 +210,10 @@ Start with the executable examples:
|
|
|
209
210
|
|
|
210
211
|
| Example | What it demonstrates |
|
|
211
212
|
| --- | --- |
|
|
212
|
-
| [`001-no-tools`](
|
|
213
|
-
| [`002-slack-bridge`](
|
|
214
|
-
| [`003-sandbox-lifecycle`](
|
|
213
|
+
| [`001-no-tools`](https://github.com/advait/effect-durable-agent/tree/master/examples/001-no-tools) | Minimal Durable Object session and durable command admission. |
|
|
214
|
+
| [`002-slack-bridge`](https://github.com/advait/effect-durable-agent/tree/master/examples/002-slack-bridge) | Idempotent ingress, application events and reducers, and a retrying durable sink. |
|
|
215
|
+
| [`003-sandbox-lifecycle`](https://github.com/advait/effect-durable-agent/tree/master/examples/003-sandbox-lifecycle) | Tool and product events reduced into one UI model, including snapshot-to-stream handoff. |
|
|
216
|
+
| [`004-celld-no-tools`](https://github.com/advait/effect-durable-agent/tree/master/examples/004-celld-no-tools) | Deployable celld cell with durable command admission. |
|
|
215
217
|
|
|
216
218
|
## Why EDA instead of another agent SDK or framework?
|
|
217
219
|
|
|
@@ -267,7 +269,7 @@ client catch-up, restart recovery, production-derived UI fixtures, and durable s
|
|
|
267
269
|
## Capabilities
|
|
268
270
|
|
|
269
271
|
- Effect-native agent runtime with command, run, turn, inference, message, and tool lifecycles
|
|
270
|
-
- Cloudflare Durable
|
|
272
|
+
- Pluggable Cloudflare Durable Objects and celld hosts with one session per object and SQLite event storage
|
|
271
273
|
- Typed custom durable application events and pure application reducers
|
|
272
274
|
- Reducer checkpoints and serialized snapshots
|
|
273
275
|
- Reconnect-safe event streaming with sequence resume and WebSocket ACK flow control
|
|
@@ -292,16 +294,16 @@ typed boundaries, structured concurrency, and first-class tracing.
|
|
|
292
294
|
|
|
293
295
|
## Documentation
|
|
294
296
|
|
|
295
|
-
- [Current implementation](
|
|
296
|
-
- [Testing strategy](
|
|
297
|
-
- [WebSocket live-event protocol](
|
|
298
|
-
- [Message steering](
|
|
299
|
-
- [
|
|
300
|
-
- [Subagents proposal](
|
|
301
|
-
- [Maintainer release guide](
|
|
297
|
+
- [Current implementation](https://github.com/advait/effect-durable-agent/blob/master/docs/spec.md)
|
|
298
|
+
- [Testing strategy](https://github.com/advait/effect-durable-agent/blob/master/docs/testing.md)
|
|
299
|
+
- [WebSocket live-event protocol](https://github.com/advait/effect-durable-agent/blob/master/docs/websocket-protocol.md)
|
|
300
|
+
- [Message steering](https://github.com/advait/effect-durable-agent/blob/master/docs/message-steering.md)
|
|
301
|
+
- [Transcript history proposal](https://github.com/advait/effect-durable-agent/blob/master/docs/transcript-history.md)
|
|
302
|
+
- [Subagents proposal](https://github.com/advait/effect-durable-agent/blob/master/docs/subagents.md)
|
|
303
|
+
- [Maintainer release guide](https://github.com/advait/effect-durable-agent/blob/master/docs/releasing.md)
|
|
302
304
|
|
|
303
305
|
## Contributing and license
|
|
304
306
|
|
|
305
|
-
See [CONTRIBUTING.md](
|
|
307
|
+
See [CONTRIBUTING.md](https://github.com/advait/effect-durable-agent/blob/master/CONTRIBUTING.md) to run the project and validate the npm package. Effect
|
|
306
308
|
Durable Agent is available under the [MIT License](./LICENSE). Please report vulnerabilities
|
|
307
|
-
through the process in [SECURITY.md](
|
|
309
|
+
through the process in [SECURITY.md](https://github.com/advait/effect-durable-agent/blob/master/SECURITY.md).
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/domain/assert-never.ts
|
|
2
|
+
const formatNeverValue = (value) => {
|
|
3
|
+
try {
|
|
4
|
+
return JSON.stringify(value);
|
|
5
|
+
} catch {
|
|
6
|
+
return String(value);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
/** Build the defect used when an exhaustive switch receives an impossible value. */
|
|
10
|
+
const assertNeverError = (value, context) => /* @__PURE__ */ new Error(`Unhandled ${context}: ${formatNeverValue(value)}`);
|
|
11
|
+
/** Throw for impossible branches in pure code after TypeScript exhaustiveness checking. */
|
|
12
|
+
const assertNever = (value, context) => {
|
|
13
|
+
throw assertNeverError(value, context);
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { assertNeverError as n, assertNever as t };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=assert-never-CoyUpoRB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-never-CoyUpoRB.js","names":[],"sources":["../src/domain/assert-never.ts"],"sourcesContent":["const formatNeverValue = (value: never): string => {\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n};\n\n/** Build the defect used when an exhaustive switch receives an impossible value. */\nexport const assertNeverError = (value: never, context: string) =>\n new Error(`Unhandled ${context}: ${formatNeverValue(value)}`);\n\n/** Throw for impossible branches in pure code after TypeScript exhaustiveness checking. */\nexport const assertNever = (value: never, context: string): never => {\n throw assertNeverError(value, context);\n};\n"],"mappings":";AAAA,MAAM,oBAAoB,UAAyB;CACjD,IAAI;EACF,OAAO,KAAK,UAAU,KAAK;CAC7B,QAAQ;EACN,OAAO,OAAO,KAAK;CACrB;AACF;;AAGA,MAAa,oBAAoB,OAAc,4BAC7C,IAAI,MAAM,aAAa,QAAQ,IAAI,iBAAiB,KAAK,GAAG;;AAG9D,MAAa,eAAe,OAAc,YAA2B;CACnE,MAAM,iBAAiB,OAAO,OAAO;AACvC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as Schema from "effect/Schema";
|
|
2
|
-
|
|
3
2
|
//#region src/types/commands.d.ts
|
|
4
3
|
/** Caller-owned stable retry/correlation key for a submitted command. */
|
|
5
4
|
declare const CommandIdempotencyKey: Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">;
|
|
@@ -43,6 +42,8 @@ declare const UserMessageContent: Schema.Union<readonly [Schema.decodeTo<Schema.
|
|
|
43
42
|
}>]>>]>;
|
|
44
43
|
type UserMessageContent = typeof UserMessageContent.Type;
|
|
45
44
|
declare const SubmitMessageCommand_base: Schema.Class<SubmitMessageCommand, Schema.TaggedStruct<"SubmitMessage", {
|
|
45
|
+
readonly commandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
|
|
46
|
+
readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
|
|
46
47
|
readonly disposition: Schema.Literals<readonly ["queue", "steer", "interrupt"]>;
|
|
47
48
|
readonly content: Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
|
|
48
49
|
readonly type: Schema.Literal<"text">;
|
|
@@ -63,30 +64,28 @@ declare const SubmitMessageCommand_base: Schema.Class<SubmitMessageCommand, Sche
|
|
|
63
64
|
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
64
65
|
}>]>>]>;
|
|
65
66
|
readonly expectedPausedMessageIdsToCancel: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "MessageId">>>;
|
|
66
|
-
readonly commandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
|
|
67
|
-
readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
|
|
68
67
|
}>, {}>;
|
|
69
68
|
/** Submit a user message to the session command stream. */
|
|
70
69
|
declare class SubmitMessageCommand extends SubmitMessageCommand_base {}
|
|
71
70
|
declare const PendingMessageCancellationReason: Schema.Literals<readonly ["edit", "user-cancel"]>;
|
|
72
71
|
type PendingMessageCancellationReason = typeof PendingMessageCancellationReason.Type;
|
|
73
72
|
declare const CancelPendingMessageCommand_base: Schema.Class<CancelPendingMessageCommand, Schema.TaggedStruct<"CancelPendingMessage", {
|
|
74
|
-
readonly messageId: Schema.brand<Schema.String, "MessageId">;
|
|
75
|
-
readonly reason: Schema.Literals<readonly ["edit", "user-cancel"]>;
|
|
76
73
|
readonly commandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
|
|
77
74
|
readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
|
|
75
|
+
readonly messageId: Schema.brand<Schema.String, "MessageId">;
|
|
76
|
+
readonly reason: Schema.Literals<readonly ["edit", "user-cancel"]>;
|
|
78
77
|
}>, {}>;
|
|
79
78
|
declare class CancelPendingMessageCommand extends CancelPendingMessageCommand_base {}
|
|
80
79
|
declare const PromotePendingMessageCommand_base: Schema.Class<PromotePendingMessageCommand, Schema.TaggedStruct<"PromotePendingMessage", {
|
|
81
|
-
readonly messageId: Schema.brand<Schema.String, "MessageId">;
|
|
82
80
|
readonly commandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
|
|
83
81
|
readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
|
|
82
|
+
readonly messageId: Schema.brand<Schema.String, "MessageId">;
|
|
84
83
|
}>, {}>;
|
|
85
84
|
declare class PromotePendingMessageCommand extends PromotePendingMessageCommand_base {}
|
|
86
85
|
declare const ResumePendingMessagesCommand_base: Schema.Class<ResumePendingMessagesCommand, Schema.TaggedStruct<"ResumePendingMessages", {
|
|
87
|
-
readonly messageIds: Schema.NonEmptyArray<Schema.brand<Schema.String, "MessageId">>;
|
|
88
86
|
readonly commandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
|
|
89
87
|
readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
|
|
88
|
+
readonly messageIds: Schema.NonEmptyArray<Schema.brand<Schema.String, "MessageId">>;
|
|
90
89
|
}>, {}>;
|
|
91
90
|
/** Framework-internal owner for restarting unconsumed messages after unexpected failure. */
|
|
92
91
|
declare class ResumePendingMessagesCommand extends ResumePendingMessagesCommand_base {}
|
|
@@ -99,6 +98,14 @@ declare class StopTurnCommand extends StopTurnCommand_base {}
|
|
|
99
98
|
/** Mutating input accepted by effect-durable-agent before runtime processing. */
|
|
100
99
|
declare const EDACommand: Schema.Union<readonly [typeof SubmitMessageCommand, typeof StopTurnCommand, typeof CancelPendingMessageCommand, typeof PromotePendingMessageCommand, typeof ResumePendingMessagesCommand]>;
|
|
101
100
|
type EDACommand = typeof EDACommand.Type;
|
|
101
|
+
declare const GrantRunCommand_base: Schema.Class<GrantRunCommand, Schema.TaggedStruct<"GrantRun", {
|
|
102
|
+
readonly requestId: Schema.brand<Schema.String, "RunRequestId">;
|
|
103
|
+
}>, {}>;
|
|
104
|
+
/**
|
|
105
|
+
* Trusted scheduler permission, accepted only through the separate grantRun API.
|
|
106
|
+
* Excluded from EDACommand so ordinary session ingress cannot authorize itself.
|
|
107
|
+
*/
|
|
108
|
+
declare class GrantRunCommand extends GrantRunCommand_base {}
|
|
102
109
|
//#endregion
|
|
103
|
-
export {
|
|
104
|
-
//# sourceMappingURL=commands-
|
|
110
|
+
export { PendingMessageCancellationReason as a, StopTurnCommand as c, UserMessageContent as d, UserMessagePart as f, GrantRunCommand as i, SubmitMessageCommand as l, CommandIdempotencyKey as n, PromotePendingMessageCommand as o, EDACommand as r, ResumePendingMessagesCommand as s, CancelPendingMessageCommand as t, SubmitMessageDisposition as u };
|
|
111
|
+
//# sourceMappingURL=commands-3OD-p8dD.d.ts.map
|