@goah/cli 0.13.0 → 0.13.1

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 (236) hide show
  1. package/dist/LICENSE +201 -0
  2. package/dist/THIRD-PARTY-NOTICES.md +2319 -0
  3. package/dist/anthropic-messages-WBFOHES5.js +7214 -0
  4. package/dist/azure-openai-responses-NZFH3PO6.js +253 -0
  5. package/dist/chunk-25XSBFX6.js +639 -0
  6. package/dist/chunk-2QBQZGXF.js +110 -0
  7. package/dist/chunk-2ZP2NBW3.js +345 -0
  8. package/dist/chunk-4KA63VNZ.js +2 -0
  9. package/dist/chunk-4M6TXTT5.js +86 -0
  10. package/dist/chunk-4US7ZHT3.js +20 -0
  11. package/dist/chunk-6M3OOCKO.js +11809 -0
  12. package/dist/chunk-7AXAFDPG.js +17 -0
  13. package/dist/chunk-BXA47DTF.js +548 -0
  14. package/dist/chunk-FSBUS2BI.js +26 -0
  15. package/dist/chunk-GKDRAHLI.js +4787 -0
  16. package/dist/chunk-H462EFJP.js +89 -0
  17. package/dist/chunk-IIJQ3DW4.js +35 -0
  18. package/dist/chunk-JQD5EWJY.js +34 -0
  19. package/dist/chunk-K26BVR6O.js +61 -0
  20. package/dist/chunk-KAO7WIXG.js +31 -0
  21. package/dist/chunk-LBKI23CC.js +9810 -0
  22. package/dist/chunk-LKBKZEHT.js +41 -0
  23. package/dist/chunk-MD7TLTXZ.js +18 -0
  24. package/dist/chunk-MPXK7QBL.js +868 -0
  25. package/dist/chunk-NRLGWZJC.js +11 -0
  26. package/dist/chunk-PFEV3HWI.js +1178 -0
  27. package/dist/chunk-QBD6EJ2Z.js +1746 -0
  28. package/dist/chunk-R6I3VKME.js +132 -0
  29. package/dist/chunk-TJON22J4.js +87 -0
  30. package/dist/chunk-ULY36ME4.js +33097 -0
  31. package/dist/chunk-VWEV4LTH.js +25 -0
  32. package/dist/chunk-X7UWW2PN.js +883 -0
  33. package/dist/chunk-XALZLRYK.js +9221 -0
  34. package/dist/chunk-XPQKM3L7.js +57 -0
  35. package/dist/chunk-YH6YJ2IB.js +1773 -0
  36. package/dist/cli.d.ts +0 -2
  37. package/dist/cli.js +13123 -580
  38. package/dist/console/assets/{index-Rtc_B7cs.js → index-B1vGMXKr.js} +11 -11
  39. package/dist/console/assets/{index-Rtc_B7cs.js.map → index-B1vGMXKr.js.map} +1 -1
  40. package/dist/console/index.html +1 -1
  41. package/dist/dist-65MDQA4Q.js +1126 -0
  42. package/dist/dist-KNR2XL6J.js +39 -0
  43. package/dist/execution.d.ts +557 -2
  44. package/dist/execution.js +37 -2
  45. package/dist/faux-runner-worker.js +128 -0
  46. package/dist/google-generative-ai-YMHXZSFE.js +422 -0
  47. package/dist/google-vertex-X6DB3ZQ6.js +471 -0
  48. package/dist/index.d.ts +853 -25
  49. package/dist/index.js +84 -385
  50. package/dist/kernel.d.ts +39 -2
  51. package/dist/kernel.js +21 -2
  52. package/dist/mistral-conversations-TY3MMD6G.js +718 -0
  53. package/dist/multipart-parser-F6M4NJZU.js +373 -0
  54. package/dist/openai-codex-responses-BRDUMLN5.js +1374 -0
  55. package/dist/openai-completions-CX634XN3.js +1139 -0
  56. package/dist/openai-responses-HMCXJIHT.js +300 -0
  57. package/dist/openrouter-images-KTWET2H2.js +148 -0
  58. package/dist/pi-messages-XL5OEC4K.js +307 -0
  59. package/dist/pi-worker.js +671 -0
  60. package/dist/runner-pi.d.ts +342 -2
  61. package/dist/runner-pi.js +46 -2
  62. package/dist/runner-registry-M776E3SE.js +22 -0
  63. package/dist/sqlite.d.ts +446 -2
  64. package/dist/sqlite.js +15 -2
  65. package/dist/src-F2KBSV4T.js +1398 -0
  66. package/dist/supervisor.d.ts +625 -2
  67. package/dist/supervisor.js +39 -2
  68. package/dist/testkit.d.ts +564 -2
  69. package/dist/testkit.js +127 -2
  70. package/dist/transcript.d.ts +84 -2
  71. package/dist/transcript.js +25 -2
  72. package/dist/verification-worker.js +72 -0
  73. package/package.json +2 -26
  74. package/dist/cli.d.ts.map +0 -1
  75. package/dist/cli.js.map +0 -1
  76. package/dist/control.d.ts +0 -106
  77. package/dist/control.d.ts.map +0 -1
  78. package/dist/control.js +0 -242
  79. package/dist/control.js.map +0 -1
  80. package/dist/execution.d.ts.map +0 -1
  81. package/dist/execution.js.map +0 -1
  82. package/dist/index.d.ts.map +0 -1
  83. package/dist/index.js.map +0 -1
  84. package/dist/kernel.d.ts.map +0 -1
  85. package/dist/kernel.js.map +0 -1
  86. package/dist/live-config.d.ts +0 -10
  87. package/dist/live-config.d.ts.map +0 -1
  88. package/dist/live-config.js +0 -44
  89. package/dist/live-config.js.map +0 -1
  90. package/dist/prompt-queue.d.ts +0 -13
  91. package/dist/prompt-queue.d.ts.map +0 -1
  92. package/dist/prompt-queue.js +0 -35
  93. package/dist/prompt-queue.js.map +0 -1
  94. package/dist/runner-pi.d.ts.map +0 -1
  95. package/dist/runner-pi.js.map +0 -1
  96. package/dist/runner-registry.d.ts +0 -8
  97. package/dist/runner-registry.d.ts.map +0 -1
  98. package/dist/runner-registry.js +0 -12
  99. package/dist/runner-registry.js.map +0 -1
  100. package/dist/searchable-select.d.ts +0 -24
  101. package/dist/searchable-select.d.ts.map +0 -1
  102. package/dist/searchable-select.js +0 -61
  103. package/dist/searchable-select.js.map +0 -1
  104. package/dist/secret-input.d.ts +0 -8
  105. package/dist/secret-input.d.ts.map +0 -1
  106. package/dist/secret-input.js +0 -14
  107. package/dist/secret-input.js.map +0 -1
  108. package/dist/setup-wizard.d.ts +0 -22
  109. package/dist/setup-wizard.d.ts.map +0 -1
  110. package/dist/setup-wizard.js +0 -154
  111. package/dist/setup-wizard.js.map +0 -1
  112. package/dist/sqlite.d.ts.map +0 -1
  113. package/dist/sqlite.js.map +0 -1
  114. package/dist/supervisor.d.ts.map +0 -1
  115. package/dist/supervisor.js.map +0 -1
  116. package/dist/testkit.d.ts.map +0 -1
  117. package/dist/testkit.js.map +0 -1
  118. package/dist/thread-inspect.d.ts +0 -47
  119. package/dist/thread-inspect.d.ts.map +0 -1
  120. package/dist/thread-inspect.js +0 -78
  121. package/dist/thread-inspect.js.map +0 -1
  122. package/dist/transcript.d.ts.map +0 -1
  123. package/dist/transcript.js.map +0 -1
  124. package/dist/tui-theme.d.ts +0 -17
  125. package/dist/tui-theme.d.ts.map +0 -1
  126. package/dist/tui-theme.js +0 -19
  127. package/dist/tui-theme.js.map +0 -1
  128. package/dist/tui.d.ts +0 -24
  129. package/dist/tui.d.ts.map +0 -1
  130. package/dist/tui.js +0 -784
  131. package/dist/tui.js.map +0 -1
  132. package/dist/update.d.ts +0 -16
  133. package/dist/update.d.ts.map +0 -1
  134. package/dist/update.js +0 -67
  135. package/dist/update.js.map +0 -1
  136. package/dist/web-console.d.ts +0 -33
  137. package/dist/web-console.d.ts.map +0 -1
  138. package/dist/web-console.js +0 -242
  139. package/dist/web-console.js.map +0 -1
  140. package/dist/welcome.d.ts +0 -30
  141. package/dist/welcome.d.ts.map +0 -1
  142. package/dist/welcome.js +0 -69
  143. package/dist/welcome.js.map +0 -1
  144. package/node_modules/goah-ledger-contract/dist/execution.d.ts +0 -544
  145. package/node_modules/goah-ledger-contract/dist/execution.d.ts.map +0 -1
  146. package/node_modules/goah-ledger-contract/dist/execution.js +0 -52
  147. package/node_modules/goah-ledger-contract/dist/execution.js.map +0 -1
  148. package/node_modules/goah-ledger-contract/dist/index.d.ts +0 -4
  149. package/node_modules/goah-ledger-contract/dist/index.d.ts.map +0 -1
  150. package/node_modules/goah-ledger-contract/dist/index.js +0 -4
  151. package/node_modules/goah-ledger-contract/dist/index.js.map +0 -1
  152. package/node_modules/goah-ledger-contract/dist/kernel.d.ts +0 -37
  153. package/node_modules/goah-ledger-contract/dist/kernel.d.ts.map +0 -1
  154. package/node_modules/goah-ledger-contract/dist/kernel.js +0 -8
  155. package/node_modules/goah-ledger-contract/dist/kernel.js.map +0 -1
  156. package/node_modules/goah-ledger-contract/dist/transcript.d.ts +0 -63
  157. package/node_modules/goah-ledger-contract/dist/transcript.d.ts.map +0 -1
  158. package/node_modules/goah-ledger-contract/dist/transcript.js +0 -115
  159. package/node_modules/goah-ledger-contract/dist/transcript.js.map +0 -1
  160. package/node_modules/goah-ledger-contract/package.json +0 -28
  161. package/node_modules/goah-ledger-sqlite/dist/index.d.ts +0 -86
  162. package/node_modules/goah-ledger-sqlite/dist/index.d.ts.map +0 -1
  163. package/node_modules/goah-ledger-sqlite/dist/index.js +0 -1254
  164. package/node_modules/goah-ledger-sqlite/dist/index.js.map +0 -1
  165. package/node_modules/goah-ledger-sqlite/package.json +0 -26
  166. package/node_modules/goah-runner-pi/dist/configurator.d.ts +0 -20
  167. package/node_modules/goah-runner-pi/dist/configurator.d.ts.map +0 -1
  168. package/node_modules/goah-runner-pi/dist/configurator.js +0 -423
  169. package/node_modules/goah-runner-pi/dist/configurator.js.map +0 -1
  170. package/node_modules/goah-runner-pi/dist/credential-store.d.ts +0 -14
  171. package/node_modules/goah-runner-pi/dist/credential-store.d.ts.map +0 -1
  172. package/node_modules/goah-runner-pi/dist/credential-store.js +0 -163
  173. package/node_modules/goah-runner-pi/dist/credential-store.js.map +0 -1
  174. package/node_modules/goah-runner-pi/dist/env-spec.d.ts +0 -17
  175. package/node_modules/goah-runner-pi/dist/env-spec.d.ts.map +0 -1
  176. package/node_modules/goah-runner-pi/dist/env-spec.js +0 -95
  177. package/node_modules/goah-runner-pi/dist/env-spec.js.map +0 -1
  178. package/node_modules/goah-runner-pi/dist/index.d.ts +0 -76
  179. package/node_modules/goah-runner-pi/dist/index.d.ts.map +0 -1
  180. package/node_modules/goah-runner-pi/dist/index.js +0 -326
  181. package/node_modules/goah-runner-pi/dist/index.js.map +0 -1
  182. package/node_modules/goah-runner-pi/dist/model-provider.d.ts +0 -30
  183. package/node_modules/goah-runner-pi/dist/model-provider.d.ts.map +0 -1
  184. package/node_modules/goah-runner-pi/dist/model-provider.js +0 -96
  185. package/node_modules/goah-runner-pi/dist/model-provider.js.map +0 -1
  186. package/node_modules/goah-runner-pi/dist/pi-worker.d.ts +0 -31
  187. package/node_modules/goah-runner-pi/dist/pi-worker.d.ts.map +0 -1
  188. package/node_modules/goah-runner-pi/dist/pi-worker.js +0 -579
  189. package/node_modules/goah-runner-pi/dist/pi-worker.js.map +0 -1
  190. package/node_modules/goah-runner-pi/dist/steering-no-ack.test-fixture.d.ts +0 -2
  191. package/node_modules/goah-runner-pi/dist/steering-no-ack.test-fixture.d.ts.map +0 -1
  192. package/node_modules/goah-runner-pi/dist/steering-no-ack.test-fixture.js +0 -3
  193. package/node_modules/goah-runner-pi/dist/steering-no-ack.test-fixture.js.map +0 -1
  194. package/node_modules/goah-runner-pi/dist/steering-reject.test-fixture.d.ts +0 -2
  195. package/node_modules/goah-runner-pi/dist/steering-reject.test-fixture.d.ts.map +0 -1
  196. package/node_modules/goah-runner-pi/dist/steering-reject.test-fixture.js +0 -5
  197. package/node_modules/goah-runner-pi/dist/steering-reject.test-fixture.js.map +0 -1
  198. package/node_modules/goah-runner-pi/dist/steering-worker.test-fixture.d.ts +0 -2
  199. package/node_modules/goah-runner-pi/dist/steering-worker.test-fixture.d.ts.map +0 -1
  200. package/node_modules/goah-runner-pi/dist/steering-worker.test-fixture.js +0 -5
  201. package/node_modules/goah-runner-pi/dist/steering-worker.test-fixture.js.map +0 -1
  202. package/node_modules/goah-runner-pi/dist/test-helpers.d.ts +0 -4
  203. package/node_modules/goah-runner-pi/dist/test-helpers.d.ts.map +0 -1
  204. package/node_modules/goah-runner-pi/dist/test-helpers.js +0 -13
  205. package/node_modules/goah-runner-pi/dist/test-helpers.js.map +0 -1
  206. package/node_modules/goah-runner-pi/dist/verification-worker.d.ts +0 -2
  207. package/node_modules/goah-runner-pi/dist/verification-worker.d.ts.map +0 -1
  208. package/node_modules/goah-runner-pi/dist/verification-worker.js +0 -46
  209. package/node_modules/goah-runner-pi/dist/verification-worker.js.map +0 -1
  210. package/node_modules/goah-runner-pi/package.json +0 -28
  211. package/node_modules/goah-supervisor/dist/context-view.d.ts +0 -30
  212. package/node_modules/goah-supervisor/dist/context-view.d.ts.map +0 -1
  213. package/node_modules/goah-supervisor/dist/context-view.js +0 -58
  214. package/node_modules/goah-supervisor/dist/context-view.js.map +0 -1
  215. package/node_modules/goah-supervisor/dist/index.d.ts +0 -96
  216. package/node_modules/goah-supervisor/dist/index.d.ts.map +0 -1
  217. package/node_modules/goah-supervisor/dist/index.js +0 -1075
  218. package/node_modules/goah-supervisor/dist/index.js.map +0 -1
  219. package/node_modules/goah-supervisor/dist/roles.d.ts +0 -4
  220. package/node_modules/goah-supervisor/dist/roles.d.ts.map +0 -1
  221. package/node_modules/goah-supervisor/dist/roles.js +0 -29
  222. package/node_modules/goah-supervisor/dist/roles.js.map +0 -1
  223. package/node_modules/goah-supervisor/dist/verification.d.ts +0 -61
  224. package/node_modules/goah-supervisor/dist/verification.d.ts.map +0 -1
  225. package/node_modules/goah-supervisor/dist/verification.js +0 -135
  226. package/node_modules/goah-supervisor/dist/verification.js.map +0 -1
  227. package/node_modules/goah-supervisor/package.json +0 -26
  228. package/node_modules/goah-testkit/dist/faux-runner-worker.d.ts +0 -2
  229. package/node_modules/goah-testkit/dist/faux-runner-worker.d.ts.map +0 -1
  230. package/node_modules/goah-testkit/dist/faux-runner-worker.js +0 -82
  231. package/node_modules/goah-testkit/dist/faux-runner-worker.js.map +0 -1
  232. package/node_modules/goah-testkit/dist/index.d.ts +0 -49
  233. package/node_modules/goah-testkit/dist/index.d.ts.map +0 -1
  234. package/node_modules/goah-testkit/dist/index.js +0 -96
  235. package/node_modules/goah-testkit/dist/index.js.map +0 -1
  236. package/node_modules/goah-testkit/package.json +0 -29
package/dist/testkit.d.ts CHANGED
@@ -1,2 +1,564 @@
1
- export * from "goah-testkit";
2
- //# sourceMappingURL=testkit.d.ts.map
1
+ import { DatabaseSync } from 'node:sqlite';
2
+
3
+ type JsonPrimitive = string | number | boolean | null;
4
+ type JsonValue = JsonPrimitive | JsonValue[] | {
5
+ [key: string]: JsonValue;
6
+ };
7
+ /** One append request. Sequence numbers are assigned by the ledger. */
8
+ interface EventInput {
9
+ streamId: string;
10
+ ts: string;
11
+ actor: string;
12
+ type: string;
13
+ data: JsonValue;
14
+ /** An unfamiliar reader may skip this event without changing replay semantics. */
15
+ ignorable?: true;
16
+ }
17
+ /** One immutable fact in the global ledger and in one logical stream. */
18
+ interface EventRecord extends EventInput {
19
+ seq: number;
20
+ streamSeq: number;
21
+ }
22
+ interface EventStore {
23
+ appendEvent(input: EventInput): EventRecord;
24
+ appendEvents(inputs: EventInput[]): EventRecord[];
25
+ readStream(streamId: string, fromStreamSeq?: number): EventRecord[];
26
+ eventsSince(seq: number, types?: string[]): EventRecord[];
27
+ events(): EventRecord[];
28
+ }
29
+ interface Clock {
30
+ now(): Date;
31
+ }
32
+
33
+ type WakeStatus = "queued" | "claimed" | "consumed" | "cancelled";
34
+ type WakeTriggerStatus = "pending" | "resolved";
35
+ type ScheduleStatus = "pending" | "consumed" | "cancelled" | "superseded";
36
+ type GoalPhase = "active" | "paused" | "blocked" | "complete";
37
+ type TurnStatus = "in_progress" | "completed" | "failed" | "interrupted";
38
+ type TurnTriggerKind = "user_message" | "wake";
39
+ type SpecialistRole = "verifier" | "audit";
40
+ type AgentRole = "child" | "ceo" | "verifier" | "audit";
41
+ type AutomaticTarget = {
42
+ targetKind: "goal";
43
+ agent: string;
44
+ goalId: string;
45
+ specialistRole: null;
46
+ } | {
47
+ targetKind: "specialist";
48
+ agent: string;
49
+ goalId: null;
50
+ specialistRole: SpecialistRole;
51
+ };
52
+ type MailRoute = {
53
+ routeKind: "goal";
54
+ goalId: string;
55
+ specialistRole: null;
56
+ } | {
57
+ routeKind: "human_inbox";
58
+ goalId: null;
59
+ specialistRole: null;
60
+ } | {
61
+ routeKind: "human_request";
62
+ goalId: null;
63
+ specialistRole: null;
64
+ } | {
65
+ routeKind: "specialist_inbox";
66
+ goalId: null;
67
+ specialistRole: SpecialistRole;
68
+ };
69
+ type TurnItemType = "user_message" | "assistant_message" | "reasoning" | "tool_call" | "tool_result" | "plan" | "handoff";
70
+ type TurnItemStatus = "in_progress" | "completed" | "failed";
71
+ interface ThreadSnapshot {
72
+ id: string;
73
+ agent: string;
74
+ role: AgentRole;
75
+ parentThreadId: string | null;
76
+ createdAt: string;
77
+ updatedAt: string;
78
+ }
79
+ interface GoalCommitment {
80
+ goalId: string;
81
+ goalRevision: number;
82
+ }
83
+ type TurnSnapshot = {
84
+ id: string;
85
+ threadId: string;
86
+ triggerKind: TurnTriggerKind;
87
+ goalId: string | null;
88
+ goalRevision: number | null;
89
+ status: TurnStatus;
90
+ attempt: number;
91
+ error: JsonValue | null;
92
+ startedAt: string;
93
+ endedAt: string | null;
94
+ leaseUntil: string | null;
95
+ leaseToken: string | null;
96
+ runnerPid: number | null;
97
+ runnerProfileId?: string;
98
+ };
99
+ interface TurnItemSnapshot {
100
+ id: string;
101
+ turnId: string;
102
+ ordinal: number;
103
+ type: TurnItemType;
104
+ status: TurnItemStatus;
105
+ data: JsonValue;
106
+ createdAt: string;
107
+ completedAt: string | null;
108
+ }
109
+ interface GoalSnapshot {
110
+ id: string;
111
+ parentId: string | null;
112
+ objective: string;
113
+ observationMethod: string | null;
114
+ verificationMethod: string | null;
115
+ owner: string;
116
+ phase: GoalPhase;
117
+ revision: number;
118
+ }
119
+ type GoalChangeOperation = "create" | "revise" | "pause" | "resume" | "block" | "complete" | "reassign";
120
+ type GoalChangeAuthority = {
121
+ kind: "human";
122
+ } | {
123
+ kind: "parent_goal";
124
+ goalId: string;
125
+ goalRevision: number;
126
+ } | {
127
+ kind: "system";
128
+ reason: string;
129
+ };
130
+ interface GoalChangeMetadata {
131
+ operation: GoalChangeOperation;
132
+ reason: string;
133
+ evidence: number[];
134
+ authority?: GoalChangeAuthority;
135
+ sourceTurnId?: string;
136
+ sourceWakeId?: string;
137
+ idempotencyKey?: string;
138
+ }
139
+ interface WorkRecordSnapshot {
140
+ goalId: string;
141
+ recordRevision: number;
142
+ goalRevision: number;
143
+ content: string;
144
+ updatedBy: string;
145
+ updatedInTurn: string;
146
+ sourceWakeId: string | null;
147
+ updatedAt: string;
148
+ reason: string;
149
+ evidence: number[];
150
+ lastEventSeq: number;
151
+ }
152
+ interface WorkRecordUpdateRequest {
153
+ goalId: string;
154
+ expectedRevision: number;
155
+ goalRevision: number;
156
+ content: string;
157
+ reason: string;
158
+ evidence: number[];
159
+ turnId: string;
160
+ sourceWakeId?: string;
161
+ }
162
+ interface WorkRecordDiff {
163
+ goalId: string;
164
+ fromRevision: number;
165
+ toRevision: number;
166
+ text: string;
167
+ }
168
+ type ScheduleSnapshot = AutomaticTarget & {
169
+ id: string;
170
+ nextWakeAt: string;
171
+ reason: string;
172
+ setBy: string;
173
+ status: ScheduleStatus;
174
+ resolvedAt: string | null;
175
+ };
176
+ type WakeSnapshot = AutomaticTarget & {
177
+ id: string;
178
+ /** Initial trigger retained for display and provenance. Runtime decisions use WakeTriggerSnapshot. */
179
+ triggerRef: string;
180
+ status: WakeStatus;
181
+ attempt: number;
182
+ enqueuedSeq: number;
183
+ claimedAt: string | null;
184
+ consumedAt: string | null;
185
+ turnId: string | null;
186
+ };
187
+ interface WakeTriggerSnapshot {
188
+ wakeId: string;
189
+ agent: string;
190
+ triggerRef: string;
191
+ source: "goal" | "system";
192
+ status: WakeTriggerStatus;
193
+ addedAt: string;
194
+ resolvedAt: string | null;
195
+ }
196
+ type MailLevel = "fyi" | "decision" | "emergency";
197
+ type MailSnapshot = MailRoute & {
198
+ id: string;
199
+ to: string;
200
+ from: string;
201
+ level: MailLevel;
202
+ body: JsonValue;
203
+ readAt: string | null;
204
+ };
205
+ interface DelegationRequest {
206
+ id: string;
207
+ parentGoalId: string;
208
+ expectedParentRevision: number;
209
+ childGoal: {
210
+ id: string;
211
+ objective: string;
212
+ observationMethod: string;
213
+ verificationMethod: string;
214
+ owner: string;
215
+ };
216
+ brief: JsonValue;
217
+ reason: string;
218
+ evidence: number[];
219
+ sourceTurnId?: string;
220
+ }
221
+ interface DelegationResult {
222
+ delegationId: string;
223
+ goal: GoalSnapshot;
224
+ mail: MailSnapshot;
225
+ wake: WakeSnapshot;
226
+ }
227
+ interface ReassignmentRequest {
228
+ id: string;
229
+ goalId: string;
230
+ expectedGoalRevision: number;
231
+ newOwner: string;
232
+ brief: JsonValue;
233
+ reason: string;
234
+ evidence: number[];
235
+ sourceTurnId?: string;
236
+ }
237
+ interface ReassignmentResult {
238
+ reassignmentId: string;
239
+ goal: GoalSnapshot;
240
+ mail: MailSnapshot[];
241
+ wake: WakeSnapshot | null;
242
+ }
243
+ interface GoalCompletionRequest {
244
+ goalId: string;
245
+ revision: number;
246
+ reason: string;
247
+ evidence: number[];
248
+ sourceTurnId?: string;
249
+ }
250
+ type GoalOutcome = "progress" | "waiting" | "blocked" | "completion_proposed";
251
+ interface AgentHandoff {
252
+ outcome: GoalOutcome;
253
+ evidence: number[];
254
+ }
255
+ interface GoalHandoff extends AgentHandoff {
256
+ goalId: string;
257
+ goalRevision: number;
258
+ recordRevision: number;
259
+ }
260
+ interface HandoffValidationIssue {
261
+ code: string;
262
+ message: string;
263
+ details?: JsonValue;
264
+ }
265
+ type HandoffValidationResult = {
266
+ accepted: true;
267
+ fatal: false;
268
+ attemptId: number;
269
+ token: string;
270
+ goalId: string;
271
+ goalRevision: number;
272
+ } | {
273
+ accepted: false;
274
+ fatal: boolean;
275
+ attemptId: number;
276
+ issues: HandoffValidationIssue[];
277
+ };
278
+ interface CommittedTurnOutput {
279
+ handoff: GoalHandoff;
280
+ }
281
+ interface RunnerTraceEvent {
282
+ type: string;
283
+ data: JsonValue;
284
+ }
285
+ type AgentCapability = "ledger.search" | "mail.send" | "schedule.set" | "goal.put" | "team.list" | "goal.get" | "goal.create" | "goal.work" | "goal.delegate" | "goal.reassign" | "goal.revise" | "goal.pause" | "goal.resume" | "goal.complete" | "human.request" | "work_record.list" | "work_record.read" | "work_record.history" | "work_record.diff" | "work_record.search" | "work_record.update" | "memory.append";
286
+ type RunnerControlMethod = "goal.handoff.validate";
287
+ type RunnerRpcMethod = AgentCapability | RunnerControlMethod;
288
+ type TurnTrigger = {
289
+ kind: "user_message";
290
+ } | {
291
+ kind: "wake";
292
+ reasons: string[];
293
+ };
294
+ interface TurnContext {
295
+ trigger: TurnTrigger;
296
+ activeGoal: GoalSnapshot | null;
297
+ goalCommitment: GoalCommitment | null;
298
+ }
299
+ interface AssistantResponse {
300
+ content: string;
301
+ }
302
+ interface RunRequest {
303
+ agent: string;
304
+ execution: TurnSnapshot;
305
+ sourceWake?: WakeSnapshot;
306
+ sourceWakeTriggers?: WakeTriggerSnapshot[];
307
+ turn: TurnContext;
308
+ context: JsonValue;
309
+ now(): string;
310
+ emit(event: RunnerTraceEvent): void;
311
+ rpc?(method: RunnerRpcMethod, params: JsonValue): Promise<JsonValue>;
312
+ }
313
+ interface HandoffCommit {
314
+ agent: string;
315
+ turnId: string;
316
+ sourceWakeId: string | null;
317
+ mailIds: string[];
318
+ ts: string;
319
+ output: CommittedTurnOutput;
320
+ responseItemId: string;
321
+ item: TurnItemSnapshot;
322
+ }
323
+ interface HumanTurnAdmissionRequest {
324
+ thread: ThreadSnapshot;
325
+ turn: TurnSnapshot;
326
+ messageItem: TurnItemSnapshot;
327
+ replaceTurnId: string | null;
328
+ rootGoal?: GoalSnapshot;
329
+ }
330
+ interface HumanTurnAdmissionResult {
331
+ turn: TurnSnapshot;
332
+ replacedTurn: TurnSnapshot | null;
333
+ goal: GoalSnapshot | null;
334
+ }
335
+ /** Standard execution modules composed on top of the generic event store. */
336
+ interface Ledger extends EventStore {
337
+ putThread(thread: ThreadSnapshot, actor: string): EventRecord;
338
+ putTurn(turn: TurnSnapshot, actor: string): EventRecord;
339
+ admitHumanTurn(request: HumanTurnAdmissionRequest): HumanTurnAdmissionResult;
340
+ commitTurnToGoal(turnId: string, goal: GoalCommitment, actor: string): TurnSnapshot;
341
+ putTurnItem(item: TurnItemSnapshot, actor: string): EventRecord;
342
+ thread(id: string): ThreadSnapshot | null;
343
+ threads(): ThreadSnapshot[];
344
+ turn(id: string): TurnSnapshot | null;
345
+ turns(threadId?: string): TurnSnapshot[];
346
+ turnItems(turnId: string): TurnItemSnapshot[];
347
+ activeTurn(threadId: string): TurnSnapshot | null;
348
+ putGoal(goal: GoalSnapshot, actor: string, wakeId?: string, change?: GoalChangeMetadata): EventRecord;
349
+ updateWorkRecord(request: WorkRecordUpdateRequest, actor: string): WorkRecordSnapshot;
350
+ commitDelegation(request: DelegationRequest, actor: string, wakeId?: string): DelegationResult;
351
+ commitReassignment(request: ReassignmentRequest, actor: string, wakeId?: string): ReassignmentResult;
352
+ completeGoal(request: GoalCompletionRequest, actor: string, wakeId?: string): GoalSnapshot;
353
+ putSchedule(schedule: ScheduleSnapshot, actor: string, wakeId?: string): EventRecord;
354
+ consumeSchedule(id: string, wake: WakeSnapshot, now: string): {
355
+ schedule: ScheduleSnapshot;
356
+ wake: WakeSnapshot;
357
+ };
358
+ cancelSchedule(id: string, now: string): ScheduleSnapshot;
359
+ supersedeSchedule(id: string, now: string): ScheduleSnapshot;
360
+ enqueueWake(wake: WakeSnapshot, actor: string): {
361
+ event: EventRecord;
362
+ created: boolean;
363
+ };
364
+ addWakeTrigger(wakeId: string, triggerRef: string, actor: string): WakeTriggerSnapshot;
365
+ claimNextWake(now: string): WakeSnapshot | null;
366
+ startTurnFromWake(id: string, turn: TurnSnapshot, now: string): WakeSnapshot;
367
+ releaseWake(id: string, now: string): WakeSnapshot;
368
+ cancelWake(id: string, now: string): WakeSnapshot;
369
+ attachTurnProcess(id: string, leaseToken: string, pid: number): TurnSnapshot;
370
+ renewTurnLease(id: string, leaseToken: string, leaseUntil: string, now: string): TurnSnapshot;
371
+ appendTurnEvent(input: EventInput, leaseToken: string): EventRecord;
372
+ repairTurnAttempt(id: string, reason: string, now: string, actor: string): TurnItemSnapshot[];
373
+ finishTurn(id: string, status: "completed" | "failed" | "interrupted", error: JsonValue | null, now: string, actor: string, mailIds?: string[]): TurnSnapshot;
374
+ releaseTurnProcess(id: string, actor: string): TurnSnapshot;
375
+ putMail(mail: MailSnapshot, actor: string, wakeId?: string): EventRecord;
376
+ putMails(mail: MailSnapshot[], actor: string, wakeId?: string): EventRecord[];
377
+ commitHandoff(commit: HandoffCommit): EventRecord;
378
+ dueSchedules(now: string): ScheduleSnapshot[];
379
+ unreadMail(agent: string): MailSnapshot[];
380
+ lastEvent(actor: string, type: string): EventRecord | null;
381
+ lastGoalHandoff(goalId: string): EventRecord | null;
382
+ latestEvent(): EventRecord | null;
383
+ eventsForWake(wakeId: string): EventRecord[];
384
+ wake(id: string): WakeSnapshot | null;
385
+ wakeByTrigger(agent: string, triggerRef: string): WakeSnapshot | null;
386
+ wakeTriggers(wakeId: string): WakeTriggerSnapshot[];
387
+ wakeTriggersForAgent(agent: string): WakeTriggerSnapshot[];
388
+ queuedWakeForAgent(agent: string): WakeSnapshot | null;
389
+ goalsForOwner(owner: string): GoalSnapshot[];
390
+ goal(id: string): GoalSnapshot | null;
391
+ workRecord(goalId: string): WorkRecordSnapshot | null;
392
+ workRecordHistory(goalId: string): WorkRecordSnapshot[];
393
+ workRecordDiff(goalId: string, fromRevision: number, toRevision: number): WorkRecordDiff;
394
+ searchWorkRecords(query: string, limit?: number): WorkRecordSnapshot[];
395
+ triggeringMail(): MailSnapshot[];
396
+ searchEvents(query: string, limit?: number): EventRecord[];
397
+ goals(): GoalSnapshot[];
398
+ workRecords(): WorkRecordSnapshot[];
399
+ schedules(): ScheduleSnapshot[];
400
+ wakes(): WakeSnapshot[];
401
+ mailbox(): MailSnapshot[];
402
+ rebuildProjections(): void;
403
+ close(): void;
404
+ }
405
+
406
+ type FaultPoint = "after_event_before_projection" | "after_delegation_event" | "after_reassignment_event" | "after_human_goal_before_turn" | "after_human_replacement_before_turn";
407
+ type FaultInjector = (point: FaultPoint) => void;
408
+ interface SqliteLedgerOptions {
409
+ faultInjector?: FaultInjector;
410
+ clock?: Clock;
411
+ busyTimeoutMs?: number;
412
+ }
413
+ declare class SqliteLedger implements Ledger {
414
+ #private;
415
+ readonly db: DatabaseSync;
416
+ constructor(path?: string, options?: SqliteLedgerOptions);
417
+ close(): void;
418
+ appendEvent(input: EventInput): EventRecord;
419
+ appendEvents(inputs: EventInput[]): EventRecord[];
420
+ readStream(streamId: string, fromStreamSeq?: number): EventRecord[];
421
+ putThread(thread: ThreadSnapshot, actor: string): EventRecord;
422
+ putTurn(turn: TurnSnapshot, actor: string): EventRecord;
423
+ admitHumanTurn(request: HumanTurnAdmissionRequest): HumanTurnAdmissionResult;
424
+ commitTurnToGoal(turnId: string, binding: {
425
+ goalId: string;
426
+ goalRevision: number;
427
+ }, actor: string): TurnSnapshot;
428
+ putTurnItem(item: TurnItemSnapshot, actor: string): EventRecord;
429
+ thread(id: string): ThreadSnapshot | null;
430
+ threads(): ThreadSnapshot[];
431
+ turn(id: string): TurnSnapshot | null;
432
+ turns(threadId?: string): TurnSnapshot[];
433
+ turnItems(turnId: string): TurnItemSnapshot[];
434
+ activeTurn(threadId: string): TurnSnapshot | null;
435
+ putGoal(goal: GoalSnapshot, actor: string, wakeId?: string, change?: GoalChangeMetadata): EventRecord;
436
+ updateWorkRecord(request: WorkRecordUpdateRequest, actor: string): WorkRecordSnapshot;
437
+ commitDelegation(request: DelegationRequest, actor: string, wakeId?: string): DelegationResult;
438
+ commitReassignment(request: ReassignmentRequest, actor: string, wakeId?: string): ReassignmentResult;
439
+ completeGoal(request: GoalCompletionRequest, actor: string, wakeId?: string): GoalSnapshot;
440
+ putSchedule(value: ScheduleSnapshot, actor: string, wakeId?: string): EventRecord;
441
+ consumeSchedule(id: string, wake: WakeSnapshot, now: string): {
442
+ schedule: ScheduleSnapshot;
443
+ wake: WakeSnapshot;
444
+ };
445
+ cancelSchedule(id: string, now: string): ScheduleSnapshot;
446
+ supersedeSchedule(id: string, now: string): ScheduleSnapshot;
447
+ enqueueWake(input: WakeSnapshot, actor: string): {
448
+ event: EventRecord;
449
+ created: boolean;
450
+ };
451
+ addWakeTrigger(wakeId: string, triggerRef: string, actor: string): WakeTriggerSnapshot;
452
+ claimNextWake(now: string): WakeSnapshot | null;
453
+ startTurnFromWake(id: string, turn: TurnSnapshot, now: string): WakeSnapshot;
454
+ releaseWake(id: string, now: string): WakeSnapshot;
455
+ cancelWake(id: string, now: string): WakeSnapshot;
456
+ attachTurnProcess(id: string, leaseToken: string, pid: number): TurnSnapshot;
457
+ renewTurnLease(id: string, leaseToken: string, leaseUntil: string, now: string): TurnSnapshot;
458
+ appendTurnEvent(input: EventInput, leaseToken: string): EventRecord;
459
+ repairTurnAttempt(id: string, reason: string, now: string, actor: string): TurnItemSnapshot[];
460
+ finishTurn(id: string, status: "completed" | "failed" | "interrupted", error: JsonValue | null, now: string, actor: string, mailIds?: string[]): TurnSnapshot;
461
+ releaseTurnProcess(id: string, actor: string): TurnSnapshot;
462
+ putMail(mail: MailSnapshot, actor: string, wakeId?: string): EventRecord;
463
+ putMails(mails: MailSnapshot[], actor: string, wakeId?: string): EventRecord[];
464
+ commitHandoff(commit: HandoffCommit): EventRecord;
465
+ dueSchedules(now: string): ScheduleSnapshot[];
466
+ unreadMail(agent: string): MailSnapshot[];
467
+ lastEvent(actor: string, type: string): EventRecord | null;
468
+ lastGoalHandoff(goalId: string): EventRecord | null;
469
+ latestEvent(): EventRecord | null;
470
+ eventsForWake(wakeId: string): EventRecord[];
471
+ wake(id: string): WakeSnapshot | null;
472
+ wakeByTrigger(agent: string, triggerRef: string): WakeSnapshot | null;
473
+ wakeTriggers(wakeId: string): WakeTriggerSnapshot[];
474
+ wakeTriggersForAgent(agent: string): WakeTriggerSnapshot[];
475
+ queuedWakeForAgent(agent: string): WakeSnapshot | null;
476
+ goalsForOwner(owner: string): GoalSnapshot[];
477
+ goal(id: string): GoalSnapshot | null;
478
+ workRecord(goalId: string): WorkRecordSnapshot | null;
479
+ workRecordHistory(goalId: string): WorkRecordSnapshot[];
480
+ workRecordDiff(goalId: string, fromRevision: number, toRevision: number): WorkRecordDiff;
481
+ searchWorkRecords(query: string, limit?: number): WorkRecordSnapshot[];
482
+ triggeringMail(): MailSnapshot[];
483
+ eventsSince(seq: number, types?: string[]): EventRecord[];
484
+ searchEvents(query: string, limit?: number): EventRecord[];
485
+ events(): EventRecord[];
486
+ goals(): GoalSnapshot[];
487
+ workRecords(): WorkRecordSnapshot[];
488
+ schedules(): ScheduleSnapshot[];
489
+ wakes(): WakeSnapshot[];
490
+ mailbox(): MailSnapshot[];
491
+ rebuildProjections(): void;
492
+ }
493
+
494
+ interface PiStep {
495
+ trace?: Array<{
496
+ type: string;
497
+ data: JsonValue;
498
+ }>;
499
+ response?: AssistantResponse;
500
+ handoff?: {
501
+ response: AssistantResponse;
502
+ handoff: AgentHandoff;
503
+ };
504
+ stopped?: boolean;
505
+ }
506
+ interface PiRunnerSession {
507
+ step(): Promise<PiStep>;
508
+ feedback(validation: Exclude<HandoffValidationResult, {
509
+ accepted: true;
510
+ }>): Promise<void>;
511
+ close(): Promise<void>;
512
+ }
513
+ interface PiDriver {
514
+ createRunnerSession(request: RunRequest): Promise<PiRunnerSession>;
515
+ }
516
+
517
+ declare class SimulatedClock implements Clock {
518
+ #private;
519
+ constructor(value?: string);
520
+ now(): Date;
521
+ advance(ms: number): void;
522
+ set(value: string): void;
523
+ }
524
+ declare function createMemoryLedger(options?: SqliteLedgerOptions): SqliteLedger;
525
+ interface FauxStep {
526
+ advanceMs?: number;
527
+ trace?: Array<{
528
+ type: string;
529
+ data: JsonValue;
530
+ }>;
531
+ response?: string;
532
+ write?: {
533
+ path: string;
534
+ content: string;
535
+ };
536
+ handoff?: {
537
+ response: {
538
+ content: string;
539
+ };
540
+ handoff: AgentHandoff;
541
+ };
542
+ stop?: boolean;
543
+ crash?: string;
544
+ effect?: (request: RunRequest, feedback: Exclude<HandoffValidationResult, {
545
+ accepted: true;
546
+ }> | null) => void;
547
+ }
548
+ declare class FauxPiDriver implements PiDriver {
549
+ #private;
550
+ readonly clock: SimulatedClock;
551
+ readonly directory: string;
552
+ readonly requests: RunRequest[];
553
+ constructor(clock: SimulatedClock, runnerSessions: FauxStep[][], directory?: string);
554
+ createRunnerSession(request: RunRequest): Promise<PiRunnerSession>;
555
+ }
556
+ declare function fauxRunnerWorkerPath(): string;
557
+ interface LedgerConformanceFactory {
558
+ (clock: Clock): Ledger;
559
+ }
560
+ /** Public, storage-independent contract checks for third-party Ledger implementations. */
561
+ declare function assertLedgerConformance(create: LedgerConformanceFactory): void;
562
+
563
+ export { FauxPiDriver, SimulatedClock, assertLedgerConformance, createMemoryLedger, fauxRunnerWorkerPath };
564
+ export type { FauxStep, LedgerConformanceFactory };
package/dist/testkit.js CHANGED
@@ -1,2 +1,127 @@
1
- export * from "goah-testkit";
2
- //# sourceMappingURL=testkit.js.map
1
+ import { createRequire as __goahCreateRequire } from "node:module";
2
+ const require = __goahCreateRequire(import.meta.url);
3
+ import {
4
+ SqliteLedger
5
+ } from "./chunk-YH6YJ2IB.js";
6
+ import "./chunk-4KA63VNZ.js";
7
+ import "./chunk-KAO7WIXG.js";
8
+ import "./chunk-R6I3VKME.js";
9
+ import {
10
+ specialistAutomaticTarget
11
+ } from "./chunk-TJON22J4.js";
12
+ import "./chunk-XPQKM3L7.js";
13
+
14
+ // node_modules/goah-testkit/dist/index.js
15
+ import { mkdirSync, writeFileSync } from "node:fs";
16
+ import { dirname, join } from "node:path";
17
+ import { fileURLToPath } from "node:url";
18
+ var SimulatedClock = class {
19
+ #value;
20
+ constructor(value = "2026-08-18T00:00:00.000Z") {
21
+ this.#value = new Date(value);
22
+ }
23
+ now() {
24
+ return new Date(this.#value);
25
+ }
26
+ advance(ms) {
27
+ this.#value = new Date(this.#value.getTime() + ms);
28
+ }
29
+ set(value) {
30
+ this.#value = new Date(value);
31
+ }
32
+ };
33
+ function createMemoryLedger(options = {}) {
34
+ return new SqliteLedger(":memory:", options);
35
+ }
36
+ var FauxPiDriver = class {
37
+ clock;
38
+ directory;
39
+ requests = [];
40
+ #runnerSessions;
41
+ constructor(clock, runnerSessions, directory = process.cwd()) {
42
+ this.clock = clock;
43
+ this.directory = directory;
44
+ this.#runnerSessions = runnerSessions.map((steps) => [...steps]);
45
+ }
46
+ async createRunnerSession(request) {
47
+ this.requests.push(request);
48
+ const steps = this.#runnerSessions.shift() ?? [];
49
+ let validationFeedback = null;
50
+ return {
51
+ step: async () => {
52
+ const step = steps.shift();
53
+ if (!step)
54
+ return { stopped: true };
55
+ if (step.advanceMs)
56
+ this.clock.advance(step.advanceMs);
57
+ if (step.write) {
58
+ const path = join(this.directory, step.write.path);
59
+ mkdirSync(dirname(path), { recursive: true });
60
+ writeFileSync(path, step.write.content);
61
+ }
62
+ const feedback = validationFeedback;
63
+ validationFeedback = null;
64
+ step.effect?.(request, feedback);
65
+ if (step.crash)
66
+ throw new Error(step.crash);
67
+ return { ...step.trace ? { trace: step.trace } : {}, ...step.response !== void 0 ? { response: { content: step.response } } : {}, ...step.handoff ? { handoff: step.handoff } : {}, ...step.stop ? { stopped: true } : {} };
68
+ },
69
+ feedback: async (value) => {
70
+ validationFeedback = value;
71
+ },
72
+ close: async () => void 0
73
+ };
74
+ }
75
+ };
76
+ function fauxRunnerWorkerPath() {
77
+ return fileURLToPath(new URL("./faux-runner-worker.js", import.meta.url));
78
+ }
79
+ function assertLedgerConformance(create) {
80
+ const clock = new SimulatedClock("2030-01-01T00:00:00.000Z");
81
+ const ledger = create(clock);
82
+ const observationMethod = "Use the conformance evidence event as the completion observation.";
83
+ ledger.putGoal({ id: "root", parentId: null, objective: "test", observationMethod, verificationMethod: observationMethod, owner: "a", phase: "active", revision: 0 }, "human");
84
+ ledger.putGoal({ id: "root", parentId: null, objective: "test", observationMethod, verificationMethod: observationMethod, owner: "a", phase: "paused", revision: 1 }, "human");
85
+ ledger.putGoal({ id: "root", parentId: null, objective: "test", observationMethod, verificationMethod: observationMethod, owner: "a", phase: "active", revision: 2 }, "human");
86
+ const completionEvidence = ledger.appendEvent({ streamId: "conformance:goal", ts: clock.now().toISOString(), actor: "a", type: "observation.completed", data: { ok: true } });
87
+ ledger.completeGoal({ goalId: "root", revision: 2, reason: "conformance observation passed", evidence: [completionEvidence.seq] }, "human");
88
+ let reopened = false;
89
+ try {
90
+ ledger.putGoal({ id: "root", parentId: null, objective: "test", observationMethod, verificationMethod: observationMethod, owner: "a", phase: "active", revision: 4 }, "human");
91
+ } catch {
92
+ reopened = true;
93
+ }
94
+ if (!reopened)
95
+ throw new Error("ledger conformance: completed goal was reopened");
96
+ const first = ledger.enqueueWake({ id: "z", ...specialistAutomaticTarget("a", "verifier"), triggerRef: "first", status: "queued", attempt: 0, enqueuedSeq: 0, claimedAt: null, consumedAt: null, turnId: null }, "supervisor");
97
+ if (ledger.wakeTriggers("z").length !== 1 || ledger.wakeTriggers("z")[0]?.status !== "pending")
98
+ throw new Error("ledger conformance: initial Wake trigger is missing");
99
+ ledger.enqueueWake({ id: "a", ...specialistAutomaticTarget("b", "audit"), triggerRef: "second", status: "queued", attempt: 0, enqueuedSeq: 0, claimedAt: null, consumedAt: null, turnId: null }, "supervisor");
100
+ const claimed = ledger.claimNextWake(clock.now().toISOString());
101
+ if (claimed?.id !== "z")
102
+ throw new Error("ledger conformance: wakes are not FIFO");
103
+ ledger.putThread({ id: "thread:a", agent: "a", role: "verifier", parentThreadId: null, createdAt: clock.now().toISOString(), updatedAt: clock.now().toISOString() }, "supervisor");
104
+ const turn = { id: "turn:a", threadId: "thread:a", triggerKind: "wake", goalId: null, goalRevision: null, status: "in_progress", attempt: 1, error: null, startedAt: clock.now().toISOString(), endedAt: null, leaseUntil: "2030-01-01T00:10:00.000Z", leaseToken: "lease", runnerPid: null };
105
+ ledger.startTurnFromWake("z", turn, clock.now().toISOString());
106
+ if (ledger.wake("z")?.turnId !== turn.id)
107
+ throw new Error("ledger conformance: consumed Wake did not link its Turn");
108
+ if (ledger.wakeTriggers("z").some((trigger) => trigger.status !== "resolved"))
109
+ throw new Error("ledger conformance: consumed Wake retained pending triggers");
110
+ if (first.event.ts !== clock.now().toISOString())
111
+ throw new Error("ledger conformance: injected clock was ignored");
112
+ const informational = ledger.appendEvent({ streamId: "conformance:events", ts: clock.now().toISOString(), actor: "a", type: "transcript.conformance_info", data: {}, ignorable: true });
113
+ if (ledger.latestEvent()?.seq !== informational.seq)
114
+ throw new Error("ledger conformance: latest event was not the globally last append");
115
+ const before = JSON.stringify({ goals: ledger.goals(), wakes: ledger.wakes(), triggers: ledger.wakeTriggers("z") });
116
+ ledger.rebuildProjections();
117
+ if (JSON.stringify({ goals: ledger.goals(), wakes: ledger.wakes(), triggers: ledger.wakeTriggers("z") }) !== before)
118
+ throw new Error("ledger conformance: projection replay changed state");
119
+ ledger.close();
120
+ }
121
+ export {
122
+ FauxPiDriver,
123
+ SimulatedClock,
124
+ assertLedgerConformance,
125
+ createMemoryLedger,
126
+ fauxRunnerWorkerPath
127
+ };