@makaio/framework 1.0.0-dev-1781022866275 → 1.0.0-dev-1781023871421

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 (456) hide show
  1. package/dist/.makaio-build.json +5 -0
  2. package/dist/account-identity-DT5NOtFi.mjs +1 -0
  3. package/dist/adapter-C1eI-fGV.mjs +1 -0
  4. package/dist/adapters/acp-client/index.d.mts +6208 -0
  5. package/dist/adapters/acp-client/index.mjs +3 -0
  6. package/dist/adapters/config/index.d.mts +429 -0
  7. package/dist/adapters/config/index.mjs +1 -0
  8. package/dist/adapters/index.d.mts +4202 -0
  9. package/dist/adapters/index.mjs +18 -0
  10. package/dist/adapters/node.d.mts +263 -0
  11. package/dist/adapters/node.mjs +4 -0
  12. package/dist/adapters/stream-session/index.d.mts +1414 -0
  13. package/dist/adapters/stream-session/index.mjs +1 -0
  14. package/dist/adapters/stream-session/testing/index.d.mts +29 -0
  15. package/dist/adapters/stream-session/testing/index.mjs +1 -0
  16. package/dist/artifact-B3npq1cy.mjs +1 -0
  17. package/dist/base-orchestrator-wyumsn3b.d.mts +772 -0
  18. package/dist/bus/index.d.mts +3994 -0
  19. package/dist/bus/index.mjs +1 -0
  20. package/dist/bus-Caz3Jpbc.mjs +1 -0
  21. package/dist/bus-Hb-LGzgb.mjs +2 -0
  22. package/dist/capability-service-CJbmhfv9.mjs +1 -0
  23. package/dist/chunk-DTipWd-i.mjs +1 -0
  24. package/dist/chunk-cpUYaJdV.mjs +1 -0
  25. package/dist/cleanEnvForAdapter-KkYzQa1f.mjs +1 -0
  26. package/dist/client-bx74gm4R.mjs +1 -0
  27. package/dist/clients/index.d.mts +2639 -0
  28. package/dist/clients/index.mjs +2 -0
  29. package/dist/clients-namespace-GmSJpBUV.d.mts +332 -0
  30. package/dist/config-namespace-CPY9YsR8.d.mts +638 -0
  31. package/dist/config-namespace-ncYg2ct_.mjs +1 -0
  32. package/dist/contracts/adapter/index.d.mts +3 -0
  33. package/dist/contracts/adapter/index.mjs +1 -0
  34. package/dist/contracts/adapter/schemas/session-lineage.d.mts +2 -0
  35. package/dist/contracts/adapter/schemas/session-lineage.mjs +1 -0
  36. package/dist/contracts/artifact/index.d.mts +2 -0
  37. package/dist/contracts/artifact/index.mjs +1 -0
  38. package/dist/contracts/client/index.d.mts +3 -0
  39. package/dist/contracts/client/index.mjs +1 -0
  40. package/dist/contracts/common/index.d.mts +2 -0
  41. package/dist/contracts/common/index.mjs +1 -0
  42. package/dist/contracts/config/index.d.mts +455 -0
  43. package/dist/contracts/config/index.mjs +1 -0
  44. package/dist/contracts/extension/index.d.mts +4 -0
  45. package/dist/contracts/extension/index.mjs +1 -0
  46. package/dist/contracts/facet/index.d.mts +2 -0
  47. package/dist/contracts/facet/index.mjs +1 -0
  48. package/dist/contracts/harness/index.d.mts +2 -0
  49. package/dist/contracts/harness/index.mjs +1 -0
  50. package/dist/contracts/host/index.d.mts +2 -0
  51. package/dist/contracts/host/index.mjs +1 -0
  52. package/dist/contracts/index.d.mts +23046 -0
  53. package/dist/contracts/index.mjs +1 -0
  54. package/dist/contracts/materialization/index.d.mts +4 -0
  55. package/dist/contracts/materialization/index.mjs +1 -0
  56. package/dist/contracts/model-registry/index.d.mts +2 -0
  57. package/dist/contracts/model-registry/index.mjs +1 -0
  58. package/dist/contracts/native-session-supervisor/index.d.mts +2 -0
  59. package/dist/contracts/native-session-supervisor/index.mjs +1 -0
  60. package/dist/contracts/platform/index.d.mts +2 -0
  61. package/dist/contracts/platform/index.mjs +1 -0
  62. package/dist/contracts/provider/index.d.mts +3 -0
  63. package/dist/contracts/provider/index.mjs +1 -0
  64. package/dist/contracts/session/index.d.mts +3 -0
  65. package/dist/contracts/session/index.mjs +1 -0
  66. package/dist/contracts/shared/index.d.mts +2 -0
  67. package/dist/contracts/shared/index.mjs +1 -0
  68. package/dist/contracts/skill/index.d.mts +2 -0
  69. package/dist/contracts/skill/index.mjs +1 -0
  70. package/dist/contracts/telemetry/index.d.mts +2 -0
  71. package/dist/contracts/telemetry/index.mjs +1 -0
  72. package/dist/contracts/timeout/index.d.mts +2 -0
  73. package/dist/contracts/timeout/index.mjs +1 -0
  74. package/dist/contracts/toast/index.d.mts +198 -0
  75. package/dist/contracts/toast/index.mjs +1 -0
  76. package/dist/contracts/variant/index.d.mts +2 -0
  77. package/dist/contracts/variant/index.mjs +1 -0
  78. package/dist/core/index.d.mts +1263 -0
  79. package/dist/core/index.mjs +1 -0
  80. package/dist/credential-ref-YWQQENEo.mjs +1 -0
  81. package/dist/cursor-storage-CtVJ3JzB.mjs +1 -0
  82. package/dist/definition-BLCdXGzh.d.mts +383 -0
  83. package/dist/definition-CrgHIpTK.d.mts +60 -0
  84. package/dist/definition-DZMXOnjX.mjs +1 -0
  85. package/dist/definition-pkJ6szUl.d.mts +158 -0
  86. package/dist/drizzle-Eq8W1EbD.mjs +1 -0
  87. package/dist/event-Ca2yUf5i.mjs +1 -0
  88. package/dist/execution-target-CRPTfZlc.mjs +1 -0
  89. package/dist/extension-C-4BHMRI.mjs +1 -0
  90. package/dist/extension-CpIUgBKI.mjs +1 -0
  91. package/dist/extension-namespace-cMh_mMiL.mjs +1 -0
  92. package/dist/facet-BuwhrThl.mjs +1 -0
  93. package/dist/filesystem-service-B8rhBRgB.mjs +1 -0
  94. package/dist/filesystem-service-p_iJVHd4.d.mts +66 -0
  95. package/dist/git/index.d.mts +210 -0
  96. package/dist/git/index.mjs +18 -0
  97. package/dist/globby-rtWVaFHv.mjs +41 -0
  98. package/dist/handlers-CkTsQLra.mjs +41 -0
  99. package/dist/harness-BRCMcvQN.mjs +1 -0
  100. package/dist/hooks/index.d.mts +423 -0
  101. package/dist/hooks/index.mjs +1 -0
  102. package/dist/host-Br9VuOyr.mjs +1 -0
  103. package/dist/identity-Cz2IeEtm.mjs +1 -0
  104. package/dist/index-472sOmsW.d.mts +218 -0
  105. package/dist/index-8SZkg7s6.d.mts +353 -0
  106. package/dist/index-B3PK4FIn.d.mts +5116 -0
  107. package/dist/index-B80L4YqA.d.mts +180 -0
  108. package/dist/index-BFg9BUpx.d.mts +355 -0
  109. package/dist/index-BGfWS6GE.d.mts +483 -0
  110. package/dist/index-BVgfS-AJ.d.mts +109 -0
  111. package/dist/index-B_zQC98V.d.mts +995 -0
  112. package/dist/index-Bh_Ne7LF.d.mts +1008 -0
  113. package/dist/index-Bvb2mMH6.d.mts +1730 -0
  114. package/dist/index-CCGVh9BF2.d.mts +749 -0
  115. package/dist/index-CGmcS0Ma.d.mts +412 -0
  116. package/dist/index-CHQ1SqT0.d.mts +117 -0
  117. package/dist/index-CLpjm52M.d.mts +183 -0
  118. package/dist/index-Caig6TeF.d.mts +6746 -0
  119. package/dist/index-CelJCBjk.d.mts +2992 -0
  120. package/dist/index-ChunCFu4.d.mts +11 -0
  121. package/dist/index-Cm0dUkWL.d.mts +4651 -0
  122. package/dist/index-CokQYGVP.d.mts +184 -0
  123. package/dist/index-Cs0kZXIz2.d.mts +37 -0
  124. package/dist/index-D5d5HeWI2.d.mts +259 -0
  125. package/dist/index-D90OmGmV.d.mts +389 -0
  126. package/dist/index-D9MwJ2Q8.d.mts +67 -0
  127. package/dist/index-DANINzMu.d.mts +40 -0
  128. package/dist/index-DBw-89vC2.d.mts +3640 -0
  129. package/dist/index-DGBu6bHi2.d.mts +438 -0
  130. package/dist/index-DKC62dY5.d.mts +146 -0
  131. package/dist/index-DKia0MX1.d.mts +43 -0
  132. package/dist/index-DMKnON5s.d.mts +28 -0
  133. package/dist/index-DUaw0Dw8.d.mts +14747 -0
  134. package/dist/index-De3kPhlN.d.mts +72 -0
  135. package/dist/index-L4GjJDKb.d.mts +822 -0
  136. package/dist/index-U-A8eyGT.d.mts +1490 -0
  137. package/dist/index-eemAKwsB.d.mts +362 -0
  138. package/dist/index-mNec7V-9.d.mts +1075 -0
  139. package/dist/index-soFznFCy2.d.mts +89 -0
  140. package/dist/index-vtXJuwrz.d.mts +40 -0
  141. package/dist/index-x_lVDp_J.d.mts +134 -0
  142. package/dist/json-value-CmhSGMLv.mjs +1 -0
  143. package/dist/kernel/cli/index.d.mts +143 -0
  144. package/dist/kernel/cli/index.mjs +1 -0
  145. package/dist/kernel/cli/schemas.d.mts +64 -0
  146. package/dist/kernel/cli/schemas.mjs +1 -0
  147. package/dist/kernel/extension/index.d.mts +2 -0
  148. package/dist/kernel/extension/index.mjs +1 -0
  149. package/dist/kernel/index.d.mts +296 -0
  150. package/dist/kernel/index.mjs +1 -0
  151. package/dist/kernel/namespace/index.d.mts +2 -0
  152. package/dist/kernel/namespace/index.mjs +1 -0
  153. package/dist/kernel/observability/index.d.mts +2 -0
  154. package/dist/kernel/observability/index.mjs +1 -0
  155. package/dist/kernel/providers/index.d.mts +2 -0
  156. package/dist/kernel/providers/index.mjs +1 -0
  157. package/dist/kernel/window/index.d.mts +2 -0
  158. package/dist/kernel/window/index.mjs +1 -0
  159. package/dist/materialization-CuUBu4XI.mjs +1 -0
  160. package/dist/model-registry-CfXytvzx.mjs +1 -0
  161. package/dist/model-registry-Scn_MC2d.mjs +1 -0
  162. package/dist/namespace-5QQqbF-B.d.mts +3133 -0
  163. package/dist/namespace-BM7Djng9.d.mts +189 -0
  164. package/dist/namespace-BoD94mrN.mjs +1 -0
  165. package/dist/namespace-BwzZJqTV.mjs +1 -0
  166. package/dist/namespace-CFLAmQfh.mjs +1 -0
  167. package/dist/namespace-CTm3nEvh.d.mts +51 -0
  168. package/dist/namespace-CaaNnKcR.d.mts +921 -0
  169. package/dist/namespace-CaoZ3S78.d.mts +43 -0
  170. package/dist/namespace-CxhsoFUP.d.mts +607 -0
  171. package/dist/namespace-DD8Oiqo7.d.mts +580 -0
  172. package/dist/namespace-DLovh2Ws.d.mts +1313 -0
  173. package/dist/namespace-DgqkaOVu.d.mts +768 -0
  174. package/dist/namespace-DkRgbZYn.mjs +1 -0
  175. package/dist/namespace-Dr8K0MCp.d.mts +2047 -0
  176. package/dist/namespace-DuXK5AYN.mjs +1 -0
  177. package/dist/namespace-EQniz-Aw.d.mts +142 -0
  178. package/dist/namespace-IV1QK__V.d.mts +159 -0
  179. package/dist/namespace-LViZ-EQk.mjs +1 -0
  180. package/dist/namespace-TyiTsLFv.d.mts +3020 -0
  181. package/dist/namespace-Yna5-Pws.mjs +1 -0
  182. package/dist/namespace-xcmbQlxh.mjs +1 -0
  183. package/dist/native-session-supervisor-B1TnaPUF.mjs +1 -0
  184. package/dist/node/bus-server/index.d.mts +178 -0
  185. package/dist/node/bus-server/index.mjs +1 -0
  186. package/dist/node/bus-server/server-lifecycle.d.mts +2 -0
  187. package/dist/node/bus-server/server-lifecycle.mjs +1 -0
  188. package/dist/node/machine-identity/index.d.mts +85 -0
  189. package/dist/node/machine-identity/index.mjs +3 -0
  190. package/dist/node/transports/index.d.mts +1945 -0
  191. package/dist/node/transports/index.mjs +2 -0
  192. package/dist/orchestrator-shared-CIDiFJMD.mjs +1 -0
  193. package/dist/orchestrator-shared-Dfa7FMyw.d.mts +249 -0
  194. package/dist/package-DKVlsMP3.mjs +1 -0
  195. package/dist/platform-DZ7z-wXD.mjs +1 -0
  196. package/dist/profile-6ynCD5k3.mjs +1 -0
  197. package/dist/provider-context-CK6B4X_8.mjs +1 -0
  198. package/dist/providers/index.d.mts +135 -0
  199. package/dist/providers/index.mjs +1 -0
  200. package/dist/providers-namespace-DSEpli4A.d.mts +583 -0
  201. package/dist/providers-u8i15co9.mjs +1 -0
  202. package/dist/schema-CoyE6mPt.mjs +1 -0
  203. package/dist/schema-M5YTvSAG.d.mts +949 -0
  204. package/dist/schema-e0wU_lcV.mjs +1 -0
  205. package/dist/schema-introspection-Dn1jWQs1.mjs +1 -0
  206. package/dist/schemas-Bd0OjRQf.d.mts +46 -0
  207. package/dist/schemas-C46QfKzv.d.mts +459 -0
  208. package/dist/schemas-CDBSjg7o.d.mts +237 -0
  209. package/dist/schemas-CR1Rripy.mjs +1 -0
  210. package/dist/schemas-CVvwIfG4.mjs +1 -0
  211. package/dist/schemas-CaLhkkLn.mjs +1 -0
  212. package/dist/schemas-ClOOT1W6.d.mts +174 -0
  213. package/dist/schemas-DATniTHb.d.mts +182 -0
  214. package/dist/schemas-DE-GNmSD.mjs +1 -0
  215. package/dist/schemas-DVF1A4DF.d.mts +160 -0
  216. package/dist/schemas-DaRSfYLf.d.mts +73 -0
  217. package/dist/schemas-DiYVzG6e.d.mts +315 -0
  218. package/dist/schemas-hSrzflwZ.mjs +1 -0
  219. package/dist/schemas-j7ivZ2HI.d.mts +944 -0
  220. package/dist/schemas-jFe1AuI-.mjs +1 -0
  221. package/dist/schemas-wg_6PAdV.d.mts +153 -0
  222. package/dist/scoped-bus-04pwo1uM.mjs +1 -0
  223. package/dist/server-lifecycle-FXTPW39-.mjs +1 -0
  224. package/dist/server-lifecycle-YoSGFGnU.d.mts +160 -0
  225. package/dist/service-base/index.d.mts +98 -0
  226. package/dist/service-base/index.mjs +1 -0
  227. package/dist/services/adapter-runtime/index.d.mts +4 -0
  228. package/dist/services/adapter-runtime/index.mjs +1 -0
  229. package/dist/services/adapter-runtime/namespace.d.mts +2 -0
  230. package/dist/services/adapter-runtime/namespace.mjs +1 -0
  231. package/dist/services/adapter-runtime/schemas.d.mts +2 -0
  232. package/dist/services/adapter-runtime/schemas.mjs +1 -0
  233. package/dist/services/adapter-subsystem/index.d.mts +3 -0
  234. package/dist/services/adapter-subsystem/index.mjs +1 -0
  235. package/dist/services/adapter-subsystem/namespace.d.mts +2 -0
  236. package/dist/services/adapter-subsystem/namespace.mjs +1 -0
  237. package/dist/services/agent-runtime/index.d.mts +3 -0
  238. package/dist/services/agent-runtime/index.mjs +1 -0
  239. package/dist/services/agent-runtime/namespace.d.mts +2 -0
  240. package/dist/services/agent-runtime/namespace.mjs +1 -0
  241. package/dist/services/agent-runtime/schemas.d.mts +2 -0
  242. package/dist/services/agent-runtime/schemas.mjs +1 -0
  243. package/dist/services/capability/index.d.mts +2 -0
  244. package/dist/services/capability/index.mjs +1 -0
  245. package/dist/services/cli-detection/namespace.d.mts +56 -0
  246. package/dist/services/cli-detection/namespace.mjs +1 -0
  247. package/dist/services/codebase/index.d.mts +3 -0
  248. package/dist/services/codebase/index.mjs +1 -0
  249. package/dist/services/codebase/namespace.d.mts +2 -0
  250. package/dist/services/codebase/namespace.mjs +1 -0
  251. package/dist/services/codebase/schemas.d.mts +2 -0
  252. package/dist/services/codebase/schemas.mjs +1 -0
  253. package/dist/services/compression/index.d.mts +3 -0
  254. package/dist/services/compression/index.mjs +1 -0
  255. package/dist/services/compression/namespace.d.mts +2 -0
  256. package/dist/services/compression/namespace.mjs +1 -0
  257. package/dist/services/compression/schemas.d.mts +2 -0
  258. package/dist/services/compression/schemas.mjs +1 -0
  259. package/dist/services/context-rules/index.d.mts +412 -0
  260. package/dist/services/context-rules/index.mjs +1 -0
  261. package/dist/services/credential-change/index.d.mts +17 -0
  262. package/dist/services/credential-change/index.mjs +1 -0
  263. package/dist/services/definition/index.d.mts +2 -0
  264. package/dist/services/definition/index.mjs +1 -0
  265. package/dist/services/definition/namespace.d.mts +71 -0
  266. package/dist/services/definition/namespace.mjs +1 -0
  267. package/dist/services/definition/schemas.d.mts +38 -0
  268. package/dist/services/definition/schemas.mjs +1 -0
  269. package/dist/services/dialog/namespace.d.mts +105 -0
  270. package/dist/services/dialog/namespace.mjs +1 -0
  271. package/dist/services/dialog/schemas.d.mts +109 -0
  272. package/dist/services/dialog/schemas.mjs +1 -0
  273. package/dist/services/execution-target/index.d.mts +4 -0
  274. package/dist/services/execution-target/index.mjs +1 -0
  275. package/dist/services/execution-target/namespace.d.mts +2 -0
  276. package/dist/services/execution-target/namespace.mjs +1 -0
  277. package/dist/services/execution-target/schemas.d.mts +2 -0
  278. package/dist/services/execution-target/schemas.mjs +1 -0
  279. package/dist/services/filesystem/index.d.mts +3 -0
  280. package/dist/services/filesystem/index.mjs +1 -0
  281. package/dist/services/filesystem/namespace.d.mts +432 -0
  282. package/dist/services/filesystem/namespace.mjs +1 -0
  283. package/dist/services/filesystem/schemas.d.mts +240 -0
  284. package/dist/services/filesystem/schemas.mjs +1 -0
  285. package/dist/services/git/namespace.d.mts +1163 -0
  286. package/dist/services/git/namespace.mjs +1 -0
  287. package/dist/services/git/schemas.d.mts +932 -0
  288. package/dist/services/git/schemas.mjs +1 -0
  289. package/dist/services/harness/index.d.mts +861 -0
  290. package/dist/services/harness/index.mjs +1 -0
  291. package/dist/services/harness/storage/schema.d.mts +424 -0
  292. package/dist/services/harness/storage/schema.mjs +1 -0
  293. package/dist/services/index.d.mts +6185 -0
  294. package/dist/services/index.mjs +1 -0
  295. package/dist/services/local-notification/index.d.mts +25 -0
  296. package/dist/services/local-notification/index.mjs +1 -0
  297. package/dist/services/local-notification/namespace.d.mts +73 -0
  298. package/dist/services/local-notification/namespace.mjs +1 -0
  299. package/dist/services/local-notification/schemas.d.mts +88 -0
  300. package/dist/services/local-notification/schemas.mjs +1 -0
  301. package/dist/services/log-import/browser.d.mts +3 -0
  302. package/dist/services/log-import/browser.mjs +1 -0
  303. package/dist/services/log-import/index.d.mts +274 -0
  304. package/dist/services/log-import/index.mjs +2 -0
  305. package/dist/services/log-import/log-import.d.mts +3 -0
  306. package/dist/services/log-import/log-import.mjs +1 -0
  307. package/dist/services/log-import/namespace.d.mts +327 -0
  308. package/dist/services/log-import/namespace.mjs +1 -0
  309. package/dist/services/log-import/schemas.d.mts +217 -0
  310. package/dist/services/log-import/schemas.mjs +1 -0
  311. package/dist/services/model-registry/index.d.mts +2 -0
  312. package/dist/services/model-registry/index.mjs +1 -0
  313. package/dist/services/preferences/index.d.mts +3 -0
  314. package/dist/services/preferences/index.mjs +1 -0
  315. package/dist/services/preferences/schemas.d.mts +2 -0
  316. package/dist/services/preferences/schemas.mjs +1 -0
  317. package/dist/services/preferences/storage-namespace.d.mts +3 -0
  318. package/dist/services/preferences/storage-namespace.mjs +1 -0
  319. package/dist/services/provider-context/index.d.mts +2 -0
  320. package/dist/services/provider-context/index.mjs +1 -0
  321. package/dist/services/provider-runtime/index.d.mts +136 -0
  322. package/dist/services/provider-runtime/index.mjs +1 -0
  323. package/dist/services/session/handlers/index.d.mts +2 -0
  324. package/dist/services/session/handlers/index.mjs +1 -0
  325. package/dist/services/session/index.d.mts +10 -0
  326. package/dist/services/session/index.mjs +1 -0
  327. package/dist/services/session/messages/namespace.d.mts +2 -0
  328. package/dist/services/session/messages/namespace.mjs +1 -0
  329. package/dist/services/session/orchestrator-testing/index.d.mts +2 -0
  330. package/dist/services/session/orchestrator-testing/index.mjs +1 -0
  331. package/dist/services/session/session-events/namespace.d.mts +2 -0
  332. package/dist/services/session/session-events/namespace.mjs +1 -0
  333. package/dist/services/session/storage/namespace.d.mts +2 -0
  334. package/dist/services/session/storage/namespace.mjs +1 -0
  335. package/dist/services/session/storage/schema.d.mts +2 -0
  336. package/dist/services/session/storage/schema.mjs +1 -0
  337. package/dist/services/session/testing/index.d.mts +35 -0
  338. package/dist/services/session/testing/index.mjs +65 -0
  339. package/dist/services/session/testing/orchestrator-shared.d.mts +2 -0
  340. package/dist/services/session/testing/orchestrator-shared.mjs +1 -0
  341. package/dist/services/session/turns/namespace.d.mts +2 -0
  342. package/dist/services/session/turns/namespace.mjs +1 -0
  343. package/dist/services/session-editor/index.d.mts +119 -0
  344. package/dist/services/session-editor/index.mjs +1 -0
  345. package/dist/services/settings/index.d.mts +47 -0
  346. package/dist/services/settings/index.mjs +1 -0
  347. package/dist/services/settings/namespace.d.mts +663 -0
  348. package/dist/services/settings/namespace.mjs +1 -0
  349. package/dist/services/settings/storage/clients-namespace.d.mts +2 -0
  350. package/dist/services/settings/storage/clients-namespace.mjs +1 -0
  351. package/dist/services/settings/storage/extension-configs/namespace.d.mts +184 -0
  352. package/dist/services/settings/storage/extension-configs/namespace.mjs +1 -0
  353. package/dist/services/settings/storage/index.d.mts +4 -0
  354. package/dist/services/settings/storage/index.mjs +1 -0
  355. package/dist/services/settings/storage/providers-namespace.d.mts +2 -0
  356. package/dist/services/settings/storage/providers-namespace.mjs +1 -0
  357. package/dist/services/subagent/index.d.mts +2 -0
  358. package/dist/services/subagent/index.mjs +1 -0
  359. package/dist/services/subagent-template/index.d.mts +3 -0
  360. package/dist/services/subagent-template/index.mjs +1 -0
  361. package/dist/services/subagent-template/namespace.d.mts +2 -0
  362. package/dist/services/subagent-template/namespace.mjs +1 -0
  363. package/dist/services/subagent-template/schemas.d.mts +2 -0
  364. package/dist/services/subagent-template/schemas.mjs +1 -0
  365. package/dist/services/tool-approval/index.d.mts +2 -0
  366. package/dist/services/tool-approval/index.mjs +1 -0
  367. package/dist/services/tools/index.d.mts +2 -0
  368. package/dist/services/tools/index.mjs +1 -0
  369. package/dist/services/tray-menu/index.d.mts +4 -0
  370. package/dist/services/tray-menu/index.mjs +1 -0
  371. package/dist/services/tray-menu/namespace.d.mts +2 -0
  372. package/dist/services/tray-menu/namespace.mjs +1 -0
  373. package/dist/services/tray-menu/schemas.d.mts +2 -0
  374. package/dist/services/tray-menu/schemas.mjs +1 -0
  375. package/dist/services/turn/index.d.mts +2 -0
  376. package/dist/services/turn/index.mjs +1 -0
  377. package/dist/services/turn/namespace.d.mts +2 -0
  378. package/dist/services/turn/namespace.mjs +1 -0
  379. package/dist/services/turn/schemas.d.mts +335 -0
  380. package/dist/services/turn/schemas.mjs +1 -0
  381. package/dist/session-BoldSdNZ2.mjs +134 -0
  382. package/dist/session-DuVOYctZ.mjs +1 -0
  383. package/dist/session-lineage-CRsc9g1x.d.mts +65 -0
  384. package/dist/shared-DpOEfD8F.mjs +1 -0
  385. package/dist/shared-schemas-CPShiLNp.mjs +1 -0
  386. package/dist/skill-CQO4mDqK.mjs +1 -0
  387. package/dist/storage/drizzle/client.d.mts +78 -0
  388. package/dist/storage/drizzle/client.mjs +1 -0
  389. package/dist/storage/drizzle/index.d.mts +137 -0
  390. package/dist/storage/drizzle/index.mjs +1 -0
  391. package/dist/storage/handlers/drizzle/index.d.mts +2 -0
  392. package/dist/storage/handlers/drizzle/index.mjs +1 -0
  393. package/dist/storage/handlers/index.d.mts +33 -0
  394. package/dist/storage/handlers/index.mjs +1 -0
  395. package/dist/storage/index.d.mts +192 -0
  396. package/dist/storage/index.mjs +1 -0
  397. package/dist/storage-namespace-BXkoh5Sy.d.mts +221 -0
  398. package/dist/storage-namespace-DWsYLAXa.mjs +1 -0
  399. package/dist/storage-namespace-definition-Bkx5rSto.d.mts +17 -0
  400. package/dist/storage-namespace-definition-CqSdsuCC.mjs +1 -0
  401. package/dist/style.css +3782 -0
  402. package/dist/telemetry-CvdLBWuk.mjs +1 -0
  403. package/dist/testing/drizzle-harness.d.mts +130 -0
  404. package/dist/testing/drizzle-harness.mjs +1 -0
  405. package/dist/testing/index.d.mts +106 -0
  406. package/dist/testing/index.mjs +1 -0
  407. package/dist/timeout-XsYIOKrc.mjs +1 -0
  408. package/dist/tool-approval-service-BvZWhYZp.mjs +1 -0
  409. package/dist/tools/index.d.mts +835 -0
  410. package/dist/tools/index.mjs +1 -0
  411. package/dist/tools/testing/index.d.mts +53 -0
  412. package/dist/tools/testing/index.mjs +1 -0
  413. package/dist/tools-D-luYcDw.mjs +1431 -0
  414. package/dist/tray-menu-service-DuXq5k22.mjs +1 -0
  415. package/dist/types-BCMUtBj1.d.mts +1106 -0
  416. package/dist/types-C2Ob9zz_.d.mts +128 -0
  417. package/dist/types-CCdqjeuH.d.mts +262 -0
  418. package/dist/types-DZHvOc_Q.d.mts +305 -0
  419. package/dist/types-Dy3YTcTF.d.mts +6777 -0
  420. package/dist/types-MfJZ67e9.d.mts +315 -0
  421. package/dist/types-dyP-bXXE.d.mts +31 -0
  422. package/dist/ui-components/index.d.mts +2342 -0
  423. package/dist/ui-components/index.mjs +8 -0
  424. package/dist/ui-config-9bDRwFZr.mjs +1 -0
  425. package/dist/ui-hooks/index.d.mts +1915 -0
  426. package/dist/ui-hooks/index.mjs +1 -0
  427. package/dist/ui-kernel/index.d.mts +2793 -0
  428. package/dist/ui-kernel/index.mjs +1 -0
  429. package/dist/ui-kernel/pages/namespace.d.mts +88 -0
  430. package/dist/ui-kernel/pages/namespace.mjs +1 -0
  431. package/dist/ui-kernel/pages/schemas.d.mts +2 -0
  432. package/dist/ui-kernel/pages/schemas.mjs +1 -0
  433. package/dist/ui-views/index.d.mts +487 -0
  434. package/dist/ui-views/index.mjs +30 -0
  435. package/dist/utils/health-probe.d.mts +26 -0
  436. package/dist/utils/health-probe.mjs +1 -0
  437. package/dist/utils/index.d.mts +262 -0
  438. package/dist/utils/index.mjs +2 -0
  439. package/dist/utils/keychain.d.mts +31 -0
  440. package/dist/utils/keychain.mjs +1 -0
  441. package/dist/utils/project-manifest.d.mts +130 -0
  442. package/dist/utils/project-manifest.mjs +1 -0
  443. package/dist/utils/resolve-package-root.d.mts +12 -0
  444. package/dist/utils/resolve-package-root.mjs +1 -0
  445. package/dist/utils/scope-paths.d.mts +33 -0
  446. package/dist/utils/scope-paths.mjs +1 -0
  447. package/dist/utils/workspace-packages.d.mts +59 -0
  448. package/dist/utils/workspace-packages.mjs +1 -0
  449. package/dist/utils/workspace-root.d.mts +24 -0
  450. package/dist/utils/workspace-root.mjs +2 -0
  451. package/dist/variant-CT6XBP6T.mjs +1 -0
  452. package/dist/version-BeT3ASEe.mjs +1 -0
  453. package/dist/visibility-Cb62p9bv.mjs +1 -0
  454. package/dist/window-registry-CBcrGTv4.d.mts +130 -0
  455. package/dist/window-registry-DW-dKRjQ.mjs +1 -0
  456. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ import{harnessDefinitions as e}from"./services/harness/storage/schema.mjs";import{z as t}from"zod";import{ApprovalPolicySchema as n,HarnessDefinitionBaseSchema as r,HarnessDefinitionSchema as i}from"@makaio/framework/contracts";import{createStorageNamespaceDefinition as a}from"@makaio/framework/storage";const o=t.object({enabled:t.array(t.string()),disabled:t.array(t.string())}),s=r.omit({createdAt:!0,updatedAt:!0,approvalPolicy:!0,isDefault:!0,enabled:!0,nativeTools:!0,registryTools:!0,skills:!0}).extend({approvalPolicy:n,isDefault:t.boolean(),enabled:t.boolean(),nativeTools:o,registryTools:o,skills:o.optional()}).strict().refine(e=>!!e.adapterName||!!e.clientId,{message:`At least one of adapterName or clientId must be set`}),c=t.object({adapterName:t.string().optional(),clientId:t.string().optional(),name:t.string().optional()}),l=a(`harness`,{schemas:{get:{request:t.object({id:t.string()}),response:t.object({harness:i.nullable()})},set:{request:t.object({harness:s}),response:t.object({id:t.string()})},delete:{request:t.object({id:t.string()}),response:t.object({deleted:t.boolean()})},list:{request:c,response:t.object({harnesses:t.array(i)})}},extensions:{drizzle:{harnessDefinitions:e}}}),u=l.subjects;export{u as n,l as t};
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";import{createBusNamespace as t}from"@makaio/framework/core";import{localSubject as n}from"@makaio/framework/bus";const r=e.object({machineId:e.string()}),i={isReady:{request:e.object({}),response:e.object({ready:e.boolean(),machineId:e.string()})},"phase.busCreated":r,"phase.coreReady":r,"phase.servicesReady":r,"phase.coordinatorReady":n({request:r,response:e.object({})}),ready:r,"lifecycle.start":{request:e.object({machineId:e.string()}),response:e.object({})},"lifecycle.shutdown":{request:e.object({}),response:e.object({})},restart:{request:e.object({reason:e.string().optional()}),response:e.object({accepted:e.boolean()})}},a=t(`kernel`,i),o=a.subjects;let s;function c(e){if(e!==void 0&&s!==void 0&&s!==e)throw Error(`Workflow trigger type registry is already set. Clear it with setWorkflowTriggerTypeRegistry(undefined) before replacing it.`);s=e}function l(){return s}export{i as a,c as i,o as n,l as r,a as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./profile-6ynCD5k3.mjs";import{z as t}from"zod";import{createBusNamespace as n}from"@makaio/framework/core";const r=t.enum([`running`,`stopped`,`exited`,`unknown`]),i={request:t.object({clientId:t.string(),cwd:t.string(),command:t.string(),args:t.array(t.string()),env:t.record(t.string(),t.string()).optional(),sessionId:t.string().optional(),clientProfileName:e.optional(),adapterSessionId:t.string().optional(),metadata:t.record(t.string(),t.unknown()).optional()}),response:t.object({supervisorSessionId:t.string(),pid:t.number().int().positive()})},a={request:t.union([t.object({supervisorSessionId:t.string()}).strict(),t.object({sessionId:t.string()}).strict(),t.object({adapterSessionId:t.string()}).strict()]),response:t.object({success:t.boolean(),supervisorSessionId:t.string().optional(),pid:t.number().int().positive().optional(),terminalAttachment:t.object({canAttach:t.boolean()}).optional()})},o={request:t.object({supervisorSessionId:t.string(),signal:t.string().optional()}),response:t.object({success:t.boolean()})},s=t.object({supervisorSessionId:t.string(),clientId:t.string(),pid:t.number().int().positive().nullable(),status:r,cwd:t.string(),sessionId:t.string().optional(),adapterSessionId:t.string().optional(),startedAt:t.number().int().nonnegative(),stoppedAt:t.number().int().nonnegative().optional()}),c={request:t.union([t.object({}).strict(),t.object({supervisorSessionId:t.string()}).strict(),t.object({sessionId:t.string()}).strict(),t.object({adapterSessionId:t.string()}).strict()]),response:t.object({runtimes:t.array(s)})},l={launch:i,attach:a,stop:o,status:c},u=n(`native-session-supervisor`,l),d=u.subjects;export{i as a,s as c,a as i,r as l,d as n,c as o,l as r,o as s,u as t};
@@ -0,0 +1,178 @@
1
+ import { i as BusServerConfig, n as startBusServer, r as BusServer, t as StartBusServerOptions } from "../../server-lifecycle-YoSGFGnU.mjs";
2
+ import { BusBroadcastMessage, BusMessage, BusRequestMessage, BusTransport, BusTransportError } from "@makaio/framework/bus";
3
+ import { TransportAuth, WebSocketLike, WebSocketServerLike, WebSocketServerLike as WebSocketServerLike$1 } from "@makaio/framework/node/transports";
4
+
5
+ //#region packages/bus-server/src/server.d.ts
6
+ /**
7
+ * Create a bus server instance.
8
+ *
9
+ * This function creates a WebSocket server transport and provides a clean
10
+ * API for lifecycle management. The server will:
11
+ * - Accept incoming client connections
12
+ * - Handle optional authentication
13
+ * - Broadcast messages to all connected clients
14
+ * - Integrate with MakaioBus for message routing
15
+ * @param config - Server configuration
16
+ * @returns BusServer instance with start/stop methods
17
+ * @example
18
+ * ```typescript
19
+ * import { WebSocketServer } from 'ws';
20
+ * import { createBusServer } from '@makaio/framework/node/bus-server';
21
+ * import { HmacAuth } from '@makaio/framework/node/transports';
22
+ *
23
+ * const wss = new WebSocketServer({ port: 8080 });
24
+ * const server = createBusServer({
25
+ * websocket: wss,
26
+ * auth: new HmacAuth({ secret: process.env.BUS_SECRET! }),
27
+ * debug: true,
28
+ * });
29
+ *
30
+ * await server.start();
31
+ * console.debug('Bus server started');
32
+ * console.debug('Connected clients:', server.getConnectionCount());
33
+ *
34
+ * // Later...
35
+ * await server.stop();
36
+ * ```
37
+ */
38
+ declare function createBusServer(config: BusServerConfig): BusServer;
39
+ //#endregion
40
+ //#region packages/bus-server/src/loopback-transport.d.ts
41
+ /**
42
+ * Options for constructing a {@link LoopbackTransport}.
43
+ */
44
+ interface LoopbackTransportOptions {
45
+ /** The existing transport to proxy sends to. */
46
+ target: BusTransport;
47
+ /** Transport identity. Required — loopback is always registered under a caller-chosen name. */
48
+ name: string;
49
+ }
50
+ /**
51
+ * Loopback transport that proxies outbound sends to an existing transport.
52
+ *
53
+ * This transport is outbound-only: `onReceive` registers a no-op handler
54
+ * so the relay layer can include this transport in its target list without
55
+ * triggering double-dispatch of inbound messages.
56
+ *
57
+ * Lifecycle methods (`connect`, `disconnect`) are no-ops because the target
58
+ * transport owns its own lifecycle.
59
+ */
60
+ declare class LoopbackTransport implements BusTransport {
61
+ #private;
62
+ /** Transport identity used as the registry key when registered on a bus. */
63
+ readonly name: string;
64
+ /**
65
+ * @param options - Construction options for the loopback transport.
66
+ */
67
+ constructor(options: LoopbackTransportOptions);
68
+ /** No-op: lifecycle is owned by the target transport. */
69
+ connect(): Promise<void>;
70
+ /** No-op: lifecycle is owned by the target transport. */
71
+ disconnect(): Promise<void>;
72
+ /**
73
+ * Delegate to the target transport.
74
+ * @param message - Bus message to send.
75
+ * @param timeout - Optional send timeout in milliseconds.
76
+ * @returns The target transport's send result.
77
+ */
78
+ send<TMessage extends BusMessage>(message: TMessage, timeout?: number): Promise<TMessage extends BusRequestMessage ? unknown : TMessage extends BusBroadcastMessage ? Array<{
79
+ nodeId: string;
80
+ payload: unknown;
81
+ }> : boolean>;
82
+ /**
83
+ * Delegate cancellation to the target transport if supported.
84
+ * @param correlationId - Correlation ID of the in-flight request to cancel.
85
+ * @param error - Optional error to surface at the cancelled call-site.
86
+ */
87
+ cancelRequest(correlationId: string, error?: Error): void;
88
+ /**
89
+ * No-op: this transport emits no inbound messages to prevent double-dispatch.
90
+ * @param _handler - Ignored receive handler.
91
+ * @returns Unsubscribe no-op.
92
+ */
93
+ onReceive(_handler: (message: BusMessage) => Promise<void>): () => void;
94
+ /**
95
+ * No-op: the loopback transport does not participate in subscription management.
96
+ * The target transport owns its own subscriptions.
97
+ */
98
+ subscribe(): Promise<void>;
99
+ /** No-op: see {@link subscribe}. */
100
+ unsubscribe(): Promise<void>;
101
+ /**
102
+ * Delegate readiness check to the target transport.
103
+ * @returns `true` when the target transport is ready or has no `isReady` method.
104
+ */
105
+ isReady(): boolean;
106
+ /**
107
+ * Delegate broadcast results to the target transport if supported.
108
+ * @param correlationId - Correlation ID of the originating broadcast.
109
+ * @param results - Collected per-node broadcast responses.
110
+ * @param error - Optional transport-level error for the broadcast.
111
+ */
112
+ onBroadcastResults(correlationId: string, results: ReadonlyArray<{
113
+ nodeId: string;
114
+ payload: unknown;
115
+ }>, error?: BusTransportError): void;
116
+ }
117
+ //#endregion
118
+ //#region packages/bus-server/src/hono-websocket-bridge.d.ts
119
+ /**
120
+ * Bridges Hono's per-route WebSocket handling to {@link ServerTransport}'s
121
+ * {@link WebSocketServerLike} connection listener interface.
122
+ *
123
+ * Instead of owning a real WebSocket server, this shim receives already-upgraded
124
+ * sockets from Hono's `upgradeWebSocket` handler and forwards them to
125
+ * `ServerTransport` as if they came from a `wss.on('connection')` event.
126
+ * @example
127
+ * ```typescript
128
+ * const bridge = new HonoWebSocketBridge();
129
+ * const busServer = createBusServer({ websocket: bridge, auth, debug });
130
+ * await busServer.start();
131
+ *
132
+ * app.get('/bus', upgradeWebSocket(() => ({
133
+ * onOpen(_event, ws) {
134
+ * bridge.accept(ws.raw as WebSocketLike);
135
+ * },
136
+ * })));
137
+ * ```
138
+ */
139
+ declare class HonoWebSocketBridge implements WebSocketServerLike$1 {
140
+ private readonly connectionListeners;
141
+ /**
142
+ * Register an event listener.
143
+ *
144
+ * Only `'connection'` listeners are tracked; `'error'` and `'close'` are
145
+ * accepted for interface compatibility but are no-ops on this shim.
146
+ * @param event - Event type
147
+ * @param listener - Listener to register
148
+ */
149
+ on(event: 'connection', listener: (socket: WebSocketLike) => void): void;
150
+ on(event: 'error', listener: (error: Error) => void): void;
151
+ on(event: 'close', listener: () => void): void;
152
+ /**
153
+ * Remove a previously registered event listener.
154
+ *
155
+ * Only `'connection'` listeners are tracked; `'error'` and `'close'` are
156
+ * accepted for interface compatibility but are no-ops on this shim.
157
+ * @param event - Event type
158
+ * @param listener - Listener to remove
159
+ */
160
+ off(event: 'connection', listener: (socket: WebSocketLike) => void): void;
161
+ off(event: 'error', listener: (error: Error) => void): void;
162
+ off(event: 'close', listener: () => void): void;
163
+ /**
164
+ * Clear all connection listeners (called by {@link ServerTransport} on disconnect).
165
+ * @param cb - Optional callback invoked after cleanup
166
+ */
167
+ close(cb?: (err?: Error) => void): void;
168
+ /**
169
+ * Feed an already-upgraded WebSocket into the transport layer.
170
+ *
171
+ * Called from Hono's `upgradeWebSocket` `onOpen` handler with `ws.raw`
172
+ * cast to {@link WebSocketLike}.
173
+ * @param socket - The raw WebSocket from Hono's WSContext
174
+ */
175
+ accept(socket: WebSocketLike): void;
176
+ }
177
+ //#endregion
178
+ export { type BusServer, type BusServerConfig, HonoWebSocketBridge, LoopbackTransport, type LoopbackTransportOptions, type StartBusServerOptions, type TransportAuth, type WebSocketServerLike, createBusServer, startBusServer };
@@ -0,0 +1 @@
1
+ import{n as e,r as t,t as n}from"../../server-lifecycle-FXTPW39-.mjs";var r=class{connectionListeners=new Set;on(e,t){e===`connection`&&this.connectionListeners.add(t)}off(e,t){e===`connection`&&this.connectionListeners.delete(t)}close(e){this.connectionListeners.clear(),e?.()}accept(e){for(let t of this.connectionListeners)t(e)}};export{r as HonoWebSocketBridge,t as LoopbackTransport,e as createBusServer,n as startBusServer};
@@ -0,0 +1,2 @@
1
+ import { n as startBusServer, t as StartBusServerOptions } from "../../server-lifecycle-YoSGFGnU.mjs";
2
+ export { StartBusServerOptions, startBusServer };
@@ -0,0 +1 @@
1
+ import{t as e}from"../../server-lifecycle-FXTPW39-.mjs";export{e as startBusServer};
@@ -0,0 +1,85 @@
1
+ //#region packages/machine-identity/src/machine-keys.d.ts
2
+ /**
3
+ * Persisted machine identity with ECDH and ECDSA keypairs.
4
+ * Loaded from or written to `~/.makaio/keys/` on Node.js.
5
+ * Used for E2E encryption and device pairing.
6
+ */
7
+ interface PersistedMachineIdentity {
8
+ /**
9
+ * Stable machine identifier used for key cache validation.
10
+ *
11
+ * Prefers a hardware-derived identifier from OS-native facilities, but may
12
+ * fall back to the cached `machine.id` value when native lookup is unavailable.
13
+ */
14
+ machineId: string;
15
+ /** ECDH keypair for key agreement */
16
+ ecdhKeyPair: CryptoKeyPair;
17
+ /** ECDSA keypair for signing */
18
+ signingKeyPair: CryptoKeyPair;
19
+ /** ECDH public key as base64url */
20
+ publicKey: string;
21
+ /** ECDSA signing public key as base64url */
22
+ signingPublicKey: string;
23
+ }
24
+ /**
25
+ * Status of machine key files.
26
+ * - 'complete': All required key files exist
27
+ * - 'partial': Some but not all key files exist
28
+ * - 'missing': No key files exist
29
+ */
30
+ type MachineKeyStatus = 'complete' | 'partial' | 'missing';
31
+ /**
32
+ * Result of machine key validation.
33
+ */
34
+ interface MachineKeyValidation {
35
+ /** Overall status of machine keys */
36
+ status: MachineKeyStatus;
37
+ /** Files that exist */
38
+ existing: string[];
39
+ /** Files that are missing */
40
+ missing: string[];
41
+ }
42
+ /**
43
+ * Load or generate machine identity.
44
+ *
45
+ * Seeds `machine.id` from OS-native facilities on first boot when available.
46
+ * After that, the persisted `machine.id` becomes the stable source of truth so
47
+ * pairing and E2E identities do not rotate if the native ID later changes or
48
+ * becomes newly available.
49
+ *
50
+ * On first run:
51
+ * - Creates the keys directory if it does not exist
52
+ * - Generates ECDH P-256 keypair → machine.key (PKCS8 PEM) + machine.pub (SPKI PEM)
53
+ * - Generates ECDSA P-256 keypair → machine-signing.key + machine-signing.pub
54
+ * - Writes resolved machine ID → machine.id
55
+ * - Sets file permissions to 0o600 (private key files)
56
+ *
57
+ * On subsequent runs:
58
+ * - Loads existing keys from PEM files
59
+ * - Warns if file permissions are too open
60
+ * @param keysDir - Directory for machine keys (e.g. `~/.makaio/keys`)
61
+ * @returns PersistedMachineIdentity with loaded/generated keys
62
+ */
63
+ declare function loadOrCreateMachineIdentity(keysDir: string): Promise<PersistedMachineIdentity>;
64
+ /**
65
+ * Validate machine key files and return detailed status.
66
+ *
67
+ * Checks existence of all required key files and categorizes the state:
68
+ * - 'complete': All 5 files exist (safe to load)
69
+ * - 'partial': Some files exist, some missing (inconsistent state)
70
+ * - 'missing': No files exist (safe to generate new keys)
71
+ * @param keysDir - Directory for machine keys (e.g. `~/.makaio/keys`)
72
+ * @returns Validation result with status and file details
73
+ */
74
+ declare function validateMachineKeys(keysDir: string): Promise<MachineKeyValidation>;
75
+ /**
76
+ * Check if machine keys exist.
77
+ *
78
+ * Returns true only if ALL required key files exist. If some files are missing,
79
+ * returns false and logs a warning about partial state.
80
+ * @param keysDir - Directory for machine keys (e.g. `~/.makaio/keys`)
81
+ * @returns true if all required key files exist
82
+ */
83
+ declare function machineKeysExist(keysDir: string): Promise<boolean>;
84
+ //#endregion
85
+ export { type MachineKeyStatus, type MachineKeyValidation, type PersistedMachineIdentity, loadOrCreateMachineIdentity, machineKeysExist, validateMachineKeys };
@@ -0,0 +1,3 @@
1
+ import{execFileSync as e}from"node:child_process";import*as t from"node:fs/promises";import*as n from"node:path";import*as r from"node:fs";const i=5e3;function a(e){if(!e)return;let t=e.trim().toLowerCase();if(/^[0-9a-f]{32}$/.test(t))return t;if(/^\{?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\}?$/.test(t))return t.replace(/[{}]/g,``)}function o(){try{switch(process.platform){case`darwin`:return s();case`linux`:return c();case`win32`:return l();default:return}}catch{return}}function s(){let t=e(`/usr/sbin/ioreg`,[`-rd1`,`-c`,`IOPlatformExpertDevice`],{encoding:`utf-8`,timeout:i});return a(/"IOPlatformUUID"\s*=\s*"([^"]+)"/.exec(t)?.[1])}function c(){for(let e of[`/etc/machine-id`,`/var/lib/dbus/machine-id`])try{let t=a(r.readFileSync(e,`utf-8`));if(t)return t}catch{}}function l(){let t=e(`${process.env.SystemRoot??`C:\\Windows`}\\System32\\reg.exe`,[`query`,`HKLM\\SOFTWARE\\Microsoft\\Cryptography`,`/v`,`MachineGuid`],{encoding:`utf-8`,timeout:i});return a(/MachineGuid\s+REG_SZ\s+([^\r\n]+)/.exec(t)?.[1])}const u=new Map;async function d(e){try{let n=a(await t.readFile(e,`utf-8`));return n||console.warn(`[machine-keys] Ignoring malformed cached machine.id at ${e}.`),n}catch(e){if(e.code===`ENOENT`)return;throw e}}async function f(e){return e===void 0?o()||(console.warn(`[machine-keys] Falling back to generated machine ID; OS-native machine ID was unavailable.`),globalThis.crypto.randomUUID()):e}async function p(e,n){try{await t.chmod(e,n)}catch(e){let t=e;if(process.platform===`win32`||t.code===`ENOSYS`||t.code===`EINVAL`)return;throw e}}function m(e){let t=e;return{dir:t,ecdhPrivPath:n.join(t,`machine.key`),ecdhPubPath:n.join(t,`machine.pub`),signingPrivPath:n.join(t,`machine-signing.key`),signingPubPath:n.join(t,`machine-signing.pub`),idPath:n.join(t,`machine.id`)}}async function h(e){await new Promise(t=>setTimeout(t,e))}async function g(e){let r=n.join(e,`.machine-keys.lock`),i=Date.now()+5e3;for(;;)try{return{file:await t.open(r,`wx`,384),path:r}}catch(t){if(t.code!==`EEXIST`)throw t;if(Date.now()>=i)throw Error(`[machine-keys] Timed out waiting for initialization lock in ${e}`,{cause:t});await h(50)}}async function _(e){await e.file.close(),await t.unlink(e.path).catch(()=>void 0)}async function v(e,n,r){let i=`${e}.tmp-${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}`;try{await t.writeFile(i,n,{mode:r}),await t.rename(i,e)}catch(e){throw await t.unlink(i).catch(()=>void 0),e}}async function y(e,n){let r=await t.readFile(e.ecdhPrivPath,`utf-8`),i=await t.readFile(e.ecdhPubPath,`utf-8`),a=await t.readFile(e.signingPrivPath,`utf-8`),o=await t.readFile(e.signingPubPath,`utf-8`);await w(e.ecdhPrivPath),await w(e.signingPrivPath);let s={privateKey:await A(r,`ECDH`),publicKey:await j(i,`ECDH`)},c={privateKey:await A(a,`ECDSA`),publicKey:await j(o,`ECDSA`)};return{machineId:n,ecdhKeyPair:s,signingKeyPair:c,publicKey:await k(s.publicKey),signingPublicKey:await k(c.publicKey)}}async function b(e,t,n){n!==void 0&&n!==t&&console.warn(`[machine-keys] Hardware ID changed. Regenerating keypairs.`);let r=await globalThis.crypto.subtle.generateKey({name:`ECDH`,namedCurve:`P-256`},!0,[`deriveKey`,`deriveBits`]),i=await globalThis.crypto.subtle.generateKey({name:`ECDSA`,namedCurve:`P-256`},!0,[`sign`,`verify`]),a=await D(r.privateKey),o=await O(r.publicKey),s=await D(i.privateKey),c=await O(i.publicKey);return await v(e.ecdhPrivPath,a,384),await v(e.ecdhPubPath,o,420),await v(e.signingPrivPath,s,384),await v(e.signingPubPath,c,420),await v(e.idPath,t,420),await p(e.ecdhPrivPath,384),await p(e.signingPrivPath,384),r={privateKey:await A(a,`ECDH`),publicKey:r.publicKey},i={privateKey:await A(s,`ECDSA`),publicKey:i.publicKey},{machineId:t,ecdhKeyPair:r,signingKeyPair:i,publicKey:await k(r.publicKey),signingPublicKey:await k(i.publicKey)}}async function x(e){let r=m(e),{dir:i,idPath:a}=r,o=u.get(i);if(o)return o;let s=(async()=>{await t.mkdir(i,{recursive:!0,mode:448});let o=await g(i);try{let t=await d(a),o=await S(e);if(o.status===`complete`&&t===void 0)throw Error(`[machine-keys] Missing or malformed machine.id in ${i} with complete key material present. Refusing to regenerate keys automatically to avoid identity rotation.`);let s=await f(t);if(o.status===`partial`){let e=o.missing.map(e=>n.basename(e)).join(`, `);throw Error(`[machine-keys] Incomplete machine key set in ${i}. Missing files: ${e}. Refusing to regenerate keys automatically because that would replace existing machine identity.`)}return o.status===`complete`&&t===s?await y(r,s):await b(r,s,t)}finally{await _(o)}})();u.set(i,s);try{return await s}finally{u.get(i)===s&&u.delete(i)}}async function S(e){let{idPath:n,ecdhPrivPath:r,ecdhPubPath:i,signingPrivPath:a,signingPubPath:o}=m(e),s=[n,r,i,a,o],c=await Promise.allSettled(s.map(e=>t.access(e).then(()=>e))),l=[],u=[];for(let[e,t]of c.entries())if(t.status===`fulfilled`)l.push(s[e]);else{let n=t.reason;if(n?.code===`ENOENT`)u.push(s[e]);else throw n}return{status:l.length===s.length?`complete`:l.length===0?`missing`:`partial`,existing:l,missing:u}}async function C(e){let t=await S(e);return t.status===`partial`&&console.warn(`Warning: Machine keys in partial state. Missing files:\n${t.missing.map(e=>` - ${n.basename(e)}`).join(`
2
+ `)}`),t.status===`complete`}async function w(e){let n=(await t.stat(e)).mode&511;(n&63||n&64)&&console.warn(`Warning: ${e} has permissive file mode ${n.toString(8)}. Should be 0o600.`)}function T(e,t){return`-----BEGIN ${e}-----\n${Buffer.from(t).toString(`base64`).match(/.{1,64}/g).join(`
3
+ `)}\n-----END ${e}-----\n`}function E(e,t){let n=e.replace(`-----BEGIN ${t}-----`,``).replace(`-----END ${t}-----`,``).replace(/\s/g,``),r=Buffer.from(n,`base64`);return new Uint8Array(r)}async function D(e){return T(`PRIVATE KEY`,await globalThis.crypto.subtle.exportKey(`pkcs8`,e))}async function O(e){return T(`PUBLIC KEY`,await globalThis.crypto.subtle.exportKey(`spki`,e))}async function k(e){let t=await globalThis.crypto.subtle.exportKey(`raw`,e);return Buffer.from(t).toString(`base64url`)}async function A(e,t){return globalThis.crypto.subtle.importKey(`pkcs8`,E(e,`PRIVATE KEY`),{name:t,namedCurve:`P-256`},!1,t===`ECDH`?[`deriveKey`,`deriveBits`]:[`sign`])}async function j(e,t){return globalThis.crypto.subtle.importKey(`spki`,E(e,`PUBLIC KEY`),{name:t,namedCurve:`P-256`},!0,t===`ECDH`?[]:[`verify`])}export{x as loadOrCreateMachineIdentity,C as machineKeysExist,S as validateMachineKeys};