@agimon-ai/po 0.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (560) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +755 -0
  3. package/assets/banner.png +0 -0
  4. package/assets/banner.svg +25 -0
  5. package/assets/favicon.svg +15 -0
  6. package/assets/logo-light.png +0 -0
  7. package/assets/logo-light.svg +25 -0
  8. package/assets/logo.png +0 -0
  9. package/assets/logo.svg +25 -0
  10. package/assets/mascot.png +0 -0
  11. package/assets/mascot.svg +25 -0
  12. package/dist/_virtual/_rolldown/runtime.cjs +23 -0
  13. package/dist/antigravity.cjs +5 -0
  14. package/dist/antigravity.d.mts +2 -0
  15. package/dist/antigravity.mjs +2 -0
  16. package/dist/apiContracts.cjs +11 -0
  17. package/dist/apiContracts.cjs.map +1 -0
  18. package/dist/apiContracts.d.mts +52 -0
  19. package/dist/apiContracts.d.mts.map +1 -0
  20. package/dist/apiContracts.mjs +7 -0
  21. package/dist/apiContracts.mjs.map +1 -0
  22. package/dist/baseCommand.cjs +3 -0
  23. package/dist/baseCommand.d.mts +2 -0
  24. package/dist/baseCommand.mjs +2 -0
  25. package/dist/bin/cli.cjs +24 -0
  26. package/dist/bin/cli.cjs.map +1 -0
  27. package/dist/bin/cli.d.mts +1 -0
  28. package/dist/bin/cli.mjs +25 -0
  29. package/dist/bin/cli.mjs.map +1 -0
  30. package/dist/bin/doomRunner.cjs +33 -0
  31. package/dist/bin/doomRunner.cjs.map +1 -0
  32. package/dist/bin/doomRunner.d.mts +4 -0
  33. package/dist/bin/doomRunner.d.mts.map +1 -0
  34. package/dist/bin/doomRunner.mjs +32 -0
  35. package/dist/bin/doomRunner.mjs.map +1 -0
  36. package/dist/bin/serve.cjs +30 -0
  37. package/dist/bin/serve.cjs.map +1 -0
  38. package/dist/bin/serve.d.mts +1 -0
  39. package/dist/bin/serve.mjs +31 -0
  40. package/dist/bin/serve.mjs.map +1 -0
  41. package/dist/builders/cli/extensionAssembler/index.cjs +342 -0
  42. package/dist/builders/cli/extensionAssembler/index.cjs.map +1 -0
  43. package/dist/builders/cli/extensionAssembler/index.d.mts +85 -0
  44. package/dist/builders/cli/extensionAssembler/index.d.mts.map +1 -0
  45. package/dist/builders/cli/extensionAssembler/index.mjs +335 -0
  46. package/dist/builders/cli/extensionAssembler/index.mjs.map +1 -0
  47. package/dist/catalog/index.json +430 -0
  48. package/dist/cli.cjs +28 -0
  49. package/dist/cli.d.mts +11 -0
  50. package/dist/cli.mjs +11 -0
  51. package/dist/cliApp.cjs +6 -0
  52. package/dist/cliApp.d.mts +2 -0
  53. package/dist/cliApp.mjs +2 -0
  54. package/dist/codex.cjs +8 -0
  55. package/dist/codex.d.mts +2 -0
  56. package/dist/codex.mjs +2 -0
  57. package/dist/commands.cjs +18 -0
  58. package/dist/commands.d.mts +9 -0
  59. package/dist/commands.mjs +9 -0
  60. package/dist/compatibility.cjs +27 -0
  61. package/dist/compatibility.d.mts +6 -0
  62. package/dist/compatibility.mjs +6 -0
  63. package/dist/compatibilityCommand.cjs +4 -0
  64. package/dist/compatibilityCommand.d.mts +2 -0
  65. package/dist/compatibilityCommand.mjs +2 -0
  66. package/dist/compatibilityContext.cjs +3 -0
  67. package/dist/compatibilityContext.d.mts +2 -0
  68. package/dist/compatibilityContext.mjs +2 -0
  69. package/dist/compatibilityOptions.cjs +5 -0
  70. package/dist/compatibilityOptions.d.mts +2 -0
  71. package/dist/compatibilityOptions.mjs +2 -0
  72. package/dist/config.cjs +163 -0
  73. package/dist/config.d.mts +7 -0
  74. package/dist/config.mjs +7 -0
  75. package/dist/doctorCommand.cjs +5 -0
  76. package/dist/doctorCommand.d.mts +2 -0
  77. package/dist/doctorCommand.mjs +2 -0
  78. package/dist/emitMcpCommand.cjs +4 -0
  79. package/dist/emitMcpCommand.d.mts +2 -0
  80. package/dist/emitMcpCommand.mjs +2 -0
  81. package/dist/explainCommand.cjs +5 -0
  82. package/dist/explainCommand.d.mts +2 -0
  83. package/dist/explainCommand.mjs +2 -0
  84. package/dist/extensions/server.cjs +39 -0
  85. package/dist/extensions/server.cjs.map +1 -0
  86. package/dist/extensions/server.d.mts +5 -0
  87. package/dist/extensions/server.d.mts.map +1 -0
  88. package/dist/extensions/server.mjs +34 -0
  89. package/dist/extensions/server.mjs.map +1 -0
  90. package/dist/harnessContext.cjs +5 -0
  91. package/dist/harnessContext.d.mts +2 -0
  92. package/dist/harnessContext.mjs +2 -0
  93. package/dist/harnessState.cjs +19 -0
  94. package/dist/harnessState.d.mts +2 -0
  95. package/dist/harnessState.mjs +2 -0
  96. package/dist/help.cjs +12 -0
  97. package/dist/help.d.mts +6 -0
  98. package/dist/help.mjs +6 -0
  99. package/dist/index.cjs +306 -0
  100. package/dist/index.d.mts +40 -0
  101. package/dist/index.mjs +37 -0
  102. package/dist/initCommand.cjs +4 -0
  103. package/dist/initCommand.d.mts +2 -0
  104. package/dist/initCommand.mjs +2 -0
  105. package/dist/matrixOptions.cjs +28 -0
  106. package/dist/matrixOptions.d.mts +2 -0
  107. package/dist/matrixOptions.mjs +2 -0
  108. package/dist/matrixSwitcher.cjs +11 -0
  109. package/dist/matrixSwitcher.d.mts +3 -0
  110. package/dist/matrixSwitcher.mjs +3 -0
  111. package/dist/mcpFilter.cjs +9 -0
  112. package/dist/mcpFilter.d.mts +1 -0
  113. package/dist/mcpFilter.mjs +2 -0
  114. package/dist/options.cjs +3 -0
  115. package/dist/options.d.mts +2 -0
  116. package/dist/options.mjs +2 -0
  117. package/dist/process.cjs +12 -0
  118. package/dist/process.d.mts +2 -0
  119. package/dist/process.mjs +2 -0
  120. package/dist/projectTrust.cjs +6 -0
  121. package/dist/projectTrust.d.mts +2 -0
  122. package/dist/projectTrust.mjs +2 -0
  123. package/dist/repository.cjs +5 -0
  124. package/dist/repository.d.mts +2 -0
  125. package/dist/repository.mjs +2 -0
  126. package/dist/resourceCollector.cjs +9 -0
  127. package/dist/resourceCollector.d.mts +1 -0
  128. package/dist/resourceCollector.mjs +2 -0
  129. package/dist/router.cjs +6 -0
  130. package/dist/router.d.mts +2 -0
  131. package/dist/router.mjs +2 -0
  132. package/dist/services.cjs +97 -0
  133. package/dist/services.d.mts +12 -0
  134. package/dist/services.mjs +12 -0
  135. package/dist/shared.cjs +18 -0
  136. package/dist/shared.d.mts +2 -0
  137. package/dist/shared.mjs +2 -0
  138. package/dist/src/bin/agentDirectory.cjs +27 -0
  139. package/dist/src/bin/agentDirectory.cjs.map +1 -0
  140. package/dist/src/bin/agentDirectory.mjs +26 -0
  141. package/dist/src/bin/agentDirectory.mjs.map +1 -0
  142. package/dist/src/builders/apiContractExport/index.cjs +126 -0
  143. package/dist/src/builders/apiContractExport/index.cjs.map +1 -0
  144. package/dist/src/builders/apiContractExport/index.mjs +123 -0
  145. package/dist/src/builders/apiContractExport/index.mjs.map +1 -0
  146. package/dist/src/builders/cli/entryResolution.cjs +39 -0
  147. package/dist/src/builders/cli/entryResolution.cjs.map +1 -0
  148. package/dist/src/builders/cli/entryResolution.mjs +35 -0
  149. package/dist/src/builders/cli/entryResolution.mjs.map +1 -0
  150. package/dist/src/builders/cli/harnessContext.cjs +175 -0
  151. package/dist/src/builders/cli/harnessContext.cjs.map +1 -0
  152. package/dist/src/builders/cli/harnessContext.d.mts +48 -0
  153. package/dist/src/builders/cli/harnessContext.d.mts.map +1 -0
  154. package/dist/src/builders/cli/harnessContext.mjs +167 -0
  155. package/dist/src/builders/cli/harnessContext.mjs.map +1 -0
  156. package/dist/src/builders/cli/sessionComposition.cjs +27 -0
  157. package/dist/src/builders/cli/sessionComposition.cjs.map +1 -0
  158. package/dist/src/builders/cli/sessionComposition.mjs +26 -0
  159. package/dist/src/builders/cli/sessionComposition.mjs.map +1 -0
  160. package/dist/src/builders/hooks/index.cjs +238 -0
  161. package/dist/src/builders/hooks/index.cjs.map +1 -0
  162. package/dist/src/builders/hooks/index.mjs +231 -0
  163. package/dist/src/builders/hooks/index.mjs.map +1 -0
  164. package/dist/src/builders/native/index.cjs +176 -0
  165. package/dist/src/builders/native/index.cjs.map +1 -0
  166. package/dist/src/builders/native/index.d.mts +36 -0
  167. package/dist/src/builders/native/index.d.mts.map +1 -0
  168. package/dist/src/builders/native/index.mjs +170 -0
  169. package/dist/src/builders/native/index.mjs.map +1 -0
  170. package/dist/src/builders/server/backgroundSync.cjs +333 -0
  171. package/dist/src/builders/server/backgroundSync.cjs.map +1 -0
  172. package/dist/src/builders/server/backgroundSync.mjs +320 -0
  173. package/dist/src/builders/server/backgroundSync.mjs.map +1 -0
  174. package/dist/src/builders/server/computerUseBinding.cjs +273 -0
  175. package/dist/src/builders/server/computerUseBinding.cjs.map +1 -0
  176. package/dist/src/builders/server/computerUseBinding.mjs +269 -0
  177. package/dist/src/builders/server/computerUseBinding.mjs.map +1 -0
  178. package/dist/src/builders/server/computerUseRecordings.cjs +188 -0
  179. package/dist/src/builders/server/computerUseRecordings.cjs.map +1 -0
  180. package/dist/src/builders/server/computerUseRecordings.mjs +184 -0
  181. package/dist/src/builders/server/computerUseRecordings.mjs.map +1 -0
  182. package/dist/src/builders/server/defaultWorkspace.cjs +38 -0
  183. package/dist/src/builders/server/defaultWorkspace.cjs.map +1 -0
  184. package/dist/src/builders/server/defaultWorkspace.mjs +35 -0
  185. package/dist/src/builders/server/defaultWorkspace.mjs.map +1 -0
  186. package/dist/src/builders/server/idleRestart.cjs +149 -0
  187. package/dist/src/builders/server/idleRestart.cjs.map +1 -0
  188. package/dist/src/builders/server/idleRestart.mjs +136 -0
  189. package/dist/src/builders/server/idleRestart.mjs.map +1 -0
  190. package/dist/src/builders/server/index.cjs +63 -0
  191. package/dist/src/builders/server/index.cjs.map +1 -0
  192. package/dist/src/builders/server/index.mjs +60 -0
  193. package/dist/src/builders/server/index.mjs.map +1 -0
  194. package/dist/src/builders/server/logSink.cjs +57 -0
  195. package/dist/src/builders/server/logSink.cjs.map +1 -0
  196. package/dist/src/builders/server/logSink.mjs +57 -0
  197. package/dist/src/builders/server/logSink.mjs.map +1 -0
  198. package/dist/src/builders/server/mcpApp.cjs +152 -0
  199. package/dist/src/builders/server/mcpApp.cjs.map +1 -0
  200. package/dist/src/builders/server/mcpApp.d.mts +18 -0
  201. package/dist/src/builders/server/mcpApp.d.mts.map +1 -0
  202. package/dist/src/builders/server/mcpApp.mjs +147 -0
  203. package/dist/src/builders/server/mcpApp.mjs.map +1 -0
  204. package/dist/src/builders/server/mcpAppBuild.cjs +111 -0
  205. package/dist/src/builders/server/mcpAppBuild.cjs.map +1 -0
  206. package/dist/src/builders/server/mcpAppBuild.d.mts +24 -0
  207. package/dist/src/builders/server/mcpAppBuild.d.mts.map +1 -0
  208. package/dist/src/builders/server/mcpAppBuild.mjs +105 -0
  209. package/dist/src/builders/server/mcpAppBuild.mjs.map +1 -0
  210. package/dist/src/builders/server/mcpBundle.cjs +87 -0
  211. package/dist/src/builders/server/mcpBundle.cjs.map +1 -0
  212. package/dist/src/builders/server/mcpBundle.d.mts +23 -0
  213. package/dist/src/builders/server/mcpBundle.d.mts.map +1 -0
  214. package/dist/src/builders/server/mcpBundle.mjs +84 -0
  215. package/dist/src/builders/server/mcpBundle.mjs.map +1 -0
  216. package/dist/src/builders/server/packageReloadCheck.cjs +62 -0
  217. package/dist/src/builders/server/packageReloadCheck.cjs.map +1 -0
  218. package/dist/src/builders/server/packageReloadCheck.mjs +61 -0
  219. package/dist/src/builders/server/packageReloadCheck.mjs.map +1 -0
  220. package/dist/src/builders/server/packageUrl.cjs +210 -0
  221. package/dist/src/builders/server/packageUrl.cjs.map +1 -0
  222. package/dist/src/builders/server/packageUrl.mjs +203 -0
  223. package/dist/src/builders/server/packageUrl.mjs.map +1 -0
  224. package/dist/src/builders/server/runtime.cjs +1428 -0
  225. package/dist/src/builders/server/runtime.cjs.map +1 -0
  226. package/dist/src/builders/server/runtime.mjs +1420 -0
  227. package/dist/src/builders/server/runtime.mjs.map +1 -0
  228. package/dist/src/builders/server/runtimeResources.cjs +72 -0
  229. package/dist/src/builders/server/runtimeResources.cjs.map +1 -0
  230. package/dist/src/builders/server/runtimeResources.mjs +71 -0
  231. package/dist/src/builders/server/runtimeResources.mjs.map +1 -0
  232. package/dist/src/builders/server/selectionStatus.cjs +12 -0
  233. package/dist/src/builders/server/selectionStatus.cjs.map +1 -0
  234. package/dist/src/builders/server/selectionStatus.mjs +12 -0
  235. package/dist/src/builders/server/selectionStatus.mjs.map +1 -0
  236. package/dist/src/builders/server/sessionArguments.cjs +63 -0
  237. package/dist/src/builders/server/sessionArguments.cjs.map +1 -0
  238. package/dist/src/builders/server/sessionArguments.mjs +62 -0
  239. package/dist/src/builders/server/sessionArguments.mjs.map +1 -0
  240. package/dist/src/builders/server/shutdown.cjs +16 -0
  241. package/dist/src/builders/server/shutdown.cjs.map +1 -0
  242. package/dist/src/builders/server/shutdown.mjs +16 -0
  243. package/dist/src/builders/server/shutdown.mjs.map +1 -0
  244. package/dist/src/builders/server/webTemplateDecision.cjs +34 -0
  245. package/dist/src/builders/server/webTemplateDecision.cjs.map +1 -0
  246. package/dist/src/builders/server/webTemplateDecision.mjs +32 -0
  247. package/dist/src/builders/server/webTemplateDecision.mjs.map +1 -0
  248. package/dist/src/builders/server/workspaceCheckout.cjs +31 -0
  249. package/dist/src/builders/server/workspaceCheckout.cjs.map +1 -0
  250. package/dist/src/builders/server/workspaceCheckout.mjs +29 -0
  251. package/dist/src/builders/server/workspaceCheckout.mjs.map +1 -0
  252. package/dist/src/builders/web/bundle.cjs +225 -0
  253. package/dist/src/builders/web/bundle.cjs.map +1 -0
  254. package/dist/src/builders/web/bundle.d.mts +65 -0
  255. package/dist/src/builders/web/bundle.d.mts.map +1 -0
  256. package/dist/src/builders/web/bundle.mjs +221 -0
  257. package/dist/src/builders/web/bundle.mjs.map +1 -0
  258. package/dist/src/builders/web/bundleAssetPolicy.cjs +96 -0
  259. package/dist/src/builders/web/bundleAssetPolicy.cjs.map +1 -0
  260. package/dist/src/builders/web/bundleAssetPolicy.d.mts +22 -0
  261. package/dist/src/builders/web/bundleAssetPolicy.d.mts.map +1 -0
  262. package/dist/src/builders/web/bundleAssetPolicy.mjs +95 -0
  263. package/dist/src/builders/web/bundleAssetPolicy.mjs.map +1 -0
  264. package/dist/src/builders/web/index.cjs +361 -0
  265. package/dist/src/builders/web/index.cjs.map +1 -0
  266. package/dist/src/builders/web/index.d.mts +109 -0
  267. package/dist/src/builders/web/index.d.mts.map +1 -0
  268. package/dist/src/builders/web/index.mjs +342 -0
  269. package/dist/src/builders/web/index.mjs.map +1 -0
  270. package/dist/src/builders/web/webDevRoots.cjs +27 -0
  271. package/dist/src/builders/web/webDevRoots.cjs.map +1 -0
  272. package/dist/src/builders/web/webDevRoots.d.mts +22 -0
  273. package/dist/src/builders/web/webDevRoots.d.mts.map +1 -0
  274. package/dist/src/builders/web/webDevRoots.mjs +25 -0
  275. package/dist/src/builders/web/webDevRoots.mjs.map +1 -0
  276. package/dist/src/builders/web/webPluginGenerate.cjs +188 -0
  277. package/dist/src/builders/web/webPluginGenerate.cjs.map +1 -0
  278. package/dist/src/builders/web/webPluginGenerate.d.mts +56 -0
  279. package/dist/src/builders/web/webPluginGenerate.d.mts.map +1 -0
  280. package/dist/src/builders/web/webPluginGenerate.mjs +178 -0
  281. package/dist/src/builders/web/webPluginGenerate.mjs.map +1 -0
  282. package/dist/src/builders/web/webPluginManifest.cjs +128 -0
  283. package/dist/src/builders/web/webPluginManifest.cjs.map +1 -0
  284. package/dist/src/builders/web/webPluginManifest.d.mts +64 -0
  285. package/dist/src/builders/web/webPluginManifest.d.mts.map +1 -0
  286. package/dist/src/builders/web/webPluginManifest.mjs +118 -0
  287. package/dist/src/builders/web/webPluginManifest.mjs.map +1 -0
  288. package/dist/src/builders/web/webPluginScan.cjs +57 -0
  289. package/dist/src/builders/web/webPluginScan.cjs.map +1 -0
  290. package/dist/src/builders/web/webPluginScan.d.mts +19 -0
  291. package/dist/src/builders/web/webPluginScan.d.mts.map +1 -0
  292. package/dist/src/builders/web/webPluginScan.mjs +54 -0
  293. package/dist/src/builders/web/webPluginScan.mjs.map +1 -0
  294. package/dist/src/builders/web/webPluginVite.cjs +255 -0
  295. package/dist/src/builders/web/webPluginVite.cjs.map +1 -0
  296. package/dist/src/builders/web/webPluginVite.d.mts +64 -0
  297. package/dist/src/builders/web/webPluginVite.d.mts.map +1 -0
  298. package/dist/src/builders/web/webPluginVite.mjs +242 -0
  299. package/dist/src/builders/web/webPluginVite.mjs.map +1 -0
  300. package/dist/src/cli/cliApp.cjs +187 -0
  301. package/dist/src/cli/cliApp.cjs.map +1 -0
  302. package/dist/src/cli/cliApp.d.mts +32 -0
  303. package/dist/src/cli/cliApp.d.mts.map +1 -0
  304. package/dist/src/cli/cliApp.mjs +184 -0
  305. package/dist/src/cli/cliApp.mjs.map +1 -0
  306. package/dist/src/cli/commands/api-export/index.cjs +66 -0
  307. package/dist/src/cli/commands/api-export/index.cjs.map +1 -0
  308. package/dist/src/cli/commands/api-export/index.mjs +62 -0
  309. package/dist/src/cli/commands/api-export/index.mjs.map +1 -0
  310. package/dist/src/cli/commands/baseCommand.cjs +16 -0
  311. package/dist/src/cli/commands/baseCommand.cjs.map +1 -0
  312. package/dist/src/cli/commands/baseCommand.d.mts +24 -0
  313. package/dist/src/cli/commands/baseCommand.d.mts.map +1 -0
  314. package/dist/src/cli/commands/baseCommand.mjs +16 -0
  315. package/dist/src/cli/commands/baseCommand.mjs.map +1 -0
  316. package/dist/src/cli/commands/compat/context.cjs +115 -0
  317. package/dist/src/cli/commands/compat/context.cjs.map +1 -0
  318. package/dist/src/cli/commands/compat/context.d.mts +22 -0
  319. package/dist/src/cli/commands/compat/context.d.mts.map +1 -0
  320. package/dist/src/cli/commands/compat/context.mjs +110 -0
  321. package/dist/src/cli/commands/compat/context.mjs.map +1 -0
  322. package/dist/src/cli/commands/compat/help.cjs +26 -0
  323. package/dist/src/cli/commands/compat/help.cjs.map +1 -0
  324. package/dist/src/cli/commands/compat/help.d.mts +4 -0
  325. package/dist/src/cli/commands/compat/help.d.mts.map +1 -0
  326. package/dist/src/cli/commands/compat/help.mjs +25 -0
  327. package/dist/src/cli/commands/compat/help.mjs.map +1 -0
  328. package/dist/src/cli/commands/compat/index.cjs +73 -0
  329. package/dist/src/cli/commands/compat/index.cjs.map +1 -0
  330. package/dist/src/cli/commands/compat/index.d.mts +14 -0
  331. package/dist/src/cli/commands/compat/index.d.mts.map +1 -0
  332. package/dist/src/cli/commands/compat/index.mjs +70 -0
  333. package/dist/src/cli/commands/compat/index.mjs.map +1 -0
  334. package/dist/src/cli/commands/compat/options.cjs +88 -0
  335. package/dist/src/cli/commands/compat/options.cjs.map +1 -0
  336. package/dist/src/cli/commands/compat/options.d.mts +15 -0
  337. package/dist/src/cli/commands/compat/options.d.mts.map +1 -0
  338. package/dist/src/cli/commands/compat/options.mjs +86 -0
  339. package/dist/src/cli/commands/compat/options.mjs.map +1 -0
  340. package/dist/src/cli/commands/compat/providers/antigravity.cjs +294 -0
  341. package/dist/src/cli/commands/compat/providers/antigravity.cjs.map +1 -0
  342. package/dist/src/cli/commands/compat/providers/antigravity.d.mts +9 -0
  343. package/dist/src/cli/commands/compat/providers/antigravity.d.mts.map +1 -0
  344. package/dist/src/cli/commands/compat/providers/antigravity.mjs +289 -0
  345. package/dist/src/cli/commands/compat/providers/antigravity.mjs.map +1 -0
  346. package/dist/src/cli/commands/compat/providers/codex.cjs +178 -0
  347. package/dist/src/cli/commands/compat/providers/codex.cjs.map +1 -0
  348. package/dist/src/cli/commands/compat/providers/codex.d.mts +17 -0
  349. package/dist/src/cli/commands/compat/providers/codex.d.mts.map +1 -0
  350. package/dist/src/cli/commands/compat/providers/codex.mjs +170 -0
  351. package/dist/src/cli/commands/compat/providers/codex.mjs.map +1 -0
  352. package/dist/src/cli/commands/compat/providers/index.cjs +65 -0
  353. package/dist/src/cli/commands/compat/providers/index.cjs.map +1 -0
  354. package/dist/src/cli/commands/compat/providers/index.d.mts +15 -0
  355. package/dist/src/cli/commands/compat/providers/index.d.mts.map +1 -0
  356. package/dist/src/cli/commands/compat/providers/index.mjs +45 -0
  357. package/dist/src/cli/commands/compat/providers/index.mjs.map +1 -0
  358. package/dist/src/cli/commands/compat/providers/process.cjs +172 -0
  359. package/dist/src/cli/commands/compat/providers/process.cjs.map +1 -0
  360. package/dist/src/cli/commands/compat/providers/process.d.mts +33 -0
  361. package/dist/src/cli/commands/compat/providers/process.d.mts.map +1 -0
  362. package/dist/src/cli/commands/compat/providers/process.mjs +159 -0
  363. package/dist/src/cli/commands/compat/providers/process.mjs.map +1 -0
  364. package/dist/src/cli/commands/compat/providers/shared.cjs +76 -0
  365. package/dist/src/cli/commands/compat/providers/shared.cjs.map +1 -0
  366. package/dist/src/cli/commands/compat/providers/shared.d.mts +40 -0
  367. package/dist/src/cli/commands/compat/providers/shared.d.mts.map +1 -0
  368. package/dist/src/cli/commands/compat/providers/shared.mjs +61 -0
  369. package/dist/src/cli/commands/compat/providers/shared.mjs.map +1 -0
  370. package/dist/src/cli/commands/compat/types.d.mts +31 -0
  371. package/dist/src/cli/commands/compat/types.d.mts.map +1 -0
  372. package/dist/src/cli/commands/doctor/help.cjs +19 -0
  373. package/dist/src/cli/commands/doctor/help.cjs.map +1 -0
  374. package/dist/src/cli/commands/doctor/help.d.mts +4 -0
  375. package/dist/src/cli/commands/doctor/help.d.mts.map +1 -0
  376. package/dist/src/cli/commands/doctor/help.mjs +19 -0
  377. package/dist/src/cli/commands/doctor/help.mjs.map +1 -0
  378. package/dist/src/cli/commands/doctor/index.cjs +118 -0
  379. package/dist/src/cli/commands/doctor/index.cjs.map +1 -0
  380. package/dist/src/cli/commands/doctor/index.d.mts +33 -0
  381. package/dist/src/cli/commands/doctor/index.d.mts.map +1 -0
  382. package/dist/src/cli/commands/doctor/index.mjs +113 -0
  383. package/dist/src/cli/commands/doctor/index.mjs.map +1 -0
  384. package/dist/src/cli/commands/emit-mcp/index.cjs +32 -0
  385. package/dist/src/cli/commands/emit-mcp/index.cjs.map +1 -0
  386. package/dist/src/cli/commands/emit-mcp/index.d.mts +19 -0
  387. package/dist/src/cli/commands/emit-mcp/index.d.mts.map +1 -0
  388. package/dist/src/cli/commands/emit-mcp/index.mjs +31 -0
  389. package/dist/src/cli/commands/emit-mcp/index.mjs.map +1 -0
  390. package/dist/src/cli/commands/explain/index.cjs +155 -0
  391. package/dist/src/cli/commands/explain/index.cjs.map +1 -0
  392. package/dist/src/cli/commands/explain/index.d.mts +57 -0
  393. package/dist/src/cli/commands/explain/index.d.mts.map +1 -0
  394. package/dist/src/cli/commands/explain/index.mjs +150 -0
  395. package/dist/src/cli/commands/explain/index.mjs.map +1 -0
  396. package/dist/src/cli/commands/init/constants.cjs +11 -0
  397. package/dist/src/cli/commands/init/constants.cjs.map +1 -0
  398. package/dist/src/cli/commands/init/constants.mjs +11 -0
  399. package/dist/src/cli/commands/init/constants.mjs.map +1 -0
  400. package/dist/src/cli/commands/init/help.cjs +17 -0
  401. package/dist/src/cli/commands/init/help.cjs.map +1 -0
  402. package/dist/src/cli/commands/init/help.d.mts +4 -0
  403. package/dist/src/cli/commands/init/help.d.mts.map +1 -0
  404. package/dist/src/cli/commands/init/help.mjs +17 -0
  405. package/dist/src/cli/commands/init/help.mjs.map +1 -0
  406. package/dist/src/cli/commands/init/index.cjs +67 -0
  407. package/dist/src/cli/commands/init/index.cjs.map +1 -0
  408. package/dist/src/cli/commands/init/index.d.mts +12 -0
  409. package/dist/src/cli/commands/init/index.d.mts.map +1 -0
  410. package/dist/src/cli/commands/init/index.mjs +63 -0
  411. package/dist/src/cli/commands/init/index.mjs.map +1 -0
  412. package/dist/src/cli/commands/init/presenter.cjs +140 -0
  413. package/dist/src/cli/commands/init/presenter.cjs.map +1 -0
  414. package/dist/src/cli/commands/init/presenter.d.mts +8 -0
  415. package/dist/src/cli/commands/init/presenter.d.mts.map +1 -0
  416. package/dist/src/cli/commands/init/presenter.mjs +140 -0
  417. package/dist/src/cli/commands/init/presenter.mjs.map +1 -0
  418. package/dist/src/cli/commands/sync/help.cjs +34 -0
  419. package/dist/src/cli/commands/sync/help.cjs.map +1 -0
  420. package/dist/src/cli/commands/sync/help.d.mts +4 -0
  421. package/dist/src/cli/commands/sync/help.d.mts.map +1 -0
  422. package/dist/src/cli/commands/sync/help.mjs +34 -0
  423. package/dist/src/cli/commands/sync/help.mjs.map +1 -0
  424. package/dist/src/cli/commands/sync/index.cjs +215 -0
  425. package/dist/src/cli/commands/sync/index.cjs.map +1 -0
  426. package/dist/src/cli/commands/sync/index.d.mts +20 -0
  427. package/dist/src/cli/commands/sync/index.d.mts.map +1 -0
  428. package/dist/src/cli/commands/sync/index.mjs +206 -0
  429. package/dist/src/cli/commands/sync/index.mjs.map +1 -0
  430. package/dist/src/cli/commands/sync/presenter.cjs +58 -0
  431. package/dist/src/cli/commands/sync/presenter.cjs.map +1 -0
  432. package/dist/src/cli/commands/sync/presenter.d.mts +16 -0
  433. package/dist/src/cli/commands/sync/presenter.d.mts.map +1 -0
  434. package/dist/src/cli/commands/sync/presenter.mjs +57 -0
  435. package/dist/src/cli/commands/sync/presenter.mjs.map +1 -0
  436. package/dist/src/cli/commands/sync/workflow.cjs +16 -0
  437. package/dist/src/cli/commands/sync/workflow.cjs.map +1 -0
  438. package/dist/src/cli/commands/sync/workflow.mjs +16 -0
  439. package/dist/src/cli/commands/sync/workflow.mjs.map +1 -0
  440. package/dist/src/cli/commands/web/index.cjs +88 -0
  441. package/dist/src/cli/commands/web/index.cjs.map +1 -0
  442. package/dist/src/cli/commands/web/index.mjs +85 -0
  443. package/dist/src/cli/commands/web/index.mjs.map +1 -0
  444. package/dist/src/cli/harnessOptions.cjs +70 -0
  445. package/dist/src/cli/harnessOptions.cjs.map +1 -0
  446. package/dist/src/cli/harnessOptions.d.mts +26 -0
  447. package/dist/src/cli/harnessOptions.d.mts.map +1 -0
  448. package/dist/src/cli/harnessOptions.mjs +66 -0
  449. package/dist/src/cli/harnessOptions.mjs.map +1 -0
  450. package/dist/src/cli/help.cjs +82 -0
  451. package/dist/src/cli/help.cjs.map +1 -0
  452. package/dist/src/cli/help.d.mts +10 -0
  453. package/dist/src/cli/help.d.mts.map +1 -0
  454. package/dist/src/cli/help.mjs +78 -0
  455. package/dist/src/cli/help.mjs.map +1 -0
  456. package/dist/src/cli/matrixOptions.cjs +178 -0
  457. package/dist/src/cli/matrixOptions.cjs.map +1 -0
  458. package/dist/src/cli/matrixOptions.d.mts +90 -0
  459. package/dist/src/cli/matrixOptions.d.mts.map +1 -0
  460. package/dist/src/cli/matrixOptions.mjs +151 -0
  461. package/dist/src/cli/matrixOptions.mjs.map +1 -0
  462. package/dist/src/cli/options.cjs +281 -0
  463. package/dist/src/cli/options.cjs.map +1 -0
  464. package/dist/src/cli/options.d.mts +5 -0
  465. package/dist/src/cli/options.d.mts.map +1 -0
  466. package/dist/src/cli/options.mjs +279 -0
  467. package/dist/src/cli/options.mjs.map +1 -0
  468. package/dist/src/cli/router.cjs +57 -0
  469. package/dist/src/cli/router.cjs.map +1 -0
  470. package/dist/src/cli/router.d.mts +32 -0
  471. package/dist/src/cli/router.d.mts.map +1 -0
  472. package/dist/src/cli/router.mjs +54 -0
  473. package/dist/src/cli/router.mjs.map +1 -0
  474. package/dist/src/cli/server/options.cjs +71 -0
  475. package/dist/src/cli/server/options.cjs.map +1 -0
  476. package/dist/src/cli/server/options.mjs +70 -0
  477. package/dist/src/cli/server/options.mjs.map +1 -0
  478. package/dist/src/cli/server/processGuards.cjs +83 -0
  479. package/dist/src/cli/server/processGuards.cjs.map +1 -0
  480. package/dist/src/cli/server/processGuards.mjs +79 -0
  481. package/dist/src/cli/server/processGuards.mjs.map +1 -0
  482. package/dist/src/cli/server/run.cjs +69 -0
  483. package/dist/src/cli/server/run.cjs.map +1 -0
  484. package/dist/src/cli/server/run.mjs +66 -0
  485. package/dist/src/cli/server/run.mjs.map +1 -0
  486. package/dist/src/composition/harnessState/index.cjs +48 -0
  487. package/dist/src/composition/harnessState/index.cjs.map +1 -0
  488. package/dist/src/composition/harnessState/index.d.mts +19 -0
  489. package/dist/src/composition/harnessState/index.d.mts.map +1 -0
  490. package/dist/src/composition/harnessState/index.mjs +34 -0
  491. package/dist/src/composition/harnessState/index.mjs.map +1 -0
  492. package/dist/src/composition/layerPackageInstaller/index.cjs +651 -0
  493. package/dist/src/composition/layerPackageInstaller/index.cjs.map +1 -0
  494. package/dist/src/composition/layerPackageInstaller/index.d.mts +74 -0
  495. package/dist/src/composition/layerPackageInstaller/index.d.mts.map +1 -0
  496. package/dist/src/composition/layerPackageInstaller/index.mjs +637 -0
  497. package/dist/src/composition/layerPackageInstaller/index.mjs.map +1 -0
  498. package/dist/src/composition/poHomeMigration/index.cjs +234 -0
  499. package/dist/src/composition/poHomeMigration/index.cjs.map +1 -0
  500. package/dist/src/composition/poHomeMigration/index.d.mts +12 -0
  501. package/dist/src/composition/poHomeMigration/index.d.mts.map +1 -0
  502. package/dist/src/composition/poHomeMigration/index.mjs +226 -0
  503. package/dist/src/composition/poHomeMigration/index.mjs.map +1 -0
  504. package/dist/src/composition/projectTrust/index.cjs +51 -0
  505. package/dist/src/composition/projectTrust/index.cjs.map +1 -0
  506. package/dist/src/composition/projectTrust/index.d.mts +22 -0
  507. package/dist/src/composition/projectTrust/index.d.mts.map +1 -0
  508. package/dist/src/composition/projectTrust/index.mjs +48 -0
  509. package/dist/src/composition/projectTrust/index.mjs.map +1 -0
  510. package/dist/src/composition/repository/index.cjs +68 -0
  511. package/dist/src/composition/repository/index.cjs.map +1 -0
  512. package/dist/src/composition/repository/index.d.mts +22 -0
  513. package/dist/src/composition/repository/index.d.mts.map +1 -0
  514. package/dist/src/composition/repository/index.mjs +63 -0
  515. package/dist/src/composition/repository/index.mjs.map +1 -0
  516. package/dist/src/composition/syncPrune/index.cjs +85 -0
  517. package/dist/src/composition/syncPrune/index.cjs.map +1 -0
  518. package/dist/src/composition/syncPrune/index.d.mts +33 -0
  519. package/dist/src/composition/syncPrune/index.d.mts.map +1 -0
  520. package/dist/src/composition/syncPrune/index.mjs +82 -0
  521. package/dist/src/composition/syncPrune/index.mjs.map +1 -0
  522. package/dist/src/composition/syncService/index.cjs +808 -0
  523. package/dist/src/composition/syncService/index.cjs.map +1 -0
  524. package/dist/src/composition/syncService/index.d.mts +65 -0
  525. package/dist/src/composition/syncService/index.d.mts.map +1 -0
  526. package/dist/src/composition/syncService/index.mjs +792 -0
  527. package/dist/src/composition/syncService/index.mjs.map +1 -0
  528. package/dist/src/composition/syncService/localBuilds.cjs +367 -0
  529. package/dist/src/composition/syncService/localBuilds.cjs.map +1 -0
  530. package/dist/src/composition/syncService/localBuilds.mjs +358 -0
  531. package/dist/src/composition/syncService/localBuilds.mjs.map +1 -0
  532. package/dist/src/composition/transitionLayers.cjs +17 -0
  533. package/dist/src/composition/transitionLayers.cjs.map +1 -0
  534. package/dist/src/composition/transitionLayers.d.mts +6 -0
  535. package/dist/src/composition/transitionLayers.d.mts.map +1 -0
  536. package/dist/src/composition/transitionLayers.mjs +16 -0
  537. package/dist/src/composition/transitionLayers.mjs.map +1 -0
  538. package/dist/src/composition/types/harness.d.mts +52 -0
  539. package/dist/src/composition/types/harness.d.mts.map +1 -0
  540. package/dist/src/extensions/setupDiagnostics.cjs +65 -0
  541. package/dist/src/extensions/setupDiagnostics.cjs.map +1 -0
  542. package/dist/src/extensions/setupDiagnostics.mjs +64 -0
  543. package/dist/src/extensions/setupDiagnostics.mjs.map +1 -0
  544. package/dist/utils.cjs +4 -0
  545. package/dist/utils.d.mts +2 -0
  546. package/dist/utils.mjs +2 -0
  547. package/dist/webBuilder.cjs +59 -0
  548. package/dist/webBuilder.d.mts +9 -0
  549. package/dist/webBuilder.mjs +9 -0
  550. package/docs/server/api-export.md +86 -0
  551. package/docs/server/api.md +144 -0
  552. package/docs/server/getting-started.md +114 -0
  553. package/docs/server/index.md +67 -0
  554. package/docs/server/ipc.md +97 -0
  555. package/docs/server/lifecycle.md +108 -0
  556. package/docs/server/security.md +101 -0
  557. package/llms.txt +12 -0
  558. package/package.json +295 -0
  559. package/src/prompts/po-author-extension/SKILL.md +35 -0
  560. package/src/prompts/po-author-extension/references/extension-contract.md +134 -0
@@ -0,0 +1,63 @@
1
+ const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
+ let node_fs = require("node:fs");
3
+ node_fs = require_runtime.__toESM(node_fs, 1);
4
+ let node_path = require("node:path");
5
+ node_path = require_runtime.__toESM(node_path, 1);
6
+ let _agimon_ai_po_core_serverFacet = require("@agimon-ai/po-core/serverFacet");
7
+ //#region src/builders/server/index.ts
8
+ function packageRootOf(entry) {
9
+ let directory = node_path.default.dirname(node_fs.default.realpathSync(entry));
10
+ for (;;) {
11
+ if (node_fs.default.existsSync(node_path.default.join(directory, "package.json"))) return directory;
12
+ const parent = node_path.default.dirname(directory);
13
+ if (parent === directory) throw new Error(`No package manifest owns ${entry}`);
14
+ directory = parent;
15
+ }
16
+ }
17
+ /**
18
+ * The server facets the given compositions select, in host installation order.
19
+ *
20
+ * Each composition contributes the packages owning its selected entries, and
21
+ * each package records which major mode and layer admitted it. A package that
22
+ * two different directories claim is ambiguous, and a built entry that resolves
23
+ * outside its package is refused.
24
+ */
25
+ function serverFacetCandidates(compositions) {
26
+ const packages = /* @__PURE__ */ new Map();
27
+ for (const composition of compositions) {
28
+ const majorMode = composition.majorMode?.name;
29
+ if (!majorMode) throw new Error("A server bundle composition needs its major mode");
30
+ const roots = new Set(composition.packageEntries.map(packageRootOf));
31
+ for (const root of roots) {
32
+ const manifest = JSON.parse(node_fs.default.readFileSync(node_path.default.join(root, "package.json"), "utf8"));
33
+ for (const declaration of (0, _agimon_ai_po_core_serverFacet.declaredServerFacetsOf)(root, manifest)) {
34
+ const previous = packages.get(declaration.packageName);
35
+ if (previous && previous.declaration.packageDir !== root) throw new Error(`Ambiguous server bundle package: ${declaration.packageName}`);
36
+ const candidate = previous ?? {
37
+ declaration,
38
+ owners: []
39
+ };
40
+ const layers = composition.selections.filter((selection) => selection.outcome === "resolved" && selection.path && packageRootOf(selection.path) === root).map((selection) => selection.layer);
41
+ for (const layer of new Set(layers.length > 0 ? layers : ["default"])) if (!candidate.owners.some((owner) => owner.majorMode === majorMode && owner.layer === layer)) candidate.owners.push({
42
+ majorMode,
43
+ layer
44
+ });
45
+ packages.set(declaration.packageName, candidate);
46
+ }
47
+ }
48
+ }
49
+ return (0, _agimon_ai_po_core_serverFacet.orderServerFacets)([...packages.values()].map(({ declaration }) => declaration)).map((declaration) => {
50
+ const module = node_fs.default.realpathSync(node_path.default.resolve(declaration.packageDir, declaration.dist));
51
+ const relative = node_path.default.relative(declaration.packageDir, module);
52
+ if (relative === ".." || relative.startsWith(`..${node_path.default.sep}`) || node_path.default.isAbsolute(relative)) throw new Error(`Server entry escapes package: ${declaration.packageName}`);
53
+ return {
54
+ declaration,
55
+ module,
56
+ owners: packages.get(declaration.packageName).owners
57
+ };
58
+ });
59
+ }
60
+ //#endregion
61
+ exports.serverFacetCandidates = serverFacetCandidates;
62
+
63
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["path","fs","declaredServerFacetsOf","orderServerFacets"],"sources":["../../../../src/builders/server/index.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport {\n type DeclaredServerFacet,\n type DoomServerBundleOwner,\n declaredServerFacetsOf,\n orderServerFacets,\n} from '@agimon-ai/po-core/serverFacet';\n\nimport type { ExtensionComposition } from '../cli/extensionAssembler';\n\nfunction packageRootOf(entry: string): string {\n let directory = path.dirname(fs.realpathSync(entry));\n for (;;) {\n if (fs.existsSync(path.join(directory, 'package.json'))) return directory;\n const parent = path.dirname(directory);\n if (parent === directory) throw new Error(`No package manifest owns ${entry}`);\n directory = parent;\n }\n}\n\n/** One server facet a composition set selects, with the built entry a host imports. */\nexport interface ServerFacetCandidate {\n readonly declaration: DeclaredServerFacet;\n /** Absolute, symlink-resolved path of the package's built `dist` entry. */\n readonly module: string;\n /** Every major mode and layer that admitted the package. */\n readonly owners: readonly DoomServerBundleOwner[];\n}\n\n/**\n * The server facets the given compositions select, in host installation order.\n *\n * Each composition contributes the packages owning its selected entries, and\n * each package records which major mode and layer admitted it. A package that\n * two different directories claim is ambiguous, and a built entry that resolves\n * outside its package is refused.\n */\nexport function serverFacetCandidates(compositions: readonly ExtensionComposition[]): ServerFacetCandidate[] {\n const packages = new Map<string, { declaration: DeclaredServerFacet; owners: DoomServerBundleOwner[] }>();\n for (const composition of compositions) {\n const majorMode = composition.majorMode?.name;\n if (!majorMode) throw new Error('A server bundle composition needs its major mode');\n const roots = new Set(composition.packageEntries.map(packageRootOf));\n for (const root of roots) {\n const manifest = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')) as Record<string, unknown>;\n for (const declaration of declaredServerFacetsOf(root, manifest)) {\n const previous = packages.get(declaration.packageName);\n if (previous && previous.declaration.packageDir !== root) {\n throw new Error(`Ambiguous server bundle package: ${declaration.packageName}`);\n }\n const candidate = previous ?? { declaration, owners: [] };\n const layers = composition.selections\n .filter(\n (selection) => selection.outcome === 'resolved' && selection.path && packageRootOf(selection.path) === root,\n )\n .map((selection) => selection.layer);\n // Fixed host packages have no layer selection; default is always explicitly admitted.\n for (const layer of new Set(layers.length > 0 ? layers : ['default'])) {\n if (!candidate.owners.some((owner) => owner.majorMode === majorMode && owner.layer === layer)) {\n candidate.owners.push({ majorMode, layer });\n }\n }\n packages.set(declaration.packageName, candidate);\n }\n }\n }\n return orderServerFacets([...packages.values()].map(({ declaration }) => declaration)).map((declaration) => {\n const module = fs.realpathSync(path.resolve(declaration.packageDir, declaration.dist));\n const relative = path.relative(declaration.packageDir, module);\n if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {\n throw new Error(`Server entry escapes package: ${declaration.packageName}`);\n }\n return { declaration, module, owners: packages.get(declaration.packageName)!.owners };\n });\n}\n"],"mappings":";;;;;;;AAYA,SAAS,cAAc,OAAuB;CAC5C,IAAI,YAAYA,UAAAA,QAAK,QAAQC,QAAAA,QAAG,aAAa,KAAK,CA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S;GACjD;EACF;CACF;CACA,QAAA,GAAOC,+BAAAA,kBAAAA,CAAkB,CAAC,GAAG,SAAS,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,kBAAkB,WAAW,CAAC,CAAC,CAAC,KAAK,gBAAgB;EAC1G,MAAM,SAASF,QAAAA,QAAG,aAAaD,UAAAA,QAAK,QAAQ,YAAY,YAAY,YAAY,IAAI,CAAC;EACrF,MAAM,WAAWA,UAAAA,QAAK,SAAS,YAAY,YAAY,MAAM;EAC7D,IAAI,aAAa,QAAQ,SAAS,WAAW,KAAKA,UAAAA,QAAK,KAAK,KAAKA,UAAAA,QAAK,WAAW,QAAQ,GACvF,MAAM,IAAI,MAAM,iCAAiC,YAAY,aAAa;EAE5E,OAAO;GAAE;GAAa;GAAQ,QAAQ,SAAS,IAAI,YAAY,WAAW,CAAC,CAAE;EAAO;CACtF,CAAC;AACH"}
@@ -0,0 +1,60 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { declaredServerFacetsOf, orderServerFacets } from "@agimon-ai/po-core/serverFacet";
4
+ //#region src/builders/server/index.ts
5
+ function packageRootOf(entry) {
6
+ let directory = path.dirname(fs.realpathSync(entry));
7
+ for (;;) {
8
+ if (fs.existsSync(path.join(directory, "package.json"))) return directory;
9
+ const parent = path.dirname(directory);
10
+ if (parent === directory) throw new Error(`No package manifest owns ${entry}`);
11
+ directory = parent;
12
+ }
13
+ }
14
+ /**
15
+ * The server facets the given compositions select, in host installation order.
16
+ *
17
+ * Each composition contributes the packages owning its selected entries, and
18
+ * each package records which major mode and layer admitted it. A package that
19
+ * two different directories claim is ambiguous, and a built entry that resolves
20
+ * outside its package is refused.
21
+ */
22
+ function serverFacetCandidates(compositions) {
23
+ const packages = /* @__PURE__ */ new Map();
24
+ for (const composition of compositions) {
25
+ const majorMode = composition.majorMode?.name;
26
+ if (!majorMode) throw new Error("A server bundle composition needs its major mode");
27
+ const roots = new Set(composition.packageEntries.map(packageRootOf));
28
+ for (const root of roots) {
29
+ const manifest = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8"));
30
+ for (const declaration of declaredServerFacetsOf(root, manifest)) {
31
+ const previous = packages.get(declaration.packageName);
32
+ if (previous && previous.declaration.packageDir !== root) throw new Error(`Ambiguous server bundle package: ${declaration.packageName}`);
33
+ const candidate = previous ?? {
34
+ declaration,
35
+ owners: []
36
+ };
37
+ const layers = composition.selections.filter((selection) => selection.outcome === "resolved" && selection.path && packageRootOf(selection.path) === root).map((selection) => selection.layer);
38
+ for (const layer of new Set(layers.length > 0 ? layers : ["default"])) if (!candidate.owners.some((owner) => owner.majorMode === majorMode && owner.layer === layer)) candidate.owners.push({
39
+ majorMode,
40
+ layer
41
+ });
42
+ packages.set(declaration.packageName, candidate);
43
+ }
44
+ }
45
+ }
46
+ return orderServerFacets([...packages.values()].map(({ declaration }) => declaration)).map((declaration) => {
47
+ const module = fs.realpathSync(path.resolve(declaration.packageDir, declaration.dist));
48
+ const relative = path.relative(declaration.packageDir, module);
49
+ if (relative === ".." || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) throw new Error(`Server entry escapes package: ${declaration.packageName}`);
50
+ return {
51
+ declaration,
52
+ module,
53
+ owners: packages.get(declaration.packageName).owners
54
+ };
55
+ });
56
+ }
57
+ //#endregion
58
+ export { serverFacetCandidates };
59
+
60
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/builders/server/index.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport {\n type DeclaredServerFacet,\n type DoomServerBundleOwner,\n declaredServerFacetsOf,\n orderServerFacets,\n} from '@agimon-ai/po-core/serverFacet';\n\nimport type { ExtensionComposition } from '../cli/extensionAssembler';\n\nfunction packageRootOf(entry: string): string {\n let directory = path.dirname(fs.realpathSync(entry));\n for (;;) {\n if (fs.existsSync(path.join(directory, 'package.json'))) return directory;\n const parent = path.dirname(directory);\n if (parent === directory) throw new Error(`No package manifest owns ${entry}`);\n directory = parent;\n }\n}\n\n/** One server facet a composition set selects, with the built entry a host imports. */\nexport interface ServerFacetCandidate {\n readonly declaration: DeclaredServerFacet;\n /** Absolute, symlink-resolved path of the package's built `dist` entry. */\n readonly module: string;\n /** Every major mode and layer that admitted the package. */\n readonly owners: readonly DoomServerBundleOwner[];\n}\n\n/**\n * The server facets the given compositions select, in host installation order.\n *\n * Each composition contributes the packages owning its selected entries, and\n * each package records which major mode and layer admitted it. A package that\n * two different directories claim is ambiguous, and a built entry that resolves\n * outside its package is refused.\n */\nexport function serverFacetCandidates(compositions: readonly ExtensionComposition[]): ServerFacetCandidate[] {\n const packages = new Map<string, { declaration: DeclaredServerFacet; owners: DoomServerBundleOwner[] }>();\n for (const composition of compositions) {\n const majorMode = composition.majorMode?.name;\n if (!majorMode) throw new Error('A server bundle composition needs its major mode');\n const roots = new Set(composition.packageEntries.map(packageRootOf));\n for (const root of roots) {\n const manifest = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')) as Record<string, unknown>;\n for (const declaration of declaredServerFacetsOf(root, manifest)) {\n const previous = packages.get(declaration.packageName);\n if (previous && previous.declaration.packageDir !== root) {\n throw new Error(`Ambiguous server bundle package: ${declaration.packageName}`);\n }\n const candidate = previous ?? { declaration, owners: [] };\n const layers = composition.selections\n .filter(\n (selection) => selection.outcome === 'resolved' && selection.path && packageRootOf(selection.path) === root,\n )\n .map((selection) => selection.layer);\n // Fixed host packages have no layer selection; default is always explicitly admitted.\n for (const layer of new Set(layers.length > 0 ? layers : ['default'])) {\n if (!candidate.owners.some((owner) => owner.majorMode === majorMode && owner.layer === layer)) {\n candidate.owners.push({ majorMode, layer });\n }\n }\n packages.set(declaration.packageName, candidate);\n }\n }\n }\n return orderServerFacets([...packages.values()].map(({ declaration }) => declaration)).map((declaration) => {\n const module = fs.realpathSync(path.resolve(declaration.packageDir, declaration.dist));\n const relative = path.relative(declaration.packageDir, module);\n if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {\n throw new Error(`Server entry escapes package: ${declaration.packageName}`);\n }\n return { declaration, module, owners: packages.get(declaration.packageName)!.owners };\n });\n}\n"],"mappings":";;;;AAYA,SAAS,cAAc,OAAuB;CAC5C,IAAI,YAAY,KAAK,QAAQ,GAAG,aAAa,KAAK,CAAC;CACnD,SAAS;EACP,IAAI,GAAG,WAAW,KAAK,KAAK,WAAW,cAAc,CAAC,GAAG,OAAO;EAChE,MAAM,SAAS,KAAK,QAAQ,SAAS;EACrC,IAAI,WAAW,WAAW,MAAM,IAAI,MAAM,4BAA4B,OAAO;EAC7E,YAAY;CACd;AACF;;;;;;;;;AAmBA,SAAgB,sBAAsB,cAAuE;CAC3G,MAAM,2BAAW,IAAI,IAAmF;CACxG,KAAK,MAAM,eAAe,cAAc;EACtC,MAAM,YAAY,YAAY,WAAW;EACzC,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,kDAAkD;EAClF,MAAM,QAAQ,IAAI,IAAI,YAAY,eAAe,IAAI,aAAa,CAAC;EACnE,KAAK,MAAM,QAAQ,OAAO;GACxB,MAAM,WAAW,KAAK,MAAM,GAAG,aAAa,KAAK,KAAK,MAAM,cAAc,GAAG,MAAM,CAAC;GACpF,KAAK,MAAM,eAAe,uBAAuB,MAAM,QAAQ,GAAG;IAChE,MAAM,WAAW,SAAS,IAAI,YAAY,WAAW;IACrD,IAAI,YAAY,SAAS,YAAY,eAAe,MAClD,MAAM,IAAI,MAAM,oCAAoC,YAAY,aAAa;IAE/E,MAAM,YAAY,YAAY;KAAE;KAAa,QAAQ,CAAC;IAAE;IACxD,MAAM,SAAS,YAAY,WACxB,QACE,cAAc,UAAU,YAAY,cAAc,UAAU,QAAQ,cAAc,UAAU,IAAI,MAAM,IACzG,CAAC,CACA,KAAK,cAAc,UAAU,KAAK;IAErC,KAAK,MAAM,SAAS,IAAI,IAAI,OAAO,SAAS,IAAI,SAAS,CAAC,SAAS,CAAC,GAClE,IAAI,CAAC,UAAU,OAAO,MAAM,UAAU,MAAM,cAAc,aAAa,MAAM,UAAU,KAAK,GAC1F,UAAU,OAAO,KAAK;KAAE;KAAW;IAAM,CAAC;IAG9C,SAAS,IAAI,YAAY,aAAa,SAAS;GACjD;EACF;CACF;CACA,OAAO,kBAAkB,CAAC,GAAG,SAAS,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,kBAAkB,WAAW,CAAC,CAAC,CAAC,KAAK,gBAAgB;EAC1G,MAAM,SAAS,GAAG,aAAa,KAAK,QAAQ,YAAY,YAAY,YAAY,IAAI,CAAC;EACrF,MAAM,WAAW,KAAK,SAAS,YAAY,YAAY,MAAM;EAC7D,IAAI,aAAa,QAAQ,SAAS,WAAW,KAAK,KAAK,KAAK,KAAK,KAAK,WAAW,QAAQ,GACvF,MAAM,IAAI,MAAM,iCAAiC,YAAY,aAAa;EAE5E,OAAO;GAAE;GAAa;GAAQ,QAAQ,SAAS,IAAI,YAAY,WAAW,CAAC,CAAE;EAAO;CACtF,CAAC;AACH"}
@@ -0,0 +1,57 @@
1
+ let node_child_process = require("node:child_process");
2
+ let node_timers_promises = require("node:timers/promises");
3
+ let node_url = require("node:url");
4
+ let node_util = require("node:util");
5
+ let _agimon_ai_log_sink_mcp = require("@agimon-ai/log-sink-mcp");
6
+ //#region src/builders/server/logSink.ts
7
+ const START_TIMEOUT_MS = 5e3;
8
+ const DISCOVERY_TIMEOUT_MS = 4e3;
9
+ const HEALTH_TIMEOUT_MS = 750;
10
+ const DISCOVERY_INTERVAL_MS = 1100;
11
+ const execFileAsync = (0, node_util.promisify)(node_child_process.execFile);
12
+ async function healthy(env) {
13
+ let timer;
14
+ try {
15
+ return await Promise.race([(0, _agimon_ai_log_sink_mcp.resolveLogSinkPort)({
16
+ env,
17
+ healthCheck: true
18
+ }), new Promise((resolve) => {
19
+ timer = setTimeout(() => resolve(void 0), HEALTH_TIMEOUT_MS);
20
+ })]) !== void 0;
21
+ } finally {
22
+ if (timer) clearTimeout(timer);
23
+ }
24
+ }
25
+ /** Attach to the shared daemon or start it through its published CLI. Never own its shutdown. */
26
+ async function ensureGlobalLogSink(options) {
27
+ const { cwd, env, notice } = options;
28
+ let failure;
29
+ try {
30
+ if (await healthy(env)) return;
31
+ const cli = (0, node_url.fileURLToPath)({}.resolve("@agimon-ai/log-sink-mcp/cli"));
32
+ await execFileAsync(process.execPath, [
33
+ cli,
34
+ "start",
35
+ "--global",
36
+ "--http-only"
37
+ ], {
38
+ cwd,
39
+ env,
40
+ timeout: START_TIMEOUT_MS,
41
+ maxBuffer: 65536
42
+ });
43
+ } catch (error) {
44
+ failure = error instanceof Error ? error.message : String(error);
45
+ }
46
+ const deadline = Date.now() + DISCOVERY_TIMEOUT_MS;
47
+ do {
48
+ if (await healthy(env)) return;
49
+ if (Date.now() + DISCOVERY_INTERVAL_MS > deadline) break;
50
+ await (0, node_timers_promises.setTimeout)(DISCOVERY_INTERVAL_MS);
51
+ } while (Date.now() < deadline);
52
+ notice(`Global log sink unavailable: ${failure ?? "healthy discovery timed out"}. Telemetry remains nonfatal.`);
53
+ }
54
+ //#endregion
55
+ exports.ensureGlobalLogSink = ensureGlobalLogSink;
56
+
57
+ //# sourceMappingURL=logSink.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logSink.cjs","names":["promisify","execFile","resolveLogSinkPort","fileURLToPath","sleep"],"sources":["../../../../src/builders/server/logSink.ts"],"sourcesContent":["import { execFile } from 'node:child_process';\nimport { setTimeout as sleep } from 'node:timers/promises';\nimport { fileURLToPath } from 'node:url';\nimport { promisify } from 'node:util';\n\nimport { resolveLogSinkPort } from '@agimon-ai/log-sink-mcp';\n\nconst START_TIMEOUT_MS = 5_000;\nconst DISCOVERY_TIMEOUT_MS = 4_000;\nconst HEALTH_TIMEOUT_MS = 750;\nconst DISCOVERY_INTERVAL_MS = 1_100;\n\nconst execFileAsync = promisify(execFile);\n\nasync function healthy(env: NodeJS.ProcessEnv): Promise<boolean> {\n // Registry discovery may wait on a broken daemon's health endpoint. The\n // server must still start, without allowing that endpoint to select a local\n // fallback or hold the startup path indefinitely.\n let timer: NodeJS.Timeout | undefined;\n try {\n const result = await Promise.race([\n resolveLogSinkPort({ env, healthCheck: true }),\n new Promise<undefined>((resolve) => {\n timer = setTimeout(() => resolve(undefined), HEALTH_TIMEOUT_MS);\n }),\n ]);\n return result !== undefined;\n } finally {\n if (timer) clearTimeout(timer);\n }\n}\n\n/** Attach to the shared daemon or start it through its published CLI. Never own its shutdown. */\nexport async function ensureGlobalLogSink(options: {\n cwd: string;\n env: NodeJS.ProcessEnv;\n notice: (message: string) => void;\n}): Promise<void> {\n const { cwd, env, notice } = options;\n let failure: string | undefined;\n try {\n if (await healthy(env)) return;\n const cli = fileURLToPath(import.meta.resolve('@agimon-ai/log-sink-mcp/cli'));\n await execFileAsync(process.execPath, [cli, 'start', '--global', '--http-only'], {\n cwd,\n env,\n timeout: START_TIMEOUT_MS,\n maxBuffer: 64 * 1024,\n });\n } catch (error) {\n failure = error instanceof Error ? error.message : String(error);\n }\n\n const deadline = Date.now() + DISCOVERY_TIMEOUT_MS;\n do {\n if (await healthy(env)) return;\n if (Date.now() + DISCOVERY_INTERVAL_MS > deadline) break;\n await sleep(DISCOVERY_INTERVAL_MS);\n } while (Date.now() < deadline);\n\n notice(`Global log sink unavailable: ${failure ?? 'healthy discovery timed out'}. Telemetry remains nonfatal.`);\n}\n"],"mappings":";;;;;;AAOA,MAAM,mBAAmB;AACzB,MAAM,uBAAuB;AAC7B,MAAM,oBAAoB;AAC1B,MAAM,wBAAwB;AAE9B,MAAM,iBAAA,GAAgBA,UAAAA,UAAAA,CAAUC,mBAAAA,QAAQ;AAExC,eAAe,QAAQ,KAA0C;CAI/D,IAAI;CACJ,IAAI;EAOF,OAAO,MANc,QAAQ,KAAK,EAAA,GAChCC,wBAAAA,mBAAAA,CAAmB;GAAE;GAAK,aAAa;EAAK,CAAC,GAC7C,IAAI,SAAoB,YAAY;GAClC,QAAQ,iBAAiB,QAAQ,KAAA,CAAS,GAAG,iBAAiB;EAChE,CAAC,CACH,CAAC,MACiB,KAAA;CACpB,UAAU;EACR,IAAI,OAAO,aAAa,KAAK;CAC/B;AACF;;AAGA,eAAsB,oBAAoB,SAIxB;CAChB,MAAM,EAAE,KAAK,KAAK,WAAW;CAC7B,IAAI;CACJ,IAAI;EACF,IAAI,MAAM,QAAQ,GAAG,GAAG;EACxB,MAAM,OAAA,GAAMC,SAAAA,cAAAA,CAAAA,CAAAA,EAA0B,QAAQ,6BAA6B,CAAC;EAC5E,MAAM,cAAc,QAAQ,UAAU;GAAC;GAAK;GAAS;GAAY;EAAa,GAAG;GAC/E;GACA;GACA,SAAS;GACT,WAAW;EACb,CAAC;CACH,SAAS,OAAO;EACd,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;CACjE;CAEA,MAAM,WAAW,KAAK,IAAI,IAAI;CAC9B,GAAG;EACD,IAAI,MAAM,QAAQ,GAAG,GAAG;EACxB,IAAI,KAAK,IAAI,IAAI,wBAAwB,UAAU;EACnD,OAAA,GAAMC,qBAAAA,WAAAA,CAAM,qBAAqB;CACnC,SAAS,KAAK,IAAI,IAAI;CAEtB,OAAO,gCAAgC,WAAW,8BAA8B,8BAA8B;AAChH"}
@@ -0,0 +1,57 @@
1
+ import { execFile } from "node:child_process";
2
+ import { setTimeout as setTimeout$1 } from "node:timers/promises";
3
+ import { fileURLToPath } from "node:url";
4
+ import { promisify } from "node:util";
5
+ import { resolveLogSinkPort } from "@agimon-ai/log-sink-mcp";
6
+ //#region src/builders/server/logSink.ts
7
+ const START_TIMEOUT_MS = 5e3;
8
+ const DISCOVERY_TIMEOUT_MS = 4e3;
9
+ const HEALTH_TIMEOUT_MS = 750;
10
+ const DISCOVERY_INTERVAL_MS = 1100;
11
+ const execFileAsync = promisify(execFile);
12
+ async function healthy(env) {
13
+ let timer;
14
+ try {
15
+ return await Promise.race([resolveLogSinkPort({
16
+ env,
17
+ healthCheck: true
18
+ }), new Promise((resolve) => {
19
+ timer = setTimeout(() => resolve(void 0), HEALTH_TIMEOUT_MS);
20
+ })]) !== void 0;
21
+ } finally {
22
+ if (timer) clearTimeout(timer);
23
+ }
24
+ }
25
+ /** Attach to the shared daemon or start it through its published CLI. Never own its shutdown. */
26
+ async function ensureGlobalLogSink(options) {
27
+ const { cwd, env, notice } = options;
28
+ let failure;
29
+ try {
30
+ if (await healthy(env)) return;
31
+ const cli = fileURLToPath(import.meta.resolve("@agimon-ai/log-sink-mcp/cli"));
32
+ await execFileAsync(process.execPath, [
33
+ cli,
34
+ "start",
35
+ "--global",
36
+ "--http-only"
37
+ ], {
38
+ cwd,
39
+ env,
40
+ timeout: START_TIMEOUT_MS,
41
+ maxBuffer: 65536
42
+ });
43
+ } catch (error) {
44
+ failure = error instanceof Error ? error.message : String(error);
45
+ }
46
+ const deadline = Date.now() + DISCOVERY_TIMEOUT_MS;
47
+ do {
48
+ if (await healthy(env)) return;
49
+ if (Date.now() + DISCOVERY_INTERVAL_MS > deadline) break;
50
+ await setTimeout$1(DISCOVERY_INTERVAL_MS);
51
+ } while (Date.now() < deadline);
52
+ notice(`Global log sink unavailable: ${failure ?? "healthy discovery timed out"}. Telemetry remains nonfatal.`);
53
+ }
54
+ //#endregion
55
+ export { ensureGlobalLogSink };
56
+
57
+ //# sourceMappingURL=logSink.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logSink.mjs","names":["sleep"],"sources":["../../../../src/builders/server/logSink.ts"],"sourcesContent":["import { execFile } from 'node:child_process';\nimport { setTimeout as sleep } from 'node:timers/promises';\nimport { fileURLToPath } from 'node:url';\nimport { promisify } from 'node:util';\n\nimport { resolveLogSinkPort } from '@agimon-ai/log-sink-mcp';\n\nconst START_TIMEOUT_MS = 5_000;\nconst DISCOVERY_TIMEOUT_MS = 4_000;\nconst HEALTH_TIMEOUT_MS = 750;\nconst DISCOVERY_INTERVAL_MS = 1_100;\n\nconst execFileAsync = promisify(execFile);\n\nasync function healthy(env: NodeJS.ProcessEnv): Promise<boolean> {\n // Registry discovery may wait on a broken daemon's health endpoint. The\n // server must still start, without allowing that endpoint to select a local\n // fallback or hold the startup path indefinitely.\n let timer: NodeJS.Timeout | undefined;\n try {\n const result = await Promise.race([\n resolveLogSinkPort({ env, healthCheck: true }),\n new Promise<undefined>((resolve) => {\n timer = setTimeout(() => resolve(undefined), HEALTH_TIMEOUT_MS);\n }),\n ]);\n return result !== undefined;\n } finally {\n if (timer) clearTimeout(timer);\n }\n}\n\n/** Attach to the shared daemon or start it through its published CLI. Never own its shutdown. */\nexport async function ensureGlobalLogSink(options: {\n cwd: string;\n env: NodeJS.ProcessEnv;\n notice: (message: string) => void;\n}): Promise<void> {\n const { cwd, env, notice } = options;\n let failure: string | undefined;\n try {\n if (await healthy(env)) return;\n const cli = fileURLToPath(import.meta.resolve('@agimon-ai/log-sink-mcp/cli'));\n await execFileAsync(process.execPath, [cli, 'start', '--global', '--http-only'], {\n cwd,\n env,\n timeout: START_TIMEOUT_MS,\n maxBuffer: 64 * 1024,\n });\n } catch (error) {\n failure = error instanceof Error ? error.message : String(error);\n }\n\n const deadline = Date.now() + DISCOVERY_TIMEOUT_MS;\n do {\n if (await healthy(env)) return;\n if (Date.now() + DISCOVERY_INTERVAL_MS > deadline) break;\n await sleep(DISCOVERY_INTERVAL_MS);\n } while (Date.now() < deadline);\n\n notice(`Global log sink unavailable: ${failure ?? 'healthy discovery timed out'}. Telemetry remains nonfatal.`);\n}\n"],"mappings":";;;;;;AAOA,MAAM,mBAAmB;AACzB,MAAM,uBAAuB;AAC7B,MAAM,oBAAoB;AAC1B,MAAM,wBAAwB;AAE9B,MAAM,gBAAgB,UAAU,QAAQ;AAExC,eAAe,QAAQ,KAA0C;CAI/D,IAAI;CACJ,IAAI;EAOF,OAAO,MANc,QAAQ,KAAK,CAChC,mBAAmB;GAAE;GAAK,aAAa;EAAK,CAAC,GAC7C,IAAI,SAAoB,YAAY;GAClC,QAAQ,iBAAiB,QAAQ,KAAA,CAAS,GAAG,iBAAiB;EAChE,CAAC,CACH,CAAC,MACiB,KAAA;CACpB,UAAU;EACR,IAAI,OAAO,aAAa,KAAK;CAC/B;AACF;;AAGA,eAAsB,oBAAoB,SAIxB;CAChB,MAAM,EAAE,KAAK,KAAK,WAAW;CAC7B,IAAI;CACJ,IAAI;EACF,IAAI,MAAM,QAAQ,GAAG,GAAG;EACxB,MAAM,MAAM,cAAc,YAAY,QAAQ,6BAA6B,CAAC;EAC5E,MAAM,cAAc,QAAQ,UAAU;GAAC;GAAK;GAAS;GAAY;EAAa,GAAG;GAC/E;GACA;GACA,SAAS;GACT,WAAW;EACb,CAAC;CACH,SAAS,OAAO;EACd,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;CACjE;CAEA,MAAM,WAAW,KAAK,IAAI,IAAI;CAC9B,GAAG;EACD,IAAI,MAAM,QAAQ,GAAG,GAAG;EACxB,IAAI,KAAK,IAAI,IAAI,wBAAwB,UAAU;EACnD,MAAMA,aAAM,qBAAqB;CACnC,SAAS,KAAK,IAAI,IAAI;CAEtB,OAAO,gCAAgC,WAAW,8BAA8B,8BAA8B;AAChH"}
@@ -0,0 +1,152 @@
1
+ const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
+ let node_fs = require("node:fs");
3
+ node_fs = require_runtime.__toESM(node_fs, 1);
4
+ let node_path = require("node:path");
5
+ node_path = require_runtime.__toESM(node_path, 1);
6
+ let node_module = require("node:module");
7
+ let node_crypto = require("node:crypto");
8
+ node_crypto = require_runtime.__toESM(node_crypto, 1);
9
+ //#region src/builders/server/mcpApp.ts
10
+ /** Resolve generator-owned inputs before looking up an immutable build. */
11
+ function mcpAppInputs(componentsRoot) {
12
+ const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
13
+ const root = componentsRoot ?? node_path.default.dirname(require$1.resolve("@agimon-ai/po-web-components/package.json"));
14
+ const coreManifest = require$1.resolve("@agimon-ai/po-core/package.json");
15
+ const reactRequire = (0, node_module.createRequire)(coreManifest);
16
+ const fonts = mcpAppFonts(root);
17
+ const inputs = /* @__PURE__ */ new Set([
18
+ __filename,
19
+ coreManifest,
20
+ ...fonts
21
+ ]);
22
+ for (const css of fonts) for (const match of node_fs.default.readFileSync(css, "utf8").matchAll(/url\(['"]?([^)'" ]+\.woff2)['"]?\)/gu)) inputs.add(node_path.default.resolve(node_path.default.dirname(css), match[1]));
23
+ for (const directory of [
24
+ node_path.default.join(root, "dist"),
25
+ node_path.default.join(root, "styles"),
26
+ node_path.default.dirname(reactRequire.resolve("react/package.json")),
27
+ node_path.default.dirname(reactRequire.resolve("react-dom/package.json")),
28
+ node_path.default.dirname(require$1.resolve("tailwindcss/package.json"))
29
+ ]) for (const file of node_fs.default.readdirSync(directory, { recursive: true })) if (typeof file === "string" && /\.(?:[cm]?js|css|json)$/u.test(file)) inputs.add(node_path.default.join(directory, file));
30
+ inputs.add(node_path.default.join(root, "package.json"));
31
+ return [...inputs].sort();
32
+ }
33
+ function mcpAppFonts(componentsRoot) {
34
+ const require$2 = (0, node_module.createRequire)(node_path.default.join(componentsRoot, "package.json"));
35
+ return ["@fontsource-variable/ibm-plex-sans/index.css", "@fontsource-variable/jetbrains-mono/index.css"].map((font) => require$2.resolve(font));
36
+ }
37
+ /** Composes the installed packages' browser registries. No tool names or presentation policies live here. */
38
+ async function bundleMcpApp(sources, outputDirectory) {
39
+ if (sources.length === 0) return void 0;
40
+ const names = /* @__PURE__ */ new Set();
41
+ for (const source of sources) for (const name of source.widgets) {
42
+ if (names.has(name)) throw new Error(`Duplicate MCP widget '${name}'`);
43
+ names.add(name);
44
+ }
45
+ const runtimeRequire = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
46
+ const coreRoot = node_path.default.dirname(runtimeRequire.resolve("@agimon-ai/po-core/package.json"));
47
+ const componentsRoot = node_path.default.dirname(runtimeRequire.resolve("@agimon-ai/po-web-components/package.json"));
48
+ const componentsManifest = JSON.parse(node_fs.default.readFileSync(node_path.default.join(componentsRoot, "package.json"), "utf8"));
49
+ const appEntry = node_path.default.resolve(componentsRoot, componentsManifest.exports["./mcpWidget"].import);
50
+ const reactRequire = (0, node_module.createRequire)(node_path.default.join(coreRoot, "package.json"));
51
+ const directory = node_path.default.join(outputDirectory, "ui");
52
+ node_fs.default.mkdirSync(directory, { recursive: true });
53
+ const outputRoot = node_fs.default.realpathSync(outputDirectory);
54
+ const entry = node_path.default.join(directory, "entry.js");
55
+ const css = node_path.default.join(directory, "app.css");
56
+ const relative = (file) => file.split(node_path.default.sep).join("/");
57
+ node_fs.default.writeFileSync(entry, [
58
+ `import { mountMcpApp } from ${JSON.stringify(relative(appEntry))};`,
59
+ ...mcpAppFonts(componentsRoot).map((font) => `import ${JSON.stringify(relative(font))};`),
60
+ "import './app.css';",
61
+ ...sources.map((source, index) => `import { widgets as widgets${index} } from ${JSON.stringify(relative(source.file))};`),
62
+ "const widgets = Object.create(null);",
63
+ ...sources.flatMap((source, index) => source.widgets.map((name) => `widgets[${JSON.stringify(name)}] = widgets${index}[${JSON.stringify(name)}];`)),
64
+ "void mountMcpApp(widgets);",
65
+ ""
66
+ ].join("\n"));
67
+ node_fs.default.writeFileSync(css, [
68
+ `@import ${JSON.stringify(relative(runtimeRequire.resolve("tailwindcss/index.css")))};`,
69
+ `@import ${JSON.stringify(relative(node_path.default.join(componentsRoot, "styles/mcp.css")))};`,
70
+ `@source ${JSON.stringify(relative(node_path.default.join(componentsRoot, "dist")))};`,
71
+ ...sources.map((source) => `@source ${JSON.stringify(relative(source.file))};`),
72
+ "body { font-family: var(--font-sans, \"IBM Plex Sans Variable\", system-ui, sans-serif); }",
73
+ "code, pre, kbd, samp { font-family: var(--font-mono, \"JetBrains Mono Variable\", monospace); }",
74
+ ""
75
+ ].join("\n"));
76
+ const inputs = /* @__PURE__ */ new Set([
77
+ ...mcpAppInputs(),
78
+ appEntry,
79
+ node_path.default.join(coreRoot, "package.json"),
80
+ node_path.default.join(componentsRoot, "package.json")
81
+ ]);
82
+ for (const root of [node_path.default.join(componentsRoot, "styles"), node_path.default.dirname(runtimeRequire.resolve("tailwindcss/package.json"))]) for (const file of node_fs.default.readdirSync(root, { recursive: true })) if (typeof file === "string" && file.endsWith(".css")) inputs.add(node_path.default.join(root, file));
83
+ const { build } = await import("vite");
84
+ const { default: tailwindcss } = await import("@tailwindcss/vite");
85
+ const built = await build({
86
+ configFile: false,
87
+ envDir: false,
88
+ root: directory,
89
+ logLevel: "warn",
90
+ define: { "process.env.NODE_ENV": JSON.stringify("production") },
91
+ plugins: [tailwindcss(), {
92
+ name: "po-mcp-inputs",
93
+ generateBundle() {
94
+ for (const id of this.getModuleIds()) {
95
+ const file = id.split("?")[0];
96
+ if (file.includes("\0") || !node_path.default.isAbsolute(file) || !node_fs.default.existsSync(file) || !node_fs.default.statSync(file).isFile()) continue;
97
+ const resolved = node_fs.default.realpathSync(file);
98
+ const withinOutput = node_path.default.relative(outputRoot, resolved);
99
+ if (withinOutput !== "" && !withinOutput.startsWith("..") && !node_path.default.isAbsolute(withinOutput)) continue;
100
+ inputs.add(resolved);
101
+ }
102
+ }
103
+ }],
104
+ resolve: { alias: [{
105
+ find: /^@agimon-ai\/po-web-components$/u,
106
+ replacement: appEntry
107
+ }, ...[
108
+ "react",
109
+ "react/jsx-runtime",
110
+ "react/jsx-dev-runtime",
111
+ "react-dom",
112
+ "react-dom/client"
113
+ ].map((specifier) => ({
114
+ find: new RegExp(`^${specifier.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}$`, "u"),
115
+ replacement: reactRequire.resolve(specifier)
116
+ }))] },
117
+ build: {
118
+ write: false,
119
+ emptyOutDir: false,
120
+ sourcemap: false,
121
+ cssCodeSplit: false,
122
+ assetsInlineLimit: Infinity,
123
+ lib: {
124
+ entry,
125
+ formats: ["iife"],
126
+ name: "PoMcpApp",
127
+ fileName: "app",
128
+ cssFileName: "app"
129
+ }
130
+ }
131
+ });
132
+ const output = (Array.isArray(built) ? built : [built]).flatMap((bundle) => "output" in bundle ? bundle.output : []);
133
+ const scripts = output.filter((item) => item.type === "chunk");
134
+ const styles = output.filter((item) => item.type === "asset").filter((item) => item.fileName.endsWith(".css"));
135
+ if (scripts.length !== 1 || scripts[0].imports.some((file) => file !== scripts[0].fileName) || scripts[0].dynamicImports.length || output.length !== scripts.length + styles.length) throw new Error(`The composed MCP app must contain one self-contained script and inline CSS only: ${output.map((item) => item.fileName).join(", ")}; imports: ${scripts.flatMap((item) => [...item.imports, ...item.dynamicImports]).join(", ")}`);
136
+ const script = scripts[0].code.replace(/<\/script/giu, "<\\/script");
137
+ const html = `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Po tools</title><style>${styles.map((item) => typeof item.source === "string" ? item.source : Buffer.from(item.source).toString("utf8")).join("\n").replace(/<\/style/giu, "<\\/style")}</style></head><body><div id="root"></div><script>${script}<\/script></body></html>`;
138
+ node_fs.default.writeFileSync(node_path.default.join(directory, "index.html"), html);
139
+ return {
140
+ file: "./ui/index.html",
141
+ sha256: node_crypto.default.createHash("sha256").update(html).digest("hex"),
142
+ inputs: [...inputs].sort().map((file) => ({
143
+ path: file,
144
+ sha256: node_crypto.default.createHash("sha256").update(node_fs.default.readFileSync(file)).digest("hex")
145
+ }))
146
+ };
147
+ }
148
+ //#endregion
149
+ exports.bundleMcpApp = bundleMcpApp;
150
+ exports.mcpAppInputs = mcpAppInputs;
151
+
152
+ //# sourceMappingURL=mcpApp.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcpApp.cjs","names":["require","createRequire","path","fs","crypto"],"sources":["../../../../src/builders/server/mcpApp.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport { createRequire } from 'node:module';\nimport path from 'node:path';\n\n/** The built MCP App HTML, its digest, and the files it was built from. */\nexport interface McpAppBundle {\n readonly file: string;\n readonly sha256: string;\n readonly inputs: readonly { readonly path: string; readonly sha256: string }[];\n}\n\nexport interface McpAppSource {\n readonly file: string;\n readonly widgets: readonly string[];\n}\n\n/** Resolve generator-owned inputs before looking up an immutable build. */\nexport function mcpAppInputs(componentsRoot?: string): string[] {\n const require = createRequire(import.meta.url);\n const root = componentsRoot ?? path.dirname(require.resolve('@agimon-ai/po-web-components/package.json'));\n const coreManifest = require.resolve('@agimon-ai/po-core/package.json');\n const reactRequire = createRequire(coreManifest);\n const fonts = mcpAppFonts(root);\n const inputs = new Set<string>([import.meta.filename, coreManifest, ...fonts]);\n for (const css of fonts) {\n for (const match of fs.readFileSync(css, 'utf8').matchAll(/url\\(['\"]?([^)'\" ]+\\.woff2)['\"]?\\)/gu))\n inputs.add(path.resolve(path.dirname(css), match[1]!));\n }\n for (const directory of [\n path.join(root, 'dist'),\n path.join(root, 'styles'),\n path.dirname(reactRequire.resolve('react/package.json')),\n path.dirname(reactRequire.resolve('react-dom/package.json')),\n path.dirname(require.resolve('tailwindcss/package.json')),\n ]) {\n for (const file of fs.readdirSync(directory, { recursive: true })) {\n if (typeof file === 'string' && /\\.(?:[cm]?js|css|json)$/u.test(file)) inputs.add(path.join(directory, file));\n }\n }\n inputs.add(path.join(root, 'package.json'));\n return [...inputs].sort();\n}\n\nfunction mcpAppFonts(componentsRoot: string): string[] {\n const require = createRequire(path.join(componentsRoot, 'package.json'));\n return ['@fontsource-variable/ibm-plex-sans/index.css', '@fontsource-variable/jetbrains-mono/index.css'].map((font) =>\n require.resolve(font),\n );\n}\n\n/** Composes the installed packages' browser registries. No tool names or presentation policies live here. */\nexport async function bundleMcpApp(\n sources: readonly McpAppSource[],\n outputDirectory: string,\n): Promise<McpAppBundle | undefined> {\n if (sources.length === 0) return undefined;\n const names = new Set<string>();\n for (const source of sources) {\n for (const name of source.widgets) {\n if (names.has(name)) throw new Error(`Duplicate MCP widget '${name}'`);\n names.add(name);\n }\n }\n const runtimeRequire = createRequire(import.meta.url);\n const coreRoot = path.dirname(runtimeRequire.resolve('@agimon-ai/po-core/package.json'));\n const componentsRoot = path.dirname(runtimeRequire.resolve('@agimon-ai/po-web-components/package.json'));\n const componentsManifest = JSON.parse(fs.readFileSync(path.join(componentsRoot, 'package.json'), 'utf8')) as {\n exports: Record<string, { import: string }>;\n };\n const appEntry = path.resolve(componentsRoot, componentsManifest.exports['./mcpWidget']!.import);\n const reactRequire = createRequire(path.join(coreRoot, 'package.json'));\n const directory = path.join(outputDirectory, 'ui');\n fs.mkdirSync(directory, { recursive: true });\n const outputRoot = fs.realpathSync(outputDirectory);\n const entry = path.join(directory, 'entry.js');\n const css = path.join(directory, 'app.css');\n const relative = (file: string): string => file.split(path.sep).join('/');\n fs.writeFileSync(\n entry,\n [\n `import { mountMcpApp } from ${JSON.stringify(relative(appEntry))};`,\n ...mcpAppFonts(componentsRoot).map((font) => `import ${JSON.stringify(relative(font))};`),\n \"import './app.css';\",\n ...sources.map(\n (source, index) => `import { widgets as widgets${index} } from ${JSON.stringify(relative(source.file))};`,\n ),\n 'const widgets = Object.create(null);',\n ...sources.flatMap((source, index) =>\n source.widgets.map((name) => `widgets[${JSON.stringify(name)}] = widgets${index}[${JSON.stringify(name)}];`),\n ),\n 'void mountMcpApp(widgets);',\n '',\n ].join('\\n'),\n );\n fs.writeFileSync(\n css,\n [\n `@import ${JSON.stringify(relative(runtimeRequire.resolve('tailwindcss/index.css')))};`,\n `@import ${JSON.stringify(relative(path.join(componentsRoot, 'styles/mcp.css')))};`,\n `@source ${JSON.stringify(relative(path.join(componentsRoot, 'dist')))};`,\n ...sources.map((source) => `@source ${JSON.stringify(relative(source.file))};`),\n 'body { font-family: var(--font-sans, \"IBM Plex Sans Variable\", system-ui, sans-serif); }',\n 'code, pre, kbd, samp { font-family: var(--font-mono, \"JetBrains Mono Variable\", monospace); }',\n '',\n ].join('\\n'),\n );\n const inputs = new Set<string>([\n ...mcpAppInputs(),\n appEntry,\n path.join(coreRoot, 'package.json'),\n path.join(componentsRoot, 'package.json'),\n ]);\n for (const root of [\n path.join(componentsRoot, 'styles'),\n path.dirname(runtimeRequire.resolve('tailwindcss/package.json')),\n ]) {\n for (const file of fs.readdirSync(root, { recursive: true })) {\n if (typeof file === 'string' && file.endsWith('.css')) inputs.add(path.join(root, file));\n }\n }\n const { build } = await import('vite');\n const { default: tailwindcss } = await import('@tailwindcss/vite');\n const built = await build({\n configFile: false,\n envDir: false,\n root: directory,\n logLevel: 'warn',\n // Library builds leave this React branch intact unless it is replaced explicitly.\n define: { 'process.env.NODE_ENV': JSON.stringify('production') },\n plugins: [\n tailwindcss(),\n {\n name: 'po-mcp-inputs',\n generateBundle() {\n for (const id of this.getModuleIds()) {\n const file = id.split('?')[0]!;\n if (file.includes('\\0') || !path.isAbsolute(file) || !fs.existsSync(file) || !fs.statSync(file).isFile())\n continue;\n const resolved = fs.realpathSync(file);\n const withinOutput = path.relative(outputRoot, resolved);\n if (withinOutput !== '' && !withinOutput.startsWith('..') && !path.isAbsolute(withinOutput)) continue;\n inputs.add(resolved);\n }\n },\n },\n ],\n resolve: {\n alias: [\n { find: /^@agimon-ai\\/po-web-components$/u, replacement: appEntry },\n ...['react', 'react/jsx-runtime', 'react/jsx-dev-runtime', 'react-dom', 'react-dom/client'].map(\n (specifier) => ({\n find: new RegExp(`^${specifier.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')}$`, 'u'),\n replacement: reactRequire.resolve(specifier),\n }),\n ),\n ],\n },\n build: {\n write: false,\n emptyOutDir: false,\n sourcemap: false,\n cssCodeSplit: false,\n // Vite library mode always inlines assets, regardless of this limit.\n assetsInlineLimit: Infinity,\n lib: { entry, formats: ['iife'], name: 'PoMcpApp', fileName: 'app', cssFileName: 'app' },\n },\n });\n const bundles = Array.isArray(built) ? built : [built];\n const output = bundles.flatMap((bundle) => ('output' in bundle ? bundle.output : []));\n const scripts = output.filter((item) => item.type === 'chunk');\n const styles = output.filter((item) => item.type === 'asset').filter((item) => item.fileName.endsWith('.css'));\n if (\n scripts.length !== 1 ||\n scripts[0]!.imports.some((file) => file !== scripts[0]!.fileName) ||\n scripts[0]!.dynamicImports.length ||\n output.length !== scripts.length + styles.length\n )\n throw new Error(\n `The composed MCP app must contain one self-contained script and inline CSS only: ${output.map((item) => item.fileName).join(', ')}; imports: ${scripts.flatMap((item) => [...item.imports, ...item.dynamicImports]).join(', ')}`,\n );\n const script = scripts[0]!.code.replace(/<\\/script/giu, '<\\\\/script');\n const style = styles\n .map((item) => (typeof item.source === 'string' ? item.source : Buffer.from(item.source).toString('utf8')))\n .join('\\n')\n .replace(/<\\/style/giu, '<\\\\/style');\n const html = `<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Po tools</title><style>${style}</style></head><body><div id=\"root\"></div><script>${script}</script></body></html>`;\n fs.writeFileSync(path.join(directory, 'index.html'), html);\n // Only immutable HTML is served. The generated imports remain useful for diagnosing a sync build.\n return {\n file: './ui/index.html',\n sha256: crypto.createHash('sha256').update(html).digest('hex'),\n inputs: [...inputs]\n .sort()\n .map((file) => ({ path: file, sha256: crypto.createHash('sha256').update(fs.readFileSync(file)).digest('hex') })),\n };\n}\n"],"mappings":";;;;;;;;;;AAkBA,SAAgB,aAAa,gBAAmC;CAC9D,MAAMA,aAAAA,GAAUC,YAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B;CAC7C,MAAM,OAAO,kBAAkBC,UAAAA,QAAK,QAAQF,UAAQ,QAAQ,2CAA2C,CAAC;CACxG,MAAM,eAAeA,UAAQ,QAAQ,iCAAiC;CACtE,MAAM,gBAAA,GAAeC,YAAAA,cAAAA,CAAc,YAAY;CAC/C,MAAM,QAAQ,YAAY,IAAI;CAC9B,MAAM,yBAAS,IAAI,IAAY;;EAAuB;EAAc,GAAG;CAAK,CAAC;CAC7E,KAAK,MAAM,OAAO,OAChB,KAAK,MAAM,SAASE,QAAAA,QAAG,aAAa,KAAK,MAAM,CAAC,CAAC,SAAS,sCAAsC,GAC9F,OAAO,IAAID,UAAAA,QAAK,QAAQ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OAAO,WAAW,QAAQ,SAAS,OAAO,QAE1C,MAAM,IAAI,MACR,oFAAoF,OAAO,KAAK,SAAS,KAAK,QAAQ,CAAC,CAAC,KAAK,IAAI,EAAE,aAAa,QAAQ,SAAS,SAAS,CAAC,GAAG,KAAK,SAAS,GAAG,KAAK,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI,GAChO;CACF,MAAM,SAAS,QAAQ,EAAE,CAAE,KAAK,QAAQ,gBAAgB,YAAY;CAKpE,MAAM,OAAO,gKAJC,OACX,KAAK,SAAU,OAAO,KAAK,WAAW,WAAW,KAAK,SAAS,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,SAAS,MAAM,CAAE,CAAC,CAC1G,KAAK,IAAI,CAAC,CACV,QAAQ,eAAe,WACuJ,EAAE,oDAAoD,OAAO;CAC9O,QAAA,QAAG,cAAcA,UAAAA,QAAK,KAAK,WAAW,YAAY,GAAG,IAAI;CAEzD,OAAO;EACL,MAAM;EACN,QAAQE,YAAAA,QAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,KAAK;EAC7D,QAAQ,CAAC,GAAG,MAAM,CAAC,CAChB,KAAK,CAAC,CACN,KAAK,UAAU;GAAE,MAAM;GAAM,QAAQA,YAAAA,QAAO,WAAW,QAAQ,CAAC,CAAC,OAAOD,QAAAA,QAAG,aAAa,IAAI,CAAC,CAAC,CAAC,OAAO,KAAK;EAAE,EAAE;CACpH;AACF"}
@@ -0,0 +1,18 @@
1
+ //#region src/builders/server/mcpApp.d.ts
2
+ /** The built MCP App HTML, its digest, and the files it was built from. */
3
+ export interface McpAppBundle {
4
+ readonly file: string;
5
+ readonly sha256: string;
6
+ readonly inputs: readonly {
7
+ readonly path: string;
8
+ readonly sha256: string;
9
+ }[];
10
+ }
11
+ export interface McpAppSource {
12
+ readonly file: string;
13
+ readonly widgets: readonly string[];
14
+ }
15
+ /** Composes the installed packages' browser registries. No tool names or presentation policies live here. */
16
+ export declare function bundleMcpApp(sources: readonly McpAppSource[], outputDirectory: string): Promise<McpAppBundle | undefined>;
17
+ //#endregion
18
+ //# sourceMappingURL=mcpApp.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcpApp.d.mts","names":[],"sources":["../../../../src/builders/server/mcpApp.ts"],"mappings":";;iBAMiB;WACN;WACA;WACA;aAA4B;aAAuB;;;iBAG7C;WACN;WACA;;;wBAsCW,aACpB,kBAAkB,gBAClB,0BACC,QAAQ"}