@makaio/framework 1.0.0-dev-1788511348215 → 1.0.0-dev-1788811230746

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 (300) hide show
  1. package/dist/.makaio-build.json +2 -2
  2. package/dist/adapters/config/index.d.mts +1 -1
  3. package/dist/adapters/index.d.mts +2 -2
  4. package/dist/adapters/node.d.mts +1 -1
  5. package/dist/attempt-fixtures-CnrnF5_4.mjs +1 -0
  6. package/dist/attempt-record-codec-B32Whx75.mjs +1 -0
  7. package/dist/authority-state-bootstrap-7Cgb9TR2.mjs +1 -0
  8. package/dist/bootstrap-start-client-DrvofWwi.mjs +1 -0
  9. package/dist/bus/index.d.mts +27 -9
  10. package/dist/bus/index.mjs +1 -1
  11. package/dist/bus-CobBUqjo.mjs +2 -0
  12. package/dist/bus-Uy9C3TBM.mjs +1 -0
  13. package/dist/clients/index.d.mts +1 -1
  14. package/dist/clients/managed-install.d.mts +1 -1
  15. package/dist/code-execution/worker-entry.d.mts +1 -1
  16. package/dist/{context-resolution-841T7jBI.d.mts → context-resolution-C2VBZhaR.d.mts} +5 -5
  17. package/dist/contracts/adapter/index.d.mts +2 -2
  18. package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
  19. package/dist/contracts/artifact/index.d.mts +2 -2
  20. package/dist/contracts/auth/index.d.mts +2 -2
  21. package/dist/contracts/automation-trigger/index.d.mts +3 -3
  22. package/dist/contracts/canonical-model/index.d.mts +1 -1
  23. package/dist/contracts/capabilities/index.d.mts +2 -2
  24. package/dist/contracts/client/index.d.mts +2 -2
  25. package/dist/contracts/code-execution/index.d.mts +1 -1
  26. package/dist/contracts/common/index.d.mts +1 -1
  27. package/dist/contracts/config/index.d.mts +1 -1
  28. package/dist/contracts/extension/index.d.mts +5 -5
  29. package/dist/contracts/facet/index.d.mts +1 -1
  30. package/dist/contracts/harness/index.d.mts +1 -1
  31. package/dist/contracts/host/index.d.mts +1 -1
  32. package/dist/contracts/index.d.mts +1254 -42
  33. package/dist/contracts/index.mjs +1 -1
  34. package/dist/contracts/materialization/index.d.mts +3 -3
  35. package/dist/contracts/model-registry/index.d.mts +1 -1
  36. package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
  37. package/dist/contracts/platform/index.d.mts +1 -1
  38. package/dist/contracts/provider/index.d.mts +2 -2
  39. package/dist/contracts/reaction/index.d.mts +1 -1
  40. package/dist/contracts/session/index.d.mts +2 -2
  41. package/dist/contracts/shared/index.d.mts +2 -2
  42. package/dist/contracts/skill/index.d.mts +1 -1
  43. package/dist/contracts/telemetry/index.d.mts +1 -1
  44. package/dist/contracts/timeout/index.d.mts +1 -1
  45. package/dist/contracts/variant/index.d.mts +1 -1
  46. package/dist/contracts/worker/index.d.mts +2 -2
  47. package/dist/contracts/worker/index.mjs +1 -1
  48. package/dist/contracts/workflow/index.d.mts +2 -2
  49. package/dist/{contribution-CUHLVLsT.d.mts → contribution-Crm-mctl.d.mts} +2 -2
  50. package/dist/{definition-DyGImhyi.d.mts → definition-u_5rYQtc.d.mts} +1 -1
  51. package/dist/{detached-extension-handle-D0aI0pJA.mjs → detached-extension-handle-DAXKQT9c.mjs} +1 -1
  52. package/dist/execution-attempt-repository-Djg3qDRv.mjs +1 -0
  53. package/dist/{execution-attempt-repository-DY4KTptE.d.mts → execution-attempt-repository-OryBjQQI.d.mts} +740 -9
  54. package/dist/{execution-target-H0RWV7Py.mjs → execution-target-BcoF_oDB.mjs} +1 -1
  55. package/dist/{hook-responses-9Ywsqzzq.d.mts → hook-responses-DcapjzLb.d.mts} +1 -1
  56. package/dist/{index-C6aSnO8m.d.mts → index-9PUmCySn.d.mts} +587 -67
  57. package/dist/{index-BmilK-co2.d.mts → index-B6Kr3cxD2.d.mts} +245 -46
  58. package/dist/{index-BNzUyVwV.d.mts → index-BDDavX2S.d.mts} +2 -2
  59. package/dist/{index-DHnSLGP4.d.mts → index-BDzqNCXs.d.mts} +1 -1
  60. package/dist/{index-Wbd_syN2.d.mts → index-BTCodvXA.d.mts} +41 -36
  61. package/dist/{index-B0VO0rAl.d.mts → index-Bo3LRb2u.d.mts} +1 -1
  62. package/dist/{index-Dg11JxKZ.d.mts → index-BwccWakG.d.mts} +1 -1
  63. package/dist/{index-DHH-93YD.d.mts → index-BxTM9lY0.d.mts} +3 -3
  64. package/dist/{index-CDud4NAm.d.mts → index-CAYbui7g.d.mts} +28 -21
  65. package/dist/{index-CPRQ4dWX.d.mts → index-CBixkF0n.d.mts} +12 -0
  66. package/dist/{index-C146Eq_J.d.mts → index-CXH1Bk0W.d.mts} +3 -3
  67. package/dist/{index-BmevAPME2.d.mts → index-Cbv_3Xi12.d.mts} +1 -1
  68. package/dist/{index-DWBkiiXH.d.mts → index-CfJKwWJa.d.mts} +1 -1
  69. package/dist/{index-B0yMCJW8.d.mts → index-CgqEyk9R.d.mts} +1 -1
  70. package/dist/{index-DI2lS7VT.d.mts → index-CnGHGFMC.d.mts} +13 -13
  71. package/dist/{index-B_8bA2JW.d.mts → index-DEpAI8CY.d.mts} +1 -1
  72. package/dist/{index-CIEycZrt.d.mts → index-DIhkK4Y0.d.mts} +1 -1
  73. package/dist/{index-DNI6UF9h.d.mts → index-Df9L5wwp.d.mts} +10 -10
  74. package/dist/{index-Bqk0pJBQ2.d.mts → index-DrO6QLwf2.d.mts} +1 -1
  75. package/dist/{index-DXtQRehh.d.mts → index-DsjUnKyr.d.mts} +1 -1
  76. package/dist/{index-Cny5RvjO.d.mts → index-J-kv32zv.d.mts} +2 -2
  77. package/dist/{index-CmwAJ8-5.d.mts → index-QJW9g1mG.d.mts} +1 -1
  78. package/dist/kernel/cli/index.d.mts +2 -2
  79. package/dist/kernel/cli/register.d.mts +1 -1
  80. package/dist/kernel/extension/index.d.mts +1 -1
  81. package/dist/kernel/index.d.mts +5 -5
  82. package/dist/kernel/namespace/index.d.mts +1 -1
  83. package/dist/kernel/observability/index.d.mts +1 -1
  84. package/dist/kernel/providers/index.d.mts +1 -1
  85. package/dist/kernel/window/index.d.mts +1 -1
  86. package/dist/{lib-Cm-uEoC1.mjs → lib-271rPR7A.mjs} +1 -1
  87. package/dist/{lib-BpGvHZye.mjs → lib-RFpLjUda.mjs} +1 -1
  88. package/dist/{load-extensions-BQoXaHhR.d.mts → load-extensions-CY8ELnCp.d.mts} +1 -1
  89. package/dist/{load-extensions-DG5LvPyM.mjs → load-extensions-D9inWcDy.mjs} +1 -1
  90. package/dist/{namespace-K23m4b0n.d.mts → namespace-BkOvOAU5.d.mts} +6 -6
  91. package/dist/node/bus-server/index.d.mts +1 -1
  92. package/dist/node/bus-server/server-lifecycle.d.mts +1 -1
  93. package/dist/node/transports/index.d.mts +56 -16
  94. package/dist/node/transports/index.mjs +2 -2
  95. package/dist/package-DEYXB80d.mjs +7 -0
  96. package/dist/{package-efR90JGe.d.mts → package-eOEt1w6u.d.mts} +498 -17
  97. package/dist/package.json +1 -1
  98. package/dist/rules/index.d.mts +1 -1
  99. package/dist/rules/schemas.d.mts +1 -1
  100. package/dist/runtime-bun/index.mjs +1 -1
  101. package/dist/runtime-node/code-execution/index.d.mts +2 -2
  102. package/dist/runtime-node/extension-discovery.d.mts +1 -1
  103. package/dist/runtime-node/extension-validation.d.mts +1 -1
  104. package/dist/runtime-node/extension-validation.mjs +1 -1
  105. package/dist/runtime-node/index.d.mts +6 -6
  106. package/dist/runtime-node/index.mjs +24 -24
  107. package/dist/runtime-node/makaio-config.d.mts +1 -1
  108. package/dist/runtime-node/workflow-execution-bus-access.mjs +1 -1
  109. package/dist/runtime-node/workflow-worker/index.d.mts +2 -2
  110. package/dist/runtime-node/workflow-worker/index.mjs +1 -1
  111. package/dist/runtime-node/workflow-worker/worker-entry.d.mts +69 -9
  112. package/dist/runtime-node/workflow-worker/worker-entry.mjs +1 -1
  113. package/dist/schemas-CeHU889f.mjs +1 -0
  114. package/dist/{schemas-BCXvEWyF.d.mts → schemas-DqnA42bw.d.mts} +4 -4
  115. package/dist/{schemas-D7EeKBDJ.d.mts → schemas-DuJs6Iqj.d.mts} +4 -4
  116. package/dist/scoped-bus-DwVrmi_1.mjs +1 -0
  117. package/dist/services/adapter-runtime/index.d.mts +3 -3
  118. package/dist/services/adapter-runtime/namespace.d.mts +1 -1
  119. package/dist/services/adapter-runtime/schemas.d.mts +1 -1
  120. package/dist/services/adapter-subsystem/index.d.mts +3 -3
  121. package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
  122. package/dist/services/agent-runtime/index.d.mts +2 -2
  123. package/dist/services/agent-runtime/namespace.d.mts +1 -1
  124. package/dist/services/agent-runtime/schemas.d.mts +1 -1
  125. package/dist/services/capability/index.d.mts +2 -2
  126. package/dist/services/code-execution/index.d.mts +1 -1
  127. package/dist/services/codebase/index.d.mts +2 -2
  128. package/dist/services/codebase/namespace.d.mts +1 -1
  129. package/dist/services/codebase/schemas.d.mts +1 -1
  130. package/dist/services/compression/index.d.mts +2 -2
  131. package/dist/services/compression/namespace.d.mts +1 -1
  132. package/dist/services/compression/schemas.d.mts +1 -1
  133. package/dist/services/context-rules/index.d.mts +1 -1
  134. package/dist/services/execution-target/index.d.mts +3 -3
  135. package/dist/services/execution-target/index.mjs +1 -1
  136. package/dist/services/execution-target/namespace.d.mts +1 -1
  137. package/dist/services/execution-target/namespace.mjs +1 -1
  138. package/dist/services/execution-target/schemas.d.mts +1 -1
  139. package/dist/services/execution-target/schemas.mjs +1 -1
  140. package/dist/services/filesystem/index.d.mts +1 -1
  141. package/dist/services/filesystem/namespace.d.mts +6 -6
  142. package/dist/services/filesystem/schemas.d.mts +3 -3
  143. package/dist/services/index.d.mts +48 -46
  144. package/dist/services/index.mjs +1 -1
  145. package/dist/services/log-import/browser.d.mts +2 -2
  146. package/dist/services/log-import/index.d.mts +2 -2
  147. package/dist/services/log-import/log-import.d.mts +1 -1
  148. package/dist/services/materialization/index.d.mts +1 -1
  149. package/dist/services/model-registry/index.d.mts +1 -1
  150. package/dist/services/preferences/index.d.mts +2 -2
  151. package/dist/services/preferences/schemas.d.mts +1 -1
  152. package/dist/services/preferences/storage-namespace.d.mts +2 -2
  153. package/dist/services/provider-context/index.d.mts +1 -1
  154. package/dist/services/session/handlers/index.d.mts +1 -1
  155. package/dist/services/session/index.d.mts +9 -9
  156. package/dist/services/session/messages/namespace.d.mts +1 -1
  157. package/dist/services/session/orchestrator-testing/index.d.mts +1 -1
  158. package/dist/services/session/session-events/namespace.d.mts +1 -1
  159. package/dist/services/session/storage/namespace.d.mts +1 -1
  160. package/dist/services/session/storage/schema.d.mts +1 -1
  161. package/dist/services/session/testing/orchestrator-shared.d.mts +1 -1
  162. package/dist/services/session/turns/namespace.d.mts +1 -1
  163. package/dist/services/session-editor/index.d.mts +1 -1
  164. package/dist/services/settings/index.d.mts +3 -3
  165. package/dist/services/settings/namespace.d.mts +4 -4
  166. package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
  167. package/dist/services/settings/storage/index.d.mts +3 -3
  168. package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
  169. package/dist/services/subagent/index.d.mts +1 -1
  170. package/dist/services/subagent-template/index.d.mts +2 -2
  171. package/dist/services/subagent-template/namespace.d.mts +1 -1
  172. package/dist/services/subagent-template/schemas.d.mts +1 -1
  173. package/dist/services/tool-approval/index.d.mts +1 -1
  174. package/dist/services/tools/index.d.mts +1 -1
  175. package/dist/services/tray-menu/index.d.mts +3 -3
  176. package/dist/services/tray-menu/namespace.d.mts +1 -1
  177. package/dist/services/tray-menu/schemas.d.mts +1 -1
  178. package/dist/services/turn/index.d.mts +1 -1
  179. package/dist/services/turn/namespace.d.mts +1 -1
  180. package/dist/services/workflow-transitions/index.d.mts +1 -1
  181. package/dist/{src-BmSQ3rlz.mjs → src-DEgV239R.mjs} +1 -1
  182. package/dist/storage/drizzle/client.d.mts +1 -1
  183. package/dist/storage/drizzle/index.d.mts +1 -1
  184. package/dist/storage/handlers/drizzle/index.d.mts +1 -1
  185. package/dist/storage/handlers/index.d.mts +1 -1
  186. package/dist/{transition-D3zUBTPc.d.mts → transition-BB138WkK.d.mts} +2 -2
  187. package/dist/{types-DcxBYlPA.d.mts → types-CR23FzmK.d.mts} +3 -3
  188. package/dist/{types-CtDGkyLx2.d.mts → types-p55qvq922.d.mts} +1 -1
  189. package/dist/ui-kernel/index.d.mts +1 -1
  190. package/dist/ui-kernel/pages/schemas.d.mts +1 -1
  191. package/dist/{view-builder-B0j9p5C0.d.mts → view-builder-qIGQrZfs.d.mts} +1 -1
  192. package/dist/worker-DPTYFyNP.mjs +1 -0
  193. package/dist/workflow-engine/execution-attempt-repository.d.mts +2 -2
  194. package/dist/workflow-engine/execution-attempt-repository.mjs +1 -1
  195. package/dist/workflow-engine/index.d.mts +396 -177
  196. package/dist/workflow-engine/index.mjs +1 -1
  197. package/dist/workflow-engine/package.d.mts +1 -1
  198. package/dist/workflow-engine/package.mjs +1 -1
  199. package/dist/workflow-engine/provider-operation.d.mts +1 -1
  200. package/dist/workflow-engine/testing/conformance.d.mts +85 -0
  201. package/dist/workflow-engine/testing/conformance.mjs +1 -0
  202. package/dist/workflow-engine/testing/index.d.mts +63 -4
  203. package/dist/workflow-engine/testing/index.mjs +1 -1
  204. package/dist/workflow-engine/testing/sqlite.d.mts +1 -1
  205. package/dist/workflow-engine/testing/sqlite.mjs +136 -39
  206. package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
  207. package/dist/workflow-worker-BW3CE0YG.mjs +2 -0
  208. package/package.json +13 -1
  209. package/dist/attempt-record-codec-dC9LSFUE.mjs +0 -1
  210. package/dist/authority-state-bootstrap-eitx6Ukn.mjs +0 -1
  211. package/dist/await-trigger-Bkg2BQfg.mjs +0 -1
  212. package/dist/bus-D6NoBhIV.mjs +0 -2
  213. package/dist/bus-UgFdHybD.mjs +0 -1
  214. package/dist/package-Cgjpm9om.mjs +0 -7
  215. package/dist/schemas-TK29KWx-.mjs +0 -1
  216. package/dist/scoped-bus-DoPmCJeM.mjs +0 -1
  217. package/dist/worker-CARV52hT.mjs +0 -1
  218. package/dist/workflow-worker-Dul-wcOR.mjs +0 -1
  219. /package/dist/{adapter-binding-CATvmGuz.d.mts → adapter-binding-D68U_Hmh.d.mts} +0 -0
  220. /package/dist/{base-orchestrator-B4YW6z_Q.d.mts → base-orchestrator-DA95InJU.d.mts} +0 -0
  221. /package/dist/{capability-service-BW1-teFU.d.mts → capability-service-s4ZYSEWc.d.mts} +0 -0
  222. /package/dist/{client-binary-version-verifier-lcv83Hq3.d.mts → client-binary-version-verifier-kd9LP9AQ.d.mts} +0 -0
  223. /package/dist/{client-BG0WX5Vz.d.mts → client-f5A-6La5.d.mts} +0 -0
  224. /package/dist/{clients-namespace-DLAjOTTb.d.mts → clients-namespace-q4PqU1cA.d.mts} +0 -0
  225. /package/dist/{config-namespace-CH7sJZ4f.d.mts → config-namespace-Cp71zTT0.d.mts} +0 -0
  226. /package/dist/{create-static-mount-DxuixuLZ.mjs → create-static-mount-CmQgA0jq.mjs} +0 -0
  227. /package/dist/{definition-BrgzUuFk.d.mts → definition-BHSzhrUf.d.mts} +0 -0
  228. /package/dist/{extension-context-QmFuHdq5.d.mts → extension-context-BmU5XKjI.d.mts} +0 -0
  229. /package/dist/{extension-discovery-Dhu3WplO.d.mts → extension-discovery-DnO7bINK.d.mts} +0 -0
  230. /package/dist/{filesystem-service-ZJ43SbBi.d.mts → filesystem-service-BBArEDPL.d.mts} +0 -0
  231. /package/dist/{index-BC-6qNeo.d.mts → index-B-zl-O-Y.d.mts} +0 -0
  232. /package/dist/{index-BfV8U4XX.d.mts → index-BB0HypzC.d.mts} +0 -0
  233. /package/dist/{index-8y4hT9WL.d.mts → index-Bf2MgOni.d.mts} +0 -0
  234. /package/dist/{index-6trZYnUP2.d.mts → index-BhOMZWZa2.d.mts} +0 -0
  235. /package/dist/{index-BkbnC65b.d.mts → index-C-cnB1Te.d.mts} +0 -0
  236. /package/dist/{index-B4svZC6L.d.mts → index-C9xVZ-gt.d.mts} +0 -0
  237. /package/dist/{index-kzIjbrS02.d.mts → index-CDLf3Fka2.d.mts} +0 -0
  238. /package/dist/{index-jxPncqWZ2.d.mts → index-COOM1j_L2.d.mts} +0 -0
  239. /package/dist/{index-BuMsrli0.d.mts → index-CPWBGotQ.d.mts} +0 -0
  240. /package/dist/{index-pvX-BIpr2.d.mts → index-CcrXttC02.d.mts} +0 -0
  241. /package/dist/{index-B5dP8rj6.d.mts → index-CkpR5sIH.d.mts} +0 -0
  242. /package/dist/{index-CmbkCxj-.d.mts → index-Co1da7YK.d.mts} +0 -0
  243. /package/dist/{index-VzLAV0Yt.d.mts → index-CrcfeFOo.d.mts} +0 -0
  244. /package/dist/{index-BM56936c.d.mts → index-CsFN2nv7.d.mts} +0 -0
  245. /package/dist/{index-CVpaGijY.d.mts → index-D-JbTXIH.d.mts} +0 -0
  246. /package/dist/{index-B-3I98nw.d.mts → index-D6RMsZko.d.mts} +0 -0
  247. /package/dist/{index-l01zsChf.d.mts → index-D94yE5Dr.d.mts} +0 -0
  248. /package/dist/{index-D037TVsm.d.mts → index-DQD2-jcL.d.mts} +0 -0
  249. /package/dist/{index-D8D-yibS2.d.mts → index-DSLTgc7h2.d.mts} +0 -0
  250. /package/dist/{index-CL0Jo1b92.d.mts → index-DSN2t48K.d.mts} +0 -0
  251. /package/dist/{index-DQ8o3JGi.d.mts → index-DW4SE_sH.d.mts} +0 -0
  252. /package/dist/{index-DgspOUa72.d.mts → index-DYHxzwok2.d.mts} +0 -0
  253. /package/dist/{index-BMRB9yhF.d.mts → index-D_sMzTvv.d.mts} +0 -0
  254. /package/dist/{index-BFWvT0NG.d.mts → index-Df1c_2PF.d.mts} +0 -0
  255. /package/dist/{index-B2Y1Wvbh.d.mts → index-Dn_SGTgp.d.mts} +0 -0
  256. /package/dist/{index-C4V8Pmi4.d.mts → index-KAAnSRZt.d.mts} +0 -0
  257. /package/dist/{index-Ek4y8M9J2.d.mts → index-NhW2h2wH2.d.mts} +0 -0
  258. /package/dist/{index-CqdMbYmR.d.mts → index-mK-rgiit.d.mts} +0 -0
  259. /package/dist/{index-BTEJfzjE.d.mts → index-xaBSwHxJ.d.mts} +0 -0
  260. /package/dist/{json-value-DPqb-SJ8.d.mts → json-value-pX6xnLGw.d.mts} +0 -0
  261. /package/dist/{jsonl-transport-Cyyh5Wje.mjs → jsonl-transport-DQIlRX_y.mjs} +0 -0
  262. /package/dist/{lib-BqV8hYtk.mjs → lib-6eNAiNK7.mjs} +0 -0
  263. /package/dist/{namespace-DknCutQZ.d.mts → namespace-2qvc6E2Y.d.mts} +0 -0
  264. /package/dist/{namespace-DBO1OzYB.d.mts → namespace-9ychTEk_.d.mts} +0 -0
  265. /package/dist/{namespace-CVFaZv8x.d.mts → namespace-BGDq7HmW.d.mts} +0 -0
  266. /package/dist/{namespace-BUYDmd0r.d.mts → namespace-CPR2xem0.d.mts} +0 -0
  267. /package/dist/{namespace-CPG6u60N.d.mts → namespace-CQEYu8az.d.mts} +0 -0
  268. /package/dist/{namespace-DqZweTbX.d.mts → namespace-CVg_cpkh.d.mts} +0 -0
  269. /package/dist/{namespace-DOezqDti.d.mts → namespace-CirognbA.d.mts} +0 -0
  270. /package/dist/{namespace-l-HG1rLF.d.mts → namespace-Cs-cOyrn.d.mts} +0 -0
  271. /package/dist/{namespace-BNp7n_gu.d.mts → namespace-CxXNlHpn.d.mts} +0 -0
  272. /package/dist/{namespace-BdAK0lD8.d.mts → namespace-DAINF1II.d.mts} +0 -0
  273. /package/dist/{namespace-B0ftHlK3.d.mts → namespace-DG0hjPcx.d.mts} +0 -0
  274. /package/dist/{namespace-BRuHzhPo.d.mts → namespace-DokogwAZ.d.mts} +0 -0
  275. /package/dist/{namespace-BGRHcrmp.d.mts → namespace-DykqxEyX.d.mts} +0 -0
  276. /package/dist/{orchestrator-shared-CNHSImNY.d.mts → orchestrator-shared-BzqqcY2z.d.mts} +0 -0
  277. /package/dist/{packages-CxPMEg8D.d.mts → packages-Cx-BwSZr.d.mts} +0 -0
  278. /package/dist/{provider-operation-DbdyFwNm.d.mts → provider-operation-B2wQST6N.d.mts} +0 -0
  279. /package/dist/{providers-namespace-CfZKp-C0.d.mts → providers-namespace-DsKTnuO1.d.mts} +0 -0
  280. /package/dist/{schema-B3Pf7JP7.d.mts → schema-zSyY22Ck.d.mts} +0 -0
  281. /package/dist/{schemas-ChmQldVH.d.mts → schemas--LAbwXvw.d.mts} +0 -0
  282. /package/dist/{schemas-CF8QwRqt.d.mts → schemas-Bk50UoMA.d.mts} +0 -0
  283. /package/dist/{schemas-bfZNpl0B.d.mts → schemas-CHRuwe18.d.mts} +0 -0
  284. /package/dist/{schemas-D7ScxLrf.d.mts → schemas-ClGDFa44.d.mts} +0 -0
  285. /package/dist/{schemas-BGvkTiCx.d.mts → schemas-CzGN0eqW.d.mts} +0 -0
  286. /package/dist/{schemas-C1mxTfd7.d.mts → schemas-D0_kfoDf.d.mts} +0 -0
  287. /package/dist/{schemas-Pe892GgN.d.mts → schemas-DmULJ7Jk.d.mts} +0 -0
  288. /package/dist/{schemas-B50oWBuj.d.mts → schemas-Dn1JDTPw.d.mts} +0 -0
  289. /package/dist/{schemas-B6Q-qdmn.d.mts → schemas-Dxvjq-Bi.d.mts} +0 -0
  290. /package/dist/{server-lifecycle-L8zja8t8.d.mts → server-lifecycle-WFZcCMwF.d.mts} +0 -0
  291. /package/dist/{session-lineage-bUkd3fqx.d.mts → session-lineage-C9kppcCa.d.mts} +0 -0
  292. /package/dist/{src-BacfeiI4.mjs → src-DIyWekjW.mjs} +0 -0
  293. /package/dist/{storage-namespace-YmE8XCCL.d.mts → storage-namespace-BWU-8rvj.d.mts} +0 -0
  294. /package/dist/{storage-namespace-definition-BsnYAPot.d.mts → storage-namespace-definition-B-8JKvzm.d.mts} +0 -0
  295. /package/dist/{types-DdpSEmTO.d.mts → types-8rMNe3AS.d.mts} +0 -0
  296. /package/dist/{types-DnK6Wa_Y.d.mts → types-BFeWU3WM.d.mts} +0 -0
  297. /package/dist/{types-tyv0B605.d.mts → types-BnPJa-C_.d.mts} +0 -0
  298. /package/dist/{types-OKJCOjme.d.mts → types-DQTCNM2i.d.mts} +0 -0
  299. /package/dist/{types-BlB23n4f.d.mts → types-DxHeL0pF.d.mts} +0 -0
  300. /package/dist/{window-registry-Pcf35cac.d.mts → window-registry-DQP5P2_0.d.mts} +0 -0
@@ -1 +0,0 @@
1
- import{z as e}from"zod";import{AdapterAuthConstantSchema as t,AuthEnvironmentVariableNameSchema as n,AuthMethodRefSchema as r}from"@makaio/framework/contracts/auth";const i=[`MAKAIO_GIT_TOKEN`,`MAKAIO_BUS_AUTH_SECRET`],a=t,o=e.object({machineId:e.string().trim().min(1),packageNames:e.array(e.string().trim().min(1)).min(1).refine(e=>new Set(e).size===e.length,{message:`Session runtime package names must be unique.`}).readonly()}).strict().readonly(),s=e.object({sessionId:e.string().trim().min(1),adapterName:e.string().trim().min(1),providerConfigId:e.string().trim().min(1),definitionId:e.string().trim().min(1),runtime:o,auth:e.object({mode:e.enum([`explicit`,`none`]),method:r}).strict().readonly()}).strict().superRefine((t,n)=>{t.auth.method.owner===`provider`&&t.auth.method.providerDefinitionId!==t.definitionId&&n.addIssue({code:e.ZodIssueCode.custom,message:`Provider-owned auth method must belong to the selected provider definition.`,path:[`auth`,`method`,`providerDefinitionId`]})}).readonly(),c=e.object({target:e.string().trim().min(1),values:e.record(e.string().trim().min(1),a).readonly()}).strict().readonly(),l=e.object({selector:s,scrubEnvVars:e.array(n).readonly(),processEnv:e.record(n,e.string()).readonly(),connectorDeliveries:e.array(c).readonly()}).strict().superRefine((t,n)=>{let r=new Set;for(let[i,a]of t.scrubEnvVars.entries())r.has(a)&&n.addIssue({code:e.ZodIssueCode.custom,message:`Duplicate scrub environment variable "${a}".`,path:[`scrubEnvVars`,i]}),r.add(a);for(let i of Object.keys(t.processEnv))r.has(i)||n.addIssue({code:e.ZodIssueCode.custom,message:`Every process-environment auth delivery must also belong to the scrub set.`,path:[`processEnv`,i]});let i=new Set;for(let[r,a]of t.connectorDeliveries.entries())i.has(a.target)&&n.addIssue({code:e.ZodIssueCode.custom,message:`Duplicate connector auth target "${a.target}".`,path:[`connectorDeliveries`,r,`target`]}),i.add(a.target)}).readonly(),u=e.object({busAuthSecret:e.string().optional(),gitToken:e.string().optional(),runtimeEnv:e.record(n,e.string()).optional(),sessionRuntime:o.optional(),adapterAuth:l.optional()}).strict(),d=e.enum([`simple`,`full`]),f=e.enum([`created`,`running`,`stopped`,`destroyed`]),p=e.object({sessionId:e.string(),adapter:e.string(),runtime:d.default(`simple`),image:e.string().optional()}).strict(),m=new Set([`git:`,`http:`,`https:`,`ssh:`]),h=/^git@[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?:[^\s?#]+$/;function g(e,t,n){let r=e.indexOf(`://`);if(e.length===0||e.trim()!==e||r<=0||e.includes(`?`)||e.includes(`#`))return!1;try{let i=new URL(e);if(!t.has(i.protocol)||i.hostname.length===0||i.password.length>0||i.search.length>0||i.hash.length>0)return!1;let a=(e.slice(r+3).split(`/`,1)[0]??``).includes(`@`);return n?!a||i.username.length>0:!a&&i.username.length===0}catch{return!1}}function _(e){if(h.test(e))return!0;try{let t=new URL(e).protocol;return g(e,m,t===`ssh:`)}catch{return!1}}const v=e.string().refine(_,{message:`Repository remote must use a supported credential-free Git URL.`}),y=p.extend({mode:e.literal(`container-local`),repoPath:e.string(),baseBranch:e.string()}).strict(),b=y,x=y.extend({executionId:e.string(),executionAttemptId:e.string()}).strict(),S=e.union([b,x]),C=p.extend({mode:e.literal(`container-isolated`),repoUrl:v,branch:e.string().optional()}).strict(),w=e.union([S,C]),T=e.object({descriptor:w,bootstrapConfig:u}).strict().superRefine((t,n)=>{let r=t.bootstrapConfig.adapterAuth?.selector;if(r===void 0)return;r.sessionId!==t.descriptor.sessionId&&n.addIssue({code:e.ZodIssueCode.custom,message:`Container auth selector session must match the Docker descriptor.`,path:[`bootstrapConfig`,`adapterAuth`,`selector`,`sessionId`]}),r.adapterName!==t.descriptor.adapter&&n.addIssue({code:e.ZodIssueCode.custom,message:`Container auth selector adapter must match the Docker descriptor.`,path:[`bootstrapConfig`,`adapterAuth`,`selector`,`adapterName`]});let i=t.bootstrapConfig.sessionRuntime;if(i===void 0){n.addIssue({code:e.ZodIssueCode.custom,message:`Container auth selector requires a session runtime binding.`,path:[`bootstrapConfig`,`sessionRuntime`]});return}r.runtime.machineId!==i.machineId&&n.addIssue({code:e.ZodIssueCode.custom,message:`Container auth selector machine must match the session runtime.`,path:[`bootstrapConfig`,`adapterAuth`,`selector`,`runtime`,`machineId`]}),(r.runtime.packageNames.length!==i.packageNames.length||r.runtime.packageNames.some((e,t)=>e!==i.packageNames[t]))&&n.addIssue({code:e.ZodIssueCode.custom,message:`Container auth selector packages must exactly match the session runtime selection.`,path:[`bootstrapConfig`,`adapterAuth`,`selector`,`runtime`,`packageNames`]})}).readonly(),E=e.object({containerId:e.string(),worktreePath:e.string().optional(),worktreeBranch:e.string().optional()}),D=e.object({containerId:e.string(),deleteBranch:e.boolean().default(!1)}),O=e.object({success:e.boolean()}),k=e.object({containerId:e.string()}),A=e.object({state:f,sessionId:e.string(),worktreePath:e.string().optional()}),j=e.object({containerId:e.string(),sessionId:e.string(),worktreePath:e.string().optional()}),M=e.object({containerId:e.string(),sessionId:e.string(),worktreePath:e.string().optional()}),N=e.object({containerId:e.string(),sessionId:e.string(),exitCode:e.number()}),P=e.object({containerId:e.string(),sessionId:e.string()}),F=e.object({id:e.string(),name:e.string(),description:e.string().optional(),scope:e.string(),enabled:e.boolean(),createdAt:e.number(),updatedAt:e.number()}),I=F.extend({type:e.literal(`local`)}),L=F.extend({type:e.literal(`container-local`),image:e.string().optional(),env:e.record(e.string(),e.string()).optional(),busUrl:e.string().optional()}),R=F.extend({type:e.literal(`container-isolated`),image:e.string().optional(),env:e.record(e.string(),e.string()).optional(),gitCredentialMode:e.enum([`token`,`ssh-agent`]).default(`token`),repoUrl:v.optional()}),z=e.discriminatedUnion(`type`,[I,L,R]),B=e.enum([`local`,`container-local`,`container-isolated`]),V=e.discriminatedUnion(`type`,[I.omit({createdAt:!0,updatedAt:!0}),L.omit({createdAt:!0,updatedAt:!0}),R.omit({createdAt:!0,updatedAt:!0})]),H=e.object({scope:e.string().optional(),type:B.optional()}),U=e.object({executionTargetId:e.string().optional()}),W={get:{request:e.object({id:e.string()}),response:e.object({executionTarget:z.nullable()})},set:{request:e.object({executionTarget:V}),response:e.object({id:e.string()})},delete:{request:e.object({id:e.string()}),response:e.object({deleted:e.boolean()})},list:{request:H,response:e.object({executionTargets:e.array(z)})},resolve:{request:U,response:e.object({executionTarget:z})},created:z,updated:z,deleted:e.object({id:e.string()})};export{k as A,o as C,v as D,N as E,D as M,O as N,w as O,d as S,f as T,j as _,U as a,S as b,B as c,l as d,s as f,a as g,c as h,H as i,A as j,E as k,I as l,T as m,L as n,z as o,u as p,V as r,W as s,R as t,i as u,P as v,M as w,x,C as y};
@@ -1 +0,0 @@
1
- import{s as e}from"./bus-D6NoBhIV.mjs";export{e as createScopedBus};
@@ -1 +0,0 @@
1
- import{n as e}from"./json-value-BBZ6uGwc.mjs";import{A as t,_ as n,x as r}from"./worker-CLsRbzpk.mjs";import{G as i,H as a,V as o}from"./workflow-BomH9DBB.mjs";import{z as s}from"zod";import{createBusNamespace as c}from"@makaio/framework/core";const l=s.object({executionAttemptId:s.string().min(1),executionId:s.string().min(1),environment:s.string().min(1),metadata:e.optional()}),u=s.object({executionAttemptId:s.string().min(1),config:i,manifest:o.optional(),requirements:t.optional(),metadata:e.optional()}),d=s.object({executionAttemptId:s.string().min(1),allocationRef:r}).strict(),f={dispatch:{request:u,response:d},"control.attempt-ready":s.object({executionAttemptId:s.string().min(1),executionId:s.string().min(1),adapters:s.array(s.string().min(1)).default([])}).strict(),"control.outcome.submit":{request:s.object({executionAttemptId:s.string().min(1),executionId:s.string().min(1),result:a}).strict().superRefine((e,t)=>{e.result.executionId!==e.executionId&&t.addIssue({code:s.ZodIssueCode.custom,path:[`result`,`executionId`],message:`result.executionId must match executionId`})}),response:s.object({decision:n}).strict()},"control.bootstrap.claim":{request:s.object({executionId:s.string().min(1),executionAttemptId:s.string().min(1)}).strict(),response:s.object({busUrl:s.string().min(1),busAuthSecret:s.string().min(1)}).strict()},"lifecycle.provisioning":l,"lifecycle.booting":l,"lifecycle.ready":l.extend({adapters:s.array(s.string().min(1)).default([])}),"lifecycle.busy":l,"lifecycle.completed":l,"lifecycle.failed":l.extend({error:s.string().min(1)}),"lifecycle.terminated":l.extend({reason:s.string().optional()}),"lifecycle.paused":l.extend({pausedAtGateId:s.string().min(1),pausedAtFrameId:s.string().min(1)})},p=`worker-bootstrap`,m=c(`worker`,f),h=m.subjects;export{d as a,u as i,m as n,f as o,h as r,p as t};
@@ -1 +0,0 @@
1
- import{resolveMakaioHome as e}from"./runtime-node/makaio-config.mjs";import{t}from"./extension-package-provenance-aYrZuS4W.mjs";import{n,o as r,t as i}from"./await-trigger-Bkg2BQfg.mjs";import*as a from"node:fs/promises";import{access as o}from"node:fs/promises";import*as s from"node:path";import{basename as c,join as l}from"node:path";import*as u from"node:crypto";import{constants as d}from"node:fs";import{createBusInstance as f,waitForSubscriptionPropagation as p}from"@makaio/framework/bus";import{AdapterSubjects as m,BoundedRecoveryEvidenceSchema as h,FrameworkContractNamespaces as g,FrameworkStorageNamespaces as _,PROVIDER_ALLOCATION_REF_VERSION as ee,ProviderAllocationRefSchema as te,RECOVERY_EVIDENCE_LIMITS as v,WorkerCapabilitiesSchema as ne,WorkerSubjects as y,WorkflowSubjects as re,WorkflowWorkerConfigSchema as ie,createWorkflowCancelSubject as ae}from"@makaio/framework/contracts";import{ExtensionCoordinator as oe,KernelSubjects as se,coalesceExtensionOverrides as ce,filterEligibleExtensions as le}from"@makaio/framework/kernel";import{BaseService as ue}from"@makaio/framework/service-base";import{AdapterRuntimeSubjects as de,registerAdapterRuntimeIdentityHandlers as fe}from"@makaio/framework/services/adapter-runtime";import{CLIDetectionNamespace as pe,CLIDetectionSubjects as me}from"@makaio/framework/services/cli-detection/namespace";import{SessionOrchestratorToken as he,ToolRegistryToken as ge,canonicalModelPackage as _e,createSubagentServicePackage as ve,createToolContributionProcessor as ye,frameworkCorePackages as b,sessionBridgePackage as be,sessionOrchestratorPackage as xe,sessionPackage as Se,sessionStoragePackage as Ce,toolRegistryPackage as we}from"@makaio/framework/services";import{AdapterSubsystemSubjects as x}from"@makaio/framework/services/adapter-subsystem";import{createClientsCorePackage as Te}from"@makaio/framework/clients";import{AdapterSubsystemToken as S,createAdapterSubsystemContributionProcessor as Ee,createAdapterSubsystemPackage as De,orderAfterAdapterSubsystem as Oe}from"@makaio/framework/adapter-subsystem";import{execa as ke}from"execa";import Ae from"piscina";import{ExecutionAttemptAuthority as je,runAuthorityDispatchedAttempt as Me}from"@makaio/framework/workflow-engine";import{runWorkflowOrchestrator as Ne}from"@makaio/framework/workflow-engine/workflow-orchestrator";function C(e){return e.on(m.getCapabilities,async t=>{let{adapterName:n,adapterId:r}=t.payload;if(r){await t.next();return}if(n){let r=await e.requestOptional(de.resolveId,{adapterName:n}),i=r.handled?r.data.adapterId:void 0;i&&(t.payload.adapterId=i)}await t.next()},{priority:20})}function w(e){let{coordinator:t,configRepository:n,platformDefaults:r,prepareAuthRuntime:i,runtimeSnapshotHandlerPriority:a,runtimeDefinitionHandlerPriority:o}=e,s=De({configRepository:n,coordinator:t,platformDefaults:r,...i!==void 0&&{prepareAuthRuntime:i},...a!==void 0&&{runtimeSnapshotHandlerPriority:a},...o!==void 0&&{runtimeDefinitionHandlerPriority:o}});return t.registerContributionProcessor(Ee({getAdapterSubsystemService:()=>t.getExtensionService(S)})),{adapterSubsystemPackage:s}}function T(e){let{bus:t,currentMachineId:n}=e,r=fe(t,{currentMachineId:n,listKnownAdapterNames:e.listKnownAdapterNames??(async()=>{let{configs:e}=await t.request(x.listAdapterConfigs,{});return e.map(e=>e.name)}),...e.resolveLiveAdapterId!==void 0&&{resolveLiveAdapterId:e.resolveLiveAdapterId},...e.resolveLiveAdapterIdentity!==void 0&&{resolveLiveAdapterIdentity:e.resolveLiveAdapterIdentity},...e.listLiveAdapterIdentities!==void 0&&{listLiveAdapterIdentities:e.listLiveAdapterIdentities}}),i=C(t);return{cleanup:()=>{r.cleanup(),i()}}}function E(e,t){if(!(e instanceof Error))return!1;let{rootPackageName:n,subpath:r}=Pe(t),i=(r===void 0?[t]:[t,n]).flatMap(e=>[`Cannot find package '${e}'`,`Cannot find module '${e}'`,`Cannot find package "${e}"`,`Cannot find module "${e}"`]),a=e;return(a.code===`ERR_MODULE_NOT_FOUND`||a.code===`MODULE_NOT_FOUND`)&&i.some(t=>e.message.includes(t))||a.code===`ERR_PACKAGE_PATH_NOT_EXPORTED`&&r!==void 0&&e.message.includes(`Package subpath '${r}' is not defined by "exports"`)&&Fe(e.message,n)?!0:i.some(t=>e.message.includes(t))}async function D(e){try{return await import(e)}catch(t){if(E(t,e))return null;throw t}}function Pe(e){let t=e.split(`/`);return e.startsWith(`@`)?{rootPackageName:t.slice(0,2).join(`/`),subpath:t.length>2?`./${t.slice(2).join(`/`)}`:void 0}:{rootPackageName:t[0]??e,subpath:t.length>1?`./${t.slice(1).join(`/`)}`:void 0}}function Fe(e,t){let n=t,r=t.replaceAll(`/`,`\\`);return e.includes(`/${n}/package.json`)||e.includes(`\\${r}\\package.json`)}async function O(e,t=process.env,n=process.platform){let r=t[Object.keys(t).find(e=>e.toUpperCase()===`PATH`)??`PATH`]??``,i=(t.PATHEXT??`.EXE;.CMD;.BAT;.COM`).split(`;`).filter(Boolean),a=n===`win32`?s.extname(e)===``?i:[``,...i]:[``];for(let t of r.split(s.delimiter)){let n=t.replace(/^"|"$/gu,``),r=s.resolve(n||process.cwd());for(let t of a){let n=s.join(r,`${e}${t}`);try{return await o(n,d.X_OK),n}catch{}}}}async function k(e,t=5e3,n=1e3){let{stdout:r}=await ke(e,[`--version`],{forceKillAfterDelay:n,timeout:t});return r}function Ie(e){return e.match(/(\d+\.\d+\.\d+)/u)?.[1]??`unknown`}async function Le(e,t=O,n=k){try{let r=await t(e);if(r===void 0)return{binary:e,found:!1};let i=await n(r);return i.length===0?{binary:e,found:!1}:{binary:e,found:!0,path:r,version:Ie(i)}}catch{return{binary:e,found:!1}}}async function Re(e,t=O,n=k){return Promise.all(e.map(e=>Le(e,t,n)))}var ze=class extends ue{constructor(e){super(e)}onInit(){this.registerHandler(me.scan,async e=>{let t=await Re(e.payload.binaries);e.setResult({results:t})})}};const A={name:`makaio.cli-detection`,displayName:`CLI Detection`,version:`0.1.0`,critical:!0,surface:`any`,namespaces:[pe],create:e=>new ze(e.bus)};function j(e,t){e.push(...Be(t))}function Be(e){return e===void 0?[]:typeof e==`function`?[e]:[...e]}function Ve(e,t=[]){let n=new Set([e]),r=new Set,i=new Map;for(let e of t)typeof e==`string`?n.add(e):(r.add(e.id),e.version!==void 0&&i.set(e.id,e.version));return{hosts:n,capabilities:r,...i.size>0?{capabilityVersions:i}:{}}}function He(e=[]){return e.some(e=>typeof e==`string`&&e===`node`)?e:[`node`,...e]}function M(e){return ce(le(We(e.packages,e.configProvider),e.surface,e.runtimeEnvironment))}function Ue(e,n){let r=M(n),i=new Set(r.map(t));return e.filter(({ownerPackage:e})=>i.has(e)).map(({package:e})=>e)}function We(e,t){return t?e.filter(e=>t.loadEnabled(e.name)!==!1):e}function N(e,t){return e.filter(e=>e.runtimeOwnership?.[t]===!0).map(e=>e.name)}function Ge(e,t){let n=N(e,t);if(n.length>1)throw Error(`Multiple extensions own runtimeOwnership.${t}: ${n.join(`, `)}`)}function P(e){return Ge(e,`sessionOrchestrator`),N(e,`sessionOrchestrator`).length===0}function Ke(e){return e===!0||P(e)?b:b.filter(e=>e.name!==he.name)}function F(e,t,n){let r=[];try{for(let i of e){let e=i.runtimeBoot;e&&j(r,e.configure({bus:t,registerContributionProcessor:e=>{r.push(n.registerContributionProcessor(e))},forEachActiveExtension:e=>{n.forEachActiveExtension(e)}}))}}catch(e){let t=[];for(let e of[...r].reverse())try{e()}catch(e){t.push(e)}throw t.length>0?AggregateError([e,...t],`Extension boot contribution failed and rollback cleanup reported additional errors`,{cause:e}):e}return r}function qe(){let e=process.env.MAKAIO_SKIP_EXTENSIONS;if(!e)return new Set;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(t)}var Je=class{pool;constructor(e){this.pool=new Ae({filename:e.workerEntry,maxThreads:e.maxConcurrency??4,idleTimeout:e.idleTimeoutMs??3e4})}async run(e,t){return this.pool.run(e,{signal:t})}onMessage(e){return this.pool.on(`message`,e),()=>this.pool.off(`message`,e)}async dispose(){await this.pool.destroy()}},I=class extends Error{code;constructor(e,t){super(e),this.code=t,this.name=`MaterializationError`}};function L(e,t,n){let r=s.resolve(t)+s.sep,i=s.resolve(e);if(i!==s.resolve(t)&&!i.startsWith(r))throw new I(`${n} escapes allowed root: ${e} is not within ${t}`,`containment-violation`)}async function R(e,t,n,r){let i=r??await a.realpath(t),o;try{o=await a.realpath(e)}catch{return e}let c=i+s.sep;if(o!==i&&!o.startsWith(c))throw new I(`${n} escapes allowed root via symlink: real path ${o} is not within ${i}`,`symlink-escape`);return o}function z(e){let t=e.indexOf(`-`);if(t===-1)throw new I(`Invalid SRI integrity format: ${e}`,`contribution-integrity-mismatch`);return{algorithm:e.slice(0,t),digest:e.slice(t+1)}}async function Ye(e,t){let n=await a.readFile(e);return u.createHash(t).update(n).digest(`base64`)}const B=new Set([`.git`,`node_modules`]);function Xe(e){return B.has(e.toLowerCase())}async function Ze(e,t){let n=t.toLowerCase();if(!B.has(n))return!1;if(t===n)return!0;try{let[r,i]=await Promise.all([a.lstat(s.join(e,t)),a.lstat(s.join(e,n))]);return r.dev===i.dev&&r.ino===i.ino}catch(e){if(e.code===`ENOENT`)return!1;throw e}}const Qe=B,$e=new Set([`.DS_Store`]);async function V(e,t){let n=u.createHash(t),r=[];async function i(t){let n=await a.readdir(t,{withFileTypes:!0});for(let a of n){let n=s.join(t,a.name);if(a.isSymbolicLink())throw new I(`Contribution package contains a symbolic link: ${s.relative(e,n)}`,`symlink-escape`);if(a.isDirectory()){Qe.has(a.name)||await i(n);continue}if(a.isFile()){$e.has(a.name)||r.push(s.relative(e,n));continue}throw new I(`Contribution package contains an unsupported filesystem entry: ${s.relative(e,n)}`,`contribution-integrity-mismatch`)}}await i(e),r.sort();for(let t of r)n.update(t.split(s.sep).join(`/`)),n.update(`\0`),n.update(await a.readFile(s.join(e,t))),n.update(`\0`);return`${t}-${n.digest(`base64`)}`}async function H(e,t=`sha256`){let n=u.createHash(t),r=[];async function i(t){let n=await a.readdir(t,{withFileTypes:!0});for(let a of n){let n=s.join(t,a.name);if(!await Ze(t,a.name)){if(a.isDirectory()){await i(n);continue}if(a.isFile()){r.push(s.relative(e,n));continue}throw a.isSymbolicLink()?new I(`Workspace root contains a symbolic link: ${s.relative(e,n)}`,`symlink-escape`):new I(`Workspace root contains an unsupported filesystem entry: ${s.relative(e,n)}`,`unsupported-filesystem-entry`)}}}await i(e),r.sort();for(let t of r){n.update(t),n.update(`\0`);let r=await a.readFile(s.join(e,t));n.update(r),n.update(`\0`)}return`${t}-${n.digest(`base64`)}`}async function U(e,t,n){let r=s.join(t,`node_modules`,e.packageName);L(r,t,`Contribution package directory`),await R(r,t,`Contribution package directory`,n);let i=s.join(r,`package.json`),o;try{o=await a.readFile(i,`utf-8`)}catch{throw new I(`Contribution package not found: ${e.packageName} (expected at ${r})`,`contribution-missing`)}let c=JSON.parse(o);if(c.name!==e.packageName)throw new I(`Contribution identity mismatch: expected ${e.packageName}, found ${c.name??`<none>`}`,`contribution-missing`);if(c.version!==e.version)throw new I(`Contribution version mismatch for ${e.packageName}: expected ${e.version}, found ${c.version??`<none>`}`,`contribution-version-mismatch`);let l=s.join(r,e.entrypoint);L(l,r,`Contribution entrypoint`),await R(l,t,`Contribution entrypoint`,n);try{await a.access(l)}catch{throw new I(`Contribution entrypoint not found for ${e.packageName}: ${e.entrypoint}`,`contribution-entrypoint-mismatch`)}let{algorithm:u}=z(e.integrity),d;try{d=await V(r,u)}catch(t){if(t instanceof I)throw t;let n=typeof t==`object`&&t&&`code`in t&&typeof t.code==`string`?t.code:void 0;throw n!==void 0&&!n.startsWith(`ERR_`)?new I(`Contribution package cannot be read for ${e.packageName}`,`contribution-entrypoint-mismatch`):t}if(d!==e.integrity)throw new I(`Contribution integrity mismatch for ${e.packageName}: expected ${e.integrity}, computed ${d}`,`contribution-integrity-mismatch`);return l}async function W(e,t,n){let r=await n.resolveWorkspaceRoot(e.workspaceId);if(r===void 0)throw new I(`Unknown workspace ID: ${e.workspaceId}`,`unknown-workspace`);try{if(!(await a.stat(r)).isDirectory())throw new I(`Workspace root is not a directory: ${r}`,`containment-violation`)}catch(e){throw e instanceof I?e:new I(`Workspace root does not exist: ${r}`,`containment-violation`)}let i=await a.realpath(r),o=s.resolve(r,e.sourcePath);if(L(o,r,`Source path`),s.relative(r,o).split(s.sep).some(Xe))throw new I(`Workflow source path selects excluded workspace content: ${e.sourcePath}`,`source-path-mismatch`);await R(o,r,`Source path`,i);let c=await H(r);if(c!==e.rootDigest)throw new I(`Workspace root digest mismatch: expected ${e.rootDigest}, computed ${c}`,`digest-mismatch`);try{await a.access(o)}catch{throw new I(`Workflow source file not found: ${o}`,`source-missing`)}return{workspaceRoot:r,sourcePath:o,contributionEntrypoints:await Promise.all(t.map(e=>U(e,r,i))),platform:process.platform,arch:process.arch}}var G=class{options;manifest;pool;constructor(e){this.options=e,this.manifest=e.manifest}async run(e,t,n){this.pool??=new Je(this.options);let r=n??this.manifest,i=await this.materializeTask(e,r,t);return{state:`uncommitted`,result:await this.pool.run(i,t)}}runWithReadiness(e,t,n){this.pool??=new Je(this.options);let i=this.pool,a,o=!1,s,c=new Promise((t,n)=>{s=n,a=i.onMessage(n=>{r(n)&&(n.executionId!==e.executionId||n.cancelSubject!==e.cancelSubject||(o=!0,a?.(),t(n)))})}),l=n??this.manifest,u=this.materializeTask(e,l,t).then(e=>i.run(e,t));return u.then(()=>{o||(o=!0,a?.(),s(Error(`Workflow worker completed before ready signal: ${e.executionId}`)))},e=>{o||(o=!0,a?.(),s(e instanceof Error?e:Error(String(e))))}),{result:u,ready:c}}async dispose(){await this.pool?.dispose()}async materializeTask(e,t,n){if(n.throwIfAborted(),!(e.source.kind===`path`||t.contributionRefs.length>0))return{config:e,manifest:t,contributionEntrypoints:[]};let r=e.materializationSpec;if(r?.kind!==`local-directory`)throw Error(`ThinWorkflowPiscinaRunner requires a local-directory materialization spec for path-backed workflows or declared contributions.`);if(this.options.resolveWorkspaceRoot===void 0)throw Error(`ThinWorkflowPiscinaRunner requires a host workspace-root resolver for local-directory materialization.`);let i=await W(r,t.contributionRefs,{resolveWorkspaceRoot:this.options.resolveWorkspaceRoot});if(n.throwIfAborted(),e.source.kind!==`path`)throw Error(`local-directory materialization requires a path-backed workflow source.`);return{config:{...e,source:{kind:`path`,path:i.sourcePath}},manifest:t,contributionEntrypoints:i.contributionEntrypoints}}};function K(e){return e.mode===`source`?l(e.moduleDir,`workflow-worker`,`worker-entry.ts`):l(e.moduleDir,`workflow-worker`,`worker-entry.mjs`)}var q=class{options;constructor(e){this.options=e}async run(e,t,n,r){let i={...e,terminalAuthority:`authority`},a=n??this.options.manifest,o=this.options.requirements,s=r?.dispatchMetadata;return{state:`authority-committed`,result:await Me({authority:this.options.authority,executionId:e.executionId,dispatch:e=>this.options.dispatch({executionAttemptId:e,config:i,...a!==void 0&&{manifest:a},...o!==void 0&&{requirements:o},...s!==void 0&&{metadata:s}},t)})}}},J=class{#e;constructor(e){this.#e=e.bus}async run(e,t,r){let a=ie.parse(e),o=await n(a);return{state:`uncommitted`,result:await Ne({config:await i(a,o,this.#e,t),loaded:o,bus:this.#e,signal:t})}}};function et(){return{contributionRefs:[]}}function tt(e){if(e.workflowRunner?.mode===`worker`&&!e.executionAttemptRepository)throw Error(`Worker dispatch mode requires an ExecutionAttemptRepository. Pass 'executionAttemptRepository' to createNodeWorkflowRunnerPackageOptions when workflowRunner.mode is 'worker'.`);let t=e.executionAttemptRepository?new je(e.executionAttemptRepository):void 0,n=c(e.runtimeModuleDir)===`src`?`source`:`dist`,r=Y({moduleDir:e.runtimeModuleDir,defaultWorkerEntryMode:n,runner:e.workflowRunner,bus:e.bus,authority:t});return{...r!==void 0&&{workflowRunner:r},executorConfig:{busUrl:e.busUrl,busAuth:{kind:`none`},platformDefaults:e.platformDefaults,makaioHome:e.makaioHome},...e.executionAttemptRepository!==void 0&&{executionAttemptRepository:e.executionAttemptRepository},...t!==void 0&&{executionAttemptAuthority:t},...e.workflowMaterializationSpecResolvers!==void 0&&{workflowMaterializationSpecResolvers:e.workflowMaterializationSpecResolvers}}}function Y(e){let{runner:t}=e;if(t)switch(t.mode){case void 0:case`in-process`:if(e.bus===void 0)throw Error(`InProcessWorkflowRunner requires a bus instance. Pass 'bus' to createNodeWorkflowRunner when runner.mode is 'in-process'.`);return new J({bus:e.bus});case`worker`:{if(e.authority===void 0)throw Error(`WorkerRunner requires an ExecutionAttemptAuthority. Pass 'authority' to createNodeWorkflowRunner when runner.mode is 'worker'.`);let n=e.bus,r=t.dispatch??(n===void 0?void 0:(e,t)=>n.request(y.dispatch,{executionAttemptId:e.executionAttemptId,config:e.config,manifest:e.manifest,requirements:e.requirements,metadata:e.metadata},{signal:t}));if(r===void 0)throw Error(`WorkerRunner requires either a dispatch function or a bus instance. Pass 'bus' to createNodeWorkflowRunner when runner.mode is 'worker'.`);return new q({dispatch:r,authority:e.authority,...t.manifest!==void 0&&{manifest:t.manifest},...t.requirements!==void 0&&{requirements:t.requirements}})}case`piscina`:return new G({workerEntry:t.workerEntry??K({moduleDir:e.moduleDir,mode:t.workerEntryMode??e.defaultWorkerEntryMode}),manifest:t.manifest??et(),...t.resolveWorkspaceRoot!==void 0&&{resolveWorkspaceRoot:t.resolveWorkspaceRoot},maxConcurrency:t.maxConcurrency,idleTimeoutMs:t.idleTimeoutMs})}}const nt=new Set([`accepted`,`duplicate`]);var X=class extends Error{decision;result;reason;constructor(e,t,n=`authority-rejected`){super(`Outcome delivery ${n===`deadline-exceeded`?`deadline exceeded`:`rejected by Authority`} (decision=${e}, executionId=${t.executionId}, status=${t.status})`),this.decision=e,this.result=t,this.reason=n,this.name=`OutcomeDeliveryError`}};function Z(e){return new X(`deadline-exceeded`,e,`deadline-exceeded`)}function rt(e){let t={maxRetries:e?.maxRetries??7,baseDelayMs:e?.baseDelayMs??1e3,maxDelayMs:e?.maxDelayMs??3e4,deadlineMs:e?.deadlineMs??12e4};if(!Number.isSafeInteger(t.maxRetries)||t.maxRetries<0)throw TypeError(`Outcome submission maxRetries must be a non-negative safe integer, got ${t.maxRetries}`);for(let[e,n]of Object.entries({baseDelayMs:t.baseDelayMs,maxDelayMs:t.maxDelayMs,deadlineMs:t.deadlineMs}))if(!Number.isFinite(n)||n<=0)throw TypeError(`Outcome submission ${e} must be a positive finite number, got ${n}`);return t}async function it(e,t,n,r){let i=t.baseDelayMs*2**(e-1),a=n-Date.now(),o=Math.min(i,t.maxDelayMs,a);await new Promise(e=>setTimeout(e,o));let s=n-Date.now();if(s<=0)return!1;if(r!==void 0){let e;try{await Promise.race([r(),new Promise(t=>{e=setTimeout(t,s)})])}catch{}finally{e!==void 0&&clearTimeout(e)}}return Date.now()<n}async function Q(e,t,n){let r=rt(n?.retry),i=n?.reconnect,a=Date.now()+r.deadlineMs,o;for(let n=0;n<=r.maxRetries;n++){if(a-Date.now()<=0||n>0&&!await it(n,r,a,i))throw Z(t.result);try{let n=a-Date.now();if(n<=0)throw Z(t.result);let{decision:r}=await e.request(y.control.outcome.submit,{executionAttemptId:t.executionAttemptId,executionId:t.executionId,result:t.result},{timeout:n});if(nt.has(r))return r;throw new X(r,t.result)}catch(e){if(e instanceof X)throw e;if(o=e,Date.now()>=a)throw Z(t.result)}}throw o??Z(t.result)}const at={maxRetries:3,baseDelayMs:200,maxDelayMs:2e3,deadlineMs:1e4},ot={persistentStorage:!0,customCapabilities:[`workflow.local-runtime`,`workflow.thin-runner`],suspensionStrategy:`wait-in-process`,supportsRecovery:!1,materializationModes:[`local-directory`]};function st(e){let t=new Set,n;return{conclude:r=>{if(n!==void 0)return;n={evidence:h.parse({source:e.slice(0,v.source),summary:r.slice(0,v.summary),observedAt:new Date().toISOString()})};let i=[...t];t.clear();for(let e of i)try{e(n)}catch(e){console.error(`[PiscinaThinWorkflowProvider] Infrastructure-conclusion observer failed:`,e)}},observe:e=>n===void 0?(t.add(e),()=>t.delete(e)):(e(n),()=>void 0)}}var ct=class{executionAttemptId;controller;detachCallerAbort;infrastructure;constructor(e,t,n,r){this.executionAttemptId=e,this.controller=t,this.detachCallerAbort=n,this.infrastructure=r}cancel(e){return this.controller.abort(e??`Worker cancelled`),this.detachCallerAbort(),Promise.resolve()}terminate(){return this.controller.abort(`Worker terminated`),this.detachCallerAbort(),Promise.resolve()}release(){return this.detachCallerAbort(),Promise.resolve()}observeInfrastructureConclusion(e){return this.infrastructure.observe(e)}},lt=class{options;environment=`piscina`;allocationLifetime=`provisioner-process-bound`;baseCapabilities;constructor(e){this.options=e,this.baseCapabilities=ne.parse({...ot,...e.baseCapabilities,suspensionStrategy:e.baseCapabilities?.suspensionStrategy??ot.suspensionStrategy,supportsRecovery:!1})}get id(){return this.options.id}get displayName(){return this.options.displayName}async provision(e,t){t.throwIfAborted();let n=new AbortController,r=st(this.id),i=()=>{n.abort(t.reason)};t.addEventListener(`abort`,i,{once:!0});let a=()=>t.removeEventListener(`abort`,i);try{let{executionAttemptId:i,executionId:o,workerConfig:s}=e,c=this.buildAllocationRef(i),l=new ct(i,n,a,r);t.throwIfAborted();let u=this.options.runner.runWithReadiness(e.workerConfig,n.signal,e.workerManifest);return u.ready.then(async e=>{n.signal.aborted||await this.options.bus.emit(y.control[`attempt-ready`],{executionAttemptId:i,executionId:o,adapters:[...e.adapters]})},()=>void 0).catch(e=>n.abort(e)),this.submitOutcomeOnSettlement(u.result,o,i,s.workflowId,r.conclude),{kind:`allocated`,allocationRef:c,handle:l}}catch(e){throw n.abort(e),a(),e}}async submitOutcomeOnSettlement(e,t,n,r,i){let a;try{a=await e}catch(e){a={executionId:t,workflowId:r,status:`failed`,error:e instanceof Error?e.message:String(e)}}try{let e={...at,...this.options.outcomeRetry};await Q(this.options.bus,{executionAttemptId:n,executionId:t,result:a},{retry:e})}catch(e){e instanceof X?console.error(`[PiscinaThinWorkflowProvider] Outcome rejected for execution '${t}' attempt '${n}' (decision=${e.decision}):`,e):console.error(`[PiscinaThinWorkflowProvider] Failed to submit outcome for execution '${t}' attempt '${n}':`,e),i(`Piscina worker for attempt '${n}' ended without an acknowledged outcome because outcome submission could not be completed`)}}buildAllocationRef(e){let t={version:ee,providerId:this.id,providerData:{executionAttemptId:e,allocatedAt:Date.now()}};return te.parse(t)}};const ut=[Ce,be,Se];function dt(e){let t;return()=>(t??=(async()=>{let t=[];for(let n of[...e].reverse())try{await n()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Isolated workflow runtime shutdown reported errors`)})(),t)}function ft(e,t,n){return T({bus:e,currentMachineId:n,resolveLiveAdapterId:e=>t.getExtensionService(S)?.resolveLiveAdapterId(e),resolveLiveAdapterIdentity:e=>t.getExtensionService(S)?.resolveLiveAdapterIdentity(e),listLiveAdapterIdentities:()=>t.getExtensionService(S)?.getLiveAdapterIdentities()??[]})}async function pt(e){let t=f();t.registerNamespaces([...g,..._]);let{context:n}=e,r=new oe(t,{surface:`headless`,extensionContextBase:{cwd:n.cwd,platform:n.platform,homedir:n.homedir,makaioHome:n.makaioHome,username:n.username,machineId:n.machineId,tryImport:D}}),i,a=[()=>t.disconnect()],o=dt(a);try{await e.connectAuthority(t);let s=[...e.contributedPackages,...await e.loadContributedPackages?.(t)??[]],{adapterSubsystemPackage:c}=w({coordinator:r,configRepository:e.configRepository,platformDefaults:{cwd:n.cwd},runtimeSnapshotHandlerPriority:1,runtimeDefinitionHandlerPriority:1,...e.prepareAuthRuntime!==void 0&&{prepareAuthRuntime:e.prepareAuthRuntime}}),l=Te({definitions:s.flatMap(e=>e.clients??[]),binaryResolutionPolicy:`global-only`});r.registerContributionProcessor(ye());let u=[...ut,c,_e,...P(s)?[xe]:[],ve(1),we,A,l,...Oe(s)];r.load(u),a.push(...F(u,t,r)),a.push(()=>r.shutdown()),await r.startAll(),i=ft(t,r,n.machineId),a.push(()=>{i?.cleanup(),i=void 0});let d=r.getExtensionService(ge);if(d===void 0)throw Error(`Isolated workflow tool registry did not start.`);for(let t of e.toolsets)await d.register(t);return await t.emit(se.ready,{machineId:n.machineId}),{bus:t,coordinator:r,machineId:n.machineId,shutdown:o}}catch(e){throw await o().catch(()=>void 0),e}}function mt(e,t){return{executionId:e,workflowId:t,status:`cancelled`,reason:`Execution cancelled`}}async function $(e,t,n){let r=new AbortController,i=e.on(ae(t),()=>{r.abort()}),a=()=>{r.abort()};return n?.addEventListener(`abort`,a,{once:!0}),n?.aborted&&r.abort(),await p(i),{signal:r.signal,cleanup:()=>{n?.removeEventListener(`abort`,a),i()}}}function ht(t,n){let r=e();return{cwd:t.workspaceRoot,platform:t.platform,homedir:r,makaioHome:r,username:`workflow-worker`,machineId:n}}async function gt(e,t,n,r,i,a){return await pt({connectAuthority:async n=>{await e.connectBus(n,t,i)},contributedPackages:[...r],configRepository:e.configRepository,context:ht(n,a),toolsets:[...e.toolsets],...e.prepareAuthRuntime!==void 0&&{prepareAuthRuntime:e.prepareAuthRuntime}})}async function _t(e,t,n){let{executionId:r,executionAttemptId:i}=e,a=mt(r,n);return{result:a,decision:await Q(t,{executionAttemptId:i,executionId:r,result:a},{retry:e.outcomeRetry,reconnect:()=>t.reconnect()})}}async function vt(e,t,n,r,i){let{executionId:a,executionAttemptId:o}=e,s;try{s=await e.execute(t.bus,n,r,i)}catch(e){s=i.aborted&&e instanceof DOMException&&e.name===`AbortError`?mt(a,n.workflowId):{executionId:a,workflowId:n.workflowId,status:`failed`,error:e instanceof Error?e.message:String(e)}}let c=await Q(t.bus,{executionAttemptId:o,executionId:a,result:s},{retry:e.outcomeRetry,reconnect:()=>t.bus.reconnect()});if(e.onPostCommit!==void 0)try{await e.onPostCommit(s,c)}catch{}return{result:s,decision:c}}async function yt(e,t,n,r,i,a){let o=await $(n,r.cancelSubject),s=AbortSignal.any([i,o.signal]),c=s,l,u,d;try{s.throwIfAborted();let f=await e.materialize(r,s),p=f.context;d=f.cleanup,s.throwIfAborted();let m=await e.loadContributions(p,s);s.throwIfAborted(),l=await gt(e,t,p,m,s,a),u=await $(l.bus,r.cancelSubject,o.signal),o.cleanup(),n.disconnect();let h=AbortSignal.any([i,u.signal]);c=h,h.throwIfAborted();let{adapters:g}=await l.bus.request(x.listAdapters,{});return h.throwIfAborted(),await l.bus.emit(y.control[`attempt-ready`],{executionAttemptId:e.executionAttemptId,executionId:e.executionId,adapters:g.map(e=>e.name)}),await vt(e,l,r,p,h)}catch(t){if(!(c.aborted&&t instanceof DOMException&&t.name===`AbortError`))throw t;return await _t(e,l?.bus??n,r.workflowId)}finally{o.cleanup(),u?.cleanup(),l!==void 0&&await l.shutdown().catch(()=>void 0),d!==void 0&&await d().catch(()=>void 0)}}async function bt(e,t){t.throwIfAborted();let n=await e.bootstrap(t);t.throwIfAborted();let r=f();r.registerNamespaces([...g,..._]);try{return await e.connectBus(r,n,t),await yt(e,n,r,await r.request(re.getRunContext,{executionId:e.executionId},{signal:t}),t,`headless-worker-${e.executionAttemptId}`)}finally{try{r.disconnect()}catch{}}}export{A,j as C,M as D,F as E,C as F,D as M,T as N,Ue as O,w as P,Ve as S,qe as T,H as _,X as a,z as b,tt as c,K as d,G as f,V as g,R as h,nt as i,E as j,Ke as k,J as l,L as m,pt as n,Q as o,I as p,lt as r,Y as s,bt as t,q as u,Ye as v,He as w,U as x,W as y};
File without changes
File without changes