@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,64 @@
1
+ import { collectDoctorReport } from "../cli/commands/doctor/index.mjs";
2
+ import { projectHarnessEnvironment } from "@agimon-ai/po-config/harnessState";
3
+ import { defineTool } from "@agimon-ai/po-core/serverFacet";
4
+ import { DOOM_HELP_WHEN } from "@agimon-ai/po-core/help";
5
+ import { Type } from "typebox";
6
+ //#region src/extensions/setupDiagnostics.ts
7
+ const DIAGNOSE_SETUP_NAME = "diagnose_setup";
8
+ const guidance = {
9
+ "config.yaml": "po-author-config",
10
+ "modes.yaml": "po-author-major-mode",
11
+ "domains.yaml": "po-author-domain",
12
+ "profiles.yaml": "po-author-profile"
13
+ };
14
+ function createSetupDiagnosticsTool(readScope, authorize) {
15
+ return defineTool({
16
+ name: DIAGNOSE_SETUP_NAME,
17
+ description: "Check this session's saved configuration, installed packages, and the global web build without changing anything. Returns scoped check results and the relevant setup guidance, never configuration values or credentials.",
18
+ parameters: Type.Object({}, { additionalProperties: false }),
19
+ when: DOOM_HELP_WHEN,
20
+ executionMode: "serial",
21
+ async execute(_input, execution) {
22
+ const signal = authorize(execution.signal);
23
+ const scope = readScope();
24
+ const environment = projectHarnessEnvironment({
25
+ root: scope.repoRoot,
26
+ majorMode: scope.selection.majorMode,
27
+ domains: [...scope.selection.domains],
28
+ profile: scope.selection.profile
29
+ }, { ...scope.environment });
30
+ const report = collectDoctorReport(environment, scope.cwd);
31
+ signal.throwIfAborted();
32
+ authorize(execution.signal);
33
+ const result = {
34
+ scope: "current-session",
35
+ configurationRoot: report.repoRoot,
36
+ appliedSelection: {
37
+ majorMode: scope.selection.majorMode,
38
+ domains: [...scope.selection.domains],
39
+ profile: scope.selection.profile
40
+ },
41
+ status: report.problems === 0 && report.skipped.length === 0 ? "checks-passed" : "issues-found",
42
+ checks: report.sections.map((section) => ({
43
+ area: section.label,
44
+ status: section.problems.length ? "failed" : "passed",
45
+ problemCount: section.problems.length,
46
+ guidance: guidance[section.label] ?? "po-use-help"
47
+ })),
48
+ skipped: report.skipped,
49
+ limitations: "These are saved configuration and installation checks, not a network authentication or agent health test. Error text and configuration values are omitted to protect credentials. Inspect a failed area with its package guidance before proposing a repair."
50
+ };
51
+ return {
52
+ content: [{
53
+ type: "text",
54
+ text: JSON.stringify(result, null, 2)
55
+ }],
56
+ details: result
57
+ };
58
+ }
59
+ });
60
+ }
61
+ //#endregion
62
+ export { DIAGNOSE_SETUP_NAME, createSetupDiagnosticsTool };
63
+
64
+ //# sourceMappingURL=setupDiagnostics.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupDiagnostics.mjs","names":["HELP_WHEN"],"sources":["../../../src/extensions/setupDiagnostics.ts"],"sourcesContent":["import { projectHarnessEnvironment } from '@agimon-ai/po-config/harnessState';\nimport type { DoomHeadlessSelection } from '@agimon-ai/po-core/headless';\nimport { DOOM_HELP_WHEN as HELP_WHEN } from '@agimon-ai/po-core/help';\nimport { defineTool } from '@agimon-ai/po-core/serverFacet';\nimport { Type } from 'typebox';\n\nimport { collectDoctorReport } from '../cli/commands/doctor';\n\nexport const DIAGNOSE_SETUP_NAME = 'diagnose_setup';\nexport interface SetupDiagnosticScope {\n repoRoot: string;\n cwd: string;\n environment: Readonly<Record<string, string | undefined>>;\n selection: Pick<DoomHeadlessSelection, 'majorMode' | 'domains' | 'profile'>;\n}\n\nconst guidance: Readonly<Record<string, string>> = {\n 'config.yaml': 'po-author-config',\n 'modes.yaml': 'po-author-major-mode',\n 'domains.yaml': 'po-author-domain',\n 'profiles.yaml': 'po-author-profile',\n};\n\nexport function createSetupDiagnosticsTool(\n readScope: () => SetupDiagnosticScope,\n authorize: (signal?: AbortSignal) => AbortSignal,\n) {\n return defineTool({\n name: DIAGNOSE_SETUP_NAME,\n description:\n \"Check this session's saved configuration, installed packages, and the global web build without changing anything. Returns scoped check results and the relevant setup guidance, never configuration values or credentials.\",\n parameters: Type.Object({}, { additionalProperties: false }),\n when: HELP_WHEN,\n executionMode: 'serial',\n async execute(_input, execution) {\n const signal = authorize(execution.signal);\n const scope = readScope();\n const environment = projectHarnessEnvironment(\n {\n root: scope.repoRoot,\n majorMode: scope.selection.majorMode,\n domains: [...scope.selection.domains],\n profile: scope.selection.profile,\n },\n { ...scope.environment },\n );\n const report = collectDoctorReport(environment, scope.cwd);\n signal.throwIfAborted();\n authorize(execution.signal);\n const result = {\n scope: 'current-session',\n configurationRoot: report.repoRoot,\n appliedSelection: {\n majorMode: scope.selection.majorMode,\n domains: [...scope.selection.domains],\n profile: scope.selection.profile,\n },\n status: report.problems === 0 && report.skipped.length === 0 ? 'checks-passed' : 'issues-found',\n checks: report.sections.map((section) => ({\n area: section.label,\n status: section.problems.length ? 'failed' : 'passed',\n problemCount: section.problems.length,\n guidance: guidance[section.label] ?? 'po-use-help',\n })),\n skipped: report.skipped,\n limitations:\n 'These are saved configuration and installation checks, not a network authentication or agent health test. Error text and configuration values are omitted to protect credentials. Inspect a failed area with its package guidance before proposing a repair.',\n };\n return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], details: result };\n },\n });\n}\n"],"mappings":";;;;;;AAQA,MAAa,sBAAsB;AAQnC,MAAM,WAA6C;CACjD,eAAe;CACf,cAAc;CACd,gBAAgB;CAChB,iBAAiB;AACnB;AAEA,SAAgB,2BACd,WACA,WACA;CACA,OAAO,WAAW;EAChB,MAAM;EACN,aACE;EACF,YAAY,KAAK,OAAO,CAAC,GAAG,EAAE,sBAAsB,MAAM,CAAC;EAC3D,MAAMA;EACN,eAAe;EACf,MAAM,QAAQ,QAAQ,WAAW;GAC/B,MAAM,SAAS,UAAU,UAAU,MAAM;GACzC,MAAM,QAAQ,UAAU;GACxB,MAAM,cAAc,0BAClB;IACE,MAAM,MAAM;IACZ,WAAW,MAAM,UAAU;IAC3B,SAAS,CAAC,GAAG,MAAM,UAAU,OAAO;IACpC,SAAS,MAAM,UAAU;GAC3B,GACA,EAAE,GAAG,MAAM,YAAY,CACzB;GACA,MAAM,SAAS,oBAAoB,aAAa,MAAM,GAAG;GACzD,OAAO,eAAe;GACtB,UAAU,UAAU,MAAM;GAC1B,MAAM,SAAS;IACb,OAAO;IACP,mBAAmB,OAAO;IAC1B,kBAAkB;KAChB,WAAW,MAAM,UAAU;KAC3B,SAAS,CAAC,GAAG,MAAM,UAAU,OAAO;KACpC,SAAS,MAAM,UAAU;IAC3B;IACA,QAAQ,OAAO,aAAa,KAAK,OAAO,QAAQ,WAAW,IAAI,kBAAkB;IACjF,QAAQ,OAAO,SAAS,KAAK,aAAa;KACxC,MAAM,QAAQ;KACd,QAAQ,QAAQ,SAAS,SAAS,WAAW;KAC7C,cAAc,QAAQ,SAAS;KAC/B,UAAU,SAAS,QAAQ,UAAU;IACvC,EAAE;IACF,SAAS,OAAO;IAChB,aACE;GACJ;GACA,OAAO;IAAE,SAAS,CAAC;KAAE,MAAM;KAAQ,MAAM,KAAK,UAAU,QAAQ,MAAM,CAAC;IAAE,CAAC;IAAG,SAAS;GAAO;EAC/F;CACF,CAAC;AACH"}
package/dist/utils.cjs ADDED
@@ -0,0 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_index = require("./src/composition/repository/index.cjs");
3
+ exports.findRepositoryRoot = require_index.findRepositoryRoot;
4
+ exports.isRepositoryRoot = require_index.isRepositoryRoot;
@@ -0,0 +1,2 @@
1
+ import { findRepositoryRoot, isRepositoryRoot } from "./src/composition/repository/index.mjs";
2
+ export { findRepositoryRoot, isRepositoryRoot };
package/dist/utils.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { findRepositoryRoot, isRepositoryRoot } from "./src/composition/repository/index.mjs";
2
+ export { findRepositoryRoot, isRepositoryRoot };
@@ -0,0 +1,59 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_webPluginManifest = require("./src/builders/web/webPluginManifest.cjs");
3
+ const require_webPluginScan = require("./src/builders/web/webPluginScan.cjs");
4
+ const require_index = require("./src/builders/web/index.cjs");
5
+ const require_bundleAssetPolicy = require("./src/builders/web/bundleAssetPolicy.cjs");
6
+ const require_webDevRoots = require("./src/builders/web/webDevRoots.cjs");
7
+ const require_webPluginGenerate = require("./src/builders/web/webPluginGenerate.cjs");
8
+ const require_webPluginVite = require("./src/builders/web/webPluginVite.cjs");
9
+ const require_bundle = require("./src/builders/web/bundle.cjs");
10
+ exports.BASE_STYLE_ENTRY = require_webPluginGenerate.BASE_STYLE_ENTRY;
11
+ exports.BUILD_RECORD = require_index.BUILD_RECORD;
12
+ exports.BUILTIN_CLIENT_MODULE = require_webPluginGenerate.BUILTIN_CLIENT_MODULE;
13
+ exports.BUILTIN_CSS_MODULE = require_webPluginGenerate.BUILTIN_CSS_MODULE;
14
+ exports.DEFAULT_REGISTRATION_ORDER = require_webPluginManifest.DEFAULT_REGISTRATION_ORDER;
15
+ exports.PLUGIN_ROOTS_ENV = require_webDevRoots.PLUGIN_ROOTS_ENV;
16
+ exports.PLUGIN_ROOTS_FILE = require_webDevRoots.PLUGIN_ROOTS_FILE;
17
+ exports.WEB_PLUGIN_FACADE_CHUNK = require_webPluginVite.WEB_PLUGIN_FACADE_CHUNK;
18
+ exports.WEB_PLUGIN_RUNTIME_SPECIFIERS = require_webPluginVite.WEB_PLUGIN_RUNTIME_SPECIFIERS;
19
+ exports.WebPluginManifestError = require_webPluginManifest.WebPluginManifestError;
20
+ exports.buildKeyDirectory = require_index.buildKeyDirectory;
21
+ exports.bundleAssetPolicyPlugin = require_bundleAssetPolicy.bundleAssetPolicyPlugin;
22
+ exports.bundleCockpitWeb = require_bundle.bundleCockpitWeb;
23
+ exports.classifyOptionalBundleAssets = require_bundleAssetPolicy.classifyOptionalBundleAssets;
24
+ exports.compareCodeUnits = require_webPluginManifest.compareCodeUnits;
25
+ exports.compositionPackageRoots = require_index.compositionPackageRoots;
26
+ exports.declaredPluginsOf = require_webPluginManifest.declaredPluginsOf;
27
+ exports.devPluginRoots = require_webDevRoots.devPluginRoots;
28
+ exports.duplicatePluginCopies = require_index.duplicatePluginCopies;
29
+ exports.ensureBuiltinWebPluginModules = require_webPluginGenerate.ensureBuiltinWebPluginModules;
30
+ exports.ensureGlobalWebBuild = require_index.ensureGlobalWebBuild;
31
+ exports.esModuleExportNames = require_webPluginVite.esModuleExportNames;
32
+ exports.globalBuildKey = require_index.globalBuildKey;
33
+ exports.isWebPluginFacade = require_webPluginVite.isWebPluginFacade;
34
+ exports.manifestClosure = require_bundle.manifestClosure;
35
+ exports.mountWebPluginIds = require_index.mountWebPluginIds;
36
+ exports.mountWebPluginSlots = require_index.mountWebPluginSlots;
37
+ exports.newestGlobalWebBuildKey = require_index.newestGlobalWebBuildKey;
38
+ exports.orderDeclaredPlugins = require_webPluginManifest.orderDeclaredPlugins;
39
+ exports.packageRootOf = require_index.packageRootOf;
40
+ exports.pluginBlocksOf = require_webPluginManifest.pluginBlocksOf;
41
+ exports.pluginSlot = require_webPluginManifest.pluginSlot;
42
+ exports.pluginStyleEntryName = require_webPluginGenerate.pluginStyleEntryName;
43
+ exports.readBuildJson = require_index.readBuildJson;
44
+ exports.readDevPluginRoots = require_webPluginVite.readDevPluginRoots;
45
+ exports.readGlobalWebBuildRecord = require_index.readGlobalWebBuildRecord;
46
+ exports.readGlobalWebBuildStatus = require_index.readGlobalWebBuildStatus;
47
+ exports.renderBuiltinWebPluginModules = require_webPluginGenerate.renderBuiltinWebPluginModules;
48
+ exports.renderWebPluginFacade = require_webPluginVite.renderWebPluginFacade;
49
+ exports.scanWebPlugins = require_webPluginScan.scanWebPlugins;
50
+ exports.singleFlightBuild = require_index.singleFlightBuild;
51
+ exports.unslottedWebPackages = require_index.unslottedWebPackages;
52
+ exports.webHostVersion = require_index.webHostVersion;
53
+ exports.webPluginCssAlias = require_webPluginVite.webPluginCssAlias;
54
+ exports.webPluginOverridePlugin = require_webPluginVite.webPluginOverridePlugin;
55
+ exports.webPluginRuntimeAliases = require_webPluginVite.webPluginRuntimeAliases;
56
+ exports.webPluginRuntimeFacadePlugin = require_webPluginVite.webPluginRuntimeFacadePlugin;
57
+ exports.webPluginRuntimeGlobal = require_webPluginVite.webPluginRuntimeGlobal;
58
+ exports.writeSyncWebPluginModules = require_webPluginGenerate.writeSyncWebPluginModules;
59
+ exports.writeWebPluginStyleEntries = require_webPluginGenerate.writeWebPluginStyleEntries;
@@ -0,0 +1,9 @@
1
+ import { DEFAULT_REGISTRATION_ORDER, DeclaredWebPlugin, PluginManifestField, WebPluginEntryDeclaration, WebPluginManifestError, compareCodeUnits, declaredPluginsOf, orderDeclaredPlugins, pluginBlocksOf, pluginSlot } from "./src/builders/web/webPluginManifest.mjs";
2
+ import { BUILD_RECORD, GlobalWebBuildInput, GlobalWebBuildRecord, GlobalWebBuildResult, buildKeyDirectory, compositionPackageRoots, duplicatePluginCopies, ensureGlobalWebBuild, globalBuildKey, mountWebPluginIds, mountWebPluginSlots, newestGlobalWebBuildKey, packageRootOf, readBuildJson, readGlobalWebBuildRecord, readGlobalWebBuildStatus, singleFlightBuild, unslottedWebPackages, webHostVersion } from "./src/builders/web/index.mjs";
3
+ import { BundleCockpitWebOptions, BundleCockpitWebResult, WebPluginBuildRecord, bundleCockpitWeb, manifestClosure } from "./src/builders/web/bundle.mjs";
4
+ import { BASE_STYLE_ENTRY, BUILTIN_CLIENT_MODULE, BUILTIN_CSS_MODULE, SyncGeneratedModules, WebPluginRegistryModules, WebPluginStyleEntries, ensureBuiltinWebPluginModules, pluginStyleEntryName, renderBuiltinWebPluginModules, writeSyncWebPluginModules, writeWebPluginStyleEntries } from "./src/builders/web/webPluginGenerate.mjs";
5
+ import { scanWebPlugins } from "./src/builders/web/webPluginScan.mjs";
6
+ import { ExportNameReader, WEB_PLUGIN_FACADE_CHUNK, WEB_PLUGIN_RUNTIME_SPECIFIERS, esModuleExportNames, isWebPluginFacade, readDevPluginRoots, renderWebPluginFacade, webPluginCssAlias, webPluginOverridePlugin, webPluginRuntimeAliases, webPluginRuntimeFacadePlugin, webPluginRuntimeGlobal } from "./src/builders/web/webPluginVite.mjs";
7
+ import { bundleAssetPolicyPlugin, classifyOptionalBundleAssets } from "./src/builders/web/bundleAssetPolicy.mjs";
8
+ import { DevPluginRootsInput, PLUGIN_ROOTS_ENV, PLUGIN_ROOTS_FILE, devPluginRoots } from "./src/builders/web/webDevRoots.mjs";
9
+ export { BASE_STYLE_ENTRY, BUILD_RECORD, BUILTIN_CLIENT_MODULE, BUILTIN_CSS_MODULE, BundleCockpitWebOptions, BundleCockpitWebResult, DEFAULT_REGISTRATION_ORDER, DeclaredWebPlugin, DevPluginRootsInput, ExportNameReader, GlobalWebBuildInput, GlobalWebBuildRecord, GlobalWebBuildResult, PLUGIN_ROOTS_ENV, PLUGIN_ROOTS_FILE, PluginManifestField, SyncGeneratedModules, WEB_PLUGIN_FACADE_CHUNK, WEB_PLUGIN_RUNTIME_SPECIFIERS, WebPluginBuildRecord, WebPluginEntryDeclaration, WebPluginManifestError, WebPluginRegistryModules, WebPluginStyleEntries, buildKeyDirectory, bundleAssetPolicyPlugin, bundleCockpitWeb, classifyOptionalBundleAssets, compareCodeUnits, compositionPackageRoots, declaredPluginsOf, devPluginRoots, duplicatePluginCopies, ensureBuiltinWebPluginModules, ensureGlobalWebBuild, esModuleExportNames, globalBuildKey, isWebPluginFacade, manifestClosure, mountWebPluginIds, mountWebPluginSlots, newestGlobalWebBuildKey, orderDeclaredPlugins, packageRootOf, pluginBlocksOf, pluginSlot, pluginStyleEntryName, readBuildJson, readDevPluginRoots, readGlobalWebBuildRecord, readGlobalWebBuildStatus, renderBuiltinWebPluginModules, renderWebPluginFacade, scanWebPlugins, singleFlightBuild, unslottedWebPackages, webHostVersion, webPluginCssAlias, webPluginOverridePlugin, webPluginRuntimeAliases, webPluginRuntimeFacadePlugin, webPluginRuntimeGlobal, writeSyncWebPluginModules, writeWebPluginStyleEntries };
@@ -0,0 +1,9 @@
1
+ import { DEFAULT_REGISTRATION_ORDER, WebPluginManifestError, compareCodeUnits, declaredPluginsOf, orderDeclaredPlugins, pluginBlocksOf, pluginSlot } from "./src/builders/web/webPluginManifest.mjs";
2
+ import { scanWebPlugins } from "./src/builders/web/webPluginScan.mjs";
3
+ import { BUILD_RECORD, buildKeyDirectory, compositionPackageRoots, duplicatePluginCopies, ensureGlobalWebBuild, globalBuildKey, mountWebPluginIds, mountWebPluginSlots, newestGlobalWebBuildKey, packageRootOf, readBuildJson, readGlobalWebBuildRecord, readGlobalWebBuildStatus, singleFlightBuild, unslottedWebPackages, webHostVersion } from "./src/builders/web/index.mjs";
4
+ import { bundleAssetPolicyPlugin, classifyOptionalBundleAssets } from "./src/builders/web/bundleAssetPolicy.mjs";
5
+ import { PLUGIN_ROOTS_ENV, PLUGIN_ROOTS_FILE, devPluginRoots } from "./src/builders/web/webDevRoots.mjs";
6
+ import { BASE_STYLE_ENTRY, BUILTIN_CLIENT_MODULE, BUILTIN_CSS_MODULE, ensureBuiltinWebPluginModules, pluginStyleEntryName, renderBuiltinWebPluginModules, writeSyncWebPluginModules, writeWebPluginStyleEntries } from "./src/builders/web/webPluginGenerate.mjs";
7
+ import { WEB_PLUGIN_FACADE_CHUNK, WEB_PLUGIN_RUNTIME_SPECIFIERS, esModuleExportNames, isWebPluginFacade, readDevPluginRoots, renderWebPluginFacade, webPluginCssAlias, webPluginOverridePlugin, webPluginRuntimeAliases, webPluginRuntimeFacadePlugin, webPluginRuntimeGlobal } from "./src/builders/web/webPluginVite.mjs";
8
+ import { bundleCockpitWeb, manifestClosure } from "./src/builders/web/bundle.mjs";
9
+ export { BASE_STYLE_ENTRY, BUILD_RECORD, BUILTIN_CLIENT_MODULE, BUILTIN_CSS_MODULE, DEFAULT_REGISTRATION_ORDER, PLUGIN_ROOTS_ENV, PLUGIN_ROOTS_FILE, WEB_PLUGIN_FACADE_CHUNK, WEB_PLUGIN_RUNTIME_SPECIFIERS, WebPluginManifestError, buildKeyDirectory, bundleAssetPolicyPlugin, bundleCockpitWeb, classifyOptionalBundleAssets, compareCodeUnits, compositionPackageRoots, declaredPluginsOf, devPluginRoots, duplicatePluginCopies, ensureBuiltinWebPluginModules, ensureGlobalWebBuild, esModuleExportNames, globalBuildKey, isWebPluginFacade, manifestClosure, mountWebPluginIds, mountWebPluginSlots, newestGlobalWebBuildKey, orderDeclaredPlugins, packageRootOf, pluginBlocksOf, pluginSlot, pluginStyleEntryName, readBuildJson, readDevPluginRoots, readGlobalWebBuildRecord, readGlobalWebBuildStatus, renderBuiltinWebPluginModules, renderWebPluginFacade, scanWebPlugins, singleFlightBuild, unslottedWebPackages, webHostVersion, webPluginCssAlias, webPluginOverridePlugin, webPluginRuntimeAliases, webPluginRuntimeFacadePlugin, webPluginRuntimeGlobal, writeSyncWebPluginModules, writeWebPluginStyleEntries };
@@ -0,0 +1,86 @@
1
+ # Export compiled client contracts
2
+
3
+ After installing the global root's and the workspace's packages, run this in the workspace:
4
+
5
+ ```sh
6
+ po sync
7
+ po api-export --out ./api-schema --strict
8
+ # Select a different session composition:
9
+ po api-export --out ./api-schema --major-mode copilot --strict
10
+ ```
11
+
12
+ The command composes the global root and the workspace live and reads each selected server facet's built `poServer.contracts.dist` straight from its installed package. Each contract module is imported in a bounded child process; the command never imports a server facet, installs packages, or starts servers. A package without a readable contract is recorded as a coverage gap. Run `po sync` first if the configuration names packages that are not installed yet.
13
+
14
+ The export contains:
15
+
16
+ - `openapi.json`: OpenAPI 3.1 HTTP operations, scoped plugin paths, request and response schemas, authentication, and named SSE payload schemas in `x-sse-events`.
17
+ - `asyncapi.json`: AsyncAPI 3.0 Pi envelopes, Chord calls, subscriptions and state deltas, session methods and reconstructed state, and selected extension methods and channel payloads. `x-po` identifies scope, service, member, direction through the operation action, and operation kind.
18
+ - `manifest.json`: selected global, workspace and session modes, contract fingerprints (the generation is always `live`), composition fingerprints, package and protocol versions, explicit dynamic values, coverage gaps, and SHA-256 hashes of both documents.
19
+
20
+ The global and workspace scopes use their own default major modes. `--major-mode` changes only the session composition. Local WebSockets carry framed CBOR; remote WebSockets carry sealed envelopes around those bytes. Channel operations describe decoded payloads, not JSON WebSocket frames. The selected package's `service` and `member` identify plugin calls carried through `po.plugin.v1.invoke`.
21
+
22
+ Export with `--strict` in CI. An incomplete export is still written for review, but the command exits with status 1. Missing third-party declarations do not prevent normal sync. Dynamic tool, provider and author-capability values are listed explicitly; exporting a schema does not freeze runtime capabilities or prove a client compatible.
23
+
24
+ Compare committed artifacts for API drift, then validate actual client requests, server responses and decoded socket traffic against their operation schemas. Verify the document hashes before consuming a bundle, since the manifest is written last. The web client contract tests exercise real HTTP handlers; the core contract tests use the public Pi and Chord codecs and independent OpenAPI and AsyncAPI parsers.
25
+
26
+ ## Declare a package contract
27
+
28
+ Add a separate data entry to the existing server metadata:
29
+
30
+ ```json
31
+ {
32
+ "poServer": {
33
+ "entry": "./src/extensions/server.ts",
34
+ "dist": "./dist/extensions/server.mjs",
35
+ "scopes": ["session"],
36
+ "contracts": {
37
+ "entry": "./src/exports/apiContracts.ts",
38
+ "dist": "./dist/api-contracts.mjs"
39
+ }
40
+ }
41
+ }
42
+ ```
43
+
44
+ Build the contract as its own entry. Keep its graph free of handlers, lifecycle hooks, environment reads and service initialization. Declare every imported runtime dependency in `dependencies`, including `typebox` when using it. Undeclared imports can be accidentally bundled and behave differently after compilation.
45
+
46
+ ```ts
47
+ import { defineApiContract } from '@agimon-ai/po-core/apiContracts';
48
+
49
+ export default defineApiContract({
50
+ version: 1,
51
+ http: [
52
+ {
53
+ id: 'status',
54
+ scope: 'session',
55
+ basePath: 'example',
56
+ path: '/status',
57
+ method: 'GET',
58
+ authentication: 'owner',
59
+ description: 'Read status.',
60
+ responses: {
61
+ '200': {
62
+ description: 'Current status.',
63
+ schema: {
64
+ type: 'object',
65
+ properties: { ready: { type: 'boolean' } },
66
+ required: ['ready'],
67
+ },
68
+ },
69
+ },
70
+ },
71
+ ],
72
+ sockets: [],
73
+ dynamic: [],
74
+ });
75
+ ```
76
+
77
+ Source schemas use JSON Schema draft-07, including TypeBox output. The exporter namespaces local references and translates tuple keywords for OpenAPI 3.1. Use self-contained local references, without `$id` or remote references. An API-free facet should declare empty `http` and `sockets` arrays. Use `gaps` for known missing declarations; never use an unconstrained schema to hide missing coverage.
78
+
79
+ The exporter is a separate `api-export` command, not a `sync` flag. For a local distribution build:
80
+
81
+ ```sh
82
+ node packages/cli/po/dist/bin/cli.mjs sync
83
+ node packages/cli/po/dist/bin/cli.mjs api-export --out /tmp/po-api-schema --strict
84
+ ```
85
+
86
+ OpenAPI uses direct settings routes, plural `plugins` mounts, and workspace-nested session resources. AsyncAPI declares `/api/ws`, `/api/workspaces/{workspaceId}/ws`, and `/api/workspaces/{workspaceId}/sessions/{sessionId}/ws`. The global channel also declares the routed workspace and session operations available through the aggregate hub connection. `x-po.transportScope` identifies the addressed channel separately from the operation's composition scope.
@@ -0,0 +1,144 @@
1
+ # Session APIs
2
+
3
+ Session APIs let a Po package add HTTP behavior beside the direct headless runtime it extends. A package facet is imported from the package's built `poServer.dist` entry, registered in `po-server`, and called in process. The public client route is `/api/workspaces/<workspace-id>/sessions/<session-id>/plugins/<base-path>/...`.
4
+
5
+ This guide also covers the package's TypeScript exports for Node.js callers that want to compose the same in-process services.
6
+
7
+ ## The design
8
+
9
+ ```text
10
+ package.json poServer declaration
11
+ |
12
+ v
13
+ live composition of the session's root
14
+ |
15
+ v
16
+ built dist entry, content-addressed URL
17
+ |
18
+ v
19
+ direct headless host
20
+ start(context) per API
21
+ |
22
+ v
23
+ in-process Request dispatch
24
+ |
25
+ v
26
+ /api/workspaces/<workspace-id>/sessions/<id>/plugins/<base-path>/...
27
+ ```
28
+
29
+ The server resolves facet candidates from the same live composition that selects the session runtime. This ensures:
30
+
31
+ - the API implementation follows the same repository, mode, and package selection as the session runtime;
32
+ - each built entry resolves inside its own package and is imported through a URL that changes with the package content; and
33
+ - discovery and validation happen when a scope is admitted or a session starts, not by scanning arbitrary modules at request time.
34
+
35
+ The server starts each handler once, routes requests by a fixed base path, and calls `close()` during shutdown. A broken optional API is isolated so it does not take down the runtime or unrelated packages.
36
+
37
+ ## Declare a session API
38
+
39
+ A package declares one `poServer` facet in `package.json`:
40
+
41
+ ```json
42
+ {
43
+ "poServer": {
44
+ "entry": "./src/extensions/server.ts",
45
+ "dist": "./dist/extensions/server.mjs",
46
+ "scopes": ["session"]
47
+ }
48
+ }
49
+ ```
50
+
51
+ Publish a default-exported `DoomServerFacet` through that entry. In its `apply`, use `requireDoomServerHost(context).registerApi(api)` and return a disposer that calls the registration's `dispose()`. Declare the host service in `inject` and check scope before registering. The API implementation owns its base path.
52
+
53
+ Paths are package-relative and cannot escape the package. The server records the built module path and the modes and layers that selected the package, and uses that ownership for admission. See the [complete facet example](../../../../clients/po-web/docs/package-apis.md#declare-an-api).
54
+
55
+ ## Implement the handler
56
+
57
+ Each API registered by a facet implements this lifecycle:
58
+
59
+ ```ts
60
+ interface DoomApi {
61
+ basePath: string;
62
+ start(context: DoomApiContext): {
63
+ fetch(request: Request): Response | Promise<Response>;
64
+ close(): void;
65
+ };
66
+ }
67
+ ```
68
+
69
+ `start()` creates session-owned resources once. `fetch()` handles requests relative to the package mount. `close()` must release timers, watchers, streams, and other resources created during startup.
70
+
71
+ Keep the API adapter reusable and have the facet import it. The facet's disposer closes the registration.
72
+
73
+ ## Selecting the API composition
74
+
75
+ The session root's configuration is the only composition source. The server reads the `poServer` declaration of each package that composition selects, checks that its built entry stays inside the package, and filters candidates by scope and ownership before importing them. It never scans arbitrary package manifests at request time and never falls back to an alternate module directory.
76
+
77
+ Rebuild the package after changing a server-side API. The next new session imports the new build; running sessions keep the module they loaded.
78
+
79
+ A composition that selects no API is a valid no-API state. In that case package API requests return `404`; the server still provides the typed session protocol. A required eligible facet failure prevents readiness. An optional facet failure is reported and does not remove unrelated APIs.
80
+
81
+ ## Routing and isolation
82
+
83
+ The public path is:
84
+
85
+ ```text
86
+ /api/workspaces/<workspace-id>/sessions/<session-id>/plugins/<base-path>/<package route>
87
+ ```
88
+
89
+ The server removes the session and package mount prefix before calling the handler. A path outside the route returns `404`. An unknown base path returns a JSON `404`. A handler exception becomes a generic JSON `500`; other APIs remain mounted. Invalid base paths are rejected before dispatch.
90
+
91
+ When two eligible APIs claim the same base path, the first keeps it and the later registration is skipped. Disabled candidates are not imported and do not reserve mount paths.
92
+
93
+ ## Host context and authority
94
+
95
+ A session handler receives:
96
+
97
+ | Field | Meaning |
98
+ | --------------- | ------------------------------------------------------- |
99
+ | `scope` | Always `session` |
100
+ | `sessionId` | Identity of the owning session |
101
+ | `cwd` | Session working directory |
102
+ | `internalToken` | Optional process context for trusted child coordination |
103
+ | `hubToken` | Optional context for trusted cockpit coordination |
104
+ | `onNotice` | Host-visible diagnostic callback |
105
+
106
+ These values are process context for trusted package code, not automatic route authorization. A handler must validate its own inputs and enforce resource bounds. It must not accept browser-supplied authorization headers as proof of identity. If caller identity or step-up state matters, use the trusted context supplied by Po Web.
107
+
108
+ Package APIs are executable trusted code. They can access the session's authority, journal, and working directory according to their implementation. Treat generated modules like extensions and review their path, body, stream, and secret handling.
109
+
110
+ ## TypeScript server exports
111
+
112
+ The core package publishes the in-process building blocks through `@agimon-ai/po/server`:
113
+
114
+ | Export | Responsibility |
115
+ | ----------------------------------- | ---------------------------------------------------------------- |
116
+ | `createHeadlessSessionManager` | Own direct session hosts and dispose them |
117
+ | `createHeadlessHub` | Aggregate sessions, channels, and package API dispatch |
118
+ | `serveHeadlessServer` | Expose HTTP and authenticated `/api/ws` WebSocket routes |
119
+ | `createAgentSessionRuntime` | Project a direct runtime into typed session state and operations |
120
+ | `createAgentServerService` | Adapt one typed session service to the Pi protocol host |
121
+ | `createRpcTranscript` | Reduce runtime events into the authoritative transcript |
122
+ | `createHeadlessChildSessionService` | Provide explicitly requested child-session capabilities |
123
+
124
+ A minimal composition is:
125
+
126
+ ```ts
127
+ import { createHeadlessHub, createHeadlessSessionManager, serveHeadlessServer } from '@agimon-ai/po/server';
128
+
129
+ const manager = createHeadlessSessionManager();
130
+ const hub = createHeadlessHub({ manager });
131
+ const server = await serveHeadlessServer({
132
+ headlessHub: hub,
133
+ port: 7533,
134
+ token: tokenFromOwnerOnlyFile,
135
+ });
136
+ ```
137
+
138
+ The caller remains responsible for creating admitted direct session hosts, closing `server`, closing `hub`, and closing `manager` in that order. The executable performs that lifecycle for the command-line case.
139
+
140
+ ## Related guides
141
+
142
+ - [IPC](ipc.md) explains `/api/ws`, typed operations, package dispatch, and replay.
143
+ - [Lifecycle](lifecycle.md) explains when facets load and close.
144
+ - [Security](security.md) describes trusted package code and context capabilities.
@@ -0,0 +1,114 @@
1
+ # Getting started
2
+
3
+ `po-server` is the process boundary for one client-neutral headless Po session. It embeds the Pi harness, typed session services, and package facets in one process, then publishes an authenticated HTTP and WebSocket listener.
4
+
5
+ ## Choose the topology
6
+
7
+ Use the server directly for a local client or a durable headless session:
8
+
9
+ ```text
10
+ client -> authenticated HTTP/WebSocket listener -> po-server
11
+ \-> DirectHarnessRuntime
12
+ ```
13
+
14
+ Add Po Web when a browser or remote cockpit should control the session:
15
+
16
+ ```text
17
+ browser -> Po Web -> authenticated /api/ws WebSocket -> po-server
18
+ \-> DirectHarnessRuntime
19
+ ```
20
+
21
+ Po Web owns browser authentication and remote-access policy. A direct client is responsible for presenting the server token.
22
+
23
+ ## Requirements
24
+
25
+ - Node.js 24 or newer
26
+ - The packages your configuration names installed (`po sync` installs them)
27
+ - A private token file
28
+
29
+ The server composes each scope live from configuration and imports only the built entries that composition selects. It does not discover arbitrary package modules at startup.
30
+
31
+ Install core, which owns the `po-server` executable:
32
+
33
+ ```bash
34
+ npm install -g @agimon-ai/po
35
+ ```
36
+
37
+ ## Start a session
38
+
39
+ ```bash
40
+ token_file="$(mktemp)"
41
+ (umask 077; openssl rand -base64 32 > "$token_file")
42
+
43
+ po-server \
44
+ --auth-token-file "$token_file" \
45
+ --name work \
46
+ -- --major-mode copilot
47
+ ```
48
+
49
+ Server options come before `--`. Everything after it configures the embedded harness. The server validates those arguments, resolves the composition live, creates a direct runtime, and waits for that runtime to exit.
50
+
51
+ The token is a session-control capability. It is read from the file so it does not appear in the server argument list. The server rejects an empty token but does not create or protect the file for you. Keep the file in a private directory with restrictive permissions.
52
+
53
+ ## What startup creates
54
+
55
+ A ready session owns:
56
+
57
+ | Resource | Purpose |
58
+ | ---------------------- | ----------------------------------------------------------------------- |
59
+ | Loopback HTTP listener | Health, discovery, channel, and package API routes |
60
+ | `/api/ws` WebSocket | Authenticated Pi 0.85 Chord protocol |
61
+ | Direct harness runtime | In-process Pi execution and typed session operations |
62
+ | Session journal | Upstream v4 JSONL history, normally below `~/.po/agent/server/sessions` |
63
+ | Loaded server facets | Built `poServer` entries the composition selects |
64
+
65
+ No separate API listener or filesystem endpoint is created. The session service hydrates its authoritative snapshot from the journal and publishes it through the protocol state.
66
+
67
+ ## Command options
68
+
69
+ | Option | Default | Meaning |
70
+ | -------------------------- | -------------- | ------------------------------------------------------- |
71
+ | `--auth-token-file <path>` | required | File containing the listener token |
72
+ | `--name <name>` | `untitled` | Session name shown by clients |
73
+ | `--session-id <id>` | generated UUID | Stable session identity; it must not contain `/` |
74
+ | `--web [port]` | 7533 | Listener port; the listener is started for every server |
75
+ | `-- <harness arguments>` | none | Arguments passed to the embedded headless harness |
76
+
77
+ There is no server-side command, runtime-directory, or API-directory fallback. Composition comes from the live configuration of each scope. A required facet that cannot be imported fails startup instead of selecting a different module set.
78
+
79
+ ## Select the runtime composition
80
+
81
+ The server follows the repository that owns the session working directory; a member checkout such as a worktree resolves its composition from the workspace root. It composes that configuration, collects the selected packages' `poServer` entries, filters them for the active major mode and layers, and installs the resulting facets into the direct headless host.
82
+
83
+ Each entry is imported through a URL that changes with the package content. After you rebuild or upgrade a package, the next new session imports the new build without a server restart; running sessions keep the module they loaded. Run `po sync` after changing configuration that names new packages, so they are installed.
84
+
85
+ ## Add the browser cockpit
86
+
87
+ Po Web can proxy the server's `/api/ws` endpoint:
88
+
89
+ ```bash
90
+ npm install -g @agimon-ai/po-web
91
+
92
+ po-web
93
+ ```
94
+
95
+ Configure the cockpit with the server URL and token through its documented pairing and discovery flow. The browser connects to the web surface, not to a private server credential. The server remains responsible for token validation at its listener.
96
+
97
+ ## Stop and recover
98
+
99
+ `SIGINT` and `SIGTERM` dispose the headless host, close package facets, stop the direct runtime, close the listener, and release history ownership. A normal stop leaves the v4 session journal available for a later server.
100
+
101
+ If startup fails while composing a scope or loading a required facet, no ready listener is published. Treat a failed composition, failed required facet, or history ownership conflict as a readiness failure, not as permission to use another module set.
102
+
103
+ ## Development
104
+
105
+ Run from `packages/cli/po`:
106
+
107
+ ```bash
108
+ pnpm build
109
+ pnpm typecheck
110
+ pnpm test
111
+ pnpm lint
112
+ ```
113
+
114
+ Read [Security](security.md) before sharing a listener or token. Read [Session APIs](api.md) when a package needs a session HTTP surface.
@@ -0,0 +1,67 @@
1
+ # Headless session server
2
+
3
+ **The canonical client-neutral server for a Po session.**
4
+
5
+ `po-server` embeds a `DirectHarnessRuntime` and its typed session services in one process. It does not launch a second Pi process or expose an internal filesystem transport. Clients use the authenticated HTTP surface and the `/api/ws` WebSocket endpoint. A command-line server owns one session; the exported hub and session manager can host more than one session in a process.
6
+
7
+ The `@agimon-ai/po` core package owns this executable and the `@agimon-ai/po/server` API. It is a standalone process, not a Pi extension. Do not add it to `.po/modes.yaml`.
8
+
9
+ ## Install
10
+
11
+ Requires Node.js 24 or newer and the packages your Po configuration names.
12
+
13
+ ```bash
14
+ npm install -g @agimon-ai/po
15
+ ```
16
+
17
+ Run `po sync` in the session repository to install the configured packages and the global web build. The server composes each scope live from configuration, so later configuration changes need no restart.
18
+
19
+ ## Quick start
20
+
21
+ Create an owner-only token file, then pass harness arguments after `--`:
22
+
23
+ ```bash
24
+ token_file="$(mktemp)"
25
+ (umask 077; openssl rand -base64 32 > "$token_file")
26
+
27
+ po-server \
28
+ --auth-token-file "$token_file" \
29
+ -- --major-mode copilot
30
+ ```
31
+
32
+ The server listens on loopback port 7533 by default. Use `--web 9000` to select another port. The option name is retained for CLI compatibility, but the listener is the server's normal client-neutral HTTP and WebSocket surface, not an optional browser-only service.
33
+
34
+ The token is read from the file, not the command line. Keep the file private. A direct client presents the token to the HTTP routes and `/api/ws`; Po Web can proxy the endpoint after applying its own browser and remote-access controls.
35
+
36
+ ## How it works
37
+
38
+ Startup composes the global scope from configuration and imports the eligible server facets from their packages' built entries. It then creates the direct harness, session service, and package API handlers in process. The listener provides:
39
+
40
+ - `/api/ws`, an authenticated WebSocket carrying the Pi 0.85 Chord protocol;
41
+ - `/api/health`, an unauthenticated readiness check;
42
+ - `/api/workspaces/<workspace-id>/sessions` and related routes for discovery and channel access; and
43
+ - session package APIs below `/api/workspaces/<workspace-id>/sessions/<session-id>/plugins/<base-path>/...`.
44
+
45
+ The Pi protocol exposes typed management, hub, and session services. Session calls operate directly on the same runtime that owns the session journal. No raw command bridge, child-process fallback, or separate package API transport sits between a client and the runtime.
46
+
47
+ ## Security
48
+
49
+ The server binds to loopback by default and requires the token for every route except `/api/health`. A token file keeps the capability out of process listings. The server is not a sandbox: the harness, extensions, and server facets run with the account's authority.
50
+
51
+ Po Web owns browser authentication, remote tunnels, device cookies, and passkeys. When it proxies a session, browser code does not need the server token. Do not publish the server listener without an authenticated boundary.
52
+
53
+ Read [Security and trust boundaries](security.md) before sharing a listener or token.
54
+
55
+ ## Guides
56
+
57
+ | Guide | What it covers |
58
+ | ------------------------------------- | ----------------------------------------------------------------- |
59
+ | [Getting started](getting-started.md) | Installation, options, live composition, and web integration |
60
+ | [Lifecycle](lifecycle.md) | In-process startup, readiness, shutdown, and history ownership |
61
+ | [IPC](ipc.md) | The `/api/ws` protocol, typed operations, HTTP routes, and replay |
62
+ | [Session APIs](api.md) | `poServer` facets, package handlers, and TypeScript exports |
63
+ | [Security](security.md) | Tokens, listener exposure, trusted code, and data boundaries |
64
+
65
+ ## License
66
+
67
+ [MIT](../../LICENSE)