@smthrs/control 0.0.0-stage → 1.0.0-rc.3

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 (418) hide show
  1. package/CHANGELOG.md +194 -0
  2. package/LICENSE +21 -0
  3. package/README.md +168 -2
  4. package/dist/cjs/ApprovalAuthority.d.ts +73 -0
  5. package/dist/cjs/ApprovalAuthority.d.ts.map +1 -0
  6. package/dist/cjs/ApprovalAuthority.js +62 -0
  7. package/dist/cjs/ApprovalAuthority.js.map +7 -0
  8. package/dist/cjs/Cancellation.d.ts +107 -0
  9. package/dist/cjs/Cancellation.d.ts.map +1 -0
  10. package/dist/cjs/Cancellation.js +72 -0
  11. package/dist/cjs/Cancellation.js.map +7 -0
  12. package/dist/cjs/Channels.d.ts +170 -0
  13. package/dist/cjs/Channels.d.ts.map +1 -0
  14. package/dist/cjs/Channels.js +278 -0
  15. package/dist/cjs/Channels.js.map +7 -0
  16. package/dist/cjs/Control.d.ts +202 -0
  17. package/dist/cjs/Control.d.ts.map +1 -0
  18. package/dist/cjs/Control.js +47 -0
  19. package/dist/cjs/Control.js.map +7 -0
  20. package/dist/cjs/ControlClient.d.ts +52 -0
  21. package/dist/cjs/ControlClient.d.ts.map +1 -0
  22. package/dist/cjs/ControlClient.js +191 -0
  23. package/dist/cjs/ControlClient.js.map +7 -0
  24. package/dist/cjs/ControlError.d.ts +318 -0
  25. package/dist/cjs/ControlError.d.ts.map +1 -0
  26. package/dist/cjs/ControlError.js +249 -0
  27. package/dist/cjs/ControlError.js.map +7 -0
  28. package/dist/cjs/ControlExecutor.d.ts +372 -0
  29. package/dist/cjs/ControlExecutor.d.ts.map +1 -0
  30. package/dist/cjs/ControlExecutor.js +123 -0
  31. package/dist/cjs/ControlExecutor.js.map +7 -0
  32. package/dist/cjs/ControlFacts.d.ts +454 -0
  33. package/dist/cjs/ControlFacts.d.ts.map +1 -0
  34. package/dist/cjs/ControlFacts.js +261 -0
  35. package/dist/cjs/ControlFacts.js.map +7 -0
  36. package/dist/cjs/ControlLive.d.ts +23 -0
  37. package/dist/cjs/ControlLive.d.ts.map +1 -0
  38. package/dist/cjs/ControlLive.js +1280 -0
  39. package/dist/cjs/ControlLive.js.map +7 -0
  40. package/dist/cjs/ControlRpcs.d.ts +1204 -0
  41. package/dist/cjs/ControlRpcs.d.ts.map +1 -0
  42. package/dist/cjs/ControlRpcs.js +247 -0
  43. package/dist/cjs/ControlRpcs.js.map +7 -0
  44. package/dist/cjs/ControlRuntime.d.ts +635 -0
  45. package/dist/cjs/ControlRuntime.d.ts.map +1 -0
  46. package/dist/cjs/ControlRuntime.js +740 -0
  47. package/dist/cjs/ControlRuntime.js.map +7 -0
  48. package/dist/cjs/ControlSchema.d.ts +2642 -0
  49. package/dist/cjs/ControlSchema.d.ts.map +1 -0
  50. package/dist/cjs/ControlSchema.js +634 -0
  51. package/dist/cjs/ControlSchema.js.map +7 -0
  52. package/dist/cjs/ControlServer.d.ts +51 -0
  53. package/dist/cjs/ControlServer.d.ts.map +1 -0
  54. package/dist/cjs/ControlServer.js +121 -0
  55. package/dist/cjs/ControlServer.js.map +7 -0
  56. package/dist/cjs/Credential.d.ts +136 -0
  57. package/dist/cjs/Credential.d.ts.map +1 -0
  58. package/dist/cjs/Credential.js +168 -0
  59. package/dist/cjs/Credential.js.map +7 -0
  60. package/dist/cjs/CredentialCipher.d.ts +90 -0
  61. package/dist/cjs/CredentialCipher.d.ts.map +1 -0
  62. package/dist/cjs/CredentialCipher.js +45 -0
  63. package/dist/cjs/CredentialCipher.js.map +7 -0
  64. package/dist/cjs/CredentialStore.d.ts +97 -0
  65. package/dist/cjs/CredentialStore.d.ts.map +1 -0
  66. package/dist/cjs/CredentialStore.js +81 -0
  67. package/dist/cjs/CredentialStore.js.map +7 -0
  68. package/dist/cjs/DispatchReader.d.ts +112 -0
  69. package/dist/cjs/DispatchReader.d.ts.map +1 -0
  70. package/dist/cjs/DispatchReader.js +45 -0
  71. package/dist/cjs/DispatchReader.js.map +7 -0
  72. package/dist/cjs/Health.d.ts +333 -0
  73. package/dist/cjs/Health.d.ts.map +1 -0
  74. package/dist/cjs/Health.js +311 -0
  75. package/dist/cjs/Health.js.map +7 -0
  76. package/dist/cjs/JevSessionChecker.d.ts +57 -0
  77. package/dist/cjs/JevSessionChecker.d.ts.map +1 -0
  78. package/dist/cjs/JevSessionChecker.js +113 -0
  79. package/dist/cjs/JevSessionChecker.js.map +7 -0
  80. package/dist/cjs/Lineage.d.ts +131 -0
  81. package/dist/cjs/Lineage.d.ts.map +1 -0
  82. package/dist/cjs/Lineage.js +81 -0
  83. package/dist/cjs/Lineage.js.map +7 -0
  84. package/dist/cjs/Migrations.d.ts +34 -0
  85. package/dist/cjs/Migrations.d.ts.map +1 -0
  86. package/dist/cjs/Migrations.js +60 -0
  87. package/dist/cjs/Migrations.js.map +7 -0
  88. package/dist/cjs/Monitor.d.ts +282 -0
  89. package/dist/cjs/Monitor.d.ts.map +1 -0
  90. package/dist/cjs/Monitor.js +283 -0
  91. package/dist/cjs/Monitor.js.map +7 -0
  92. package/dist/cjs/ScopedToken.d.ts +193 -0
  93. package/dist/cjs/ScopedToken.d.ts.map +1 -0
  94. package/dist/cjs/ScopedToken.js +135 -0
  95. package/dist/cjs/ScopedToken.js.map +7 -0
  96. package/dist/cjs/SqlControlRuntime.d.ts +161 -0
  97. package/dist/cjs/SqlControlRuntime.d.ts.map +1 -0
  98. package/dist/cjs/SqlControlRuntime.js +1521 -0
  99. package/dist/cjs/SqlControlRuntime.js.map +7 -0
  100. package/dist/cjs/SqlCredentialStore.d.ts +43 -0
  101. package/dist/cjs/SqlCredentialStore.d.ts.map +1 -0
  102. package/dist/cjs/SqlCredentialStore.js +113 -0
  103. package/dist/cjs/SqlCredentialStore.js.map +7 -0
  104. package/dist/cjs/Steering.d.ts +69 -0
  105. package/dist/cjs/Steering.d.ts.map +1 -0
  106. package/dist/cjs/Steering.js +49 -0
  107. package/dist/cjs/Steering.js.map +7 -0
  108. package/dist/cjs/SystemFlows.d.ts +223 -0
  109. package/dist/cjs/SystemFlows.d.ts.map +1 -0
  110. package/dist/cjs/SystemFlows.js +195 -0
  111. package/dist/cjs/SystemFlows.js.map +7 -0
  112. package/dist/cjs/WebCryptoCipher.d.ts +49 -0
  113. package/dist/cjs/WebCryptoCipher.d.ts.map +1 -0
  114. package/dist/cjs/WebCryptoCipher.js +129 -0
  115. package/dist/cjs/WebCryptoCipher.js.map +7 -0
  116. package/dist/cjs/WebhookChannel.d.ts +113 -0
  117. package/dist/cjs/WebhookChannel.d.ts.map +1 -0
  118. package/dist/cjs/WebhookChannel.js +98 -0
  119. package/dist/cjs/WebhookChannel.js.map +7 -0
  120. package/dist/cjs/index.d.ts +160 -0
  121. package/dist/cjs/index.d.ts.map +1 -0
  122. package/dist/cjs/index.js +91 -0
  123. package/dist/cjs/index.js.map +7 -0
  124. package/dist/cjs/internal/MutationBoundary.d.ts +27 -0
  125. package/dist/cjs/internal/MutationBoundary.d.ts.map +1 -0
  126. package/dist/cjs/internal/MutationBoundary.js +50 -0
  127. package/dist/cjs/internal/MutationBoundary.js.map +7 -0
  128. package/dist/cjs/internal/activeFibers.d.ts +12 -0
  129. package/dist/cjs/internal/activeFibers.d.ts.map +1 -0
  130. package/dist/cjs/internal/activeFibers.js +30 -0
  131. package/dist/cjs/internal/activeFibers.js.map +7 -0
  132. package/dist/cjs/internal/issues.d.ts +28 -0
  133. package/dist/cjs/internal/issues.d.ts.map +1 -0
  134. package/dist/cjs/internal/issues.js +34 -0
  135. package/dist/cjs/internal/issues.js.map +7 -0
  136. package/dist/cjs/internal/planning.d.ts +347 -0
  137. package/dist/cjs/internal/planning.d.ts.map +1 -0
  138. package/dist/cjs/internal/planning.js +137 -0
  139. package/dist/cjs/internal/planning.js.map +7 -0
  140. package/dist/cjs/internal/sqlSchemaErrors.d.ts +18 -0
  141. package/dist/cjs/internal/sqlSchemaErrors.d.ts.map +1 -0
  142. package/dist/cjs/internal/sqlSchemaErrors.js +40 -0
  143. package/dist/cjs/internal/sqlSchemaErrors.js.map +7 -0
  144. package/dist/cjs/migrations/0001_control_tables.d.ts +18 -0
  145. package/dist/cjs/migrations/0001_control_tables.d.ts.map +1 -0
  146. package/dist/cjs/migrations/0001_control_tables.js +115 -0
  147. package/dist/cjs/migrations/0001_control_tables.js.map +7 -0
  148. package/dist/cjs/migrations/0002_run_keys.d.ts +15 -0
  149. package/dist/cjs/migrations/0002_run_keys.d.ts.map +1 -0
  150. package/dist/cjs/migrations/0002_run_keys.js +44 -0
  151. package/dist/cjs/migrations/0002_run_keys.js.map +7 -0
  152. package/dist/cjs/migrations/0003_signal_commands.d.ts +13 -0
  153. package/dist/cjs/migrations/0003_signal_commands.d.ts.map +1 -0
  154. package/dist/cjs/migrations/0003_signal_commands.js +50 -0
  155. package/dist/cjs/migrations/0003_signal_commands.js.map +7 -0
  156. package/dist/cjs/migrations/0004_approval_decisions.d.ts +13 -0
  157. package/dist/cjs/migrations/0004_approval_decisions.d.ts.map +1 -0
  158. package/dist/cjs/migrations/0004_approval_decisions.js +45 -0
  159. package/dist/cjs/migrations/0004_approval_decisions.js.map +7 -0
  160. package/dist/cjs/migrations/0005_signal_principals.d.ts +18 -0
  161. package/dist/cjs/migrations/0005_signal_principals.d.ts.map +1 -0
  162. package/dist/cjs/migrations/0005_signal_principals.js +45 -0
  163. package/dist/cjs/migrations/0005_signal_principals.js.map +7 -0
  164. package/dist/cjs/migrations/0006_run_principals.d.ts +18 -0
  165. package/dist/cjs/migrations/0006_run_principals.d.ts.map +1 -0
  166. package/dist/cjs/migrations/0006_run_principals.js +49 -0
  167. package/dist/cjs/migrations/0006_run_principals.js.map +7 -0
  168. package/dist/cjs/migrations/0007_resume_consent.d.ts +18 -0
  169. package/dist/cjs/migrations/0007_resume_consent.d.ts.map +1 -0
  170. package/dist/cjs/migrations/0007_resume_consent.js +46 -0
  171. package/dist/cjs/migrations/0007_resume_consent.js.map +7 -0
  172. package/dist/cjs/package.json +1 -0
  173. package/dist/cjs/test/TestControl.d.ts +19 -0
  174. package/dist/cjs/test/TestControl.d.ts.map +1 -0
  175. package/dist/cjs/test/TestControl.js +62 -0
  176. package/dist/cjs/test/TestControl.js.map +7 -0
  177. package/dist/esm/ApprovalAuthority.d.ts +73 -0
  178. package/dist/esm/ApprovalAuthority.d.ts.map +1 -0
  179. package/dist/esm/ApprovalAuthority.js +72 -0
  180. package/dist/esm/ApprovalAuthority.js.map +1 -0
  181. package/dist/esm/Cancellation.d.ts +107 -0
  182. package/dist/esm/Cancellation.d.ts.map +1 -0
  183. package/dist/esm/Cancellation.js +116 -0
  184. package/dist/esm/Cancellation.js.map +1 -0
  185. package/dist/esm/Channels.d.ts +170 -0
  186. package/dist/esm/Channels.d.ts.map +1 -0
  187. package/dist/esm/Channels.js +312 -0
  188. package/dist/esm/Channels.js.map +1 -0
  189. package/dist/esm/Control.d.ts +202 -0
  190. package/dist/esm/Control.d.ts.map +1 -0
  191. package/dist/esm/Control.js +42 -0
  192. package/dist/esm/Control.js.map +1 -0
  193. package/dist/esm/ControlClient.d.ts +52 -0
  194. package/dist/esm/ControlClient.d.ts.map +1 -0
  195. package/dist/esm/ControlClient.js +217 -0
  196. package/dist/esm/ControlClient.js.map +1 -0
  197. package/dist/esm/ControlError.d.ts +318 -0
  198. package/dist/esm/ControlError.d.ts.map +1 -0
  199. package/dist/esm/ControlError.js +359 -0
  200. package/dist/esm/ControlError.js.map +1 -0
  201. package/dist/esm/ControlExecutor.d.ts +372 -0
  202. package/dist/esm/ControlExecutor.d.ts.map +1 -0
  203. package/dist/esm/ControlExecutor.js +212 -0
  204. package/dist/esm/ControlExecutor.js.map +1 -0
  205. package/dist/esm/ControlFacts.d.ts +454 -0
  206. package/dist/esm/ControlFacts.d.ts.map +1 -0
  207. package/dist/esm/ControlFacts.js +324 -0
  208. package/dist/esm/ControlFacts.js.map +1 -0
  209. package/dist/esm/ControlLive.d.ts +23 -0
  210. package/dist/esm/ControlLive.d.ts.map +1 -0
  211. package/dist/esm/ControlLive.js +1585 -0
  212. package/dist/esm/ControlLive.js.map +1 -0
  213. package/dist/esm/ControlRpcs.d.ts +1204 -0
  214. package/dist/esm/ControlRpcs.d.ts.map +1 -0
  215. package/dist/esm/ControlRpcs.js +299 -0
  216. package/dist/esm/ControlRpcs.js.map +1 -0
  217. package/dist/esm/ControlRuntime.d.ts +635 -0
  218. package/dist/esm/ControlRuntime.d.ts.map +1 -0
  219. package/dist/esm/ControlRuntime.js +807 -0
  220. package/dist/esm/ControlRuntime.js.map +1 -0
  221. package/dist/esm/ControlSchema.d.ts +2642 -0
  222. package/dist/esm/ControlSchema.d.ts.map +1 -0
  223. package/dist/esm/ControlSchema.js +1030 -0
  224. package/dist/esm/ControlSchema.js.map +1 -0
  225. package/dist/esm/ControlServer.d.ts +51 -0
  226. package/dist/esm/ControlServer.d.ts.map +1 -0
  227. package/dist/esm/ControlServer.js +145 -0
  228. package/dist/esm/ControlServer.js.map +1 -0
  229. package/dist/esm/Credential.d.ts +136 -0
  230. package/dist/esm/Credential.d.ts.map +1 -0
  231. package/dist/esm/Credential.js +190 -0
  232. package/dist/esm/Credential.js.map +1 -0
  233. package/dist/esm/CredentialCipher.d.ts +90 -0
  234. package/dist/esm/CredentialCipher.d.ts.map +1 -0
  235. package/dist/esm/CredentialCipher.js +56 -0
  236. package/dist/esm/CredentialCipher.js.map +1 -0
  237. package/dist/esm/CredentialStore.d.ts +97 -0
  238. package/dist/esm/CredentialStore.d.ts.map +1 -0
  239. package/dist/esm/CredentialStore.js +101 -0
  240. package/dist/esm/CredentialStore.js.map +1 -0
  241. package/dist/esm/DispatchReader.d.ts +112 -0
  242. package/dist/esm/DispatchReader.d.ts.map +1 -0
  243. package/dist/esm/DispatchReader.js +76 -0
  244. package/dist/esm/DispatchReader.js.map +1 -0
  245. package/dist/esm/Health.d.ts +333 -0
  246. package/dist/esm/Health.d.ts.map +1 -0
  247. package/dist/esm/Health.js +400 -0
  248. package/dist/esm/Health.js.map +1 -0
  249. package/dist/esm/JevSessionChecker.d.ts +57 -0
  250. package/dist/esm/JevSessionChecker.d.ts.map +1 -0
  251. package/dist/esm/JevSessionChecker.js +108 -0
  252. package/dist/esm/JevSessionChecker.js.map +1 -0
  253. package/dist/esm/Lineage.d.ts +131 -0
  254. package/dist/esm/Lineage.d.ts.map +1 -0
  255. package/dist/esm/Lineage.js +174 -0
  256. package/dist/esm/Lineage.js.map +1 -0
  257. package/dist/esm/Migrations.d.ts +34 -0
  258. package/dist/esm/Migrations.d.ts.map +1 -0
  259. package/dist/esm/Migrations.js +53 -0
  260. package/dist/esm/Migrations.js.map +1 -0
  261. package/dist/esm/Monitor.d.ts +282 -0
  262. package/dist/esm/Monitor.d.ts.map +1 -0
  263. package/dist/esm/Monitor.js +415 -0
  264. package/dist/esm/Monitor.js.map +1 -0
  265. package/dist/esm/ScopedToken.d.ts +193 -0
  266. package/dist/esm/ScopedToken.d.ts.map +1 -0
  267. package/dist/esm/ScopedToken.js +224 -0
  268. package/dist/esm/ScopedToken.js.map +1 -0
  269. package/dist/esm/SqlControlRuntime.d.ts +161 -0
  270. package/dist/esm/SqlControlRuntime.d.ts.map +1 -0
  271. package/dist/esm/SqlControlRuntime.js +1756 -0
  272. package/dist/esm/SqlControlRuntime.js.map +1 -0
  273. package/dist/esm/SqlCredentialStore.d.ts +43 -0
  274. package/dist/esm/SqlCredentialStore.d.ts.map +1 -0
  275. package/dist/esm/SqlCredentialStore.js +97 -0
  276. package/dist/esm/SqlCredentialStore.js.map +1 -0
  277. package/dist/esm/Steering.d.ts +69 -0
  278. package/dist/esm/Steering.d.ts.map +1 -0
  279. package/dist/esm/Steering.js +89 -0
  280. package/dist/esm/Steering.js.map +1 -0
  281. package/dist/esm/SystemFlows.d.ts +223 -0
  282. package/dist/esm/SystemFlows.d.ts.map +1 -0
  283. package/dist/esm/SystemFlows.js +198 -0
  284. package/dist/esm/SystemFlows.js.map +1 -0
  285. package/dist/esm/WebCryptoCipher.d.ts +49 -0
  286. package/dist/esm/WebCryptoCipher.d.ts.map +1 -0
  287. package/dist/esm/WebCryptoCipher.js +123 -0
  288. package/dist/esm/WebCryptoCipher.js.map +1 -0
  289. package/dist/esm/WebhookChannel.d.ts +113 -0
  290. package/dist/esm/WebhookChannel.d.ts.map +1 -0
  291. package/dist/esm/WebhookChannel.js +109 -0
  292. package/dist/esm/WebhookChannel.js.map +1 -0
  293. package/dist/esm/index.d.ts +160 -0
  294. package/dist/esm/index.d.ts.map +1 -0
  295. package/dist/esm/index.js +160 -0
  296. package/dist/esm/index.js.map +1 -0
  297. package/dist/esm/internal/MutationBoundary.d.ts +27 -0
  298. package/dist/esm/internal/MutationBoundary.d.ts.map +1 -0
  299. package/dist/esm/internal/MutationBoundary.js +40 -0
  300. package/dist/esm/internal/MutationBoundary.js.map +1 -0
  301. package/dist/esm/internal/activeFibers.d.ts +12 -0
  302. package/dist/esm/internal/activeFibers.d.ts.map +1 -0
  303. package/dist/esm/internal/activeFibers.js +17 -0
  304. package/dist/esm/internal/activeFibers.js.map +1 -0
  305. package/dist/esm/internal/issues.d.ts +28 -0
  306. package/dist/esm/internal/issues.d.ts.map +1 -0
  307. package/dist/esm/internal/issues.js +35 -0
  308. package/dist/esm/internal/issues.js.map +1 -0
  309. package/dist/esm/internal/planning.d.ts +347 -0
  310. package/dist/esm/internal/planning.d.ts.map +1 -0
  311. package/dist/esm/internal/planning.js +199 -0
  312. package/dist/esm/internal/planning.js.map +1 -0
  313. package/dist/esm/internal/sqlSchemaErrors.d.ts +18 -0
  314. package/dist/esm/internal/sqlSchemaErrors.d.ts.map +1 -0
  315. package/dist/esm/internal/sqlSchemaErrors.js +38 -0
  316. package/dist/esm/internal/sqlSchemaErrors.js.map +1 -0
  317. package/dist/esm/migrations/0001_control_tables.d.ts +18 -0
  318. package/dist/esm/migrations/0001_control_tables.d.ts.map +1 -0
  319. package/dist/esm/migrations/0001_control_tables.js +96 -0
  320. package/dist/esm/migrations/0001_control_tables.js.map +1 -0
  321. package/dist/esm/migrations/0002_run_keys.d.ts +15 -0
  322. package/dist/esm/migrations/0002_run_keys.d.ts.map +1 -0
  323. package/dist/esm/migrations/0002_run_keys.js +22 -0
  324. package/dist/esm/migrations/0002_run_keys.js.map +1 -0
  325. package/dist/esm/migrations/0003_signal_commands.d.ts +13 -0
  326. package/dist/esm/migrations/0003_signal_commands.d.ts.map +1 -0
  327. package/dist/esm/migrations/0003_signal_commands.js +26 -0
  328. package/dist/esm/migrations/0003_signal_commands.js.map +1 -0
  329. package/dist/esm/migrations/0004_approval_decisions.d.ts +13 -0
  330. package/dist/esm/migrations/0004_approval_decisions.d.ts.map +1 -0
  331. package/dist/esm/migrations/0004_approval_decisions.js +25 -0
  332. package/dist/esm/migrations/0004_approval_decisions.js.map +1 -0
  333. package/dist/esm/migrations/0005_signal_principals.d.ts +18 -0
  334. package/dist/esm/migrations/0005_signal_principals.d.ts.map +1 -0
  335. package/dist/esm/migrations/0005_signal_principals.js +27 -0
  336. package/dist/esm/migrations/0005_signal_principals.js.map +1 -0
  337. package/dist/esm/migrations/0006_run_principals.d.ts +18 -0
  338. package/dist/esm/migrations/0006_run_principals.d.ts.map +1 -0
  339. package/dist/esm/migrations/0006_run_principals.js +30 -0
  340. package/dist/esm/migrations/0006_run_principals.js.map +1 -0
  341. package/dist/esm/migrations/0007_resume_consent.d.ts +18 -0
  342. package/dist/esm/migrations/0007_resume_consent.d.ts.map +1 -0
  343. package/dist/esm/migrations/0007_resume_consent.js +27 -0
  344. package/dist/esm/migrations/0007_resume_consent.js.map +1 -0
  345. package/dist/esm/test/TestControl.d.ts +19 -0
  346. package/dist/esm/test/TestControl.d.ts.map +1 -0
  347. package/dist/esm/test/TestControl.js +30 -0
  348. package/dist/esm/test/TestControl.js.map +1 -0
  349. package/docs/README.md +189 -0
  350. package/docs/api.md +982 -0
  351. package/docs/concepts/authority.md +109 -0
  352. package/docs/concepts/cancellation.md +129 -0
  353. package/docs/concepts/lineage.md +132 -0
  354. package/docs/concepts/ownership.md +139 -0
  355. package/docs/concepts/projections.md +203 -0
  356. package/docs/concepts/receipts.md +128 -0
  357. package/docs/guides/approvals.md +284 -0
  358. package/docs/guides/cancel-and-resume.md +162 -0
  359. package/docs/guides/durable-storage.md +147 -0
  360. package/docs/guides/implement-an-executor.md +173 -0
  361. package/docs/guides/ingest-a-webhook.md +177 -0
  362. package/docs/guides/list-runs.md +160 -0
  363. package/docs/guides/monitor-runs.md +176 -0
  364. package/docs/guides/observe-health.md +147 -0
  365. package/docs/guides/postgres-tests.md +5 -0
  366. package/docs/guides/serve-over-rpc.md +220 -0
  367. package/docs/guides/signal-a-run.md +53 -0
  368. package/docs/guides/steer-a-run.md +138 -0
  369. package/docs/guides/store-credentials.md +164 -0
  370. package/docs/guides/testing.md +139 -0
  371. package/docs/guides/watch-a-run.md +154 -0
  372. package/docs/installation.md +106 -0
  373. package/docs/quickstart.md +163 -0
  374. package/docs/troubleshooting.md +208 -0
  375. package/package.json +405 -3
  376. package/src/ApprovalAuthority.ts +114 -0
  377. package/src/Cancellation.ts +172 -0
  378. package/src/Channels.ts +493 -0
  379. package/src/Control.ts +337 -0
  380. package/src/ControlClient.ts +319 -0
  381. package/src/ControlError.ts +378 -0
  382. package/src/ControlExecutor.ts +490 -0
  383. package/src/ControlFacts.ts +383 -0
  384. package/src/ControlLive.ts +2113 -0
  385. package/src/ControlRpcs.ts +443 -0
  386. package/src/ControlRuntime.ts +1597 -0
  387. package/src/ControlSchema.ts +1380 -0
  388. package/src/ControlServer.ts +182 -0
  389. package/src/Credential.ts +310 -0
  390. package/src/CredentialCipher.ts +110 -0
  391. package/src/CredentialStore.ts +152 -0
  392. package/src/DispatchReader.ts +122 -0
  393. package/src/Health.ts +591 -0
  394. package/src/JevSessionChecker.ts +127 -0
  395. package/src/Lineage.ts +203 -0
  396. package/src/Migrations.ts +56 -0
  397. package/src/Monitor.ts +600 -0
  398. package/src/ScopedToken.ts +306 -0
  399. package/src/SqlControlRuntime.ts +2476 -0
  400. package/src/SqlCredentialStore.ts +148 -0
  401. package/src/Steering.ts +96 -0
  402. package/src/SystemFlows.ts +225 -0
  403. package/src/WebCryptoCipher.ts +169 -0
  404. package/src/WebhookChannel.ts +166 -0
  405. package/src/index.ts +188 -0
  406. package/src/internal/MutationBoundary.ts +46 -0
  407. package/src/internal/activeFibers.ts +22 -0
  408. package/src/internal/issues.ts +40 -0
  409. package/src/internal/planning.ts +262 -0
  410. package/src/internal/sqlSchemaErrors.ts +37 -0
  411. package/src/migrations/0001_control_tables.ts +99 -0
  412. package/src/migrations/0002_run_keys.ts +23 -0
  413. package/src/migrations/0003_signal_commands.ts +27 -0
  414. package/src/migrations/0004_approval_decisions.ts +25 -0
  415. package/src/migrations/0005_signal_principals.ts +27 -0
  416. package/src/migrations/0006_run_principals.ts +31 -0
  417. package/src/migrations/0007_resume_consent.ts +28 -0
  418. package/src/test/TestControl.ts +47 -0
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Run ancestry as the control plane reads it.
3
+ *
4
+ * A run's ancestry is recorded by whoever created the run, in four different
5
+ * places: the run row's `parent_run_id`, `lineage_id`, and `round_ordinal`
6
+ * columns; the `flows_run_parents` edge a spawn writes; the `created` and
7
+ * `handed-off` run decisions the engine journals; and the `fork-created`
8
+ * marker time travel writes on a forked child. This module owns the one
9
+ * vocabulary they all project onto — {@link Origin} — and the pure functions
10
+ * that do the projecting, so the durable runtime and the watch stream cannot
11
+ * disagree about what a run's ancestry means.
12
+ *
13
+ * The two event types named here are produced by `@smthrs/engine-store` and
14
+ * `@smthrs/time-travel`. They are named as strings rather than imported
15
+ * because the control plane reads journals, not engines: a control plane that
16
+ * depended on the engine could not project a journal written by a different
17
+ * one.
18
+ *
19
+ * @since 0.1.0
20
+ */
21
+ import { Schema } from "effect";
22
+ import type { ControlEvent } from "./ControlSchema.ts";
23
+ /**
24
+ * How a run came to exist.
25
+ *
26
+ * The three values are the lineage-edge kinds of
27
+ * `docs/pages/concepts/time-travel.md`: a `child` is a run its parent spawned, a
28
+ * `fork` is a run branched off a parent frame, and a `continuation` is a later
29
+ * round of one trampoline lineage. A rewind is deliberately absent — it
30
+ * truncates a run in place and creates none — and a run with no ancestor has
31
+ * no origin at all.
32
+ *
33
+ * @category models
34
+ * @since 0.1.0
35
+ */
36
+ export declare const Origin: Schema.Literals<readonly ["child", "fork", "continuation"]>;
37
+ /**
38
+ * How a run came to exist.
39
+ *
40
+ * @category models
41
+ * @since 0.1.0
42
+ */
43
+ export type Origin = typeof Origin.Type;
44
+ /**
45
+ * The ancestry facts an origin is decided from.
46
+ *
47
+ * @category models
48
+ * @since 0.1.0
49
+ */
50
+ export interface Ancestry {
51
+ readonly parentRunId?: string | undefined;
52
+ readonly roundOrdinal?: number | undefined;
53
+ /** Whether a `fork-created` marker names this run. */
54
+ readonly forked?: boolean | undefined;
55
+ }
56
+ /**
57
+ * The journal event type carrying an engine run decision.
58
+ *
59
+ * @category constants
60
+ * @since 0.1.0
61
+ */
62
+ export declare const runDecisionEventType = "flows.engine.run-decision";
63
+ /**
64
+ * The journal event type time travel writes on a forked child.
65
+ *
66
+ * @category constants
67
+ * @since 0.1.0
68
+ */
69
+ export declare const forkCreatedEventType = "flows.time-travel.fork-created";
70
+ /**
71
+ * The kind `watch` reports a derived ancestry delta under.
72
+ *
73
+ * @category constants
74
+ * @since 0.1.0
75
+ */
76
+ export declare const lineageEventType = "control.run.lineage";
77
+ /**
78
+ * Decides how a run came to exist from its ancestry facts.
79
+ *
80
+ * A fork wins over a plain child because a fork records `parent_run_id` too:
81
+ * without the marker every fork would be reported as an ordinary child.
82
+ *
83
+ * @param ancestry the run's recorded ancestry
84
+ * @category projections
85
+ * @since 0.1.0
86
+ */
87
+ export declare const originOf: (ancestry: Ancestry) => Origin | undefined;
88
+ /**
89
+ * Derives the ancestry edge one journal entry discloses, if it discloses one.
90
+ *
91
+ * Three entries do, and each names a different pair:
92
+ *
93
+ * | Entry | Ancestor | Descendant |
94
+ * | --- | --- | --- |
95
+ * | `created` naming `parentExecutionId`, at round 0 or with no round | the spawning run | the entry's run |
96
+ * | `handed-off` naming `nextExecutionId` | the entry's run | the next round |
97
+ * | `fork-created` | the forked-from run | the entry's run |
98
+ *
99
+ * The handoff is what carries a trampoline, and a continuation round's own
100
+ * `created` decision is deliberately skipped. The engine journals BOTH in one
101
+ * transaction: `RunDriver` creates the next round with
102
+ * `{decision: "created", lineageId, roundOrdinal, parentExecutionId}` and then
103
+ * records `{decision: "handed-off", nextExecutionId}` on the round that
104
+ * finished. Both name the same pair, so deriving from both would report one
105
+ * run as a `child` of its predecessor on one entry and a `continuation` of it
106
+ * on the other. The handoff is the one kept, because it reaches a consumer
107
+ * watching the run that hands off — which is the run an operator is already
108
+ * following when a trampoline advances.
109
+ *
110
+ * A `created` decision at round 0, or with no round at all, is an ordinary
111
+ * spawn and derives a `child` edge.
112
+ *
113
+ * Everything else derives nothing. This is a projection over entries the
114
+ * control plane did not write, so an entry it does not recognize is not an
115
+ * error.
116
+ *
117
+ * @param event the projected journal entry
118
+ * @category projections
119
+ * @since 0.1.0
120
+ */
121
+ export declare const derive: (event: ControlEvent) => ControlEvent | undefined;
122
+ /**
123
+ * Expands one projected entry into itself plus any ancestry delta it
124
+ * discloses.
125
+ *
126
+ * @param event the projected journal entry
127
+ * @category projections
128
+ * @since 0.1.0
129
+ */
130
+ export declare const expand: (event: ControlEvent) => ReadonlyArray<ControlEvent>;
131
+ //# sourceMappingURL=Lineage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Lineage.d.ts","sourceRoot":"","sources":["../../src/Lineage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,6DAAqD,CAAA;AAExE;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AAEvC;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1C,sDAAsD;IACtD,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CACtC;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,8BAA8B,CAAA;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,mCAAmC,CAAA;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,wBAAwB,CAAA;AAErD;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,GAAI,UAAU,QAAQ,KAAG,MAAM,GAAG,SAItD,CAAA;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,MAAM,GAAI,OAAO,YAAY,KAAG,YAAY,GAAG,SA8C3D,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,GAAI,OAAO,YAAY,KAAG,aAAa,CAAC,YAAY,CAGtE,CAAA"}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var Lineage_exports = {};
20
+ __export(Lineage_exports, {
21
+ Origin: () => Origin,
22
+ derive: () => derive,
23
+ expand: () => expand,
24
+ forkCreatedEventType: () => forkCreatedEventType,
25
+ lineageEventType: () => lineageEventType,
26
+ originOf: () => originOf,
27
+ runDecisionEventType: () => runDecisionEventType
28
+ });
29
+ module.exports = __toCommonJS(Lineage_exports);
30
+ var import_effect = require("effect");
31
+ const Origin = import_effect.Schema.Literals(["child", "fork", "continuation"]);
32
+ const runDecisionEventType = "flows.engine.run-decision";
33
+ const forkCreatedEventType = "flows.time-travel.fork-created";
34
+ const lineageEventType = "control.run.lineage";
35
+ const originOf = (ancestry) => {
36
+ if (ancestry.forked === true) return "fork";
37
+ if (ancestry.roundOrdinal !== void 0 && ancestry.roundOrdinal > 0) return "continuation";
38
+ return ancestry.parentRunId === void 0 ? void 0 : "child";
39
+ };
40
+ const record = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
41
+ const text = (value) => typeof value === "string" && value.length > 0 ? value : void 0;
42
+ const ordinal = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : void 0;
43
+ const derive = (event) => {
44
+ if (event.runId === void 0) return void 0;
45
+ const payload = record(event.payload);
46
+ if (payload === void 0) return void 0;
47
+ const edge = event.kind === forkCreatedEventType ? { runId: event.runId, parentRunId: text(payload["parentRunId"]), forked: true } : event.kind !== runDecisionEventType ? void 0 : payload["decision"] === "created" ? (ordinal(payload["roundOrdinal"]) ?? 0) > 0 ? void 0 : { runId: event.runId, parentRunId: text(payload["parentExecutionId"]), forked: false } : payload["decision"] === "handed-off" ? {
48
+ runId: text(payload["nextExecutionId"]),
49
+ parentRunId: event.runId,
50
+ forked: false,
51
+ lineageId: text(payload["lineageId"]),
52
+ roundOrdinal: ordinal(payload["roundOrdinal"])
53
+ } : void 0;
54
+ if (edge === void 0 || edge.runId === void 0 || edge.parentRunId === void 0) return void 0;
55
+ const lineageId = "lineageId" in edge ? edge.lineageId : void 0;
56
+ const roundOrdinal = "roundOrdinal" in edge ? edge.roundOrdinal : void 0;
57
+ const origin = originOf({
58
+ parentRunId: edge.parentRunId,
59
+ ...roundOrdinal === void 0 ? {} : { roundOrdinal },
60
+ forked: edge.forked
61
+ });
62
+ return {
63
+ sequence: event.sequence,
64
+ kind: lineageEventType,
65
+ runId: event.runId,
66
+ occurredAt: event.occurredAt,
67
+ payload: {
68
+ runId: edge.runId,
69
+ parentRunId: edge.parentRunId,
70
+ ...lineageId === void 0 ? {} : { lineageId },
71
+ ...roundOrdinal === void 0 ? {} : { roundOrdinal },
72
+ /* v8 ignore next -- `originOf` answers nothing only without a parent, and the guard above already refused an edge with no parent */
73
+ ...origin === void 0 ? {} : { origin }
74
+ }
75
+ };
76
+ };
77
+ const expand = (event) => {
78
+ const derived = derive(event);
79
+ return derived === void 0 ? [event] : [event, derived];
80
+ };
81
+ //# sourceMappingURL=Lineage.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Lineage.ts"],
4
+ "sourcesContent": ["/**\n * Run ancestry as the control plane reads it.\n *\n * A run's ancestry is recorded by whoever created the run, in four different\n * places: the run row's `parent_run_id`, `lineage_id`, and `round_ordinal`\n * columns; the `flows_run_parents` edge a spawn writes; the `created` and\n * `handed-off` run decisions the engine journals; and the `fork-created`\n * marker time travel writes on a forked child. This module owns the one\n * vocabulary they all project onto \u2014 {@link Origin} \u2014 and the pure functions\n * that do the projecting, so the durable runtime and the watch stream cannot\n * disagree about what a run's ancestry means.\n *\n * The two event types named here are produced by `@smthrs/engine-store` and\n * `@smthrs/time-travel`. They are named as strings rather than imported\n * because the control plane reads journals, not engines: a control plane that\n * depended on the engine could not project a journal written by a different\n * one.\n *\n * @since 0.1.0\n */\n\nimport { Schema } from \"effect\"\nimport type { ControlEvent } from \"./ControlSchema.ts\"\n\n/**\n * How a run came to exist.\n *\n * The three values are the lineage-edge kinds of\n * `docs/pages/concepts/time-travel.md`: a `child` is a run its parent spawned, a\n * `fork` is a run branched off a parent frame, and a `continuation` is a later\n * round of one trampoline lineage. A rewind is deliberately absent \u2014 it\n * truncates a run in place and creates none \u2014 and a run with no ancestor has\n * no origin at all.\n *\n * @category models\n * @since 0.1.0\n */\nexport const Origin = Schema.Literals([\"child\", \"fork\", \"continuation\"])\n\n/**\n * How a run came to exist.\n *\n * @category models\n * @since 0.1.0\n */\nexport type Origin = typeof Origin.Type\n\n/**\n * The ancestry facts an origin is decided from.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface Ancestry {\n readonly parentRunId?: string | undefined\n readonly roundOrdinal?: number | undefined\n /** Whether a `fork-created` marker names this run. */\n readonly forked?: boolean | undefined\n}\n\n/**\n * The journal event type carrying an engine run decision.\n *\n * @category constants\n * @since 0.1.0\n */\nexport const runDecisionEventType = \"flows.engine.run-decision\"\n\n/**\n * The journal event type time travel writes on a forked child.\n *\n * @category constants\n * @since 0.1.0\n */\nexport const forkCreatedEventType = \"flows.time-travel.fork-created\"\n\n/**\n * The kind `watch` reports a derived ancestry delta under.\n *\n * @category constants\n * @since 0.1.0\n */\nexport const lineageEventType = \"control.run.lineage\"\n\n/**\n * Decides how a run came to exist from its ancestry facts.\n *\n * A fork wins over a plain child because a fork records `parent_run_id` too:\n * without the marker every fork would be reported as an ordinary child.\n *\n * @param ancestry the run's recorded ancestry\n * @category projections\n * @since 0.1.0\n */\nexport const originOf = (ancestry: Ancestry): Origin | undefined => {\n if (ancestry.forked === true) return \"fork\"\n if (ancestry.roundOrdinal !== undefined && ancestry.roundOrdinal > 0) return \"continuation\"\n return ancestry.parentRunId === undefined ? undefined : \"child\"\n}\n\nconst record = (value: unknown): Readonly<Record<string, unknown>> | undefined =>\n typeof value === \"object\" && value !== null && !Array.isArray(value)\n ? value as Readonly<Record<string, unknown>>\n : undefined\n\nconst text = (value: unknown): string | undefined => typeof value === \"string\" && value.length > 0 ? value : undefined\n\nconst ordinal = (value: unknown): number | undefined =>\n typeof value === \"number\" && Number.isSafeInteger(value) && value >= 0 ? value : undefined\n\n/**\n * Derives the ancestry edge one journal entry discloses, if it discloses one.\n *\n * Three entries do, and each names a different pair:\n *\n * | Entry | Ancestor | Descendant |\n * | --- | --- | --- |\n * | `created` naming `parentExecutionId`, at round 0 or with no round | the spawning run | the entry's run |\n * | `handed-off` naming `nextExecutionId` | the entry's run | the next round |\n * | `fork-created` | the forked-from run | the entry's run |\n *\n * The handoff is what carries a trampoline, and a continuation round's own\n * `created` decision is deliberately skipped. The engine journals BOTH in one\n * transaction: `RunDriver` creates the next round with\n * `{decision: \"created\", lineageId, roundOrdinal, parentExecutionId}` and then\n * records `{decision: \"handed-off\", nextExecutionId}` on the round that\n * finished. Both name the same pair, so deriving from both would report one\n * run as a `child` of its predecessor on one entry and a `continuation` of it\n * on the other. The handoff is the one kept, because it reaches a consumer\n * watching the run that hands off \u2014 which is the run an operator is already\n * following when a trampoline advances.\n *\n * A `created` decision at round 0, or with no round at all, is an ordinary\n * spawn and derives a `child` edge.\n *\n * Everything else derives nothing. This is a projection over entries the\n * control plane did not write, so an entry it does not recognize is not an\n * error.\n *\n * @param event the projected journal entry\n * @category projections\n * @since 0.1.0\n */\nexport const derive = (event: ControlEvent): ControlEvent | undefined => {\n if (event.runId === undefined) return undefined\n const payload = record(event.payload)\n if (payload === undefined) return undefined\n const edge = event.kind === forkCreatedEventType\n ? { runId: event.runId, parentRunId: text(payload[\"parentRunId\"]), forked: true }\n : event.kind !== runDecisionEventType\n ? undefined\n : payload[\"decision\"] === \"created\"\n // A continuation round's `created` names its predecessor too. The handoff\n // the previous round journals in the SAME transaction already discloses\n // that edge, so deriving here as well would contradict it.\n ? (ordinal(payload[\"roundOrdinal\"]) ?? 0) > 0\n ? undefined\n : { runId: event.runId, parentRunId: text(payload[\"parentExecutionId\"]), forked: false }\n : payload[\"decision\"] === \"handed-off\"\n ? {\n runId: text(payload[\"nextExecutionId\"]),\n parentRunId: event.runId,\n forked: false,\n lineageId: text(payload[\"lineageId\"]),\n roundOrdinal: ordinal(payload[\"roundOrdinal\"])\n }\n : undefined\n if (edge === undefined || edge.runId === undefined || edge.parentRunId === undefined) return undefined\n const lineageId = \"lineageId\" in edge ? edge.lineageId : undefined\n const roundOrdinal = \"roundOrdinal\" in edge ? edge.roundOrdinal : undefined\n const origin = originOf({\n parentRunId: edge.parentRunId,\n ...(roundOrdinal === undefined ? {} : { roundOrdinal }),\n forked: edge.forked\n })\n return {\n sequence: event.sequence,\n kind: lineageEventType,\n runId: event.runId,\n occurredAt: event.occurredAt,\n payload: {\n runId: edge.runId,\n parentRunId: edge.parentRunId,\n ...(lineageId === undefined ? {} : { lineageId }),\n ...(roundOrdinal === undefined ? {} : { roundOrdinal }),\n /* v8 ignore next -- `originOf` answers nothing only without a parent, and the guard above already refused an edge with no parent */\n ...(origin === undefined ? {} : { origin })\n }\n }\n}\n\n/**\n * Expands one projected entry into itself plus any ancestry delta it\n * discloses.\n *\n * @param event the projected journal entry\n * @category projections\n * @since 0.1.0\n */\nexport const expand = (event: ControlEvent): ReadonlyArray<ControlEvent> => {\n const derived = derive(event)\n return derived === undefined ? [event] : [event, derived]\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBA,oBAAuB;AAgBhB,MAAM,SAAS,qBAAO,SAAS,CAAC,SAAS,QAAQ,cAAc,CAAC;AA6BhE,MAAM,uBAAuB;AAQ7B,MAAM,uBAAuB;AAQ7B,MAAM,mBAAmB;AAYzB,MAAM,WAAW,CAAC,aAA2C;AAClE,MAAI,SAAS,WAAW,KAAM,QAAO;AACrC,MAAI,SAAS,iBAAiB,UAAa,SAAS,eAAe,EAAG,QAAO;AAC7E,SAAO,SAAS,gBAAgB,SAAY,SAAY;AAC1D;AAEA,MAAM,SAAS,CAAC,UACd,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK,IAC/D,QACA;AAEN,MAAM,OAAO,CAAC,UAAuC,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI,QAAQ;AAE7G,MAAM,UAAU,CAAC,UACf,OAAO,UAAU,YAAY,OAAO,cAAc,KAAK,KAAK,SAAS,IAAI,QAAQ;AAmC5E,MAAM,SAAS,CAAC,UAAkD;AACvE,MAAI,MAAM,UAAU,OAAW,QAAO;AACtC,QAAM,UAAU,OAAO,MAAM,OAAO;AACpC,MAAI,YAAY,OAAW,QAAO;AAClC,QAAM,OAAO,MAAM,SAAS,uBACxB,EAAE,OAAO,MAAM,OAAO,aAAa,KAAK,QAAQ,aAAa,CAAC,GAAG,QAAQ,KAAK,IAC9E,MAAM,SAAS,uBACf,SACA,QAAQ,UAAU,MAAM,aAIvB,QAAQ,QAAQ,cAAc,CAAC,KAAK,KAAK,IACxC,SACA,EAAE,OAAO,MAAM,OAAO,aAAa,KAAK,QAAQ,mBAAmB,CAAC,GAAG,QAAQ,MAAM,IACvF,QAAQ,UAAU,MAAM,eACxB;AAAA,IACA,OAAO,KAAK,QAAQ,iBAAiB,CAAC;AAAA,IACtC,aAAa,MAAM;AAAA,IACnB,QAAQ;AAAA,IACR,WAAW,KAAK,QAAQ,WAAW,CAAC;AAAA,IACpC,cAAc,QAAQ,QAAQ,cAAc,CAAC;AAAA,EAC/C,IACE;AACJ,MAAI,SAAS,UAAa,KAAK,UAAU,UAAa,KAAK,gBAAgB,OAAW,QAAO;AAC7F,QAAM,YAAY,eAAe,OAAO,KAAK,YAAY;AACzD,QAAM,eAAe,kBAAkB,OAAO,KAAK,eAAe;AAClE,QAAM,SAAS,SAAS;AAAA,IACtB,aAAa,KAAK;AAAA,IAClB,GAAI,iBAAiB,SAAY,CAAC,IAAI,EAAE,aAAa;AAAA,IACrD,QAAQ,KAAK;AAAA,EACf,CAAC;AACD,SAAO;AAAA,IACL,UAAU,MAAM;AAAA,IAChB,MAAM;AAAA,IACN,OAAO,MAAM;AAAA,IACb,YAAY,MAAM;AAAA,IAClB,SAAS;AAAA,MACP,OAAO,KAAK;AAAA,MACZ,aAAa,KAAK;AAAA,MAClB,GAAI,cAAc,SAAY,CAAC,IAAI,EAAE,UAAU;AAAA,MAC/C,GAAI,iBAAiB,SAAY,CAAC,IAAI,EAAE,aAAa;AAAA;AAAA,MAErD,GAAI,WAAW,SAAY,CAAC,IAAI,EAAE,OAAO;AAAA,IAC3C;AAAA,EACF;AACF;AAUO,MAAM,SAAS,CAAC,UAAqD;AAC1E,QAAM,UAAU,OAAO,KAAK;AAC5B,SAAO,YAAY,SAAY,CAAC,KAAK,IAAI,CAAC,OAAO,OAAO;AAC1D;",
6
+ "names": []
7
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Control-plane and credential schema migrations.
3
+ *
4
+ * This package reserves the migration block immediately after time travel.
5
+ * Hosts compose this set with the journal and run-store sets before opening a
6
+ * shared control database.
7
+ *
8
+ * @since 0.1.0
9
+ */
10
+ import * as DatabaseMigrations from "@smthrs/database/Migrations";
11
+ import * as Layer from "effect/Layer";
12
+ /**
13
+ * The control package's namespaced migration set.
14
+ *
15
+ * @category migrations
16
+ * @since 0.1.0
17
+ */
18
+ export declare const set: DatabaseMigrations.MigrationSet;
19
+ /**
20
+ * Creates every durable control-plane and credential table.
21
+ *
22
+ * @category migrations
23
+ * @since 0.1.0
24
+ */
25
+ export declare const run: import("effect/Effect").Effect<readonly (readonly [id: number, name: string])[], import("effect/unstable/sql/SqlError").SqlError | import("effect/unstable/sql/Migrator").MigrationError, import("effect/unstable/sql/SqlClient").SqlClient>;
26
+ /**
27
+ * Layer that runs control migrations before exposing the database to control
28
+ * services.
29
+ *
30
+ * @category layers
31
+ * @since 0.1.0
32
+ */
33
+ export declare const layer: Layer.Layer<never, import("effect/unstable/sql/SqlError").SqlError | import("effect/unstable/sql/Migrator").MigrationError, import("effect/unstable/sql/SqlClient").SqlClient>;
34
+ //# sourceMappingURL=Migrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migrations.d.ts","sourceRoot":"","sources":["../../src/Migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,kBAAkB,MAAM,6BAA6B,CAAA;AACjE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AASrC;;;;;GAKG;AACH,eAAO,MAAM,GAAG,EAAE,kBAAkB,CAAC,YAYpC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,GAAG,8OAAgC,CAAA;AAEhD;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,gLAA2B,CAAA"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var Migrations_exports = {};
30
+ __export(Migrations_exports, {
31
+ layer: () => layer,
32
+ run: () => run,
33
+ set: () => set
34
+ });
35
+ module.exports = __toCommonJS(Migrations_exports);
36
+ var DatabaseMigrations = __toESM(require("@smthrs/database/Migrations"), 1);
37
+ var Layer = __toESM(require("effect/Layer"), 1);
38
+ var import_control_tables = require("./migrations/0001_control_tables.js");
39
+ var import_run_keys = require("./migrations/0002_run_keys.js");
40
+ var import_signal_commands = require("./migrations/0003_signal_commands.js");
41
+ var import_approval_decisions = require("./migrations/0004_approval_decisions.js");
42
+ var import_signal_principals = require("./migrations/0005_signal_principals.js");
43
+ var import_run_principals = require("./migrations/0006_run_principals.js");
44
+ var import_resume_consent = require("./migrations/0007_resume_consent.js");
45
+ const set = {
46
+ namespace: "control",
47
+ idOffset: DatabaseMigrations.idBlock * 6,
48
+ migrations: {
49
+ "0001_control_tables": import_control_tables.initial,
50
+ "0002_run_keys": import_run_keys.runKeys,
51
+ "0003_signal_commands": import_signal_commands.signalCommands,
52
+ "0004_approval_decisions": import_approval_decisions.approvalDecisions,
53
+ "0005_signal_principals": import_signal_principals.signalPrincipals,
54
+ "0006_run_principals": import_run_principals.runPrincipals,
55
+ "0007_resume_consent": import_resume_consent.resumeConsent
56
+ }
57
+ };
58
+ const run = DatabaseMigrations.run([set]);
59
+ const layer = Layer.effectDiscard(run);
60
+ //# sourceMappingURL=Migrations.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Migrations.ts"],
4
+ "sourcesContent": ["/**\n * Control-plane and credential schema migrations.\n *\n * This package reserves the migration block immediately after time travel.\n * Hosts compose this set with the journal and run-store sets before opening a\n * shared control database.\n *\n * @since 0.1.0\n */\n\nimport * as DatabaseMigrations from \"@smthrs/database/Migrations\"\nimport * as Layer from \"effect/Layer\"\nimport { initial } from \"./migrations/0001_control_tables.ts\"\nimport { runKeys } from \"./migrations/0002_run_keys.ts\"\nimport { signalCommands } from \"./migrations/0003_signal_commands.ts\"\nimport { approvalDecisions } from \"./migrations/0004_approval_decisions.ts\"\nimport { signalPrincipals } from \"./migrations/0005_signal_principals.ts\"\nimport { runPrincipals } from \"./migrations/0006_run_principals.ts\"\nimport { resumeConsent } from \"./migrations/0007_resume_consent.ts\"\n\n/**\n * The control package's namespaced migration set.\n *\n * @category migrations\n * @since 0.1.0\n */\nexport const set: DatabaseMigrations.MigrationSet = {\n namespace: \"control\",\n idOffset: DatabaseMigrations.idBlock * 6,\n migrations: {\n \"0001_control_tables\": initial,\n \"0002_run_keys\": runKeys,\n \"0003_signal_commands\": signalCommands,\n \"0004_approval_decisions\": approvalDecisions,\n \"0005_signal_principals\": signalPrincipals,\n \"0006_run_principals\": runPrincipals,\n \"0007_resume_consent\": resumeConsent\n }\n}\n\n/**\n * Creates every durable control-plane and credential table.\n *\n * @category migrations\n * @since 0.1.0\n */\nexport const run = DatabaseMigrations.run([set])\n\n/**\n * Layer that runs control migrations before exposing the database to control\n * services.\n *\n * @category layers\n * @since 0.1.0\n */\nexport const layer = Layer.effectDiscard(run)\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,yBAAoC;AACpC,YAAuB;AACvB,4BAAwB;AACxB,sBAAwB;AACxB,6BAA+B;AAC/B,gCAAkC;AAClC,+BAAiC;AACjC,4BAA8B;AAC9B,4BAA8B;AAQvB,MAAM,MAAuC;AAAA,EAClD,WAAW;AAAA,EACX,UAAU,mBAAmB,UAAU;AAAA,EACvC,YAAY;AAAA,IACV,uBAAuB;AAAA,IACvB,iBAAiB;AAAA,IACjB,wBAAwB;AAAA,IACxB,2BAA2B;AAAA,IAC3B,0BAA0B;AAAA,IAC1B,uBAAuB;AAAA,IACvB,uBAAuB;AAAA,EACzB;AACF;AAQO,MAAM,MAAM,mBAAmB,IAAI,CAAC,GAAG,CAAC;AASxC,MAAM,QAAQ,MAAM,cAAc,GAAG;",
6
+ "names": []
7
+ }
@@ -0,0 +1,282 @@
1
+ /**
2
+ * Run health over the control plane: what a run's state means, and what to do
3
+ * about it.
4
+ *
5
+ * A control plane answers "what is this run doing". A monitor answers the
6
+ * question after it — "is that all right, and if not, what now" — and the two
7
+ * are deliberately separate modules. {@link classify} is a pure function of
8
+ * one observation, so the vocabulary an operator reads on a dashboard is the
9
+ * same one a heal loop branches on and the same one a test can enumerate.
10
+ * {@link run} is the loop that beats over `Control` and journals what it saw.
11
+ *
12
+ * The classification is decided from durable evidence only: the run summary
13
+ * the control plane projects, and the journal entries `watch` replays. Nothing
14
+ * here reads an in-process fiber, which is what makes a monitor able to watch
15
+ * a run in another process at all.
16
+ *
17
+ * @since 0.1.0
18
+ */
19
+ import { Journal } from "@smthrs/journal";
20
+ import { Effect } from "effect";
21
+ import { Control } from "./Control.ts";
22
+ import type { ControlError } from "./ControlError.ts";
23
+ import type { ControlEvent, Receipt, RunId, RunSummary } from "./ControlSchema.ts";
24
+ import * as SubjectHealth from "./Health.ts";
25
+ /**
26
+ * The journal event type the engine records when an action attempt starts.
27
+ *
28
+ * Named as a string rather than imported, exactly as in `Lineage`: a monitor
29
+ * reads journals, not engines.
30
+ *
31
+ * @category constants
32
+ * @since 0.1.0
33
+ */
34
+ export declare const attemptStartedEventType = "flows.engine.attempt-started";
35
+ /**
36
+ * The journal event type the engine records when an action attempt settles.
37
+ *
38
+ * @category constants
39
+ * @since 0.1.0
40
+ */
41
+ export declare const attemptFinishedEventType = "flows.engine.attempt-finished";
42
+ /**
43
+ * The journal event type one monitor beat is recorded under.
44
+ *
45
+ * @category constants
46
+ * @since 0.1.0
47
+ */
48
+ export declare const beatEventType = "control.monitor.beat";
49
+ /**
50
+ * The journal event type one applied remedy is recorded under.
51
+ *
52
+ * A beat and a heal are two records because they are two facts, and only one
53
+ * of them is true before the remedy runs. A single record carrying `healed`
54
+ * has to be written either before the remedy — leaving durable evidence of a
55
+ * heal that a crash one instruction later never performed — or after it, which
56
+ * loses the evidence of what a monitor decided when the remedy is what killed
57
+ * it. Splitting them keeps both.
58
+ *
59
+ * @category constants
60
+ * @since 0.1.0
61
+ */
62
+ export declare const healedEventType = "control.monitor.healed";
63
+ /**
64
+ * What a run looks like to a monitor.
65
+ *
66
+ * `healthy` covers both "moving" and "finished": a completed run needs nothing
67
+ * done to it, and neither does one that is making progress. The other six name
68
+ * a specific thing that is wrong, because a heal that cannot tell them apart
69
+ * would resume a run that is waiting for a human.
70
+ *
71
+ * @category models
72
+ * @since 0.1.0
73
+ */
74
+ export declare const Health: import("effect/Schema").Literals<readonly ["healthy", "stalled", "wedged-node", "runaway-loop", "awaiting-human", "failing", "unknown"]>;
75
+ /**
76
+ * What a run looks like to a monitor.
77
+ *
78
+ * @category models
79
+ * @since 0.1.0
80
+ */
81
+ export type Health = typeof Health.Type;
82
+ /**
83
+ * Everything one classification is decided from.
84
+ *
85
+ * `events` is the run's journal as `watch` projects it, oldest first.
86
+ * `beatsWithoutProgress` counts consecutive beats that added no entry, and
87
+ * `stallBeats` is how many of those make a stall. Splitting the count from the
88
+ * threshold is what lets the same pure function serve a monitor that beats
89
+ * every second and one that beats every hour.
90
+ *
91
+ * @category models
92
+ * @since 0.1.0
93
+ */
94
+ export interface Observation {
95
+ /** The run's projection, or nothing when the control plane has no such run. */
96
+ readonly summary?: RunSummary | undefined;
97
+ readonly events: ReadonlyArray<ControlEvent>;
98
+ readonly beatsWithoutProgress: number;
99
+ readonly stallBeats: number;
100
+ /**
101
+ * The trampoline round at which a lineage stops being a loop and starts
102
+ * being a runaway. A run past it is looping without converging.
103
+ */
104
+ readonly roundBound?: number | undefined;
105
+ /** Fresh, explicitly reported semantic work; never inferred from bytes or monitor events. */
106
+ readonly semanticProgress?: boolean | undefined;
107
+ }
108
+ /**
109
+ * Decides what a run's state means.
110
+ *
111
+ * The order is the order an operator would read it in, and each rule earns its
112
+ * place by naming a different response:
113
+ *
114
+ * | Condition | Health | Because |
115
+ * | --- | --- | --- |
116
+ * | No summary | `unknown` | Nothing to say, and nothing to do. |
117
+ * | `failed` | `failing` | The run itself reported the failure. |
118
+ * | `completed`, `cancelled` | `healthy` | A finished run needs nothing. |
119
+ * | `waiting-approval`, or parked on `approval` | `awaiting-human` | A human owes it an answer; no machine can supply one. |
120
+ * | Parked with no waiting reason | `awaiting-human` | Only an operator's own park writes no waiting reason, so a person stopped it and a person restarts it. |
121
+ * | `roundOrdinal` at or past the bound | `runaway-loop` | The lineage is looping without converging. |
122
+ * | The last settled attempt failed | `failing` | The run is still alive but its work is not landing. |
123
+ * | No progress for `stallBeats`, an attempt open | `wedged-node` | One attempt started and never settled: the work is stuck, not the run. |
124
+ * | No progress for `stallBeats` | `stalled` | Nothing is happening and nothing is in flight. |
125
+ * | Anything else | `healthy` | Entries are still arriving. |
126
+ *
127
+ * `awaiting-human` deliberately outranks `failing`: a run parked for approval
128
+ * after a failed attempt is waiting for a person, and resuming or cancelling
129
+ * it would take the decision away from them.
130
+ *
131
+ * A park with no reason is the same case. The engine names every park it makes
132
+ * — `event`, `approval`, `timer`, `quota`, `released` — so a parked run whose
133
+ * `waitingReason` is absent was parked by an operator through
134
+ * `ControlRuntime.writeStatus`. Calling that a stall and resuming it would undo
135
+ * a deliberate act, which is the worst thing an unattended heal loop can do.
136
+ *
137
+ * @param observation what the beat saw
138
+ * @category projections
139
+ * @since 0.1.0
140
+ */
141
+ export declare const classify: (observation: Observation) => Health;
142
+ /**
143
+ * What a monitor does about one unhealthy run.
144
+ *
145
+ * @category models
146
+ * @since 0.1.0
147
+ */
148
+ export type Remedy = "resume" | "cancel" | "none";
149
+ /**
150
+ * The remedy a health warrants, before `autoHeal` decides whether to apply it.
151
+ *
152
+ * A stalled or wedged run is one nobody is driving, and a resume claims it. A
153
+ * failing or runaway run is one that will not get better by being driven
154
+ * harder. Everything else is left alone.
155
+ *
156
+ * @param health what the beat classified
157
+ * @category projections
158
+ * @since 0.1.0
159
+ */
160
+ export declare const remedyFor: (health: Health) => Remedy;
161
+ /**
162
+ * One beat of a monitor.
163
+ *
164
+ * @category models
165
+ * @since 0.1.0
166
+ */
167
+ export interface Beat {
168
+ /** Which beat this was, counting from zero. */
169
+ readonly beat: number;
170
+ readonly health: Health;
171
+ /** The newest journal sequence the run had, ignoring the monitor's own records. */
172
+ readonly sequence: number;
173
+ /**
174
+ * The remedy that ran and returned, absent when none did.
175
+ *
176
+ * Present only after the heal succeeded, which is also when
177
+ * `control.monitor.healed` is journaled. A beat that decided on a remedy the
178
+ * monitor never got to apply reports nothing here.
179
+ */
180
+ readonly healed?: Remedy | undefined;
181
+ /** The receipt the remedy returned, absent when none was applied. */
182
+ readonly receipt?: Receipt | undefined;
183
+ }
184
+ /**
185
+ * What a monitor found.
186
+ *
187
+ * @category models
188
+ * @since 0.1.0
189
+ */
190
+ export interface Report {
191
+ readonly runId: RunId;
192
+ readonly beats: ReadonlyArray<Beat>;
193
+ /** The last beat's health, or `unknown` when no beat ran. */
194
+ readonly health: Health;
195
+ }
196
+ /**
197
+ * How a monitor beats.
198
+ *
199
+ * @category models
200
+ * @since 0.1.0
201
+ */
202
+ export interface Options {
203
+ readonly runId: RunId;
204
+ /** Optional configured observational checker; checker results never authorize a remedy. */
205
+ readonly healthCheck?: SubjectHealth.ResolvedCheck | undefined;
206
+ /** Shared host admission limit around probes. */
207
+ readonly withProbePermit?: (<A>(effect: Effect.Effect<A>) => Effect.Effect<A>) | undefined;
208
+ /** Bounded retained beat history for long-lived host monitoring. */
209
+ readonly retainBeats?: number | undefined;
210
+ /** Hosts with structured status observations omit redundant legacy heartbeat records. */
211
+ readonly recordBeats?: boolean | undefined;
212
+ /**
213
+ * Who is watching. Defaults to `default`.
214
+ *
215
+ * It reaches the journal twice: as the source of every record this monitor
216
+ * writes, and as `monitorId` in each payload. Two monitors pointed at one
217
+ * run both beat and both remedy — nothing on the control plane leases a run
218
+ * to one watcher — so the identity is what makes their evidence tellable
219
+ * apart, and what keeps their remedies on separate idempotency keys.
220
+ */
221
+ readonly monitorId?: string | undefined;
222
+ /** How long to wait between beats. Defaults to one second. */
223
+ readonly intervalMs?: number | undefined;
224
+ /** How many beats to take before reporting. Defaults to ten. */
225
+ readonly maxChecks?: number | undefined;
226
+ /** How many beats without progress make a stall. Defaults to three. */
227
+ readonly stallBeats?: number | undefined;
228
+ /** The round at which a trampoline is a runaway. Defaults to 32. */
229
+ readonly roundBound?: number | undefined;
230
+ /** Which healths the monitor is allowed to act on. Defaults to none. */
231
+ readonly autoHeal?: ReadonlyArray<Health> | undefined;
232
+ /**
233
+ * What to do about an unhealthy run. Defaults to `Control.resume` and
234
+ * `Control.cancel` per {@link remedyFor}.
235
+ *
236
+ * A heal that fails does not abort the monitor: the failure is logged, the
237
+ * beat is recorded without `healed` or `receipt`, and the loop moves to the
238
+ * next beat, where the stall evidence still stands and the remedy is
239
+ * retried under that beat's own idempotency key.
240
+ */
241
+ readonly heal?: (input: {
242
+ readonly runId: RunId;
243
+ readonly health: Health;
244
+ readonly remedy: Remedy;
245
+ readonly beat: number;
246
+ }) => Effect.Effect<Receipt, ControlError>;
247
+ }
248
+ /**
249
+ * Watches one run and, when told to, heals it.
250
+ *
251
+ * The loop stops early on a terminal run, because a finished run has nothing
252
+ * left to observe and beating at it would fill its journal with heartbeats.
253
+ * Otherwise it takes `maxChecks` beats and reports what it saw.
254
+ *
255
+ * Every beat is journaled as `control.monitor.beat` before any remedy is
256
+ * applied, carrying the `remedy` it is about to attempt, so a monitor that
257
+ * crashes mid-heal leaves the evidence of what it decided. The remedy itself
258
+ * is journaled separately as `control.monitor.healed`, and only once the heal
259
+ * returned a receipt: a heal that failed, or a process that died running one,
260
+ * must not leave a durable record saying the run was healed.
261
+ *
262
+ * `autoHeal` is empty by default. A monitor that healed by default would be a
263
+ * monitor that cancels a run the first time it looks at one, which is the
264
+ * wrong default for a thing an operator points at production.
265
+ *
266
+ * Nothing here leases the run. Two monitors on one run both beat and both
267
+ * remedy, so a remedy has to be idempotent on the control plane — which the
268
+ * two defaults are, through `Control.resume` and `Control.cancel`
269
+ * idempotency keys that name the monitor, the run, and the beat. A custom
270
+ * `heal` owes the same property.
271
+ *
272
+ * @param options how to beat and what to heal
273
+ * @category constructors
274
+ * @since 0.1.0
275
+ */
276
+ export declare const run: (options: Options) => Effect.Effect<Report, ControlError, Control | Journal.Journal>;
277
+ /** Observer and notification bookkeeping is never execution progress.
278
+ * @category predicates
279
+ * @since 1.0.0
280
+ */
281
+ export declare const isBookkeepingEvent: (kind: string) => boolean;
282
+ //# sourceMappingURL=Monitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Monitor.d.ts","sourceRoot":"","sources":["../../src/Monitor.ts"],"names":[],"mappings":"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"}