@agimon-ai/doompi 0.0.1-alpha.76 → 0.0.1-alpha.78

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 (836) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +23 -0
  2. package/dist/antigravity.cjs +5 -0
  3. package/dist/antigravity.d.cts +2 -0
  4. package/dist/antigravity.d.mts +2 -0
  5. package/dist/antigravity.mjs +2 -0
  6. package/dist/api-contracts.cjs +11 -0
  7. package/dist/api-contracts.cjs.map +1 -0
  8. package/dist/api-contracts.d.cts +52 -0
  9. package/dist/api-contracts.d.cts.map +1 -0
  10. package/dist/api-contracts.d.mts +52 -0
  11. package/dist/api-contracts.d.mts.map +1 -0
  12. package/dist/api-contracts.mjs +7 -0
  13. package/dist/api-contracts.mjs.map +1 -0
  14. package/dist/base-command.cjs +3 -0
  15. package/dist/base-command.d.cts +2 -0
  16. package/dist/base-command.d.mts +2 -0
  17. package/dist/base-command.mjs +2 -0
  18. package/dist/bin/cli.cjs +29 -0
  19. package/dist/bin/cli.cjs.map +1 -0
  20. package/dist/bin/cli.d.cts +1 -0
  21. package/dist/bin/cli.d.mts +1 -0
  22. package/dist/bin/cli.mjs +30 -0
  23. package/dist/bin/cli.mjs.map +1 -0
  24. package/dist/bin/doomRunner.cjs +39 -0
  25. package/dist/bin/doomRunner.cjs.map +1 -0
  26. package/dist/bin/doomRunner.d.cts +12 -0
  27. package/dist/bin/doomRunner.d.cts.map +1 -0
  28. package/dist/bin/doomRunner.d.mts +12 -0
  29. package/dist/bin/doomRunner.d.mts.map +1 -0
  30. package/dist/bin/doomRunner.mjs +38 -0
  31. package/dist/bin/doomRunner.mjs.map +1 -0
  32. package/dist/bin/dpi.cjs +12 -0
  33. package/dist/bin/dpi.cjs.map +1 -0
  34. package/dist/bin/dpi.d.cts +1 -0
  35. package/dist/bin/dpi.d.mts +1 -0
  36. package/dist/bin/dpi.mjs +14 -0
  37. package/dist/bin/dpi.mjs.map +1 -0
  38. package/dist/bin/serve.cjs +11 -0
  39. package/dist/bin/serve.cjs.map +1 -0
  40. package/dist/bin/serve.d.cts +1 -0
  41. package/dist/bin/serve.d.mts +1 -0
  42. package/dist/bin/serve.mjs +13 -0
  43. package/dist/bin/serve.mjs.map +1 -0
  44. package/dist/builders/apiContractExport/index.cjs +81 -0
  45. package/dist/builders/apiContractExport/index.cjs.map +1 -0
  46. package/dist/builders/apiContractExport/index.mjs +77 -0
  47. package/dist/builders/apiContractExport/index.mjs.map +1 -0
  48. package/dist/builders/apiContracts/index.cjs +87 -0
  49. package/dist/builders/apiContracts/index.cjs.map +1 -0
  50. package/dist/builders/apiContracts/index.mjs +82 -0
  51. package/dist/builders/apiContracts/index.mjs.map +1 -0
  52. package/dist/builders/cli/bootstrapClaim.cjs +53 -0
  53. package/dist/builders/cli/bootstrapClaim.cjs.map +1 -0
  54. package/dist/builders/cli/bootstrapClaim.mjs +51 -0
  55. package/dist/builders/cli/bootstrapClaim.mjs.map +1 -0
  56. package/dist/builders/cli/bootstrapLocator/index.cjs +204 -0
  57. package/dist/builders/cli/bootstrapLocator/index.cjs.map +1 -0
  58. package/dist/builders/cli/bootstrapLocator/index.d.cts +5 -0
  59. package/dist/builders/cli/bootstrapLocator/index.d.cts.map +1 -0
  60. package/dist/builders/cli/bootstrapLocator/index.d.mts +5 -0
  61. package/dist/builders/cli/bootstrapLocator/index.d.mts.map +1 -0
  62. package/dist/builders/cli/bootstrapLocator/index.mjs +196 -0
  63. package/dist/builders/cli/bootstrapLocator/index.mjs.map +1 -0
  64. package/dist/builders/cli/composition.cjs +378 -0
  65. package/dist/builders/cli/composition.cjs.map +1 -0
  66. package/dist/builders/cli/composition.d.cts +119 -0
  67. package/dist/builders/cli/composition.d.cts.map +1 -0
  68. package/dist/builders/cli/composition.d.mts +119 -0
  69. package/dist/builders/cli/composition.d.mts.map +1 -0
  70. package/dist/builders/cli/composition.mjs +351 -0
  71. package/dist/builders/cli/composition.mjs.map +1 -0
  72. package/dist/builders/cli/compositionState.cjs +33 -0
  73. package/dist/builders/cli/compositionState.cjs.map +1 -0
  74. package/dist/builders/cli/compositionState.d.cts +9 -0
  75. package/dist/builders/cli/compositionState.d.cts.map +1 -0
  76. package/dist/builders/cli/compositionState.d.mts +9 -0
  77. package/dist/builders/cli/compositionState.d.mts.map +1 -0
  78. package/dist/builders/cli/compositionState.mjs +30 -0
  79. package/dist/builders/cli/compositionState.mjs.map +1 -0
  80. package/dist/builders/cli/constants.cjs +20 -0
  81. package/dist/builders/cli/constants.cjs.map +1 -0
  82. package/dist/builders/cli/constants.d.cts +17 -0
  83. package/dist/builders/cli/constants.d.cts.map +1 -0
  84. package/dist/builders/cli/constants.d.mts +17 -0
  85. package/dist/builders/cli/constants.d.mts.map +1 -0
  86. package/dist/builders/cli/constants.mjs +19 -0
  87. package/dist/builders/cli/constants.mjs.map +1 -0
  88. package/dist/builders/cli/contextCatalog.cjs +130 -0
  89. package/dist/builders/cli/contextCatalog.cjs.map +1 -0
  90. package/dist/builders/cli/contextCatalog.mjs +130 -0
  91. package/dist/builders/cli/contextCatalog.mjs.map +1 -0
  92. package/dist/builders/cli/dpiSettings.cjs +118 -0
  93. package/dist/builders/cli/dpiSettings.cjs.map +1 -0
  94. package/dist/builders/cli/dpiSettings.mjs +111 -0
  95. package/dist/builders/cli/dpiSettings.mjs.map +1 -0
  96. package/dist/builders/cli/entryResolution.cjs +23 -0
  97. package/dist/builders/cli/entryResolution.cjs.map +1 -0
  98. package/dist/builders/cli/entryResolution.d.cts +5 -0
  99. package/dist/builders/cli/entryResolution.d.cts.map +1 -0
  100. package/dist/builders/cli/entryResolution.d.mts +5 -0
  101. package/dist/builders/cli/entryResolution.d.mts.map +1 -0
  102. package/dist/builders/cli/entryResolution.mjs +20 -0
  103. package/dist/builders/cli/entryResolution.mjs.map +1 -0
  104. package/dist/builders/cli/extensionAssembler/index.cjs +386 -0
  105. package/dist/builders/cli/extensionAssembler/index.cjs.map +1 -0
  106. package/dist/builders/cli/extensionAssembler/index.d.cts +113 -0
  107. package/dist/builders/cli/extensionAssembler/index.d.cts.map +1 -0
  108. package/dist/builders/cli/extensionAssembler/index.d.mts +113 -0
  109. package/dist/builders/cli/extensionAssembler/index.d.mts.map +1 -0
  110. package/dist/builders/cli/extensionAssembler/index.mjs +376 -0
  111. package/dist/builders/cli/extensionAssembler/index.mjs.map +1 -0
  112. package/dist/builders/cli/harnessContext.cjs +186 -0
  113. package/dist/builders/cli/harnessContext.cjs.map +1 -0
  114. package/dist/builders/cli/harnessContext.d.cts +51 -0
  115. package/dist/builders/cli/harnessContext.d.cts.map +1 -0
  116. package/dist/builders/cli/harnessContext.d.mts +51 -0
  117. package/dist/builders/cli/harnessContext.d.mts.map +1 -0
  118. package/dist/builders/cli/harnessContext.mjs +179 -0
  119. package/dist/builders/cli/harnessContext.mjs.map +1 -0
  120. package/dist/builders/cli/index.cjs +151 -0
  121. package/dist/builders/cli/index.cjs.map +1 -0
  122. package/dist/builders/cli/index.d.cts +22 -0
  123. package/dist/builders/cli/index.d.cts.map +1 -0
  124. package/dist/builders/cli/index.d.mts +22 -0
  125. package/dist/builders/cli/index.d.mts.map +1 -0
  126. package/dist/builders/cli/index.mjs +147 -0
  127. package/dist/builders/cli/index.mjs.map +1 -0
  128. package/dist/builders/cli/launchPlan/index.cjs +102 -0
  129. package/dist/builders/cli/launchPlan/index.cjs.map +1 -0
  130. package/dist/builders/cli/launchPlan/index.d.cts +43 -0
  131. package/dist/builders/cli/launchPlan/index.d.cts.map +1 -0
  132. package/dist/builders/cli/launchPlan/index.d.mts +43 -0
  133. package/dist/builders/cli/launchPlan/index.d.mts.map +1 -0
  134. package/dist/builders/cli/launchPlan/index.mjs +100 -0
  135. package/dist/builders/cli/launchPlan/index.mjs.map +1 -0
  136. package/dist/builders/cli/launcherComposition/index.cjs +84 -0
  137. package/dist/builders/cli/launcherComposition/index.cjs.map +1 -0
  138. package/dist/builders/cli/launcherComposition/index.mjs +80 -0
  139. package/dist/builders/cli/launcherComposition/index.mjs.map +1 -0
  140. package/dist/builders/cli/piExtensionAlias/index.cjs +40 -0
  141. package/dist/builders/cli/piExtensionAlias/index.cjs.map +1 -0
  142. package/dist/builders/cli/piExtensionAlias/index.mjs +35 -0
  143. package/dist/builders/cli/piExtensionAlias/index.mjs.map +1 -0
  144. package/dist/builders/cli/piExtensionDispatcher/index.cjs +205 -0
  145. package/dist/builders/cli/piExtensionDispatcher/index.cjs.map +1 -0
  146. package/dist/builders/cli/piExtensionDispatcher/index.mjs +198 -0
  147. package/dist/builders/cli/piExtensionDispatcher/index.mjs.map +1 -0
  148. package/dist/builders/cli/prepare.cjs +64 -0
  149. package/dist/builders/cli/prepare.cjs.map +1 -0
  150. package/dist/builders/cli/prepare.mjs +62 -0
  151. package/dist/builders/cli/prepare.mjs.map +1 -0
  152. package/dist/builders/cli/projectSettings.cjs +155 -0
  153. package/dist/builders/cli/projectSettings.cjs.map +1 -0
  154. package/dist/builders/cli/projectSettings.d.cts +27 -0
  155. package/dist/builders/cli/projectSettings.d.cts.map +1 -0
  156. package/dist/builders/cli/projectSettings.d.mts +27 -0
  157. package/dist/builders/cli/projectSettings.d.mts.map +1 -0
  158. package/dist/builders/cli/projectSettings.mjs +144 -0
  159. package/dist/builders/cli/projectSettings.mjs.map +1 -0
  160. package/dist/builders/cli/runtimeBundle/index.cjs +130 -0
  161. package/dist/builders/cli/runtimeBundle/index.cjs.map +1 -0
  162. package/dist/builders/cli/runtimeBundle/index.d.cts +21 -0
  163. package/dist/builders/cli/runtimeBundle/index.d.cts.map +1 -0
  164. package/dist/builders/cli/runtimeBundle/index.d.mts +21 -0
  165. package/dist/builders/cli/runtimeBundle/index.d.mts.map +1 -0
  166. package/dist/builders/cli/runtimeBundle/index.mjs +126 -0
  167. package/dist/builders/cli/runtimeBundle/index.mjs.map +1 -0
  168. package/dist/builders/server/index.cjs +184 -0
  169. package/dist/builders/server/index.cjs.map +1 -0
  170. package/dist/builders/server/index.mjs +181 -0
  171. package/dist/builders/server/index.mjs.map +1 -0
  172. package/dist/builders/server/runtime.cjs +603 -0
  173. package/dist/builders/server/runtime.cjs.map +1 -0
  174. package/dist/builders/server/runtime.mjs +595 -0
  175. package/dist/builders/server/runtime.mjs.map +1 -0
  176. package/dist/builders/server/selectionStatus.cjs +12 -0
  177. package/dist/builders/server/selectionStatus.cjs.map +1 -0
  178. package/dist/builders/server/selectionStatus.mjs +12 -0
  179. package/dist/builders/server/selectionStatus.mjs.map +1 -0
  180. package/dist/builders/server/sessionArguments.cjs +22 -0
  181. package/dist/builders/server/sessionArguments.cjs.map +1 -0
  182. package/dist/builders/server/sessionArguments.mjs +22 -0
  183. package/dist/builders/server/sessionArguments.mjs.map +1 -0
  184. package/dist/builders/web/bundle.cjs +110 -0
  185. package/dist/builders/web/bundle.cjs.map +1 -0
  186. package/dist/builders/web/bundle.d.cts +29 -0
  187. package/dist/builders/web/bundle.d.cts.map +1 -0
  188. package/dist/builders/web/bundle.d.mts +29 -0
  189. package/dist/builders/web/bundle.d.mts.map +1 -0
  190. package/dist/builders/web/bundle.mjs +107 -0
  191. package/dist/builders/web/bundle.mjs.map +1 -0
  192. package/dist/builders/web/bundleAssetPolicy.cjs +96 -0
  193. package/dist/builders/web/bundleAssetPolicy.cjs.map +1 -0
  194. package/dist/builders/web/bundleAssetPolicy.d.cts +22 -0
  195. package/dist/builders/web/bundleAssetPolicy.d.cts.map +1 -0
  196. package/dist/builders/web/bundleAssetPolicy.d.mts +22 -0
  197. package/dist/builders/web/bundleAssetPolicy.d.mts.map +1 -0
  198. package/dist/builders/web/bundleAssetPolicy.mjs +95 -0
  199. package/dist/builders/web/bundleAssetPolicy.mjs.map +1 -0
  200. package/dist/builders/web/index.cjs +75 -0
  201. package/dist/builders/web/index.cjs.map +1 -0
  202. package/dist/builders/web/index.d.cts +29 -0
  203. package/dist/builders/web/index.d.cts.map +1 -0
  204. package/dist/builders/web/index.d.mts +29 -0
  205. package/dist/builders/web/index.d.mts.map +1 -0
  206. package/dist/builders/web/index.mjs +72 -0
  207. package/dist/builders/web/index.mjs.map +1 -0
  208. package/dist/builders/web/webDevRoots.cjs +27 -0
  209. package/dist/builders/web/webDevRoots.cjs.map +1 -0
  210. package/dist/builders/web/webDevRoots.d.cts +22 -0
  211. package/dist/builders/web/webDevRoots.d.cts.map +1 -0
  212. package/dist/builders/web/webDevRoots.d.mts +22 -0
  213. package/dist/builders/web/webDevRoots.d.mts.map +1 -0
  214. package/dist/builders/web/webDevRoots.mjs +25 -0
  215. package/dist/builders/web/webDevRoots.mjs.map +1 -0
  216. package/dist/builders/web/webPluginGenerate.cjs +113 -0
  217. package/dist/builders/web/webPluginGenerate.cjs.map +1 -0
  218. package/dist/builders/web/webPluginGenerate.d.cts +28 -0
  219. package/dist/builders/web/webPluginGenerate.d.cts.map +1 -0
  220. package/dist/builders/web/webPluginGenerate.d.mts +28 -0
  221. package/dist/builders/web/webPluginGenerate.d.mts.map +1 -0
  222. package/dist/builders/web/webPluginGenerate.mjs +106 -0
  223. package/dist/builders/web/webPluginGenerate.mjs.map +1 -0
  224. package/dist/builders/web/webPluginManifest.cjs +92 -0
  225. package/dist/builders/web/webPluginManifest.cjs.map +1 -0
  226. package/dist/builders/web/webPluginManifest.d.cts +44 -0
  227. package/dist/builders/web/webPluginManifest.d.cts.map +1 -0
  228. package/dist/builders/web/webPluginManifest.d.mts +44 -0
  229. package/dist/builders/web/webPluginManifest.d.mts.map +1 -0
  230. package/dist/builders/web/webPluginManifest.mjs +88 -0
  231. package/dist/builders/web/webPluginManifest.mjs.map +1 -0
  232. package/dist/builders/web/webPluginScan.cjs +53 -0
  233. package/dist/builders/web/webPluginScan.cjs.map +1 -0
  234. package/dist/builders/web/webPluginScan.d.cts +16 -0
  235. package/dist/builders/web/webPluginScan.d.cts.map +1 -0
  236. package/dist/builders/web/webPluginScan.d.mts +16 -0
  237. package/dist/builders/web/webPluginScan.d.mts.map +1 -0
  238. package/dist/builders/web/webPluginScan.mjs +50 -0
  239. package/dist/builders/web/webPluginScan.mjs.map +1 -0
  240. package/dist/builders/web/webPluginVite.cjs +124 -0
  241. package/dist/builders/web/webPluginVite.cjs.map +1 -0
  242. package/dist/builders/web/webPluginVite.d.cts +36 -0
  243. package/dist/builders/web/webPluginVite.d.cts.map +1 -0
  244. package/dist/builders/web/webPluginVite.d.mts +36 -0
  245. package/dist/builders/web/webPluginVite.d.mts.map +1 -0
  246. package/dist/builders/web/webPluginVite.mjs +116 -0
  247. package/dist/builders/web/webPluginVite.mjs.map +1 -0
  248. package/dist/builders/web.cjs +33 -0
  249. package/dist/builders/web.d.cts +9 -0
  250. package/dist/builders/web.d.mts +9 -0
  251. package/dist/builders/web.mjs +9 -0
  252. package/dist/cli/cliApp.cjs +177 -0
  253. package/dist/cli/cliApp.cjs.map +1 -0
  254. package/dist/cli/cliApp.d.cts +25 -0
  255. package/dist/cli/cliApp.d.cts.map +1 -0
  256. package/dist/cli/cliApp.d.mts +25 -0
  257. package/dist/cli/cliApp.d.mts.map +1 -0
  258. package/dist/cli/cliApp.mjs +175 -0
  259. package/dist/cli/cliApp.mjs.map +1 -0
  260. package/dist/cli/commands/api-export/index.cjs +65 -0
  261. package/dist/cli/commands/api-export/index.cjs.map +1 -0
  262. package/dist/cli/commands/api-export/index.mjs +61 -0
  263. package/dist/cli/commands/api-export/index.mjs.map +1 -0
  264. package/dist/cli/commands/baseCommand.cjs +16 -0
  265. package/dist/cli/commands/baseCommand.cjs.map +1 -0
  266. package/dist/cli/commands/baseCommand.d.cts +24 -0
  267. package/dist/cli/commands/baseCommand.d.cts.map +1 -0
  268. package/dist/cli/commands/baseCommand.d.mts +24 -0
  269. package/dist/cli/commands/baseCommand.d.mts.map +1 -0
  270. package/dist/cli/commands/baseCommand.mjs +16 -0
  271. package/dist/cli/commands/baseCommand.mjs.map +1 -0
  272. package/dist/cli/commands/compat/context.cjs +115 -0
  273. package/dist/cli/commands/compat/context.cjs.map +1 -0
  274. package/dist/cli/commands/compat/context.d.cts +22 -0
  275. package/dist/cli/commands/compat/context.d.cts.map +1 -0
  276. package/dist/cli/commands/compat/context.d.mts +22 -0
  277. package/dist/cli/commands/compat/context.d.mts.map +1 -0
  278. package/dist/cli/commands/compat/context.mjs +110 -0
  279. package/dist/cli/commands/compat/context.mjs.map +1 -0
  280. package/dist/cli/commands/compat/help.cjs +26 -0
  281. package/dist/cli/commands/compat/help.cjs.map +1 -0
  282. package/dist/cli/commands/compat/help.d.cts +4 -0
  283. package/dist/cli/commands/compat/help.d.cts.map +1 -0
  284. package/dist/cli/commands/compat/help.d.mts +4 -0
  285. package/dist/cli/commands/compat/help.d.mts.map +1 -0
  286. package/dist/cli/commands/compat/help.mjs +25 -0
  287. package/dist/cli/commands/compat/help.mjs.map +1 -0
  288. package/dist/cli/commands/compat/index.cjs +73 -0
  289. package/dist/cli/commands/compat/index.cjs.map +1 -0
  290. package/dist/cli/commands/compat/index.d.cts +14 -0
  291. package/dist/cli/commands/compat/index.d.cts.map +1 -0
  292. package/dist/cli/commands/compat/index.d.mts +14 -0
  293. package/dist/cli/commands/compat/index.d.mts.map +1 -0
  294. package/dist/cli/commands/compat/index.mjs +70 -0
  295. package/dist/cli/commands/compat/index.mjs.map +1 -0
  296. package/dist/cli/commands/compat/options.cjs +88 -0
  297. package/dist/cli/commands/compat/options.cjs.map +1 -0
  298. package/dist/cli/commands/compat/options.d.cts +15 -0
  299. package/dist/cli/commands/compat/options.d.cts.map +1 -0
  300. package/dist/cli/commands/compat/options.d.mts +15 -0
  301. package/dist/cli/commands/compat/options.d.mts.map +1 -0
  302. package/dist/cli/commands/compat/options.mjs +86 -0
  303. package/dist/cli/commands/compat/options.mjs.map +1 -0
  304. package/dist/cli/commands/compat/providers/antigravity.cjs +294 -0
  305. package/dist/cli/commands/compat/providers/antigravity.cjs.map +1 -0
  306. package/dist/cli/commands/compat/providers/antigravity.d.cts +9 -0
  307. package/dist/cli/commands/compat/providers/antigravity.d.cts.map +1 -0
  308. package/dist/cli/commands/compat/providers/antigravity.d.mts +9 -0
  309. package/dist/cli/commands/compat/providers/antigravity.d.mts.map +1 -0
  310. package/dist/cli/commands/compat/providers/antigravity.mjs +289 -0
  311. package/dist/cli/commands/compat/providers/antigravity.mjs.map +1 -0
  312. package/dist/cli/commands/compat/providers/codex.cjs +178 -0
  313. package/dist/cli/commands/compat/providers/codex.cjs.map +1 -0
  314. package/dist/cli/commands/compat/providers/codex.d.cts +17 -0
  315. package/dist/cli/commands/compat/providers/codex.d.cts.map +1 -0
  316. package/dist/cli/commands/compat/providers/codex.d.mts +17 -0
  317. package/dist/cli/commands/compat/providers/codex.d.mts.map +1 -0
  318. package/dist/cli/commands/compat/providers/codex.mjs +170 -0
  319. package/dist/cli/commands/compat/providers/codex.mjs.map +1 -0
  320. package/dist/cli/commands/compat/providers/index.cjs +65 -0
  321. package/dist/cli/commands/compat/providers/index.cjs.map +1 -0
  322. package/dist/cli/commands/compat/providers/index.d.cts +15 -0
  323. package/dist/cli/commands/compat/providers/index.d.cts.map +1 -0
  324. package/dist/cli/commands/compat/providers/index.d.mts +15 -0
  325. package/dist/cli/commands/compat/providers/index.d.mts.map +1 -0
  326. package/dist/cli/commands/compat/providers/index.mjs +45 -0
  327. package/dist/cli/commands/compat/providers/index.mjs.map +1 -0
  328. package/dist/cli/commands/compat/providers/process.cjs +172 -0
  329. package/dist/cli/commands/compat/providers/process.cjs.map +1 -0
  330. package/dist/cli/commands/compat/providers/process.d.cts +33 -0
  331. package/dist/cli/commands/compat/providers/process.d.cts.map +1 -0
  332. package/dist/cli/commands/compat/providers/process.d.mts +33 -0
  333. package/dist/cli/commands/compat/providers/process.d.mts.map +1 -0
  334. package/dist/cli/commands/compat/providers/process.mjs +159 -0
  335. package/dist/cli/commands/compat/providers/process.mjs.map +1 -0
  336. package/dist/cli/commands/compat/providers/shared.cjs +76 -0
  337. package/dist/cli/commands/compat/providers/shared.cjs.map +1 -0
  338. package/dist/cli/commands/compat/providers/shared.d.cts +40 -0
  339. package/dist/cli/commands/compat/providers/shared.d.cts.map +1 -0
  340. package/dist/cli/commands/compat/providers/shared.d.mts +40 -0
  341. package/dist/cli/commands/compat/providers/shared.d.mts.map +1 -0
  342. package/dist/cli/commands/compat/providers/shared.mjs +61 -0
  343. package/dist/cli/commands/compat/providers/shared.mjs.map +1 -0
  344. package/dist/cli/commands/compat/types.d.cts +31 -0
  345. package/dist/cli/commands/compat/types.d.cts.map +1 -0
  346. package/dist/cli/commands/compat/types.d.mts +31 -0
  347. package/dist/cli/commands/compat/types.d.mts.map +1 -0
  348. package/dist/cli/commands/doctor/help.cjs +19 -0
  349. package/dist/cli/commands/doctor/help.cjs.map +1 -0
  350. package/dist/cli/commands/doctor/help.d.cts +4 -0
  351. package/dist/cli/commands/doctor/help.d.cts.map +1 -0
  352. package/dist/cli/commands/doctor/help.d.mts +4 -0
  353. package/dist/cli/commands/doctor/help.d.mts.map +1 -0
  354. package/dist/cli/commands/doctor/help.mjs +19 -0
  355. package/dist/cli/commands/doctor/help.mjs.map +1 -0
  356. package/dist/cli/commands/doctor/index.cjs +116 -0
  357. package/dist/cli/commands/doctor/index.cjs.map +1 -0
  358. package/dist/cli/commands/doctor/index.d.cts +12 -0
  359. package/dist/cli/commands/doctor/index.d.cts.map +1 -0
  360. package/dist/cli/commands/doctor/index.d.mts +12 -0
  361. package/dist/cli/commands/doctor/index.d.mts.map +1 -0
  362. package/dist/cli/commands/doctor/index.mjs +112 -0
  363. package/dist/cli/commands/doctor/index.mjs.map +1 -0
  364. package/dist/cli/commands/emit-mcp/index.cjs +32 -0
  365. package/dist/cli/commands/emit-mcp/index.cjs.map +1 -0
  366. package/dist/cli/commands/emit-mcp/index.d.cts +19 -0
  367. package/dist/cli/commands/emit-mcp/index.d.cts.map +1 -0
  368. package/dist/cli/commands/emit-mcp/index.d.mts +19 -0
  369. package/dist/cli/commands/emit-mcp/index.d.mts.map +1 -0
  370. package/dist/cli/commands/emit-mcp/index.mjs +31 -0
  371. package/dist/cli/commands/emit-mcp/index.mjs.map +1 -0
  372. package/dist/cli/commands/explain/index.cjs +155 -0
  373. package/dist/cli/commands/explain/index.cjs.map +1 -0
  374. package/dist/cli/commands/explain/index.d.cts +57 -0
  375. package/dist/cli/commands/explain/index.d.cts.map +1 -0
  376. package/dist/cli/commands/explain/index.d.mts +57 -0
  377. package/dist/cli/commands/explain/index.d.mts.map +1 -0
  378. package/dist/cli/commands/explain/index.mjs +150 -0
  379. package/dist/cli/commands/explain/index.mjs.map +1 -0
  380. package/dist/cli/commands/history-export/help.cjs +18 -0
  381. package/dist/cli/commands/history-export/help.cjs.map +1 -0
  382. package/dist/cli/commands/history-export/help.d.cts +4 -0
  383. package/dist/cli/commands/history-export/help.d.cts.map +1 -0
  384. package/dist/cli/commands/history-export/help.d.mts +4 -0
  385. package/dist/cli/commands/history-export/help.d.mts.map +1 -0
  386. package/dist/cli/commands/history-export/help.mjs +18 -0
  387. package/dist/cli/commands/history-export/help.mjs.map +1 -0
  388. package/dist/cli/commands/history-export/index.cjs +76 -0
  389. package/dist/cli/commands/history-export/index.cjs.map +1 -0
  390. package/dist/cli/commands/history-export/index.mjs +74 -0
  391. package/dist/cli/commands/history-export/index.mjs.map +1 -0
  392. package/dist/cli/commands/history-import/help.cjs +20 -0
  393. package/dist/cli/commands/history-import/help.cjs.map +1 -0
  394. package/dist/cli/commands/history-import/help.d.cts +4 -0
  395. package/dist/cli/commands/history-import/help.d.cts.map +1 -0
  396. package/dist/cli/commands/history-import/help.d.mts +4 -0
  397. package/dist/cli/commands/history-import/help.d.mts.map +1 -0
  398. package/dist/cli/commands/history-import/help.mjs +20 -0
  399. package/dist/cli/commands/history-import/help.mjs.map +1 -0
  400. package/dist/cli/commands/history-import/index.cjs +78 -0
  401. package/dist/cli/commands/history-import/index.cjs.map +1 -0
  402. package/dist/cli/commands/history-import/index.mjs +75 -0
  403. package/dist/cli/commands/history-import/index.mjs.map +1 -0
  404. package/dist/cli/commands/init/constants.cjs +11 -0
  405. package/dist/cli/commands/init/constants.cjs.map +1 -0
  406. package/dist/cli/commands/init/constants.mjs +11 -0
  407. package/dist/cli/commands/init/constants.mjs.map +1 -0
  408. package/dist/cli/commands/init/help.cjs +17 -0
  409. package/dist/cli/commands/init/help.cjs.map +1 -0
  410. package/dist/cli/commands/init/help.d.cts +4 -0
  411. package/dist/cli/commands/init/help.d.cts.map +1 -0
  412. package/dist/cli/commands/init/help.d.mts +4 -0
  413. package/dist/cli/commands/init/help.d.mts.map +1 -0
  414. package/dist/cli/commands/init/help.mjs +17 -0
  415. package/dist/cli/commands/init/help.mjs.map +1 -0
  416. package/dist/cli/commands/init/index.cjs +87 -0
  417. package/dist/cli/commands/init/index.cjs.map +1 -0
  418. package/dist/cli/commands/init/index.d.cts +12 -0
  419. package/dist/cli/commands/init/index.d.cts.map +1 -0
  420. package/dist/cli/commands/init/index.d.mts +12 -0
  421. package/dist/cli/commands/init/index.d.mts.map +1 -0
  422. package/dist/cli/commands/init/index.mjs +83 -0
  423. package/dist/cli/commands/init/index.mjs.map +1 -0
  424. package/dist/cli/commands/init/presenter.cjs +170 -0
  425. package/dist/cli/commands/init/presenter.cjs.map +1 -0
  426. package/dist/cli/commands/init/presenter.d.cts +8 -0
  427. package/dist/cli/commands/init/presenter.d.cts.map +1 -0
  428. package/dist/cli/commands/init/presenter.d.mts +8 -0
  429. package/dist/cli/commands/init/presenter.d.mts.map +1 -0
  430. package/dist/cli/commands/init/presenter.mjs +170 -0
  431. package/dist/cli/commands/init/presenter.mjs.map +1 -0
  432. package/dist/cli/commands/launch/index.cjs +128 -0
  433. package/dist/cli/commands/launch/index.cjs.map +1 -0
  434. package/dist/cli/commands/launch/index.d.cts +29 -0
  435. package/dist/cli/commands/launch/index.d.cts.map +1 -0
  436. package/dist/cli/commands/launch/index.d.mts +29 -0
  437. package/dist/cli/commands/launch/index.d.mts.map +1 -0
  438. package/dist/cli/commands/launch/index.mjs +122 -0
  439. package/dist/cli/commands/launch/index.mjs.map +1 -0
  440. package/dist/cli/commands/sandbox/args.cjs +50 -0
  441. package/dist/cli/commands/sandbox/args.cjs.map +1 -0
  442. package/dist/cli/commands/sandbox/args.mjs +50 -0
  443. package/dist/cli/commands/sandbox/args.mjs.map +1 -0
  444. package/dist/cli/commands/sandbox/harness.cjs +61 -0
  445. package/dist/cli/commands/sandbox/harness.cjs.map +1 -0
  446. package/dist/cli/commands/sandbox/harness.mjs +60 -0
  447. package/dist/cli/commands/sandbox/harness.mjs.map +1 -0
  448. package/dist/cli/commands/sandbox/index.cjs +57 -0
  449. package/dist/cli/commands/sandbox/index.cjs.map +1 -0
  450. package/dist/cli/commands/sandbox/index.mjs +56 -0
  451. package/dist/cli/commands/sandbox/index.mjs.map +1 -0
  452. package/dist/cli/commands/sync/help.cjs +31 -0
  453. package/dist/cli/commands/sync/help.cjs.map +1 -0
  454. package/dist/cli/commands/sync/help.d.cts +4 -0
  455. package/dist/cli/commands/sync/help.d.cts.map +1 -0
  456. package/dist/cli/commands/sync/help.d.mts +4 -0
  457. package/dist/cli/commands/sync/help.d.mts.map +1 -0
  458. package/dist/cli/commands/sync/help.mjs +31 -0
  459. package/dist/cli/commands/sync/help.mjs.map +1 -0
  460. package/dist/cli/commands/sync/index.cjs +577 -0
  461. package/dist/cli/commands/sync/index.cjs.map +1 -0
  462. package/dist/cli/commands/sync/index.d.cts +65 -0
  463. package/dist/cli/commands/sync/index.d.cts.map +1 -0
  464. package/dist/cli/commands/sync/index.d.mts +65 -0
  465. package/dist/cli/commands/sync/index.d.mts.map +1 -0
  466. package/dist/cli/commands/sync/index.mjs +560 -0
  467. package/dist/cli/commands/sync/index.mjs.map +1 -0
  468. package/dist/cli/commands/sync/prepare.cjs +43 -0
  469. package/dist/cli/commands/sync/prepare.cjs.map +1 -0
  470. package/dist/cli/commands/sync/prepare.mjs +40 -0
  471. package/dist/cli/commands/sync/prepare.mjs.map +1 -0
  472. package/dist/cli/commands/sync/presenter.cjs +58 -0
  473. package/dist/cli/commands/sync/presenter.cjs.map +1 -0
  474. package/dist/cli/commands/sync/presenter.d.cts +16 -0
  475. package/dist/cli/commands/sync/presenter.d.cts.map +1 -0
  476. package/dist/cli/commands/sync/presenter.d.mts +16 -0
  477. package/dist/cli/commands/sync/presenter.d.mts.map +1 -0
  478. package/dist/cli/commands/sync/presenter.mjs +57 -0
  479. package/dist/cli/commands/sync/presenter.mjs.map +1 -0
  480. package/dist/cli/commands/sync/workflow.cjs +99 -0
  481. package/dist/cli/commands/sync/workflow.cjs.map +1 -0
  482. package/dist/cli/commands/sync/workflow.mjs +96 -0
  483. package/dist/cli/commands/sync/workflow.mjs.map +1 -0
  484. package/dist/cli/dpi.cjs +98 -0
  485. package/dist/cli/dpi.cjs.map +1 -0
  486. package/dist/cli/dpi.mjs +91 -0
  487. package/dist/cli/dpi.mjs.map +1 -0
  488. package/dist/cli/harnessOptions.cjs +60 -0
  489. package/dist/cli/harnessOptions.cjs.map +1 -0
  490. package/dist/cli/harnessOptions.d.cts +24 -0
  491. package/dist/cli/harnessOptions.d.cts.map +1 -0
  492. package/dist/cli/harnessOptions.d.mts +24 -0
  493. package/dist/cli/harnessOptions.d.mts.map +1 -0
  494. package/dist/cli/harnessOptions.mjs +57 -0
  495. package/dist/cli/harnessOptions.mjs.map +1 -0
  496. package/dist/cli/help.cjs +89 -0
  497. package/dist/cli/help.cjs.map +1 -0
  498. package/dist/cli/help.d.cts +12 -0
  499. package/dist/cli/help.d.cts.map +1 -0
  500. package/dist/cli/help.d.mts +12 -0
  501. package/dist/cli/help.d.mts.map +1 -0
  502. package/dist/cli/help.mjs +83 -0
  503. package/dist/cli/help.mjs.map +1 -0
  504. package/dist/cli/matrixOptions.cjs +178 -0
  505. package/dist/cli/matrixOptions.cjs.map +1 -0
  506. package/dist/cli/matrixOptions.d.cts +90 -0
  507. package/dist/cli/matrixOptions.d.cts.map +1 -0
  508. package/dist/cli/matrixOptions.d.mts +90 -0
  509. package/dist/cli/matrixOptions.d.mts.map +1 -0
  510. package/dist/cli/matrixOptions.mjs +151 -0
  511. package/dist/cli/matrixOptions.mjs.map +1 -0
  512. package/dist/cli/options.cjs +306 -0
  513. package/dist/cli/options.cjs.map +1 -0
  514. package/dist/cli/options.d.cts +5 -0
  515. package/dist/cli/options.d.cts.map +1 -0
  516. package/dist/cli/options.d.mts +5 -0
  517. package/dist/cli/options.d.mts.map +1 -0
  518. package/dist/cli/options.mjs +304 -0
  519. package/dist/cli/options.mjs.map +1 -0
  520. package/dist/cli/router.cjs +59 -0
  521. package/dist/cli/router.cjs.map +1 -0
  522. package/dist/cli/router.d.cts +32 -0
  523. package/dist/cli/router.d.cts.map +1 -0
  524. package/dist/cli/router.d.mts +32 -0
  525. package/dist/cli/router.d.mts.map +1 -0
  526. package/dist/cli/router.mjs +56 -0
  527. package/dist/cli/router.mjs.map +1 -0
  528. package/dist/cli/server/options.cjs +71 -0
  529. package/dist/cli/server/options.cjs.map +1 -0
  530. package/dist/cli/server/options.mjs +70 -0
  531. package/dist/cli/server/options.mjs.map +1 -0
  532. package/dist/cli/server/run.cjs +45 -0
  533. package/dist/cli/server/run.cjs.map +1 -0
  534. package/dist/cli/server/run.mjs +45 -0
  535. package/dist/cli/server/run.mjs.map +1 -0
  536. package/dist/cli-app.cjs +5 -0
  537. package/dist/cli-app.d.cts +2 -0
  538. package/dist/cli-app.d.mts +2 -0
  539. package/dist/cli-app.mjs +2 -0
  540. package/dist/cli.cjs +28 -0
  541. package/dist/cli.d.cts +11 -0
  542. package/dist/cli.d.mts +11 -0
  543. package/dist/cli.mjs +11 -0
  544. package/dist/codex.cjs +8 -0
  545. package/dist/codex.d.cts +2 -0
  546. package/dist/codex.d.mts +2 -0
  547. package/dist/codex.mjs +2 -0
  548. package/dist/commands.cjs +23 -0
  549. package/dist/commands.d.cts +9 -0
  550. package/dist/commands.d.mts +9 -0
  551. package/dist/commands.mjs +9 -0
  552. package/dist/compatibility-command.cjs +4 -0
  553. package/dist/compatibility-command.d.cts +2 -0
  554. package/dist/compatibility-command.d.mts +2 -0
  555. package/dist/compatibility-command.mjs +2 -0
  556. package/dist/compatibility-context.cjs +3 -0
  557. package/dist/compatibility-context.d.cts +2 -0
  558. package/dist/compatibility-context.d.mts +2 -0
  559. package/dist/compatibility-context.mjs +2 -0
  560. package/dist/compatibility-options.cjs +5 -0
  561. package/dist/compatibility-options.d.cts +2 -0
  562. package/dist/compatibility-options.d.mts +2 -0
  563. package/dist/compatibility-options.mjs +2 -0
  564. package/dist/compatibility.cjs +27 -0
  565. package/dist/compatibility.d.cts +6 -0
  566. package/dist/compatibility.d.mts +6 -0
  567. package/dist/compatibility.mjs +6 -0
  568. package/dist/compiler/cache.cjs +331 -0
  569. package/dist/compiler/cache.cjs.map +1 -0
  570. package/dist/compiler/cache.mjs +323 -0
  571. package/dist/compiler/cache.mjs.map +1 -0
  572. package/dist/compiler/index.cjs +996 -0
  573. package/dist/compiler/index.cjs.map +1 -0
  574. package/dist/compiler/index.mjs +988 -0
  575. package/dist/compiler/index.mjs.map +1 -0
  576. package/dist/compiler/inputs.cjs +83 -0
  577. package/dist/compiler/inputs.cjs.map +1 -0
  578. package/dist/compiler/inputs.mjs +78 -0
  579. package/dist/compiler/inputs.mjs.map +1 -0
  580. package/dist/composer.cjs +28 -0
  581. package/dist/composer.d.cts +4 -0
  582. package/dist/composer.d.mts +4 -0
  583. package/dist/composer.mjs +4 -0
  584. package/dist/composition/harnessState/index.cjs +48 -0
  585. package/dist/composition/harnessState/index.cjs.map +1 -0
  586. package/dist/composition/harnessState/index.d.cts +19 -0
  587. package/dist/composition/harnessState/index.d.cts.map +1 -0
  588. package/dist/composition/harnessState/index.d.mts +19 -0
  589. package/dist/composition/harnessState/index.d.mts.map +1 -0
  590. package/dist/composition/harnessState/index.mjs +34 -0
  591. package/dist/composition/harnessState/index.mjs.map +1 -0
  592. package/dist/composition/layerPackageInstaller/index.cjs +342 -0
  593. package/dist/composition/layerPackageInstaller/index.cjs.map +1 -0
  594. package/dist/composition/layerPackageInstaller/index.d.cts +45 -0
  595. package/dist/composition/layerPackageInstaller/index.d.cts.map +1 -0
  596. package/dist/composition/layerPackageInstaller/index.d.mts +45 -0
  597. package/dist/composition/layerPackageInstaller/index.d.mts.map +1 -0
  598. package/dist/composition/layerPackageInstaller/index.mjs +334 -0
  599. package/dist/composition/layerPackageInstaller/index.mjs.map +1 -0
  600. package/dist/composition/projectTrust/index.cjs +51 -0
  601. package/dist/composition/projectTrust/index.cjs.map +1 -0
  602. package/dist/composition/projectTrust/index.d.cts +22 -0
  603. package/dist/composition/projectTrust/index.d.cts.map +1 -0
  604. package/dist/composition/projectTrust/index.d.mts +22 -0
  605. package/dist/composition/projectTrust/index.d.mts.map +1 -0
  606. package/dist/composition/projectTrust/index.mjs +48 -0
  607. package/dist/composition/projectTrust/index.mjs.map +1 -0
  608. package/dist/composition/repository/index.cjs +69 -0
  609. package/dist/composition/repository/index.cjs.map +1 -0
  610. package/dist/composition/repository/index.d.cts +22 -0
  611. package/dist/composition/repository/index.d.cts.map +1 -0
  612. package/dist/composition/repository/index.d.mts +22 -0
  613. package/dist/composition/repository/index.d.mts.map +1 -0
  614. package/dist/composition/repository/index.mjs +64 -0
  615. package/dist/composition/repository/index.mjs.map +1 -0
  616. package/dist/composition/syncDrift/index.cjs +160 -0
  617. package/dist/composition/syncDrift/index.cjs.map +1 -0
  618. package/dist/composition/syncDrift/index.d.cts +41 -0
  619. package/dist/composition/syncDrift/index.d.cts.map +1 -0
  620. package/dist/composition/syncDrift/index.d.mts +41 -0
  621. package/dist/composition/syncDrift/index.d.mts.map +1 -0
  622. package/dist/composition/syncDrift/index.mjs +152 -0
  623. package/dist/composition/syncDrift/index.mjs.map +1 -0
  624. package/dist/composition/syncState/index.cjs +593 -0
  625. package/dist/composition/syncState/index.cjs.map +1 -0
  626. package/dist/composition/syncState/index.d.cts +188 -0
  627. package/dist/composition/syncState/index.d.cts.map +1 -0
  628. package/dist/composition/syncState/index.d.mts +188 -0
  629. package/dist/composition/syncState/index.d.mts.map +1 -0
  630. package/dist/composition/syncState/index.mjs +559 -0
  631. package/dist/composition/syncState/index.mjs.map +1 -0
  632. package/dist/composition/transitionLayers.cjs +17 -0
  633. package/dist/composition/transitionLayers.cjs.map +1 -0
  634. package/dist/composition/transitionLayers.d.cts +6 -0
  635. package/dist/composition/transitionLayers.d.cts.map +1 -0
  636. package/dist/composition/transitionLayers.d.mts +6 -0
  637. package/dist/composition/transitionLayers.d.mts.map +1 -0
  638. package/dist/composition/transitionLayers.mjs +16 -0
  639. package/dist/composition/transitionLayers.mjs.map +1 -0
  640. package/dist/composition/types/harness.d.cts +49 -0
  641. package/dist/composition/types/harness.d.cts.map +1 -0
  642. package/dist/composition/types/harness.d.mts +49 -0
  643. package/dist/composition/types/harness.d.mts.map +1 -0
  644. package/dist/config.cjs +163 -0
  645. package/dist/config.d.cts +7 -0
  646. package/dist/config.d.mts +7 -0
  647. package/dist/config.mjs +7 -0
  648. package/dist/emit-mcp-command.cjs +4 -0
  649. package/dist/emit-mcp-command.d.cts +2 -0
  650. package/dist/emit-mcp-command.d.mts +2 -0
  651. package/dist/emit-mcp-command.mjs +2 -0
  652. package/dist/explain-command.cjs +5 -0
  653. package/dist/explain-command.d.cts +2 -0
  654. package/dist/explain-command.d.mts +2 -0
  655. package/dist/explain-command.mjs +2 -0
  656. package/dist/extensions/agent-model.cjs +41 -0
  657. package/dist/extensions/agent-model.cjs.map +1 -0
  658. package/dist/extensions/agent-model.d.cts +22 -0
  659. package/dist/extensions/agent-model.d.cts.map +1 -0
  660. package/dist/extensions/agent-model.d.mts +22 -0
  661. package/dist/extensions/agent-model.d.mts.map +1 -0
  662. package/dist/extensions/agent-model.mjs +35 -0
  663. package/dist/extensions/agent-model.mjs.map +1 -0
  664. package/dist/extensions/composed-pi.cjs +46 -0
  665. package/dist/extensions/composed-pi.cjs.map +1 -0
  666. package/dist/extensions/composed-pi.d.cts +13 -0
  667. package/dist/extensions/composed-pi.d.cts.map +1 -0
  668. package/dist/extensions/composed-pi.d.mts +13 -0
  669. package/dist/extensions/composed-pi.d.mts.map +1 -0
  670. package/dist/extensions/composed-pi.mjs +41 -0
  671. package/dist/extensions/composed-pi.mjs.map +1 -0
  672. package/dist/extensions/context-catalog.cjs +96 -0
  673. package/dist/extensions/context-catalog.cjs.map +1 -0
  674. package/dist/extensions/context-catalog.d.cts +4 -0
  675. package/dist/extensions/context-catalog.d.cts.map +1 -0
  676. package/dist/extensions/context-catalog.d.mts +5 -0
  677. package/dist/extensions/context-catalog.d.mts.map +1 -0
  678. package/dist/extensions/context-catalog.mjs +96 -0
  679. package/dist/extensions/context-catalog.mjs.map +1 -0
  680. package/dist/extensions/cordis-finalizer.cjs +24 -0
  681. package/dist/extensions/cordis-finalizer.cjs.map +1 -0
  682. package/dist/extensions/cordis-finalizer.d.cts +7 -0
  683. package/dist/extensions/cordis-finalizer.d.cts.map +1 -0
  684. package/dist/extensions/cordis-finalizer.d.mts +7 -0
  685. package/dist/extensions/cordis-finalizer.d.mts.map +1 -0
  686. package/dist/extensions/cordis-finalizer.mjs +19 -0
  687. package/dist/extensions/cordis-finalizer.mjs.map +1 -0
  688. package/dist/extensions/cordis-host.cjs +19 -0
  689. package/dist/extensions/cordis-host.cjs.map +1 -0
  690. package/dist/extensions/cordis-host.d.cts +7 -0
  691. package/dist/extensions/cordis-host.d.cts.map +1 -0
  692. package/dist/extensions/cordis-host.d.mts +7 -0
  693. package/dist/extensions/cordis-host.d.mts.map +1 -0
  694. package/dist/extensions/cordis-host.mjs +14 -0
  695. package/dist/extensions/cordis-host.mjs.map +1 -0
  696. package/dist/extensions/effort.cjs +54 -0
  697. package/dist/extensions/effort.cjs.map +1 -0
  698. package/dist/extensions/effort.d.cts +8 -0
  699. package/dist/extensions/effort.d.cts.map +1 -0
  700. package/dist/extensions/effort.d.mts +8 -0
  701. package/dist/extensions/effort.d.mts.map +1 -0
  702. package/dist/extensions/effort.mjs +48 -0
  703. package/dist/extensions/effort.mjs.map +1 -0
  704. package/dist/extensions/launcher-bootstrap.cjs +38 -0
  705. package/dist/extensions/launcher-bootstrap.cjs.map +1 -0
  706. package/dist/extensions/launcher-bootstrap.d.cts +16 -0
  707. package/dist/extensions/launcher-bootstrap.d.cts.map +1 -0
  708. package/dist/extensions/launcher-bootstrap.d.mts +16 -0
  709. package/dist/extensions/launcher-bootstrap.d.mts.map +1 -0
  710. package/dist/extensions/launcher-bootstrap.mjs +33 -0
  711. package/dist/extensions/launcher-bootstrap.mjs.map +1 -0
  712. package/dist/extensions/ollama-provider.cjs +32 -0
  713. package/dist/extensions/ollama-provider.cjs.map +1 -0
  714. package/dist/extensions/ollama-provider.d.cts +5 -0
  715. package/dist/extensions/ollama-provider.d.cts.map +1 -0
  716. package/dist/extensions/ollama-provider.d.mts +5 -0
  717. package/dist/extensions/ollama-provider.d.mts.map +1 -0
  718. package/dist/extensions/ollama-provider.mjs +32 -0
  719. package/dist/extensions/ollama-provider.mjs.map +1 -0
  720. package/dist/extensions/pi.cjs +63 -0
  721. package/dist/extensions/pi.cjs.map +1 -0
  722. package/dist/extensions/pi.d.cts +7 -0
  723. package/dist/extensions/pi.d.cts.map +1 -0
  724. package/dist/extensions/pi.d.mts +7 -0
  725. package/dist/extensions/pi.d.mts.map +1 -0
  726. package/dist/extensions/pi.mjs +58 -0
  727. package/dist/extensions/pi.mjs.map +1 -0
  728. package/dist/extensions/server.cjs +20 -0
  729. package/dist/extensions/server.cjs.map +1 -0
  730. package/dist/extensions/server.d.cts +5 -0
  731. package/dist/extensions/server.d.cts.map +1 -0
  732. package/dist/extensions/server.d.mts +5 -0
  733. package/dist/extensions/server.d.mts.map +1 -0
  734. package/dist/extensions/server.mjs +15 -0
  735. package/dist/extensions/server.mjs.map +1 -0
  736. package/dist/extensions/style-system.cjs +234 -0
  737. package/dist/extensions/style-system.cjs.map +1 -0
  738. package/dist/extensions/style-system.d.cts +32 -0
  739. package/dist/extensions/style-system.d.cts.map +1 -0
  740. package/dist/extensions/style-system.d.mts +32 -0
  741. package/dist/extensions/style-system.d.mts.map +1 -0
  742. package/dist/extensions/style-system.mjs +219 -0
  743. package/dist/extensions/style-system.mjs.map +1 -0
  744. package/dist/extensions/terminal-child-session.cjs +76 -0
  745. package/dist/extensions/terminal-child-session.cjs.map +1 -0
  746. package/dist/extensions/terminal-child-session.d.cts +7 -0
  747. package/dist/extensions/terminal-child-session.d.cts.map +1 -0
  748. package/dist/extensions/terminal-child-session.d.mts +7 -0
  749. package/dist/extensions/terminal-child-session.d.mts.map +1 -0
  750. package/dist/extensions/terminal-child-session.mjs +69 -0
  751. package/dist/extensions/terminal-child-session.mjs.map +1 -0
  752. package/dist/extensions/transition-coordinator.cjs +154 -0
  753. package/dist/extensions/transition-coordinator.cjs.map +1 -0
  754. package/dist/extensions/transition-coordinator.d.cts +8 -0
  755. package/dist/extensions/transition-coordinator.d.cts.map +1 -0
  756. package/dist/extensions/transition-coordinator.d.mts +8 -0
  757. package/dist/extensions/transition-coordinator.d.mts.map +1 -0
  758. package/dist/extensions/transition-coordinator.mjs +146 -0
  759. package/dist/extensions/transition-coordinator.mjs.map +1 -0
  760. package/dist/harness-context.cjs +5 -0
  761. package/dist/harness-context.d.cts +2 -0
  762. package/dist/harness-context.d.mts +2 -0
  763. package/dist/harness-context.mjs +2 -0
  764. package/dist/harness-state.cjs +19 -0
  765. package/dist/harness-state.d.cts +2 -0
  766. package/dist/harness-state.d.mts +2 -0
  767. package/dist/harness-state.mjs +2 -0
  768. package/dist/help.cjs +16 -0
  769. package/dist/help.d.cts +8 -0
  770. package/dist/help.d.mts +8 -0
  771. package/dist/help.mjs +8 -0
  772. package/dist/index.cjs +368 -0
  773. package/dist/index.d.cts +49 -0
  774. package/dist/index.d.mts +49 -0
  775. package/dist/index.mjs +46 -0
  776. package/dist/init-command.cjs +4 -0
  777. package/dist/init-command.d.cts +2 -0
  778. package/dist/init-command.d.mts +2 -0
  779. package/dist/init-command.mjs +2 -0
  780. package/dist/launch-command.cjs +7 -0
  781. package/dist/launch-command.d.cts +2 -0
  782. package/dist/launch-command.d.mts +2 -0
  783. package/dist/launch-command.mjs +2 -0
  784. package/dist/matrix-options.cjs +28 -0
  785. package/dist/matrix-options.d.cts +2 -0
  786. package/dist/matrix-options.d.mts +2 -0
  787. package/dist/matrix-options.mjs +2 -0
  788. package/dist/matrix-switcher.cjs +11 -0
  789. package/dist/matrix-switcher.d.cts +3 -0
  790. package/dist/matrix-switcher.d.mts +3 -0
  791. package/dist/matrix-switcher.mjs +3 -0
  792. package/dist/mcp-filter.cjs +9 -0
  793. package/dist/mcp-filter.d.cts +1 -0
  794. package/dist/mcp-filter.d.mts +1 -0
  795. package/dist/mcp-filter.mjs +2 -0
  796. package/dist/options.cjs +3 -0
  797. package/dist/options.d.cts +2 -0
  798. package/dist/options.d.mts +2 -0
  799. package/dist/options.mjs +2 -0
  800. package/dist/process.cjs +12 -0
  801. package/dist/process.d.cts +2 -0
  802. package/dist/process.d.mts +2 -0
  803. package/dist/process.mjs +2 -0
  804. package/dist/project-trust.cjs +6 -0
  805. package/dist/project-trust.d.cts +2 -0
  806. package/dist/project-trust.d.mts +2 -0
  807. package/dist/project-trust.mjs +2 -0
  808. package/dist/repository.cjs +5 -0
  809. package/dist/repository.d.cts +2 -0
  810. package/dist/repository.d.mts +2 -0
  811. package/dist/repository.mjs +2 -0
  812. package/dist/resource-collector.cjs +9 -0
  813. package/dist/resource-collector.d.cts +1 -0
  814. package/dist/resource-collector.d.mts +1 -0
  815. package/dist/resource-collector.mjs +2 -0
  816. package/dist/services.cjs +154 -0
  817. package/dist/services.d.cts +21 -0
  818. package/dist/services.d.mts +21 -0
  819. package/dist/services.mjs +21 -0
  820. package/dist/shared.cjs +18 -0
  821. package/dist/shared.d.cts +2 -0
  822. package/dist/shared.d.mts +2 -0
  823. package/dist/shared.mjs +2 -0
  824. package/dist/sync-command.cjs +13 -0
  825. package/dist/sync-command.d.cts +2 -0
  826. package/dist/sync-command.d.mts +2 -0
  827. package/dist/sync-command.mjs +2 -0
  828. package/dist/sync-state.cjs +33 -0
  829. package/dist/sync-state.d.cts +2 -0
  830. package/dist/sync-state.d.mts +2 -0
  831. package/dist/sync-state.mjs +2 -0
  832. package/dist/utils.cjs +6 -0
  833. package/dist/utils.d.cts +3 -0
  834. package/dist/utils.d.mts +3 -0
  835. package/dist/utils.mjs +3 -0
  836. package/package.json +16 -16
@@ -0,0 +1,22 @@
1
+ //#region src/composition/repository/index.d.ts
2
+ /**
3
+ * True when a directory carries a marker Doom Pi is willing to treat as a root.
4
+ *
5
+ * Doom and Pi markers identify configured projects. A Git marker also counts so
6
+ * personal configuration can be synchronized into a new checkout before it has
7
+ * repository-local configuration. Build-tooling markers remain deliberately
8
+ * excluded because they do not establish a repository boundary.
9
+ */
10
+ export declare function isRepositoryRoot(directory: string): boolean;
11
+ /**
12
+ * Walks up from `start` looking for the repository root.
13
+ *
14
+ * The nearest marked ancestor wins, so a session started in a subdirectory
15
+ * resolves to the repository that configured Doom rather than to a parent
16
+ * checkout that happens to sit above it.
17
+ */
18
+ export declare function findRepositoryRoot(start: string): string;
19
+ /** Uses the nearest repository when one exists, otherwise the user's global Doom composition. */
20
+ export declare function resolveDoomConfigurationRoot(start: string, homeDirectory: string): string;
21
+ //#endregion
22
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../../src/composition/repository/index.ts"],"mappings":";;;;;;;;;wBAoCgB,iBAAiB;;;;;;;;wBAiBjB,mBAAmB;;wBAWnB,6BAA6B,eAAe"}
@@ -0,0 +1,22 @@
1
+ //#region src/composition/repository/index.d.ts
2
+ /**
3
+ * True when a directory carries a marker Doom Pi is willing to treat as a root.
4
+ *
5
+ * Doom and Pi markers identify configured projects. A Git marker also counts so
6
+ * personal configuration can be synchronized into a new checkout before it has
7
+ * repository-local configuration. Build-tooling markers remain deliberately
8
+ * excluded because they do not establish a repository boundary.
9
+ */
10
+ export declare function isRepositoryRoot(directory: string): boolean;
11
+ /**
12
+ * Walks up from `start` looking for the repository root.
13
+ *
14
+ * The nearest marked ancestor wins, so a session started in a subdirectory
15
+ * resolves to the repository that configured Doom rather than to a parent
16
+ * checkout that happens to sit above it.
17
+ */
18
+ export declare function findRepositoryRoot(start: string): string;
19
+ /** Uses the nearest repository when one exists, otherwise the user's global Doom composition. */
20
+ export declare function resolveDoomConfigurationRoot(start: string, homeDirectory: string): string;
21
+ //#endregion
22
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/composition/repository/index.ts"],"mappings":";;;;;;;;;wBAoCgB,iBAAiB;;;;;;;;wBAiBjB,mBAAmB;;wBAWnB,6BAA6B,eAAe"}
@@ -0,0 +1,64 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { globalDoomConfigDirectory } from "@agimon-ai/doompi-config/config";
4
+ //#region src/composition/repository/index.ts
5
+ /** Doom's own repository configuration directory. */
6
+ const DOOM_DIRECTORY = ".doom";
7
+ /** Git's root marker, which may be a directory or a worktree pointer file. */
8
+ const GIT_DIRECTORY = ".git";
9
+ /** A Pi project that has been configured, rather than any stray `.pi` folder. */
10
+ const PI_SETTINGS = path.join(".pi", "settings.json");
11
+ function isDirectory(target) {
12
+ try {
13
+ return fs.statSync(target).isDirectory();
14
+ } catch {
15
+ return false;
16
+ }
17
+ }
18
+ function isFile(target) {
19
+ try {
20
+ return fs.statSync(target).isFile();
21
+ } catch {
22
+ return false;
23
+ }
24
+ }
25
+ /**
26
+ * True when a directory carries a marker Doom Pi is willing to treat as a root.
27
+ *
28
+ * Doom and Pi markers identify configured projects. A Git marker also counts so
29
+ * personal configuration can be synchronized into a new checkout before it has
30
+ * repository-local configuration. Build-tooling markers remain deliberately
31
+ * excluded because they do not establish a repository boundary.
32
+ */
33
+ function isRepositoryRoot(directory) {
34
+ const gitMarker = path.join(directory, GIT_DIRECTORY);
35
+ return isDirectory(path.join(directory, DOOM_DIRECTORY)) || isFile(path.join(directory, PI_SETTINGS)) || isDirectory(gitMarker) || isFile(gitMarker);
36
+ }
37
+ /**
38
+ * Walks up from `start` looking for the repository root.
39
+ *
40
+ * The nearest marked ancestor wins, so a session started in a subdirectory
41
+ * resolves to the repository that configured Doom rather than to a parent
42
+ * checkout that happens to sit above it.
43
+ */
44
+ function findRepositoryRoot(start) {
45
+ let directory = path.resolve(start);
46
+ while (true) {
47
+ if (isRepositoryRoot(directory)) return directory;
48
+ const parent = path.dirname(directory);
49
+ if (parent === directory) throw new Error(`Could not find repository root from ${start}`);
50
+ directory = parent;
51
+ }
52
+ }
53
+ /** Uses the nearest repository when one exists, otherwise the user's global Doom composition. */
54
+ function resolveDoomConfigurationRoot(start, homeDirectory) {
55
+ try {
56
+ return findRepositoryRoot(start);
57
+ } catch {
58
+ return globalDoomConfigDirectory(homeDirectory);
59
+ }
60
+ }
61
+ //#endregion
62
+ export { findRepositoryRoot, isRepositoryRoot, resolveDoomConfigurationRoot };
63
+
64
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/composition/repository/index.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport { globalDoomConfigDirectory } from '@agimon-ai/doompi-config/config';\n\n/** Doom's own repository configuration directory. */\nconst DOOM_DIRECTORY = '.doom';\n/** Git's root marker, which may be a directory or a worktree pointer file. */\nconst GIT_DIRECTORY = '.git';\n/** A Pi project that has been configured, rather than any stray `.pi` folder. */\nconst PI_SETTINGS = path.join('.pi', 'settings.json');\n\nfunction isDirectory(target: string): boolean {\n try {\n return fs.statSync(target).isDirectory();\n } catch {\n return false;\n }\n}\n\nfunction isFile(target: string): boolean {\n try {\n return fs.statSync(target).isFile();\n } catch {\n return false;\n }\n}\n\n/**\n * True when a directory carries a marker Doom Pi is willing to treat as a root.\n *\n * Doom and Pi markers identify configured projects. A Git marker also counts so\n * personal configuration can be synchronized into a new checkout before it has\n * repository-local configuration. Build-tooling markers remain deliberately\n * excluded because they do not establish a repository boundary.\n */\nexport function isRepositoryRoot(directory: string): boolean {\n const gitMarker = path.join(directory, GIT_DIRECTORY);\n return (\n isDirectory(path.join(directory, DOOM_DIRECTORY)) ||\n isFile(path.join(directory, PI_SETTINGS)) ||\n isDirectory(gitMarker) ||\n isFile(gitMarker)\n );\n}\n\n/**\n * Walks up from `start` looking for the repository root.\n *\n * The nearest marked ancestor wins, so a session started in a subdirectory\n * resolves to the repository that configured Doom rather than to a parent\n * checkout that happens to sit above it.\n */\nexport function findRepositoryRoot(start: string): string {\n let directory = path.resolve(start);\n while (true) {\n if (isRepositoryRoot(directory)) return directory;\n const parent = path.dirname(directory);\n if (parent === directory) throw new Error(`Could not find repository root from ${start}`);\n directory = parent;\n }\n}\n\n/** Uses the nearest repository when one exists, otherwise the user's global Doom composition. */\nexport function resolveDoomConfigurationRoot(start: string, homeDirectory: string): string {\n try {\n return findRepositoryRoot(start);\n } catch {\n return globalDoomConfigDirectory(homeDirectory);\n }\n}\n"],"mappings":";;;;;AAMA,MAAM,iBAAiB;;AAEvB,MAAM,gBAAgB;;AAEtB,MAAM,cAAc,KAAK,KAAK,OAAO,eAAe;AAEpD,SAAS,YAAY,QAAyB;CAC5C,IAAI;EACF,OAAO,GAAG,SAAS,MAAM,CAAC,CAAC,YAAY;CACzC,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAS,OAAO,QAAyB;CACvC,IAAI;EACF,OAAO,GAAG,SAAS,MAAM,CAAC,CAAC,OAAO;CACpC,QAAQ;EACN,OAAO;CACT;AACF;;;;;;;;;AAUA,SAAgB,iBAAiB,WAA4B;CAC3D,MAAM,YAAY,KAAK,KAAK,WAAW,aAAa;CACpD,OACE,YAAY,KAAK,KAAK,WAAW,cAAc,CAAC,KAChD,OAAO,KAAK,KAAK,WAAW,WAAW,CAAC,KACxC,YAAY,SAAS,KACrB,OAAO,SAAS;AAEpB;;;;;;;;AASA,SAAgB,mBAAmB,OAAuB;CACxD,IAAI,YAAY,KAAK,QAAQ,KAAK;CAClC,OAAO,MAAM;EACX,IAAI,iBAAiB,SAAS,GAAG,OAAO;EACxC,MAAM,SAAS,KAAK,QAAQ,SAAS;EACrC,IAAI,WAAW,WAAW,MAAM,IAAI,MAAM,uCAAuC,OAAO;EACxF,YAAY;CACd;AACF;;AAGA,SAAgB,6BAA6B,OAAe,eAA+B;CACzF,IAAI;EACF,OAAO,mBAAmB,KAAK;CACjC,QAAQ;EACN,OAAO,0BAA0B,aAAa;CAChD;AACF"}
@@ -0,0 +1,160 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_index = require("../syncState/index.cjs");
3
+ const require_inputs = require("../../compiler/inputs.cjs");
4
+ const require_index$1 = require("../../builders/cli/bootstrapLocator/index.cjs");
5
+ let _agimon_ai_doompi_core_api_contracts = require("@agimon-ai/doompi-core/api-contracts");
6
+ let node_fs = require("node:fs");
7
+ node_fs = require_runtime.__toESM(node_fs, 1);
8
+ let node_path = require("node:path");
9
+ node_path = require_runtime.__toESM(node_path, 1);
10
+ let _agimon_ai_doompi_core_sync_registration = require("@agimon-ai/doompi-core/sync-registration");
11
+ let node_os = require("node:os");
12
+ node_os = require_runtime.__toESM(node_os, 1);
13
+ let node_crypto = require("node:crypto");
14
+ node_crypto = require_runtime.__toESM(node_crypto, 1);
15
+ let _agimon_ai_doompi_core_server_facet = require("@agimon-ai/doompi-core/server-facet");
16
+ //#region src/composition/syncDrift/index.ts
17
+ function artifactReceiptIsIntact(receipt, inside) {
18
+ if (typeof receipt.output !== "string" || !Array.isArray(receipt.artifacts) || !Array.isArray(receipt.artifactInputs)) return false;
19
+ if (receipt.artifactInputs.length === 0 || receipt.artifacts.some((file) => typeof file !== "string")) return false;
20
+ const expected = new Set([receipt.output, ...receipt.artifacts].map((file) => node_fs.default.realpathSync(file)));
21
+ const seen = /* @__PURE__ */ new Set();
22
+ for (const value of receipt.artifactInputs) {
23
+ const input = require_inputs.parseInputFingerprint(value);
24
+ if (!input || !/^[a-f0-9]{64}$/u.test(input.sha256) || !inside(input.path)) return false;
25
+ const target = node_fs.default.realpathSync(input.path);
26
+ if (!expected.has(target)) return false;
27
+ const stat = node_fs.default.statSync(target);
28
+ if (!stat.isFile() || stat.size !== input.size) return false;
29
+ if (node_crypto.default.createHash("sha256").update(node_fs.default.readFileSync(target)).digest("hex") !== input.sha256) return false;
30
+ seen.add(target);
31
+ }
32
+ return seen.size === expected.size;
33
+ }
34
+ function serverBundleIsUsable(state, registration, requireFreshSources) {
35
+ const bundle = state.serverBundle;
36
+ if (!bundle || !registration.serverBundle) return false;
37
+ try {
38
+ if (requireFreshSources && bundle.sourcesHash !== require_index.computeServerSourcesHash(state.resolved)) return false;
39
+ const descriptorPath = node_fs.default.realpathSync(bundle.descriptorPath);
40
+ if (descriptorPath !== node_fs.default.realpathSync(registration.serverBundle.path)) return false;
41
+ const descriptor = (0, _agimon_ai_doompi_core_server_facet.parseDoomServerBundle)(JSON.parse(node_fs.default.readFileSync(descriptorPath, "utf8")));
42
+ if (descriptor.generation !== registration.generation || descriptor.fingerprint !== bundle.fingerprint) return false;
43
+ const root = node_fs.default.realpathSync(registration.generationRoot);
44
+ const inside = (target) => {
45
+ const relative = node_path.default.relative(root, node_fs.default.realpathSync(target));
46
+ return relative === "" || !relative.startsWith("..") && !node_path.default.isAbsolute(relative);
47
+ };
48
+ if (!descriptor.contracts) return false;
49
+ const contractFile = node_path.default.resolve(node_path.default.dirname(descriptorPath), descriptor.contracts.file);
50
+ if (!inside(contractFile)) return false;
51
+ const bytes = node_fs.default.readFileSync(contractFile);
52
+ if (node_crypto.default.createHash("sha256").update(bytes).digest("hex") !== descriptor.contracts.sha256) return false;
53
+ const contracts = (0, _agimon_ai_doompi_core_api_contracts.parseCompiledContracts)(JSON.parse(bytes.toString("utf8")));
54
+ if (contracts.generation !== descriptor.generation || contracts.fingerprint !== descriptor.fingerprint) return false;
55
+ const outputs = [...descriptor.entries.map((entry) => ({
56
+ key: entry.packageName,
57
+ module: entry.module
58
+ })), ...contracts.packages.flatMap((entry) => entry.module ? [{
59
+ key: `${entry.packageName}#contracts`,
60
+ module: entry.module
61
+ }] : [])];
62
+ if (Object.keys(bundle.compilerManifests).length !== outputs.length) return false;
63
+ for (const entry of outputs) {
64
+ const manifestPath = bundle.compilerManifests[entry.key];
65
+ if (!manifestPath || !inside(manifestPath)) return false;
66
+ const receipt = JSON.parse(node_fs.default.readFileSync(manifestPath, "utf8"));
67
+ if (typeof receipt.output !== "string" || !inside(receipt.output) || node_fs.default.realpathSync(receipt.output) !== node_fs.default.realpathSync(node_path.default.resolve(node_path.default.dirname(descriptorPath), entry.module)) || !Array.isArray(receipt.artifacts) || !receipt.artifacts.every((file) => typeof file === "string" && inside(file))) return false;
68
+ const inputs = Array.isArray(receipt.inputs) ? receipt.inputs.map(require_inputs.parseInputFingerprint) : [];
69
+ if (inputs.length === 0 || inputs.some((input) => input === void 0)) return false;
70
+ if (requireFreshSources && !require_inputs.inputsAreFresh(inputs)) return false;
71
+ if (!artifactReceiptIsIntact(receipt, inside)) return false;
72
+ }
73
+ return true;
74
+ } catch {
75
+ return false;
76
+ }
77
+ }
78
+ /** Validate direct-module receipts without importing candidates or loading the compiler. */
79
+ function serverBundleIsFresh(state, registration) {
80
+ return serverBundleIsUsable(state, registration, true);
81
+ }
82
+ /** Validate generated server artifacts while allowing the producer source to drift. */
83
+ function serverBundleIsRuntimeUsable(state, registration) {
84
+ return serverBundleIsUsable(state, registration, false);
85
+ }
86
+ /**
87
+ * Whether this repository is synced for the composition it would launch.
88
+ *
89
+ * Sync produces three things a session or the cockpit reads later: the
90
+ * resolved composition, the plugin bundle the browser loads, and the package
91
+ * API routes each host mounts. A session started against any of them stale
92
+ * runs, but quietly wrong: the cockpit shows no plugin surfaces and package
93
+ * APIs answer nothing, with nothing in the log to say why.
94
+ *
95
+ * The hash is the one sync already records. It covers every `.doom` document
96
+ * in both the repository and the home directory, the MCP configuration, the
97
+ * plugin catalogue, and each profile's persona files, so an edit to any of
98
+ * them reads as drift without this having to know what changed.
99
+ */
100
+ function readSyncDrift(options) {
101
+ const homeDirectory = options.homeDirectory ?? node_os.default.homedir();
102
+ const requireFreshSources = options.requireFreshSources ?? true;
103
+ const reasons = [];
104
+ let state;
105
+ let registration;
106
+ try {
107
+ registration = (0, _agimon_ai_doompi_core_sync_registration.readSyncRegistration)(options.repoRoot, homeDirectory);
108
+ state = registration ? require_index.readSyncState(options.repoRoot, homeDirectory) : void 0;
109
+ } catch {
110
+ state = void 0;
111
+ registration = void 0;
112
+ }
113
+ if (!state || !registration) return {
114
+ fresh: false,
115
+ reasons: ["never-synced"]
116
+ };
117
+ let currentInputsHash;
118
+ try {
119
+ currentInputsHash = require_index.computeInputsHash(options.repoRoot, state.selection, homeDirectory);
120
+ } catch {
121
+ reasons.push("configuration-changed");
122
+ }
123
+ if (currentInputsHash !== void 0 && currentInputsHash !== state.inputsHash) reasons.push("configuration-changed");
124
+ if (requireFreshSources && state.webSourcesHash !== void 0 && require_index.computeWebSourcesHash(state.resolved) !== state.webSourcesHash) reasons.push("code-changed");
125
+ try {
126
+ if (!(requireFreshSources ? require_index$1.readBootstrapStatus(options.repoRoot, options.expectedBootstrapEntry, homeDirectory) : require_index$1.readStartupBootstrapStatus(options.repoRoot, options.expectedBootstrapEntry, homeDirectory)).fresh) reasons.push("runtime-stale");
127
+ } catch {
128
+ reasons.push("runtime-stale");
129
+ }
130
+ if (registration.webDirectory === null && options.requireWebBundle || registration.webDirectory !== null && (!node_fs.default.existsSync(node_path.default.join(registration.webDirectory, "index.html")) || !node_fs.default.existsSync(node_path.default.join(node_path.default.dirname(registration.webDirectory), "plugins", "composition.js")) || !node_fs.default.existsSync(node_path.default.join(node_path.default.dirname(registration.webDirectory), "plugins", "manifest.json")))) reasons.push("cockpit-bundle-missing");
131
+ if (!node_fs.default.existsSync(registration.apiDirectory)) reasons.push("package-apis-missing");
132
+ if (!(requireFreshSources ? serverBundleIsFresh(state, registration) : serverBundleIsRuntimeUsable(state, registration))) reasons.push("server-bundle-stale");
133
+ return {
134
+ fresh: reasons.length === 0,
135
+ reasons,
136
+ recordedInputsHash: state.inputsHash,
137
+ ...currentInputsHash === void 0 ? {} : { currentInputsHash }
138
+ };
139
+ }
140
+ /** A one-line account of what drifted, for a log the person running the hub reads. */
141
+ function describeSyncDrift(drift) {
142
+ if (drift.fresh) return "the repository is synced";
143
+ const detail = {
144
+ "never-synced": "it has never been synced",
145
+ "configuration-changed": "its configuration changed since the last sync",
146
+ "code-changed": "its cockpit sources changed since the last sync",
147
+ "runtime-stale": "its precompiled runtime is out of date",
148
+ "cockpit-bundle-missing": "the cockpit bundle is missing",
149
+ "package-apis-missing": "the package API routes are missing",
150
+ "server-bundle-stale": "its server bundle is missing or out of date"
151
+ };
152
+ return drift.reasons.map((reason) => detail[reason]).join(", ");
153
+ }
154
+ //#endregion
155
+ exports.describeSyncDrift = describeSyncDrift;
156
+ exports.readSyncDrift = readSyncDrift;
157
+ exports.serverBundleIsFresh = serverBundleIsFresh;
158
+ exports.serverBundleIsRuntimeUsable = serverBundleIsRuntimeUsable;
159
+
160
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["fs","parseInputFingerprint","crypto","computeServerSourcesHash","parseDoomServerBundle","path","parseCompiledContracts","inputsAreFresh","os","readSyncRegistration","readSyncState","computeInputsHash","computeWebSourcesHash","readBootstrapStatus","readStartupBootstrapStatus"],"sources":["../../../src/composition/syncDrift/index.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { parseCompiledContracts } from '@agimon-ai/doompi-core/api-contracts';\nimport { parseDoomServerBundle } from '@agimon-ai/doompi-core/server-facet';\nimport { readSyncRegistration, type SyncRegistration } from '@agimon-ai/doompi-core/sync-registration';\n\nimport { readStartupBootstrapStatus, readBootstrapStatus } from '../../builders/cli/bootstrapLocator';\nimport { inputsAreFresh, parseInputFingerprint } from '../../compiler/inputs';\nimport {\n computeInputsHash,\n computeWebSourcesHash,\n computeServerSourcesHash,\n readSyncState,\n type SyncState,\n} from '../syncState';\n\nexport type SyncDriftReason =\n | 'never-synced'\n | 'configuration-changed'\n | 'code-changed'\n | 'runtime-stale'\n | 'cockpit-bundle-missing'\n | 'package-apis-missing'\n | 'server-bundle-stale';\n\nexport interface SyncDrift {\n /** True when nothing needs syncing before a session starts. */\n fresh: boolean;\n reasons: SyncDriftReason[];\n /** The recorded inputs hash, for a caller that wants to log what moved. */\n recordedInputsHash?: string;\n currentInputsHash?: string;\n}\n\nexport interface ReadSyncDriftOptions {\n repoRoot: string;\n /** Launcher-owned Doom entry used to build this repository's generated bootstrap. */\n expectedBootstrapEntry?: string;\n homeDirectory?: string;\n /** Web hosts cannot reuse a CLI-only generation without plugin artifacts. */\n requireWebBundle?: boolean;\n /** Ignore producer source drift while retaining generation and artifact checks. */\n requireFreshSources?: boolean;\n}\n\nfunction artifactReceiptIsIntact(receipt: Record<string, unknown>, inside: (target: string) => boolean): boolean {\n if (\n typeof receipt.output !== 'string' ||\n !Array.isArray(receipt.artifacts) ||\n !Array.isArray(receipt.artifactInputs)\n ) {\n return false;\n }\n if (receipt.artifactInputs.length === 0 || receipt.artifacts.some((file) => typeof file !== 'string')) return false;\n const expected = new Set([receipt.output, ...(receipt.artifacts as string[])].map((file) => fs.realpathSync(file)));\n const seen = new Set<string>();\n for (const value of receipt.artifactInputs) {\n const input = parseInputFingerprint(value);\n if (!input || !/^[a-f0-9]{64}$/u.test(input.sha256) || !inside(input.path)) return false;\n const target = fs.realpathSync(input.path);\n if (!expected.has(target)) return false;\n const stat = fs.statSync(target);\n if (!stat.isFile() || stat.size !== input.size) return false;\n if (crypto.createHash('sha256').update(fs.readFileSync(target)).digest('hex') !== input.sha256) return false;\n seen.add(target);\n }\n return seen.size === expected.size;\n}\n\nfunction serverBundleIsUsable(\n state: Pick<SyncState, 'serverBundle' | 'resolved'>,\n registration: Pick<SyncRegistration, 'generation' | 'generationRoot' | 'serverBundle'>,\n requireFreshSources: boolean,\n): boolean {\n const bundle = state.serverBundle;\n if (!bundle || !registration.serverBundle) return false;\n try {\n if (requireFreshSources && bundle.sourcesHash !== computeServerSourcesHash(state.resolved)) return false;\n const descriptorPath = fs.realpathSync(bundle.descriptorPath);\n if (descriptorPath !== fs.realpathSync(registration.serverBundle.path)) return false;\n const descriptor = parseDoomServerBundle(JSON.parse(fs.readFileSync(descriptorPath, 'utf8')));\n if (descriptor.generation !== registration.generation || descriptor.fingerprint !== bundle.fingerprint)\n return false;\n\n const root = fs.realpathSync(registration.generationRoot);\n const inside = (target: string) => {\n const relative = path.relative(root, fs.realpathSync(target));\n return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));\n };\n if (!descriptor.contracts) return false;\n const contractFile = path.resolve(path.dirname(descriptorPath), descriptor.contracts.file);\n if (!inside(contractFile)) return false;\n const bytes = fs.readFileSync(contractFile);\n if (crypto.createHash('sha256').update(bytes).digest('hex') !== descriptor.contracts.sha256) return false;\n const contracts = parseCompiledContracts(JSON.parse(bytes.toString('utf8')));\n if (contracts.generation !== descriptor.generation || contracts.fingerprint !== descriptor.fingerprint)\n return false;\n const outputs = [\n ...descriptor.entries.map((entry) => ({ key: entry.packageName, module: entry.module })),\n ...contracts.packages.flatMap((entry) =>\n entry.module ? [{ key: `${entry.packageName}#contracts`, module: entry.module }] : [],\n ),\n ];\n if (Object.keys(bundle.compilerManifests).length !== outputs.length) return false;\n for (const entry of outputs) {\n const manifestPath = bundle.compilerManifests[entry.key];\n if (!manifestPath || !inside(manifestPath)) return false;\n const receipt = JSON.parse(fs.readFileSync(manifestPath, 'utf8')) as Record<string, unknown>;\n if (\n typeof receipt.output !== 'string' ||\n !inside(receipt.output) ||\n fs.realpathSync(receipt.output) !== fs.realpathSync(path.resolve(path.dirname(descriptorPath), entry.module)) ||\n !Array.isArray(receipt.artifacts) ||\n !receipt.artifacts.every((file) => typeof file === 'string' && inside(file))\n )\n return false;\n const inputs = Array.isArray(receipt.inputs) ? receipt.inputs.map(parseInputFingerprint) : [];\n if (inputs.length === 0 || inputs.some((input) => input === undefined)) return false;\n if (requireFreshSources && !inputsAreFresh(inputs as NonNullable<(typeof inputs)[number]>[])) return false;\n if (!artifactReceiptIsIntact(receipt, inside)) return false;\n }\n return true;\n } catch {\n return false;\n }\n}\n\n/** Validate direct-module receipts without importing candidates or loading the compiler. */\nexport function serverBundleIsFresh(\n state: Pick<SyncState, 'serverBundle' | 'resolved'>,\n registration: Pick<SyncRegistration, 'generation' | 'generationRoot' | 'serverBundle'>,\n): boolean {\n return serverBundleIsUsable(state, registration, true);\n}\n\n/** Validate generated server artifacts while allowing the producer source to drift. */\nexport function serverBundleIsRuntimeUsable(\n state: Pick<SyncState, 'serverBundle' | 'resolved'>,\n registration: Pick<SyncRegistration, 'generation' | 'generationRoot' | 'serverBundle'>,\n): boolean {\n return serverBundleIsUsable(state, registration, false);\n}\n\n/**\n * Whether this repository is synced for the composition it would launch.\n *\n * Sync produces three things a session or the cockpit reads later: the\n * resolved composition, the plugin bundle the browser loads, and the package\n * API routes each host mounts. A session started against any of them stale\n * runs, but quietly wrong: the cockpit shows no plugin surfaces and package\n * APIs answer nothing, with nothing in the log to say why.\n *\n * The hash is the one sync already records. It covers every `.doom` document\n * in both the repository and the home directory, the MCP configuration, the\n * plugin catalogue, and each profile's persona files, so an edit to any of\n * them reads as drift without this having to know what changed.\n */\nexport function readSyncDrift(options: ReadSyncDriftOptions): SyncDrift {\n const homeDirectory = options.homeDirectory ?? os.homedir();\n const requireFreshSources = options.requireFreshSources ?? true;\n const reasons: SyncDriftReason[] = [];\n\n let state: SyncState | undefined;\n let registration: ReturnType<typeof readSyncRegistration>;\n try {\n registration = readSyncRegistration(options.repoRoot, homeDirectory);\n state = registration ? readSyncState(options.repoRoot, homeDirectory) : undefined;\n } catch {\n // Unreadable or invalid registration is indistinguishable from absent for\n // this purpose: the next session needs a sync before it can be trusted.\n state = undefined;\n registration = undefined;\n }\n if (!state || !registration) return { fresh: false, reasons: ['never-synced'] };\n\n let currentInputsHash: string | undefined;\n try {\n currentInputsHash = computeInputsHash(options.repoRoot, state.selection, homeDirectory);\n } catch {\n // A malformed document cannot be hashed, and syncing is what reports it.\n reasons.push('configuration-changed');\n }\n if (currentInputsHash !== undefined && currentInputsHash !== state.inputsHash) {\n reasons.push('configuration-changed');\n }\n // Cockpit sources are compiled straight from each package's web/ folder, so a\n // rebuilt plugin surface is a real change that no configuration hash sees. A\n // state recorded before this was tracked has nothing to compare and is left\n // alone rather than being called stale on sight.\n if (\n requireFreshSources &&\n state.webSourcesHash !== undefined &&\n computeWebSourcesHash(state.resolved) !== state.webSourcesHash\n ) {\n reasons.push('code-changed');\n }\n // The same question the `--check` path asks, so the cockpit and the CLI\n // cannot disagree about whether one repository is synced.\n try {\n const bootstrapStatus = requireFreshSources\n ? readBootstrapStatus(options.repoRoot, options.expectedBootstrapEntry, homeDirectory)\n : readStartupBootstrapStatus(options.repoRoot, options.expectedBootstrapEntry, homeDirectory);\n if (!bootstrapStatus.fresh) reasons.push('runtime-stale');\n } catch {\n // An unreadable bootstrap record is exactly as unusable as a stale one, and\n // syncing is what reports the underlying cause.\n reasons.push('runtime-stale');\n }\n if (\n (registration.webDirectory === null && options.requireWebBundle) ||\n (registration.webDirectory !== null &&\n (!fs.existsSync(path.join(registration.webDirectory, 'index.html')) ||\n !fs.existsSync(path.join(path.dirname(registration.webDirectory), 'plugins', 'composition.js')) ||\n !fs.existsSync(path.join(path.dirname(registration.webDirectory), 'plugins', 'manifest.json'))))\n ) {\n reasons.push('cockpit-bundle-missing');\n }\n if (!fs.existsSync(registration.apiDirectory)) reasons.push('package-apis-missing');\n if (\n !(requireFreshSources ? serverBundleIsFresh(state, registration) : serverBundleIsRuntimeUsable(state, registration))\n )\n reasons.push('server-bundle-stale');\n\n return {\n fresh: reasons.length === 0,\n reasons,\n recordedInputsHash: state.inputsHash,\n ...(currentInputsHash === undefined ? {} : { currentInputsHash }),\n };\n}\n\n/** A one-line account of what drifted, for a log the person running the hub reads. */\nexport function describeSyncDrift(drift: SyncDrift): string {\n if (drift.fresh) return 'the repository is synced';\n const detail: Record<SyncDriftReason, string> = {\n 'never-synced': 'it has never been synced',\n 'configuration-changed': 'its configuration changed since the last sync',\n 'code-changed': 'its cockpit sources changed since the last sync',\n 'runtime-stale': 'its precompiled runtime is out of date',\n 'cockpit-bundle-missing': 'the cockpit bundle is missing',\n 'package-apis-missing': 'the package API routes are missing',\n 'server-bundle-stale': 'its server bundle is missing or out of date',\n };\n return drift.reasons.map((reason) => detail[reason]).join(', ');\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgDA,SAAS,wBAAwB,SAAkC,QAA8C;CAC/G,IACE,OAAO,QAAQ,WAAW,YAC1B,CAAC,MAAM,QAAQ,QAAQ,SAAS,KAChC,CAAC,MAAM,QAAQ,QAAQ,cAAc,GAErC,OAAO;CAET,IAAI,QAAQ,eAAe,WAAW,KAAK,QAAQ,UAAU,MAAM,SAAS,OAAO,SAAS,QAAQ,GAAG,OAAO;CAC9G,MAAM,WAAW,IAAI,IAAI,CAAC,QAAQ,QAAQ,GAAI,QAAQ,SAAsB,CAAC,CAAC,KAAK,SAASA,QAAAA,QAAG,aAAa,IAAI,CAAC,CAAC;CAClH,MAAM,uBAAO,IAAI,IAAY;CAC7B,KAAK,MAAM,SAAS,QAAQ,gBAAgB;EAC1C,MAAM,QAAQC,eAAAA,sBAAsB,KAAK;EACzC,IAAI,CAAC,SAAS,CAAC,kBAAkB,KAAK,MAAM,MAAM,KAAK,CAAC,OAAO,MAAM,IAAI,GAAG,OAAO;EACnF,MAAM,SAASD,QAAAA,QAAG,aAAa,MAAM,IAAI;EACzC,IAAI,CAAC,SAAS,IAAI,MAAM,GAAG,OAAO;EAClC,MAAM,OAAOA,QAAAA,QAAG,SAAS,MAAM;EAC/B,IAAI,CAAC,KAAK,OAAO,KAAK,KAAK,SAAS,MAAM,MAAM,OAAO;EACvD,IAAIE,YAAAA,QAAO,WAAW,QAAQ,CAAC,CAAC,OAAOF,QAAAA,QAAG,a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AQ,KAAK,eAAe;CAC9B;CACA,IACG,aAAa,iBAAiB,QAAQ,QAAQ,oBAC9C,aAAa,iBAAiB,SAC5B,CAACd,QAAAA,QAAG,WAAWK,UAAAA,QAAK,KAAK,aAAa,cAAc,YAAY,CAAC,KAChE,CAACL,QAAAA,QAAG,WAAWK,UAAAA,QAAK,KAAKA,UAAAA,QAAK,QAAQ,aAAa,YAAY,GAAG,WAAW,gBAAgB,CAAC,KAC9F,CAACL,QAAAA,QAAG,WAAWK,UAAAA,QAAK,KAAKA,UAAAA,QAAK,QAAQ,aAAa,YAAY,GAAG,WAAW,eAAe,CAAC,IAEjG,QAAQ,KAAK,wBAAwB;CAEvC,IAAI,CAACL,QAAAA,QAAG,WAAW,aAAa,YAAY,GAAG,QAAQ,KAAK,sBAAsB;CAClF,IACE,EAAE,sBAAsB,oBAAoB,OAAO,YAAY,IAAI,4BAA4B,OAAO,YAAY,IAElH,QAAQ,KAAK,qBAAqB;CAEpC,OAAO;EACL,OAAO,QAAQ,WAAW;EAC1B;EACA,oBAAoB,MAAM;EAC1B,GAAI,sBAAsB,KAAA,IAAY,CAAC,IAAI,EAAE,kBAAkB;CACjE;AACF;;AAGA,SAAgB,kBAAkB,OAA0B;CAC1D,IAAI,MAAM,OAAO,OAAO;CACxB,MAAM,SAA0C;EAC9C,gBAAgB;EAChB,yBAAyB;EACzB,gBAAgB;EAChB,iBAAiB;EACjB,0BAA0B;EAC1B,wBAAwB;EACxB,uBAAuB;CACzB;CACA,OAAO,MAAM,QAAQ,KAAK,WAAW,OAAO,OAAO,CAAC,CAAC,KAAK,IAAI;AAChE"}
@@ -0,0 +1,41 @@
1
+ import "../syncState/index.cjs";
2
+ import "@agimon-ai/doompi-core/sync-registration";
3
+ //#region src/composition/syncDrift/index.d.ts
4
+ export type SyncDriftReason = 'never-synced' | 'configuration-changed' | 'code-changed' | 'runtime-stale' | 'cockpit-bundle-missing' | 'package-apis-missing' | 'server-bundle-stale';
5
+ export interface SyncDrift {
6
+ /** True when nothing needs syncing before a session starts. */
7
+ fresh: boolean;
8
+ reasons: SyncDriftReason[];
9
+ /** The recorded inputs hash, for a caller that wants to log what moved. */
10
+ recordedInputsHash?: string;
11
+ currentInputsHash?: string;
12
+ }
13
+ export interface ReadSyncDriftOptions {
14
+ repoRoot: string;
15
+ /** Launcher-owned Doom entry used to build this repository's generated bootstrap. */
16
+ expectedBootstrapEntry?: string;
17
+ homeDirectory?: string;
18
+ /** Web hosts cannot reuse a CLI-only generation without plugin artifacts. */
19
+ requireWebBundle?: boolean;
20
+ /** Ignore producer source drift while retaining generation and artifact checks. */
21
+ requireFreshSources?: boolean;
22
+ }
23
+ /**
24
+ * Whether this repository is synced for the composition it would launch.
25
+ *
26
+ * Sync produces three things a session or the cockpit reads later: the
27
+ * resolved composition, the plugin bundle the browser loads, and the package
28
+ * API routes each host mounts. A session started against any of them stale
29
+ * runs, but quietly wrong: the cockpit shows no plugin surfaces and package
30
+ * APIs answer nothing, with nothing in the log to say why.
31
+ *
32
+ * The hash is the one sync already records. It covers every `.doom` document
33
+ * in both the repository and the home directory, the MCP configuration, the
34
+ * plugin catalogue, and each profile's persona files, so an edit to any of
35
+ * them reads as drift without this having to know what changed.
36
+ */
37
+ export declare function readSyncDrift(options: ReadSyncDriftOptions): SyncDrift;
38
+ /** A one-line account of what drifted, for a log the person running the hub reads. */
39
+ export declare function describeSyncDrift(drift: SyncDrift): string;
40
+ //#endregion
41
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../../src/composition/syncDrift/index.ts"],"mappings":";;;YAmBY;iBASK;;EAEf;EACA,SAAS;;EAET;EACA;;iBAGe;EACf;;EAEA;EACA;;EAEA;;EAEA;;;;;;;;;;;;;;;;wBAmHc,cAAc,SAAS,uBAAuB;;wBA2E9C,kBAAkB,OAAO"}
@@ -0,0 +1,41 @@
1
+ import "../syncState/index.mjs";
2
+ import "@agimon-ai/doompi-core/sync-registration";
3
+ //#region src/composition/syncDrift/index.d.ts
4
+ export type SyncDriftReason = 'never-synced' | 'configuration-changed' | 'code-changed' | 'runtime-stale' | 'cockpit-bundle-missing' | 'package-apis-missing' | 'server-bundle-stale';
5
+ export interface SyncDrift {
6
+ /** True when nothing needs syncing before a session starts. */
7
+ fresh: boolean;
8
+ reasons: SyncDriftReason[];
9
+ /** The recorded inputs hash, for a caller that wants to log what moved. */
10
+ recordedInputsHash?: string;
11
+ currentInputsHash?: string;
12
+ }
13
+ export interface ReadSyncDriftOptions {
14
+ repoRoot: string;
15
+ /** Launcher-owned Doom entry used to build this repository's generated bootstrap. */
16
+ expectedBootstrapEntry?: string;
17
+ homeDirectory?: string;
18
+ /** Web hosts cannot reuse a CLI-only generation without plugin artifacts. */
19
+ requireWebBundle?: boolean;
20
+ /** Ignore producer source drift while retaining generation and artifact checks. */
21
+ requireFreshSources?: boolean;
22
+ }
23
+ /**
24
+ * Whether this repository is synced for the composition it would launch.
25
+ *
26
+ * Sync produces three things a session or the cockpit reads later: the
27
+ * resolved composition, the plugin bundle the browser loads, and the package
28
+ * API routes each host mounts. A session started against any of them stale
29
+ * runs, but quietly wrong: the cockpit shows no plugin surfaces and package
30
+ * APIs answer nothing, with nothing in the log to say why.
31
+ *
32
+ * The hash is the one sync already records. It covers every `.doom` document
33
+ * in both the repository and the home directory, the MCP configuration, the
34
+ * plugin catalogue, and each profile's persona files, so an edit to any of
35
+ * them reads as drift without this having to know what changed.
36
+ */
37
+ export declare function readSyncDrift(options: ReadSyncDriftOptions): SyncDrift;
38
+ /** A one-line account of what drifted, for a log the person running the hub reads. */
39
+ export declare function describeSyncDrift(drift: SyncDrift): string;
40
+ //#endregion
41
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/composition/syncDrift/index.ts"],"mappings":";;;YAmBY;iBASK;;EAEf;EACA,SAAS;;EAET;EACA;;iBAGe;EACf;;EAEA;EACA;;EAEA;;EAEA;;;;;;;;;;;;;;;;wBAmHc,cAAc,SAAS,uBAAuB;;wBA2E9C,kBAAkB,OAAO"}
@@ -0,0 +1,152 @@
1
+ import { computeInputsHash, computeServerSourcesHash, computeWebSourcesHash, readSyncState } from "../syncState/index.mjs";
2
+ import { inputsAreFresh, parseInputFingerprint } from "../../compiler/inputs.mjs";
3
+ import { readBootstrapStatus, readStartupBootstrapStatus } from "../../builders/cli/bootstrapLocator/index.mjs";
4
+ import { parseCompiledContracts } from "@agimon-ai/doompi-core/api-contracts";
5
+ import fs from "node:fs";
6
+ import path from "node:path";
7
+ import { readSyncRegistration } from "@agimon-ai/doompi-core/sync-registration";
8
+ import os from "node:os";
9
+ import crypto from "node:crypto";
10
+ import { parseDoomServerBundle } from "@agimon-ai/doompi-core/server-facet";
11
+ //#region src/composition/syncDrift/index.ts
12
+ function artifactReceiptIsIntact(receipt, inside) {
13
+ if (typeof receipt.output !== "string" || !Array.isArray(receipt.artifacts) || !Array.isArray(receipt.artifactInputs)) return false;
14
+ if (receipt.artifactInputs.length === 0 || receipt.artifacts.some((file) => typeof file !== "string")) return false;
15
+ const expected = new Set([receipt.output, ...receipt.artifacts].map((file) => fs.realpathSync(file)));
16
+ const seen = /* @__PURE__ */ new Set();
17
+ for (const value of receipt.artifactInputs) {
18
+ const input = parseInputFingerprint(value);
19
+ if (!input || !/^[a-f0-9]{64}$/u.test(input.sha256) || !inside(input.path)) return false;
20
+ const target = fs.realpathSync(input.path);
21
+ if (!expected.has(target)) return false;
22
+ const stat = fs.statSync(target);
23
+ if (!stat.isFile() || stat.size !== input.size) return false;
24
+ if (crypto.createHash("sha256").update(fs.readFileSync(target)).digest("hex") !== input.sha256) return false;
25
+ seen.add(target);
26
+ }
27
+ return seen.size === expected.size;
28
+ }
29
+ function serverBundleIsUsable(state, registration, requireFreshSources) {
30
+ const bundle = state.serverBundle;
31
+ if (!bundle || !registration.serverBundle) return false;
32
+ try {
33
+ if (requireFreshSources && bundle.sourcesHash !== computeServerSourcesHash(state.resolved)) return false;
34
+ const descriptorPath = fs.realpathSync(bundle.descriptorPath);
35
+ if (descriptorPath !== fs.realpathSync(registration.serverBundle.path)) return false;
36
+ const descriptor = parseDoomServerBundle(JSON.parse(fs.readFileSync(descriptorPath, "utf8")));
37
+ if (descriptor.generation !== registration.generation || descriptor.fingerprint !== bundle.fingerprint) return false;
38
+ const root = fs.realpathSync(registration.generationRoot);
39
+ const inside = (target) => {
40
+ const relative = path.relative(root, fs.realpathSync(target));
41
+ return relative === "" || !relative.startsWith("..") && !path.isAbsolute(relative);
42
+ };
43
+ if (!descriptor.contracts) return false;
44
+ const contractFile = path.resolve(path.dirname(descriptorPath), descriptor.contracts.file);
45
+ if (!inside(contractFile)) return false;
46
+ const bytes = fs.readFileSync(contractFile);
47
+ if (crypto.createHash("sha256").update(bytes).digest("hex") !== descriptor.contracts.sha256) return false;
48
+ const contracts = parseCompiledContracts(JSON.parse(bytes.toString("utf8")));
49
+ if (contracts.generation !== descriptor.generation || contracts.fingerprint !== descriptor.fingerprint) return false;
50
+ const outputs = [...descriptor.entries.map((entry) => ({
51
+ key: entry.packageName,
52
+ module: entry.module
53
+ })), ...contracts.packages.flatMap((entry) => entry.module ? [{
54
+ key: `${entry.packageName}#contracts`,
55
+ module: entry.module
56
+ }] : [])];
57
+ if (Object.keys(bundle.compilerManifests).length !== outputs.length) return false;
58
+ for (const entry of outputs) {
59
+ const manifestPath = bundle.compilerManifests[entry.key];
60
+ if (!manifestPath || !inside(manifestPath)) return false;
61
+ const receipt = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
62
+ if (typeof receipt.output !== "string" || !inside(receipt.output) || fs.realpathSync(receipt.output) !== fs.realpathSync(path.resolve(path.dirname(descriptorPath), entry.module)) || !Array.isArray(receipt.artifacts) || !receipt.artifacts.every((file) => typeof file === "string" && inside(file))) return false;
63
+ const inputs = Array.isArray(receipt.inputs) ? receipt.inputs.map(parseInputFingerprint) : [];
64
+ if (inputs.length === 0 || inputs.some((input) => input === void 0)) return false;
65
+ if (requireFreshSources && !inputsAreFresh(inputs)) return false;
66
+ if (!artifactReceiptIsIntact(receipt, inside)) return false;
67
+ }
68
+ return true;
69
+ } catch {
70
+ return false;
71
+ }
72
+ }
73
+ /** Validate direct-module receipts without importing candidates or loading the compiler. */
74
+ function serverBundleIsFresh(state, registration) {
75
+ return serverBundleIsUsable(state, registration, true);
76
+ }
77
+ /** Validate generated server artifacts while allowing the producer source to drift. */
78
+ function serverBundleIsRuntimeUsable(state, registration) {
79
+ return serverBundleIsUsable(state, registration, false);
80
+ }
81
+ /**
82
+ * Whether this repository is synced for the composition it would launch.
83
+ *
84
+ * Sync produces three things a session or the cockpit reads later: the
85
+ * resolved composition, the plugin bundle the browser loads, and the package
86
+ * API routes each host mounts. A session started against any of them stale
87
+ * runs, but quietly wrong: the cockpit shows no plugin surfaces and package
88
+ * APIs answer nothing, with nothing in the log to say why.
89
+ *
90
+ * The hash is the one sync already records. It covers every `.doom` document
91
+ * in both the repository and the home directory, the MCP configuration, the
92
+ * plugin catalogue, and each profile's persona files, so an edit to any of
93
+ * them reads as drift without this having to know what changed.
94
+ */
95
+ function readSyncDrift(options) {
96
+ const homeDirectory = options.homeDirectory ?? os.homedir();
97
+ const requireFreshSources = options.requireFreshSources ?? true;
98
+ const reasons = [];
99
+ let state;
100
+ let registration;
101
+ try {
102
+ registration = readSyncRegistration(options.repoRoot, homeDirectory);
103
+ state = registration ? readSyncState(options.repoRoot, homeDirectory) : void 0;
104
+ } catch {
105
+ state = void 0;
106
+ registration = void 0;
107
+ }
108
+ if (!state || !registration) return {
109
+ fresh: false,
110
+ reasons: ["never-synced"]
111
+ };
112
+ let currentInputsHash;
113
+ try {
114
+ currentInputsHash = computeInputsHash(options.repoRoot, state.selection, homeDirectory);
115
+ } catch {
116
+ reasons.push("configuration-changed");
117
+ }
118
+ if (currentInputsHash !== void 0 && currentInputsHash !== state.inputsHash) reasons.push("configuration-changed");
119
+ if (requireFreshSources && state.webSourcesHash !== void 0 && computeWebSourcesHash(state.resolved) !== state.webSourcesHash) reasons.push("code-changed");
120
+ try {
121
+ if (!(requireFreshSources ? readBootstrapStatus(options.repoRoot, options.expectedBootstrapEntry, homeDirectory) : readStartupBootstrapStatus(options.repoRoot, options.expectedBootstrapEntry, homeDirectory)).fresh) reasons.push("runtime-stale");
122
+ } catch {
123
+ reasons.push("runtime-stale");
124
+ }
125
+ if (registration.webDirectory === null && options.requireWebBundle || registration.webDirectory !== null && (!fs.existsSync(path.join(registration.webDirectory, "index.html")) || !fs.existsSync(path.join(path.dirname(registration.webDirectory), "plugins", "composition.js")) || !fs.existsSync(path.join(path.dirname(registration.webDirectory), "plugins", "manifest.json")))) reasons.push("cockpit-bundle-missing");
126
+ if (!fs.existsSync(registration.apiDirectory)) reasons.push("package-apis-missing");
127
+ if (!(requireFreshSources ? serverBundleIsFresh(state, registration) : serverBundleIsRuntimeUsable(state, registration))) reasons.push("server-bundle-stale");
128
+ return {
129
+ fresh: reasons.length === 0,
130
+ reasons,
131
+ recordedInputsHash: state.inputsHash,
132
+ ...currentInputsHash === void 0 ? {} : { currentInputsHash }
133
+ };
134
+ }
135
+ /** A one-line account of what drifted, for a log the person running the hub reads. */
136
+ function describeSyncDrift(drift) {
137
+ if (drift.fresh) return "the repository is synced";
138
+ const detail = {
139
+ "never-synced": "it has never been synced",
140
+ "configuration-changed": "its configuration changed since the last sync",
141
+ "code-changed": "its cockpit sources changed since the last sync",
142
+ "runtime-stale": "its precompiled runtime is out of date",
143
+ "cockpit-bundle-missing": "the cockpit bundle is missing",
144
+ "package-apis-missing": "the package API routes are missing",
145
+ "server-bundle-stale": "its server bundle is missing or out of date"
146
+ };
147
+ return drift.reasons.map((reason) => detail[reason]).join(", ");
148
+ }
149
+ //#endregion
150
+ export { describeSyncDrift, readSyncDrift, serverBundleIsFresh, serverBundleIsRuntimeUsable };
151
+
152
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/composition/syncDrift/index.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { parseCompiledContracts } from '@agimon-ai/doompi-core/api-contracts';\nimport { parseDoomServerBundle } from '@agimon-ai/doompi-core/server-facet';\nimport { readSyncRegistration, type SyncRegistration } from '@agimon-ai/doompi-core/sync-registration';\n\nimport { readStartupBootstrapStatus, readBootstrapStatus } from '../../builders/cli/bootstrapLocator';\nimport { inputsAreFresh, parseInputFingerprint } from '../../compiler/inputs';\nimport {\n computeInputsHash,\n computeWebSourcesHash,\n computeServerSourcesHash,\n readSyncState,\n type SyncState,\n} from '../syncState';\n\nexport type SyncDriftReason =\n | 'never-synced'\n | 'configuration-changed'\n | 'code-changed'\n | 'runtime-stale'\n | 'cockpit-bundle-missing'\n | 'package-apis-missing'\n | 'server-bundle-stale';\n\nexport interface SyncDrift {\n /** True when nothing needs syncing before a session starts. */\n fresh: boolean;\n reasons: SyncDriftReason[];\n /** The recorded inputs hash, for a caller that wants to log what moved. */\n recordedInputsHash?: string;\n currentInputsHash?: string;\n}\n\nexport interface ReadSyncDriftOptions {\n repoRoot: string;\n /** Launcher-owned Doom entry used to build this repository's generated bootstrap. */\n expectedBootstrapEntry?: string;\n homeDirectory?: string;\n /** Web hosts cannot reuse a CLI-only generation without plugin artifacts. */\n requireWebBundle?: boolean;\n /** Ignore producer source drift while retaining generation and artifact checks. */\n requireFreshSources?: boolean;\n}\n\nfunction artifactReceiptIsIntact(receipt: Record<string, unknown>, inside: (target: string) => boolean): boolean {\n if (\n typeof receipt.output !== 'string' ||\n !Array.isArray(receipt.artifacts) ||\n !Array.isArray(receipt.artifactInputs)\n ) {\n return false;\n }\n if (receipt.artifactInputs.length === 0 || receipt.artifacts.some((file) => typeof file !== 'string')) return false;\n const expected = new Set([receipt.output, ...(receipt.artifacts as string[])].map((file) => fs.realpathSync(file)));\n const seen = new Set<string>();\n for (const value of receipt.artifactInputs) {\n const input = parseInputFingerprint(value);\n if (!input || !/^[a-f0-9]{64}$/u.test(input.sha256) || !inside(input.path)) return false;\n const target = fs.realpathSync(input.path);\n if (!expected.has(target)) return false;\n const stat = fs.statSync(target);\n if (!stat.isFile() || stat.size !== input.size) return false;\n if (crypto.createHash('sha256').update(fs.readFileSync(target)).digest('hex') !== input.sha256) return false;\n seen.add(target);\n }\n return seen.size === expected.size;\n}\n\nfunction serverBundleIsUsable(\n state: Pick<SyncState, 'serverBundle' | 'resolved'>,\n registration: Pick<SyncRegistration, 'generation' | 'generationRoot' | 'serverBundle'>,\n requireFreshSources: boolean,\n): boolean {\n const bundle = state.serverBundle;\n if (!bundle || !registration.serverBundle) return false;\n try {\n if (requireFreshSources && bundle.sourcesHash !== computeServerSourcesHash(state.resolved)) return false;\n const descriptorPath = fs.realpathSync(bundle.descriptorPath);\n if (descriptorPath !== fs.realpathSync(registration.serverBundle.path)) return false;\n const descriptor = parseDoomServerBundle(JSON.parse(fs.readFileSync(descriptorPath, 'utf8')));\n if (descriptor.generation !== registration.generation || descriptor.fingerprint !== bundle.fingerprint)\n return false;\n\n const root = fs.realpathSync(registration.generationRoot);\n const inside = (target: string) => {\n const relative = path.relative(root, fs.realpathSync(target));\n return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));\n };\n if (!descriptor.contracts) return false;\n const contractFile = path.resolve(path.dirname(descriptorPath), descriptor.contracts.file);\n if (!inside(contractFile)) return false;\n const bytes = fs.readFileSync(contractFile);\n if (crypto.createHash('sha256').update(bytes).digest('hex') !== descriptor.contracts.sha256) return false;\n const contracts = parseCompiledContracts(JSON.parse(bytes.toString('utf8')));\n if (contracts.generation !== descriptor.generation || contracts.fingerprint !== descriptor.fingerprint)\n return false;\n const outputs = [\n ...descriptor.entries.map((entry) => ({ key: entry.packageName, module: entry.module })),\n ...contracts.packages.flatMap((entry) =>\n entry.module ? [{ key: `${entry.packageName}#contracts`, module: entry.module }] : [],\n ),\n ];\n if (Object.keys(bundle.compilerManifests).length !== outputs.length) return false;\n for (const entry of outputs) {\n const manifestPath = bundle.compilerManifests[entry.key];\n if (!manifestPath || !inside(manifestPath)) return false;\n const receipt = JSON.parse(fs.readFileSync(manifestPath, 'utf8')) as Record<string, unknown>;\n if (\n typeof receipt.output !== 'string' ||\n !inside(receipt.output) ||\n fs.realpathSync(receipt.output) !== fs.realpathSync(path.resolve(path.dirname(descriptorPath), entry.module)) ||\n !Array.isArray(receipt.artifacts) ||\n !receipt.artifacts.every((file) => typeof file === 'string' && inside(file))\n )\n return false;\n const inputs = Array.isArray(receipt.inputs) ? receipt.inputs.map(parseInputFingerprint) : [];\n if (inputs.length === 0 || inputs.some((input) => input === undefined)) return false;\n if (requireFreshSources && !inputsAreFresh(inputs as NonNullable<(typeof inputs)[number]>[])) return false;\n if (!artifactReceiptIsIntact(receipt, inside)) return false;\n }\n return true;\n } catch {\n return false;\n }\n}\n\n/** Validate direct-module receipts without importing candidates or loading the compiler. */\nexport function serverBundleIsFresh(\n state: Pick<SyncState, 'serverBundle' | 'resolved'>,\n registration: Pick<SyncRegistration, 'generation' | 'generationRoot' | 'serverBundle'>,\n): boolean {\n return serverBundleIsUsable(state, registration, true);\n}\n\n/** Validate generated server artifacts while allowing the producer source to drift. */\nexport function serverBundleIsRuntimeUsable(\n state: Pick<SyncState, 'serverBundle' | 'resolved'>,\n registration: Pick<SyncRegistration, 'generation' | 'generationRoot' | 'serverBundle'>,\n): boolean {\n return serverBundleIsUsable(state, registration, false);\n}\n\n/**\n * Whether this repository is synced for the composition it would launch.\n *\n * Sync produces three things a session or the cockpit reads later: the\n * resolved composition, the plugin bundle the browser loads, and the package\n * API routes each host mounts. A session started against any of them stale\n * runs, but quietly wrong: the cockpit shows no plugin surfaces and package\n * APIs answer nothing, with nothing in the log to say why.\n *\n * The hash is the one sync already records. It covers every `.doom` document\n * in both the repository and the home directory, the MCP configuration, the\n * plugin catalogue, and each profile's persona files, so an edit to any of\n * them reads as drift without this having to know what changed.\n */\nexport function readSyncDrift(options: ReadSyncDriftOptions): SyncDrift {\n const homeDirectory = options.homeDirectory ?? os.homedir();\n const requireFreshSources = options.requireFreshSources ?? true;\n const reasons: SyncDriftReason[] = [];\n\n let state: SyncState | undefined;\n let registration: ReturnType<typeof readSyncRegistration>;\n try {\n registration = readSyncRegistration(options.repoRoot, homeDirectory);\n state = registration ? readSyncState(options.repoRoot, homeDirectory) : undefined;\n } catch {\n // Unreadable or invalid registration is indistinguishable from absent for\n // this purpose: the next session needs a sync before it can be trusted.\n state = undefined;\n registration = undefined;\n }\n if (!state || !registration) return { fresh: false, reasons: ['never-synced'] };\n\n let currentInputsHash: string | undefined;\n try {\n currentInputsHash = computeInputsHash(options.repoRoot, state.selection, homeDirectory);\n } catch {\n // A malformed document cannot be hashed, and syncing is what reports it.\n reasons.push('configuration-changed');\n }\n if (currentInputsHash !== undefined && currentInputsHash !== state.inputsHash) {\n reasons.push('configuration-changed');\n }\n // Cockpit sources are compiled straight from each package's web/ folder, so a\n // rebuilt plugin surface is a real change that no configuration hash sees. A\n // state recorded before this was tracked has nothing to compare and is left\n // alone rather than being called stale on sight.\n if (\n requireFreshSources &&\n state.webSourcesHash !== undefined &&\n computeWebSourcesHash(state.resolved) !== state.webSourcesHash\n ) {\n reasons.push('code-changed');\n }\n // The same question the `--check` path asks, so the cockpit and the CLI\n // cannot disagree about whether one repository is synced.\n try {\n const bootstrapStatus = requireFreshSources\n ? readBootstrapStatus(options.repoRoot, options.expectedBootstrapEntry, homeDirectory)\n : readStartupBootstrapStatus(options.repoRoot, options.expectedBootstrapEntry, homeDirectory);\n if (!bootstrapStatus.fresh) reasons.push('runtime-stale');\n } catch {\n // An unreadable bootstrap record is exactly as unusable as a stale one, and\n // syncing is what reports the underlying cause.\n reasons.push('runtime-stale');\n }\n if (\n (registration.webDirectory === null && options.requireWebBundle) ||\n (registration.webDirectory !== null &&\n (!fs.existsSync(path.join(registration.webDirectory, 'index.html')) ||\n !fs.existsSync(path.join(path.dirname(registration.webDirectory), 'plugins', 'composition.js')) ||\n !fs.existsSync(path.join(path.dirname(registration.webDirectory), 'plugins', 'manifest.json'))))\n ) {\n reasons.push('cockpit-bundle-missing');\n }\n if (!fs.existsSync(registration.apiDirectory)) reasons.push('package-apis-missing');\n if (\n !(requireFreshSources ? serverBundleIsFresh(state, registration) : serverBundleIsRuntimeUsable(state, registration))\n )\n reasons.push('server-bundle-stale');\n\n return {\n fresh: reasons.length === 0,\n reasons,\n recordedInputsHash: state.inputsHash,\n ...(currentInputsHash === undefined ? {} : { currentInputsHash }),\n };\n}\n\n/** A one-line account of what drifted, for a log the person running the hub reads. */\nexport function describeSyncDrift(drift: SyncDrift): string {\n if (drift.fresh) return 'the repository is synced';\n const detail: Record<SyncDriftReason, string> = {\n 'never-synced': 'it has never been synced',\n 'configuration-changed': 'its configuration changed since the last sync',\n 'code-changed': 'its cockpit sources changed since the last sync',\n 'runtime-stale': 'its precompiled runtime is out of date',\n 'cockpit-bundle-missing': 'the cockpit bundle is missing',\n 'package-apis-missing': 'the package API routes are missing',\n 'server-bundle-stale': 'its server bundle is missing or out of date',\n };\n return drift.reasons.map((reason) => detail[reason]).join(', ');\n}\n"],"mappings":";;;;;;;;;;;AAgDA,SAAS,wBAAwB,SAAkC,QAA8C;CAC/G,IACE,OAAO,QAAQ,WAAW,YAC1B,CAAC,MAAM,QAAQ,QAAQ,SAAS,KAChC,CAAC,MAAM,QAAQ,QAAQ,cAAc,GAErC,OAAO;CAET,IAAI,QAAQ,eAAe,WAAW,KAAK,QAAQ,UAAU,MAAM,SAAS,OAAO,SAAS,QAAQ,GAAG,OAAO;CAC9G,MAAM,WAAW,IAAI,IAAI,CAAC,QAAQ,QAAQ,GAAI,QAAQ,SAAsB,CAAC,CAAC,KAAK,SAAS,GAAG,aAAa,IAAI,CAAC,CAAC;CAClH,MAAM,uBAAO,IAAI,IAAY;CAC7B,KAAK,MAAM,SAAS,QAAQ,gBAAgB;EAC1C,MAAM,QAAQ,sBAAsB,KAAK;EACzC,IAA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