@atolis-hq/wake 0.4.2 → 0.4.8

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 (703) hide show
  1. package/README.md +9 -0
  2. package/dist/src/activities/agent/agent-activity-definition.d.ts +9 -0
  3. package/dist/src/activities/agent/agent-activity.d.ts +51 -0
  4. package/dist/src/activities/agent/agent-result.d.ts +43 -0
  5. package/dist/src/activities/contracts/activity.d.ts +184 -0
  6. package/dist/src/activities/contracts/config.d.ts +3 -0
  7. package/dist/src/activities/contracts/decision-claim-schema.d.ts +35 -0
  8. package/dist/src/activities/contracts/decision-claim-schema.js +42 -0
  9. package/dist/src/activities/contracts/event-factory.d.ts +6 -0
  10. package/dist/src/activities/contracts/event-factory.js +40 -0
  11. package/dist/src/activities/contracts/event-integrity.d.ts +61 -0
  12. package/dist/src/activities/contracts/event-integrity.js +50 -0
  13. package/dist/src/activities/contracts/event-schema.d.ts +2803 -0
  14. package/dist/src/activities/contracts/event-schema.js +67 -121
  15. package/dist/src/activities/contracts/events.d.ts +153 -0
  16. package/dist/src/activities/contracts/events.js +4 -4
  17. package/dist/src/activities/contracts/identifiers.d.ts +5 -0
  18. package/dist/src/activities/contracts/registry.d.ts +19 -0
  19. package/dist/src/activities/contracts/streams.d.ts +13 -0
  20. package/dist/src/activities/contracts/vocabulary.d.ts +69 -0
  21. package/dist/src/activities/index.d.ts +23 -0
  22. package/dist/src/activities/index.js +1 -0
  23. package/dist/src/activities/issue/complete.d.ts +26 -0
  24. package/dist/src/activities/issue/complete.js +5 -5
  25. package/dist/src/activities/pr/activity-support.d.ts +38 -0
  26. package/dist/src/activities/pr/activity-support.js +1 -1
  27. package/dist/src/activities/pr/application.d.ts +17 -0
  28. package/dist/src/activities/pr/application.js +6 -6
  29. package/dist/src/activities/pr/approve.d.ts +7 -0
  30. package/dist/src/activities/pr/approve.js +8 -3
  31. package/dist/src/activities/pr/capability.d.ts +2 -0
  32. package/dist/src/activities/pr/contracts.d.ts +133 -0
  33. package/dist/src/activities/pr/decision-claim.d.ts +26 -0
  34. package/dist/src/activities/pr/decision-claim.js +50 -30
  35. package/dist/src/activities/pr/event-data.d.ts +21 -0
  36. package/dist/src/activities/pr/event-data.js +101 -0
  37. package/dist/src/activities/pr/intent.d.ts +12 -0
  38. package/dist/src/activities/pr/intent.js +5 -5
  39. package/dist/src/activities/pr/merge-authority-gate.d.ts +13 -0
  40. package/dist/src/activities/pr/merge-authority-gate.js +1 -1
  41. package/dist/src/activities/pr/merge.d.ts +7 -0
  42. package/dist/src/activities/pr/merge.js +8 -3
  43. package/dist/src/activities/pr/policy.d.ts +13 -0
  44. package/dist/src/activities/pr/projection.d.ts +5 -0
  45. package/dist/src/activities/pr/projection.js +18 -17
  46. package/dist/src/activities/pr/vocabulary.d.ts +34 -0
  47. package/dist/src/activities/review/authorization.d.ts +9 -0
  48. package/dist/src/activities/review/contracts.d.ts +46 -0
  49. package/dist/src/activities/review/signals.d.ts +2 -0
  50. package/dist/src/bootstrap/activation-scheduler-serialiser.d.ts +3 -0
  51. package/dist/src/bootstrap/activation-scheduler-serialiser.js +8 -0
  52. package/dist/src/bootstrap/activity-registry.d.ts +4 -0
  53. package/dist/src/bootstrap/analytics-projection.d.ts +12 -0
  54. package/dist/src/bootstrap/analytics-projection.js +3 -3
  55. package/dist/src/bootstrap/board-projection.d.ts +56 -0
  56. package/dist/src/bootstrap/board-projection.js +156 -71
  57. package/dist/src/bootstrap/composition-root.d.ts +76 -0
  58. package/dist/src/bootstrap/composition-root.js +20 -13
  59. package/dist/src/bootstrap/config/load-config.d.ts +6 -0
  60. package/dist/src/bootstrap/config/root-schema.d.ts +443 -0
  61. package/dist/src/bootstrap/event-processor-runtime.d.ts +22 -0
  62. package/dist/src/bootstrap/event-processor-runtime.js +88 -0
  63. package/dist/src/bootstrap/external-ref.d.ts +3 -0
  64. package/dist/src/bootstrap/fake-provider-files.d.ts +3 -0
  65. package/dist/src/bootstrap/fake-scenarios.d.ts +3 -0
  66. package/dist/src/bootstrap/index.d.ts +27 -0
  67. package/dist/src/bootstrap/index.js +2 -28
  68. package/dist/src/bootstrap/initialise.d.ts +4 -0
  69. package/dist/src/bootstrap/initialise.js +8 -16
  70. package/dist/src/bootstrap/integration-runtime.d.ts +48 -0
  71. package/dist/src/bootstrap/integration-runtime.js +36 -54
  72. package/dist/src/bootstrap/paths.d.ts +12 -0
  73. package/dist/src/bootstrap/persistence-composition.d.ts +21 -0
  74. package/dist/src/bootstrap/persistence-composition.js +12 -4
  75. package/dist/src/bootstrap/projection-runtime.d.ts +16 -0
  76. package/dist/src/bootstrap/projection-runtime.js +50 -23
  77. package/dist/src/bootstrap/resource-transition-evidence.d.ts +11 -0
  78. package/dist/src/bootstrap/runner-quota-reporter.d.ts +6 -0
  79. package/dist/src/bootstrap/runner-quota-reporter.js +16 -11
  80. package/dist/src/bootstrap/runner-registry.d.ts +3 -0
  81. package/dist/src/bootstrap/runner-tick-adapter.d.ts +16 -0
  82. package/dist/src/bootstrap/runner-tick-adapter.js +57 -0
  83. package/dist/src/bootstrap/schedule-checkpoint-store.d.ts +9 -0
  84. package/dist/src/bootstrap/self-update-application.d.ts +54 -0
  85. package/dist/src/bootstrap/self-update-failure-log.d.ts +17 -0
  86. package/dist/src/bootstrap/source-update-port.d.ts +8 -0
  87. package/dist/src/bootstrap/status-publish-activity.d.ts +7 -0
  88. package/dist/src/bootstrap/status-publish-activity.js +4 -5
  89. package/dist/src/bootstrap/surface-api-applications.d.ts +18 -0
  90. package/dist/src/bootstrap/surface-api-applications.js +104 -57
  91. package/dist/src/bootstrap/surface-api-execution-applications.d.ts +3 -0
  92. package/dist/src/bootstrap/surface-api-execution-applications.js +3 -3
  93. package/dist/src/bootstrap/surface-api-metadata.d.ts +4 -0
  94. package/dist/src/bootstrap/surface-api-metadata.js +1 -1
  95. package/dist/src/bootstrap/surface-api-projection-pages.d.ts +12 -0
  96. package/dist/src/bootstrap/surface-api-run-context.d.ts +12 -0
  97. package/dist/src/bootstrap/surface-api-transcripts.d.ts +10 -0
  98. package/dist/src/bootstrap/surface-api-work-applications.d.ts +3 -0
  99. package/dist/src/bootstrap/surface-api-work-applications.js +3 -3
  100. package/dist/src/bootstrap/surface-api-workflow-diagrams.d.ts +11 -0
  101. package/dist/src/bootstrap/surface-api-workflow-diagrams.js +2 -2
  102. package/dist/src/bootstrap/surface-applications.d.ts +10 -0
  103. package/dist/src/bootstrap/surface-cli-applications.d.ts +33 -0
  104. package/dist/src/bootstrap/surface-cli-applications.js +151 -65
  105. package/dist/src/bootstrap/transcript-retention.d.ts +11 -0
  106. package/dist/src/bootstrap/update-ledger.d.ts +9 -0
  107. package/dist/src/bootstrap/update-maintenance-lease.d.ts +24 -0
  108. package/dist/src/bootstrap/update-maintenance-lease.js +1 -1
  109. package/dist/src/bootstrap/version.d.ts +13 -0
  110. package/dist/src/bootstrap/version.js +1 -1
  111. package/dist/src/control-plane/application/activation-scheduler-ports.d.ts +71 -0
  112. package/dist/src/control-plane/application/activation-scheduler-subscriber.d.ts +42 -0
  113. package/dist/src/control-plane/application/activation-scheduler-subscriber.js +111 -0
  114. package/dist/src/control-plane/application/activation-scheduler.d.ts +8 -0
  115. package/dist/src/control-plane/application/activation-scheduler.js +165 -0
  116. package/dist/src/control-plane/application/advance-once-dispatch.d.ts +46 -0
  117. package/dist/src/control-plane/application/advance-once-dispatch.js +6 -7
  118. package/dist/src/control-plane/application/advance-once.d.ts +5 -0
  119. package/dist/src/control-plane/application/advance-once.js +4 -158
  120. package/dist/src/control-plane/application/control-plane-projection.d.ts +21 -0
  121. package/dist/src/control-plane/application/control-plane-projection.js +27 -5
  122. package/dist/src/control-plane/application/control-plane-service.d.ts +12 -0
  123. package/dist/src/control-plane/application/control-plane-service.js +28 -9
  124. package/dist/src/control-plane/application/execution-reconciliation.d.ts +21 -0
  125. package/dist/src/control-plane/application/intake-pipeline.d.ts +18 -0
  126. package/dist/src/control-plane/application/intake-pipeline.js +8 -18
  127. package/dist/src/control-plane/application/runner-control-service.d.ts +12 -0
  128. package/dist/src/control-plane/application/runner-control-service.js +35 -13
  129. package/dist/src/control-plane/application/runner-pipeline.d.ts +24 -0
  130. package/dist/src/control-plane/application/runner-pipeline.js +23 -41
  131. package/dist/src/control-plane/application/schedule-service.d.ts +31 -0
  132. package/dist/src/control-plane/application/schedule-service.js +1 -1
  133. package/dist/src/control-plane/application/work-cancellation-policy.d.ts +20 -0
  134. package/dist/src/control-plane/application/work-cancellation-policy.js +1 -1
  135. package/dist/src/control-plane/contracts/commands.d.ts +20 -0
  136. package/dist/src/control-plane/contracts/config.d.ts +30 -0
  137. package/dist/src/control-plane/contracts/config.js +7 -1
  138. package/dist/src/control-plane/contracts/event-factory.d.ts +6 -0
  139. package/dist/src/control-plane/contracts/event-factory.js +14 -0
  140. package/dist/src/control-plane/contracts/events.d.ts +36 -0
  141. package/dist/src/control-plane/contracts/events.js +42 -47
  142. package/dist/src/control-plane/contracts/streams.d.ts +6 -0
  143. package/dist/src/control-plane/contracts/views.d.ts +28 -0
  144. package/dist/src/control-plane/domain/dispatch-policy.d.ts +18 -0
  145. package/dist/src/control-plane/domain/quota-policy.d.ts +21 -0
  146. package/dist/src/control-plane/domain/runner-quota.d.ts +2 -0
  147. package/dist/src/control-plane/domain/schedule-policy.d.ts +8 -0
  148. package/dist/src/control-plane/index.d.ts +24 -0
  149. package/dist/src/control-plane/index.js +3 -0
  150. package/dist/src/control-plane/infrastructure/intake-host.d.ts +19 -0
  151. package/dist/src/control-plane/infrastructure/intake-host.js +2 -3
  152. package/dist/src/control-plane/infrastructure/resident-host.d.ts +16 -0
  153. package/dist/src/control-plane/infrastructure/resident-host.js +3 -1
  154. package/dist/src/control-plane/infrastructure/tick-host.d.ts +6 -0
  155. package/dist/src/control-plane/infrastructure/tick-host.js +2 -2
  156. package/dist/src/conversations/application/conversation-projection.d.ts +3 -0
  157. package/dist/src/conversations/application/conversation-repository.d.ts +13 -0
  158. package/dist/src/conversations/application/conversation-repository.js +1 -1
  159. package/dist/src/conversations/application/conversation-service.d.ts +16 -0
  160. package/dist/src/conversations/application/conversation-service.js +32 -27
  161. package/dist/src/conversations/contracts/commands.d.ts +33 -0
  162. package/dist/src/conversations/contracts/event-factory.d.ts +6 -0
  163. package/dist/src/conversations/contracts/event-factory.js +18 -0
  164. package/dist/src/conversations/contracts/events.d.ts +42 -0
  165. package/dist/src/conversations/contracts/events.js +37 -24
  166. package/dist/src/conversations/contracts/identifiers.d.ts +5 -0
  167. package/dist/src/conversations/contracts/streams.d.ts +7 -0
  168. package/dist/src/conversations/contracts/views.d.ts +49 -0
  169. package/dist/src/conversations/contracts/vocabulary.d.ts +5 -0
  170. package/dist/src/conversations/domain/conversation.d.ts +4 -0
  171. package/dist/src/conversations/domain/conversation.js +8 -7
  172. package/dist/src/conversations/index.d.ts +9 -0
  173. package/dist/src/conversations/index.js +1 -0
  174. package/dist/src/execution/application/activation-claim.d.ts +23 -0
  175. package/dist/src/execution/application/activation-claim.js +8 -9
  176. package/dist/src/execution/application/active-run-cancellation.d.ts +4 -0
  177. package/dist/src/execution/application/active-run-cancellation.js +2 -2
  178. package/dist/src/execution/application/execution-activity.d.ts +61 -0
  179. package/dist/src/execution/application/execution-activity.js +4 -1
  180. package/dist/src/execution/application/execution-projection.d.ts +11 -0
  181. package/dist/src/execution/application/execution-projection.js +8 -4
  182. package/dist/src/execution/application/execution-service.d.ts +33 -0
  183. package/dist/src/execution/application/execution-service.js +288 -59
  184. package/dist/src/execution/application/execution-validation.d.ts +8 -0
  185. package/dist/src/execution/application/execution-validation.js +3 -2
  186. package/dist/src/execution/application/recovery-service.d.ts +52 -0
  187. package/dist/src/execution/application/recovery-service.js +32 -17
  188. package/dist/src/execution/application/run-lifecycle.d.ts +75 -0
  189. package/dist/src/execution/application/run-lifecycle.js +130 -62
  190. package/dist/src/execution/application/run-liveness-service.d.ts +14 -0
  191. package/dist/src/execution/application/run-liveness-service.js +68 -30
  192. package/dist/src/execution/application/run-repository.d.ts +18 -0
  193. package/dist/src/execution/application/run-repository.js +2 -2
  194. package/dist/src/execution/contracts/commands.d.ts +30 -0
  195. package/dist/src/execution/contracts/config.d.ts +94 -0
  196. package/dist/src/execution/contracts/control-plane.d.ts +10 -0
  197. package/dist/src/execution/contracts/event-factory.d.ts +10 -0
  198. package/dist/src/execution/contracts/event-factory.js +20 -31
  199. package/dist/src/execution/contracts/events.d.ts +198 -0
  200. package/dist/src/execution/contracts/events.js +152 -129
  201. package/dist/src/execution/contracts/identifiers.d.ts +3 -0
  202. package/dist/src/execution/contracts/liveness.d.ts +17 -0
  203. package/dist/src/execution/contracts/results.d.ts +23 -0
  204. package/dist/src/execution/contracts/runner.d.ts +78 -0
  205. package/dist/src/execution/contracts/streams.d.ts +12 -0
  206. package/dist/src/execution/contracts/views.d.ts +42 -0
  207. package/dist/src/execution/contracts/vocabulary.d.ts +50 -0
  208. package/dist/src/execution/contracts/vocabulary.js +4 -0
  209. package/dist/src/execution/contracts/workspace.d.ts +48 -0
  210. package/dist/src/execution/domain/run-result.d.ts +2 -0
  211. package/dist/src/execution/domain/run.d.ts +3 -0
  212. package/dist/src/execution/domain/run.js +72 -22
  213. package/dist/src/execution/index.d.ts +34 -0
  214. package/dist/src/execution/infrastructure/agent-runner-adapter.d.ts +2 -0
  215. package/dist/src/execution/infrastructure/codex-stop-hook.d.ts +13 -0
  216. package/dist/src/execution/infrastructure/process-execution.d.ts +23 -0
  217. package/dist/src/execution/infrastructure/prompt-templates.d.ts +15 -0
  218. package/dist/src/execution/infrastructure/runner-memory-profile.d.ts +11 -0
  219. package/dist/src/execution/infrastructure/runners/claude.d.ts +34 -0
  220. package/dist/src/execution/infrastructure/runners/codex.d.ts +13 -0
  221. package/dist/src/execution/infrastructure/runners/command.d.ts +3 -0
  222. package/dist/src/execution/infrastructure/runners/cursor.d.ts +12 -0
  223. package/dist/src/execution/infrastructure/runners/fake-scenarios.d.ts +35 -0
  224. package/dist/src/execution/infrastructure/runners/fake.d.ts +8 -0
  225. package/dist/src/execution/infrastructure/runners/registry.d.ts +14 -0
  226. package/dist/src/execution/infrastructure/transcript-store.d.ts +48 -0
  227. package/dist/src/execution/infrastructure/transcripts.d.ts +1 -0
  228. package/dist/src/execution/infrastructure/workspace/fake-workspace.d.ts +36 -0
  229. package/dist/src/execution/infrastructure/workspace/fake-workspace.js +2 -0
  230. package/dist/src/execution/infrastructure/workspace/git-workspace.d.ts +29 -0
  231. package/dist/src/execution/infrastructure/workspace/git-workspace.js +21 -11
  232. package/dist/src/execution/infrastructure/workspace/prepare-workspace.d.ts +3 -0
  233. package/dist/src/execution/infrastructure/workspace/prepare-workspace.js +4 -2
  234. package/dist/src/integrations/application/adapter-health-tracker.d.ts +17 -0
  235. package/dist/src/integrations/application/agent-run-publication-reactor.d.ts +25 -0
  236. package/dist/src/integrations/application/agent-run-publication-reactor.js +36 -20
  237. package/dist/src/integrations/application/artifact-registration-reactor.d.ts +32 -0
  238. package/dist/src/integrations/application/artifact-registration-reactor.js +43 -35
  239. package/dist/src/integrations/application/poll-service.d.ts +13 -0
  240. package/dist/src/integrations/application/poll-service.js +2 -2
  241. package/dist/src/integrations/application/terminal-agent-run-report.d.ts +33 -0
  242. package/dist/src/integrations/application/work-admission.d.ts +30 -0
  243. package/dist/src/integrations/application/work-conclusion.d.ts +13 -0
  244. package/dist/src/integrations/contracts/artifact-event-factory.d.ts +6 -0
  245. package/dist/src/integrations/contracts/artifact-event-factory.js +8 -0
  246. package/dist/src/integrations/contracts/artifact-events.d.ts +31 -0
  247. package/dist/src/integrations/contracts/artifact-events.js +24 -24
  248. package/dist/src/integrations/contracts/artifact-vocabulary.d.ts +11 -0
  249. package/dist/src/integrations/contracts/config.d.ts +13 -0
  250. package/dist/src/integrations/contracts/identifiers.d.ts +3 -0
  251. package/dist/src/integrations/contracts/intake-rules.d.ts +15 -0
  252. package/dist/src/integrations/contracts/intake.d.ts +15 -0
  253. package/dist/src/integrations/contracts/outcome-vocabulary.d.ts +6 -0
  254. package/dist/src/integrations/contracts/provider.d.ts +105 -0
  255. package/dist/src/integrations/contracts/reply-routing.d.ts +31 -0
  256. package/dist/src/integrations/contracts/streams.d.ts +12 -0
  257. package/dist/src/integrations/delivery/application/delivery-outcome-reactor.d.ts +24 -0
  258. package/dist/src/integrations/delivery/application/delivery-outcome-reactor.js +151 -73
  259. package/dist/src/integrations/delivery/application/delivery-projector.d.ts +5 -0
  260. package/dist/src/integrations/delivery/application/delivery-projector.js +52 -52
  261. package/dist/src/integrations/delivery/application/delivery-service.d.ts +40 -0
  262. package/dist/src/integrations/delivery/application/delivery-service.js +15 -16
  263. package/dist/src/integrations/delivery/contracts/commands.d.ts +7 -0
  264. package/dist/src/integrations/delivery/contracts/config.d.ts +25 -0
  265. package/dist/src/integrations/delivery/contracts/event-factory.d.ts +11 -0
  266. package/dist/src/integrations/delivery/contracts/event-factory.js +20 -9
  267. package/dist/src/integrations/delivery/contracts/events.d.ts +46 -0
  268. package/dist/src/integrations/delivery/contracts/events.js +33 -18
  269. package/dist/src/integrations/delivery/contracts/intents.d.ts +54 -0
  270. package/dist/src/integrations/delivery/contracts/intents.js +21 -14
  271. package/dist/src/integrations/delivery/contracts/views.d.ts +47 -0
  272. package/dist/src/integrations/delivery/contracts/vocabulary.d.ts +25 -0
  273. package/dist/src/integrations/fake/durable-delivery-provider.d.ts +29 -0
  274. package/dist/src/integrations/fake/external-sink.d.ts +5 -0
  275. package/dist/src/integrations/fake/external-source.d.ts +30 -0
  276. package/dist/src/integrations/fake/external-source.js +1 -3
  277. package/dist/src/integrations/fake/inbound-translator.d.ts +16 -0
  278. package/dist/src/integrations/fake/inbound-translator.js +22 -10
  279. package/dist/src/integrations/fake/provider.d.ts +38 -0
  280. package/dist/src/integrations/fake/provider.js +3 -1
  281. package/dist/src/integrations/github/application/agent-context-reader.d.ts +6 -0
  282. package/dist/src/integrations/github/application/agent-context-reader.js +10 -7
  283. package/dist/src/integrations/github/application/agent-run-comment.d.ts +22 -0
  284. package/dist/src/integrations/github/application/comment-history-reader.d.ts +25 -0
  285. package/dist/src/integrations/github/application/comment-history-reader.js +36 -32
  286. package/dist/src/integrations/github/application/delivery-marker.d.ts +2 -0
  287. package/dist/src/integrations/github/application/inbound-comment-syntax.d.ts +8 -0
  288. package/dist/src/integrations/github/application/inbound-context.d.ts +3 -0
  289. package/dist/src/integrations/github/application/inbound-context.js +4 -4
  290. package/dist/src/integrations/github/application/inbound-review-signals.d.ts +21 -0
  291. package/dist/src/integrations/github/application/inbound-review-signals.js +30 -25
  292. package/dist/src/integrations/github/application/inbound-translator.d.ts +103 -0
  293. package/dist/src/integrations/github/application/inbound-translator.js +149 -160
  294. package/dist/src/integrations/github/application/inbound-watch-gate-signals.d.ts +10 -0
  295. package/dist/src/integrations/github/application/inbound-watch-gate-signals.js +4 -4
  296. package/dist/src/integrations/github/application/intake-policy.d.ts +7 -0
  297. package/dist/src/integrations/github/application/operator-retry-command.d.ts +1 -0
  298. package/dist/src/integrations/github/application/outbound-translator.d.ts +19 -0
  299. package/dist/src/integrations/github/application/poll-service.d.ts +11 -0
  300. package/dist/src/integrations/github/application/poll-service.js +11 -2
  301. package/dist/src/integrations/github/application/pull-request-translation.d.ts +5 -0
  302. package/dist/src/integrations/github/application/reply-target-selector.d.ts +8 -0
  303. package/dist/src/integrations/github/application/resource-links.d.ts +2 -0
  304. package/dist/src/integrations/github/application/review-command-translator.d.ts +14 -0
  305. package/dist/src/integrations/github/application/wake-labels.d.ts +29 -0
  306. package/dist/src/integrations/github/contracts/check-evidence.d.ts +1 -0
  307. package/dist/src/integrations/github/contracts/config.d.ts +81 -0
  308. package/dist/src/integrations/github/contracts/event-factory.d.ts +6 -0
  309. package/dist/src/integrations/github/contracts/event-factory.js +26 -0
  310. package/dist/src/integrations/github/contracts/events.d.ts +135 -0
  311. package/dist/src/integrations/github/contracts/events.js +118 -132
  312. package/dist/src/integrations/github/contracts/external-key.d.ts +8 -0
  313. package/dist/src/integrations/github/contracts/issue-query.d.ts +5 -0
  314. package/dist/src/integrations/github/contracts/payloads.d.ts +74 -0
  315. package/dist/src/integrations/github/contracts/vocabulary.d.ts +64 -0
  316. package/dist/src/integrations/github/index.d.ts +34 -0
  317. package/dist/src/integrations/github/index.js +1 -0
  318. package/dist/src/integrations/github/infrastructure/adapter-health-registry.d.ts +11 -0
  319. package/dist/src/integrations/github/infrastructure/bounded-fetch.d.ts +10 -0
  320. package/dist/src/integrations/github/infrastructure/client-reads.d.ts +255 -0
  321. package/dist/src/integrations/github/infrastructure/client.d.ts +263 -0
  322. package/dist/src/integrations/github/infrastructure/comment-source.d.ts +7 -0
  323. package/dist/src/integrations/github/infrastructure/content-fingerprint.d.ts +2 -0
  324. package/dist/src/integrations/github/infrastructure/delivery.d.ts +6 -0
  325. package/dist/src/integrations/github/infrastructure/etag-cache.d.ts +29 -0
  326. package/dist/src/integrations/github/infrastructure/gh-auth.d.ts +4 -0
  327. package/dist/src/integrations/github/infrastructure/issue-source.d.ts +20 -0
  328. package/dist/src/integrations/github/infrastructure/issue-source.js +10 -6
  329. package/dist/src/integrations/github/infrastructure/poll-watermark.d.ts +12 -0
  330. package/dist/src/integrations/github/infrastructure/pr-source.d.ts +16 -0
  331. package/dist/src/integrations/github/infrastructure/pr-source.js +6 -4
  332. package/dist/src/integrations/github/infrastructure/request-coordinator.d.ts +13 -0
  333. package/dist/src/integrations/github/infrastructure/review-source.d.ts +10 -0
  334. package/dist/src/integrations/github/infrastructure/review-source.js +29 -25
  335. package/dist/src/integrations/github/infrastructure/source-contracts.d.ts +22 -0
  336. package/dist/src/integrations/github/infrastructure/source.d.ts +12 -0
  337. package/dist/src/integrations/github/infrastructure/source.js +3 -5
  338. package/dist/src/integrations/github/provider.d.ts +3 -0
  339. package/dist/src/integrations/github/provider.js +14 -12
  340. package/dist/src/integrations/index.d.ts +32 -0
  341. package/dist/src/integrations/index.js +1 -0
  342. package/dist/src/kernel/contracts/clock.d.ts +3 -0
  343. package/dist/src/kernel/contracts/id-generator.d.ts +3 -0
  344. package/dist/src/kernel/contracts/identifiers.d.ts +7 -0
  345. package/dist/src/kernel/contracts/identifiers.js +1 -8
  346. package/dist/src/kernel/contracts/relations.d.ts +14 -0
  347. package/dist/src/kernel/contracts/schema.d.ts +3 -0
  348. package/dist/src/kernel/contracts/vocabulary.d.ts +7 -0
  349. package/dist/src/kernel/domain/match-mode.d.ts +2 -0
  350. package/dist/src/kernel/domain/relation.d.ts +9 -0
  351. package/dist/src/kernel/index.d.ts +10 -0
  352. package/dist/src/kernel/index.js +0 -11
  353. package/dist/src/kernel/infrastructure/system-clock.d.ts +4 -0
  354. package/dist/src/kernel/infrastructure/ulid-id-generator.d.ts +4 -0
  355. package/dist/src/main.d.ts +15 -0
  356. package/dist/src/main.js +8 -2
  357. package/dist/src/node_modules/@atolis-hq/eventing/LICENSE +201 -0
  358. package/dist/src/node_modules/@atolis-hq/eventing/README.md +41 -0
  359. package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/commands.d.ts +9 -0
  360. package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/commands.d.ts.map +1 -0
  361. package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-envelope.d.ts +13 -0
  362. package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-envelope.d.ts.map +1 -0
  363. package/dist/src/{kernel/domain → node_modules/@atolis-hq/eventing/dist/contracts}/event-envelope.js +4 -4
  364. package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-schema.d.ts +83 -0
  365. package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/event-schema.d.ts.map +1 -0
  366. package/dist/src/{kernel → node_modules/@atolis-hq/eventing/dist}/contracts/event-schema.js +21 -5
  367. package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/events.d.ts +46 -0
  368. package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/events.d.ts.map +1 -0
  369. package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/events.js +10 -0
  370. package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/identifiers.d.ts +11 -0
  371. package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/identifiers.d.ts.map +1 -0
  372. package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/identifiers.js +8 -0
  373. package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/processor-state-store.d.ts +11 -0
  374. package/dist/src/node_modules/@atolis-hq/eventing/dist/contracts/processor-state-store.d.ts.map +1 -0
  375. package/dist/src/node_modules/@atolis-hq/eventing/dist/index.d.ts +19 -0
  376. package/dist/src/node_modules/@atolis-hq/eventing/dist/index.d.ts.map +1 -0
  377. package/dist/src/node_modules/@atolis-hq/eventing/dist/index.js +17 -0
  378. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-checkpoint-store.d.ts +8 -0
  379. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-checkpoint-store.d.ts.map +1 -0
  380. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-event-journal.d.ts +19 -0
  381. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-event-journal.d.ts.map +1 -0
  382. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-event-journal.js +82 -0
  383. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-run-serialiser.d.ts +6 -0
  384. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-run-serialiser.d.ts.map +1 -0
  385. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-run-serialiser.js +26 -0
  386. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-state-store.d.ts +8 -0
  387. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-state-store.d.ts.map +1 -0
  388. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-processor-state-store.js +20 -0
  389. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-projection-store.d.ts +9 -0
  390. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-memory-projection-store.d.ts.map +1 -0
  391. package/dist/src/{persistence → node_modules/@atolis-hq/eventing/dist}/memory/in-memory-projection-store.js +2 -1
  392. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-process-journal-change-signal.d.ts +10 -0
  393. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory/in-process-journal-change-signal.d.ts.map +1 -0
  394. package/dist/src/{kernel/infrastructure/journal-change-signal.js → node_modules/@atolis-hq/eventing/dist/memory/in-process-journal-change-signal.js} +5 -2
  395. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory.d.ts +7 -0
  396. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory.d.ts.map +1 -0
  397. package/dist/src/node_modules/@atolis-hq/eventing/dist/memory.js +6 -0
  398. package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-processor.d.ts +20 -0
  399. package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-processor.d.ts.map +1 -0
  400. package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-processor.js +83 -0
  401. package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-store.d.ts +22 -0
  402. package/dist/src/node_modules/@atolis-hq/eventing/dist/projections/projection-store.d.ts.map +1 -0
  403. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/cached-journal-view.d.ts +8 -0
  404. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/cached-journal-view.d.ts.map +1 -0
  405. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/cached-journal-view.js +24 -0
  406. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/clock.d.ts +4 -0
  407. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/clock.d.ts.map +1 -0
  408. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/event-processor-host.d.ts +39 -0
  409. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/event-processor-host.d.ts.map +1 -0
  410. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/event-processor-host.js +168 -0
  411. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-health.d.ts +43 -0
  412. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-health.d.ts.map +1 -0
  413. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-health.js +66 -0
  414. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-run-serialiser.d.ts +2 -0
  415. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-run-serialiser.d.ts.map +1 -0
  416. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-run-serialiser.js +1 -0
  417. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-validation.d.ts +7 -0
  418. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-validation.d.ts.map +1 -0
  419. package/dist/src/node_modules/@atolis-hq/eventing/dist/runtime/processor-validation.js +43 -0
  420. package/dist/src/node_modules/@atolis-hq/eventing/dist/store/checkpoint-store.d.ts +6 -0
  421. package/dist/src/node_modules/@atolis-hq/eventing/dist/store/checkpoint-store.d.ts.map +1 -0
  422. package/dist/src/node_modules/@atolis-hq/eventing/dist/store/checkpoint-store.js +1 -0
  423. package/dist/src/node_modules/@atolis-hq/eventing/dist/store/event-journal.d.ts +14 -0
  424. package/dist/src/node_modules/@atolis-hq/eventing/dist/store/event-journal.d.ts.map +1 -0
  425. package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/event-processor.d.ts +49 -0
  426. package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/event-processor.d.ts.map +1 -0
  427. package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/event-processor.js +17 -0
  428. package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/journal-change-signal.d.ts +6 -0
  429. package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/journal-change-signal.d.ts.map +1 -0
  430. package/dist/src/node_modules/@atolis-hq/eventing/dist/subscriptions/journal-change-signal.js +1 -0
  431. package/dist/src/node_modules/@atolis-hq/eventing/package.json +42 -0
  432. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/LICENSE +201 -0
  433. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/README.md +40 -0
  434. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/atomic-write.d.ts +23 -0
  435. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/atomic-write.d.ts.map +1 -0
  436. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/atomic-write.js +54 -0
  437. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/event-record-codec.d.ts +4 -0
  438. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/event-record-codec.d.ts.map +1 -0
  439. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/event-record-codec.js +50 -0
  440. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-checkpoint-store.d.ts +17 -0
  441. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-checkpoint-store.d.ts.map +1 -0
  442. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-checkpoint-store.js +99 -0
  443. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-event-journal.d.ts +51 -0
  444. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-event-journal.d.ts.map +1 -0
  445. package/dist/src/{persistence/filesystem → node_modules/@atolis-hq/eventing-filesystem/dist}/file-event-journal.js +185 -103
  446. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-lock.d.ts +34 -0
  447. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-lock.d.ts.map +1 -0
  448. package/dist/src/{persistence/filesystem → node_modules/@atolis-hq/eventing-filesystem/dist}/file-lock.js +10 -1
  449. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-run-serialiser.d.ts +9 -0
  450. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-run-serialiser.d.ts.map +1 -0
  451. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-run-serialiser.js +82 -0
  452. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-state-store.d.ts +12 -0
  453. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-state-store.d.ts.map +1 -0
  454. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-processor-state-store.js +127 -0
  455. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-projection-store.d.ts +19 -0
  456. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-projection-store.d.ts.map +1 -0
  457. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-projection-store.js +219 -0
  458. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/index.d.ts +7 -0
  459. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/index.d.ts.map +1 -0
  460. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/index.js +6 -0
  461. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-paths.d.ts +10 -0
  462. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-paths.d.ts.map +1 -0
  463. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-paths.js +27 -0
  464. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-record.d.ts +8 -0
  465. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-record.d.ts.map +1 -0
  466. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/processor-state-record.js +28 -0
  467. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/storage-name.d.ts +6 -0
  468. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/storage-name.d.ts.map +1 -0
  469. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/storage-name.js +34 -0
  470. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/package.json +38 -0
  471. package/dist/src/orchestration/application/accept-activity-outcome.d.ts +18 -0
  472. package/dist/src/orchestration/application/accept-signal.d.ts +14 -0
  473. package/dist/src/orchestration/application/advance-workflow.d.ts +50 -0
  474. package/dist/src/orchestration/application/advance-workflow.js +7 -12
  475. package/dist/src/orchestration/application/coordination-claims.d.ts +17 -0
  476. package/dist/src/orchestration/application/coordination-claims.js +17 -20
  477. package/dist/src/orchestration/application/durable-append.d.ts +17 -0
  478. package/dist/src/orchestration/application/durable-append.js +1 -1
  479. package/dist/src/orchestration/application/group-budget-recorder.d.ts +9 -0
  480. package/dist/src/orchestration/application/group-budget-recorder.js +9 -6
  481. package/dist/src/orchestration/application/orchestration-projection.d.ts +6 -0
  482. package/dist/src/orchestration/application/orchestration-projection.js +6 -7
  483. package/dist/src/orchestration/application/orchestration-repository.d.ts +23 -0
  484. package/dist/src/orchestration/application/orchestration-repository.js +2 -2
  485. package/dist/src/orchestration/application/orchestration-service.d.ts +93 -0
  486. package/dist/src/orchestration/application/orchestration-service.js +10 -1
  487. package/dist/src/orchestration/application/pull-request-transition-evidence.d.ts +3 -0
  488. package/dist/src/orchestration/application/pull-request-transition-evidence.js +10 -10
  489. package/dist/src/orchestration/application/reactor-command-context.d.ts +5 -0
  490. package/dist/src/orchestration/application/reactor-command-context.js +9 -0
  491. package/dist/src/orchestration/application/request-child.d.ts +29 -0
  492. package/dist/src/orchestration/application/request-child.js +26 -10
  493. package/dist/src/orchestration/application/resource-transition-evidence.d.ts +18 -0
  494. package/dist/src/orchestration/application/resource-transition-matching.d.ts +19 -0
  495. package/dist/src/orchestration/application/resource-transition-matching.js +9 -3
  496. package/dist/src/orchestration/application/resource-transition-reactor.d.ts +16 -0
  497. package/dist/src/orchestration/application/resource-transition-reactor.js +21 -42
  498. package/dist/src/orchestration/application/signal-reactor.d.ts +11 -0
  499. package/dist/src/orchestration/application/start-workflow.d.ts +18 -0
  500. package/dist/src/orchestration/application/start-workflow.js +3 -4
  501. package/dist/src/orchestration/application/trigger-workflow-instance.d.ts +12 -0
  502. package/dist/src/orchestration/application/trigger-workflow-instance.js +1 -1
  503. package/dist/src/orchestration/application/watch-child-transitions.d.ts +2 -0
  504. package/dist/src/orchestration/application/watch-matching.d.ts +13 -0
  505. package/dist/src/orchestration/application/watch-matching.js +3 -3
  506. package/dist/src/orchestration/application/watch-reactor.d.ts +42 -0
  507. package/dist/src/orchestration/application/watch-reactor.js +36 -35
  508. package/dist/src/orchestration/application/workflow-definition-registry.d.ts +32 -0
  509. package/dist/src/orchestration/application/workflow-definition-registry.js +13 -11
  510. package/dist/src/orchestration/contracts/activity-outcome.d.ts +15 -0
  511. package/dist/src/orchestration/contracts/commands.d.ts +30 -0
  512. package/dist/src/orchestration/contracts/config.d.ts +356 -0
  513. package/dist/src/orchestration/contracts/event-decoder.d.ts +262 -0
  514. package/dist/src/orchestration/contracts/event-decoder.js +88 -64
  515. package/dist/src/orchestration/contracts/event-factory.d.ts +6 -0
  516. package/dist/src/orchestration/contracts/event-factory.js +64 -0
  517. package/dist/src/orchestration/contracts/events.d.ts +233 -0
  518. package/dist/src/orchestration/contracts/identifiers.d.ts +15 -0
  519. package/dist/src/orchestration/contracts/streams.d.ts +28 -0
  520. package/dist/src/orchestration/contracts/views.d.ts +68 -0
  521. package/dist/src/orchestration/contracts/vocabulary.d.ts +34 -0
  522. package/dist/src/orchestration/domain/activation-policy.d.ts +60 -0
  523. package/dist/src/orchestration/domain/activation-policy.js +34 -19
  524. package/dist/src/orchestration/domain/approval-defaults.d.ts +8 -0
  525. package/dist/src/orchestration/domain/child-policy.d.ts +20 -0
  526. package/dist/src/orchestration/domain/compiler.d.ts +3 -0
  527. package/dist/src/orchestration/domain/coordination-events.d.ts +18 -0
  528. package/dist/src/orchestration/domain/coordination-events.js +25 -11
  529. package/dist/src/orchestration/domain/decision-events.d.ts +33 -0
  530. package/dist/src/orchestration/domain/decision-events.js +26 -15
  531. package/dist/src/orchestration/domain/interpreter.d.ts +14 -0
  532. package/dist/src/orchestration/domain/interpreter.js +4 -1
  533. package/dist/src/orchestration/domain/operator-retry-policy.d.ts +14 -0
  534. package/dist/src/orchestration/domain/operator-retry-policy.js +29 -11
  535. package/dist/src/orchestration/domain/resource-transition-compiler.d.ts +8 -0
  536. package/dist/src/orchestration/domain/retry-policy.d.ts +7 -0
  537. package/dist/src/orchestration/domain/retry-policy.js +7 -4
  538. package/dist/src/orchestration/domain/runner-quota-retry-policy.d.ts +10 -0
  539. package/dist/src/orchestration/domain/runner-quota-retry-policy.js +21 -15
  540. package/dist/src/orchestration/domain/signal-policy.d.ts +11 -0
  541. package/dist/src/orchestration/domain/signal-policy.js +18 -7
  542. package/dist/src/orchestration/domain/supplemental-policy.d.ts +11 -0
  543. package/dist/src/orchestration/domain/supplemental-policy.js +29 -14
  544. package/dist/src/orchestration/domain/transition.d.ts +16 -0
  545. package/dist/src/orchestration/domain/transition.js +46 -28
  546. package/dist/src/orchestration/domain/workflow-graph.d.ts +4 -0
  547. package/dist/src/orchestration/domain/workflow-instance-events.d.ts +44 -0
  548. package/dist/src/orchestration/domain/workflow-instance.d.ts +7 -0
  549. package/dist/src/orchestration/domain/workflow-instance.js +29 -9
  550. package/dist/src/orchestration/domain/workflow-selector.d.ts +15 -0
  551. package/dist/src/orchestration/index.d.ts +27 -0
  552. package/dist/src/orchestration/index.js +1 -0
  553. package/dist/src/resources/application/lookup-projections.d.ts +6 -0
  554. package/dist/src/resources/application/lookup-projections.js +15 -15
  555. package/dist/src/resources/application/resource-correlation-retry.d.ts +16 -0
  556. package/dist/src/resources/application/resource-correlation-retry.js +39 -44
  557. package/dist/src/resources/application/resource-event-support.d.ts +12 -0
  558. package/dist/src/resources/application/resource-event-support.js +17 -0
  559. package/dist/src/resources/application/resource-lookup.d.ts +17 -0
  560. package/dist/src/resources/application/resource-lookup.js +9 -9
  561. package/dist/src/resources/application/resource-projections.d.ts +4 -0
  562. package/dist/src/resources/application/resource-projections.js +32 -24
  563. package/dist/src/resources/application/resource-repository.d.ts +16 -0
  564. package/dist/src/resources/application/resource-repository.js +3 -3
  565. package/dist/src/resources/application/resource-service.d.ts +34 -0
  566. package/dist/src/resources/application/resource-service.js +73 -52
  567. package/dist/src/resources/contracts/commands.d.ts +23 -0
  568. package/dist/src/resources/contracts/config.d.ts +3 -0
  569. package/dist/src/resources/contracts/event-factory.d.ts +6 -0
  570. package/dist/src/resources/contracts/event-factory.js +32 -0
  571. package/dist/src/resources/contracts/events.d.ts +79 -0
  572. package/dist/src/resources/contracts/events.js +94 -102
  573. package/dist/src/resources/contracts/identifiers.d.ts +7 -0
  574. package/dist/src/resources/contracts/streams.d.ts +8 -0
  575. package/dist/src/resources/contracts/views.d.ts +35 -0
  576. package/dist/src/resources/contracts/vocabulary.d.ts +50 -0
  577. package/dist/src/resources/domain/correlation.d.ts +6 -0
  578. package/dist/src/resources/domain/resource.d.ts +8 -0
  579. package/dist/src/resources/domain/resource.js +24 -21
  580. package/dist/src/resources/index.d.ts +15 -0
  581. package/dist/src/resources/index.js +1 -0
  582. package/dist/src/surfaces/api/contracts/activities.d.ts +1 -0
  583. package/dist/src/surfaces/api/contracts/board.d.ts +46 -0
  584. package/dist/src/surfaces/api/contracts/board.js +1 -1
  585. package/dist/src/surfaces/api/contracts/common.d.ts +43 -0
  586. package/dist/src/surfaces/api/contracts/control-plane.d.ts +37 -0
  587. package/dist/src/surfaces/api/contracts/events.d.ts +13 -0
  588. package/dist/src/surfaces/api/contracts/execution.d.ts +67 -0
  589. package/dist/src/surfaces/api/contracts/index.d.ts +14 -0
  590. package/dist/src/surfaces/api/contracts/observability.d.ts +10 -0
  591. package/dist/src/surfaces/api/contracts/orchestration.d.ts +16 -0
  592. package/dist/src/surfaces/api/contracts/resources.d.ts +10 -0
  593. package/dist/src/surfaces/api/contracts/status.d.ts +4 -0
  594. package/dist/src/surfaces/api/contracts/system.d.ts +32 -0
  595. package/dist/src/surfaces/api/contracts/transport-values.d.ts +50 -0
  596. package/dist/src/surfaces/api/contracts/transport-values.js +6 -0
  597. package/dist/src/surfaces/api/contracts/work.d.ts +74 -0
  598. package/dist/src/surfaces/api/contracts/workflow-diagram.d.ts +64 -0
  599. package/dist/src/surfaces/api/http-server.d.ts +33 -0
  600. package/dist/src/surfaces/api/http-server.js +2 -2
  601. package/dist/src/surfaces/api/presenters/activities.d.ts +1 -0
  602. package/dist/src/surfaces/api/presenters/board.d.ts +2 -0
  603. package/dist/src/surfaces/api/presenters/control-plane.d.ts +1 -0
  604. package/dist/src/surfaces/api/presenters/events.d.ts +1 -0
  605. package/dist/src/surfaces/api/presenters/execution.d.ts +3 -0
  606. package/dist/src/surfaces/api/presenters/execution.js +5 -2
  607. package/dist/src/surfaces/api/presenters/observability.d.ts +1 -0
  608. package/dist/src/surfaces/api/presenters/orchestration.d.ts +3 -0
  609. package/dist/src/surfaces/api/presenters/resources.d.ts +3 -0
  610. package/dist/src/surfaces/api/presenters/status.d.ts +2 -0
  611. package/dist/src/surfaces/api/presenters/system.d.ts +2 -0
  612. package/dist/src/surfaces/api/presenters/work.d.ts +4 -0
  613. package/dist/src/surfaces/api/problem-details.d.ts +2 -0
  614. package/dist/src/surfaces/api/router.d.ts +8 -0
  615. package/dist/src/surfaces/api/routes/activities.d.ts +1 -0
  616. package/dist/src/surfaces/api/routes/applications.d.ts +88 -0
  617. package/dist/src/surfaces/api/routes/commands.d.ts +3 -0
  618. package/dist/src/surfaces/api/routes/commands.js +1 -3
  619. package/dist/src/surfaces/api/routes/control-plane.d.ts +1 -0
  620. package/dist/src/surfaces/api/routes/control-plane.js +0 -1
  621. package/dist/src/surfaces/api/routes/events.d.ts +1 -0
  622. package/dist/src/surfaces/api/routes/execution.d.ts +1 -0
  623. package/dist/src/surfaces/api/routes/index.d.ts +4 -0
  624. package/dist/src/surfaces/api/routes/observability.d.ts +1 -0
  625. package/dist/src/surfaces/api/routes/orchestration.d.ts +1 -0
  626. package/dist/src/surfaces/api/routes/pagination.d.ts +5 -0
  627. package/dist/src/surfaces/api/routes/read.d.ts +3 -0
  628. package/dist/src/surfaces/api/routes/resources.d.ts +1 -0
  629. package/dist/src/surfaces/api/routes/responses.d.ts +15 -0
  630. package/dist/src/surfaces/api/routes/system.d.ts +1 -0
  631. package/dist/src/surfaces/api/routes/work.d.ts +1 -0
  632. package/dist/src/surfaces/auth/credentials.d.ts +22 -0
  633. package/dist/src/surfaces/auth/credentials.js +8 -12
  634. package/dist/src/surfaces/auth/vocabulary.d.ts +9 -0
  635. package/dist/src/surfaces/cli/commands/api.d.ts +4 -0
  636. package/dist/src/surfaces/cli/commands/audit.d.ts +16 -0
  637. package/dist/src/surfaces/cli/commands/audit.js +11 -2
  638. package/dist/src/surfaces/cli/commands/correlate.d.ts +7 -0
  639. package/dist/src/surfaces/cli/commands/doctor.d.ts +24 -0
  640. package/dist/src/surfaces/cli/commands/init.d.ts +2 -0
  641. package/dist/src/surfaces/cli/commands/sandbox-entrypoint.d.ts +43 -0
  642. package/dist/src/surfaces/cli/commands/sandbox-setup.d.ts +9 -0
  643. package/dist/src/surfaces/cli/commands/sandbox.d.ts +16 -0
  644. package/dist/src/surfaces/cli/commands/self-update.d.ts +15 -0
  645. package/dist/src/surfaces/cli/commands/smoke.d.ts +14 -0
  646. package/dist/src/surfaces/cli/commands/start.d.ts +5 -0
  647. package/dist/src/surfaces/cli/commands/stop.d.ts +11 -0
  648. package/dist/src/surfaces/cli/commands/tick.d.ts +5 -0
  649. package/dist/src/surfaces/cli/commands/ui.d.ts +5 -0
  650. package/dist/src/surfaces/cli/commands/validate-state.d.ts +13 -0
  651. package/dist/src/surfaces/cli/infrastructure/docker-cli.d.ts +66 -0
  652. package/dist/src/surfaces/cli/infrastructure/docker-invocation.d.ts +14 -0
  653. package/dist/src/surfaces/cli/infrastructure/process-log.d.ts +35 -0
  654. package/dist/src/surfaces/cli/infrastructure/resident-start.d.ts +10 -0
  655. package/dist/src/surfaces/cli/main.d.ts +115 -0
  656. package/dist/src/surfaces/cli/usage.d.ts +1 -0
  657. package/dist/src/surfaces/contracts/config.d.ts +51 -0
  658. package/dist/src/surfaces/index.d.ts +49 -0
  659. package/dist/src/surfaces/web-assets/assets/index-D9xGa5tD.css +1 -0
  660. package/dist/src/surfaces/web-assets/assets/index-qai1Ymhv.js +1179 -0
  661. package/dist/src/surfaces/web-assets/index.html +2 -2
  662. package/dist/src/surfaces/web-host/asset-source.d.ts +9 -0
  663. package/dist/src/surfaces/web-host/packaged-assets.d.ts +8 -0
  664. package/dist/src/work/application/work-projection.d.ts +3 -0
  665. package/dist/src/work/application/work-projection.js +4 -4
  666. package/dist/src/work/application/work-repository.d.ts +15 -0
  667. package/dist/src/work/application/work-repository.js +2 -2
  668. package/dist/src/work/application/work-service.d.ts +18 -0
  669. package/dist/src/work/application/work-service.js +70 -31
  670. package/dist/src/work/contracts/commands.d.ts +15 -0
  671. package/dist/src/work/contracts/config.d.ts +3 -0
  672. package/dist/src/work/contracts/event-factory.d.ts +6 -0
  673. package/dist/src/work/contracts/event-factory.js +26 -0
  674. package/dist/src/work/contracts/events.d.ts +46 -0
  675. package/dist/src/work/contracts/events.js +54 -60
  676. package/dist/src/work/contracts/identifiers.d.ts +3 -0
  677. package/dist/src/work/contracts/streams.d.ts +8 -0
  678. package/dist/src/work/contracts/views.d.ts +18 -0
  679. package/dist/src/work/contracts/vocabulary.d.ts +7 -0
  680. package/dist/src/work/domain/work-item.d.ts +3 -0
  681. package/dist/src/work/domain/work-item.js +10 -7
  682. package/dist/src/work/index.d.ts +12 -0
  683. package/dist/src/work/index.js +1 -0
  684. package/docker/Dockerfile +9 -7
  685. package/docker/Dockerfile.packaged +4 -6
  686. package/package.json +24 -24
  687. package/dist/src/activities/pr/event-drafts.js +0 -66
  688. package/dist/src/kernel/contracts/events.js +0 -11
  689. package/dist/src/kernel/infrastructure/cached-journal-view.js +0 -27
  690. package/dist/src/persistence/application/projection-runner.js +0 -128
  691. package/dist/src/persistence/filesystem/file-checkpoint-store.js +0 -50
  692. package/dist/src/persistence/filesystem/file-projection-store.js +0 -137
  693. package/dist/src/persistence/index.js +0 -8
  694. package/dist/src/persistence/memory/in-memory-event-journal.js +0 -99
  695. package/dist/src/surfaces/web-assets/assets/index-B0ofn_L5.css +0 -1
  696. package/dist/src/surfaces/web-assets/assets/index-DFBhpSSX.js +0 -1179
  697. /package/dist/src/control-plane/application/{advance-once-ports.js → activation-scheduler-ports.js} +0 -0
  698. /package/dist/src/{kernel → node_modules/@atolis-hq/eventing/dist}/contracts/commands.js +0 -0
  699. /package/dist/src/{kernel/contracts/checkpoint-store.js → node_modules/@atolis-hq/eventing/dist/contracts/processor-state-store.js} +0 -0
  700. /package/dist/src/{persistence → node_modules/@atolis-hq/eventing/dist}/memory/in-memory-checkpoint-store.js +0 -0
  701. /package/dist/src/{kernel/contracts → node_modules/@atolis-hq/eventing/dist/projections}/projection-store.js +0 -0
  702. /package/dist/src/{kernel/contracts/journal-change-signal.js → node_modules/@atolis-hq/eventing/dist/runtime/clock.js} +0 -0
  703. /package/dist/src/{kernel/contracts → node_modules/@atolis-hq/eventing/dist/store}/event-journal.js +0 -0
@@ -0,0 +1,33 @@
1
+ import { type FastifyInstance } from 'fastify';
2
+ import { type SurfaceCredentials } from '../auth/credentials.js';
3
+ import type { AssetSource } from '../web-host/asset-source.js';
4
+ declare module '@fastify/secure-session' {
5
+ interface SessionData {
6
+ operator?: boolean;
7
+ }
8
+ }
9
+ export interface ApiHttpResponse {
10
+ readonly status: number;
11
+ readonly body: unknown;
12
+ readonly contentType?: string;
13
+ readonly headers?: Readonly<Record<string, string>>;
14
+ }
15
+ /** A transport-only dispatcher supplied by Bootstrap composition. */
16
+ export interface ApiDispatcher {
17
+ dispatch(method: string, pathname: string, body: unknown): Promise<ApiHttpResponse | undefined>;
18
+ }
19
+ export interface SurfaceHttpServerOptions {
20
+ readonly dispatcher: ApiDispatcher;
21
+ readonly credentials: SurfaceCredentials;
22
+ readonly assets?: AssetSource;
23
+ readonly auth?: {
24
+ readonly disabled: boolean;
25
+ readonly redeemGrant: (grant: string) => Promise<boolean>;
26
+ };
27
+ }
28
+ /**
29
+ * The production HTTP surface. Public login routes are declared separately;
30
+ * every operational API route is protected in its own Fastify scope before
31
+ * Fastify parses the request body.
32
+ */
33
+ export declare function createSurfaceHttpServer(options: SurfaceHttpServerOptions): FastifyInstance;
@@ -127,8 +127,8 @@ function errorResult(error) {
127
127
  // Duck-types an octokit RequestError (or any similarly-shaped upstream HTTP
128
128
  // client failure) by its `.status` field — the same detection already used
129
129
  // for GitHub 404s in integrations/github/provider.ts's verifyArtifact. A
130
- // synchronous command (like manual tick) that happens to run while an
131
- // external provider is rate-limited or unreachable should surface as a
130
+ // synchronous command that happens to run while an external provider is
131
+ // rate-limited or unreachable should surface as a
132
132
  // distinguishable gateway failure, not an opaque "Internal Server Error"
133
133
  // indistinguishable from an actual Wake bug.
134
134
  function isUpstreamProviderError(error) {
@@ -0,0 +1 @@
1
+ export { resourceResponse as presentActivity } from '../contracts/common.js';
@@ -0,0 +1,2 @@
1
+ import type { BoardCardResponse } from '../contracts/board.js';
2
+ export declare function presentBoardCard(card: BoardCardResponse): BoardCardResponse;
@@ -0,0 +1 @@
1
+ export { resourceResponse as presentControlPlane } from '../contracts/common.js';
@@ -0,0 +1 @@
1
+ export { collectionResponse as presentEvents } from '../contracts/common.js';
@@ -0,0 +1,3 @@
1
+ import { type RunView } from '../../../execution/index.js';
2
+ import type { RunResponse } from '../contracts/execution.js';
3
+ export declare function presentRun(value: RunView): RunResponse;
@@ -1,5 +1,5 @@
1
1
  import { ActivityOutcomeKind } from '../../../activities/index.js';
2
- import { agentTokenUsage, RunStatus, } from '../../../execution/index.js';
2
+ import { agentTokenUsage, isActiveRunStatus, } from '../../../execution/index.js';
3
3
  const outcomeSentinels = {
4
4
  [ActivityOutcomeKind.Done]: 'DONE',
5
5
  [ActivityOutcomeKind.Rejected]: 'REJECTED',
@@ -24,8 +24,11 @@ export function presentRun(value) {
24
24
  orchestrationGroupId: value.orchestrationGroupId,
25
25
  attempt: value.attempt,
26
26
  status: value.status,
27
- active: value.status === RunStatus.Started,
27
+ active: isActiveRunStatus(value.status),
28
28
  startedAt: value.startedAt,
29
+ ...(value.executionStartedAt === undefined
30
+ ? {}
31
+ : { executionStartedAt: value.executionStartedAt }),
29
32
  ...(value.finishedAt === undefined ? {} : { finishedAt: value.finishedAt }),
30
33
  ...(value.outcome === undefined ? {} : { outcome: value.outcome }),
31
34
  ...(value.failure === undefined ? {} : { failure: { kind: value.failure.kind } }),
@@ -0,0 +1 @@
1
+ export { resourceResponse as presentMetrics } from '../contracts/common.js';
@@ -0,0 +1,3 @@
1
+ import { type WorkflowInstanceView } from '../../../orchestration/index.js';
2
+ import type { WorkflowInstanceResponse } from '../contracts/orchestration.js';
3
+ export declare function presentWorkflowInstance(value: WorkflowInstanceView): WorkflowInstanceResponse;
@@ -0,0 +1,3 @@
1
+ import type { ResourceLinkResolver, ResourceView } from '../../../resources/index.js';
2
+ import type { ResourceItemResponse } from '../contracts/resources.js';
3
+ export declare function presentResource(resolveLink: ResourceLinkResolver): (value: ResourceView) => ResourceItemResponse;
@@ -0,0 +1,2 @@
1
+ import type { StatusResponse } from '../contracts/status.js';
2
+ export declare function presentStatus(status: StatusResponse): StatusResponse;
@@ -0,0 +1,2 @@
1
+ export { resourceResponse as presentSystem } from '../contracts/common.js';
2
+ export declare function redactConfiguration(value: object): Readonly<Record<string, unknown>>;
@@ -0,0 +1,4 @@
1
+ import type { WorkItemView } from '../../../work/index.js';
2
+ import { type WorkItemResponse } from '../contracts/work.js';
3
+ /** The current Wake work identity is the canonical transport key; retain the mapping centrally. */
4
+ export declare function presentWorkItem(work: WorkItemView): WorkItemResponse;
@@ -0,0 +1,2 @@
1
+ import type { ProblemDetails } from './contracts/common.js';
2
+ export declare function problemDetails(status: number, title: string, detail?: string, extensions?: Record<string, unknown>): ProblemDetails;
@@ -0,0 +1,8 @@
1
+ import { type ValueOf } from '../../kernel/index.js';
2
+ export declare const BrowserRouteOutcome: {
3
+ readonly Spa: "spa";
4
+ readonly NotFound: "not-found";
5
+ };
6
+ export type BrowserRouteOutcome = ValueOf<typeof BrowserRouteOutcome>;
7
+ /** Browser history fallback must never mask a missing API or static asset. */
8
+ export declare function routeBrowserRequest(method: string, pathname: string): BrowserRouteOutcome;
@@ -0,0 +1 @@
1
+ export declare const activityRoutes: readonly [];
@@ -0,0 +1,88 @@
1
+ import type { RunStatus } from '../../../execution/index.js';
2
+ import type { ApiCommandResult, AuditEventResponse, BoardCardResponse, BoardResponse, CommandsResponse, ConfigurationResponse, ControlPlaneStatusResponse, ConversationMessageRequest, HealthResponse, MetricsResponse, ResourceItemResponse, ResourceResponse, ResponseMeta, RunnerResponse, RunResponse, RunTranscriptResponse, StatusResponse, WorkDetailResponse, WorkflowDiagramsResponse, WorkflowInstanceResponse, WorkItemResponse, WorkItemTranscriptResponse } from '../contracts/index.js';
3
+ export interface CollectionQuery {
4
+ readonly cursor?: {
5
+ readonly position: number;
6
+ };
7
+ readonly limit: number;
8
+ readonly search?: string;
9
+ readonly state?: string;
10
+ readonly workItemKey?: string;
11
+ }
12
+ export interface ApiCollectionPage<T> {
13
+ readonly items: readonly T[];
14
+ readonly meta: ResponseMeta;
15
+ readonly total?: number;
16
+ readonly nextPosition?: number;
17
+ readonly continuationPosition?: number;
18
+ }
19
+ export type ApiResourceResult<T> = ResourceResponse<T>;
20
+ export interface ApiCommandRequest {
21
+ readonly idempotencyKey: string;
22
+ }
23
+ export type ApiRunResolutionRequest = (ApiCommandRequest & {
24
+ readonly status: typeof RunStatus.Succeeded;
25
+ readonly outcome: unknown;
26
+ }) | (ApiCommandRequest & {
27
+ readonly status: typeof RunStatus.Failed;
28
+ readonly reason: string;
29
+ });
30
+ export interface ApiSystemApplications {
31
+ health(): Promise<ApiResourceResult<HealthResponse>>;
32
+ configuration(): Promise<ApiResourceResult<ConfigurationResponse>>;
33
+ commands(): Promise<ApiResourceResult<CommandsResponse>>;
34
+ }
35
+ export interface ApiApplications {
36
+ readonly now: () => string;
37
+ readonly board?: {
38
+ list(query: CollectionQuery): Promise<ApiCollectionPage<BoardCardResponse> & {
39
+ readonly conditionCounts: BoardResponse['conditionCounts'];
40
+ }>;
41
+ };
42
+ readonly status?: {
43
+ get(): Promise<ApiResourceResult<StatusResponse>>;
44
+ };
45
+ readonly controlPlane: {
46
+ status(): Promise<ApiResourceResult<ControlPlaneStatusResponse>>;
47
+ pause?(command: ApiCommandRequest): Promise<ApiCommandResult>;
48
+ resume?(command: ApiCommandRequest): Promise<ApiCommandResult>;
49
+ };
50
+ readonly work: {
51
+ list(query: CollectionQuery): Promise<ApiCollectionPage<WorkItemResponse>>;
52
+ detail(key: string): Promise<ApiResourceResult<WorkDetailResponse> | undefined>;
53
+ transcript?(key: string, groupId: string): Promise<ApiResourceResult<WorkItemTranscriptResponse> | undefined>;
54
+ freeze?(key: string, command: ApiCommandRequest): Promise<ApiCommandResult>;
55
+ unfreeze?(key: string, command: ApiCommandRequest): Promise<ApiCommandResult>;
56
+ delete?(key: string, command: ApiCommandRequest): Promise<ApiCommandResult>;
57
+ retry?(key: string, command: ApiCommandRequest): Promise<ApiCommandResult>;
58
+ extend?(key: string, command: ApiCommandRequest): Promise<ApiCommandResult>;
59
+ message?(key: string, command: ConversationMessageRequest): Promise<ApiCommandResult>;
60
+ };
61
+ readonly resources: {
62
+ list(query: CollectionQuery): Promise<ApiCollectionPage<ResourceItemResponse>>;
63
+ };
64
+ readonly orchestration: {
65
+ list(query: CollectionQuery): Promise<ApiCollectionPage<WorkflowInstanceResponse>>;
66
+ };
67
+ readonly workflowDiagrams?: {
68
+ get(workItemKey?: string): Promise<ApiResourceResult<WorkflowDiagramsResponse>>;
69
+ };
70
+ readonly execution: {
71
+ list(query: CollectionQuery): Promise<ApiCollectionPage<RunResponse>>;
72
+ get?(runId: string): Promise<ApiResourceResult<RunResponse> | undefined>;
73
+ transcript?(runId: string): Promise<ApiResourceResult<RunTranscriptResponse> | undefined>;
74
+ runners?(query: CollectionQuery): Promise<ApiCollectionPage<RunnerResponse>>;
75
+ pauseRunner?(runnerId: string, command: ApiCommandRequest): Promise<ApiCommandResult>;
76
+ unpauseRunner?(runnerId: string, command: ApiCommandRequest): Promise<ApiCommandResult>;
77
+ resolveAmbiguousRun?(runId: string, command: ApiRunResolutionRequest): Promise<ApiCommandResult>;
78
+ };
79
+ readonly events: {
80
+ list(query: CollectionQuery): Promise<ApiCollectionPage<AuditEventResponse>>;
81
+ };
82
+ readonly observability: {
83
+ metrics(query?: {
84
+ readonly days: number;
85
+ }): Promise<ApiResourceResult<MetricsResponse>>;
86
+ };
87
+ readonly system: ApiSystemApplications;
88
+ }
@@ -0,0 +1,3 @@
1
+ import type { ApiHttpResponse } from '../http-server.js';
2
+ import type { ApiApplications } from './applications.js';
3
+ export declare function dispatchCommand(applications: ApiApplications, url: URL, body: unknown): Promise<ApiHttpResponse>;
@@ -79,8 +79,6 @@ async function dispatchControlCommand(applications, pathname, request) {
79
79
  if (name === undefined)
80
80
  return undefined;
81
81
  const status = await applications.controlPlane.status();
82
- if (name === 'tick' && status.data.paused)
83
- return problem(409, 'Conflict', 'Ticks are paused', { code: 'paused', current: status.data });
84
82
  const operation = applications.controlPlane[name];
85
83
  return operation === undefined
86
84
  ? unavailable(name, status.data)
@@ -91,7 +89,7 @@ function controlCommandName(pathname) {
91
89
  if (!pathname.startsWith(prefix))
92
90
  return undefined;
93
91
  const name = pathname.slice(prefix.length);
94
- return name === 'pause' || name === 'resume' || name === 'tick' ? name : undefined;
92
+ return name === 'pause' || name === 'resume' ? name : undefined;
95
93
  }
96
94
  async function dispatchRunnerCommand(applications, pathname, request) {
97
95
  const match = /^\/api\/v1\/runners\/([^/]+)\/commands\/(pause|unpause)$/.exec(pathname);
@@ -0,0 +1 @@
1
+ export declare const controlPlaneRoutes: readonly ["/api/v1/control-plane/status", "/api/v1/control-plane/commands/pause", "/api/v1/control-plane/commands/resume"];
@@ -2,5 +2,4 @@ export const controlPlaneRoutes = [
2
2
  '/api/v1/control-plane/status',
3
3
  '/api/v1/control-plane/commands/pause',
4
4
  '/api/v1/control-plane/commands/resume',
5
- '/api/v1/control-plane/commands/tick',
6
5
  ];
@@ -0,0 +1 @@
1
+ export declare const eventRoutes: readonly ["/api/v1/events"];
@@ -0,0 +1 @@
1
+ export declare const executionRoutes: readonly ["/api/v1/runs", "/api/v1/runs/:runId", "/api/v1/runs/:runId/transcript", "/api/v1/runs/:runId/commands/resolve", "/api/v1/runners", "/api/v1/runners/:runnerId/commands/pause", "/api/v1/runners/:runnerId/commands/unpause"];
@@ -0,0 +1,4 @@
1
+ import type { ApiDispatcher } from '../http-server.js';
2
+ import type { ApiApplications } from './applications.js';
3
+ export type { ApiApplications, ApiCollectionPage, ApiCommandRequest, ApiResourceResult, ApiRunResolutionRequest, ApiSystemApplications, CollectionQuery, } from './applications.js';
4
+ export declare function createApiDispatcher(applications: ApiApplications): ApiDispatcher;
@@ -0,0 +1 @@
1
+ export declare const observabilityRoutes: readonly ["/api/v1/observability/metrics"];
@@ -0,0 +1 @@
1
+ export declare const orchestrationRoutes: readonly ["/api/v1/workflow-instances"];
@@ -0,0 +1,5 @@
1
+ import type { ApiHttpResponse } from '../http-server.js';
2
+ import type { ApiCollectionPage, CollectionQuery } from './applications.js';
3
+ export declare function parseCollectionQuery(parameters: URLSearchParams, allowed: ReadonlySet<string>): CollectionQuery | ApiHttpResponse;
4
+ export declare function collection<T>(page: ApiCollectionPage<T>, query: CollectionQuery): ApiHttpResponse;
5
+ export declare function normalizePage<T>(result: ApiCollectionPage<T>): ApiCollectionPage<T>;
@@ -0,0 +1,3 @@
1
+ import type { ApiHttpResponse } from '../http-server.js';
2
+ import type { ApiApplications } from './applications.js';
3
+ export declare function dispatchRead(applications: ApiApplications, method: string, url: URL): Promise<ApiHttpResponse | undefined>;
@@ -0,0 +1 @@
1
+ export declare const resourceRoutes: readonly ["/api/v1/resources"];
@@ -0,0 +1,15 @@
1
+ import { type ApiCommandResult, type ResourceResponse } from '../contracts/index.js';
2
+ import type { ApiHttpResponse } from '../http-server.js';
3
+ export declare function noQuery(url: URL, operation: () => Promise<ApiHttpResponse> | ApiHttpResponse): Promise<ApiHttpResponse>;
4
+ export declare function decodePathSegment(value: string): string | ApiPathError;
5
+ export declare class ApiPathError extends Error {
6
+ }
7
+ export declare function accepted(value: ApiCommandResult, asOf: string, status?: number): ApiHttpResponse;
8
+ export declare function ok(body: unknown): ApiHttpResponse;
9
+ export declare function found<T>(value: ResourceResponse<T> | undefined): ApiHttpResponse;
10
+ export declare function unavailable(commandName: string, current?: unknown): ApiHttpResponse;
11
+ export declare function invalidPath(detail: string): ApiHttpResponse;
12
+ export declare function invalidQuery(detail: string, path?: string): ApiHttpResponse;
13
+ export declare function invalidRequest(path: string, message: string): ApiHttpResponse;
14
+ export declare function problem(status: number, title: string, detail: string, extensions?: Record<string, unknown>): ApiHttpResponse;
15
+ export declare function isObject(value: unknown): value is Record<string, unknown>;
@@ -0,0 +1 @@
1
+ export declare const systemRoutes: readonly ["/api/v1/system/health", "/api/v1/system/configuration", "/api/v1/system/commands"];
@@ -0,0 +1 @@
1
+ export declare const workRoutes: readonly ["/api/v1/work-items", "/api/v1/work-items/:workItemKey", "/api/v1/work-items/:workItemKey/transcripts/:groupId", "/api/v1/work-items/:workItemKey/commands/freeze", "/api/v1/work-items/:workItemKey/commands/unfreeze", "/api/v1/work-items/:workItemKey/commands/delete", "/api/v1/work-items/:workItemKey/commands/retry", "/api/v1/work-items/:workItemKey/commands/extend", "/api/v1/work-items/:workItemKey/commands/message"];
@@ -0,0 +1,22 @@
1
+ export interface SurfaceCredentials {
2
+ readonly accessKey: string;
3
+ readonly sessionPassword: string;
4
+ readonly createdAt: string;
5
+ readonly pairingGrants?: readonly PairingGrantRecord[];
6
+ }
7
+ interface PairingGrantRecord {
8
+ readonly hash: string;
9
+ readonly expiresAt: string;
10
+ }
11
+ export interface SurfacePairingGrant {
12
+ readonly value: string;
13
+ readonly expiresAt: string;
14
+ }
15
+ export type CredentialMutationSerialiser = <Value>(lockPath: string, operation: () => Promise<Value>) => Promise<Value>;
16
+ export declare function credentialsPath(wakeRoot: string): string;
17
+ export declare function loadOrCreateCredentials(wakeRoot: string): Promise<SurfaceCredentials>;
18
+ export declare function replaceAccessKey(wakeRoot: string, accessKey: string, serialise: CredentialMutationSerialiser): Promise<SurfaceCredentials>;
19
+ export declare function createPairingGrant(wakeRoot: string, now: Date | undefined, serialise: CredentialMutationSerialiser): Promise<SurfacePairingGrant>;
20
+ export declare function redeemPairingGrant(wakeRoot: string, value: string, now: Date | undefined, serialise: CredentialMutationSerialiser): Promise<boolean>;
21
+ export declare function verifyAccessKey(candidate: string, expected: string): boolean;
22
+ export {};
@@ -1,7 +1,6 @@
1
1
  import { createHash, randomBytes, timingSafeEqual } from 'node:crypto';
2
2
  import { chmod, mkdir, readFile, rename, writeFile } from 'node:fs/promises';
3
3
  import { dirname, join } from 'node:path';
4
- import { withFileLock } from '../../persistence/index.js';
5
4
  const pairingGrantLifetimeMs = 10 * 60 * 1000;
6
5
  const credentialLockName = 'surface-credentials.lock';
7
6
  export function credentialsPath(wakeRoot) {
@@ -20,11 +19,11 @@ export async function loadOrCreateCredentials(wakeRoot) {
20
19
  await saveCredentials(path, credentials);
21
20
  return credentials;
22
21
  }
23
- export async function replaceAccessKey(wakeRoot, accessKey) {
22
+ export async function replaceAccessKey(wakeRoot, accessKey, serialise) {
24
23
  if (accessKey.trim() === '')
25
24
  throw new Error('UI access key must not be empty');
26
25
  const path = credentialsPath(wakeRoot);
27
- return mutateCredentials(path, async () => {
26
+ return mutateCredentials(path, serialise, async () => {
28
27
  const current = await loadOrCreateCredentials(wakeRoot);
29
28
  const replacement = {
30
29
  ...current,
@@ -35,9 +34,9 @@ export async function replaceAccessKey(wakeRoot, accessKey) {
35
34
  return replacement;
36
35
  });
37
36
  }
38
- export async function createPairingGrant(wakeRoot, now = new Date()) {
37
+ export async function createPairingGrant(wakeRoot, now = new Date(), serialise) {
39
38
  const path = credentialsPath(wakeRoot);
40
- return mutateCredentials(path, async () => {
39
+ return mutateCredentials(path, serialise, async () => {
41
40
  const current = await loadOrCreateCredentials(wakeRoot);
42
41
  const value = randomBytes(24).toString('base64url');
43
42
  const expiresAt = new Date(now.getTime() + pairingGrantLifetimeMs).toISOString();
@@ -51,9 +50,9 @@ export async function createPairingGrant(wakeRoot, now = new Date()) {
51
50
  return { value, expiresAt };
52
51
  });
53
52
  }
54
- export async function redeemPairingGrant(wakeRoot, value, now = new Date()) {
53
+ export async function redeemPairingGrant(wakeRoot, value, now = new Date(), serialise) {
55
54
  const path = credentialsPath(wakeRoot);
56
- return mutateCredentials(path, async () => {
55
+ return mutateCredentials(path, serialise, async () => {
57
56
  const current = await loadOrCreateCredentials(wakeRoot);
58
57
  const nowIso = now.toISOString();
59
58
  const hash = grantHash(value);
@@ -90,11 +89,8 @@ async function saveCredentials(path, credentials) {
90
89
  await chmod(temporaryPath, 0o600);
91
90
  await rename(temporaryPath, path);
92
91
  }
93
- async function mutateCredentials(path, mutation) {
94
- return withFileLock(credentialLockPath(path), mutation, {
95
- waitMs: 5_000,
96
- retryIntervalMs: 10,
97
- });
92
+ async function mutateCredentials(path, serialise, mutation) {
93
+ return serialise(credentialLockPath(path), mutation);
98
94
  }
99
95
  function credentialLockPath(credentials) {
100
96
  return join(dirname(dirname(credentials)), 'locks', credentialLockName);
@@ -0,0 +1,9 @@
1
+ import { type ValueOf } from '../../kernel/index.js';
2
+ export declare const SurfaceSessionAttribute: {
3
+ readonly Operator: "operator";
4
+ };
5
+ export type SurfaceSessionAttribute = ValueOf<typeof SurfaceSessionAttribute>;
6
+ export declare const SurfaceCookieSecurity: {
7
+ readonly Auto: "auto";
8
+ };
9
+ export type SurfaceCookieSecurity = ValueOf<typeof SurfaceCookieSecurity>;
@@ -0,0 +1,4 @@
1
+ export interface ApiApplication {
2
+ start(): Promise<void>;
3
+ }
4
+ export declare const api: (application: ApiApplication) => Promise<void>;
@@ -0,0 +1,16 @@
1
+ import type { EventEnvelope } from '@atolis-hq/eventing';
2
+ export interface AuditJournal {
3
+ readAll(afterGlobalPosition: number, limit?: number): Promise<readonly EventEnvelope[]>;
4
+ }
5
+ export interface AuditWork {
6
+ get(workItemId: string): Promise<unknown>;
7
+ }
8
+ export interface AuditFact {
9
+ readonly event: EventEnvelope['event'] & Omit<EventEnvelope, 'event'>;
10
+ readonly causalLinks: {
11
+ readonly causationId: string;
12
+ readonly correlationId: string;
13
+ };
14
+ }
15
+ /** Reads canonical journal facts, not a projection, so it remains useful during rebuilds. */
16
+ export declare function audit(journal: AuditJournal, work: AuditWork, workItemId: string): Promise<readonly AuditFact[]>;
@@ -4,7 +4,16 @@ export async function audit(journal, work, workItemId) {
4
4
  return (await journal.readAll(0))
5
5
  .filter((event) => event.stream.id === workItemId)
6
6
  .map((event) => ({
7
- event,
8
- causalLinks: { causationId: event.causationId, correlationId: event.correlationId },
7
+ event: {
8
+ ...event.event,
9
+ stream: event.stream,
10
+ recordedAt: event.recordedAt,
11
+ sequence: event.sequence,
12
+ globalPosition: event.globalPosition,
13
+ },
14
+ causalLinks: {
15
+ causationId: event.event.causationId,
16
+ correlationId: event.event.correlationId,
17
+ },
9
18
  }));
10
19
  }
@@ -0,0 +1,7 @@
1
+ import type { CommandContext } from '@atolis-hq/eventing';
2
+ import { ResourceCorrelationRole, type ResourceId } from '../../../resources/index.js';
3
+ import type { WorkItemId } from '../../../work/index.js';
4
+ export interface ResourceCorrelationApplication {
5
+ correlate(resourceId: ResourceId, workItemId: WorkItemId, role: ResourceCorrelationRole, context: CommandContext): Promise<unknown>;
6
+ }
7
+ export declare const correlate: (application: ResourceCorrelationApplication, resource: ResourceId, workItemId: WorkItemId, context: CommandContext) => Promise<unknown>;
@@ -0,0 +1,24 @@
1
+ export interface ProjectionMaintenance {
2
+ health(): Promise<{
3
+ readonly journal: string;
4
+ readonly projections: readonly string[];
5
+ readonly checkpoints: string;
6
+ }>;
7
+ rebuild(): Promise<void>;
8
+ }
9
+ export interface DoctorDependencies {
10
+ readonly diagnose: () => Promise<{
11
+ readonly failures: readonly string[];
12
+ readonly notices: readonly string[];
13
+ }>;
14
+ readonly projections: ProjectionMaintenance;
15
+ }
16
+ export declare function runDoctor(input: DoctorDependencies & {
17
+ readonly rebuildProjections?: boolean;
18
+ }): Promise<{
19
+ journal: string;
20
+ projections: readonly string[];
21
+ checkpoints: string;
22
+ failures: readonly string[];
23
+ notices: readonly string[];
24
+ }>;
@@ -0,0 +1,2 @@
1
+ /** Creates a new Wake home; runtime state always stays under its hidden .wake directory. */
2
+ export declare function initialiseWakeHome(wakeRoot: string, assets: Readonly<Record<string, string>>): Promise<void>;
@@ -0,0 +1,43 @@
1
+ export interface ResidentSupervisorDependencies {
2
+ readonly restartDelaySeconds: number;
3
+ readonly wakeInvocation: readonly string[];
4
+ readonly pidFile: string;
5
+ readonly startLogFile: string;
6
+ readonly spawnDetached: (command: string, arguments_: readonly string[], options: {
7
+ readonly logFile: string;
8
+ }) => {
9
+ readonly pid: number;
10
+ };
11
+ readonly waitForExit: (pid: number) => Promise<number>;
12
+ readonly writeFile: (path: string, content: string) => Promise<void>;
13
+ readonly sleep: (milliseconds: number) => Promise<void>;
14
+ readonly log: (message: string) => void;
15
+ }
16
+ export interface SandboxEntrypointDependencies extends ResidentSupervisorDependencies {
17
+ readonly startEnabled: boolean;
18
+ readonly ensureLogDirectory: () => Promise<void>;
19
+ readonly waitForever: () => Promise<never>;
20
+ }
21
+ /**
22
+ * Never resolves, and never lets the process exit either. The supervised
23
+ * child is spawned detached and unref'd (see spawnDetached), so an
24
+ * unresolved Promise alone is not enough here — a Promise executor registers
25
+ * no libuv handle, and once other pending I/O quiets down Node treats the
26
+ * still-pending top-level await as unsettled and exits anyway. A ref'd
27
+ * timer is a real handle, so it keeps the process alive for as long as this
28
+ * Promise is meant to.
29
+ */
30
+ export declare function waitForever(): Promise<never>;
31
+ /**
32
+ * Restarts `wake start` on every exit — a first-boot crash (e.g. missing
33
+ * sandbox auth) must not stop the retry loop, since the operator's only path
34
+ * to fixing it (`wake sandbox setup`) also depends on this loop's container
35
+ * staying alive.
36
+ */
37
+ export declare function runResidentSupervisor(deps: ResidentSupervisorDependencies): Promise<never>;
38
+ /**
39
+ * Keeps the sandbox container alive regardless of whether `wake start` can
40
+ * currently run — `sandbox setup`/`sandbox exec` need a live container to
41
+ * reach into, including on first boot before auth is configured.
42
+ */
43
+ export declare function runSandboxEntrypoint(deps: SandboxEntrypointDependencies): Promise<void>;
@@ -0,0 +1,9 @@
1
+ export interface SandboxSetupDependencies {
2
+ readonly prompt: (message: string) => Promise<boolean>;
3
+ readonly runInteractive: (command: string, arguments_: readonly string[]) => Promise<void>;
4
+ readonly ensureSshKey: () => Promise<void>;
5
+ readonly prepareCodexHome: () => Promise<void>;
6
+ readonly log: (message: string) => void;
7
+ }
8
+ /** Configures the sandbox-owned credentials and git identity interactively. */
9
+ export declare function runSandboxSetup(deps: SandboxSetupDependencies): Promise<void>;
@@ -0,0 +1,16 @@
1
+ export interface SandboxDockerPort {
2
+ build(): Promise<unknown>;
3
+ up(): Promise<unknown>;
4
+ down(): Promise<unknown>;
5
+ update?(): Promise<unknown>;
6
+ exec?(command: readonly string[]): Promise<unknown>;
7
+ logs?(tail: number): Promise<unknown>;
8
+ setup?(): Promise<unknown>;
9
+ resume?(target: {
10
+ sessionId: string;
11
+ cwd: string;
12
+ cli: string;
13
+ }): Promise<unknown>;
14
+ }
15
+ export declare const sandboxUsage: string;
16
+ export declare function runSandbox(arguments_: readonly string[], docker: SandboxDockerPort): Promise<void>;
@@ -0,0 +1,15 @@
1
+ export interface SelfUpdateDependencies {
2
+ readonly tag: string;
3
+ readonly readLedger: () => Promise<string | null>;
4
+ readonly writeLedger: (tag: string) => Promise<void>;
5
+ readonly update: (tag: string) => Promise<void>;
6
+ readonly force?: boolean;
7
+ readonly health?: () => Promise<boolean>;
8
+ readonly rollback?: (priorTag: string) => Promise<void>;
9
+ }
10
+ /** Updates application files only; journal and projection ownership stay outside this command. */
11
+ export declare function runSelfUpdate(input: SelfUpdateDependencies): Promise<boolean>;
12
+ /** Runs update checks resiliently; the injected wait boundary owns shutdown. */
13
+ export declare function runSelfUpdateLoop(input: SelfUpdateDependencies, wait: () => Promise<void>): Promise<never>;
14
+ /** Re-discovers the source tag per iteration so a resident updater does not retain stale version state. */
15
+ export declare function runSelfUpdateLatestLoop(updateLatest: () => Promise<unknown>, wait: () => Promise<void>): Promise<never>;
@@ -0,0 +1,14 @@
1
+ import { type RunnerRegistry } from '../../../execution/index.js';
2
+ export interface SmokeRunner {
3
+ run(): Promise<{
4
+ readonly ok: boolean;
5
+ }>;
6
+ }
7
+ export declare const runSmoke: (runner: SmokeRunner) => Promise<{
8
+ readonly ok: boolean;
9
+ }>;
10
+ export declare function runTargetSmoke(registry: Pick<RunnerRegistry, 'resolve'>, runnerPool: string, signal: AbortSignal): Promise<{
11
+ readonly ok: boolean;
12
+ readonly runner: string;
13
+ readonly transport: string;
14
+ }>;
@@ -0,0 +1,5 @@
1
+ import type { HostBudget, HostResult } from '../../../control-plane/index.js';
2
+ export interface ResidentApplication {
3
+ run(signal: AbortSignal, budget: HostBudget): Promise<HostResult>;
4
+ }
5
+ export declare const start: (application: ResidentApplication, signal: AbortSignal, budget: HostBudget) => Promise<HostResult>;
@@ -0,0 +1,11 @@
1
+ export interface StopApplication {
2
+ stop(): Promise<void>;
3
+ }
4
+ export interface ActiveRunWaitDependencies {
5
+ readonly activeRunIds: () => Promise<readonly string[]>;
6
+ readonly sleep: (milliseconds: number) => Promise<void>;
7
+ readonly pollIntervalMs?: number;
8
+ readonly timeoutMs?: number;
9
+ }
10
+ export declare function waitForActiveRuns(input: ActiveRunWaitDependencies): Promise<void>;
11
+ export declare const stop: (application: StopApplication) => Promise<void>;
@@ -0,0 +1,5 @@
1
+ import type { HostBudget, HostResult } from '../../../control-plane/index.js';
2
+ export interface TickApplication {
3
+ run(budget: HostBudget): Promise<HostResult>;
4
+ }
5
+ export declare const tick: (application: TickApplication, budget: HostBudget) => Promise<HostResult>;