@justscale/core 0.1.0

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 (784) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +261 -0
  3. package/bin/just.js +34 -0
  4. package/dist/app.d.ts +56 -0
  5. package/dist/app.d.ts.map +1 -0
  6. package/dist/app.js +182 -0
  7. package/dist/app.js.map +1 -0
  8. package/dist/builder/build-context.d.ts +8 -0
  9. package/dist/builder/build-context.d.ts.map +1 -0
  10. package/dist/builder/build-context.js +4 -0
  11. package/dist/builder/build-context.js.map +1 -0
  12. package/dist/builder/builder.d.ts +60 -0
  13. package/dist/builder/builder.d.ts.map +1 -0
  14. package/dist/builder/builder.js +72 -0
  15. package/dist/builder/builder.js.map +1 -0
  16. package/dist/builder/create-builder.d.ts +36 -0
  17. package/dist/builder/create-builder.d.ts.map +1 -0
  18. package/dist/builder/create-builder.js +66 -0
  19. package/dist/builder/create-builder.js.map +1 -0
  20. package/dist/builder/execute.d.ts +37 -0
  21. package/dist/builder/execute.d.ts.map +1 -0
  22. package/dist/builder/execute.js +62 -0
  23. package/dist/builder/execute.js.map +1 -0
  24. package/dist/builder/feature-builder.d.ts +147 -0
  25. package/dist/builder/feature-builder.d.ts.map +1 -0
  26. package/dist/builder/feature-builder.js +138 -0
  27. package/dist/builder/feature-builder.js.map +1 -0
  28. package/dist/builder/index.d.ts +35 -0
  29. package/dist/builder/index.d.ts.map +1 -0
  30. package/dist/builder/index.js +37 -0
  31. package/dist/builder/index.js.map +1 -0
  32. package/dist/builder/plugin.d.ts +90 -0
  33. package/dist/builder/plugin.d.ts.map +1 -0
  34. package/dist/builder/plugin.js +101 -0
  35. package/dist/builder/plugin.js.map +1 -0
  36. package/dist/builder/plugins/query.d.ts +31 -0
  37. package/dist/builder/plugins/query.d.ts.map +1 -0
  38. package/dist/builder/plugins/query.js +42 -0
  39. package/dist/builder/plugins/query.js.map +1 -0
  40. package/dist/builder/plugins/validation.d.ts +12 -0
  41. package/dist/builder/plugins/validation.d.ts.map +1 -0
  42. package/dist/builder/plugins/validation.js +12 -0
  43. package/dist/builder/plugins/validation.js.map +1 -0
  44. package/dist/builder/sort.d.ts +27 -0
  45. package/dist/builder/sort.d.ts.map +1 -0
  46. package/dist/builder/sort.js +210 -0
  47. package/dist/builder/sort.js.map +1 -0
  48. package/dist/builder/stop.d.ts +24 -0
  49. package/dist/builder/stop.d.ts.map +1 -0
  50. package/dist/builder/stop.js +27 -0
  51. package/dist/builder/stop.js.map +1 -0
  52. package/dist/builder/test/permits-type-spike.d.ts +8 -0
  53. package/dist/builder/test/permits-type-spike.d.ts.map +1 -0
  54. package/dist/builder/test/permits-type-spike.js +117 -0
  55. package/dist/builder/test/permits-type-spike.js.map +1 -0
  56. package/dist/builder/types.d.ts +678 -0
  57. package/dist/builder/types.d.ts.map +1 -0
  58. package/dist/builder/types.js +98 -0
  59. package/dist/builder/types.js.map +1 -0
  60. package/dist/builder/validation.d.ts +101 -0
  61. package/dist/builder/validation.d.ts.map +1 -0
  62. package/dist/builder/validation.js +335 -0
  63. package/dist/builder/validation.js.map +1 -0
  64. package/dist/cli/adapter.d.ts +23 -0
  65. package/dist/cli/adapter.d.ts.map +1 -0
  66. package/dist/cli/adapter.js +26 -0
  67. package/dist/cli/adapter.js.map +1 -0
  68. package/dist/cli/args.d.ts +150 -0
  69. package/dist/cli/args.d.ts.map +1 -0
  70. package/dist/cli/args.js +172 -0
  71. package/dist/cli/args.js.map +1 -0
  72. package/dist/cli/assemble.d.ts +20 -0
  73. package/dist/cli/assemble.d.ts.map +1 -0
  74. package/dist/cli/assemble.js +55 -0
  75. package/dist/cli/assemble.js.map +1 -0
  76. package/dist/cli/bin/main.d.ts +26 -0
  77. package/dist/cli/bin/main.d.ts.map +1 -0
  78. package/dist/cli/bin/main.js +475 -0
  79. package/dist/cli/bin/main.js.map +1 -0
  80. package/dist/cli/build/migrations-plugin.d.ts +21 -0
  81. package/dist/cli/build/migrations-plugin.d.ts.map +1 -0
  82. package/dist/cli/build/migrations-plugin.js +41 -0
  83. package/dist/cli/build/migrations-plugin.js.map +1 -0
  84. package/dist/cli/build/process-plugin.d.ts +29 -0
  85. package/dist/cli/build/process-plugin.d.ts.map +1 -0
  86. package/dist/cli/build/process-plugin.js +66 -0
  87. package/dist/cli/build/process-plugin.js.map +1 -0
  88. package/dist/cli/builder/create-cli-builder.d.ts +42 -0
  89. package/dist/cli/builder/create-cli-builder.d.ts.map +1 -0
  90. package/dist/cli/builder/create-cli-builder.js +104 -0
  91. package/dist/cli/builder/create-cli-builder.js.map +1 -0
  92. package/dist/cli/builder/index.d.ts +8 -0
  93. package/dist/cli/builder/index.d.ts.map +1 -0
  94. package/dist/cli/builder/index.js +7 -0
  95. package/dist/cli/builder/index.js.map +1 -0
  96. package/dist/cli/builder/types.d.ts +113 -0
  97. package/dist/cli/builder/types.d.ts.map +1 -0
  98. package/dist/cli/builder/types.js +7 -0
  99. package/dist/cli/builder/types.js.map +1 -0
  100. package/dist/cli/cluster.d.ts +8 -0
  101. package/dist/cli/cluster.d.ts.map +1 -0
  102. package/dist/cli/cluster.js +145 -0
  103. package/dist/cli/cluster.js.map +1 -0
  104. package/dist/cli/current-app.d.ts +36 -0
  105. package/dist/cli/current-app.d.ts.map +1 -0
  106. package/dist/cli/current-app.js +21 -0
  107. package/dist/cli/current-app.js.map +1 -0
  108. package/dist/cli/define-app.d.ts +35 -0
  109. package/dist/cli/define-app.d.ts.map +1 -0
  110. package/dist/cli/define-app.js +79 -0
  111. package/dist/cli/define-app.js.map +1 -0
  112. package/dist/cli/define-main.d.ts +33 -0
  113. package/dist/cli/define-main.d.ts.map +1 -0
  114. package/dist/cli/define-main.js +67 -0
  115. package/dist/cli/define-main.js.map +1 -0
  116. package/dist/cli/define-project.d.ts +93 -0
  117. package/dist/cli/define-project.d.ts.map +1 -0
  118. package/dist/cli/define-project.js +85 -0
  119. package/dist/cli/define-project.js.map +1 -0
  120. package/dist/cli/dev-server.d.ts +20 -0
  121. package/dist/cli/dev-server.d.ts.map +1 -0
  122. package/dist/cli/dev-server.js +131 -0
  123. package/dist/cli/dev-server.js.map +1 -0
  124. package/dist/cli/discovery.d.ts +29 -0
  125. package/dist/cli/discovery.d.ts.map +1 -0
  126. package/dist/cli/discovery.js +142 -0
  127. package/dist/cli/discovery.js.map +1 -0
  128. package/dist/cli/factory.d.ts +43 -0
  129. package/dist/cli/factory.d.ts.map +1 -0
  130. package/dist/cli/factory.js +52 -0
  131. package/dist/cli/factory.js.map +1 -0
  132. package/dist/cli/generators/ai.d.ts +3 -0
  133. package/dist/cli/generators/ai.d.ts.map +1 -0
  134. package/dist/cli/generators/ai.js +65 -0
  135. package/dist/cli/generators/ai.js.map +1 -0
  136. package/dist/cli/generators/ci.d.ts +5 -0
  137. package/dist/cli/generators/ci.d.ts.map +1 -0
  138. package/dist/cli/generators/ci.js +102 -0
  139. package/dist/cli/generators/ci.js.map +1 -0
  140. package/dist/cli/generators/detect.d.ts +15 -0
  141. package/dist/cli/generators/detect.d.ts.map +1 -0
  142. package/dist/cli/generators/detect.js +75 -0
  143. package/dist/cli/generators/detect.js.map +1 -0
  144. package/dist/cli/generators/ide.d.ts +3 -0
  145. package/dist/cli/generators/ide.d.ts.map +1 -0
  146. package/dist/cli/generators/ide.js +179 -0
  147. package/dist/cli/generators/ide.js.map +1 -0
  148. package/dist/cli/generators/index.d.ts +5 -0
  149. package/dist/cli/generators/index.d.ts.map +1 -0
  150. package/dist/cli/generators/index.js +5 -0
  151. package/dist/cli/generators/index.js.map +1 -0
  152. package/dist/cli/index.d.ts +81 -0
  153. package/dist/cli/index.d.ts.map +1 -0
  154. package/dist/cli/index.js +88 -0
  155. package/dist/cli/index.js.map +1 -0
  156. package/dist/cli/io.d.ts +131 -0
  157. package/dist/cli/io.d.ts.map +1 -0
  158. package/dist/cli/io.js +373 -0
  159. package/dist/cli/io.js.map +1 -0
  160. package/dist/cli/mcp/server.d.ts +23 -0
  161. package/dist/cli/mcp/server.d.ts.map +1 -0
  162. package/dist/cli/mcp/server.js +148 -0
  163. package/dist/cli/mcp/server.js.map +1 -0
  164. package/dist/cli/parser.d.ts +106 -0
  165. package/dist/cli/parser.d.ts.map +1 -0
  166. package/dist/cli/parser.js +520 -0
  167. package/dist/cli/parser.js.map +1 -0
  168. package/dist/cli/runner.d.ts +75 -0
  169. package/dist/cli/runner.d.ts.map +1 -0
  170. package/dist/cli/runner.js +422 -0
  171. package/dist/cli/runner.js.map +1 -0
  172. package/dist/cli/service.d.ts +61 -0
  173. package/dist/cli/service.d.ts.map +1 -0
  174. package/dist/cli/service.js +95 -0
  175. package/dist/cli/service.js.map +1 -0
  176. package/dist/cli/types.d.ts +47 -0
  177. package/dist/cli/types.d.ts.map +1 -0
  178. package/dist/cli/types.js +20 -0
  179. package/dist/cli/types.js.map +1 -0
  180. package/dist/cli/wizard.d.ts +11 -0
  181. package/dist/cli/wizard.d.ts.map +1 -0
  182. package/dist/cli/wizard.js +2 -0
  183. package/dist/cli/wizard.js.map +1 -0
  184. package/dist/cli/workspace-controller.d.ts +36 -0
  185. package/dist/cli/workspace-controller.d.ts.map +1 -0
  186. package/dist/cli/workspace-controller.js +896 -0
  187. package/dist/cli/workspace-controller.js.map +1 -0
  188. package/dist/cluster/client.d.ts +101 -0
  189. package/dist/cluster/client.d.ts.map +1 -0
  190. package/dist/cluster/client.js +256 -0
  191. package/dist/cluster/client.js.map +1 -0
  192. package/dist/cluster/cluster.d.ts +82 -0
  193. package/dist/cluster/cluster.d.ts.map +1 -0
  194. package/dist/cluster/cluster.js +27 -0
  195. package/dist/cluster/cluster.js.map +1 -0
  196. package/dist/cluster/coordinator/cluster-node.model.d.ts +14 -0
  197. package/dist/cluster/coordinator/cluster-node.model.d.ts.map +1 -0
  198. package/dist/cluster/coordinator/cluster-node.model.js +15 -0
  199. package/dist/cluster/coordinator/cluster-node.model.js.map +1 -0
  200. package/dist/cluster/coordinator/cluster-signals.d.ts +45 -0
  201. package/dist/cluster/coordinator/cluster-signals.d.ts.map +1 -0
  202. package/dist/cluster/coordinator/cluster-signals.js +24 -0
  203. package/dist/cluster/coordinator/cluster-signals.js.map +1 -0
  204. package/dist/cluster/coordinator/coordinator.process.d.ts +21 -0
  205. package/dist/cluster/coordinator/coordinator.process.d.ts.map +1 -0
  206. package/dist/cluster/coordinator/coordinator.process.js +221 -0
  207. package/dist/cluster/coordinator/coordinator.process.js.map +1 -0
  208. package/dist/cluster/coordinator/index.d.ts +13 -0
  209. package/dist/cluster/coordinator/index.d.ts.map +1 -0
  210. package/dist/cluster/coordinator/index.js +13 -0
  211. package/dist/cluster/coordinator/index.js.map +1 -0
  212. package/dist/cluster/coordinator/node-lifecycle.d.ts +31 -0
  213. package/dist/cluster/coordinator/node-lifecycle.d.ts.map +1 -0
  214. package/dist/cluster/coordinator/node-lifecycle.js +178 -0
  215. package/dist/cluster/coordinator/node-lifecycle.js.map +1 -0
  216. package/dist/cluster/index.d.ts +45 -0
  217. package/dist/cluster/index.d.ts.map +1 -0
  218. package/dist/cluster/index.js +57 -0
  219. package/dist/cluster/index.js.map +1 -0
  220. package/dist/cluster/protocol.d.ts +204 -0
  221. package/dist/cluster/protocol.d.ts.map +1 -0
  222. package/dist/cluster/protocol.js +274 -0
  223. package/dist/cluster/protocol.js.map +1 -0
  224. package/dist/cluster/scheduled-task/builder.d.ts +24 -0
  225. package/dist/cluster/scheduled-task/builder.d.ts.map +1 -0
  226. package/dist/cluster/scheduled-task/builder.js +63 -0
  227. package/dist/cluster/scheduled-task/builder.js.map +1 -0
  228. package/dist/cluster/scheduled-task/factory.d.ts +76 -0
  229. package/dist/cluster/scheduled-task/factory.d.ts.map +1 -0
  230. package/dist/cluster/scheduled-task/factory.js +64 -0
  231. package/dist/cluster/scheduled-task/factory.js.map +1 -0
  232. package/dist/cluster/scheduled-task/index.d.ts +43 -0
  233. package/dist/cluster/scheduled-task/index.d.ts.map +1 -0
  234. package/dist/cluster/scheduled-task/index.js +45 -0
  235. package/dist/cluster/scheduled-task/index.js.map +1 -0
  236. package/dist/cluster/scheduled-task/transport.d.ts +12 -0
  237. package/dist/cluster/scheduled-task/transport.d.ts.map +1 -0
  238. package/dist/cluster/scheduled-task/transport.js +146 -0
  239. package/dist/cluster/scheduled-task/transport.js.map +1 -0
  240. package/dist/cluster/scheduled-task/types.d.ts +89 -0
  241. package/dist/cluster/scheduled-task/types.d.ts.map +1 -0
  242. package/dist/cluster/scheduled-task/types.js +7 -0
  243. package/dist/cluster/scheduled-task/types.js.map +1 -0
  244. package/dist/cluster/server.d.ts +87 -0
  245. package/dist/cluster/server.d.ts.map +1 -0
  246. package/dist/cluster/server.js +290 -0
  247. package/dist/cluster/server.js.map +1 -0
  248. package/dist/cluster/transport.d.ts +86 -0
  249. package/dist/cluster/transport.d.ts.map +1 -0
  250. package/dist/cluster/transport.js +138 -0
  251. package/dist/cluster/transport.js.map +1 -0
  252. package/dist/core/container-hooks.d.ts +22 -0
  253. package/dist/core/container-hooks.d.ts.map +1 -0
  254. package/dist/core/container-hooks.js +29 -0
  255. package/dist/core/container-hooks.js.map +1 -0
  256. package/dist/core/container-reflection.d.ts +71 -0
  257. package/dist/core/container-reflection.d.ts.map +1 -0
  258. package/dist/core/container-reflection.js +60 -0
  259. package/dist/core/container-reflection.js.map +1 -0
  260. package/dist/core/context.d.ts +146 -0
  261. package/dist/core/context.d.ts.map +1 -0
  262. package/dist/core/context.js +155 -0
  263. package/dist/core/context.js.map +1 -0
  264. package/dist/core/contribution.d.ts +152 -0
  265. package/dist/core/contribution.d.ts.map +1 -0
  266. package/dist/core/contribution.js +213 -0
  267. package/dist/core/contribution.js.map +1 -0
  268. package/dist/core/controller.contextual.d.ts +193 -0
  269. package/dist/core/controller.contextual.d.ts.map +1 -0
  270. package/dist/core/controller.contextual.js +459 -0
  271. package/dist/core/controller.contextual.js.map +1 -0
  272. package/dist/core/controller.d.ts +510 -0
  273. package/dist/core/controller.d.ts.map +1 -0
  274. package/dist/core/controller.js +411 -0
  275. package/dist/core/controller.js.map +1 -0
  276. package/dist/core/controller.procedure.d.ts +147 -0
  277. package/dist/core/controller.procedure.d.ts.map +1 -0
  278. package/dist/core/controller.procedure.js +115 -0
  279. package/dist/core/controller.procedure.js.map +1 -0
  280. package/dist/core/disposable.d.ts +126 -0
  281. package/dist/core/disposable.d.ts.map +1 -0
  282. package/dist/core/disposable.js +179 -0
  283. package/dist/core/disposable.js.map +1 -0
  284. package/dist/core/hmr.d.ts +83 -0
  285. package/dist/core/hmr.d.ts.map +1 -0
  286. package/dist/core/hmr.js +211 -0
  287. package/dist/core/hmr.js.map +1 -0
  288. package/dist/core/index.d.ts +17 -0
  289. package/dist/core/index.d.ts.map +1 -0
  290. package/dist/core/index.js +25 -0
  291. package/dist/core/index.js.map +1 -0
  292. package/dist/core/internal/routes.d.ts +26 -0
  293. package/dist/core/internal/routes.d.ts.map +1 -0
  294. package/dist/core/internal/routes.js +48 -0
  295. package/dist/core/internal/routes.js.map +1 -0
  296. package/dist/core/lifecycle-impl.d.ts +45 -0
  297. package/dist/core/lifecycle-impl.d.ts.map +1 -0
  298. package/dist/core/lifecycle-impl.js +102 -0
  299. package/dist/core/lifecycle-impl.js.map +1 -0
  300. package/dist/core/lifecycle.d.ts +86 -0
  301. package/dist/core/lifecycle.d.ts.map +1 -0
  302. package/dist/core/lifecycle.js +38 -0
  303. package/dist/core/lifecycle.js.map +1 -0
  304. package/dist/core/logger.d.ts +282 -0
  305. package/dist/core/logger.d.ts.map +1 -0
  306. package/dist/core/logger.js +368 -0
  307. package/dist/core/logger.js.map +1 -0
  308. package/dist/core/middleware.d.ts +108 -0
  309. package/dist/core/middleware.d.ts.map +1 -0
  310. package/dist/core/middleware.js +60 -0
  311. package/dist/core/middleware.js.map +1 -0
  312. package/dist/core/openapi-methods.d.ts +61 -0
  313. package/dist/core/openapi-methods.d.ts.map +1 -0
  314. package/dist/core/openapi-methods.js +53 -0
  315. package/dist/core/openapi-methods.js.map +1 -0
  316. package/dist/core/plugin.d.ts +209 -0
  317. package/dist/core/plugin.d.ts.map +1 -0
  318. package/dist/core/plugin.js +36 -0
  319. package/dist/core/plugin.js.map +1 -0
  320. package/dist/core/scope-bridge.d.ts +19 -0
  321. package/dist/core/scope-bridge.d.ts.map +1 -0
  322. package/dist/core/scope-bridge.js +34 -0
  323. package/dist/core/scope-bridge.js.map +1 -0
  324. package/dist/core/service.d.ts +429 -0
  325. package/dist/core/service.d.ts.map +1 -0
  326. package/dist/core/service.js +875 -0
  327. package/dist/core/service.js.map +1 -0
  328. package/dist/features/channel/backend.d.ts +98 -0
  329. package/dist/features/channel/backend.d.ts.map +1 -0
  330. package/dist/features/channel/backend.js +75 -0
  331. package/dist/features/channel/backend.js.map +1 -0
  332. package/dist/features/channel/channel.d.ts +18 -0
  333. package/dist/features/channel/channel.d.ts.map +1 -0
  334. package/dist/features/channel/channel.js +219 -0
  335. package/dist/features/channel/channel.js.map +1 -0
  336. package/dist/features/channel/channels.d.ts +87 -0
  337. package/dist/features/channel/channels.d.ts.map +1 -0
  338. package/dist/features/channel/channels.js +252 -0
  339. package/dist/features/channel/channels.js.map +1 -0
  340. package/dist/features/channel/feature.d.ts +40 -0
  341. package/dist/features/channel/feature.d.ts.map +1 -0
  342. package/dist/features/channel/feature.js +44 -0
  343. package/dist/features/channel/feature.js.map +1 -0
  344. package/dist/features/channel/index.d.ts +41 -0
  345. package/dist/features/channel/index.d.ts.map +1 -0
  346. package/dist/features/channel/index.js +41 -0
  347. package/dist/features/channel/index.js.map +1 -0
  348. package/dist/features/channel/types.d.ts +165 -0
  349. package/dist/features/channel/types.d.ts.map +1 -0
  350. package/dist/features/channel/types.js +10 -0
  351. package/dist/features/channel/types.js.map +1 -0
  352. package/dist/features/config/cli/config-controller.d.ts +77 -0
  353. package/dist/features/config/cli/config-controller.d.ts.map +1 -0
  354. package/dist/features/config/cli/config-controller.js +209 -0
  355. package/dist/features/config/cli/config-controller.js.map +1 -0
  356. package/dist/features/config/cli/index.d.ts +9 -0
  357. package/dist/features/config/cli/index.d.ts.map +1 -0
  358. package/dist/features/config/cli/index.js +9 -0
  359. package/dist/features/config/cli/index.js.map +1 -0
  360. package/dist/features/config/cli/profile-controller.d.ts +87 -0
  361. package/dist/features/config/cli/profile-controller.d.ts.map +1 -0
  362. package/dist/features/config/cli/profile-controller.js +223 -0
  363. package/dist/features/config/cli/profile-controller.js.map +1 -0
  364. package/dist/features/config/cli/utils.d.ts +14 -0
  365. package/dist/features/config/cli/utils.d.ts.map +1 -0
  366. package/dist/features/config/cli/utils.js +29 -0
  367. package/dist/features/config/cli/utils.js.map +1 -0
  368. package/dist/features/config/config-of.d.ts +36 -0
  369. package/dist/features/config/config-of.d.ts.map +1 -0
  370. package/dist/features/config/config-of.js +36 -0
  371. package/dist/features/config/config-of.js.map +1 -0
  372. package/dist/features/config/config-service.d.ts +54 -0
  373. package/dist/features/config/config-service.d.ts.map +1 -0
  374. package/dist/features/config/config-service.js +184 -0
  375. package/dist/features/config/config-service.js.map +1 -0
  376. package/dist/features/config/create-config.d.ts +21 -0
  377. package/dist/features/config/create-config.d.ts.map +1 -0
  378. package/dist/features/config/create-config.js +16 -0
  379. package/dist/features/config/create-config.js.map +1 -0
  380. package/dist/features/config/define-config-partial.d.ts +13 -0
  381. package/dist/features/config/define-config-partial.d.ts.map +1 -0
  382. package/dist/features/config/define-config-partial.js +19 -0
  383. package/dist/features/config/define-config-partial.js.map +1 -0
  384. package/dist/features/config/env-service.d.ts +54 -0
  385. package/dist/features/config/env-service.d.ts.map +1 -0
  386. package/dist/features/config/env-service.js +115 -0
  387. package/dist/features/config/env-service.js.map +1 -0
  388. package/dist/features/config/file-watcher.d.ts +13 -0
  389. package/dist/features/config/file-watcher.d.ts.map +1 -0
  390. package/dist/features/config/file-watcher.js +98 -0
  391. package/dist/features/config/file-watcher.js.map +1 -0
  392. package/dist/features/config/index.d.ts +21 -0
  393. package/dist/features/config/index.d.ts.map +1 -0
  394. package/dist/features/config/index.js +24 -0
  395. package/dist/features/config/index.js.map +1 -0
  396. package/dist/features/config/profile-service.d.ts +59 -0
  397. package/dist/features/config/profile-service.d.ts.map +1 -0
  398. package/dist/features/config/profile-service.js +114 -0
  399. package/dist/features/config/profile-service.js.map +1 -0
  400. package/dist/features/config/types.d.ts +38 -0
  401. package/dist/features/config/types.d.ts.map +1 -0
  402. package/dist/features/config/types.js +17 -0
  403. package/dist/features/config/types.js.map +1 -0
  404. package/dist/features/contract/contract.d.ts +264 -0
  405. package/dist/features/contract/contract.d.ts.map +1 -0
  406. package/dist/features/contract/contract.js +183 -0
  407. package/dist/features/contract/contract.js.map +1 -0
  408. package/dist/features/contract/index.d.ts +2 -0
  409. package/dist/features/contract/index.d.ts.map +1 -0
  410. package/dist/features/contract/index.js +2 -0
  411. package/dist/features/contract/index.js.map +1 -0
  412. package/dist/features/env/contribute.d.ts +70 -0
  413. package/dist/features/env/contribute.d.ts.map +1 -0
  414. package/dist/features/env/contribute.js +195 -0
  415. package/dist/features/env/contribute.js.map +1 -0
  416. package/dist/features/environment/create-environment.d.ts +58 -0
  417. package/dist/features/environment/create-environment.d.ts.map +1 -0
  418. package/dist/features/environment/create-environment.js +22 -0
  419. package/dist/features/environment/create-environment.js.map +1 -0
  420. package/dist/features/environment/index.d.ts +12 -0
  421. package/dist/features/environment/index.d.ts.map +1 -0
  422. package/dist/features/environment/index.js +10 -0
  423. package/dist/features/environment/index.js.map +1 -0
  424. package/dist/features/environment/load.d.ts +59 -0
  425. package/dist/features/environment/load.d.ts.map +1 -0
  426. package/dist/features/environment/load.js +117 -0
  427. package/dist/features/environment/load.js.map +1 -0
  428. package/dist/features/environment/types.d.ts +165 -0
  429. package/dist/features/environment/types.d.ts.map +1 -0
  430. package/dist/features/environment/types.js +18 -0
  431. package/dist/features/environment/types.js.map +1 -0
  432. package/dist/features/feature-flags/create-feature-flag-provider.d.ts +21 -0
  433. package/dist/features/feature-flags/create-feature-flag-provider.d.ts.map +1 -0
  434. package/dist/features/feature-flags/create-feature-flag-provider.js +16 -0
  435. package/dist/features/feature-flags/create-feature-flag-provider.js.map +1 -0
  436. package/dist/features/feature-flags/define-feature-flag-partial.d.ts +20 -0
  437. package/dist/features/feature-flags/define-feature-flag-partial.d.ts.map +1 -0
  438. package/dist/features/feature-flags/define-feature-flag-partial.js +26 -0
  439. package/dist/features/feature-flags/define-feature-flag-partial.js.map +1 -0
  440. package/dist/features/feature-flags/feature-flag-of.d.ts +16 -0
  441. package/dist/features/feature-flags/feature-flag-of.d.ts.map +1 -0
  442. package/dist/features/feature-flags/feature-flag-of.js +16 -0
  443. package/dist/features/feature-flags/feature-flag-of.js.map +1 -0
  444. package/dist/features/feature-flags/feature-flag-service.d.ts +22 -0
  445. package/dist/features/feature-flags/feature-flag-service.d.ts.map +1 -0
  446. package/dist/features/feature-flags/feature-flag-service.js +112 -0
  447. package/dist/features/feature-flags/feature-flag-service.js.map +1 -0
  448. package/dist/features/feature-flags/index.d.ts +15 -0
  449. package/dist/features/feature-flags/index.d.ts.map +1 -0
  450. package/dist/features/feature-flags/index.js +12 -0
  451. package/dist/features/feature-flags/index.js.map +1 -0
  452. package/dist/features/feature-flags/types.d.ts +30 -0
  453. package/dist/features/feature-flags/types.d.ts.map +1 -0
  454. package/dist/features/feature-flags/types.js +8 -0
  455. package/dist/features/feature-flags/types.js.map +1 -0
  456. package/dist/features/index.d.ts +6 -0
  457. package/dist/features/index.d.ts.map +1 -0
  458. package/dist/features/index.js +7 -0
  459. package/dist/features/index.js.map +1 -0
  460. package/dist/features/lock/index.d.ts +4 -0
  461. package/dist/features/lock/index.d.ts.map +1 -0
  462. package/dist/features/lock/index.js +4 -0
  463. package/dist/features/lock/index.js.map +1 -0
  464. package/dist/features/lock/lock-service.d.ts +74 -0
  465. package/dist/features/lock/lock-service.d.ts.map +1 -0
  466. package/dist/features/lock/lock-service.js +210 -0
  467. package/dist/features/lock/lock-service.js.map +1 -0
  468. package/dist/features/lock/memory.d.ts +60 -0
  469. package/dist/features/lock/memory.d.ts.map +1 -0
  470. package/dist/features/lock/memory.js +194 -0
  471. package/dist/features/lock/memory.js.map +1 -0
  472. package/dist/features/lock/types.d.ts +151 -0
  473. package/dist/features/lock/types.d.ts.map +1 -0
  474. package/dist/features/lock/types.js +17 -0
  475. package/dist/features/lock/types.js.map +1 -0
  476. package/dist/features/memory/index.d.ts +18 -0
  477. package/dist/features/memory/index.d.ts.map +1 -0
  478. package/dist/features/memory/index.js +18 -0
  479. package/dist/features/memory/index.js.map +1 -0
  480. package/dist/features/memory/lock-feature.d.ts +21 -0
  481. package/dist/features/memory/lock-feature.d.ts.map +1 -0
  482. package/dist/features/memory/lock-feature.js +24 -0
  483. package/dist/features/memory/lock-feature.js.map +1 -0
  484. package/dist/features/secrets/create-secret-provider.d.ts +31 -0
  485. package/dist/features/secrets/create-secret-provider.d.ts.map +1 -0
  486. package/dist/features/secrets/create-secret-provider.js +26 -0
  487. package/dist/features/secrets/create-secret-provider.js.map +1 -0
  488. package/dist/features/secrets/define-secret-partial.d.ts +16 -0
  489. package/dist/features/secrets/define-secret-partial.d.ts.map +1 -0
  490. package/dist/features/secrets/define-secret-partial.js +26 -0
  491. package/dist/features/secrets/define-secret-partial.js.map +1 -0
  492. package/dist/features/secrets/index.d.ts +17 -0
  493. package/dist/features/secrets/index.d.ts.map +1 -0
  494. package/dist/features/secrets/index.js +14 -0
  495. package/dist/features/secrets/index.js.map +1 -0
  496. package/dist/features/secrets/secret-of.d.ts +19 -0
  497. package/dist/features/secrets/secret-of.d.ts.map +1 -0
  498. package/dist/features/secrets/secret-of.js +21 -0
  499. package/dist/features/secrets/secret-of.js.map +1 -0
  500. package/dist/features/secrets/secret-service.d.ts +21 -0
  501. package/dist/features/secrets/secret-service.d.ts.map +1 -0
  502. package/dist/features/secrets/secret-service.js +28 -0
  503. package/dist/features/secrets/secret-service.js.map +1 -0
  504. package/dist/features/secrets/types.d.ts +30 -0
  505. package/dist/features/secrets/types.d.ts.map +1 -0
  506. package/dist/features/secrets/types.js +8 -0
  507. package/dist/features/secrets/types.js.map +1 -0
  508. package/dist/features/vault/env-var-vault.d.ts +24 -0
  509. package/dist/features/vault/env-var-vault.d.ts.map +1 -0
  510. package/dist/features/vault/env-var-vault.js +43 -0
  511. package/dist/features/vault/env-var-vault.js.map +1 -0
  512. package/dist/features/vault/hardcoded-vault.d.ts +34 -0
  513. package/dist/features/vault/hardcoded-vault.d.ts.map +1 -0
  514. package/dist/features/vault/hardcoded-vault.js +46 -0
  515. package/dist/features/vault/hardcoded-vault.js.map +1 -0
  516. package/dist/features/vault/hashicorp-vault.d.ts +32 -0
  517. package/dist/features/vault/hashicorp-vault.d.ts.map +1 -0
  518. package/dist/features/vault/hashicorp-vault.js +69 -0
  519. package/dist/features/vault/hashicorp-vault.js.map +1 -0
  520. package/dist/features/vault/index.d.ts +13 -0
  521. package/dist/features/vault/index.d.ts.map +1 -0
  522. package/dist/features/vault/index.js +12 -0
  523. package/dist/features/vault/index.js.map +1 -0
  524. package/dist/features/vault/kubernetes-vault.d.ts +27 -0
  525. package/dist/features/vault/kubernetes-vault.d.ts.map +1 -0
  526. package/dist/features/vault/kubernetes-vault.js +51 -0
  527. package/dist/features/vault/kubernetes-vault.js.map +1 -0
  528. package/dist/features/vault/types.d.ts +41 -0
  529. package/dist/features/vault/types.d.ts.map +1 -0
  530. package/dist/features/vault/types.js +21 -0
  531. package/dist/features/vault/types.js.map +1 -0
  532. package/dist/index.d.ts +78 -0
  533. package/dist/index.d.ts.map +1 -0
  534. package/dist/index.js +48 -0
  535. package/dist/index.js.map +1 -0
  536. package/dist/justscale.d.ts +63 -0
  537. package/dist/justscale.d.ts.map +1 -0
  538. package/dist/justscale.js +501 -0
  539. package/dist/justscale.js.map +1 -0
  540. package/dist/kernel/adapter.d.ts +9 -0
  541. package/dist/kernel/adapter.d.ts.map +1 -0
  542. package/dist/kernel/adapter.js +2 -0
  543. package/dist/kernel/adapter.js.map +1 -0
  544. package/dist/kernel/kernel.d.ts +15 -0
  545. package/dist/kernel/kernel.d.ts.map +1 -0
  546. package/dist/kernel/kernel.js +134 -0
  547. package/dist/kernel/kernel.js.map +1 -0
  548. package/dist/models/access.d.ts +26 -0
  549. package/dist/models/access.d.ts.map +1 -0
  550. package/dist/models/access.js +126 -0
  551. package/dist/models/access.js.map +1 -0
  552. package/dist/models/apply-types-config.d.ts +52 -0
  553. package/dist/models/apply-types-config.d.ts.map +1 -0
  554. package/dist/models/apply-types-config.js +47 -0
  555. package/dist/models/apply-types-config.js.map +1 -0
  556. package/dist/models/define-model.d.ts +249 -0
  557. package/dist/models/define-model.d.ts.map +1 -0
  558. package/dist/models/define-model.js +388 -0
  559. package/dist/models/define-model.js.map +1 -0
  560. package/dist/models/field.d.ts +309 -0
  561. package/dist/models/field.d.ts.map +1 -0
  562. package/dist/models/field.js +312 -0
  563. package/dist/models/field.js.map +1 -0
  564. package/dist/models/in-memory/condition-evaluator.d.ts +53 -0
  565. package/dist/models/in-memory/condition-evaluator.d.ts.map +1 -0
  566. package/dist/models/in-memory/condition-evaluator.js +593 -0
  567. package/dist/models/in-memory/condition-evaluator.js.map +1 -0
  568. package/dist/models/in-memory/in-memory-model.d.ts +89 -0
  569. package/dist/models/in-memory/in-memory-model.d.ts.map +1 -0
  570. package/dist/models/in-memory/in-memory-model.js +101 -0
  571. package/dist/models/in-memory/in-memory-model.js.map +1 -0
  572. package/dist/models/in-memory/in-memory-repository.d.ts +208 -0
  573. package/dist/models/in-memory/in-memory-repository.d.ts.map +1 -0
  574. package/dist/models/in-memory/in-memory-repository.js +618 -0
  575. package/dist/models/in-memory/in-memory-repository.js.map +1 -0
  576. package/dist/models/in-memory/in-memory-scheduled-task.repository.d.ts +92 -0
  577. package/dist/models/in-memory/in-memory-scheduled-task.repository.d.ts.map +1 -0
  578. package/dist/models/in-memory/in-memory-scheduled-task.repository.js +395 -0
  579. package/dist/models/in-memory/in-memory-scheduled-task.repository.js.map +1 -0
  580. package/dist/models/in-memory/index.d.ts +35 -0
  581. package/dist/models/in-memory/index.d.ts.map +1 -0
  582. package/dist/models/in-memory/index.js +36 -0
  583. package/dist/models/in-memory/index.js.map +1 -0
  584. package/dist/models/index.d.ts +52 -0
  585. package/dist/models/index.d.ts.map +1 -0
  586. package/dist/models/index.js +86 -0
  587. package/dist/models/index.js.map +1 -0
  588. package/dist/models/model-name-registry.d.ts +16 -0
  589. package/dist/models/model-name-registry.d.ts.map +1 -0
  590. package/dist/models/model-name-registry.js +19 -0
  591. package/dist/models/model-name-registry.js.map +1 -0
  592. package/dist/models/model.d.ts +15 -0
  593. package/dist/models/model.d.ts.map +1 -0
  594. package/dist/models/model.js +114 -0
  595. package/dist/models/model.js.map +1 -0
  596. package/dist/models/model.repository.d.ts +318 -0
  597. package/dist/models/model.repository.d.ts.map +1 -0
  598. package/dist/models/model.repository.js +146 -0
  599. package/dist/models/model.repository.js.map +1 -0
  600. package/dist/models/observable.d.ts +15 -0
  601. package/dist/models/observable.d.ts.map +1 -0
  602. package/dist/models/observable.js +64 -0
  603. package/dist/models/observable.js.map +1 -0
  604. package/dist/models/proxy.d.ts +5 -0
  605. package/dist/models/proxy.d.ts.map +1 -0
  606. package/dist/models/proxy.js +407 -0
  607. package/dist/models/proxy.js.map +1 -0
  608. package/dist/models/query.d.ts +574 -0
  609. package/dist/models/query.d.ts.map +1 -0
  610. package/dist/models/query.js +701 -0
  611. package/dist/models/query.js.map +1 -0
  612. package/dist/models/reference/reference.d.ts +229 -0
  613. package/dist/models/reference/reference.d.ts.map +1 -0
  614. package/dist/models/reference/reference.js +331 -0
  615. package/dist/models/reference/reference.js.map +1 -0
  616. package/dist/models/reference/transient-ref.d.ts +123 -0
  617. package/dist/models/reference/transient-ref.d.ts.map +1 -0
  618. package/dist/models/reference/transient-ref.js +152 -0
  619. package/dist/models/reference/transient-ref.js.map +1 -0
  620. package/dist/models/repository.d.ts +53 -0
  621. package/dist/models/repository.d.ts.map +1 -0
  622. package/dist/models/repository.js +37 -0
  623. package/dist/models/repository.js.map +1 -0
  624. package/dist/models/scheduled-task/index.d.ts +13 -0
  625. package/dist/models/scheduled-task/index.d.ts.map +1 -0
  626. package/dist/models/scheduled-task/index.js +12 -0
  627. package/dist/models/scheduled-task/index.js.map +1 -0
  628. package/dist/models/scheduled-task/scheduled-task.d.ts +73 -0
  629. package/dist/models/scheduled-task/scheduled-task.d.ts.map +1 -0
  630. package/dist/models/scheduled-task/scheduled-task.js +95 -0
  631. package/dist/models/scheduled-task/scheduled-task.js.map +1 -0
  632. package/dist/models/scheduled-task/scheduled-task.repository.d.ts +150 -0
  633. package/dist/models/scheduled-task/scheduled-task.repository.d.ts.map +1 -0
  634. package/dist/models/scheduled-task/scheduled-task.repository.js +40 -0
  635. package/dist/models/scheduled-task/scheduled-task.repository.js.map +1 -0
  636. package/dist/models/stream.d.ts +139 -0
  637. package/dist/models/stream.d.ts.map +1 -0
  638. package/dist/models/stream.js +153 -0
  639. package/dist/models/stream.js.map +1 -0
  640. package/dist/models/symbols.d.ts +73 -0
  641. package/dist/models/symbols.d.ts.map +1 -0
  642. package/dist/models/symbols.js +97 -0
  643. package/dist/models/symbols.js.map +1 -0
  644. package/dist/models/types.d.ts +291 -0
  645. package/dist/models/types.d.ts.map +1 -0
  646. package/dist/models/types.js +50 -0
  647. package/dist/models/types.js.map +1 -0
  648. package/dist/models/watch.d.ts +27 -0
  649. package/dist/models/watch.d.ts.map +1 -0
  650. package/dist/models/watch.js +124 -0
  651. package/dist/models/watch.js.map +1 -0
  652. package/dist/models/zod-ref.d.ts +46 -0
  653. package/dist/models/zod-ref.d.ts.map +1 -0
  654. package/dist/models/zod-ref.js +31 -0
  655. package/dist/models/zod-ref.js.map +1 -0
  656. package/dist/process/builtin-serializers.d.ts +19 -0
  657. package/dist/process/builtin-serializers.d.ts.map +1 -0
  658. package/dist/process/builtin-serializers.js +213 -0
  659. package/dist/process/builtin-serializers.js.map +1 -0
  660. package/dist/process/cluster-plugin.d.ts +129 -0
  661. package/dist/process/cluster-plugin.d.ts.map +1 -0
  662. package/dist/process/cluster-plugin.js +175 -0
  663. package/dist/process/cluster-plugin.js.map +1 -0
  664. package/dist/process/createProcess.d.ts +67 -0
  665. package/dist/process/createProcess.d.ts.map +1 -0
  666. package/dist/process/createProcess.js +111 -0
  667. package/dist/process/createProcess.js.map +1 -0
  668. package/dist/process/define-signals.d.ts +113 -0
  669. package/dist/process/define-signals.d.ts.map +1 -0
  670. package/dist/process/define-signals.js +222 -0
  671. package/dist/process/define-signals.js.map +1 -0
  672. package/dist/process/delay-controller.d.ts +35 -0
  673. package/dist/process/delay-controller.d.ts.map +1 -0
  674. package/dist/process/delay-controller.js +55 -0
  675. package/dist/process/delay-controller.js.map +1 -0
  676. package/dist/process/index.d.ts +38 -0
  677. package/dist/process/index.d.ts.map +1 -0
  678. package/dist/process/index.js +47 -0
  679. package/dist/process/index.js.map +1 -0
  680. package/dist/process/primitives.d.ts +393 -0
  681. package/dist/process/primitives.d.ts.map +1 -0
  682. package/dist/process/primitives.js +325 -0
  683. package/dist/process/primitives.js.map +1 -0
  684. package/dist/process/serialization.d.ts +58 -0
  685. package/dist/process/serialization.d.ts.map +1 -0
  686. package/dist/process/serialization.js +220 -0
  687. package/dist/process/serialization.js.map +1 -0
  688. package/dist/process/stream-utils.d.ts +123 -0
  689. package/dist/process/stream-utils.d.ts.map +1 -0
  690. package/dist/process/stream-utils.js +247 -0
  691. package/dist/process/stream-utils.js.map +1 -0
  692. package/dist/process/testing/clock.d.ts +115 -0
  693. package/dist/process/testing/clock.d.ts.map +1 -0
  694. package/dist/process/testing/clock.js +166 -0
  695. package/dist/process/testing/clock.js.map +1 -0
  696. package/dist/process/testing/index.d.ts +9 -0
  697. package/dist/process/testing/index.d.ts.map +1 -0
  698. package/dist/process/testing/index.js +9 -0
  699. package/dist/process/testing/index.js.map +1 -0
  700. package/dist/process/testing.d.ts +50 -0
  701. package/dist/process/testing.d.ts.map +1 -0
  702. package/dist/process/testing.js +59 -0
  703. package/dist/process/testing.js.map +1 -0
  704. package/dist/process/types.d.ts +540 -0
  705. package/dist/process/types.d.ts.map +1 -0
  706. package/dist/process/types.js +21 -0
  707. package/dist/process/types.js.map +1 -0
  708. package/dist/queue/index.d.ts +2 -0
  709. package/dist/queue/index.d.ts.map +1 -0
  710. package/dist/queue/index.js +2 -0
  711. package/dist/queue/index.js.map +1 -0
  712. package/dist/queue/queue.d.ts +34 -0
  713. package/dist/queue/queue.d.ts.map +1 -0
  714. package/dist/queue/queue.js +108 -0
  715. package/dist/queue/queue.js.map +1 -0
  716. package/dist/runtime/process/compiled.d.ts +56 -0
  717. package/dist/runtime/process/compiled.d.ts.map +1 -0
  718. package/dist/runtime/process/compiled.js +221 -0
  719. package/dist/runtime/process/compiled.js.map +1 -0
  720. package/dist/runtime/process/executor.d.ts +279 -0
  721. package/dist/runtime/process/executor.d.ts.map +1 -0
  722. package/dist/runtime/process/executor.js +1941 -0
  723. package/dist/runtime/process/executor.js.map +1 -0
  724. package/dist/runtime/process/factory.d.ts +72 -0
  725. package/dist/runtime/process/factory.d.ts.map +1 -0
  726. package/dist/runtime/process/factory.js +78 -0
  727. package/dist/runtime/process/factory.js.map +1 -0
  728. package/dist/runtime/process/freeze.d.ts +5 -0
  729. package/dist/runtime/process/freeze.d.ts.map +1 -0
  730. package/dist/runtime/process/freeze.js +94 -0
  731. package/dist/runtime/process/freeze.js.map +1 -0
  732. package/dist/runtime/process/scheduled-task-timer.d.ts +52 -0
  733. package/dist/runtime/process/scheduled-task-timer.d.ts.map +1 -0
  734. package/dist/runtime/process/scheduled-task-timer.js +104 -0
  735. package/dist/runtime/process/scheduled-task-timer.js.map +1 -0
  736. package/dist/runtime/process/signal-bus.d.ts +186 -0
  737. package/dist/runtime/process/signal-bus.d.ts.map +1 -0
  738. package/dist/runtime/process/signal-bus.js +256 -0
  739. package/dist/runtime/process/signal-bus.js.map +1 -0
  740. package/dist/runtime/process/state-serializer.d.ts +30 -0
  741. package/dist/runtime/process/state-serializer.d.ts.map +1 -0
  742. package/dist/runtime/process/state-serializer.js +244 -0
  743. package/dist/runtime/process/state-serializer.js.map +1 -0
  744. package/dist/runtime/process/storage.d.ts +96 -0
  745. package/dist/runtime/process/storage.d.ts.map +1 -0
  746. package/dist/runtime/process/storage.js +165 -0
  747. package/dist/runtime/process/storage.js.map +1 -0
  748. package/dist/runtime/process/timer-scheduler.d.ts +115 -0
  749. package/dist/runtime/process/timer-scheduler.d.ts.map +1 -0
  750. package/dist/runtime/process/timer-scheduler.js +192 -0
  751. package/dist/runtime/process/timer-scheduler.js.map +1 -0
  752. package/dist/runtime/process/trace.d.ts +17 -0
  753. package/dist/runtime/process/trace.d.ts.map +1 -0
  754. package/dist/runtime/process/trace.js +26 -0
  755. package/dist/runtime/process/trace.js.map +1 -0
  756. package/dist/runtime/protobuf/encoding/index.d.ts +26 -0
  757. package/dist/runtime/protobuf/encoding/index.d.ts.map +1 -0
  758. package/dist/runtime/protobuf/encoding/index.js +30 -0
  759. package/dist/runtime/protobuf/encoding/index.js.map +1 -0
  760. package/dist/runtime/protobuf/encoding/reader.d.ts +182 -0
  761. package/dist/runtime/protobuf/encoding/reader.d.ts.map +1 -0
  762. package/dist/runtime/protobuf/encoding/reader.js +353 -0
  763. package/dist/runtime/protobuf/encoding/reader.js.map +1 -0
  764. package/dist/runtime/protobuf/encoding/varint.d.ts +67 -0
  765. package/dist/runtime/protobuf/encoding/varint.d.ts.map +1 -0
  766. package/dist/runtime/protobuf/encoding/varint.js +117 -0
  767. package/dist/runtime/protobuf/encoding/varint.js.map +1 -0
  768. package/dist/runtime/protobuf/encoding/wire-types.d.ts +62 -0
  769. package/dist/runtime/protobuf/encoding/wire-types.d.ts.map +1 -0
  770. package/dist/runtime/protobuf/encoding/wire-types.js +103 -0
  771. package/dist/runtime/protobuf/encoding/wire-types.js.map +1 -0
  772. package/dist/runtime/protobuf/encoding/writer.d.ts +147 -0
  773. package/dist/runtime/protobuf/encoding/writer.d.ts.map +1 -0
  774. package/dist/runtime/protobuf/encoding/writer.js +214 -0
  775. package/dist/runtime/protobuf/encoding/writer.js.map +1 -0
  776. package/dist/runtime/protobuf/index.d.ts +3 -0
  777. package/dist/runtime/protobuf/index.d.ts.map +1 -0
  778. package/dist/runtime/protobuf/index.js +3 -0
  779. package/dist/runtime/protobuf/index.js.map +1 -0
  780. package/dist/runtime/protobuf/serialized.d.ts +48 -0
  781. package/dist/runtime/protobuf/serialized.d.ts.map +1 -0
  782. package/dist/runtime/protobuf/serialized.js +517 -0
  783. package/dist/runtime/protobuf/serialized.js.map +1 -0
  784. package/package.json +209 -0
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @justscale/process/testing - Testing Utilities
3
+ *
4
+ * Utilities for testing durable processes:
5
+ * - TestClock for time travel testing
6
+ * - setupTestProcessRuntime for test setup
7
+ */
8
+ export { TestClock, createTestClock } from './clock.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/process/testing/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @justscale/process/testing - Testing Utilities
3
+ *
4
+ * Utilities for testing durable processes:
5
+ * - TestClock for time travel testing
6
+ * - setupTestProcessRuntime for test setup
7
+ */
8
+ export { TestClock, createTestClock } from './clock.js';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/process/testing/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @justscale/process - Testing Utilities
3
+ *
4
+ * Helpers for setting up process runtime in tests.
5
+ */
6
+ import type { Container } from '../core/index.js';
7
+ import type { LockProvider } from '../index.js';
8
+ import { type InMemoryRuntime } from '../runtime/process/factory.js';
9
+ import { TestClock, createTestClock } from './testing/clock.js';
10
+ export { TestClock, createTestClock };
11
+ export interface SetupTestProcessRuntimeOptions {
12
+ /** Optional lock provider for testing locking behavior */
13
+ lockProvider?: LockProvider;
14
+ }
15
+ /**
16
+ * Set up process runtime for testing.
17
+ *
18
+ * Creates an in-memory process runtime and sets it as the global executor.
19
+ * Also registers the executor for DI so services can inject AbstractProcessExecutor.
20
+ * Returns the runtime for test control (emitting signals, advancing timers).
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * import { setupTestProcessRuntime, TestClock } from '@justscale/process'
25
+ *
26
+ * const app = built.compile()
27
+ * await app.ready
28
+ *
29
+ * const runtime = setupTestProcessRuntime(app.container)
30
+ * const clock = new TestClock(runtime.timerScheduler)
31
+ *
32
+ * // Now processes will work
33
+ * await myProcess(['param'])
34
+ *
35
+ * // Emit signals in tests
36
+ * await runtime.signalBus.emit('some.signal', { id: '123' }, { data: 'payload' })
37
+ *
38
+ * // Time travel - advance by duration
39
+ * await clock.advance.minutes(5)
40
+ * await clock.advance.hours(1)
41
+ *
42
+ * // Or fire next timer directly
43
+ * clock.fireNext()
44
+ *
45
+ * // Clean up
46
+ * runtime.stop()
47
+ * ```
48
+ */
49
+ export declare function setupTestProcessRuntime(container: Container, options?: SetupTestProcessRuntimeOptions): InMemoryRuntime;
50
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/process/testing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAG5F,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGhE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AAEtC,MAAM,WAAW,8BAA8B;IAC7C,0DAA0D;IAC1D,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,SAAS,EACpB,OAAO,GAAE,8BAAmC,GAC3C,eAAe,CAgBjB"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * @justscale/process - Testing Utilities
3
+ *
4
+ * Helpers for setting up process runtime in tests.
5
+ */
6
+ import { createInMemoryRuntime } from '../runtime/process/factory.js';
7
+ import { setProcessExecutor } from '../runtime/process/compiled.js';
8
+ import { AbstractProcessExecutor } from '../runtime/process/executor.js';
9
+ import { TestClock, createTestClock } from './testing/clock.js';
10
+ // Re-export testing utilities
11
+ export { TestClock, createTestClock };
12
+ /**
13
+ * Set up process runtime for testing.
14
+ *
15
+ * Creates an in-memory process runtime and sets it as the global executor.
16
+ * Also registers the executor for DI so services can inject AbstractProcessExecutor.
17
+ * Returns the runtime for test control (emitting signals, advancing timers).
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * import { setupTestProcessRuntime, TestClock } from '@justscale/process'
22
+ *
23
+ * const app = built.compile()
24
+ * await app.ready
25
+ *
26
+ * const runtime = setupTestProcessRuntime(app.container)
27
+ * const clock = new TestClock(runtime.timerScheduler)
28
+ *
29
+ * // Now processes will work
30
+ * await myProcess(['param'])
31
+ *
32
+ * // Emit signals in tests
33
+ * await runtime.signalBus.emit('some.signal', { id: '123' }, { data: 'payload' })
34
+ *
35
+ * // Time travel - advance by duration
36
+ * await clock.advance.minutes(5)
37
+ * await clock.advance.hours(1)
38
+ *
39
+ * // Or fire next timer directly
40
+ * clock.fireNext()
41
+ *
42
+ * // Clean up
43
+ * runtime.stop()
44
+ * ```
45
+ */
46
+ export function setupTestProcessRuntime(container, options = {}) {
47
+ // Create a resolver function that wraps the container
48
+ const resolve = ((token) => container.resolve(token));
49
+ const runtime = createInMemoryRuntime({
50
+ resolve,
51
+ autoStart: true,
52
+ lockProvider: options.lockProvider,
53
+ });
54
+ setProcessExecutor(runtime.executor);
55
+ // Register executor for DI-based signal creation
56
+ container.registerInstance(AbstractProcessExecutor, runtime.executor);
57
+ return runtime;
58
+ }
59
+ //# sourceMappingURL=testing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.js","sourceRoot":"","sources":["../../src/process/testing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,qBAAqB,EAAwB,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEhE,8BAA8B;AAC9B,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AAOtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,uBAAuB,CACrC,SAAoB,EACpB,UAA0C,EAAE;IAE5C,sDAAsD;IACtD,MAAM,OAAO,GAAG,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAa,CAAC;IAEvE,MAAM,OAAO,GAAG,qBAAqB,CAAC;QACpC,OAAO;QACP,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,OAAO,CAAC,YAAY;KACnC,CAAC,CAAC;IAEH,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAErC,iDAAiD;IACjD,SAAS,CAAC,gBAAgB,CAAC,uBAAuB,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEtE,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,540 @@
1
+ /**
2
+ * @justscale/process - Core Types
3
+ *
4
+ * Type definitions for durable processes.
5
+ */
6
+ import type { ServiceToken, ResolvedDeps } from '../core/index.js';
7
+ import type { TypesConfig, TypedParams, ExtractParamNames, Prettify } from '../models/apply-types-config.js';
8
+ /** Brand symbol for Signal type */
9
+ export declare const SIGNAL_BRAND: unique symbol;
10
+ /**
11
+ * A Signal represents a suspension point in a process.
12
+ *
13
+ * Usage:
14
+ * - Inside process: `await signal(orders.complete)` - suspends until signal emitted
15
+ * - Outside process: `await orders.complete(orderId)` - emits signal to instance
16
+ *
17
+ * Create signals with `defineSignals()`:
18
+ * ```typescript
19
+ * class OrderSignals extends defineSignals(signal => ({
20
+ * complete: signal('/order/:order/complete').types({ Order }),
21
+ * shipped: signal('/order/:order/shipped').data<ShipmentDetails>().types({ Order }),
22
+ * })) {}
23
+ * ```
24
+ *
25
+ * @typeParam TIdentity - Tuple of identity parameters for routing
26
+ * @typeParam TPayload - Payload type returned when signal is received
27
+ * @typeParam TName - Literal signal name (inferred from createSignal)
28
+ */
29
+ export interface Signal<TIdentity extends readonly unknown[] = [], TPayload = void, TName extends string = string> extends PromiseLike<TPayload> {
30
+ /** Call to emit the signal (from outside a process) */
31
+ (...args: [...TIdentity, ...(TPayload extends void ? [] : [TPayload])]): Promise<void>;
32
+ /** Brand for type safety */
33
+ readonly [SIGNAL_BRAND]: typeof SIGNAL_BRAND;
34
+ /** Signal name for routing (literal type for switch narrowing) */
35
+ readonly signalName: TName;
36
+ /** Phantom types for inference */
37
+ readonly __identity: TIdentity;
38
+ readonly __payload: TPayload;
39
+ }
40
+ /**
41
+ * A process param value: a plain string, or anything with an `identifier` property
42
+ * (e.g. a Reference, or Model.ref(entity)).
43
+ *
44
+ * This lets you write `process([Table.ref(table)])` instead of
45
+ * `process([Table.ref(table).identifier])`.
46
+ */
47
+ export type ParamValue = string | {
48
+ readonly identifier: string;
49
+ };
50
+ /**
51
+ * Extract params for calling a process — accepts strings or refs.
52
+ * "/order/:orderId/:customerId" → readonly [orderId: ParamValue, customerId: ParamValue]
53
+ */
54
+ export type ExtractPathParams<Path extends string> = Path extends `${string}:${infer Param}/${infer Rest}` ? readonly [Param: ParamValue, ...ExtractPathParams<`/${Rest}`>] : Path extends `${string}:${infer Param}` ? readonly [Param: ParamValue] : readonly [];
55
+ /**
56
+ * Extract params for the handler as a named object.
57
+ * "/order/:orderId/:customerId" → { orderId: string, customerId: string }
58
+ */
59
+ export type ExtractHandlerParams<Path extends string> = Prettify<{
60
+ [P in ExtractParamNames<Path>]: string;
61
+ }>;
62
+ export type { TypedParams, TypesConfig, ExtractParamNames, Prettify } from '../models/apply-types-config.js';
63
+ /**
64
+ * Any model class with a static `ref` method.
65
+ * Used in the `types` config to map path params to model references.
66
+ */
67
+ export type ModelClass = abstract new (...args: any[]) => any;
68
+ /**
69
+ * Configuration for createProcess.
70
+ */
71
+ export interface ProcessConfig<TPath extends string, TDeps extends Record<string, ServiceToken>, TResult, TExports = void, TTypes extends Record<string, ModelClass> = {}> {
72
+ /** Route-style path for process identity, e.g., '/order/:orderId/fulfillment' */
73
+ path: TPath;
74
+ /** Dependencies to inject (same pattern as defineService) */
75
+ inject: TDeps;
76
+ /**
77
+ * Map path params to model types. Matched params become `Ref<T>` in the handler.
78
+ *
79
+ * Matching: key matches param name directly, or lowercased.
80
+ * `types: { Table }` matches `:table` in the path.
81
+ * `types: { tableId: Table }` matches `:tableId` in the path.
82
+ *
83
+ * @example
84
+ * ```typescript
85
+ * createProcess({
86
+ * path: '/poker/:table/game/:gameId',
87
+ * types: { Table },
88
+ * handler(deps, { table, gameId }) {
89
+ * // table: Ref<Table> — use directly with repos
90
+ * // gameId: string — untyped param
91
+ * }
92
+ * })
93
+ * ```
94
+ */
95
+ types?: TTypes;
96
+ /** The process handler function */
97
+ handler: (deps: Prettify<ResolvedDeps<TDeps>>, params: keyof TTypes extends never ? ExtractHandlerParams<TPath> : TypedParams<TPath, TTypes>) => Promise<TResult>;
98
+ /** Phantom: carries the exports type. Emitted by compiler, never set by users. */
99
+ __exportsType?: TExports;
100
+ }
101
+ /**
102
+ * A handle to a running or completed process instance.
103
+ *
104
+ * Note: ProcessHandle is intentionally NOT a thenable (no `then` method).
105
+ * This is to avoid JavaScript's automatic unwrapping when returning from
106
+ * async functions. Use `handle.wait()` to await the process result.
107
+ */
108
+ export type ExportsData<T> = Readonly<T> & AsyncIterable<Readonly<T>>;
109
+ export interface ProcessHandle<TResult, TExports = void> {
110
+ /** Unique instance ID (derived from path + params) */
111
+ readonly id: string;
112
+ /** The resolved path, e.g., '/order/123/abc/fulfillment' */
113
+ readonly path: string;
114
+ /** Current process status */
115
+ readonly status: ProcessStatus;
116
+ /** Result if completed (snapshot, may be stale) */
117
+ readonly result?: TResult;
118
+ /** Error if failed (snapshot, may be stale) */
119
+ readonly error?: Error;
120
+ /** Frozen, read-only replica of process exports. AsyncIterable for live updates. */
121
+ readonly data: [TExports] extends [void] ? undefined : ExportsData<TExports>;
122
+ /**
123
+ * Async iterable that emits each status transition.
124
+ * Ends (done: true) when the process reaches a terminal state.
125
+ */
126
+ readonly statusChanges: AsyncIterable<ProcessStatus>;
127
+ /**
128
+ * Wait for the process to complete and return its result.
129
+ * Use `await handle.wait()` to block until process completes.
130
+ */
131
+ wait(): Promise<TResult>;
132
+ /**
133
+ * Cancel the process.
134
+ * Only pending or suspended processes can be cancelled.
135
+ * @returns true if the process was cancelled, false if already completed/failed
136
+ */
137
+ cancel(): Promise<boolean>;
138
+ }
139
+ export type ProcessStatus = 'pending' | 'running' | 'suspended' | 'completed' | 'failed' | 'cancelled';
140
+ /**
141
+ * A continuation handle for processes that yield events.
142
+ *
143
+ * ProcessContinuation allows you to:
144
+ * - Iterate over yielded events as they occur
145
+ * - Wait for the final result
146
+ * - Check the current status
147
+ * - Cancel the subscription (without killing the process)
148
+ *
149
+ * @example
150
+ * ```typescript
151
+ * // Subscribe to process yields
152
+ * const continuation = await OrderBatch(['batch-123'])
153
+ *
154
+ * // Iterate over events as they're yielded
155
+ * for await (const event of continuation) {
156
+ * console.log('Order processed:', event.orderId)
157
+ * }
158
+ *
159
+ * // Get the final result
160
+ * const result = await continuation.result
161
+ * console.log('Batch complete:', result)
162
+ * ```
163
+ */
164
+ export interface ProcessContinuation<TYield, TReturn = void> {
165
+ /**
166
+ * Async iterator over yielded events.
167
+ * Each iteration returns the next yielded value from the process.
168
+ * Consumer cursor is persisted — break/return/cancel persists progress.
169
+ */
170
+ [Symbol.asyncIterator](): AsyncIterator<TYield>;
171
+ /**
172
+ * Promise that resolves when the process COMPLETES (not just suspends).
173
+ * Returns the final return value of the handler.
174
+ */
175
+ readonly result: Promise<TReturn>;
176
+ /**
177
+ * Current process status.
178
+ */
179
+ readonly status: ProcessStatus;
180
+ /**
181
+ * Unique instance ID (derived from path + params).
182
+ */
183
+ readonly id: string;
184
+ /**
185
+ * Unique consumer ID for this continuation.
186
+ * Use this to reconnect and resume from the persisted cursor.
187
+ */
188
+ readonly consumerId: string;
189
+ /**
190
+ * Cancel the subscription to yields.
191
+ * Persists the consumer cursor so reconnection resumes where we left off.
192
+ * This does NOT kill or stop the process.
193
+ */
194
+ cancel(): Promise<void>;
195
+ }
196
+ /**
197
+ * A process definition - callable to start instances.
198
+ * Also acts as a ServiceToken so processes can be injected.
199
+ */
200
+ export interface ProcessDefinition<TPath extends string, TParams extends readonly unknown[], TResult, TExports = void> {
201
+ /** The path pattern */
202
+ readonly path: TPath;
203
+ /**
204
+ * Start a new process instance.
205
+ * Idempotent: if a process with these params already exists, returns its handle.
206
+ */
207
+ (params: TParams): Promise<ProcessHandle<TResult, TExports>>;
208
+ /**
209
+ * Get an existing process by params without starting a new one.
210
+ * Returns null if no process exists for these params.
211
+ */
212
+ get(params: TParams): Promise<ProcessHandle<TResult, TExports> | null>;
213
+ /**
214
+ * Query processes by partial params pattern.
215
+ */
216
+ query(pattern: Partial<Record<string, string>>): AsyncIterable<ProcessHandle<TResult, TExports>>;
217
+ /**
218
+ * Emit a signal to processes waiting for it.
219
+ * @deprecated Use service methods instead. Provided for testing.
220
+ */
221
+ emit(signal: string, identity: unknown[], payload: unknown): Promise<void>;
222
+ /** Placeholder for DI token support on exports. */
223
+ readonly exports: undefined;
224
+ /** Dependencies (same as inject config) */
225
+ readonly deps: Record<string, ServiceToken>;
226
+ /** Factory function that returns the process callable */
227
+ readonly factory: (resolvedDeps: Record<string, unknown>) => (params: TParams) => Promise<ProcessHandle<TResult, TExports>>;
228
+ }
229
+ /**
230
+ * Serialized process state stored in database.
231
+ */
232
+ export interface ProcessState<TVariables = Record<string, unknown>> {
233
+ /** Process definition ID */
234
+ processId: string;
235
+ /** Instance ID (derived from path + params) */
236
+ instanceId: string;
237
+ /** Version hash of opcode structure */
238
+ version: string;
239
+ /** Program counter - current opcode index */
240
+ pc: number;
241
+ /** Serialized variables */
242
+ variables: TVariables;
243
+ /** Pending timers */
244
+ timers: TimerState[];
245
+ /** Metadata */
246
+ createdAt: Date;
247
+ updatedAt: Date;
248
+ suspendedAt?: Date;
249
+ completedAt?: Date;
250
+ status: ProcessStatus;
251
+ result?: unknown;
252
+ error?: string;
253
+ /** Last recoverable error (e.g. DoubleLockError). See SwitchProcessState.lastError. */
254
+ lastError?: string;
255
+ /** Timestamp of the last recoverable error. */
256
+ lastErrorAt?: Date;
257
+ }
258
+ export interface TimerState {
259
+ id: string;
260
+ expiresAt: Date;
261
+ opcodeIndex: number;
262
+ }
263
+ export interface SignalDefinition {
264
+ identity: string[];
265
+ payloadType: string;
266
+ }
267
+ /** Unique symbol for delay branches in race */
268
+ declare const DELAY_BRANCH_SYMBOL: unique symbol;
269
+ export declare const DELAY_BRANCH: typeof DELAY_BRANCH_SYMBOL;
270
+ export type DelayBranch = typeof DELAY_BRANCH;
271
+ /**
272
+ * Extract payload type from a Signal.
273
+ */
274
+ export type SignalPayload<S> = S extends Signal<infer _I, infer P, infer _N> ? P : never;
275
+ /**
276
+ * Extract signal name from a Signal.
277
+ */
278
+ export type SignalName<S> = S extends Signal<infer _I, infer _P, infer N> ? N : never;
279
+ /**
280
+ * A race branch definition - either a signal or a delay.
281
+ */
282
+ export type RaceBranchType<TName extends string = string, TPayload = void> = {
283
+ readonly name: TName;
284
+ readonly __payload: TPayload;
285
+ };
286
+ /**
287
+ * Build a race result variant from a signal or delay.
288
+ * Spreads payload properties directly onto the result (no .payload wrapper).
289
+ * TName can be a string (signal name) or symbol (DELAY_BRANCH).
290
+ */
291
+ export type RaceVariant<TName extends string | symbol, TPayload> = {
292
+ which: TName;
293
+ } & (TPayload extends void ? {} : TPayload extends object ? TPayload : {
294
+ value: TPayload;
295
+ });
296
+ /**
297
+ * Union of race result variants from a tuple of signals.
298
+ *
299
+ * @example
300
+ * ```typescript
301
+ * type Signals = [
302
+ * Signal<[], { code: string }, 'auth.code'>,
303
+ * Signal<[], void, 'auth.cancel'>,
304
+ * ]
305
+ * type Result = RaceResult<Signals>
306
+ * // = { which: 'auth.code'; code: string } | { which: 'auth.cancel' }
307
+ * ```
308
+ */
309
+ export type RaceResult<TBranches extends readonly unknown[]> = {
310
+ [K in keyof TBranches]: TBranches[K] extends Signal<infer _I, infer P, infer N> ? RaceVariant<N, P> : TBranches[K] extends DelayBranch ? RaceVariant<DelayBranch, void> : never;
311
+ }[number];
312
+ /**
313
+ * Helper to create a race result type from signal types.
314
+ * Use with `race<RaceOf<typeof sig1 | typeof sig2>>()`.
315
+ */
316
+ export type RaceOf<TSignals> = TSignals extends Signal<infer _I, infer P, infer N> ? RaceVariant<N, P> : TSignals extends DelayBranch ? RaceVariant<DelayBranch, void> : never;
317
+ /**
318
+ * Entry in the label history for observability.
319
+ * Tracks when the process entered and exited named blocks.
320
+ */
321
+ export interface LabelHistoryEntry {
322
+ /** The label name (e.g., 'waitForPayment') */
323
+ label: string;
324
+ /** Step number when the label was entered */
325
+ enteredAt: number;
326
+ /** Step number when the label was exited (undefined if still active) */
327
+ exitedAt?: number;
328
+ }
329
+ /** Execution result discriminant - process completed */
330
+ export declare const DONE: 0;
331
+ /** Execution result discriminant - process suspended */
332
+ export declare const SUSPEND: 1;
333
+ /** Execution result discriminant - spawn subprocess */
334
+ export declare const SUBPROCESS: 2;
335
+ /**
336
+ * Timer duration specification for delay branches.
337
+ */
338
+ export interface TimerDuration {
339
+ hours?: number;
340
+ minutes?: number;
341
+ seconds?: number;
342
+ days?: number;
343
+ }
344
+ /**
345
+ * Configuration for suspending on a single signal.
346
+ */
347
+ export interface SuspendSignalConfig {
348
+ signal: string;
349
+ }
350
+ /**
351
+ * Configuration for suspending on a timer.
352
+ */
353
+ export interface SuspendTimerConfig {
354
+ timer: TimerDuration;
355
+ }
356
+ /**
357
+ * Configuration for a race branch in suspend config.
358
+ */
359
+ export interface SuspendRaceBranch {
360
+ id: string;
361
+ signal?: string;
362
+ timer?: TimerDuration;
363
+ resumeStep: number;
364
+ }
365
+ /**
366
+ * Configuration for suspending on a race (multiple branches).
367
+ */
368
+ export interface SuspendRaceConfig {
369
+ race: SuspendRaceBranch[];
370
+ }
371
+ /**
372
+ * Configuration for suspending on a scope (parallel fan-out).
373
+ */
374
+ export interface SuspendScopeConfig {
375
+ scope: {
376
+ scopeId: number;
377
+ type: 'signal' | 'handler';
378
+ signal?: unknown;
379
+ resumeStep: number;
380
+ };
381
+ }
382
+ /**
383
+ * A branch in a parallel (signal.all / signal.settled) suspension.
384
+ */
385
+ export interface SuspendParallelBranch {
386
+ id: string | number;
387
+ type: 'signal' | 'delay' | 'function';
388
+ /** Signal expression (has .signalName) for signal branches */
389
+ expr?: unknown;
390
+ }
391
+ /**
392
+ * Configuration for suspending on parallel signal.all() / signal.settled().
393
+ */
394
+ export interface SuspendParallelConfig {
395
+ parallel: {
396
+ parallelId: number;
397
+ pending: number;
398
+ results: unknown[];
399
+ errors: unknown[];
400
+ isSettled: boolean;
401
+ branches: SuspendParallelBranch[];
402
+ };
403
+ }
404
+ /**
405
+ * Union of suspend configurations.
406
+ */
407
+ export type SuspendConfig = SuspendSignalConfig | SuspendTimerConfig | SuspendRaceConfig | SuspendScopeConfig | SuspendParallelConfig;
408
+ export interface SubProcessSpawnConfig {
409
+ name: string;
410
+ args: unknown[];
411
+ storeVar?: string;
412
+ /**
413
+ * True when the source call expression was `await child(...)`.
414
+ * Executor suspends the parent until the child reaches DONE. False for
415
+ * detached spawns; parent continues past the spawn point with a handle
416
+ * (or undefined storeVar) and the child runs independently.
417
+ */
418
+ awaited: boolean;
419
+ }
420
+ /**
421
+ * Result tuple from process execution.
422
+ * - [DONE, result] - Process completed with result
423
+ * - [SUSPEND, config] - Process suspended, needs to wait for signal/timer
424
+ * - [SUBPROCESS, config] - Spawn a subprocess
425
+ */
426
+ export type ExecutionResult = readonly [typeof DONE, unknown] | readonly [typeof SUSPEND, SuspendConfig] | readonly [typeof SUBPROCESS, SubProcessSpawnConfig];
427
+ /**
428
+ * Execution context passed to the compiled process execute function.
429
+ */
430
+ export interface ExecutionContext {
431
+ /** Current process state */
432
+ state: SwitchProcessState;
433
+ /** Resolved service dependencies */
434
+ services: Record<string, unknown>;
435
+ /** Signal payload when resuming from a signal */
436
+ signalPayload?: unknown;
437
+ /** Emit a yielded value (for generator processes). Fire-and-forward, no suspension. */
438
+ emit: (value: unknown) => void;
439
+ }
440
+ /**
441
+ * Process state for switch-based execution model.
442
+ * Uses step (hash) instead of pc (opcode index).
443
+ */
444
+ export interface SwitchProcessState<TVariables = Record<string, unknown>> {
445
+ /** Process definition ID */
446
+ processId: string;
447
+ /** Instance ID (derived from path + params) */
448
+ instanceId: string;
449
+ /** Version hash of process structure */
450
+ version: string;
451
+ /** Current step index (numeric for execution) */
452
+ step: number;
453
+ /** Persisted step hash (for storage/resume) */
454
+ persistedStep: string;
455
+ /** Serialized variables */
456
+ vars: TVariables;
457
+ /** Pending timers */
458
+ timers: TimerState[];
459
+ /** Metadata */
460
+ createdAt: Date;
461
+ updatedAt: Date;
462
+ suspendedAt?: Date;
463
+ completedAt?: Date;
464
+ status: ProcessStatus;
465
+ result?: unknown;
466
+ error?: string;
467
+ /**
468
+ * Last recoverable error thrown by a handler pass that left the process
469
+ * suspended at its prior step (e.g. DoubleLockError). Cleared when a
470
+ * subsequent execute either advances the step or completes.
471
+ *
472
+ * Distinct from `error` which is only set alongside `status: 'failed'`.
473
+ */
474
+ lastError?: string;
475
+ /** Timestamp of the last recoverable error. Pairs with `lastError`. */
476
+ lastErrorAt?: Date;
477
+ /** Current label (innermost active label block) */
478
+ label?: string;
479
+ /** Stack of nested label names (outermost first) */
480
+ labelStack?: string[];
481
+ /** History of label transitions (circular buffer, max 50 entries) */
482
+ labelHistory?: LabelHistoryEntry[];
483
+ }
484
+ /**
485
+ * Compiled process using switch-based execution model.
486
+ * Generated by the process compiler.
487
+ */
488
+ export interface ProcessExportsMetadata {
489
+ /** Data field names (serialized in JSONB) */
490
+ fields: string[];
491
+ /** Method implementations (reattached on resume, NOT serialized) */
492
+ methods: Record<string, Function>;
493
+ }
494
+ export interface CompiledSwitchProcess<TDeps extends Record<string, ServiceToken> = Record<string, ServiceToken>, TExports = unknown> {
495
+ /** Process identifier */
496
+ id: string;
497
+ /** Route path pattern */
498
+ path: string;
499
+ /** Version hash for migration detection */
500
+ version: string;
501
+ /** Service dependencies to inject */
502
+ inject: TDeps;
503
+ /** Hash → index mapping for persistence stability */
504
+ stepMap: Record<string, number>;
505
+ /** Index → [startLine, endLine] for debugging */
506
+ sourceMap: Record<number, [number, number]>;
507
+ /** Signal definitions */
508
+ signals: Record<string, SignalDefinition>;
509
+ /** The VM-style execute function */
510
+ execute: (ctx: ExecutionContext) => Promise<ExecutionResult>;
511
+ /** Exports metadata — present when handler uses `using exports = { ... }` */
512
+ exports?: ProcessExportsMetadata;
513
+ /** Subprocess definitions — present when handler uses createSubProcess() */
514
+ subprocesses?: CompiledSubProcess[];
515
+ /**
516
+ * Types config — maps path param names to model classes.
517
+ * When present, the executor wraps matching string params with Model.ref().
518
+ * Keys match param names directly or lowercased (e.g., { Table } matches :table).
519
+ */
520
+ types?: TypesConfig;
521
+ /** Phantom property carrying the exports type — emitted by compiler, never read at runtime */
522
+ __exportsType?: TExports;
523
+ }
524
+ export interface CompiledSubProcess {
525
+ /** Subprocess name (e.g., 'player') */
526
+ name: string;
527
+ /** Subprocess path suffix (e.g., '/:playerId') */
528
+ path: string;
529
+ /** Handler parameter names */
530
+ params: string[];
531
+ /** Step map for the subprocess handler */
532
+ stepMap: Record<string, number>;
533
+ /** Signal definitions for the subprocess */
534
+ signals: Record<string, SignalDefinition>;
535
+ /** The subprocess execute function */
536
+ execute: (ctx: ExecutionContext) => Promise<ExecutionResult>;
537
+ /** Subprocess exports metadata */
538
+ exports?: ProcessExportsMetadata;
539
+ }
540
+ //# sourceMappingURL=types.d.ts.map