effect-durable-agent 0.1.0-alpha.1 → 0.1.0-alpha.10

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 (183) hide show
  1. package/README.md +140 -136
  2. package/dist/{command-queues-CQ9cwRP7.d.ts → command-queues-CQi4Xc7u.d.ts} +109 -21
  3. package/dist/{commands-Ce1ec6kH.d.ts → commands-p8venTWs.d.ts} +10 -2
  4. package/dist/compaction-0k8zCJgB.js +473 -0
  5. package/dist/compaction-0k8zCJgB.js.map +1 -0
  6. package/dist/{compaction-YayFKo_1.d.ts → compaction-BhLSSXJ-.d.ts} +28 -7
  7. package/dist/context-projection-mCuvcO2W.d.ts +140 -0
  8. package/dist/{core-Hv3cFydL.d.ts → core-C-6xHzRx.d.ts} +6 -3
  9. package/dist/domain/command-queues.d.ts +1 -1
  10. package/dist/domain/command-queues.js +1 -1
  11. package/dist/domain/command-queues.js.map +1 -1
  12. package/dist/domain/context-projection.d.ts +2 -0
  13. package/dist/domain/context-projection.js +32 -0
  14. package/dist/domain/context-projection.js.map +1 -0
  15. package/dist/domain/message-transcript.d.ts +1 -1
  16. package/dist/domain/model-usage.d.ts +2 -0
  17. package/dist/domain/model-usage.js +59 -0
  18. package/dist/domain/model-usage.js.map +1 -0
  19. package/dist/domain/reduced-state-schema.d.ts +14 -18
  20. package/dist/domain/reduced-state-schema.js +7 -11
  21. package/dist/domain/reduced-state-schema.js.map +1 -1
  22. package/dist/domain/reduced-state.d.ts +3 -2
  23. package/dist/domain/reduced-state.js +3 -2
  24. package/dist/domain/run-scheduling.d.ts +2 -0
  25. package/dist/domain/run-scheduling.js +127 -0
  26. package/dist/domain/run-scheduling.js.map +1 -0
  27. package/dist/{durable-C3Rz7kg3.js → durable-BPHVFVvV.js} +74 -83
  28. package/dist/durable-BPHVFVvV.js.map +1 -0
  29. package/dist/{durable-DlScwmCy.d.ts → durable-DeLCAvbw.d.ts} +1256 -104
  30. package/dist/envelope-DkZyMIgp.d.ts +191 -0
  31. package/dist/envelope-DxQzo5rN.js +82 -0
  32. package/dist/envelope-DxQzo5rN.js.map +1 -0
  33. package/dist/{keep-alive-DYDsH6qN.d.ts → event-factory-KaeDSfeP.d.ts} +11 -31
  34. package/dist/{keep-alive-p8dIcSVy.js → event-factory-QuC_UvyP.js} +8 -10
  35. package/dist/event-factory-QuC_UvyP.js.map +1 -0
  36. package/dist/{events-Bb9-Cu-7.d.ts → events-LZFNoESe.d.ts} +2 -188
  37. package/dist/{id-generator-C2Q15uZM.d.ts → id-generator--x6itQZ2.d.ts} +3 -2
  38. package/dist/index.d.ts +7 -6
  39. package/dist/index.js +5 -4
  40. package/dist/keep-alive-Chl5SJxy.d.ts +29 -0
  41. package/dist/{message-transcript-BCHdHAe2.d.ts → message-transcript-6PEzaEGn.d.ts} +4 -4
  42. package/dist/model-resolver-BPPJAsuh.d.ts +18 -0
  43. package/dist/model-usage-CdBEkTwU.d.ts +55 -0
  44. package/dist/{prompt-projector-9_02lk5-.d.ts → prompt-projector-CNhqUsEr.d.ts} +15 -16
  45. package/dist/{reduced-state-C4nVVzz9.js → reduced-state-Bz68V2H8.js} +65 -32
  46. package/dist/reduced-state-Bz68V2H8.js.map +1 -0
  47. package/dist/{reducer-registry-C0svUa63.d.ts → reducer-registry-CCSzc4h8.d.ts} +16 -6
  48. package/dist/run-scheduler-DcS_okUH.d.ts +43 -0
  49. package/dist/run-scheduling-wakeup-CeHrvXie.d.ts +25 -0
  50. package/dist/{runtime-C56FQxiL.d.ts → runtime-WL_gKqxn.d.ts} +16 -7
  51. package/dist/services/compaction.d.ts +1 -1
  52. package/dist/services/compaction.js +1 -425
  53. package/dist/services/id-generator.d.ts +1 -1
  54. package/dist/services/id-generator.js +2 -1
  55. package/dist/services/id-generator.js.map +1 -1
  56. package/dist/services/keep-alive.d.ts +2 -0
  57. package/dist/services/keep-alive.js +13 -0
  58. package/dist/services/keep-alive.js.map +1 -0
  59. package/dist/services/model-resolver.d.ts +2 -0
  60. package/dist/services/model-resolver.js +17 -0
  61. package/dist/services/model-resolver.js.map +1 -0
  62. package/dist/services/prompt-projector.d.ts +2 -2
  63. package/dist/services/prompt-projector.js +20 -10
  64. package/dist/services/prompt-projector.js.map +1 -1
  65. package/dist/services/reducer-registry.d.ts +2 -2
  66. package/dist/services/reducer-registry.js +7 -3
  67. package/dist/services/reducer-registry.js.map +1 -1
  68. package/dist/services/run-scheduler.d.ts +3 -0
  69. package/dist/services/run-scheduler.js +25 -0
  70. package/dist/services/run-scheduler.js.map +1 -0
  71. package/dist/services/run-scheduling-wakeup.d.ts +2 -0
  72. package/dist/services/run-scheduling-wakeup.js +13 -0
  73. package/dist/services/run-scheduling-wakeup.js.map +1 -0
  74. package/dist/services/runtime-layer.d.ts +67 -0
  75. package/dist/services/runtime-layer.js +47 -0
  76. package/dist/services/runtime-layer.js.map +1 -0
  77. package/dist/services/runtime.d.ts +1 -1
  78. package/dist/services/runtime.js +21 -14
  79. package/dist/services/runtime.js.map +1 -1
  80. package/dist/services/session-event-observer.d.ts +2 -0
  81. package/dist/services/session-event-observer.js +13 -0
  82. package/dist/services/session-event-observer.js.map +1 -0
  83. package/dist/services/session-query.d.ts +2 -2
  84. package/dist/services/session-query.js +140 -1
  85. package/dist/services/session-query.js.map +1 -0
  86. package/dist/services/session-state.d.ts +2 -0
  87. package/dist/services/session-state.js +2 -0
  88. package/dist/services/session-store.d.ts +2 -2
  89. package/dist/services/session-store.js +182 -2
  90. package/dist/services/session-store.js.map +1 -0
  91. package/dist/services/sink-checkpoint-store.d.ts +2 -0
  92. package/dist/services/sink-checkpoint-store.js +49 -0
  93. package/dist/services/sink-checkpoint-store.js.map +1 -0
  94. package/dist/services/sink-registry.d.ts +1 -1
  95. package/dist/services/sink-registry.js +1 -1
  96. package/dist/services/span-names.d.ts +1 -1
  97. package/dist/services/span-names.js +3 -0
  98. package/dist/services/span-names.js.map +1 -1
  99. package/dist/services/tool-registry.d.ts +1 -1
  100. package/dist/services/tracing.d.ts +1 -1
  101. package/dist/services/tracing.js +23 -2
  102. package/dist/services/tracing.js.map +1 -1
  103. package/dist/session-event-observer-DaFMKKNc.d.ts +24 -0
  104. package/dist/session-query-DfW_4KC0.d.ts +47 -0
  105. package/dist/{session-query-DOc1KanA.js → session-state-BIZ2SYaP.js} +350 -183
  106. package/dist/session-state-BIZ2SYaP.js.map +1 -0
  107. package/dist/{session-query-DlRo5Ufc.d.ts → session-state-BeR2rZRR.d.ts} +144 -46
  108. package/dist/{session-store-D2Ore1QC.d.ts → session-store-J_Un45kW.d.ts} +7 -96
  109. package/dist/sink-checkpoint-store-C9hUxfH0.d.ts +40 -0
  110. package/dist/{sink-registry-CFC6xjsN.js → sink-registry-Bbqhtdnx.js} +27 -67
  111. package/dist/sink-registry-Bbqhtdnx.js.map +1 -0
  112. package/dist/{sink-registry-CIU0LD3m.d.ts → sink-registry-DuDkNXjZ.d.ts} +24 -49
  113. package/dist/testkit/layers.d.ts +24 -14
  114. package/dist/testkit/layers.js +18 -11
  115. package/dist/testkit/layers.js.map +1 -1
  116. package/dist/{tool-registry-CcnkAAQK.d.ts → tool-registry-BDmJe_Wr.d.ts} +4 -4
  117. package/dist/types/commands.d.ts +2 -2
  118. package/dist/types/commands.js +7 -2
  119. package/dist/types/commands.js.map +1 -1
  120. package/dist/types/core.d.ts +2 -2
  121. package/dist/types/core.js +4 -2
  122. package/dist/types/core.js.map +1 -1
  123. package/dist/types/events/durable.d.ts +2 -2
  124. package/dist/types/events/durable.js +2 -2
  125. package/dist/types/events.d.ts +4 -3
  126. package/dist/types/events.js +3 -2
  127. package/dist/types/events.js.map +1 -1
  128. package/dist/websocket.d.ts +2776 -0
  129. package/dist/websocket.js +498 -0
  130. package/dist/websocket.js.map +1 -0
  131. package/package.json +68 -43
  132. package/testing/offline-trace/README.md +2 -1
  133. package/CHANGELOG.md +0 -10
  134. package/CONTRIBUTING.md +0 -26
  135. package/SECURITY.md +0 -8
  136. package/dist/durable-C3Rz7kg3.js.map +0 -1
  137. package/dist/durable-object-runtime-B7jwBY2R.js +0 -1494
  138. package/dist/durable-object-runtime-B7jwBY2R.js.map +0 -1
  139. package/dist/durable-object-runtime-pWv0ohlz.d.ts +0 -257
  140. package/dist/durable-object-storage-Czy7IPrh.d.ts +0 -41
  141. package/dist/host/durable-object-runtime.d.ts +0 -2
  142. package/dist/host/durable-object-runtime.js +0 -2
  143. package/dist/host/durable-object-storage.d.ts +0 -2
  144. package/dist/host/durable-object-storage.js +0 -0
  145. package/dist/host/durable-object.d.ts +0 -83
  146. package/dist/host/durable-object.js +0 -191
  147. package/dist/host/durable-object.js.map +0 -1
  148. package/dist/host/websocket-wire.d.ts +0 -2
  149. package/dist/host/websocket-wire.js +0 -88
  150. package/dist/host/websocket-wire.js.map +0 -1
  151. package/dist/keep-alive-p8dIcSVy.js.map +0 -1
  152. package/dist/reduced-state-C4nVVzz9.js.map +0 -1
  153. package/dist/services/compaction.js.map +0 -1
  154. package/dist/session-query-DOc1KanA.js.map +0 -1
  155. package/dist/session-store-pYxQW9qh.js +0 -214
  156. package/dist/session-store-pYxQW9qh.js.map +0 -1
  157. package/dist/sink-registry-CFC6xjsN.js.map +0 -1
  158. package/dist/websocket-wire-DvOu_6BJ.d.ts +0 -16773
  159. package/docs/assets/architecture.svg +0 -106
  160. package/docs/assets/event-sequence.svg +0 -143
  161. package/docs/assets/gcp-trace.png +0 -0
  162. package/docs/message-steering.md +0 -831
  163. package/docs/releasing.md +0 -57
  164. package/docs/spec.md +0 -774
  165. package/docs/subagents.md +0 -725
  166. package/docs/testing.md +0 -64
  167. package/docs/ui-projection.md +0 -742
  168. package/docs/websocket-protocol.md +0 -613
  169. package/examples/001-no-tools/README.md +0 -65
  170. package/examples/001-no-tools/worker.ts +0 -79
  171. package/examples/002-slack-bridge/README.md +0 -134
  172. package/examples/002-slack-bridge/events.ts +0 -115
  173. package/examples/002-slack-bridge/reducer.ts +0 -216
  174. package/examples/002-slack-bridge/scenario.test.ts +0 -223
  175. package/examples/002-slack-bridge/sinks.ts +0 -109
  176. package/examples/002-slack-bridge/worker.ts +0 -140
  177. package/examples/003-sandbox-lifecycle/README.md +0 -78
  178. package/examples/003-sandbox-lifecycle/events.ts +0 -203
  179. package/examples/003-sandbox-lifecycle/reducer.ts +0 -305
  180. package/examples/003-sandbox-lifecycle/scenario.test.ts +0 -202
  181. package/examples/_shared/event-id.ts +0 -12
  182. package/examples/_shared/http.ts +0 -27
  183. package/examples/_shared/openai.ts +0 -33
package/docs/testing.md DELETED
@@ -1,64 +0,0 @@
1
- # Effect Durable Agent testing
2
-
3
- EDA tests use a small set of archetypes. Choose the lowest-cost archetype that crosses the boundary where the behavior can fail; do not repeat the same assertion at every layer.
4
-
5
- ## Archetypes
6
-
7
- | Archetype | Purpose | Shape |
8
- | --- | --- | --- |
9
- | Pure unit | Decisions, reducers, projections, ordering | Plain inputs and outputs; no layers, clocks, storage, or model |
10
- | Schema contract | Untrusted boundary acceptance and rejection | Decode representative valid values and invalid equivalence classes |
11
- | Property/model | Laws and state-machine invariants over broad input spaces | Fast-check generators with deterministic seeds on failure |
12
- | Effect service contract | One service boundary, including typed failures, interruption, and resources | Isolated layer per test unless shared state is intentional; controllable clocks for time |
13
- | Canned-model journey | High-fidelity runtime behavior without provider nondeterminism | Fake `LanguageModel`; real EDA runtime, tools, event log, reducers, and host adapter |
14
- | Real-provider smoke | Provider wire compatibility only | Explicit opt-in; minimal assertions; never part of the default suite |
15
-
16
- Examples and documentation scenarios are not a seventh archetype. They should reuse a pure unit or canned-model journey shape and exist only when they prove an externally useful example.
17
-
18
- ## Fidelity ownership
19
-
20
- - Pure reducers own transition tables and ordering laws.
21
- - Service contracts own typed error, interruption, retry, and resource semantics.
22
- - `session-state-control.model.test.ts` owns generated command/control lifecycle invariants.
23
- - `session-state-crash-simulation.test.ts` owns recovery from every durable batch prefix. Do not replace these prefix sweeps with a few named regressions.
24
- - `host/durable-object-runtime.test.ts` owns the canned-model host journey through admission, streaming, SQLite persistence, reducer checkpoints, cold-start replay, and transcript hydration.
25
- - `testing/offline-trace/offline-trace.test.ts` owns multi-turn prompt continuity, tool continuation, parallel tool ordering, and trace artifacts.
26
- - `testing/integration/runtime-real.test.ts` is the opt-in provider smoke. The default suite must never need a network or provider key.
27
-
28
- Before adding a regression test, identify which owner failed. Extend an existing table, generator, crash scenario, or journey when possible. Add a standalone named regression only when the input represents a distinct business rule or failure boundary.
29
-
30
- ## Effect testing rules
31
-
32
- - Use Effect's `TestClock` for timeout, retry, throttle, and polling behavior. A default-suite test must not wait for a production delay.
33
- - Build dependencies as layers and provide them at the test boundary. Share a layer only when shared state is intentional; EDA session tests normally require isolation.
34
- - Keep the fake model at the `LanguageModel` boundary. Do not mock internal runtime, reducer, event-store, or tool orchestration calls in a canned-model journey.
35
- - Prefer generated properties for invariants over enumerating permutations as named examples.
36
- - Assert durable facts and observable projections. Avoid assertions whose only value is proving a constructor returns its literal arguments, a constant has an exact value, or Effect/TypeScript supports an upstream library feature.
37
- - Real-provider tests are smoke tests, not the source of behavioral fidelity.
38
-
39
- ### Vite+ compatibility
40
-
41
- The repository currently runs tests through `vite-plus/test`. `@effect/vitest` imports stock `vitest` and `@vitest/runner` internals, which creates a second incompatible suite context under the Vite+ runner. Therefore EDA tests cannot safely import `@effect/vitest` yet.
42
-
43
- Until the runners converge, follow the same boundaries explicitly: run Effect programs at the outer test boundary, use layers for dependencies, and provide `TestClock.layer()` for temporal tests. Do not introduce an ad hoc imitation of `it.effect`; migrate directly to `@effect/vitest` once Vite+ exposes a compatible adapter or the repository returns to stock Vitest.
44
-
45
- ## Commands
46
-
47
- Run the standalone EDA suite:
48
-
49
- ```bash
50
- mise run test
51
- ```
52
-
53
- Run Gia's Effect-based EDA adapter tests from the sibling consumer package:
54
-
55
- ```bash
56
- mise run //gia-cf:test -- workers/eda-agent
57
- ```
58
-
59
- Run EDA's opt-in real-provider smoke:
60
-
61
- ```bash
62
- EDA_REAL_INTEGRATION=true OPENAI_API_KEY=... \
63
- mise run test -- testing/integration/runtime-real.test.ts
64
- ```