@goah/cli 0.13.0 → 0.13.2

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-7E7V6OIU.js +920 -0
  14. package/dist/chunk-BXA47DTF.js +548 -0
  15. package/dist/chunk-D2DVAH37.js +25 -0
  16. package/dist/chunk-FSBUS2BI.js +26 -0
  17. package/dist/chunk-GKDRAHLI.js +4787 -0
  18. package/dist/chunk-H462EFJP.js +89 -0
  19. package/dist/chunk-IIJQ3DW4.js +35 -0
  20. package/dist/chunk-JQD5EWJY.js +34 -0
  21. package/dist/chunk-K26BVR6O.js +61 -0
  22. package/dist/chunk-KAO7WIXG.js +31 -0
  23. package/dist/chunk-KJ4HJCTK.js +1178 -0
  24. package/dist/chunk-LBKI23CC.js +9810 -0
  25. package/dist/chunk-LKBKZEHT.js +41 -0
  26. package/dist/chunk-MD7TLTXZ.js +18 -0
  27. package/dist/chunk-MPXK7QBL.js +868 -0
  28. package/dist/chunk-NRLGWZJC.js +11 -0
  29. package/dist/chunk-QBD6EJ2Z.js +1746 -0
  30. package/dist/chunk-R6I3VKME.js +132 -0
  31. package/dist/chunk-TJON22J4.js +87 -0
  32. package/dist/chunk-ULY36ME4.js +33097 -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 +13716 -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-GD4BYCQC.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
@@ -0,0 +1,39 @@
1
+ import { createRequire as __goahCreateRequire } from "node:module";
2
+ const require = __goahCreateRequire(import.meta.url);
3
+ import {
4
+ ProcessVerifierModel,
5
+ RunnerRouter,
6
+ Supervisor,
7
+ VerificationPlane,
8
+ calibrateVerificationThreshold,
9
+ composeActiveContext,
10
+ defaultRolePrompt,
11
+ defaultTurnPrompt,
12
+ deriveRecoveryViews,
13
+ deriveTeam,
14
+ evaluateVerification,
15
+ renderDashboard,
16
+ runSupervisorDaemon,
17
+ selectRecoveryEvents
18
+ } from "./chunk-QBD6EJ2Z.js";
19
+ import "./chunk-4KA63VNZ.js";
20
+ import "./chunk-KAO7WIXG.js";
21
+ import "./chunk-R6I3VKME.js";
22
+ import "./chunk-TJON22J4.js";
23
+ import "./chunk-XPQKM3L7.js";
24
+ export {
25
+ ProcessVerifierModel,
26
+ RunnerRouter,
27
+ Supervisor,
28
+ VerificationPlane,
29
+ calibrateVerificationThreshold,
30
+ composeActiveContext,
31
+ defaultRolePrompt,
32
+ defaultTurnPrompt,
33
+ deriveRecoveryViews,
34
+ deriveTeam,
35
+ evaluateVerification,
36
+ renderDashboard,
37
+ runSupervisorDaemon,
38
+ selectRecoveryEvents
39
+ };
@@ -1,2 +1,557 @@
1
- export * from "goah-ledger-contract/execution";
2
- //# sourceMappingURL=execution.d.ts.map
1
+ type JsonPrimitive = string | number | boolean | null;
2
+ type JsonValue = JsonPrimitive | JsonValue[] | {
3
+ [key: string]: JsonValue;
4
+ };
5
+ /** One append request. Sequence numbers are assigned by the ledger. */
6
+ interface EventInput {
7
+ streamId: string;
8
+ ts: string;
9
+ actor: string;
10
+ type: string;
11
+ data: JsonValue;
12
+ /** An unfamiliar reader may skip this event without changing replay semantics. */
13
+ ignorable?: true;
14
+ }
15
+ /** One immutable fact in the global ledger and in one logical stream. */
16
+ interface EventRecord extends EventInput {
17
+ seq: number;
18
+ streamSeq: number;
19
+ }
20
+ interface EventStore {
21
+ appendEvent(input: EventInput): EventRecord;
22
+ appendEvents(inputs: EventInput[]): EventRecord[];
23
+ readStream(streamId: string, fromStreamSeq?: number): EventRecord[];
24
+ eventsSince(seq: number, types?: string[]): EventRecord[];
25
+ events(): EventRecord[];
26
+ }
27
+
28
+ type WakeStatus = "queued" | "claimed" | "consumed" | "cancelled";
29
+ type WakeTriggerStatus = "pending" | "resolved";
30
+ type ScheduleStatus = "pending" | "consumed" | "cancelled" | "superseded";
31
+ type GoalPhase = "active" | "paused" | "blocked" | "complete";
32
+ type TurnStatus = "in_progress" | "completed" | "failed" | "interrupted";
33
+ type TurnTriggerKind = "user_message" | "wake";
34
+ type SpecialistRole = "verifier" | "audit";
35
+ type AgentRole = "child" | "ceo" | "verifier" | "audit";
36
+ type AutomaticTarget = {
37
+ targetKind: "goal";
38
+ agent: string;
39
+ goalId: string;
40
+ specialistRole: null;
41
+ } | {
42
+ targetKind: "specialist";
43
+ agent: string;
44
+ goalId: null;
45
+ specialistRole: SpecialistRole;
46
+ };
47
+ type MailRoute = {
48
+ routeKind: "goal";
49
+ goalId: string;
50
+ specialistRole: null;
51
+ } | {
52
+ routeKind: "human_inbox";
53
+ goalId: null;
54
+ specialistRole: null;
55
+ } | {
56
+ routeKind: "human_request";
57
+ goalId: null;
58
+ specialistRole: null;
59
+ } | {
60
+ routeKind: "specialist_inbox";
61
+ goalId: null;
62
+ specialistRole: SpecialistRole;
63
+ };
64
+ declare function goalAutomaticTarget(agent: string, goalId: string): Extract<AutomaticTarget, {
65
+ targetKind: "goal";
66
+ }>;
67
+ declare function specialistAutomaticTarget(agent: string, role: SpecialistRole): Extract<AutomaticTarget, {
68
+ targetKind: "specialist";
69
+ }>;
70
+ declare function goalRoute(goalId: string): Extract<MailRoute, {
71
+ routeKind: "goal";
72
+ }>;
73
+ declare function humanInboxRoute(): Extract<MailRoute, {
74
+ routeKind: "human_inbox";
75
+ }>;
76
+ declare function humanRequestRoute(): Extract<MailRoute, {
77
+ routeKind: "human_request";
78
+ }>;
79
+ declare function specialistInboxRoute(role: SpecialistRole): Extract<MailRoute, {
80
+ routeKind: "specialist_inbox";
81
+ }>;
82
+ type TurnItemType = "user_message" | "assistant_message" | "reasoning" | "tool_call" | "tool_result" | "plan" | "handoff";
83
+ type TurnItemStatus = "in_progress" | "completed" | "failed";
84
+ interface ThreadSnapshot {
85
+ id: string;
86
+ agent: string;
87
+ role: AgentRole;
88
+ parentThreadId: string | null;
89
+ createdAt: string;
90
+ updatedAt: string;
91
+ }
92
+ interface GoalCommitment {
93
+ goalId: string;
94
+ goalRevision: number;
95
+ }
96
+ declare function noGoalCommitment(): {
97
+ goalId: null;
98
+ goalRevision: null;
99
+ };
100
+ declare function goalCommitment(goalId: string, goalRevision: number): GoalCommitment;
101
+ type TurnSnapshot = {
102
+ id: string;
103
+ threadId: string;
104
+ triggerKind: TurnTriggerKind;
105
+ goalId: string | null;
106
+ goalRevision: number | null;
107
+ status: TurnStatus;
108
+ attempt: number;
109
+ error: JsonValue | null;
110
+ startedAt: string;
111
+ endedAt: string | null;
112
+ leaseUntil: string | null;
113
+ leaseToken: string | null;
114
+ runnerPid: number | null;
115
+ runnerProfileId?: string;
116
+ };
117
+ interface TurnItemSnapshot {
118
+ id: string;
119
+ turnId: string;
120
+ ordinal: number;
121
+ type: TurnItemType;
122
+ status: TurnItemStatus;
123
+ data: JsonValue;
124
+ createdAt: string;
125
+ completedAt: string | null;
126
+ }
127
+ interface GoalSnapshot {
128
+ id: string;
129
+ parentId: string | null;
130
+ objective: string;
131
+ observationMethod: string | null;
132
+ verificationMethod: string | null;
133
+ owner: string;
134
+ phase: GoalPhase;
135
+ revision: number;
136
+ }
137
+ type GoalChangeOperation = "create" | "revise" | "pause" | "resume" | "block" | "complete" | "reassign";
138
+ type GoalChangeAuthority = {
139
+ kind: "human";
140
+ } | {
141
+ kind: "parent_goal";
142
+ goalId: string;
143
+ goalRevision: number;
144
+ } | {
145
+ kind: "system";
146
+ reason: string;
147
+ };
148
+ interface GoalChangeMetadata {
149
+ operation: GoalChangeOperation;
150
+ reason: string;
151
+ evidence: number[];
152
+ authority?: GoalChangeAuthority;
153
+ sourceTurnId?: string;
154
+ sourceWakeId?: string;
155
+ idempotencyKey?: string;
156
+ }
157
+ interface GoalChangedData extends GoalChangeMetadata {
158
+ version: 1;
159
+ previousRevision: number | null;
160
+ snapshot: GoalSnapshot;
161
+ authority: GoalChangeAuthority;
162
+ }
163
+ interface WorkRecordSnapshot {
164
+ goalId: string;
165
+ recordRevision: number;
166
+ goalRevision: number;
167
+ content: string;
168
+ updatedBy: string;
169
+ updatedInTurn: string;
170
+ sourceWakeId: string | null;
171
+ updatedAt: string;
172
+ reason: string;
173
+ evidence: number[];
174
+ lastEventSeq: number;
175
+ }
176
+ interface WorkRecordUpdateRequest {
177
+ goalId: string;
178
+ expectedRevision: number;
179
+ goalRevision: number;
180
+ content: string;
181
+ reason: string;
182
+ evidence: number[];
183
+ turnId: string;
184
+ sourceWakeId?: string;
185
+ }
186
+ interface WorkRecordDiff {
187
+ goalId: string;
188
+ fromRevision: number;
189
+ toRevision: number;
190
+ text: string;
191
+ }
192
+ type ScheduleSnapshot = AutomaticTarget & {
193
+ id: string;
194
+ nextWakeAt: string;
195
+ reason: string;
196
+ setBy: string;
197
+ status: ScheduleStatus;
198
+ resolvedAt: string | null;
199
+ };
200
+ type WakeSnapshot = AutomaticTarget & {
201
+ id: string;
202
+ /** Initial trigger retained for display and provenance. Runtime decisions use WakeTriggerSnapshot. */
203
+ triggerRef: string;
204
+ status: WakeStatus;
205
+ attempt: number;
206
+ enqueuedSeq: number;
207
+ claimedAt: string | null;
208
+ consumedAt: string | null;
209
+ turnId: string | null;
210
+ };
211
+ interface WakeTriggerSnapshot {
212
+ wakeId: string;
213
+ agent: string;
214
+ triggerRef: string;
215
+ source: "goal" | "system";
216
+ status: WakeTriggerStatus;
217
+ addedAt: string;
218
+ resolvedAt: string | null;
219
+ }
220
+ type MailLevel = "fyi" | "decision" | "emergency";
221
+ type MailSnapshot = MailRoute & {
222
+ id: string;
223
+ to: string;
224
+ from: string;
225
+ level: MailLevel;
226
+ body: JsonValue;
227
+ readAt: string | null;
228
+ };
229
+ interface DelegationRequest {
230
+ id: string;
231
+ parentGoalId: string;
232
+ expectedParentRevision: number;
233
+ childGoal: {
234
+ id: string;
235
+ objective: string;
236
+ observationMethod: string;
237
+ verificationMethod: string;
238
+ owner: string;
239
+ };
240
+ brief: JsonValue;
241
+ reason: string;
242
+ evidence: number[];
243
+ sourceTurnId?: string;
244
+ }
245
+ interface DelegationResult {
246
+ delegationId: string;
247
+ goal: GoalSnapshot;
248
+ mail: MailSnapshot;
249
+ wake: WakeSnapshot;
250
+ }
251
+ interface ReassignmentRequest {
252
+ id: string;
253
+ goalId: string;
254
+ expectedGoalRevision: number;
255
+ newOwner: string;
256
+ brief: JsonValue;
257
+ reason: string;
258
+ evidence: number[];
259
+ sourceTurnId?: string;
260
+ }
261
+ interface ReassignmentResult {
262
+ reassignmentId: string;
263
+ goal: GoalSnapshot;
264
+ mail: MailSnapshot[];
265
+ wake: WakeSnapshot | null;
266
+ }
267
+ interface GoalCompletionRequest {
268
+ goalId: string;
269
+ revision: number;
270
+ reason: string;
271
+ evidence: number[];
272
+ sourceTurnId?: string;
273
+ }
274
+ type TeamMemberMotion = "running" | "queued" | "scheduled" | "idle" | "retired";
275
+ interface TeamMemberView {
276
+ agent: string;
277
+ goalIds: string[];
278
+ motion: TeamMemberMotion;
279
+ lastOutcome: GoalOutcome | null;
280
+ lastHandoffSeq: number | null;
281
+ lastWakeStatus: WakeStatus | null;
282
+ nextWakeAt: string | null;
283
+ }
284
+ type GoalOutcome = "progress" | "waiting" | "blocked" | "completion_proposed";
285
+ interface AgentHandoff {
286
+ outcome: GoalOutcome;
287
+ evidence: number[];
288
+ }
289
+ interface GoalHandoff extends AgentHandoff {
290
+ goalId: string;
291
+ goalRevision: number;
292
+ recordRevision: number;
293
+ }
294
+ type Handoff = GoalHandoff;
295
+ interface HandoffValidationIssue {
296
+ code: string;
297
+ message: string;
298
+ details?: JsonValue;
299
+ }
300
+ type HandoffValidationResult = {
301
+ accepted: true;
302
+ fatal: false;
303
+ attemptId: number;
304
+ token: string;
305
+ goalId: string;
306
+ goalRevision: number;
307
+ } | {
308
+ accepted: false;
309
+ fatal: boolean;
310
+ attemptId: number;
311
+ issues: HandoffValidationIssue[];
312
+ };
313
+ interface HandoffValidationRequest {
314
+ handoff: AgentHandoff;
315
+ candidateMessage: string;
316
+ }
317
+ interface TurnOutput {
318
+ validationAttemptId: number;
319
+ validationToken: string;
320
+ handoff: AgentHandoff;
321
+ }
322
+ interface CommittedTurnOutput {
323
+ handoff: GoalHandoff;
324
+ }
325
+ interface RunnerTraceEvent {
326
+ type: string;
327
+ data: JsonValue;
328
+ }
329
+ 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";
330
+ type RunnerControlMethod = "goal.handoff.validate";
331
+ type RunnerRpcMethod = AgentCapability | RunnerControlMethod;
332
+ interface RunnerProfile {
333
+ id: string;
334
+ runner: string;
335
+ config: JsonValue;
336
+ credentialRefs?: string[];
337
+ }
338
+ interface AgentProfile {
339
+ agent: string;
340
+ role: AgentRole;
341
+ capabilities?: AgentCapability[];
342
+ systemPrompt?: string;
343
+ runnerProfile?: string;
344
+ }
345
+ interface RunnerChoice {
346
+ value: string;
347
+ label: string;
348
+ description?: string;
349
+ }
350
+ interface RunnerSetupProgress {
351
+ current: number;
352
+ total: number;
353
+ }
354
+ interface RunnerSetupInteraction {
355
+ select(input: {
356
+ title: string;
357
+ description?: string;
358
+ choices: RunnerChoice[];
359
+ progress?: RunnerSetupProgress;
360
+ }): Promise<string | null>;
361
+ input(input: {
362
+ title: string;
363
+ description?: string;
364
+ prompt: string;
365
+ initial?: string;
366
+ secret?: boolean;
367
+ progress?: RunnerSetupProgress;
368
+ }): Promise<string | null>;
369
+ notify(message: string): void;
370
+ openUrl?(url: string): void;
371
+ }
372
+ interface RunnerManifest {
373
+ id: string;
374
+ name: string;
375
+ description: string;
376
+ commands?: Array<{
377
+ name: string;
378
+ description: string;
379
+ }>;
380
+ }
381
+ interface RunnerDiagnostic {
382
+ ok: boolean;
383
+ name: string;
384
+ detail: string;
385
+ severity?: "warning" | "error";
386
+ }
387
+ interface RunnerCommandResult {
388
+ config?: JsonValue;
389
+ output: string[];
390
+ rollback?(): Promise<void>;
391
+ }
392
+ interface RunnerSetupTransaction {
393
+ config: JsonValue | null;
394
+ commit(): Promise<JsonValue | null>;
395
+ rollback(): Promise<void>;
396
+ }
397
+ interface RunnerConfigurator {
398
+ describe(): RunnerManifest;
399
+ setup(current: JsonValue | null, interaction: RunnerSetupInteraction): Promise<JsonValue | null>;
400
+ beginSetup?(current: JsonValue | null, interaction: RunnerSetupInteraction): Promise<RunnerSetupTransaction>;
401
+ doctor(config: JsonValue, context?: {
402
+ root: string;
403
+ }): Promise<RunnerDiagnostic[]>;
404
+ summarize?(config: JsonValue): Array<{
405
+ label: string;
406
+ value: string;
407
+ }>;
408
+ runCommand?(command: string, args: string[], config: JsonValue, interaction: RunnerSetupInteraction): Promise<RunnerCommandResult>;
409
+ }
410
+ type TurnTrigger = {
411
+ kind: "user_message";
412
+ } | {
413
+ kind: "wake";
414
+ reasons: string[];
415
+ };
416
+ interface TurnContext {
417
+ trigger: TurnTrigger;
418
+ activeGoal: GoalSnapshot | null;
419
+ goalCommitment: GoalCommitment | null;
420
+ }
421
+ interface AssistantResponse {
422
+ content: string;
423
+ }
424
+ /** Canonical user-visible assistant prose. Raw provider events remain unchanged. */
425
+ declare function normalizeAssistantText(text: string): string;
426
+ interface RunRequest {
427
+ agent: string;
428
+ execution: TurnSnapshot;
429
+ sourceWake?: WakeSnapshot;
430
+ sourceWakeTriggers?: WakeTriggerSnapshot[];
431
+ turn: TurnContext;
432
+ context: JsonValue;
433
+ now(): string;
434
+ emit(event: RunnerTraceEvent): void;
435
+ rpc?(method: RunnerRpcMethod, params: JsonValue): Promise<JsonValue>;
436
+ }
437
+ type RunnerCandidateResult = {
438
+ outcome: "completed";
439
+ response: AssistantResponse;
440
+ handoff?: TurnOutput;
441
+ } | {
442
+ outcome: "abnormal";
443
+ reason: string;
444
+ };
445
+ interface RunnerHandle {
446
+ pid: number | null;
447
+ begin(): void;
448
+ result: Promise<RunnerCandidateResult>;
449
+ steer?(message: string): Promise<void>;
450
+ terminate(): Promise<void>;
451
+ }
452
+ interface Runner {
453
+ readonly isolation: "process";
454
+ prepare(request: RunRequest): RunnerHandle;
455
+ terminateProcess(pid: number, runnerProfileId?: string): Promise<void>;
456
+ }
457
+ interface HandoffCommit {
458
+ agent: string;
459
+ turnId: string;
460
+ sourceWakeId: string | null;
461
+ mailIds: string[];
462
+ ts: string;
463
+ output: CommittedTurnOutput;
464
+ responseItemId: string;
465
+ item: TurnItemSnapshot;
466
+ }
467
+ interface HumanTurnAdmissionRequest {
468
+ thread: ThreadSnapshot;
469
+ turn: TurnSnapshot;
470
+ messageItem: TurnItemSnapshot;
471
+ replaceTurnId: string | null;
472
+ rootGoal?: GoalSnapshot;
473
+ }
474
+ interface HumanTurnAdmissionResult {
475
+ turn: TurnSnapshot;
476
+ replacedTurn: TurnSnapshot | null;
477
+ goal: GoalSnapshot | null;
478
+ }
479
+ /** Standard execution modules composed on top of the generic event store. */
480
+ interface Ledger extends EventStore {
481
+ putThread(thread: ThreadSnapshot, actor: string): EventRecord;
482
+ putTurn(turn: TurnSnapshot, actor: string): EventRecord;
483
+ admitHumanTurn(request: HumanTurnAdmissionRequest): HumanTurnAdmissionResult;
484
+ commitTurnToGoal(turnId: string, goal: GoalCommitment, actor: string): TurnSnapshot;
485
+ putTurnItem(item: TurnItemSnapshot, actor: string): EventRecord;
486
+ thread(id: string): ThreadSnapshot | null;
487
+ threads(): ThreadSnapshot[];
488
+ turn(id: string): TurnSnapshot | null;
489
+ turns(threadId?: string): TurnSnapshot[];
490
+ turnItems(turnId: string): TurnItemSnapshot[];
491
+ activeTurn(threadId: string): TurnSnapshot | null;
492
+ putGoal(goal: GoalSnapshot, actor: string, wakeId?: string, change?: GoalChangeMetadata): EventRecord;
493
+ updateWorkRecord(request: WorkRecordUpdateRequest, actor: string): WorkRecordSnapshot;
494
+ commitDelegation(request: DelegationRequest, actor: string, wakeId?: string): DelegationResult;
495
+ commitReassignment(request: ReassignmentRequest, actor: string, wakeId?: string): ReassignmentResult;
496
+ completeGoal(request: GoalCompletionRequest, actor: string, wakeId?: string): GoalSnapshot;
497
+ putSchedule(schedule: ScheduleSnapshot, actor: string, wakeId?: string): EventRecord;
498
+ consumeSchedule(id: string, wake: WakeSnapshot, now: string): {
499
+ schedule: ScheduleSnapshot;
500
+ wake: WakeSnapshot;
501
+ };
502
+ cancelSchedule(id: string, now: string): ScheduleSnapshot;
503
+ supersedeSchedule(id: string, now: string): ScheduleSnapshot;
504
+ enqueueWake(wake: WakeSnapshot, actor: string): {
505
+ event: EventRecord;
506
+ created: boolean;
507
+ };
508
+ addWakeTrigger(wakeId: string, triggerRef: string, actor: string): WakeTriggerSnapshot;
509
+ claimNextWake(now: string): WakeSnapshot | null;
510
+ startTurnFromWake(id: string, turn: TurnSnapshot, now: string): WakeSnapshot;
511
+ releaseWake(id: string, now: string): WakeSnapshot;
512
+ cancelWake(id: string, now: string): WakeSnapshot;
513
+ attachTurnProcess(id: string, leaseToken: string, pid: number): TurnSnapshot;
514
+ renewTurnLease(id: string, leaseToken: string, leaseUntil: string, now: string): TurnSnapshot;
515
+ appendTurnEvent(input: EventInput, leaseToken: string): EventRecord;
516
+ repairTurnAttempt(id: string, reason: string, now: string, actor: string): TurnItemSnapshot[];
517
+ finishTurn(id: string, status: "completed" | "failed" | "interrupted", error: JsonValue | null, now: string, actor: string, mailIds?: string[]): TurnSnapshot;
518
+ releaseTurnProcess(id: string, actor: string): TurnSnapshot;
519
+ putMail(mail: MailSnapshot, actor: string, wakeId?: string): EventRecord;
520
+ putMails(mail: MailSnapshot[], actor: string, wakeId?: string): EventRecord[];
521
+ commitHandoff(commit: HandoffCommit): EventRecord;
522
+ dueSchedules(now: string): ScheduleSnapshot[];
523
+ unreadMail(agent: string): MailSnapshot[];
524
+ lastEvent(actor: string, type: string): EventRecord | null;
525
+ lastGoalHandoff(goalId: string): EventRecord | null;
526
+ latestEvent(): EventRecord | null;
527
+ eventsForWake(wakeId: string): EventRecord[];
528
+ wake(id: string): WakeSnapshot | null;
529
+ wakeByTrigger(agent: string, triggerRef: string): WakeSnapshot | null;
530
+ wakeTriggers(wakeId: string): WakeTriggerSnapshot[];
531
+ wakeTriggersForAgent(agent: string): WakeTriggerSnapshot[];
532
+ queuedWakeForAgent(agent: string): WakeSnapshot | null;
533
+ goalsForOwner(owner: string): GoalSnapshot[];
534
+ goal(id: string): GoalSnapshot | null;
535
+ workRecord(goalId: string): WorkRecordSnapshot | null;
536
+ workRecordHistory(goalId: string): WorkRecordSnapshot[];
537
+ workRecordDiff(goalId: string, fromRevision: number, toRevision: number): WorkRecordDiff;
538
+ searchWorkRecords(query: string, limit?: number): WorkRecordSnapshot[];
539
+ triggeringMail(): MailSnapshot[];
540
+ searchEvents(query: string, limit?: number): EventRecord[];
541
+ goals(): GoalSnapshot[];
542
+ workRecords(): WorkRecordSnapshot[];
543
+ schedules(): ScheduleSnapshot[];
544
+ wakes(): WakeSnapshot[];
545
+ mailbox(): MailSnapshot[];
546
+ rebuildProjections(): void;
547
+ close(): void;
548
+ }
549
+ declare function assertWakeTransition(from: WakeStatus, to: WakeStatus): void;
550
+ declare function assertGoalTransition(from: GoalPhase, to: GoalPhase): void;
551
+ declare function assertHandoff(value: Handoff): void;
552
+ declare function assertAgentHandoff(value: AgentHandoff): void;
553
+ declare function assertTurnOutput(value: TurnOutput): void;
554
+ declare function assertGoalSnapshot(value: GoalSnapshot): void;
555
+
556
+ export { assertAgentHandoff, assertGoalSnapshot, assertGoalTransition, assertHandoff, assertTurnOutput, assertWakeTransition, goalAutomaticTarget, goalCommitment, goalRoute, humanInboxRoute, humanRequestRoute, noGoalCommitment, normalizeAssistantText, specialistAutomaticTarget, specialistInboxRoute };
557
+ export type { AgentCapability, AgentHandoff, AgentProfile, AgentRole, AssistantResponse, AutomaticTarget, CommittedTurnOutput, DelegationRequest, DelegationResult, GoalChangeAuthority, GoalChangeMetadata, GoalChangeOperation, GoalChangedData, GoalCommitment, GoalCompletionRequest, GoalHandoff, GoalOutcome, GoalPhase, GoalSnapshot, Handoff, HandoffCommit, HandoffValidationIssue, HandoffValidationRequest, HandoffValidationResult, HumanTurnAdmissionRequest, HumanTurnAdmissionResult, Ledger, MailLevel, MailRoute, MailSnapshot, ReassignmentRequest, ReassignmentResult, RunRequest, Runner, RunnerCandidateResult, RunnerChoice, RunnerCommandResult, RunnerConfigurator, RunnerControlMethod, RunnerDiagnostic, RunnerHandle, RunnerManifest, RunnerProfile, RunnerRpcMethod, RunnerSetupInteraction, RunnerSetupProgress, RunnerSetupTransaction, RunnerTraceEvent, ScheduleSnapshot, ScheduleStatus, SpecialistRole, TeamMemberMotion, TeamMemberView, ThreadSnapshot, TurnContext, TurnItemSnapshot, TurnItemStatus, TurnItemType, TurnOutput, TurnSnapshot, TurnStatus, TurnTrigger, TurnTriggerKind, WakeSnapshot, WakeStatus, WakeTriggerSnapshot, WakeTriggerStatus, WorkRecordDiff, WorkRecordSnapshot, WorkRecordUpdateRequest };
package/dist/execution.js CHANGED
@@ -1,2 +1,37 @@
1
- export * from "goah-ledger-contract/execution";
2
- //# sourceMappingURL=execution.js.map
1
+ import { createRequire as __goahCreateRequire } from "node:module";
2
+ const require = __goahCreateRequire(import.meta.url);
3
+ import {
4
+ assertAgentHandoff,
5
+ assertGoalSnapshot,
6
+ assertGoalTransition,
7
+ assertHandoff,
8
+ assertTurnOutput,
9
+ assertWakeTransition,
10
+ goalAutomaticTarget,
11
+ goalCommitment,
12
+ goalRoute,
13
+ humanInboxRoute,
14
+ humanRequestRoute,
15
+ noGoalCommitment,
16
+ normalizeAssistantText,
17
+ specialistAutomaticTarget,
18
+ specialistInboxRoute
19
+ } from "./chunk-TJON22J4.js";
20
+ import "./chunk-XPQKM3L7.js";
21
+ export {
22
+ assertAgentHandoff,
23
+ assertGoalSnapshot,
24
+ assertGoalTransition,
25
+ assertHandoff,
26
+ assertTurnOutput,
27
+ assertWakeTransition,
28
+ goalAutomaticTarget,
29
+ goalCommitment,
30
+ goalRoute,
31
+ humanInboxRoute,
32
+ humanRequestRoute,
33
+ noGoalCommitment,
34
+ normalizeAssistantText,
35
+ specialistAutomaticTarget,
36
+ specialistInboxRoute
37
+ };