@sixb/core 0.1.18 → 0.1.19

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 (404) hide show
  1. package/README.md +7 -6
  2. package/dist/actions/commit-edits.d.ts +7 -19
  3. package/dist/actions/commit-edits.d.ts.map +1 -1
  4. package/dist/actions/errors.d.ts +0 -3
  5. package/dist/actions/errors.d.ts.map +1 -1
  6. package/dist/actions/execution.d.ts +10 -3
  7. package/dist/actions/execution.d.ts.map +1 -1
  8. package/dist/actions/index.d.ts +6 -9
  9. package/dist/actions/index.d.ts.map +1 -1
  10. package/dist/actions/index.js +51 -50
  11. package/dist/actions/index.js.map +1 -1
  12. package/dist/actions/request.d.ts +14 -25
  13. package/dist/actions/request.d.ts.map +1 -1
  14. package/dist/actions/run/context.d.ts +40 -0
  15. package/dist/actions/run/context.d.ts.map +1 -0
  16. package/dist/actions/run/edits-commit.d.ts +31 -0
  17. package/dist/actions/run/edits-commit.d.ts.map +1 -0
  18. package/dist/actions/run/effects.d.ts +23 -0
  19. package/dist/actions/run/effects.d.ts.map +1 -0
  20. package/dist/actions/run/execute.d.ts +30 -0
  21. package/dist/actions/run/execute.d.ts.map +1 -0
  22. package/dist/actions/run/executor.d.ts +95 -0
  23. package/dist/actions/run/executor.d.ts.map +1 -0
  24. package/dist/actions/run/normalize.d.ts +36 -0
  25. package/dist/actions/run/normalize.d.ts.map +1 -0
  26. package/dist/actions/run/phase-types.d.ts +18 -0
  27. package/dist/actions/run/phase-types.d.ts.map +1 -0
  28. package/dist/actions/run/phases.d.ts +20 -0
  29. package/dist/actions/run/phases.d.ts.map +1 -0
  30. package/dist/actions/run/run-action.d.ts +25 -0
  31. package/dist/actions/run/run-action.d.ts.map +1 -0
  32. package/dist/actions/run/signals.d.ts +67 -0
  33. package/dist/actions/run/signals.d.ts.map +1 -0
  34. package/dist/actions/run/state.d.ts +47 -0
  35. package/dist/actions/run/state.d.ts.map +1 -0
  36. package/dist/actions/run/types.d.ts +54 -0
  37. package/dist/actions/run/types.d.ts.map +1 -0
  38. package/dist/actions/run/writeback.d.ts +17 -0
  39. package/dist/actions/run/writeback.d.ts.map +1 -0
  40. package/dist/actions/run-authorization.d.ts +1 -1
  41. package/dist/actions/run-authorization.d.ts.map +1 -1
  42. package/dist/actions/run-persistence.d.ts +53 -0
  43. package/dist/actions/run-persistence.d.ts.map +1 -0
  44. package/dist/actions/types/context.d.ts +10 -0
  45. package/dist/actions/types/context.d.ts.map +1 -1
  46. package/dist/agents/index.js +52 -55
  47. package/dist/agents/index.js.map +1 -1
  48. package/dist/agents/streams/index.js +2 -2
  49. package/dist/agents/streams/internal.js +2 -2
  50. package/dist/auth/index.js +11 -11
  51. package/dist/auth/index.js.map +1 -1
  52. package/dist/authorization/event-visibility.d.ts.map +1 -1
  53. package/dist/authorization/index.js +3 -3
  54. package/dist/bootstrap/index.js +46 -49
  55. package/dist/bootstrap/index.js.map +2 -2
  56. package/dist/{chunk-d0eb5yy6.js → chunk-1f7wpmyp.js} +5 -5
  57. package/dist/{chunk-d0eb5yy6.js.map → chunk-1f7wpmyp.js.map} +1 -1
  58. package/dist/{chunk-vgk3hknm.js → chunk-1k89ecfr.js} +1 -1
  59. package/dist/{chunk-6h5m9xjx.js → chunk-3gnrh4ve.js} +6 -10
  60. package/dist/{chunk-6h5m9xjx.js.map → chunk-3gnrh4ve.js.map} +4 -4
  61. package/dist/{chunk-htr6wjmv.js → chunk-4tcx876c.js} +15 -15
  62. package/dist/{chunk-htr6wjmv.js.map → chunk-4tcx876c.js.map} +1 -1
  63. package/dist/{chunk-za5yd58j.js → chunk-52bk93x8.js} +2 -2
  64. package/dist/{chunk-22v5bpz3.js → chunk-5e43w60z.js} +1 -1
  65. package/dist/{chunk-zxawp1n2.js → chunk-7kg3k1m9.js} +1 -1
  66. package/dist/{chunk-ny3xyvcn.js → chunk-7mbzgd9m.js} +3 -3
  67. package/dist/{chunk-b9affek3.js → chunk-7n440zgt.js} +30 -30
  68. package/dist/{chunk-b9affek3.js.map → chunk-7n440zgt.js.map} +4 -4
  69. package/dist/{chunk-kkqwzy6h.js → chunk-7t429e3f.js} +1 -1
  70. package/dist/{chunk-s4jhg8a3.js → chunk-80mc0971.js} +13 -13
  71. package/dist/{chunk-s4jhg8a3.js.map → chunk-80mc0971.js.map} +1 -1
  72. package/dist/{chunk-1b1f2d5f.js → chunk-85yvv5n0.js} +8 -8
  73. package/dist/{chunk-1b1f2d5f.js.map → chunk-85yvv5n0.js.map} +1 -1
  74. package/dist/{chunk-6fsr7y93.js → chunk-8mx7qw3y.js} +14 -13
  75. package/dist/{chunk-6fsr7y93.js.map → chunk-8mx7qw3y.js.map} +4 -4
  76. package/dist/{chunk-kpx7jrmn.js → chunk-91mg3nj9.js} +59 -59
  77. package/dist/{chunk-kpx7jrmn.js.map → chunk-91mg3nj9.js.map} +5 -5
  78. package/dist/{chunk-48e3cn2d.js → chunk-9gyp8hg1.js} +2 -2
  79. package/dist/{chunk-ewqa58h9.js → chunk-9k93ah50.js} +4 -4
  80. package/dist/{chunk-ewqa58h9.js.map → chunk-9k93ah50.js.map} +1 -1
  81. package/dist/{chunk-4wn7bxxa.js → chunk-9ybhtmg4.js} +1 -1
  82. package/dist/{chunk-fc5zfxy1.js → chunk-a40ad1ft.js} +5 -13
  83. package/dist/chunk-a40ad1ft.js.map +10 -0
  84. package/dist/{chunk-vz3gc1tm.js → chunk-aff7cyea.js} +62 -64
  85. package/dist/{chunk-vz3gc1tm.js.map → chunk-aff7cyea.js.map} +4 -4
  86. package/dist/{chunk-y2aq6ag9.js → chunk-b38szspf.js} +5 -14
  87. package/dist/chunk-b38szspf.js.map +11 -0
  88. package/dist/{chunk-r2y23egw.js → chunk-bkpke1sg.js} +1 -10
  89. package/dist/chunk-bkpke1sg.js.map +10 -0
  90. package/dist/{chunk-bs7sqkre.js → chunk-bpgy64fw.js} +1 -1
  91. package/dist/{chunk-vx2yp45y.js → chunk-c85m1hyj.js} +2 -2
  92. package/dist/{chunk-v6xpd60t.js → chunk-d2ync1v3.js} +5 -5
  93. package/dist/{chunk-fe52eczz.js → chunk-ey3pyej1.js} +6345 -2125
  94. package/dist/chunk-ey3pyej1.js.map +106 -0
  95. package/dist/{chunk-vjcd8d27.js → chunk-fa02jy15.js} +1 -1
  96. package/dist/{chunk-y05543x6.js → chunk-hvsb78a1.js} +4 -4
  97. package/dist/{chunk-y05543x6.js.map → chunk-hvsb78a1.js.map} +1 -1
  98. package/dist/{chunk-qq90g05n.js → chunk-j2bp5ryw.js} +53 -244
  99. package/dist/{chunk-qq90g05n.js.map → chunk-j2bp5ryw.js.map} +3 -3
  100. package/dist/{chunk-qmnnhde6.js → chunk-kg5j6fct.js} +1 -1
  101. package/dist/{chunk-de4z2bj6.js → chunk-kyzq4wy9.js} +6 -6
  102. package/dist/{chunk-wr8qp979.js → chunk-m427qgq0.js} +9 -5
  103. package/dist/{chunk-wr8qp979.js.map → chunk-m427qgq0.js.map} +4 -3
  104. package/dist/{chunk-e1c18xjx.js → chunk-nq6gpjt7.js} +4 -45
  105. package/dist/{chunk-e1c18xjx.js.map → chunk-nq6gpjt7.js.map} +5 -5
  106. package/dist/{chunk-ex496vct.js → chunk-nre82s12.js} +1 -1
  107. package/dist/{chunk-1hqwggsn.js → chunk-nzapm6p0.js} +1 -2
  108. package/dist/chunk-nzapm6p0.js.map +12 -0
  109. package/dist/{chunk-wt4szfec.js → chunk-pbcbn83d.js} +4 -4
  110. package/dist/{chunk-wt4szfec.js.map → chunk-pbcbn83d.js.map} +1 -1
  111. package/dist/{chunk-7hpdd6r9.js → chunk-q1vkr2ys.js} +4 -4
  112. package/dist/{chunk-zb77kjth.js → chunk-rhg02hxq.js} +3 -3
  113. package/dist/{chunk-y9jmd7e5.js → chunk-s16apyk9.js} +102 -16
  114. package/dist/chunk-s16apyk9.js.map +16 -0
  115. package/dist/{chunk-yv9czyfr.js → chunk-t6vq7bff.js} +5 -5
  116. package/dist/{chunk-qkvz64nd.js → chunk-tjb1mk5t.js} +2 -2
  117. package/dist/{chunk-p844e0rn.js → chunk-tpn40322.js} +2 -2
  118. package/dist/{chunk-rt9p8m9t.js → chunk-v9xd5wzd.js} +1 -1
  119. package/dist/{chunk-2vhg6ysa.js → chunk-vyf9kfqf.js} +1 -1
  120. package/dist/{chunk-k6hrnf35.js → chunk-wwdfe68s.js} +51 -4
  121. package/dist/chunk-wwdfe68s.js.map +11 -0
  122. package/dist/{chunk-f1zxad2t.js → chunk-wz0xs816.js} +6 -6
  123. package/dist/{chunk-f1zxad2t.js.map → chunk-wz0xs816.js.map} +1 -1
  124. package/dist/chunk-y0c4e6ex.js +16 -0
  125. package/dist/chunk-y0c4e6ex.js.map +10 -0
  126. package/dist/{chunk-qkbx3tf6.js → chunk-y7rqfrgg.js} +6 -13
  127. package/dist/{chunk-qkbx3tf6.js.map → chunk-y7rqfrgg.js.map} +4 -4
  128. package/dist/{chunk-dfm066qg.js → chunk-yxd3nnqt.js} +2 -29
  129. package/dist/chunk-yxd3nnqt.js.map +11 -0
  130. package/dist/{chunk-70jmg2zx.js → chunk-yzwja0mj.js} +4 -19
  131. package/dist/{chunk-70jmg2zx.js.map → chunk-yzwja0mj.js.map} +3 -3
  132. package/dist/{chunk-p0dqwj3n.js → chunk-zrmy8zvw.js} +66 -47
  133. package/dist/{chunk-p0dqwj3n.js.map → chunk-zrmy8zvw.js.map} +4 -4
  134. package/dist/deploy/index.d.ts +1 -1
  135. package/dist/deploy/index.d.ts.map +1 -1
  136. package/dist/deploy/internal.js +10 -8
  137. package/dist/deploy/internal.js.map +4 -4
  138. package/dist/deploy/services.d.ts +1 -2
  139. package/dist/deploy/services.d.ts.map +1 -1
  140. package/dist/deploy/types.d.ts +6 -5
  141. package/dist/deploy/types.d.ts.map +1 -1
  142. package/dist/deploy/validation.d.ts.map +1 -1
  143. package/dist/edits/index.js +3 -5
  144. package/dist/edits/index.js.map +1 -1
  145. package/dist/error-reporting/internal.js +3 -3
  146. package/dist/error-reporting/types.d.ts +2 -9
  147. package/dist/error-reporting/types.d.ts.map +1 -1
  148. package/dist/errors/catalog.d.ts +12 -0
  149. package/dist/errors/catalog.d.ts.map +1 -1
  150. package/dist/errors/internal.js +1 -1
  151. package/dist/events/definitions.d.ts +0 -5
  152. package/dist/events/definitions.d.ts.map +1 -1
  153. package/dist/events/index.d.ts +3 -3
  154. package/dist/events/index.d.ts.map +1 -1
  155. package/dist/events/index.js +6 -8
  156. package/dist/events/index.js.map +1 -1
  157. package/dist/events/scope.d.ts +0 -1
  158. package/dist/events/scope.d.ts.map +1 -1
  159. package/dist/events/scope.js +1 -1
  160. package/dist/events/selectors/builder.d.ts +1 -8
  161. package/dist/events/selectors/builder.d.ts.map +1 -1
  162. package/dist/events/selectors/index.d.ts +2 -2
  163. package/dist/events/selectors/index.d.ts.map +1 -1
  164. package/dist/events/selectors/index.js +2 -2
  165. package/dist/events/selectors/predicate.d.ts.map +1 -1
  166. package/dist/events/selectors/types.d.ts +2 -33
  167. package/dist/events/selectors/types.d.ts.map +1 -1
  168. package/dist/events/types/index.d.ts +1 -12
  169. package/dist/events/types/index.d.ts.map +1 -1
  170. package/dist/execution/agent.js +41 -44
  171. package/dist/execution/agent.js.map +1 -1
  172. package/dist/execution/primitive.js +57 -88
  173. package/dist/execution/primitive.js.map +3 -4
  174. package/dist/execution/request.js +35 -38
  175. package/dist/execution/request.js.map +2 -2
  176. package/dist/index.d.ts +3 -3
  177. package/dist/index.d.ts.map +1 -1
  178. package/dist/index.js +111 -120
  179. package/dist/index.js.map +1 -1
  180. package/dist/materialization/index.js +3 -3
  181. package/dist/materialization/index.js.map +1 -1
  182. package/dist/materialization/model.d.ts +19 -6
  183. package/dist/materialization/model.d.ts.map +1 -1
  184. package/dist/materializer/index.js +31 -31
  185. package/dist/materializer/index.js.map +1 -1
  186. package/dist/materializer/shared/normalize.d.ts.map +1 -1
  187. package/dist/models/execution/index.js +18 -18
  188. package/dist/objects/action/errors.d.ts +0 -9
  189. package/dist/objects/action/errors.d.ts.map +1 -1
  190. package/dist/objects/action/index.d.ts +3 -3
  191. package/dist/objects/action/index.d.ts.map +1 -1
  192. package/dist/objects/action/request.d.ts +2 -8
  193. package/dist/objects/action/request.d.ts.map +1 -1
  194. package/dist/objects/execution.d.ts +0 -2
  195. package/dist/objects/execution.d.ts.map +1 -1
  196. package/dist/objects/index.js +44 -29
  197. package/dist/objects/index.js.map +1 -1
  198. package/dist/objects/query/index.js +29 -29
  199. package/dist/objects/query/index.js.map +1 -1
  200. package/dist/objects/sdk/object-handle.d.ts.map +1 -1
  201. package/dist/objects/sdk/object-set.d.ts.map +1 -1
  202. package/dist/objects/service/index.d.ts +0 -1
  203. package/dist/objects/service/index.d.ts.map +1 -1
  204. package/dist/ontology/index.js +5 -5
  205. package/dist/ontology/index.js.map +1 -1
  206. package/dist/ontology/internal.js +2 -2
  207. package/dist/pipelines/index.js +28 -28
  208. package/dist/projections/internal.js +22 -22
  209. package/dist/projections/internal.js.map +1 -1
  210. package/dist/query.js +2 -2
  211. package/dist/queues/in-memory.d.ts +1 -2
  212. package/dist/queues/in-memory.d.ts.map +1 -1
  213. package/dist/queues/index.d.ts +1 -1
  214. package/dist/queues/index.d.ts.map +1 -1
  215. package/dist/queues/index.js +1 -1
  216. package/dist/queues/types.d.ts +0 -7
  217. package/dist/queues/types.d.ts.map +1 -1
  218. package/dist/runtime/host.d.ts.map +1 -1
  219. package/dist/runtime/internal.js +24 -25
  220. package/dist/runtime/internal.js.map +1 -1
  221. package/dist/runtime/resolve-definitions.d.ts.map +1 -1
  222. package/dist/runtime/types.d.ts +16 -36
  223. package/dist/runtime/types.d.ts.map +1 -1
  224. package/dist/sandboxes/index.js +5 -5
  225. package/dist/schedules/builders.d.ts.map +1 -1
  226. package/dist/schedules/index.js +3 -3
  227. package/dist/schedules/runtime.d.ts.map +1 -1
  228. package/dist/schedules/validation.d.ts +0 -1
  229. package/dist/schedules/validation.d.ts.map +1 -1
  230. package/dist/security/every.d.ts +1 -1
  231. package/dist/shares/internal.js +17 -17
  232. package/dist/storage/action-runs/failure.js +2 -2
  233. package/dist/storage/action-runs/idempotency.d.ts +3 -4
  234. package/dist/storage/action-runs/idempotency.d.ts.map +1 -1
  235. package/dist/storage/action-runs/in-memory.d.ts +2 -9
  236. package/dist/storage/action-runs/in-memory.d.ts.map +1 -1
  237. package/dist/storage/action-runs/index.d.ts +1 -3
  238. package/dist/storage/action-runs/index.d.ts.map +1 -1
  239. package/dist/storage/action-runs/provider.js +1 -1
  240. package/dist/storage/action-runs/record.d.ts +20 -0
  241. package/dist/storage/action-runs/record.d.ts.map +1 -0
  242. package/dist/storage/action-runs/types.d.ts +39 -68
  243. package/dist/storage/action-runs/types.d.ts.map +1 -1
  244. package/dist/storage/ai-limits/enforcement.js +2 -2
  245. package/dist/storage/connector-connections/provider.js +1 -1
  246. package/dist/storage/file-upload-sessions/provider.js +9 -9
  247. package/dist/storage/index.d.ts +2 -2
  248. package/dist/storage/index.d.ts.map +1 -1
  249. package/dist/storage/index.js +30 -31
  250. package/dist/storage/index.js.map +1 -1
  251. package/dist/storage/internal.d.ts +1 -1
  252. package/dist/storage/internal.d.ts.map +1 -1
  253. package/dist/storage/internal.js +9 -12
  254. package/dist/storage/internal.js.map +1 -1
  255. package/dist/storage/objects/execution-limits.d.ts +1 -1
  256. package/dist/storage/objects/execution-limits.d.ts.map +1 -1
  257. package/dist/storage/ontology/provider.js +2 -2
  258. package/dist/storage/projection-runs/provider.js +2 -2
  259. package/dist/storage/types.d.ts +1 -1
  260. package/dist/storage/types.d.ts.map +1 -1
  261. package/dist/storage/workflow-runs/provider.js +9 -9
  262. package/dist/syncs/index.js +29 -29
  263. package/dist/testing/action-execution.d.ts +34 -4
  264. package/dist/testing/action-execution.d.ts.map +1 -1
  265. package/dist/testing/action-run-storage-contract.d.ts +11 -0
  266. package/dist/testing/action-run-storage-contract.d.ts.map +1 -0
  267. package/dist/testing/index.d.ts +2 -1
  268. package/dist/testing/index.d.ts.map +1 -1
  269. package/dist/testing/index.js +3202 -2860
  270. package/dist/testing/index.js.map +7 -6
  271. package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
  272. package/dist/testing/queues-contract.d.ts.map +1 -1
  273. package/dist/webhooks/internal.js +23 -23
  274. package/dist/webhooks/internal.js.map +1 -1
  275. package/dist/workers/index.js +1 -1
  276. package/dist/workflows/index.js +48 -51
  277. package/dist/workflows/index.js.map +1 -1
  278. package/package.json +1 -7
  279. package/src/actions/commit-edits.ts +9 -37
  280. package/src/actions/errors.ts +0 -4
  281. package/src/actions/execution.ts +10 -10
  282. package/src/actions/index.ts +5 -24
  283. package/src/actions/request.ts +157 -295
  284. package/src/actions/run/context.ts +193 -0
  285. package/src/actions/run/edits-commit.ts +102 -0
  286. package/src/actions/run/effects.ts +105 -0
  287. package/src/actions/run/execute.ts +113 -0
  288. package/src/actions/run/executor.ts +314 -0
  289. package/src/actions/run/normalize.ts +142 -0
  290. package/src/actions/run/phase-types.ts +20 -0
  291. package/src/actions/run/phases.ts +150 -0
  292. package/src/actions/run/run-action.ts +170 -0
  293. package/src/actions/run/signals.ts +118 -0
  294. package/src/actions/run/state.ts +95 -0
  295. package/src/actions/run/types.ts +61 -0
  296. package/src/actions/run/writeback.ts +79 -0
  297. package/src/actions/run-authorization.ts +1 -1
  298. package/src/actions/run-persistence.ts +105 -0
  299. package/src/actions/types/context.ts +10 -0
  300. package/src/authorization/event-visibility.ts +0 -12
  301. package/src/deploy/index.ts +0 -1
  302. package/src/deploy/services.ts +2 -11
  303. package/src/deploy/types.ts +6 -6
  304. package/src/deploy/validation.ts +12 -6
  305. package/src/error-reporting/types.ts +2 -10
  306. package/src/errors/catalog.ts +13 -0
  307. package/src/events/definitions.ts +0 -17
  308. package/src/events/index.ts +0 -14
  309. package/src/events/scope.ts +0 -12
  310. package/src/events/selectors/builder.ts +0 -51
  311. package/src/events/selectors/index.ts +0 -6
  312. package/src/events/selectors/predicate.ts +0 -2
  313. package/src/events/selectors/types.ts +7 -65
  314. package/src/events/types/index.ts +0 -11
  315. package/src/index.ts +1 -19
  316. package/src/materialization/model.ts +26 -9
  317. package/src/materializer/README.md +6 -1
  318. package/src/materializer/edits/commit.ts +42 -32
  319. package/src/materializer/shared/normalize.ts +25 -14
  320. package/src/objects/action/errors.ts +0 -12
  321. package/src/objects/action/index.ts +3 -3
  322. package/src/objects/action/request.ts +2 -29
  323. package/src/objects/execution.ts +2 -2
  324. package/src/objects/sdk/object-handle.ts +3 -29
  325. package/src/objects/sdk/object-set.ts +5 -30
  326. package/src/objects/service/index.ts +0 -1
  327. package/src/queues/in-memory.ts +0 -6
  328. package/src/queues/index.ts +0 -2
  329. package/src/queues/types.ts +0 -11
  330. package/src/runtime/host.ts +5 -0
  331. package/src/runtime/resolve-definitions.ts +0 -1
  332. package/src/runtime/types.ts +16 -45
  333. package/src/schedules/builders.ts +1 -4
  334. package/src/schedules/runtime.ts +0 -41
  335. package/src/schedules/validation.ts +2 -16
  336. package/src/security/every.ts +1 -1
  337. package/src/storage/action-runs/idempotency.ts +13 -41
  338. package/src/storage/action-runs/in-memory.ts +20 -311
  339. package/src/storage/action-runs/index.ts +1 -16
  340. package/src/storage/action-runs/record.ts +130 -0
  341. package/src/storage/action-runs/types.ts +37 -92
  342. package/src/storage/index.ts +1 -9
  343. package/src/storage/internal.ts +1 -7
  344. package/src/storage/objects/execution-limits.ts +3 -2
  345. package/src/storage/types.ts +2 -4
  346. package/src/testing/action-execution.ts +73 -13
  347. package/src/testing/action-run-storage-contract.ts +335 -0
  348. package/src/testing/index.ts +8 -1
  349. package/src/testing/materializer-storage-contract.ts +174 -18
  350. package/src/testing/queues-contract.ts +0 -18
  351. package/dist/actions/run-dispatch.d.ts +0 -25
  352. package/dist/actions/run-dispatch.d.ts.map +0 -1
  353. package/dist/actions/worker.d.ts +0 -3
  354. package/dist/actions/worker.d.ts.map +0 -1
  355. package/dist/actions/worker.js +0 -325
  356. package/dist/actions/worker.js.map +0 -11
  357. package/dist/chunk-1hqwggsn.js.map +0 -12
  358. package/dist/chunk-85cd7e8c.js +0 -51
  359. package/dist/chunk-85cd7e8c.js.map +0 -10
  360. package/dist/chunk-dfm066qg.js.map +0 -11
  361. package/dist/chunk-fc5zfxy1.js.map +0 -11
  362. package/dist/chunk-fe52eczz.js.map +0 -49
  363. package/dist/chunk-fx93hd2n.js +0 -1614
  364. package/dist/chunk-fx93hd2n.js.map +0 -20
  365. package/dist/chunk-k6hrnf35.js.map +0 -10
  366. package/dist/chunk-qxvp5epv.js +0 -1329
  367. package/dist/chunk-qxvp5epv.js.map +0 -36
  368. package/dist/chunk-r2y23egw.js.map +0 -10
  369. package/dist/chunk-tffvfy6s.js +0 -593
  370. package/dist/chunk-tffvfy6s.js.map +0 -15
  371. package/dist/chunk-y2aq6ag9.js.map +0 -11
  372. package/dist/chunk-y9jmd7e5.js.map +0 -15
  373. package/dist/chunk-zvx7h87b.js +0 -12
  374. package/dist/chunk-zvx7h87b.js.map +0 -10
  375. package/dist/events/types/actions.d.ts +0 -39
  376. package/dist/events/types/actions.d.ts.map +0 -1
  377. package/dist/objects/service/action-service.d.ts +0 -13
  378. package/dist/objects/service/action-service.d.ts.map +0 -1
  379. package/src/actions/run-dispatch.ts +0 -282
  380. package/src/actions/worker.ts +0 -2
  381. package/src/events/types/actions.ts +0 -42
  382. package/src/objects/service/action-service.ts +0 -43
  383. /package/dist/{chunk-vgk3hknm.js.map → chunk-1k89ecfr.js.map} +0 -0
  384. /package/dist/{chunk-za5yd58j.js.map → chunk-52bk93x8.js.map} +0 -0
  385. /package/dist/{chunk-22v5bpz3.js.map → chunk-5e43w60z.js.map} +0 -0
  386. /package/dist/{chunk-zxawp1n2.js.map → chunk-7kg3k1m9.js.map} +0 -0
  387. /package/dist/{chunk-ny3xyvcn.js.map → chunk-7mbzgd9m.js.map} +0 -0
  388. /package/dist/{chunk-kkqwzy6h.js.map → chunk-7t429e3f.js.map} +0 -0
  389. /package/dist/{chunk-48e3cn2d.js.map → chunk-9gyp8hg1.js.map} +0 -0
  390. /package/dist/{chunk-4wn7bxxa.js.map → chunk-9ybhtmg4.js.map} +0 -0
  391. /package/dist/{chunk-bs7sqkre.js.map → chunk-bpgy64fw.js.map} +0 -0
  392. /package/dist/{chunk-vx2yp45y.js.map → chunk-c85m1hyj.js.map} +0 -0
  393. /package/dist/{chunk-v6xpd60t.js.map → chunk-d2ync1v3.js.map} +0 -0
  394. /package/dist/{chunk-vjcd8d27.js.map → chunk-fa02jy15.js.map} +0 -0
  395. /package/dist/{chunk-qmnnhde6.js.map → chunk-kg5j6fct.js.map} +0 -0
  396. /package/dist/{chunk-de4z2bj6.js.map → chunk-kyzq4wy9.js.map} +0 -0
  397. /package/dist/{chunk-ex496vct.js.map → chunk-nre82s12.js.map} +0 -0
  398. /package/dist/{chunk-7hpdd6r9.js.map → chunk-q1vkr2ys.js.map} +0 -0
  399. /package/dist/{chunk-zb77kjth.js.map → chunk-rhg02hxq.js.map} +0 -0
  400. /package/dist/{chunk-yv9czyfr.js.map → chunk-t6vq7bff.js.map} +0 -0
  401. /package/dist/{chunk-qkvz64nd.js.map → chunk-tjb1mk5t.js.map} +0 -0
  402. /package/dist/{chunk-p844e0rn.js.map → chunk-tpn40322.js.map} +0 -0
  403. /package/dist/{chunk-rt9p8m9t.js.map → chunk-v9xd5wzd.js.map} +0 -0
  404. /package/dist/{chunk-2vhg6ysa.js.map → chunk-vyf9kfqf.js.map} +0 -0
@@ -0,0 +1,95 @@
1
+ import type { ActionRunRecord } from "../../storage";
2
+ import { type ActionRunRequestPayload, type AssertCanReuseActionRun, type PersistedActionRun } from "../run-persistence";
3
+ import { type ActionRunHost } from "./execute";
4
+ /** A request for an Action run, handed over to execute in the requesting process. */
5
+ export interface ActionRunRequest {
6
+ readonly runId: string;
7
+ readonly payload: ActionRunRequestPayload;
8
+ /** Find the record of an earlier request with the same run id, or create the run's execution. */
9
+ readonly persist: () => Promise<PersistedActionRun>;
10
+ /** Refuse a run that already exists under the run id, when this request's caller may not have it. */
11
+ readonly assertCanReuse: AssertCanReuseActionRun;
12
+ /** Cancels the run before its irreversible boundary. */
13
+ readonly signal?: AbortSignal;
14
+ /** Called once the run's execution exists, before the run executes. A throw starts nothing. */
15
+ readonly onRequested?: (runId: string) => void | Promise<void>;
16
+ }
17
+ /**
18
+ * Runs requested Actions in the calling process, and tracks each request until its run is recorded
19
+ * and its effects ended, so that a stopping process can wait for them.
20
+ *
21
+ * `SixbHost` registers one on itself and on the context its bound SDKs share, so a request can
22
+ * execute its run without holding the host.
23
+ */
24
+ export declare class ActionRunExecutor {
25
+ private readonly host;
26
+ private readonly inFlight;
27
+ /** Run ids held by a request of this process, until it ends. */
28
+ private readonly held;
29
+ private stopping;
30
+ constructor(host: ActionRunHost);
31
+ /**
32
+ * Execute a requested run to its terminal record, or answer with the record of an earlier request
33
+ * for the same run id.
34
+ *
35
+ * The request is tracked from before anything is persisted, so that {@link drain} waits for it
36
+ * from the start. Once the process is stopping, a new request is refused before anything is
37
+ * persisted. A request for a run id that this process is executing is refused as in progress:
38
+ * see {@link joinHeldRunId}. A request for the same run id in another process executes too, and
39
+ * the request that records it second answers with the first one's record, under the same checks
40
+ * as any record it finds.
41
+ *
42
+ * Once the run's execution exists, the request either resolves with the run's record or rejects
43
+ * with `internal.unexpected`: see {@link failRequest}.
44
+ */
45
+ request(request: ActionRunRequest): Promise<ActionRunRecord>;
46
+ /**
47
+ * Refuse new requests, then wait for at most `timeoutMs` for those in flight and for the effects
48
+ * they start meanwhile.
49
+ */
50
+ drain(timeoutMs: number): Promise<void>;
51
+ /** Track work until it settles. Whoever started it handles how it ends; this only waits. */
52
+ private track;
53
+ private dispatch;
54
+ /**
55
+ * Answer a request for a run id that a request of this process executes.
56
+ *
57
+ * Nothing is stored about a run before it ends, so this process is the only one that knows the
58
+ * run is in progress. The request gets what a stored run would give it: refused when its caller
59
+ * may not have the run or asks for something else, the record once it is written, and
60
+ * `action.run_in_progress` until then.
61
+ */
62
+ private joinHeldRunId;
63
+ private holdAndExecute;
64
+ private execute;
65
+ /**
66
+ * Start a recorded run's effects once the request has returned, tracked until they end. Deferring
67
+ * them keeps a handler that does synchronous work before its first `await` from delaying the
68
+ * response.
69
+ */
70
+ private startEffects;
71
+ /**
72
+ * Fail a request whose run's execution exists.
73
+ *
74
+ * The run may have executed, so the caller gets an `internal.unexpected` error that names the run
75
+ * and says what requesting it again does, never what went wrong inside it: that goes to
76
+ * `onError`, once, with the failure the run recorded or would have recorded. Errors outside the
77
+ * run's phases fail it in `validation`, the phase it starts in.
78
+ */
79
+ private failRequest;
80
+ }
81
+ /**
82
+ * Attach the executor to a host or runtime context. The property is enumerable so that spreading a
83
+ * context into a narrower one carries it along.
84
+ */
85
+ export declare function registerActionRunExecutor(owner: object, executor: ActionRunExecutor): void;
86
+ export declare function getActionRunExecutor(owner: object): ActionRunExecutor;
87
+ /** Copy the executor, when there is one, onto an internal runtime context being reconstructed. */
88
+ export declare function shareActionRunExecutor(source: object, target: object): void;
89
+ /**
90
+ * Refuse new Action requests on this host, then wait for at most `timeoutMs` for those in flight.
91
+ *
92
+ * Every `SixbHost` has an executor from construction on, so an object without one is not a host.
93
+ */
94
+ export declare function drainActionRuns(host: object, timeoutMs: number): Promise<void>;
95
+ //# sourceMappingURL=executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/actions/run/executor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAE5B,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,WAAW,CAAA;AAKhE,qFAAqF;AACrF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,uBAAuB,CAAA;IACzC,iGAAiG;IACjG,QAAQ,CAAC,OAAO,EAAE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IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMpF"}
@@ -0,0 +1,36 @@
1
+ import { type SixbCodedError } from "../../errors/internal";
2
+ import { type ActionRunFailure, type ActionRunPhase } from "../../storage";
3
+ export declare function throwIfAborted(signal: AbortSignal): void;
4
+ /**
5
+ * Wait for a handler until the signal of its phase aborts, then reject with the abort's reason.
6
+ *
7
+ * A handler stops early only when it forwards its `signal` to what it awaits. One that does not
8
+ * keeps running after the abort, but the run no longer waits for it: nothing it does from then on
9
+ * reaches the run, and what it throws is dropped.
10
+ */
11
+ export declare function untilAborted<T>(work: () => Promise<T>, signal: AbortSignal): Promise<T>;
12
+ /**
13
+ * Translate work performed by an Action phase without misclassifying its bookkeeping.
14
+ *
15
+ * Whatever a handler throws once its phase's signal aborted is that abort's doing: the run failed
16
+ * with `action.timeout` when its deadline elapsed, and with `runtime.cancelled` when its caller
17
+ * aborted. The handler's own error stays the cause reported to `onError`. Every expectation an
18
+ * Action commit carries comes from the Action's own reads, so an expectation conflict at commit is
19
+ * a read conflict: the run can be requested again against current state.
20
+ */
21
+ export declare function translateActionPhaseError(error: unknown, phase: ActionRunPhase, input: {
22
+ readonly actionId: string;
23
+ readonly runId: string;
24
+ /** The signal the work ran under. Omit it for work that nothing interrupts, like a commit. */
25
+ readonly signal?: AbortSignal;
26
+ }): unknown;
27
+ /** Whether a phase classified this error as the phase's own failure, rather than as an abort. */
28
+ export declare function isActionPhaseFailure(error: unknown): error is SixbCodedError;
29
+ /** Recover the native phase error for direct callers and error-monitoring integrations. */
30
+ export declare function unwrapActionPhaseError(error: unknown): unknown;
31
+ export declare function toActionRunFailure<TPhase extends ActionRunPhase>(error: unknown, phase: TPhase, input: {
32
+ readonly actionId: string;
33
+ readonly runId: string;
34
+ readonly at: Date;
35
+ }): ActionRunFailure<TPhase>;
36
+ //# sourceMappingURL=normalize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../src/actions/run/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EAGpB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAA4B,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAA;AAIpG,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAExD;AAQD;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAY7F;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE;IACL,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,8FAA8F;IAC9F,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAC9B,GACA,OAAO,CAgCT;AAED,iGAAiG;AACjG,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAK5E;AAED,2FAA2F;AAC3F,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE9D;AAED,wBAAgB,kBAAkB,CAAC,MAAM,SAAS,cAAc,EAC9D,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE;IACL,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAA;CAClB,GACA,gBAAgB,CAAC,MAAM,CAAC,CAyB1B"}
@@ -0,0 +1,18 @@
1
+ import type { ObjectTypeWithPropertyTokens } from "../../ontology/tokens";
2
+ import type { ObjectRow } from "../../storage";
3
+ import type { ActionDefinition, ActionTargetObject } from "../types";
4
+ import type { ActionRunContext } from "./types";
5
+ export type LoadedObjectTarget = {
6
+ readonly subjectObjectType: ObjectTypeWithPropertyTokens;
7
+ readonly snapshot: ActionTargetObject;
8
+ /** The exact row the subject was loaded from, recorded as a commit-time read dependency. */
9
+ readonly row: ObjectRow;
10
+ };
11
+ export type PhaseExecutionBase = {
12
+ readonly runtime: ActionRunContext;
13
+ readonly action: ActionDefinition;
14
+ /** The signal this phase's handler runs under; see `ActionRunSignals`. */
15
+ readonly signal: AbortSignal;
16
+ };
17
+ export type RuntimePhaseHandler = (ctx: unknown) => unknown;
18
+ //# sourceMappingURL=phase-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phase-types.d.ts","sourceRoot":"","sources":["../../../src/actions/run/phase-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,iBAAiB,EAAE,4BAA4B,CAAA;IACxD,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAA;IACrC,4FAA4F;IAC5F,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAA;IAClC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAA;IACjC,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAA"}
@@ -0,0 +1,20 @@
1
+ import type { ActionDefinition } from "../types";
2
+ import { type CommittedActionRun } from "./edits-commit";
3
+ import type { ActionRunSignals } from "./signals";
4
+ import type { ActionRunState } from "./state";
5
+ import type { ActionRunContext } from "./types";
6
+ interface PhasesInput {
7
+ readonly runtime: ActionRunContext;
8
+ readonly action: ActionDefinition;
9
+ readonly state: ActionRunState;
10
+ readonly signals: ActionRunSignals;
11
+ }
12
+ /**
13
+ * Run the phases up to the commit, keeping what they do on the run's state.
14
+ *
15
+ * Resolves with the commit, which recorded the run, for an Action with edits; and with `null` for
16
+ * one without, whose run is still to record. Rejects when a phase fails.
17
+ */
18
+ export declare function executeActionPhases(input: PhasesInput): Promise<CommittedActionRun | null>;
19
+ export {};
20
+ //# sourceMappingURL=phases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phases.d.ts","sourceRoot":"","sources":["../../../src/actions/run/phases.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAIhD,OAAO,EAAE,KAAK,kBAAkB,EAA0B,MAAM,gBAAgB,CAAA;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAQ/C,UAAU,WAAW;IACnB,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAA;IAClC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAA;IACjC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAA;IAC9B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAA;CACnC;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAWhG"}
@@ -0,0 +1,25 @@
1
+ import type { RecordActionRunInput } from "../../storage";
2
+ import type { ActionRunOutcome, RunActionInput } from "./types";
3
+ /**
4
+ * A run that ended, but whose terminal record could not be written.
5
+ *
6
+ * It carries that record, so that whoever reports this error still reports how the run ended. Its
7
+ * cause is the error that kept the record from being written.
8
+ */
9
+ export declare class UnrecordedActionRunError extends Error {
10
+ readonly record: RecordActionRunInput;
11
+ readonly name = "UnrecordedActionRunError";
12
+ constructor(record: RecordActionRunInput, options: {
13
+ readonly cause: unknown;
14
+ });
15
+ }
16
+ /**
17
+ * Execute a requested run to its end, and record it once.
18
+ *
19
+ * A run with edits is recorded by the commit of its edits; any other run, succeeded or failed, is
20
+ * recorded as soon as it ends. The run's effects are left to the caller to start: see
21
+ * {@link ActionRunOutcome.effects}. This rejects when the run cannot execute here, or with an
22
+ * {@link UnrecordedActionRunError} when its record cannot be written.
23
+ */
24
+ export declare function runAction(input: RunActionInput): Promise<ActionRunOutcome>;
25
+ //# sourceMappingURL=run-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-action.d.ts","sourceRoot":"","sources":["../../../src/actions/run/run-action.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAoB,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAQ3E,OAAO,KAAK,EAAoB,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEjF;;;;;GAKG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;IAI/C,QAAQ,CAAC,MAAM,EAAE,oBAAoB;IAHvC,SAAkB,IAAI,8BAA6B;gBAGxC,MAAM,EAAE,oBAAoB,EACrC,OAAO,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;KAAE;CAIvC;AAED;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAgDhF"}
@@ -0,0 +1,67 @@
1
+ /** How long an Action run has to reach its irreversible boundary, and its effects after commit. */
2
+ export declare const ACTION_TIMEOUT_MS = 30000;
3
+ /**
4
+ * How long a stopping process waits for its in-flight Action runs and their effects: a run's
5
+ * deadline, then its effects' deadline, plus a margin.
6
+ *
7
+ * It does not bound a whole run. Edits past the boundary are uninterruptible, and effects start
8
+ * only once they committed, so a run or its effects can still be executing when the wait ends. A
9
+ * deployment's kill timeout must exceed this bound.
10
+ */
11
+ export declare const ACTION_RUN_DRAIN_TIMEOUT_MS: number;
12
+ export interface ActionRunSignalsInput {
13
+ readonly actionId: string;
14
+ readonly runId: string;
15
+ /** The caller's cancellation. It applies before the boundary only. */
16
+ readonly caller?: AbortSignal;
17
+ /** Test-only override of {@link ACTION_TIMEOUT_MS}. */
18
+ readonly timeoutMs?: number;
19
+ }
20
+ /**
21
+ * The cancellation one Action run observes, phase by phase.
22
+ *
23
+ * The irreversible boundary is a succeeded writeback, or the commit of an Action without one. Before
24
+ * it, validation, writeback and edits run under {@link beforeBoundary}, which aborts when the run's
25
+ * deadline elapses or its caller aborts. After it, edits and commit run under
26
+ * {@link uninterruptible}: abandoning them would strand an external change that the ontology never
27
+ * records. Effects run after the commit under a deadline of their own, which
28
+ * {@link startEffects} starts.
29
+ *
30
+ * Cancellation is cooperative: a handler stops early only when it forwards its `signal` to what it
31
+ * awaits. The run stops waiting for one that does not, wherever abandoning it loses nothing:
32
+ * validation, edits before the boundary, and effects (`untilAborted`). A writeback is always waited
33
+ * for, since only its result says whether the external change happened.
34
+ */
35
+ export declare class ActionRunSignals {
36
+ readonly beforeBoundary: AbortSignal;
37
+ /**
38
+ * Never aborts, for the work that must run to completion once it starts. One per run: whatever
39
+ * listens to it is released with the run, not kept for the life of the process.
40
+ */
41
+ readonly uninterruptible: AbortSignal;
42
+ private readonly input;
43
+ private readonly deadline;
44
+ constructor(input: ActionRunSignalsInput);
45
+ /**
46
+ * Why the run stopped before its boundary: its deadline's `action.timeout` when the deadline
47
+ * elapsed first, or else a `runtime.cancelled` error caused by what its caller aborted with.
48
+ */
49
+ stopReason(): unknown;
50
+ /**
51
+ * Start the deadline the run's effects run under. It is independent of the run's own: effects
52
+ * start after the run is recorded, and the caller of the deadline disposes it once they end.
53
+ */
54
+ startEffects(): ActionDeadline;
55
+ /** Release the run's deadline timer. */
56
+ dispose(): void;
57
+ }
58
+ /** A signal that aborts with `action.timeout` once its scope's deadline elapses. */
59
+ export declare class ActionDeadline {
60
+ readonly signal: AbortSignal;
61
+ private readonly timer;
62
+ constructor(input: Pick<ActionRunSignalsInput, "actionId" | "runId" | "timeoutMs">, scope: "run" | "effects");
63
+ /** Release the deadline timer. */
64
+ dispose(): void;
65
+ }
66
+ export declare function isActionTimeout(error: unknown): boolean;
67
+ //# sourceMappingURL=signals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../../src/actions/run/signals.ts"],"names":[],"mappings":"AAEA,mGAAmG;AACnG,eAAO,MAAM,iBAAiB,QAAS,CAAA;AAEvC;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,QAAgC,CAAA;AAExE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,sEAAsE;IACtE,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B,uDAAuD;IACvD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,gBAAgB;IAC3B,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAA;IACpC;;;OAGG;IACH,QAAQ,CAAC,eAAe,EAAE,WAAW,CAA+B;IAEpE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuB;IAC7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;gBAE7B,KAAK,EAAE,qBAAqB;IAQxC;;;OAGG;IACH,UAAU,IAAI,OAAO;IAUrB;;;OAGG;IACH,YAAY,IAAI,cAAc;IAI9B,wCAAwC;IACxC,OAAO,IAAI,IAAI;CAGhB;AAED,oFAAoF;AACpF,qBAAa,cAAc;IACzB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA+B;gBAGnD,KAAK,EAAE,IAAI,CAAC,qBAAqB,EAAE,UAAU,GAAG,OAAO,GAAG,WAAW,CAAC,EACtE,KAAK,EAAE,KAAK,GAAG,SAAS;IAgB1B,kCAAkC;IAClC,OAAO,IAAI,IAAI;CAGhB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEvD"}
@@ -0,0 +1,47 @@
1
+ import type { JsonValue } from "../../json";
2
+ import type { ActionRunFailure, ActionRunPhase, ActionRunWritebackRecord, RecordActionRunInput } from "../../storage";
3
+ import type { PendingActionRun } from "./types";
4
+ export type SucceededActionRunRecord = Extract<RecordActionRunInput, {
5
+ readonly status: "succeeded";
6
+ }>;
7
+ export type FailedActionRunRecord = Extract<RecordActionRunInput, {
8
+ readonly status: "failed";
9
+ }>;
10
+ /**
11
+ * What a run has done so far: the phase it reached and how its writeback ended.
12
+ *
13
+ * It lives in memory while the run executes, and nothing about the run is stored before it ends:
14
+ * its terminal record is built from this state once, when it succeeds or fails.
15
+ */
16
+ export declare class ActionRunState {
17
+ readonly run: PendingActionRun;
18
+ /** When the run started executing, as its handlers and its record see it. */
19
+ readonly startedAt: Date;
20
+ private reached;
21
+ private writebackRecord;
22
+ constructor(run: PendingActionRun,
23
+ /** When the run started executing, as its handlers and its record see it. */
24
+ startedAt: Date);
25
+ /** The last phase the run reached. */
26
+ get phase(): ActionRunPhase;
27
+ get writeback(): ActionRunWritebackRecord | undefined;
28
+ /** The value a succeeded writeback returned, which edits and effects receive. */
29
+ get writebackValue(): JsonValue | undefined;
30
+ /**
31
+ * Whether the run's deadline and caller no longer apply to it.
32
+ *
33
+ * True once its writeback succeeded, or once its commit started for an Action without one: from
34
+ * there the run either commits or fails on its own merits.
35
+ */
36
+ get pastBoundary(): boolean;
37
+ /** Enter a phase before the commit. The run is recorded before its effects run. */
38
+ enter(phase: Exclude<ActionRunPhase, "effects">): void;
39
+ /** Keep how the writeback ended. A run calls its writeback once, so this is set once. */
40
+ recordWriteback(writeback: ActionRunWritebackRecord): void;
41
+ /** The record of the run succeeding in the phase it reached. */
42
+ succeeded(finishedAt?: Date): SucceededActionRunRecord;
43
+ /** The record of the run failing with `error`, in the phase the failure names. */
44
+ failed(error: ActionRunFailure, finishedAt?: Date): FailedActionRunRecord;
45
+ private recordFields;
46
+ }
47
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/actions/run/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAC5C,oBAAoB,EACpB;IAAE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAAE,CACjC,CAAA;AACD,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAA;AAEhG;;;;;GAKG;AACH,qBAAa,cAAc;IAKvB,QAAQ,CAAC,GAAG,EAAE,gBAAgB;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,SAAS,EAAE,IAAI;IAN1B,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,eAAe,CAAsC;gBAGlD,GAAG,EAAE,gBAAgB;IAC9B,6EAA6E;IACpE,SAAS,EAAE,IAAI;IAG1B,sCAAsC;IACtC,IAAI,KAAK,IAAI,cAAc,CAE1B;IAED,IAAI,SAAS,IAAI,wBAAwB,GAAG,SAAS,CAEpD;IAED,iFAAiF;IACjF,IAAI,cAAc,IAAI,SAAS,GAAG,SAAS,CAE1C;IAED;;;;;OAKG;IACH,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,mFAAmF;IACnF,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,cAAc,EAAE,SAAS,CAAC,GAAG,IAAI;IAItD,yFAAyF;IACzF,eAAe,CAAC,SAAS,EAAE,wBAAwB,GAAG,IAAI;IAO1D,gEAAgE;IAChE,SAAS,CAAC,UAAU,GAAE,IAAiB,GAAG,wBAAwB;IAIlE,kFAAkF;IAClF,MAAM,CAAC,KAAK,EAAE,gBAAgB,EAAE,UAAU,GAAE,IAAiB,GAAG,qBAAqB;IAIrF,OAAO,CAAC,YAAY;CAgBrB"}
@@ -0,0 +1,54 @@
1
+ import type { BlobsRuntime } from "../../blob-storage/execution";
2
+ import type { ConnectorRuntime } from "../../connectors/execution";
3
+ import type { LoggingService } from "../../logging/service";
4
+ import type { ModelsRuntime } from "../../models/generation-types";
5
+ import type { ObjectsRuntime } from "../../objects/execution";
6
+ import type { SixbDefinitions } from "../../runtime/definitions";
7
+ import type { OntologyMutationRuntime } from "../../runtime/ontology-mutations";
8
+ import type { ActionRunRecord, ActionRunStorage, Storage } from "../../storage";
9
+ import type { ActionsRuntime } from "../execution";
10
+ import type { ActionRunSignals } from "./signals";
11
+ /** Execution-bound primitives exposed to Action phase handlers. */
12
+ export interface ActionExecutionFacade {
13
+ readonly models: ModelsRuntime;
14
+ readonly objects: ObjectsRuntime;
15
+ readonly actions: ActionsRuntime;
16
+ readonly connector: ConnectorRuntime;
17
+ readonly blobs: BlobsRuntime;
18
+ }
19
+ export interface ActionRunContext {
20
+ readonly id: string;
21
+ readonly errorReporterHost: object;
22
+ readonly logging?: LoggingService;
23
+ readonly storage: Storage;
24
+ readonly actionRunsStorage: ActionRunStorage;
25
+ readonly ontologyMutations: OntologyMutationRuntime;
26
+ readonly sixb: ActionExecutionFacade;
27
+ readonly actions: Pick<SixbDefinitions["actions"], "getById">;
28
+ }
29
+ /**
30
+ * A requested run that has not ended: the request it executes, under the durable execution created
31
+ * for it. Nothing else about it is stored until its terminal record is written.
32
+ */
33
+ export type PendingActionRun = Pick<ActionRunRecord, "id" | "projectId" | "executionId" | "actionId" | "subject" | "params" | "idempotencyKey">;
34
+ export interface RunActionInput {
35
+ readonly runtime: ActionRunContext;
36
+ readonly run: PendingActionRun;
37
+ readonly signals: ActionRunSignals;
38
+ }
39
+ /** How a request's run ended. */
40
+ export interface ActionRunOutcome {
41
+ readonly record: ActionRunRecord;
42
+ /**
43
+ * Whether this request wrote the record. When it did not, a concurrent request for the same run
44
+ * id recorded the run first, and the record is that request's, whatever it asked for.
45
+ */
46
+ readonly recorded: boolean;
47
+ /**
48
+ * Runs the run's effects and records their outcome. The request starts it once it returns the
49
+ * record, and does not wait for it. An effects failure does not reject it: it is recorded on the
50
+ * run.
51
+ */
52
+ readonly effects?: () => Promise<void>;
53
+ }
54
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/actions/run/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAA;AAC/E,OAAO,KAAK,EAA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C;AACjC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;IAChC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CACvC"}
@@ -0,0 +1,17 @@
1
+ import type { ActionReadRecorder } from "../read-facade";
2
+ import { type BasePhaseContext } from "./context";
3
+ import type { LoadedObjectTarget, PhaseExecutionBase } from "./phase-types";
4
+ import type { ActionRunState } from "./state";
5
+ /**
6
+ * Calls the Action's writeback, when it has one, and keeps how it ended on the run's state.
7
+ *
8
+ * A failed writeback fails the run with the writeback's own failure; a succeeded one is the run's
9
+ * irreversible boundary.
10
+ */
11
+ export declare function runWritebackPhase(input: PhaseExecutionBase & {
12
+ readonly state: ActionRunState;
13
+ readonly baseContext: BasePhaseContext;
14
+ readonly objectTarget: LoadedObjectTarget | null;
15
+ readonly reads: ActionReadRecorder;
16
+ }): Promise<void>;
17
+ //# sourceMappingURL=writeback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeback.d.ts","sourceRoot":"","sources":["../../../src/actions/run/writeback.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAExD,OAAO,EACL,KAAK,gBAAgB,EAItB,MAAM,WAAW,CAAA;AAElB,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAuB,MAAM,eAAe,CAAA;AAChG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,kBAAkB,GAAG;IAC1B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAA;IAC9B,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAA;IACtC,QAAQ,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,CAAA;IAChD,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAA;CACnC,GACA,OAAO,CAAC,IAAI,CAAC,CA0Cf"}
@@ -14,7 +14,7 @@ export declare function canDelegationAccessActionRun(input: {
14
14
  export declare function actionRunBelongsToShareGrant(input: {
15
15
  readonly storage: Storage;
16
16
  readonly projectId: string;
17
- readonly run: ActionRunRecord;
17
+ readonly run: Pick<ActionRunRecord, "id" | "actionId" | "executionId">;
18
18
  readonly grantId: string;
19
19
  }): Promise<boolean>;
20
20
  //# sourceMappingURL=run-authorization.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"run-authorization.d.ts","sourceRoot":"","sources":["../../src/actions/run-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAA;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAG7D,kGAAkG;AAClG,wBAAsB,4BAA4B,CAAC,KAAK,EAAE;IACxD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,4BAA4B,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC,CAAA;IACzF,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAA;CAC9B,GAAG,OAAO,CAAC,OAAO,CAAC,CAoBnB;AAED,gGAAgG;AAChG,wBAAsB,4BAA4B,CAAC,KAAK,EAAE;IACxD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAA;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,GAAG,OAAO,CAAC,OAAO,CAAC,CAanB"}
1
+ {"version":3,"file":"run-authorization.d.ts","sourceRoot":"","sources":["../../src/actions/run-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAA;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAG7D,kGAAkG;AAClG,wBAAsB,4BAA4B,CAAC,KAAK,EAAE;IACxD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,4BAA4B,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC,CAAA;IACzF,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAA;CAC9B,GAAG,OAAO,CAAC,OAAO,CAAC,CAoBnB;AAED,gGAAgG;AAChG,wBAAsB,4BAA4B,CAAC,KAAK,EAAE;IACxD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,GAAG,UAAU,GAAG,aAAa,CAAC,CAAA;IACtE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,GAAG,OAAO,CAAC,OAAO,CAAC,CAanB"}
@@ -0,0 +1,53 @@
1
+ import type { ActionRunParams, ActionRunRecord, CreateExecutionInput, Storage } from "../storage";
2
+ import type { ExecutionRecord } from "../storage/executions";
3
+ import type { PendingActionRun } from "./run/types";
4
+ import type { ActionSubject } from "./types";
5
+ /** What a request asks its run id to run. */
6
+ export interface ActionRunRequestPayload {
7
+ readonly actionId: string;
8
+ readonly subject: ActionSubject;
9
+ readonly params: ActionRunParams;
10
+ }
11
+ /** A run that already exists under a requested run id, recorded or still executing. */
12
+ export type ExistingActionRun = Pick<ActionRunRecord, "id" | "executionId" | "actionId" | "subject" | "params">;
13
+ /** Refuses an existing run the requesting caller may not have. */
14
+ export type AssertCanReuseActionRun = (run: ExistingActionRun) => void | Promise<void>;
15
+ /**
16
+ * Answer a request with the run that already exists under its run id only when its caller may have
17
+ * that run, and only for the same request.
18
+ *
19
+ * The caller's right to the run is checked first, so that a refused caller learns nothing about it,
20
+ * not even whether it carries the same request.
21
+ */
22
+ export declare function assertCanReuseActionRun(run: ExistingActionRun, request: {
23
+ readonly payload: ActionRunRequestPayload;
24
+ readonly assertCanReuse: AssertCanReuseActionRun;
25
+ }): Promise<void>;
26
+ interface PersistActionRunInput {
27
+ readonly projectId: string;
28
+ readonly storage: Storage;
29
+ readonly runId: string;
30
+ readonly payload: ActionRunRequestPayload;
31
+ readonly createExecution: (executionId: string, runId: string) => Promise<CreateExecutionInput>;
32
+ readonly assertCanReuse: AssertCanReuseActionRun;
33
+ /** Checks that hold only for a run this call creates; a replayed run keeps its accepted params. */
34
+ readonly assertNewRun?: () => Promise<void>;
35
+ }
36
+ /** A run this request is to execute, or the record of an earlier request with the same run id. */
37
+ export type PersistedActionRun = {
38
+ readonly kind: "new";
39
+ readonly run: PendingActionRun;
40
+ readonly execution: ExecutionRecord;
41
+ } | {
42
+ readonly kind: "recorded";
43
+ readonly run: ActionRunRecord;
44
+ };
45
+ /**
46
+ * Persist what a requested run needs before it executes: the durable execution it runs under.
47
+ *
48
+ * Nothing else is stored before the run ends. A run id that is already recorded must carry the same
49
+ * request, and its record answers this request without running anything.
50
+ */
51
+ export declare function persistActionRun(input: PersistActionRunInput): Promise<PersistedActionRun>;
52
+ export {};
53
+ //# sourceMappingURL=run-persistence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-persistence.d.ts","sourceRoot":"","sources":["../../src/actions/run-persistence.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,e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AAuB,CAAA;IAChD,mGAAmG;IACnG,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5C;AAED,kGAAkG;AAClG,MAAM,MAAM,kBAAkB,GAC1B;IACE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;IACpB,QAAQ,CAAC,GAAG,EAAE,gBAAgB,CAAA;IAC9B,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAA;CACpC,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAA;CAAE,CAAA;AAEhE;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA+BhG"}
@@ -51,6 +51,10 @@ export type ActionBinding<TObjectType extends ObjectType = ObjectType> = {
51
51
  export interface ActionRunPhaseInfo {
52
52
  readonly id: string;
53
53
  readonly startedAt: Date;
54
+ /**
55
+ * Identifies this run to external systems. Send it as the idempotency key of the external call a
56
+ * writeback makes, so that call applies once even when it is retried.
57
+ */
54
58
  readonly idempotencyKey: string;
55
59
  }
56
60
  /** A telemetry-mode ontology property accepted by Action history reads. */
@@ -136,6 +140,12 @@ export interface BaseActionPhaseContext<TParams extends Record<string, unknown>>
136
140
  readonly run: ActionRunPhaseInfo;
137
141
  readonly params: TParams;
138
142
  readonly subject: ActionSubject;
143
+ /**
144
+ * Aborts when the caller cancels the run or it runs out of time: a run has 30 seconds until its
145
+ * writeback succeeds or its edits commit, and its effects have 30 more after the commit. Forward
146
+ * it to every call the handler awaits. Edits that follow a succeeded writeback always complete, so
147
+ * their signal never aborts.
148
+ */
139
149
  readonly signal: AbortSignal;
140
150
  readonly logger: Logger;
141
151
  }
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/actions/types/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,Y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