@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 @@
1
+ {"version":3,"file":"ControlSchema.d.ts","sourceRoot":"","sources":["../../src/ControlSchema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,YAAY,MAAM,oCAAoC,CAAA;AAElE,OAAO,EAAoB,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAG/B;;;;;GAKG;AACH,eAAO,MAAM,KAAK,eAAgB,CAAA;AAElC;;;;;GAKG;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAErC;;;;;GAKG;AACH,eAAO,MAAM,MAAM,eAAgB,CAAA;AAEnC;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,cAAc,eAAgB,CAAA;AAE3C;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAA;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,SAAS;;;;E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I,CAAA;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,OAAO;;;EAA+D,CAAA;AAEnF;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;IAqBlB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA"}
@@ -0,0 +1,634 @@
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 ControlSchema_exports = {};
30
+ __export(ControlSchema_exports, {
31
+ ApprovalInputSchema: () => ApprovalInputSchema,
32
+ ApprovalPayload: () => ApprovalPayload,
33
+ ApprovalTarget: () => ApprovalTarget,
34
+ CancelInputSchema: () => CancelInputSchema,
35
+ CancelSource: () => CancelSource,
36
+ Cancellation: () => Cancellation,
37
+ ControlEvent: () => ControlEvent,
38
+ Envelope: () => Envelope,
39
+ ExecutionBatch: () => ExecutionBatch,
40
+ FireOutcome: () => FireOutcome,
41
+ FireSummary: () => FireSummary,
42
+ FlowId: () => FlowId,
43
+ GrantScope: () => GrantScope,
44
+ IdempotencyKey: () => IdempotencyKey,
45
+ ListRequest: () => ListRequest,
46
+ ListResponse: () => ListResponse,
47
+ MessageSteer: () => MessageSteer,
48
+ PageLimit: () => PageLimit,
49
+ PendingWait: () => PendingWait,
50
+ PlanCard: () => PlanCard,
51
+ PlanDecision: () => PlanDecision,
52
+ PlanEdge: () => PlanEdge,
53
+ PlanEdgeReason: () => PlanEdgeReason,
54
+ PlanGraph: () => PlanGraph,
55
+ PlanGraphNode: () => PlanGraphNode,
56
+ PlanInputSchema: () => PlanInputSchema,
57
+ PlanNode: () => PlanNode,
58
+ PlanNodeStatus: () => PlanNodeStatus,
59
+ PlanSummary: () => PlanSummary,
60
+ Principal: () => Principal,
61
+ ReasonedMutationInputSchema: () => ReasonedMutationInputSchema,
62
+ Receipt: () => Receipt,
63
+ ResumeInputSchema: () => ResumeInputSchema,
64
+ RunHost: () => RunHost,
65
+ RunId: () => RunId,
66
+ RunInputSchema: () => RunInputSchema,
67
+ RunMutationInputSchema: () => RunMutationInputSchema,
68
+ RunOrigin: () => RunOrigin,
69
+ RunStatus: () => RunStatus,
70
+ RunSummary: () => RunSummary,
71
+ SeatSteer: () => SeatSteer,
72
+ SignalInputSchema: () => SignalInputSchema,
73
+ SignalPayload: () => SignalPayload,
74
+ SteerInputSchema: () => SteerInputSchema,
75
+ SteerMessage: () => SteerMessage,
76
+ ThinkingSteer: () => ThinkingSteer,
77
+ ToolsSteer: () => ToolsSteer,
78
+ TriggerSummary: () => TriggerSummary,
79
+ WatchCursor: () => WatchCursor,
80
+ WatchFilter: () => WatchFilter,
81
+ defaultPageSize: () => defaultPageSize,
82
+ maxPageSize: () => maxPageSize,
83
+ steerItem: () => steerItem
84
+ });
85
+ module.exports = __toCommonJS(ControlSchema_exports);
86
+ var import_journal = require("@smthrs/journal");
87
+ var import_Notification = require("@smthrs/notifications/Notification");
88
+ var SteerPayload = __toESM(require("@smthrs/notifications/SteerPayload"), 1);
89
+ var PersistedPlan = __toESM(require("@smthrs/plan/Plan"), 1);
90
+ var import_Descriptor = require("@smthrs/registry/Descriptor");
91
+ var import_effect = require("effect");
92
+ var import_Lineage = require("./Lineage.js");
93
+ const RunId = import_effect.Schema.String;
94
+ const FlowId = import_effect.Schema.String;
95
+ const IdempotencyKey = import_effect.Schema.String;
96
+ const Principal = import_effect.Schema.Struct({
97
+ id: import_effect.Schema.String,
98
+ kind: import_effect.Schema.String,
99
+ stampedAt: import_effect.Schema.Number
100
+ });
101
+ const Envelope = import_effect.Schema.Struct({
102
+ capabilities: import_effect.Schema.Array(import_effect.Schema.String),
103
+ /** Unrestricted builtin/addon/package imports, outside the guarded capability ceiling. */
104
+ hostImports: import_effect.Schema.optional(import_effect.Schema.Array(import_effect.Schema.String)),
105
+ flows: import_effect.Schema.Array(import_effect.Schema.String),
106
+ budget: import_effect.Schema.Struct({
107
+ tokens: import_effect.Schema.optional(import_effect.Schema.Number),
108
+ milliseconds: import_effect.Schema.optional(import_effect.Schema.Number),
109
+ usd: import_effect.Schema.optional(import_effect.Schema.Number),
110
+ onExceeded: import_effect.Schema.optional(import_Descriptor.BudgetOnExceeded),
111
+ deadline: import_effect.Schema.optional(import_effect.Schema.Int.check(import_effect.Schema.isGreaterThan(0)))
112
+ }),
113
+ host: import_effect.Schema.optional(import_effect.Schema.String)
114
+ });
115
+ const GrantScope = import_effect.Schema.Literals(["once", "run", "remembered"]);
116
+ const ApprovalTarget = import_effect.Schema.Union([
117
+ import_effect.Schema.TaggedStruct("Plan", {
118
+ planId: import_effect.Schema.String,
119
+ digest: import_effect.Schema.String,
120
+ envelope: Envelope
121
+ }),
122
+ import_effect.Schema.TaggedStruct("Node", {
123
+ runId: RunId,
124
+ requestId: import_effect.Schema.String,
125
+ digest: import_effect.Schema.String,
126
+ envelope: Envelope
127
+ })
128
+ ]);
129
+ const ApprovalPayload = import_effect.Schema.Struct({
130
+ target: ApprovalTarget,
131
+ scope: GrantScope,
132
+ idempotencyKey: IdempotencyKey
133
+ });
134
+ const PlanNodeStatus = import_effect.Schema.Literals(["cached", "run"]);
135
+ const PlanNode = import_effect.Schema.Struct({
136
+ ...PersistedPlan.PlanNode.fields,
137
+ status: PlanNodeStatus
138
+ });
139
+ const PlanEdgeReason = import_effect.Schema.Literals(["value", "continuation", "failure", "conflict", "lane-merge"]);
140
+ const PlanEdge = import_effect.Schema.Struct({
141
+ from: import_effect.Schema.NonEmptyString,
142
+ to: import_effect.Schema.NonEmptyString,
143
+ reason: PlanEdgeReason
144
+ });
145
+ const PlanGraphNode = import_effect.Schema.Struct({
146
+ id: import_effect.Schema.NonEmptyString,
147
+ declaredAt: import_effect.Schema.optionalKey(import_journal.EngineEvent.DeclaredAt)
148
+ });
149
+ const PlanGraph = import_effect.Schema.Struct({
150
+ edges: import_effect.Schema.Array(PlanEdge),
151
+ nodes: import_effect.Schema.optional(import_effect.Schema.Array(PlanGraphNode)),
152
+ /**
153
+ * The revision of the workspace those declaration sites were read out of.
154
+ *
155
+ * A site is a path and a line, and neither says which bytes were there: a
156
+ * host's working tree moves, so the same path after an edit or a branch
157
+ * switch is a different file. This is the immutable name of the tree the
158
+ * host loaded the flow from — a jj working-copy commit id, or a git commit
159
+ * for a tree that still matches one — and a reader asks the content route
160
+ * for the file AT this revision rather than for whatever is on disk now.
161
+ *
162
+ * A host that cannot name one reports nothing, and a reader that has
163
+ * nothing shows no code at all rather than code it cannot bind (D-068).
164
+ *
165
+ * Exactly the forty lowercase hex digits the only producer emits
166
+ * (`SourceRevision.objectId`), because the app puts this value straight
167
+ * into a contents route's `?ref=` and a route that spawns jj or git from it
168
+ * should never see anything else.
169
+ */
170
+ sourceRevision: import_effect.Schema.optional(
171
+ import_effect.Schema.NonEmptyString.check(import_effect.Schema.makeFilter((value) => /^[0-9a-f]{40}$/.test(value)))
172
+ )
173
+ });
174
+ const PlanCard = import_effect.Schema.Struct({
175
+ planId: import_effect.Schema.String,
176
+ flowId: FlowId,
177
+ digest: import_effect.Schema.String,
178
+ inputSummary: import_effect.Schema.String,
179
+ /** Discovery diagnostics for the selected flow; outside the approval identity. */
180
+ warnings: import_effect.Schema.optional(import_effect.Schema.Array(import_Descriptor.DiscoveryWarning)),
181
+ envelope: Envelope,
182
+ deployClass: import_effect.Schema.Boolean,
183
+ /** Executable source/metadata identity supplied by a discovery-based host. */
184
+ executionDigest: import_effect.Schema.optional(import_effect.Schema.String),
185
+ plan: import_effect.Schema.optional(PersistedPlan.Plan),
186
+ nodes: import_effect.Schema.Array(PlanNode),
187
+ /**
188
+ * The labelled edges of the graph this plan was built from, and where its
189
+ * nodes were declared.
190
+ *
191
+ * Deliberately OUTSIDE the digest an approval binds to: the edges and the
192
+ * declaration sites describe the plan a reader draws, and nothing here
193
+ * changes what will run. The
194
+ * persisted plan's own digest already covers keys, edges, effects,
195
+ * conflicts, priorities and generations, so a host that starts reporting
196
+ * this field re-plans to the digest it planned to before and every parked
197
+ * approval still validates.
198
+ */
199
+ graph: import_effect.Schema.optional(PlanGraph),
200
+ approval: ApprovalPayload
201
+ });
202
+ const RunStatus = import_effect.Schema.Literals([
203
+ "accepted",
204
+ "running",
205
+ "parked",
206
+ "waiting-approval",
207
+ "cancelled",
208
+ "completed",
209
+ "failed"
210
+ ]);
211
+ const RunOrigin = import_Lineage.Origin;
212
+ const CancelSource = import_effect.Schema.Literals(["control", "engine", "cascade"]);
213
+ const Cancellation = import_effect.Schema.Struct({
214
+ requestedAt: import_effect.Schema.Number,
215
+ source: CancelSource,
216
+ principal: import_effect.Schema.optional(Principal),
217
+ reason: import_effect.Schema.optional(import_effect.Schema.String),
218
+ /** The cancelled ancestor this run was swept up with, on a cascade. */
219
+ cascadedFrom: import_effect.Schema.optional(RunId)
220
+ });
221
+ const PendingWait = import_effect.Schema.Struct({
222
+ /** The execution parked on this wait, which may be the root run itself. */
223
+ runId: RunId,
224
+ /** The flow that execution is running. */
225
+ flowId: import_effect.Schema.optional(FlowId),
226
+ /** The supervisor vocabulary: `approval` for people or `event` for a named signal. */
227
+ reason: import_effect.Schema.String,
228
+ /** The durable wait address a decision is routed to. */
229
+ token: import_effect.Schema.String,
230
+ /** Digest used to join replayed display facts to this current operational address. */
231
+ tokenDigest: import_effect.Schema.optional(import_effect.Schema.String),
232
+ /** The wait point's own name, when the token addresses a named one. */
233
+ name: import_effect.Schema.optional(import_effect.Schema.String),
234
+ /** Which attempt of a re-asked question this is, counting from 1. */
235
+ attempt: import_effect.Schema.optional(import_effect.Schema.Number),
236
+ /** What the wait declared about itself, absent when it declared nothing. */
237
+ request: import_effect.Schema.optional(import_effect.Schema.Json),
238
+ /** When the execution holding this wait was created. */
239
+ createdAt: import_effect.Schema.Number
240
+ });
241
+ const RunSummary = import_effect.Schema.Struct({
242
+ /** Whether lifecycle fields were observed in the engine or no engine row was visible. */
243
+ executionObservation: import_effect.Schema.optional(import_effect.Schema.Literals(["observed", "missing"])),
244
+ /** Exact native semantic observation; never a control-stream fact. */
245
+ executionView: import_effect.Schema.optional(import_journal.ExecutionFact.View),
246
+ runId: RunId,
247
+ flowId: FlowId,
248
+ status: RunStatus,
249
+ planId: import_effect.Schema.optional(import_effect.Schema.String),
250
+ planDigest: import_effect.Schema.optional(import_effect.Schema.String),
251
+ /** The flow's executable identity when the run started; resume refuses a different one. */
252
+ executionDigest: import_effect.Schema.optional(import_effect.Schema.String),
253
+ /** The engine version that started the run. */
254
+ engineVersion: import_effect.Schema.optional(import_effect.Schema.String),
255
+ /**
256
+ * How the code that would resume this run differs from the code it
257
+ * recorded. Computed by an exact run lookup, never stored; absent when
258
+ * nothing changed or the run is terminal.
259
+ */
260
+ codeDrift: import_effect.Schema.optional(import_effect.Schema.Struct({
261
+ recorded: import_effect.Schema.optional(import_effect.Schema.String),
262
+ current: import_effect.Schema.optional(import_effect.Schema.String),
263
+ recordedEngine: import_effect.Schema.optional(import_effect.Schema.String),
264
+ currentEngine: import_effect.Schema.optional(import_effect.Schema.String)
265
+ })),
266
+ ownerId: import_effect.Schema.optional(import_effect.Schema.String),
267
+ /**
268
+ * The authenticated principal that launched this run through the control
269
+ * plane. A reader that does not see every run sees only the runs its own
270
+ * principal launched. Absent on a run the engine created (a child, a fork,
271
+ * a later trampoline round) and on a run launched before it was recorded;
272
+ * only a reader that sees every run sees those.
273
+ */
274
+ launchedBy: import_effect.Schema.optional(import_effect.Schema.Struct({ id: import_effect.Schema.String, kind: import_effect.Schema.String })),
275
+ /**
276
+ * The run this one branched from: the spawning run, the forked-from run, or
277
+ * the previous trampoline round. Absent on a run with no ancestor.
278
+ */
279
+ parentRunId: import_effect.Schema.optional(RunId),
280
+ /**
281
+ * The trampoline lineage this run is a round of, and which round it is.
282
+ * Both absent means a lineage of one, read as round 0 of itself.
283
+ */
284
+ lineageId: import_effect.Schema.optional(import_effect.Schema.String),
285
+ roundOrdinal: import_effect.Schema.optional(import_effect.Schema.Number),
286
+ origin: import_effect.Schema.optional(RunOrigin),
287
+ /**
288
+ * What a parked run is holding on: `approval`, `event`, `timer`, `quota`, or
289
+ * a reason a plugin declared. Absent on a run that is not parked, and on a
290
+ * park whose owner released the run without declaring one.
291
+ *
292
+ * The CLI's `ps` and `status` listings also render `executor` here for a run
293
+ * that has sat at `accepted` with no owner process past the launch handoff
294
+ * window. That value is computed at render time and never stored, so a
295
+ * reader going through the control RPC, the gateway projection, or a plugin
296
+ * sees the field absent on the same run.
297
+ */
298
+ waitingReason: import_effect.Schema.optional(import_effect.Schema.String),
299
+ /** What has been steered to this run and not yet delivered. */
300
+ steering: import_effect.Schema.optional(import_effect.Schema.Struct({ pending: import_effect.Schema.Number })),
301
+ /**
302
+ * A resume this run has been told to take and no host has taken up yet.
303
+ *
304
+ * A decision on an in-run approval restarts the run server-side, and the
305
+ * process that decides is usually not the process that hosts the execution:
306
+ * an operator's `smithers approve`, a gateway, a second CLI. The intent is
307
+ * therefore recorded durably here, and the host that owns the execution
308
+ * takes it up on its next tick and clears it. The number is the durable
309
+ * sequence of the request, so an operator can tell a delegation that is
310
+ * still outstanding from one that has been taken up. Absent means nothing
311
+ * is waiting to be taken up.
312
+ */
313
+ pendingResume: import_effect.Schema.optional(import_effect.Schema.Number),
314
+ /**
315
+ * The executor claim this run was parked under.
316
+ *
317
+ * A parked execution releases its owner columns — that is what makes it
318
+ * resumable at all — so after a park nothing on the row says which process
319
+ * is hosting it. Every process that shares the databases can therefore see
320
+ * the parked execution and resume it, including a short-lived `smithers
321
+ * approve` that would drive the run and then exit. The fence the park was
322
+ * written under is recorded here instead, so the host that parked the run
323
+ * recognizes its own park and every other composition can tell that the
324
+ * execution is not its to take up (triage B-15). Absent on a run that is not
325
+ * parked, and on a park written by something that held no fence.
326
+ */
327
+ parkedBy: import_effect.Schema.optional(import_effect.Schema.String),
328
+ /** Who cancelled this run, why, and on whose behalf. Absent until one did. */
329
+ cancellation: import_effect.Schema.optional(Cancellation),
330
+ /**
331
+ * Open human waits anywhere in this run's tree, nearest execution first.
332
+ *
333
+ * Present only when there is at least one, so a run nobody owes an answer
334
+ * carries no field rather than an empty array. `status` rolls up with it:
335
+ * a run any of whose descendants is parked on `approval` reports
336
+ * `waiting-approval`, which is what the existing inbox filters select on.
337
+ */
338
+ pendingWaits: import_effect.Schema.optional(import_effect.Schema.Array(PendingWait)),
339
+ /**
340
+ * When the run's approved deadline passes: its `createdAt` plus the
341
+ * envelope's `budget.deadline`, which is the instant the run is failed with
342
+ * `deadline_exceeded` if it has not settled. Absent on a run approved with
343
+ * no deadline.
344
+ */
345
+ deadlineAt: import_effect.Schema.optional(import_effect.Schema.Number),
346
+ createdAt: import_effect.Schema.Number,
347
+ updatedAt: import_effect.Schema.Number
348
+ });
349
+ const steerEnvelope = {
350
+ messageId: import_effect.Schema.String,
351
+ /**
352
+ * The run this message is for. `Control.steer` refuses a message whose
353
+ * `runId` disagrees with the one the call names: the notification would be
354
+ * admitted to the call's run while the stored message claimed another, and an
355
+ * operator reading it later would be told it belongs somewhere it was never
356
+ * delivered.
357
+ */
358
+ runId: RunId,
359
+ principal: Principal,
360
+ // Producer labels are data, distinct from principal. Public RPC strips
361
+ // these; a trusted product bridge may relay its already-authorized sender.
362
+ attribution: import_effect.Schema.optional(import_Notification.Attribution),
363
+ /**
364
+ * When the caller says it wrote the message. It is the caller's own
365
+ * statement, recorded on `control.steer.enqueued` and never used to decide
366
+ * anything. Over RPC the server's own clock is already on
367
+ * `principal.stampedAt`, which is the time a decision may be replayed
368
+ * against.
369
+ */
370
+ createdAt: import_effect.Schema.Number
371
+ };
372
+ const MessageSteer = import_effect.Schema.Struct({
373
+ ...steerEnvelope,
374
+ kind: import_effect.Schema.optional(import_effect.Schema.Literal("Message")),
375
+ body: import_effect.Schema.String
376
+ });
377
+ const SeatSteer = import_effect.Schema.Struct({ ...steerEnvelope, ...SteerPayload.SeatPayload.fields });
378
+ const ThinkingSteer = import_effect.Schema.Struct({ ...steerEnvelope, ...SteerPayload.ThinkingPayload.fields });
379
+ const ToolsSteer = import_effect.Schema.Struct({ ...steerEnvelope, ...SteerPayload.ToolsPayload.fields });
380
+ const SteerMessage = import_effect.Schema.Union([MessageSteer, SeatSteer, ThinkingSteer, ToolsSteer]);
381
+ const steerItem = (message) => {
382
+ switch (message.kind) {
383
+ case void 0:
384
+ case "Message":
385
+ return { kind: "Message", body: message.body };
386
+ case "Seat":
387
+ return { kind: "Seat", seat: message.seat };
388
+ case "Thinking":
389
+ return { kind: "Thinking", thinking: message.thinking };
390
+ case "Tools":
391
+ return { kind: "Tools", toolNames: message.toolNames };
392
+ }
393
+ };
394
+ const SignalPayload = import_effect.Schema.Struct({
395
+ name: import_effect.Schema.String,
396
+ payload: import_effect.Schema.Json
397
+ });
398
+ const PlanInputSchema = import_effect.Schema.Struct({
399
+ flowId: FlowId,
400
+ input: import_effect.Schema.Json,
401
+ idempotencyKey: import_effect.Schema.optional(IdempotencyKey),
402
+ budget: import_effect.Schema.optional(Envelope.fields.budget)
403
+ });
404
+ const RunInputSchema = import_effect.Schema.Union([
405
+ import_effect.Schema.TaggedStruct("Plan", {
406
+ planId: import_effect.Schema.String,
407
+ digest: import_effect.Schema.String,
408
+ envelope: Envelope,
409
+ idempotencyKey: IdempotencyKey
410
+ }),
411
+ import_effect.Schema.TaggedStruct("Resume", {
412
+ runId: RunId,
413
+ idempotencyKey: IdempotencyKey,
414
+ allowCodeDrift: import_effect.Schema.optional(import_effect.Schema.Boolean)
415
+ })
416
+ ]);
417
+ const ApprovalInputSchema = ApprovalPayload;
418
+ const SteerInputSchema = import_effect.Schema.Struct({
419
+ version: import_effect.Schema.optional(import_effect.Schema.Number),
420
+ runId: RunId,
421
+ message: SteerMessage,
422
+ idempotencyKey: IdempotencyKey
423
+ });
424
+ const SignalInputSchema = import_effect.Schema.Struct({
425
+ runId: RunId,
426
+ signal: SignalPayload,
427
+ idempotencyKey: IdempotencyKey
428
+ });
429
+ const RunMutationInputSchema = import_effect.Schema.Struct({ runId: RunId, idempotencyKey: IdempotencyKey });
430
+ const ReasonedMutationInputSchema = import_effect.Schema.Struct({
431
+ ...RunMutationInputSchema.fields,
432
+ reason: import_effect.Schema.optional(import_effect.Schema.String)
433
+ });
434
+ const CancelInputSchema = ReasonedMutationInputSchema;
435
+ const ResumeInputSchema = import_effect.Schema.Struct({
436
+ ...ReasonedMutationInputSchema.fields,
437
+ allowCodeDrift: import_effect.Schema.optional(import_effect.Schema.Boolean)
438
+ });
439
+ const WatchCursor = import_effect.Schema.Struct({
440
+ sequence: import_effect.Schema.Int.check(import_effect.Schema.isGreaterThanOrEqualTo(0), import_effect.Schema.isLessThan(Number.MAX_SAFE_INTEGER)),
441
+ offset: import_effect.Schema.optional(
442
+ import_effect.Schema.Int.check(import_effect.Schema.isGreaterThanOrEqualTo(0), import_effect.Schema.isLessThan(Number.MAX_SAFE_INTEGER))
443
+ )
444
+ });
445
+ const WatchFilter = import_effect.Schema.Struct({
446
+ runId: import_effect.Schema.optional(RunId),
447
+ /** Resume after a fully consumed source entry, including all its deltas. Requires `runId`. */
448
+ afterSequence: import_effect.Schema.optional(import_effect.Schema.Number),
449
+ /** Resume after one emitted event, even inside an expansion. Requires `runId`. Cannot be combined with `afterSequence`. */
450
+ afterCursor: import_effect.Schema.optional(WatchCursor),
451
+ follow: import_effect.Schema.optional(import_effect.Schema.Boolean)
452
+ });
453
+ const ControlEvent = import_effect.Schema.Struct({
454
+ /** Present on `ControlLive.watch` events; absent on raw projections and older providers. */
455
+ cursor: import_effect.Schema.optional(WatchCursor),
456
+ sequence: import_effect.Schema.Number,
457
+ kind: import_effect.Schema.String,
458
+ runId: import_effect.Schema.optional(RunId),
459
+ occurredAt: import_effect.Schema.Number,
460
+ payload: import_effect.Schema.Json
461
+ });
462
+ const defaultPageSize = 100;
463
+ const maxPageSize = 500;
464
+ const PageLimit = import_effect.Schema.Int.check(
465
+ import_effect.Schema.isGreaterThanOrEqualTo(1),
466
+ import_effect.Schema.isLessThanOrEqualTo(maxPageSize)
467
+ );
468
+ const FireOutcome = import_effect.Schema.Literals(["launched", "completed", "skipped", "buffered", "superseded", "failed"]);
469
+ const TriggerSummary = import_effect.Schema.Struct({
470
+ triggerId: import_effect.Schema.String,
471
+ flowId: FlowId,
472
+ input: import_effect.Schema.Json,
473
+ cron: import_effect.Schema.String,
474
+ timezone: import_effect.Schema.optional(import_effect.Schema.String),
475
+ overlap: import_effect.Schema.Literals(["skip", "buffer-one", "supersede"]),
476
+ catchUp: import_effect.Schema.Literals(["none", "one", "all"]),
477
+ maxCatchUp: import_effect.Schema.optional(import_effect.Schema.Number),
478
+ enabled: import_effect.Schema.Boolean,
479
+ revision: import_effect.Schema.Number,
480
+ lastFiredAtMs: import_effect.Schema.optional(import_effect.Schema.Number),
481
+ pendingAtMs: import_effect.Schema.optional(import_effect.Schema.Number),
482
+ activeRunId: import_effect.Schema.optional(RunId),
483
+ nextOccurrencesMs: import_effect.Schema.Array(import_effect.Schema.Number),
484
+ schedulerLastTickMs: import_effect.Schema.optional(import_effect.Schema.Number)
485
+ });
486
+ const FireSummary = import_effect.Schema.Struct({
487
+ triggerId: import_effect.Schema.String,
488
+ occurrenceAtMs: import_effect.Schema.Number,
489
+ outcome: import_effect.Schema.NullOr(FireOutcome),
490
+ runId: import_effect.Schema.optional(RunId),
491
+ error: import_effect.Schema.optional(import_effect.Schema.String),
492
+ waiting: import_effect.Schema.optional(import_effect.Schema.Literal("approval"))
493
+ });
494
+ const PlanDecision = import_effect.Schema.Literals(["pending", "approved", "denied"]);
495
+ const PlanSummary = import_effect.Schema.Struct({
496
+ card: PlanCard,
497
+ input: import_effect.Schema.Json,
498
+ decision: PlanDecision
499
+ });
500
+ const ExecutionBatch = import_effect.Schema.Struct({
501
+ source: import_effect.Schema.NullOr(import_effect.Schema.String),
502
+ revision: import_effect.Schema.NullOr(import_effect.Schema.Int.check(import_effect.Schema.isGreaterThanOrEqualTo(0))),
503
+ snapshots: import_effect.Schema.Array(import_effect.Schema.Union([
504
+ import_effect.Schema.TaggedStruct("Observed", {
505
+ executionId: RunId,
506
+ source: import_effect.Schema.String,
507
+ revision: import_effect.Schema.Int.check(import_effect.Schema.isGreaterThanOrEqualTo(0)),
508
+ observation: import_journal.ExecutionFact.Observation
509
+ }),
510
+ import_effect.Schema.TaggedStruct("Missing", {
511
+ executionId: RunId,
512
+ source: import_effect.Schema.String,
513
+ revision: import_effect.Schema.Int.check(import_effect.Schema.isGreaterThanOrEqualTo(0)),
514
+ deleted: import_effect.Schema.Boolean
515
+ }),
516
+ import_effect.Schema.TaggedStruct("Unavailable", {
517
+ executionId: RunId,
518
+ reason: import_effect.Schema.Literals(["unsupported", "outside-run", "ancestry-unavailable"])
519
+ })
520
+ ]))
521
+ });
522
+ const ListRequest = import_effect.Schema.Union([
523
+ import_effect.Schema.TaggedStruct("executions", {
524
+ runId: RunId,
525
+ executionIds: import_effect.Schema.Array(import_effect.Schema.NonEmptyString).check(import_effect.Schema.isMaxLength(200))
526
+ }),
527
+ import_effect.Schema.TaggedStruct("flows", {
528
+ filters: import_effect.Schema.optional(import_effect.Schema.Json),
529
+ cursor: import_effect.Schema.optional(import_effect.Schema.String),
530
+ limit: import_effect.Schema.optional(PageLimit)
531
+ }),
532
+ import_effect.Schema.TaggedStruct("runs", {
533
+ filters: import_effect.Schema.optional(import_effect.Schema.Struct({
534
+ runId: import_effect.Schema.optional(RunId),
535
+ flowId: import_effect.Schema.optional(FlowId),
536
+ status: import_effect.Schema.optional(RunStatus),
537
+ terminal: import_effect.Schema.optional(import_effect.Schema.Boolean),
538
+ principalId: import_effect.Schema.optional(import_effect.Schema.String),
539
+ parentRunId: import_effect.Schema.optional(RunId),
540
+ lineageId: import_effect.Schema.optional(import_effect.Schema.String),
541
+ /** Runs created at or after this epoch millisecond. */
542
+ since: import_effect.Schema.optional(import_effect.Schema.Number),
543
+ /** Runs created before this epoch millisecond. */
544
+ until: import_effect.Schema.optional(import_effect.Schema.Number),
545
+ /** Runs a fire of this trigger started. */
546
+ triggerId: import_effect.Schema.optional(import_effect.Schema.String)
547
+ })),
548
+ /** Creation time, newest or oldest first; omitted preserves the historical listing order. */
549
+ order: import_effect.Schema.optional(import_effect.Schema.Literals(["newest", "oldest"])),
550
+ cursor: import_effect.Schema.optional(import_effect.Schema.String),
551
+ limit: import_effect.Schema.optional(PageLimit)
552
+ }),
553
+ import_effect.Schema.TaggedStruct("triggers", {
554
+ filters: import_effect.Schema.optional(import_effect.Schema.Struct({
555
+ triggerId: import_effect.Schema.optional(import_effect.Schema.String),
556
+ flowId: import_effect.Schema.optional(FlowId),
557
+ enabled: import_effect.Schema.optional(import_effect.Schema.Boolean)
558
+ })),
559
+ cursor: import_effect.Schema.optional(import_effect.Schema.String),
560
+ limit: import_effect.Schema.optional(PageLimit)
561
+ }),
562
+ import_effect.Schema.TaggedStruct("fires", {
563
+ filters: import_effect.Schema.optional(import_effect.Schema.Struct({
564
+ triggerId: import_effect.Schema.optional(import_effect.Schema.String),
565
+ runId: import_effect.Schema.optional(RunId),
566
+ outcome: import_effect.Schema.optional(FireOutcome)
567
+ })),
568
+ cursor: import_effect.Schema.optional(import_effect.Schema.String),
569
+ limit: import_effect.Schema.optional(PageLimit)
570
+ }),
571
+ import_effect.Schema.TaggedStruct("plans", {
572
+ filters: import_effect.Schema.optional(import_effect.Schema.Struct({
573
+ flowId: import_effect.Schema.optional(FlowId),
574
+ decision: import_effect.Schema.optional(PlanDecision)
575
+ })),
576
+ cursor: import_effect.Schema.optional(import_effect.Schema.String),
577
+ limit: import_effect.Schema.optional(PageLimit)
578
+ })
579
+ ]);
580
+ const ListResponse = import_effect.Schema.Union([
581
+ import_effect.Schema.TaggedStruct("executions", {
582
+ source: ExecutionBatch.fields.source,
583
+ revision: ExecutionBatch.fields.revision,
584
+ items: ExecutionBatch.fields.snapshots,
585
+ nextCursor: import_effect.Schema.optional(import_effect.Schema.Never)
586
+ }),
587
+ import_effect.Schema.TaggedStruct("flows", {
588
+ items: import_effect.Schema.Array(
589
+ import_effect.Schema.Struct({ flowId: FlowId, description: import_effect.Schema.String, inputSchema: import_effect.Schema.optional(import_effect.Schema.Json) })
590
+ ),
591
+ warnings: import_effect.Schema.optional(import_effect.Schema.Array(import_Descriptor.DiscoveryWarning)),
592
+ nextCursor: import_effect.Schema.optional(import_effect.Schema.String)
593
+ }),
594
+ import_effect.Schema.TaggedStruct("runs", {
595
+ items: import_effect.Schema.Array(RunSummary),
596
+ nextCursor: import_effect.Schema.optional(import_effect.Schema.String)
597
+ }),
598
+ import_effect.Schema.TaggedStruct("triggers", {
599
+ items: import_effect.Schema.Array(TriggerSummary),
600
+ nextCursor: import_effect.Schema.optional(import_effect.Schema.String)
601
+ }),
602
+ import_effect.Schema.TaggedStruct("fires", {
603
+ items: import_effect.Schema.Array(FireSummary),
604
+ nextCursor: import_effect.Schema.optional(import_effect.Schema.String)
605
+ }),
606
+ import_effect.Schema.TaggedStruct("plans", {
607
+ items: import_effect.Schema.Array(PlanSummary),
608
+ nextCursor: import_effect.Schema.optional(import_effect.Schema.String)
609
+ })
610
+ ]);
611
+ const RunHost = import_effect.Schema.Struct({ hostId: import_effect.Schema.String, pid: import_effect.Schema.Number });
612
+ const Receipt = import_effect.Schema.Union([
613
+ import_effect.Schema.TaggedStruct("Accepted", {
614
+ inputConsumed: import_effect.Schema.optional(import_effect.Schema.Boolean),
615
+ inputBody: import_effect.Schema.optional(import_effect.Schema.String),
616
+ receiptId: import_effect.Schema.String,
617
+ runId: import_effect.Schema.optional(RunId),
618
+ handedTo: import_effect.Schema.optional(RunHost)
619
+ }),
620
+ import_effect.Schema.TaggedStruct("AlreadyApplied", {
621
+ receiptId: import_effect.Schema.String,
622
+ runId: import_effect.Schema.optional(RunId),
623
+ inputConsumed: import_effect.Schema.optional(import_effect.Schema.Boolean),
624
+ inputBody: import_effect.Schema.optional(import_effect.Schema.String)
625
+ }),
626
+ import_effect.Schema.TaggedStruct("Parked", {
627
+ receiptId: import_effect.Schema.String,
628
+ planId: import_effect.Schema.String,
629
+ status: import_effect.Schema.Literal("waiting-approval")
630
+ }),
631
+ import_effect.Schema.TaggedStruct("Conflict", { message: import_effect.Schema.String }),
632
+ import_effect.Schema.TaggedStruct("Terminal", { runId: RunId, status: RunStatus })
633
+ ]);
634
+ //# sourceMappingURL=ControlSchema.js.map