@agimon-ai/po-core 0.0.0-alpha.2 → 0.0.0-alpha.21

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 (1149) hide show
  1. package/LICENSE +149 -21
  2. package/NOTICE +41 -0
  3. package/dist/agentModel.cjs +1 -1
  4. package/dist/agentModel.d.mts +2 -2
  5. package/dist/agentModel.mjs +1 -2
  6. package/dist/apiContracts.cjs +623 -802
  7. package/dist/apiContracts.cjs.map +1 -1
  8. package/dist/apiContracts.d.mts +277 -615
  9. package/dist/apiContracts.d.mts.map +1 -1
  10. package/dist/apiContracts.mjs +617 -794
  11. package/dist/apiContracts.mjs.map +1 -1
  12. package/dist/askUser.cjs +2 -2
  13. package/dist/askUser.d.mts +2 -2
  14. package/dist/askUser.mjs +1 -2
  15. package/dist/authorTools.mjs +1 -2
  16. package/dist/backgroundWork.cjs +3 -3
  17. package/dist/backgroundWork.d.mts +2 -2
  18. package/dist/backgroundWork.mjs +1 -2
  19. package/dist/bundleAssetPolicy.mjs +1 -2
  20. package/dist/chatgptAuth.cjs +3 -2
  21. package/dist/chatgptAuth.d.mts +3 -2
  22. package/dist/chatgptAuth.mjs +2 -1
  23. package/dist/childProcess.cjs +1 -1
  24. package/dist/childProcess.d.mts +2 -2
  25. package/dist/childProcess.mjs +1 -2
  26. package/dist/childSession.cjs +11 -6
  27. package/dist/childSession.d.mts +3 -3
  28. package/dist/childSession.mjs +3 -3
  29. package/dist/cockpitContainer.mjs +1 -2
  30. package/dist/config.cjs +1 -1
  31. package/dist/config.d.mts +3 -3
  32. package/dist/config.mjs +1 -2
  33. package/dist/contextApi.cjs +1 -0
  34. package/dist/contextApi.d.mts +2 -2
  35. package/dist/contextApi.mjs +2 -2
  36. package/dist/contextContributions.cjs +4 -4
  37. package/dist/contextContributions.d.mts +3 -3
  38. package/dist/contextContributions.mjs +3 -3
  39. package/dist/contextDetailStore.cjs +7 -5
  40. package/dist/contextDetailStore.cjs.map +1 -1
  41. package/dist/contextDetailStore.d.mts +2 -1
  42. package/dist/contextDetailStore.d.mts.map +1 -1
  43. package/dist/contextDetailStore.mjs +6 -4
  44. package/dist/contextDetailStore.mjs.map +1 -1
  45. package/dist/contextProjection.cjs +7 -2
  46. package/dist/contextProjection.cjs.map +1 -1
  47. package/dist/contextProjection.d.mts +4 -1
  48. package/dist/contextProjection.d.mts.map +1 -1
  49. package/dist/contextProjection.mjs +5 -2
  50. package/dist/contextProjection.mjs.map +1 -1
  51. package/dist/cordisHost.cjs +11 -11
  52. package/dist/cordisHost.d.mts +2 -2
  53. package/dist/cordisHost.mjs +1 -2
  54. package/dist/delegation.cjs +8 -8
  55. package/dist/delegation.d.mts +2 -2
  56. package/dist/delegation.mjs +1 -2
  57. package/dist/executionBudget.cjs +4 -3
  58. package/dist/executionBudget.cjs.map +1 -1
  59. package/dist/executionBudget.d.mts +2 -2
  60. package/dist/executionBudget.d.mts.map +1 -1
  61. package/dist/executionBudget.mjs +4 -3
  62. package/dist/executionBudget.mjs.map +1 -1
  63. package/dist/extensionFile.cjs +5 -0
  64. package/dist/extensionFile.d.mts +4 -2
  65. package/dist/extensionFile.mjs +4 -2
  66. package/dist/footer.d.mts +2 -2
  67. package/dist/footer.mjs +1 -2
  68. package/dist/headless.cjs +14 -14
  69. package/dist/headless.d.mts +2 -2
  70. package/dist/headless.mjs +1 -2
  71. package/dist/headlessHub.cjs +308 -109
  72. package/dist/headlessHub.cjs.map +1 -1
  73. package/dist/headlessHub.d.mts +71 -36
  74. package/dist/headlessHub.d.mts.map +1 -1
  75. package/dist/headlessHub.mjs +309 -110
  76. package/dist/headlessHub.mjs.map +1 -1
  77. package/dist/headlessProtocol.cjs +327 -0
  78. package/dist/headlessProtocol.cjs.map +1 -0
  79. package/dist/headlessProtocol.d.mts +30 -0
  80. package/dist/headlessProtocol.d.mts.map +1 -0
  81. package/dist/headlessProtocol.mjs +326 -0
  82. package/dist/headlessProtocol.mjs.map +1 -0
  83. package/dist/headlessServer.cjs +166 -151
  84. package/dist/headlessServer.cjs.map +1 -1
  85. package/dist/headlessServer.d.mts +13 -5
  86. package/dist/headlessServer.d.mts.map +1 -1
  87. package/dist/headlessServer.mjs +166 -151
  88. package/dist/headlessServer.mjs.map +1 -1
  89. package/dist/headlessSessionHost.d.mts +58 -21
  90. package/dist/headlessSessionHost.d.mts.map +1 -1
  91. package/dist/help.cjs +20 -20
  92. package/dist/help.d.mts +2 -2
  93. package/dist/help.mjs +2 -2
  94. package/dist/history.cjs +16 -20
  95. package/dist/history.d.mts +9 -7
  96. package/dist/history.mjs +6 -7
  97. package/dist/historyOwnership.cjs.map +1 -1
  98. package/dist/historyOwnership.d.mts +1 -1
  99. package/dist/historyOwnership.mjs.map +1 -1
  100. package/dist/hubChannel.cjs +9 -0
  101. package/dist/hubChannel.d.mts +3 -2
  102. package/dist/hubChannel.mjs +3 -2
  103. package/dist/index.cjs +26 -28
  104. package/dist/index.d.mts +6 -6
  105. package/dist/index.mjs +6 -6
  106. package/dist/interop/chord.mjs +1 -0
  107. package/dist/interop/chordContext.mjs +1 -0
  108. package/dist/json.cjs +11 -5
  109. package/dist/json.d.mts +4 -2
  110. package/dist/json.mjs +4 -2
  111. package/dist/kernel.cjs +1 -1
  112. package/dist/kernel.d.mts +3 -3
  113. package/dist/kernel.mjs +1 -2
  114. package/dist/leader.d.mts +2 -2
  115. package/dist/leader.mjs +1 -2
  116. package/dist/logSinkTelemetry.mjs +1 -2
  117. package/dist/machineApi.cjs +80 -74
  118. package/dist/machineApi.cjs.map +1 -1
  119. package/dist/machineApi.d.mts +5 -2
  120. package/dist/machineApi.d.mts.map +1 -1
  121. package/dist/machineApi.mjs +78 -71
  122. package/dist/machineApi.mjs.map +1 -1
  123. package/dist/main.cjs +2 -1
  124. package/dist/main.d.mts +2 -1
  125. package/dist/main.mjs +2 -1
  126. package/dist/mcpFacet.d.mts +3 -3
  127. package/dist/mcpProjection.cjs +13 -13
  128. package/dist/mcpProjection.d.mts +2 -2
  129. package/dist/mcpProjection.mjs +1 -2
  130. package/dist/mcpSchemaCost.cjs +4 -4
  131. package/dist/mcpSchemaCost.cjs.map +1 -1
  132. package/dist/mcpSchemaCost.d.mts +2 -2
  133. package/dist/mcpSchemaCost.mjs +4 -4
  134. package/dist/mcpSchemaCost.mjs.map +1 -1
  135. package/dist/mcpSession.cjs +7 -7
  136. package/dist/mcpSession.d.mts +2 -2
  137. package/dist/mcpSession.mjs +1 -2
  138. package/dist/mcpStatus.cjs +2 -2
  139. package/dist/mcpStatus.d.mts +2 -2
  140. package/dist/mcpStatus.mjs +1 -2
  141. package/dist/mcpToolResolver.cjs +3 -3
  142. package/dist/mcpToolResolver.d.mts +2 -2
  143. package/dist/mcpToolResolver.mjs +1 -2
  144. package/dist/mcpWidget.d.mts +2 -2
  145. package/dist/moduleResolution.cjs +43 -8
  146. package/dist/moduleResolution.cjs.map +1 -1
  147. package/dist/moduleResolution.d.mts +10 -1
  148. package/dist/moduleResolution.d.mts.map +1 -1
  149. package/dist/moduleResolution.mjs +40 -7
  150. package/dist/moduleResolution.mjs.map +1 -1
  151. package/dist/narration.cjs +3 -3
  152. package/dist/narration.d.mts +2 -2
  153. package/dist/narration.mjs +1 -2
  154. package/dist/native.cjs +9 -0
  155. package/dist/native.d.mts +4 -3
  156. package/dist/native.mjs +3 -2
  157. package/dist/nodePlatform.cjs +77 -0
  158. package/dist/nodePlatform.cjs.map +1 -0
  159. package/dist/nodePlatform.d.mts +17 -0
  160. package/dist/nodePlatform.d.mts.map +1 -0
  161. package/dist/nodePlatform.mjs +72 -0
  162. package/dist/nodePlatform.mjs.map +1 -0
  163. package/dist/notification.cjs +15 -15
  164. package/dist/notification.d.mts +2 -2
  165. package/dist/notification.mjs +1 -2
  166. package/dist/packageApi.cjs +11 -11
  167. package/dist/packageApi.d.mts +2 -2
  168. package/dist/packageApi.mjs +2 -2
  169. package/dist/packageApiServer.cjs +45 -27
  170. package/dist/packageApiServer.cjs.map +1 -1
  171. package/dist/packageApiServer.d.mts +36 -26
  172. package/dist/packageApiServer.d.mts.map +1 -1
  173. package/dist/packageApiServer.mjs +44 -26
  174. package/dist/packageApiServer.mjs.map +1 -1
  175. package/dist/piSettings.cjs +41 -20
  176. package/dist/piSettings.d.mts +4 -2
  177. package/dist/piSettings.mjs +4 -2
  178. package/dist/platform.cjs +62 -0
  179. package/dist/platform.d.mts +10 -0
  180. package/dist/platform.mjs +10 -0
  181. package/dist/pluginProtocol.cjs +7 -8
  182. package/dist/pluginProtocol.d.mts +2 -2
  183. package/dist/pluginProtocol.mjs +1 -2
  184. package/dist/poPackage.cjs +12 -0
  185. package/dist/poPackage.d.mts +3 -0
  186. package/dist/poPackage.mjs +3 -0
  187. package/dist/profileIdentity.cjs +1 -1
  188. package/dist/profileIdentity.d.mts +2 -2
  189. package/dist/profileIdentity.mjs +1 -2
  190. package/dist/protocol.cjs +3 -3
  191. package/dist/protocol.d.mts +2 -2
  192. package/dist/protocol.mjs +1 -2
  193. package/dist/readiness.cjs +6 -6
  194. package/dist/readiness.d.mts +2 -2
  195. package/dist/readiness.mjs +1 -2
  196. package/dist/remoteApi.cjs.map +1 -1
  197. package/dist/remoteApi.d.mts +2 -2
  198. package/dist/remoteApi.mjs.map +1 -1
  199. package/dist/remoteRuntime.cjs +42 -65
  200. package/dist/remoteRuntime.cjs.map +1 -1
  201. package/dist/remoteRuntime.d.mts +3 -2
  202. package/dist/remoteRuntime.d.mts.map +1 -1
  203. package/dist/remoteRuntime.mjs +41 -62
  204. package/dist/remoteRuntime.mjs.map +1 -1
  205. package/dist/runtimeConfig.cjs +4 -4
  206. package/dist/runtimeConfig.cjs.map +1 -1
  207. package/dist/runtimeConfig.d.mts +10 -9
  208. package/dist/runtimeConfig.d.mts.map +1 -1
  209. package/dist/runtimeConfig.mjs +4 -4
  210. package/dist/runtimeConfig.mjs.map +1 -1
  211. package/dist/runtimeContextApi.cjs +10 -3
  212. package/dist/runtimeContextApi.cjs.map +1 -1
  213. package/dist/runtimeContextApi.d.mts +3 -3
  214. package/dist/runtimeContextApi.d.mts.map +1 -1
  215. package/dist/runtimeContextApi.mjs +10 -3
  216. package/dist/runtimeContextApi.mjs.map +1 -1
  217. package/dist/runtimeCordisHost.cjs +46 -46
  218. package/dist/runtimeCordisHost.cjs.map +1 -1
  219. package/dist/runtimeCordisHost.d.mts +29 -28
  220. package/dist/runtimeCordisHost.d.mts.map +1 -1
  221. package/dist/runtimeCordisHost.mjs +42 -42
  222. package/dist/runtimeCordisHost.mjs.map +1 -1
  223. package/dist/runtimeIdentity.cjs +6 -9
  224. package/dist/runtimeIdentity.cjs.map +1 -1
  225. package/dist/runtimeIdentity.d.mts +5 -1
  226. package/dist/runtimeIdentity.d.mts.map +1 -1
  227. package/dist/runtimeIdentity.mjs +5 -8
  228. package/dist/runtimeIdentity.mjs.map +1 -1
  229. package/dist/runtimeJson.cjs +10 -45
  230. package/dist/runtimeJson.d.mts +3 -22
  231. package/dist/runtimeJson.mjs +3 -39
  232. package/dist/runtimeLogSinkTelemetry.cjs +19 -19
  233. package/dist/runtimeLogSinkTelemetry.cjs.map +1 -1
  234. package/dist/runtimeLogSinkTelemetry.d.mts +19 -19
  235. package/dist/runtimeLogSinkTelemetry.mjs +19 -19
  236. package/dist/runtimeLogSinkTelemetry.mjs.map +1 -1
  237. package/dist/runtimePackages.cjs +7 -2
  238. package/dist/runtimePackages.cjs.map +1 -1
  239. package/dist/runtimePackages.d.mts +4 -1
  240. package/dist/runtimePackages.d.mts.map +1 -1
  241. package/dist/runtimePackages.mjs +7 -2
  242. package/dist/runtimePackages.mjs.map +1 -1
  243. package/dist/runtimePiSettings.cjs +40 -263
  244. package/dist/runtimePiSettings.d.mts +3 -72
  245. package/dist/runtimePiSettings.mjs +3 -241
  246. package/dist/runtimeProtocol.cjs +19 -19
  247. package/dist/runtimeProtocol.cjs.map +1 -1
  248. package/dist/runtimeProtocol.d.mts +7 -7
  249. package/dist/runtimeProtocol.d.mts.map +1 -1
  250. package/dist/runtimeProtocol.mjs +17 -17
  251. package/dist/runtimeProtocol.mjs.map +1 -1
  252. package/dist/runtimeTransition.cjs +9 -9
  253. package/dist/runtimeTransition.cjs.map +1 -1
  254. package/dist/runtimeTransition.d.mts +10 -10
  255. package/dist/runtimeTransition.d.mts.map +1 -1
  256. package/dist/runtimeTransition.mjs +7 -7
  257. package/dist/runtimeTransition.mjs.map +1 -1
  258. package/dist/sandboxHarness.mjs +1 -2
  259. package/dist/server.cjs +3 -7
  260. package/dist/server.d.mts +6 -6
  261. package/dist/server.mjs +3 -4
  262. package/dist/serverPlugin.cjs +39 -0
  263. package/dist/serverPlugin.d.mts +12 -0
  264. package/dist/serverPlugin.mjs +11 -0
  265. package/dist/serverTelemetry.cjs +1 -1
  266. package/dist/serverTelemetry.cjs.map +1 -1
  267. package/dist/serverTelemetry.d.mts +2 -2
  268. package/dist/serverTelemetry.mjs +2 -2
  269. package/dist/serverTelemetry.mjs.map +1 -1
  270. package/dist/sessionFilesApi.cjs +41 -37
  271. package/dist/sessionFilesApi.cjs.map +1 -1
  272. package/dist/sessionFilesApi.d.mts +6 -3
  273. package/dist/sessionFilesApi.d.mts.map +1 -1
  274. package/dist/sessionFilesApi.mjs +41 -36
  275. package/dist/sessionFilesApi.mjs.map +1 -1
  276. package/dist/sessionProtocol.cjs +31 -6
  277. package/dist/sessionProtocol.d.mts +8 -3
  278. package/dist/sessionProtocol.mjs +8 -2
  279. package/dist/skills.cjs +5 -5
  280. package/dist/skills.d.mts +2 -2
  281. package/dist/skills.mjs +1 -2
  282. package/dist/sqliteSessionStorage.cjs +28 -50
  283. package/dist/sqliteSessionStorage.cjs.map +1 -1
  284. package/dist/sqliteSessionStorage.d.mts +13 -20
  285. package/dist/sqliteSessionStorage.d.mts.map +1 -1
  286. package/dist/sqliteSessionStorage.mjs +25 -48
  287. package/dist/sqliteSessionStorage.mjs.map +1 -1
  288. package/dist/src/constants/agentSettled.cjs +7 -0
  289. package/dist/src/constants/agentSettled.cjs.map +1 -0
  290. package/dist/src/constants/agentSettled.mjs +7 -0
  291. package/dist/src/constants/agentSettled.mjs.map +1 -0
  292. package/dist/src/constants/contextApi.cjs +3 -1
  293. package/dist/src/constants/contextApi.cjs.map +1 -1
  294. package/dist/src/constants/contextApi.d.mts +2 -1
  295. package/dist/src/constants/contextApi.d.mts.map +1 -1
  296. package/dist/src/constants/contextApi.mjs +3 -2
  297. package/dist/src/constants/contextApi.mjs.map +1 -1
  298. package/dist/src/constants/voiceTools.cjs +6 -6
  299. package/dist/src/constants/voiceTools.cjs.map +1 -1
  300. package/dist/src/constants/voiceTools.d.mts +3 -3
  301. package/dist/src/constants/voiceTools.mjs +4 -4
  302. package/dist/src/constants/voiceTools.mjs.map +1 -1
  303. package/dist/src/extensions/extensionFile.cjs +22 -5
  304. package/dist/src/extensions/extensionFile.cjs.map +1 -1
  305. package/dist/src/extensions/extensionFile.d.mts +17 -4
  306. package/dist/src/extensions/extensionFile.d.mts.map +1 -1
  307. package/dist/src/extensions/extensionFile.mjs +22 -6
  308. package/dist/src/extensions/extensionFile.mjs.map +1 -1
  309. package/dist/src/extensions/serverPlugin.cjs +231 -92
  310. package/dist/src/extensions/serverPlugin.cjs.map +1 -1
  311. package/dist/src/extensions/serverPlugin.d.mts +2 -2
  312. package/dist/src/extensions/serverPlugin.d.mts.map +1 -1
  313. package/dist/src/extensions/serverPlugin.mjs +232 -93
  314. package/dist/src/extensions/serverPlugin.mjs.map +1 -1
  315. package/dist/src/pi/piSessionRuntime.cjs +349 -142
  316. package/dist/src/pi/piSessionRuntime.cjs.map +1 -1
  317. package/dist/src/pi/piSessionRuntime.d.mts +18 -17
  318. package/dist/src/pi/piSessionRuntime.d.mts.map +1 -1
  319. package/dist/src/pi/piSessionRuntime.mjs +342 -135
  320. package/dist/src/pi/piSessionRuntime.mjs.map +1 -1
  321. package/dist/src/schemas/agentModel.cjs +2 -2
  322. package/dist/src/schemas/agentModel.cjs.map +1 -1
  323. package/dist/src/schemas/agentModel.d.mts +1 -1
  324. package/dist/src/schemas/agentModel.mjs +2 -2
  325. package/dist/src/schemas/agentModel.mjs.map +1 -1
  326. package/dist/src/schemas/apiContracts.d.mts +2 -2
  327. package/dist/src/schemas/apiContracts.d.mts.map +1 -1
  328. package/dist/src/schemas/askUser.cjs +4 -4
  329. package/dist/src/schemas/askUser.cjs.map +1 -1
  330. package/dist/src/schemas/askUser.d.mts +4 -4
  331. package/dist/src/schemas/askUser.d.mts.map +1 -1
  332. package/dist/src/schemas/askUser.mjs +3 -3
  333. package/dist/src/schemas/askUser.mjs.map +1 -1
  334. package/dist/src/schemas/backgroundWork.cjs +10 -10
  335. package/dist/src/schemas/backgroundWork.cjs.map +1 -1
  336. package/dist/src/schemas/backgroundWork.d.mts +9 -9
  337. package/dist/src/schemas/backgroundWork.d.mts.map +1 -1
  338. package/dist/src/schemas/backgroundWork.mjs +8 -8
  339. package/dist/src/schemas/backgroundWork.mjs.map +1 -1
  340. package/dist/src/schemas/childProcess.cjs +5 -5
  341. package/dist/src/schemas/childProcess.cjs.map +1 -1
  342. package/dist/src/schemas/childProcess.d.mts +2 -2
  343. package/dist/src/schemas/childProcess.mjs +5 -5
  344. package/dist/src/schemas/childProcess.mjs.map +1 -1
  345. package/dist/src/schemas/contextContributions.cjs +10 -10
  346. package/dist/src/schemas/contextContributions.cjs.map +1 -1
  347. package/dist/src/schemas/contextContributions.d.mts +16 -16
  348. package/dist/src/schemas/contextContributions.d.mts.map +1 -1
  349. package/dist/src/schemas/contextContributions.mjs +8 -8
  350. package/dist/src/schemas/contextContributions.mjs.map +1 -1
  351. package/dist/src/schemas/delegation.cjs +17 -17
  352. package/dist/src/schemas/delegation.cjs.map +1 -1
  353. package/dist/src/schemas/delegation.d.mts +16 -16
  354. package/dist/src/schemas/delegation.d.mts.map +1 -1
  355. package/dist/src/schemas/delegation.mjs +10 -10
  356. package/dist/src/schemas/delegation.mjs.map +1 -1
  357. package/dist/src/schemas/extensionFile.d.mts +23 -19
  358. package/dist/src/schemas/extensionFile.d.mts.map +1 -1
  359. package/dist/src/schemas/footer.cjs.map +1 -1
  360. package/dist/src/schemas/footer.d.mts +5 -5
  361. package/dist/src/schemas/footer.d.mts.map +1 -1
  362. package/dist/src/schemas/footer.mjs.map +1 -1
  363. package/dist/src/schemas/headless.cjs +37 -37
  364. package/dist/src/schemas/headless.cjs.map +1 -1
  365. package/dist/src/schemas/headless.d.mts +100 -101
  366. package/dist/src/schemas/headless.d.mts.map +1 -1
  367. package/dist/src/schemas/headless.mjs +24 -24
  368. package/dist/src/schemas/headless.mjs.map +1 -1
  369. package/dist/src/schemas/help.cjs +60 -60
  370. package/dist/src/schemas/help.cjs.map +1 -1
  371. package/dist/src/schemas/help.d.mts +43 -43
  372. package/dist/src/schemas/help.d.mts.map +1 -1
  373. package/dist/src/schemas/help.mjs +41 -41
  374. package/dist/src/schemas/help.mjs.map +1 -1
  375. package/dist/src/schemas/home.cjs +127 -0
  376. package/dist/src/schemas/home.cjs.map +1 -0
  377. package/dist/src/schemas/home.d.mts +63 -0
  378. package/dist/src/schemas/home.d.mts.map +1 -0
  379. package/dist/src/schemas/home.mjs +121 -0
  380. package/dist/src/schemas/home.mjs.map +1 -0
  381. package/dist/src/schemas/httpApiContracts.cjs +441 -0
  382. package/dist/src/schemas/httpApiContracts.cjs.map +1 -0
  383. package/dist/src/schemas/httpApiContracts.d.mts +78 -0
  384. package/dist/src/schemas/httpApiContracts.d.mts.map +1 -0
  385. package/dist/src/schemas/httpApiContracts.mjs +434 -0
  386. package/dist/src/schemas/httpApiContracts.mjs.map +1 -0
  387. package/dist/src/schemas/hubChannel.cjs +3 -0
  388. package/dist/src/schemas/hubChannel.cjs.map +1 -1
  389. package/dist/src/schemas/hubChannel.d.mts +84 -60
  390. package/dist/src/schemas/hubChannel.d.mts.map +1 -1
  391. package/dist/src/schemas/hubChannel.mjs +3 -1
  392. package/dist/src/schemas/hubChannel.mjs.map +1 -1
  393. package/dist/src/schemas/leader.cjs.map +1 -1
  394. package/dist/src/schemas/leader.d.mts +3 -3
  395. package/dist/src/schemas/leader.d.mts.map +1 -1
  396. package/dist/src/schemas/leader.mjs.map +1 -1
  397. package/dist/src/schemas/mcpBundle.d.mts +3 -3
  398. package/dist/src/schemas/mcpFacet.cjs.map +1 -1
  399. package/dist/src/schemas/mcpFacet.d.mts +22 -22
  400. package/dist/src/schemas/mcpFacet.d.mts.map +1 -1
  401. package/dist/src/schemas/mcpFacet.mjs.map +1 -1
  402. package/dist/src/schemas/mcpProjection.cjs +41 -41
  403. package/dist/src/schemas/mcpProjection.cjs.map +1 -1
  404. package/dist/src/schemas/mcpProjection.d.mts +31 -30
  405. package/dist/src/schemas/mcpProjection.d.mts.map +1 -1
  406. package/dist/src/schemas/mcpProjection.mjs +29 -29
  407. package/dist/src/schemas/mcpProjection.mjs.map +1 -1
  408. package/dist/src/schemas/mcpSession.cjs +23 -23
  409. package/dist/src/schemas/mcpSession.cjs.map +1 -1
  410. package/dist/src/schemas/mcpSession.d.mts +12 -12
  411. package/dist/src/schemas/mcpSession.d.mts.map +1 -1
  412. package/dist/src/schemas/mcpSession.mjs +18 -18
  413. package/dist/src/schemas/mcpSession.mjs.map +1 -1
  414. package/dist/src/schemas/mcpStatus.cjs +5 -5
  415. package/dist/src/schemas/mcpStatus.cjs.map +1 -1
  416. package/dist/src/schemas/mcpStatus.d.mts +4 -4
  417. package/dist/src/schemas/mcpStatus.d.mts.map +1 -1
  418. package/dist/src/schemas/mcpStatus.mjs +4 -4
  419. package/dist/src/schemas/mcpStatus.mjs.map +1 -1
  420. package/dist/src/schemas/mcpToolResolver.cjs +9 -9
  421. package/dist/src/schemas/mcpToolResolver.cjs.map +1 -1
  422. package/dist/src/schemas/mcpToolResolver.d.mts +7 -7
  423. package/dist/src/schemas/mcpToolResolver.d.mts.map +1 -1
  424. package/dist/src/schemas/mcpToolResolver.mjs +7 -7
  425. package/dist/src/schemas/mcpToolResolver.mjs.map +1 -1
  426. package/dist/src/schemas/narration.cjs +9 -9
  427. package/dist/src/schemas/narration.cjs.map +1 -1
  428. package/dist/src/schemas/narration.d.mts +5 -5
  429. package/dist/src/schemas/narration.d.mts.map +1 -1
  430. package/dist/src/schemas/narration.mjs +7 -7
  431. package/dist/src/schemas/narration.mjs.map +1 -1
  432. package/dist/src/schemas/notification.cjs +45 -45
  433. package/dist/src/schemas/notification.cjs.map +1 -1
  434. package/dist/src/schemas/notification.d.mts +22 -22
  435. package/dist/src/schemas/notification.d.mts.map +1 -1
  436. package/dist/src/schemas/notification.mjs +31 -31
  437. package/dist/src/schemas/notification.mjs.map +1 -1
  438. package/dist/src/schemas/packageApi.cjs +28 -28
  439. package/dist/src/schemas/packageApi.cjs.map +1 -1
  440. package/dist/src/schemas/packageApi.d.mts +91 -65
  441. package/dist/src/schemas/packageApi.d.mts.map +1 -1
  442. package/dist/src/schemas/packageApi.mjs +18 -18
  443. package/dist/src/schemas/packageApi.mjs.map +1 -1
  444. package/dist/src/schemas/platform.cjs +34 -0
  445. package/dist/src/schemas/platform.cjs.map +1 -0
  446. package/dist/src/schemas/platform.d.mts +75 -0
  447. package/dist/src/schemas/platform.d.mts.map +1 -0
  448. package/dist/src/schemas/platform.mjs +27 -0
  449. package/dist/src/schemas/platform.mjs.map +1 -0
  450. package/dist/src/schemas/pluginContributions.cjs.map +1 -1
  451. package/dist/src/schemas/pluginContributions.d.mts +12 -12
  452. package/dist/src/schemas/pluginContributions.d.mts.map +1 -1
  453. package/dist/src/schemas/pluginContributions.mjs.map +1 -1
  454. package/dist/src/schemas/pluginProtocol.cjs +24 -27
  455. package/dist/src/schemas/pluginProtocol.cjs.map +1 -1
  456. package/dist/src/schemas/pluginProtocol.d.mts +21 -21
  457. package/dist/src/schemas/pluginProtocol.d.mts.map +1 -1
  458. package/dist/src/schemas/pluginProtocol.mjs +18 -20
  459. package/dist/src/schemas/pluginProtocol.mjs.map +1 -1
  460. package/dist/src/schemas/profileIdentity.cjs +2 -2
  461. package/dist/src/schemas/profileIdentity.cjs.map +1 -1
  462. package/dist/src/schemas/profileIdentity.d.mts +1 -1
  463. package/dist/src/schemas/profileIdentity.mjs +2 -2
  464. package/dist/src/schemas/profileIdentity.mjs.map +1 -1
  465. package/dist/src/schemas/protocolChannelsContract.cjs +27 -0
  466. package/dist/src/schemas/protocolChannelsContract.cjs.map +1 -0
  467. package/dist/src/schemas/protocolChannelsContract.d.mts +37 -0
  468. package/dist/src/schemas/protocolChannelsContract.d.mts.map +1 -0
  469. package/dist/src/schemas/protocolChannelsContract.mjs +25 -0
  470. package/dist/src/schemas/protocolChannelsContract.mjs.map +1 -0
  471. package/dist/src/schemas/protocolContracts.cjs +168 -0
  472. package/dist/src/schemas/protocolContracts.cjs.map +1 -0
  473. package/dist/src/schemas/protocolContracts.d.mts +69 -0
  474. package/dist/src/schemas/protocolContracts.d.mts.map +1 -0
  475. package/dist/src/schemas/protocolContracts.mjs +164 -0
  476. package/dist/src/schemas/protocolContracts.mjs.map +1 -0
  477. package/dist/src/schemas/protocolHubContract.cjs +51 -0
  478. package/dist/src/schemas/protocolHubContract.cjs.map +1 -0
  479. package/dist/src/schemas/protocolHubContract.d.mts +218 -0
  480. package/dist/src/schemas/protocolHubContract.d.mts.map +1 -0
  481. package/dist/src/schemas/protocolHubContract.mjs +49 -0
  482. package/dist/src/schemas/protocolHubContract.mjs.map +1 -0
  483. package/dist/src/schemas/protocolSessionContract.cjs +22 -0
  484. package/dist/src/schemas/protocolSessionContract.cjs.map +1 -0
  485. package/dist/src/schemas/protocolSessionContract.d.mts +324 -0
  486. package/dist/src/schemas/protocolSessionContract.d.mts.map +1 -0
  487. package/dist/src/schemas/protocolSessionContract.mjs +22 -0
  488. package/dist/src/schemas/protocolSessionContract.mjs.map +1 -0
  489. package/dist/src/schemas/protocolThreadContract.cjs +21 -0
  490. package/dist/src/schemas/protocolThreadContract.cjs.map +1 -0
  491. package/dist/src/schemas/protocolThreadContract.d.mts +29 -0
  492. package/dist/src/schemas/protocolThreadContract.d.mts.map +1 -0
  493. package/dist/src/schemas/protocolThreadContract.mjs +20 -0
  494. package/dist/src/schemas/protocolThreadContract.mjs.map +1 -0
  495. package/dist/src/schemas/readiness.cjs +36 -36
  496. package/dist/src/schemas/readiness.cjs.map +1 -1
  497. package/dist/src/schemas/readiness.d.mts +37 -37
  498. package/dist/src/schemas/readiness.d.mts.map +1 -1
  499. package/dist/src/schemas/readiness.mjs +31 -31
  500. package/dist/src/schemas/readiness.mjs.map +1 -1
  501. package/dist/src/schemas/serverBundle.d.mts +5 -5
  502. package/dist/src/schemas/serverPlugin.cjs +103 -0
  503. package/dist/src/schemas/serverPlugin.cjs.map +1 -0
  504. package/dist/src/schemas/serverPlugin.d.mts +176 -0
  505. package/dist/src/schemas/serverPlugin.d.mts.map +1 -0
  506. package/dist/src/schemas/serverPlugin.mjs +95 -0
  507. package/dist/src/schemas/serverPlugin.mjs.map +1 -0
  508. package/dist/src/schemas/serverScope.cjs +37 -0
  509. package/dist/src/schemas/serverScope.cjs.map +1 -0
  510. package/dist/src/schemas/serverScope.d.mts +77 -0
  511. package/dist/src/schemas/serverScope.d.mts.map +1 -0
  512. package/dist/src/schemas/serverScope.mjs +33 -0
  513. package/dist/src/schemas/serverScope.mjs.map +1 -0
  514. package/dist/src/schemas/sessionApiContracts.cjs +320 -0
  515. package/dist/src/schemas/sessionApiContracts.cjs.map +1 -0
  516. package/dist/src/schemas/sessionApiContracts.mjs +318 -0
  517. package/dist/src/schemas/sessionApiContracts.mjs.map +1 -0
  518. package/dist/src/schemas/sessionProtocol.cjs +20 -13
  519. package/dist/src/schemas/sessionProtocol.cjs.map +1 -1
  520. package/dist/src/schemas/sessionProtocol.d.mts +37 -54
  521. package/dist/src/schemas/sessionProtocol.d.mts.map +1 -1
  522. package/dist/src/schemas/sessionProtocol.mjs +17 -8
  523. package/dist/src/schemas/sessionProtocol.mjs.map +1 -1
  524. package/dist/src/schemas/skills.cjs +16 -16
  525. package/dist/src/schemas/skills.cjs.map +1 -1
  526. package/dist/src/schemas/skills.d.mts +7 -7
  527. package/dist/src/schemas/skills.d.mts.map +1 -1
  528. package/dist/src/schemas/skills.mjs +12 -12
  529. package/dist/src/schemas/skills.mjs.map +1 -1
  530. package/dist/src/schemas/toolOverrides.cjs +9 -9
  531. package/dist/src/schemas/toolOverrides.cjs.map +1 -1
  532. package/dist/src/schemas/toolOverrides.d.mts +8 -8
  533. package/dist/src/schemas/toolOverrides.d.mts.map +1 -1
  534. package/dist/src/schemas/toolOverrides.mjs +7 -7
  535. package/dist/src/schemas/toolOverrides.mjs.map +1 -1
  536. package/dist/src/schemas/toolSurface.cjs +9 -9
  537. package/dist/src/schemas/toolSurface.cjs.map +1 -1
  538. package/dist/src/schemas/toolSurface.d.mts +13 -13
  539. package/dist/src/schemas/toolSurface.d.mts.map +1 -1
  540. package/dist/src/schemas/toolSurface.mjs +7 -7
  541. package/dist/src/schemas/toolSurface.mjs.map +1 -1
  542. package/dist/src/schemas/uiHub.cjs +9 -9
  543. package/dist/src/schemas/uiHub.cjs.map +1 -1
  544. package/dist/src/schemas/uiHub.d.mts +12 -12
  545. package/dist/src/schemas/uiHub.d.mts.map +1 -1
  546. package/dist/src/schemas/uiHub.mjs +7 -7
  547. package/dist/src/schemas/uiHub.mjs.map +1 -1
  548. package/dist/src/server/directHarnessRuntime.cjs +691 -775
  549. package/dist/src/server/directHarnessRuntime.cjs.map +1 -1
  550. package/dist/src/server/directHarnessRuntime.d.mts +5 -1
  551. package/dist/src/server/directHarnessRuntime.d.mts.map +1 -0
  552. package/dist/src/server/directHarnessRuntime.mjs +671 -754
  553. package/dist/src/server/directHarnessRuntime.mjs.map +1 -1
  554. package/dist/src/server/largeFrameLink.cjs +47 -0
  555. package/dist/src/server/largeFrameLink.cjs.map +1 -0
  556. package/dist/src/server/largeFrameLink.mjs +47 -0
  557. package/dist/src/server/largeFrameLink.mjs.map +1 -0
  558. package/dist/src/server/liveImport.cjs +1 -1
  559. package/dist/src/server/liveImport.cjs.map +1 -1
  560. package/dist/src/server/liveImport.d.mts +1 -1
  561. package/dist/src/server/liveImport.mjs +1 -1
  562. package/dist/src/server/liveImport.mjs.map +1 -1
  563. package/dist/src/server/mcpBundleLoader.cjs.map +1 -1
  564. package/dist/src/server/mcpBundleLoader.d.mts +6 -6
  565. package/dist/src/server/mcpBundleLoader.d.mts.map +1 -1
  566. package/dist/src/server/mcpBundleLoader.mjs.map +1 -1
  567. package/dist/src/server/serverPackages.cjs +60 -0
  568. package/dist/src/server/serverPackages.cjs.map +1 -0
  569. package/dist/src/server/serverPackages.d.mts +44 -0
  570. package/dist/src/server/serverPackages.d.mts.map +1 -0
  571. package/dist/src/server/serverPackages.mjs +59 -0
  572. package/dist/src/server/serverPackages.mjs.map +1 -0
  573. package/dist/src/server/serverScope.cjs +510 -0
  574. package/dist/src/server/serverScope.cjs.map +1 -0
  575. package/dist/src/server/serverScope.d.mts +123 -0
  576. package/dist/src/server/serverScope.d.mts.map +1 -0
  577. package/dist/src/server/serverScope.mjs +510 -0
  578. package/dist/src/server/serverScope.mjs.map +1 -0
  579. package/dist/src/server/sessionMcpHandler.cjs +3 -3
  580. package/dist/src/server/sessionMcpHandler.cjs.map +1 -1
  581. package/dist/src/server/sessionMcpHandler.mjs +4 -4
  582. package/dist/src/server/sessionMcpHandler.mjs.map +1 -1
  583. package/dist/src/server/sessionMcpRoutes.cjs +2 -1
  584. package/dist/src/server/sessionMcpRoutes.cjs.map +1 -1
  585. package/dist/src/server/sessionMcpRoutes.mjs +2 -1
  586. package/dist/src/server/sessionMcpRoutes.mjs.map +1 -1
  587. package/dist/src/server/threadJournals.cjs +38 -107
  588. package/dist/src/server/threadJournals.cjs.map +1 -1
  589. package/dist/src/server/threadJournals.mjs +38 -104
  590. package/dist/src/server/threadJournals.mjs.map +1 -1
  591. package/dist/src/services/apiSurfaceAssert/index.cjs +1 -1
  592. package/dist/src/services/apiSurfaceAssert/index.cjs.map +1 -1
  593. package/dist/src/services/apiSurfaceAssert/index.d.mts +6 -6
  594. package/dist/src/services/apiSurfaceAssert/index.mjs +1 -1
  595. package/dist/src/services/apiSurfaceAssert/index.mjs.map +1 -1
  596. package/dist/src/services/chatgptAuth/index.cjs +1 -220
  597. package/dist/src/services/chatgptAuth/index.cjs.map +1 -1
  598. package/dist/src/services/chatgptAuth/index.d.mts +0 -18
  599. package/dist/src/services/chatgptAuth/index.d.mts.map +1 -1
  600. package/dist/src/services/chatgptAuth/index.mjs +1 -217
  601. package/dist/src/services/chatgptAuth/index.mjs.map +1 -1
  602. package/dist/src/services/chatgptImages/index.cjs +1 -1
  603. package/dist/src/services/chatgptImages/index.cjs.map +1 -1
  604. package/dist/src/services/chatgptImages/index.mjs +1 -1
  605. package/dist/src/services/chatgptImages/index.mjs.map +1 -1
  606. package/dist/src/services/chatgptLogin/index.cjs +230 -0
  607. package/dist/src/services/chatgptLogin/index.cjs.map +1 -0
  608. package/dist/src/services/chatgptLogin/index.d.mts +21 -0
  609. package/dist/src/services/chatgptLogin/index.d.mts.map +1 -0
  610. package/dist/src/services/chatgptLogin/index.mjs +227 -0
  611. package/dist/src/services/chatgptLogin/index.mjs.map +1 -0
  612. package/dist/src/services/chatgptWebSearch/index.cjs +1 -1
  613. package/dist/src/services/chatgptWebSearch/index.cjs.map +1 -1
  614. package/dist/src/services/chatgptWebSearch/index.mjs +1 -1
  615. package/dist/src/services/chatgptWebSearch/index.mjs.map +1 -1
  616. package/dist/src/services/contextContributions/index.cjs +8 -8
  617. package/dist/src/services/contextContributions/index.cjs.map +1 -1
  618. package/dist/src/services/contextContributions/index.d.mts +3 -3
  619. package/dist/src/services/contextContributions/index.d.mts.map +1 -1
  620. package/dist/src/services/contextContributions/index.mjs +8 -8
  621. package/dist/src/services/contextContributions/index.mjs.map +1 -1
  622. package/dist/src/services/devProxyStore/devProxyRecords.cjs +59 -0
  623. package/dist/src/services/devProxyStore/devProxyRecords.cjs.map +1 -0
  624. package/dist/src/services/devProxyStore/devProxyRecords.mjs +56 -0
  625. package/dist/src/services/devProxyStore/devProxyRecords.mjs.map +1 -0
  626. package/dist/src/services/devProxyStore/index.cjs +7 -101
  627. package/dist/src/services/devProxyStore/index.cjs.map +1 -1
  628. package/dist/src/services/devProxyStore/index.mjs +7 -101
  629. package/dist/src/services/devProxyStore/index.mjs.map +1 -1
  630. package/dist/src/services/devProxyStore/sync.cjs +66 -0
  631. package/dist/src/services/devProxyStore/sync.cjs.map +1 -0
  632. package/dist/src/services/devProxyStore/sync.mjs +63 -0
  633. package/dist/src/services/devProxyStore/sync.mjs.map +1 -0
  634. package/dist/src/services/durableNavigation/docs.cjs +15 -0
  635. package/dist/src/services/durableNavigation/docs.cjs.map +1 -0
  636. package/dist/src/services/durableNavigation/docs.mjs +16 -0
  637. package/dist/src/services/durableNavigation/docs.mjs.map +1 -0
  638. package/dist/src/services/durableNavigation/index.cjs +3 -18
  639. package/dist/src/services/durableNavigation/index.cjs.map +1 -1
  640. package/dist/src/services/durableNavigation/index.mjs +2 -17
  641. package/dist/src/services/durableNavigation/index.mjs.map +1 -1
  642. package/dist/src/services/durableQueue/docs.cjs +12 -0
  643. package/dist/src/services/durableQueue/docs.cjs.map +1 -0
  644. package/dist/src/services/durableQueue/docs.mjs +13 -0
  645. package/dist/src/services/durableQueue/docs.mjs.map +1 -0
  646. package/dist/src/services/durableQueue/index.cjs +151 -0
  647. package/dist/src/services/durableQueue/index.cjs.map +1 -0
  648. package/dist/src/services/durableQueue/index.mjs +149 -0
  649. package/dist/src/services/durableQueue/index.mjs.map +1 -0
  650. package/dist/src/services/durableRequestReceipts/docs.cjs +11 -0
  651. package/dist/src/services/durableRequestReceipts/docs.cjs.map +1 -0
  652. package/dist/src/services/durableRequestReceipts/docs.mjs +12 -0
  653. package/dist/src/services/durableRequestReceipts/docs.mjs.map +1 -0
  654. package/dist/src/services/{requestReceipts → durableRequestReceipts}/index.cjs +10 -16
  655. package/dist/src/services/durableRequestReceipts/index.cjs.map +1 -0
  656. package/dist/src/services/durableRequestReceipts/index.d.mts +12 -0
  657. package/dist/src/services/durableRequestReceipts/index.d.mts.map +1 -0
  658. package/dist/src/services/{requestReceipts → durableRequestReceipts}/index.mjs +7 -13
  659. package/dist/src/services/durableRequestReceipts/index.mjs.map +1 -0
  660. package/dist/src/services/durableSession/docs.cjs +65 -0
  661. package/dist/src/services/durableSession/docs.cjs.map +1 -0
  662. package/dist/src/services/durableSession/docs.d.mts +17 -0
  663. package/dist/src/services/durableSession/docs.d.mts.map +1 -0
  664. package/dist/src/services/durableSession/docs.mjs +60 -0
  665. package/dist/src/services/durableSession/docs.mjs.map +1 -0
  666. package/dist/src/services/durableSession/index.cjs +21 -0
  667. package/dist/src/services/durableSession/index.cjs.map +1 -0
  668. package/dist/src/services/durableSession/index.d.mts +13 -0
  669. package/dist/src/services/durableSession/index.d.mts.map +1 -0
  670. package/dist/src/services/durableSession/index.mjs +20 -0
  671. package/dist/src/services/durableSession/index.mjs.map +1 -0
  672. package/dist/src/services/durableSubagents/docs.cjs +15 -0
  673. package/dist/src/services/durableSubagents/docs.cjs.map +1 -0
  674. package/dist/src/services/durableSubagents/docs.mjs +16 -0
  675. package/dist/src/services/durableSubagents/docs.mjs.map +1 -0
  676. package/dist/src/services/durableSubagents/extension.cjs +11 -0
  677. package/dist/src/services/durableSubagents/extension.cjs.map +1 -0
  678. package/dist/src/services/durableSubagents/extension.mjs +12 -0
  679. package/dist/src/services/durableSubagents/extension.mjs.map +1 -0
  680. package/dist/src/services/durableSubagents/index.cjs +95 -0
  681. package/dist/src/services/durableSubagents/index.cjs.map +1 -0
  682. package/dist/src/services/durableSubagents/index.mjs +90 -0
  683. package/dist/src/services/durableSubagents/index.mjs.map +1 -0
  684. package/dist/src/services/durableSubagents/tasks.cjs +25 -0
  685. package/dist/src/services/durableSubagents/tasks.cjs.map +1 -0
  686. package/dist/src/services/durableSubagents/tasks.mjs +26 -0
  687. package/dist/src/services/durableSubagents/tasks.mjs.map +1 -0
  688. package/dist/src/services/headlessClient/index.cjs +20 -13
  689. package/dist/src/services/headlessClient/index.cjs.map +1 -1
  690. package/dist/src/services/headlessClient/index.mjs +21 -14
  691. package/dist/src/services/headlessClient/index.mjs.map +1 -1
  692. package/dist/src/services/historyOwnership/type.d.mts +15 -0
  693. package/dist/src/services/historyOwnership/type.d.mts.map +1 -0
  694. package/dist/src/services/hubChannelHarness/index.cjs +2 -2
  695. package/dist/src/services/hubChannelHarness/index.cjs.map +1 -1
  696. package/dist/src/services/hubChannelHarness/index.d.mts +8 -8
  697. package/dist/src/services/hubChannelHarness/index.d.mts.map +1 -1
  698. package/dist/src/services/hubChannelHarness/index.mjs +2 -2
  699. package/dist/src/services/hubChannelHarness/index.mjs.map +1 -1
  700. package/dist/src/services/json/core.cjs +30 -0
  701. package/dist/src/services/json/core.cjs.map +1 -0
  702. package/dist/src/services/json/core.d.mts +21 -0
  703. package/dist/src/services/json/core.d.mts.map +1 -0
  704. package/dist/src/services/json/core.mjs +26 -0
  705. package/dist/src/services/json/core.mjs.map +1 -0
  706. package/dist/src/services/json/sync.cjs +48 -0
  707. package/dist/src/services/json/sync.cjs.map +1 -0
  708. package/dist/src/services/json/sync.d.mts +22 -0
  709. package/dist/src/services/json/sync.d.mts.map +1 -0
  710. package/dist/src/services/json/sync.mjs +43 -0
  711. package/dist/src/services/json/sync.mjs.map +1 -0
  712. package/dist/src/services/kernel/index.cjs +2 -2
  713. package/dist/src/services/kernel/index.cjs.map +1 -1
  714. package/dist/src/services/kernel/index.d.mts +3 -3
  715. package/dist/src/services/kernel/index.d.mts.map +1 -1
  716. package/dist/src/services/kernel/index.mjs +2 -2
  717. package/dist/src/services/kernel/index.mjs.map +1 -1
  718. package/dist/src/services/nativeChildTools/index.cjs +16 -0
  719. package/dist/src/services/nativeChildTools/index.cjs.map +1 -0
  720. package/dist/src/services/nativeChildTools/index.mjs +16 -0
  721. package/dist/src/services/nativeChildTools/index.mjs.map +1 -0
  722. package/dist/src/services/nodeHost/index.cjs +30 -0
  723. package/dist/src/services/nodeHost/index.cjs.map +1 -0
  724. package/dist/src/services/nodeHost/index.d.mts +16 -0
  725. package/dist/src/services/nodeHost/index.d.mts.map +1 -0
  726. package/dist/src/services/nodeHost/index.mjs +27 -0
  727. package/dist/src/services/nodeHost/index.mjs.map +1 -0
  728. package/dist/src/services/nodeModelDependencies/index.cjs +89 -0
  729. package/dist/src/services/nodeModelDependencies/index.cjs.map +1 -0
  730. package/dist/src/services/nodeModelDependencies/index.mjs +86 -0
  731. package/dist/src/services/nodeModelDependencies/index.mjs.map +1 -0
  732. package/dist/src/services/openSessionRegistry/index.cjs +6 -128
  733. package/dist/src/services/openSessionRegistry/index.cjs.map +1 -1
  734. package/dist/src/services/openSessionRegistry/index.d.mts +5 -36
  735. package/dist/src/services/openSessionRegistry/index.mjs +6 -128
  736. package/dist/src/services/openSessionRegistry/index.mjs.map +1 -1
  737. package/dist/src/services/openSessionRegistry/openSessionRecords.cjs +87 -0
  738. package/dist/src/services/openSessionRegistry/openSessionRecords.cjs.map +1 -0
  739. package/dist/src/services/openSessionRegistry/openSessionRecords.d.mts +30 -0
  740. package/dist/src/services/openSessionRegistry/openSessionRecords.d.mts.map +1 -0
  741. package/dist/src/services/openSessionRegistry/openSessionRecords.mjs +81 -0
  742. package/dist/src/services/openSessionRegistry/openSessionRecords.mjs.map +1 -0
  743. package/dist/src/services/openSessionRegistry/sync.cjs +71 -0
  744. package/dist/src/services/openSessionRegistry/sync.cjs.map +1 -0
  745. package/dist/src/services/openSessionRegistry/sync.d.mts +14 -0
  746. package/dist/src/services/openSessionRegistry/sync.d.mts.map +1 -0
  747. package/dist/src/services/openSessionRegistry/sync.mjs +68 -0
  748. package/dist/src/services/openSessionRegistry/sync.mjs.map +1 -0
  749. package/dist/src/services/packageApiHarness/index.cjs +1 -1
  750. package/dist/src/services/packageApiHarness/index.cjs.map +1 -1
  751. package/dist/src/services/packageApiHarness/index.d.mts +6 -6
  752. package/dist/src/services/packageApiHarness/index.d.mts.map +1 -1
  753. package/dist/src/services/packageApiHarness/index.mjs +2 -2
  754. package/dist/src/services/packageApiHarness/index.mjs.map +1 -1
  755. package/dist/src/services/piArgs/index.cjs +53 -0
  756. package/dist/src/services/piArgs/index.cjs.map +1 -0
  757. package/dist/src/services/piArgs/index.d.mts +6 -0
  758. package/dist/src/services/piArgs/index.d.mts.map +1 -0
  759. package/dist/src/services/piArgs/index.mjs +53 -0
  760. package/dist/src/services/piArgs/index.mjs.map +1 -0
  761. package/dist/src/services/piExtensionHost/index.cjs +47 -39
  762. package/dist/src/services/piExtensionHost/index.cjs.map +1 -1
  763. package/dist/src/services/piExtensionHost/index.d.mts +83 -0
  764. package/dist/src/services/piExtensionHost/index.d.mts.map +1 -0
  765. package/dist/src/services/piExtensionHost/index.mjs +47 -38
  766. package/dist/src/services/piExtensionHost/index.mjs.map +1 -1
  767. package/dist/src/services/piHelpTools/index.cjs +5 -5
  768. package/dist/src/services/piHelpTools/index.cjs.map +1 -1
  769. package/dist/src/services/piHelpTools/index.d.mts.map +1 -1
  770. package/dist/src/services/piHelpTools/index.mjs +7 -7
  771. package/dist/src/services/piHelpTools/index.mjs.map +1 -1
  772. package/dist/src/services/piMessages/index.cjs +106 -0
  773. package/dist/src/services/piMessages/index.cjs.map +1 -0
  774. package/dist/src/services/piMessages/index.mjs +105 -0
  775. package/dist/src/services/piMessages/index.mjs.map +1 -0
  776. package/dist/src/services/piSessionEntries/index.cjs +4 -4
  777. package/dist/src/services/piSessionEntries/index.cjs.map +1 -1
  778. package/dist/src/services/piSessionEntries/index.mjs +3 -3
  779. package/dist/src/services/piSessionEntries/index.mjs.map +1 -1
  780. package/dist/src/services/piSettings/core.cjs +308 -0
  781. package/dist/src/services/piSettings/core.cjs.map +1 -0
  782. package/dist/src/services/piSettings/core.d.mts +102 -0
  783. package/dist/src/services/piSettings/core.d.mts.map +1 -0
  784. package/dist/src/services/piSettings/core.mjs +276 -0
  785. package/dist/src/services/piSettings/core.mjs.map +1 -0
  786. package/dist/src/services/piSettings/sync.cjs +119 -0
  787. package/dist/src/services/piSettings/sync.cjs.map +1 -0
  788. package/dist/src/services/piSettings/sync.d.mts +44 -0
  789. package/dist/src/services/piSettings/sync.d.mts.map +1 -0
  790. package/dist/src/services/piSettings/sync.mjs +110 -0
  791. package/dist/src/services/piSettings/sync.mjs.map +1 -0
  792. package/dist/src/services/piSummary/index.cjs +7 -0
  793. package/dist/src/services/piSummary/index.cjs.map +1 -0
  794. package/dist/src/services/piSummary/index.mjs +7 -0
  795. package/dist/src/services/piSummary/index.mjs.map +1 -0
  796. package/dist/src/services/platformFiles/index.cjs +44 -0
  797. package/dist/src/services/platformFiles/index.cjs.map +1 -0
  798. package/dist/src/services/platformFiles/index.d.mts +16 -0
  799. package/dist/src/services/platformFiles/index.d.mts.map +1 -0
  800. package/dist/src/services/platformFiles/index.mjs +39 -0
  801. package/dist/src/services/platformFiles/index.mjs.map +1 -0
  802. package/dist/src/services/pluginLifecycle/index.cjs +19 -13
  803. package/dist/src/services/pluginLifecycle/index.cjs.map +1 -1
  804. package/dist/src/services/pluginLifecycle/index.d.mts +2 -0
  805. package/dist/src/services/pluginLifecycle/index.d.mts.map +1 -1
  806. package/dist/src/services/pluginLifecycle/index.mjs +19 -14
  807. package/dist/src/services/pluginLifecycle/index.mjs.map +1 -1
  808. package/dist/src/services/poPackage/core.cjs +73 -0
  809. package/dist/src/services/poPackage/core.cjs.map +1 -0
  810. package/dist/src/services/poPackage/core.d.mts +32 -0
  811. package/dist/src/services/poPackage/core.d.mts.map +1 -0
  812. package/dist/src/services/poPackage/core.mjs +66 -0
  813. package/dist/src/services/poPackage/core.mjs.map +1 -0
  814. package/dist/src/services/poPackage/sync.cjs +55 -0
  815. package/dist/src/services/poPackage/sync.cjs.map +1 -0
  816. package/dist/src/services/poPackage/sync.d.mts +21 -0
  817. package/dist/src/services/poPackage/sync.d.mts.map +1 -0
  818. package/dist/src/services/poPackage/sync.mjs +50 -0
  819. package/dist/src/services/poPackage/sync.mjs.map +1 -0
  820. package/dist/src/services/providerAuth/index.cjs +11 -7
  821. package/dist/src/services/providerAuth/index.cjs.map +1 -1
  822. package/dist/src/services/providerAuth/index.mjs +11 -7
  823. package/dist/src/services/providerAuth/index.mjs.map +1 -1
  824. package/dist/src/services/publicFileShares/index.cjs +1 -1
  825. package/dist/src/services/publicFileShares/index.cjs.map +1 -1
  826. package/dist/src/services/publicFileShares/index.d.mts +2 -2
  827. package/dist/src/services/publicFileShares/index.mjs +2 -2
  828. package/dist/src/services/publicFileShares/index.mjs.map +1 -1
  829. package/dist/src/services/remoteAccess/index.d.mts +1 -0
  830. package/dist/src/services/remoteAccess/index.d.mts.map +1 -1
  831. package/dist/src/services/remoteAccessStore/index.cjs +8 -190
  832. package/dist/src/services/remoteAccessStore/index.cjs.map +1 -1
  833. package/dist/src/services/remoteAccessStore/index.d.mts +2 -0
  834. package/dist/src/services/remoteAccessStore/index.mjs +7 -187
  835. package/dist/src/services/remoteAccessStore/index.mjs.map +1 -1
  836. package/dist/src/services/remoteAccessStore/remoteAccessRecords.cjs +98 -0
  837. package/dist/src/services/remoteAccessStore/remoteAccessRecords.cjs.map +1 -0
  838. package/dist/src/services/remoteAccessStore/remoteAccessRecords.mjs +88 -0
  839. package/dist/src/services/remoteAccessStore/remoteAccessRecords.mjs.map +1 -0
  840. package/dist/src/services/remoteAccessStore/sync.cjs +111 -0
  841. package/dist/src/services/remoteAccessStore/sync.cjs.map +1 -0
  842. package/dist/src/services/remoteAccessStore/sync.mjs +108 -0
  843. package/dist/src/services/remoteAccessStore/sync.mjs.map +1 -0
  844. package/dist/src/services/runtimeIdentity/sync.cjs +23 -0
  845. package/dist/src/services/runtimeIdentity/sync.cjs.map +1 -0
  846. package/dist/src/services/runtimeIdentity/sync.d.mts +9 -0
  847. package/dist/src/services/runtimeIdentity/sync.d.mts.map +1 -0
  848. package/dist/src/services/runtimeIdentity/sync.mjs +20 -0
  849. package/dist/src/services/runtimeIdentity/sync.mjs.map +1 -0
  850. package/dist/src/services/serialRunner/index.cjs +25 -0
  851. package/dist/src/services/serialRunner/index.cjs.map +1 -0
  852. package/dist/src/services/serialRunner/index.d.mts +10 -0
  853. package/dist/src/services/serialRunner/index.d.mts.map +1 -0
  854. package/dist/src/services/serialRunner/index.mjs +25 -0
  855. package/dist/src/services/serialRunner/index.mjs.map +1 -0
  856. package/dist/src/services/{serverFacet → serverHost}/index.cjs +5 -5
  857. package/dist/src/services/serverHost/index.cjs.map +1 -0
  858. package/dist/src/services/serverHost/index.d.mts +31 -0
  859. package/dist/src/services/serverHost/index.d.mts.map +1 -0
  860. package/dist/src/services/{serverFacet → serverHost}/index.mjs +5 -5
  861. package/dist/src/services/serverHost/index.mjs.map +1 -0
  862. package/dist/src/services/sessionAttachments/index.cjs +4 -3
  863. package/dist/src/services/sessionAttachments/index.cjs.map +1 -1
  864. package/dist/src/services/sessionAttachments/index.d.mts +1 -6
  865. package/dist/src/services/sessionAttachments/index.d.mts.map +1 -1
  866. package/dist/src/services/sessionAttachments/index.mjs +3 -2
  867. package/dist/src/services/sessionAttachments/index.mjs.map +1 -1
  868. package/dist/src/services/sessionAttachments/type.d.mts +9 -0
  869. package/dist/src/services/sessionAttachments/type.d.mts.map +1 -0
  870. package/dist/src/services/sessionFiles/index.cjs +96 -0
  871. package/dist/src/services/sessionFiles/index.cjs.map +1 -0
  872. package/dist/src/services/sessionFiles/index.d.mts +33 -0
  873. package/dist/src/services/sessionFiles/index.d.mts.map +1 -0
  874. package/dist/src/services/sessionFiles/index.mjs +89 -0
  875. package/dist/src/services/sessionFiles/index.mjs.map +1 -0
  876. package/dist/src/services/sessionFiles/sessionDirectory.cjs +66 -0
  877. package/dist/src/services/sessionFiles/sessionDirectory.cjs.map +1 -0
  878. package/dist/src/services/sessionFiles/sessionDirectory.mjs +62 -0
  879. package/dist/src/services/sessionFiles/sessionDirectory.mjs.map +1 -0
  880. package/dist/src/services/sessionGitStatus/index.cjs +31 -33
  881. package/dist/src/services/sessionGitStatus/index.cjs.map +1 -1
  882. package/dist/src/services/sessionGitStatus/index.mjs +31 -33
  883. package/dist/src/services/sessionGitStatus/index.mjs.map +1 -1
  884. package/dist/src/services/sessionPresentation/index.cjs +3 -27
  885. package/dist/src/services/sessionPresentation/index.cjs.map +1 -1
  886. package/dist/src/services/sessionPresentation/index.mjs +3 -27
  887. package/dist/src/services/sessionPresentation/index.mjs.map +1 -1
  888. package/dist/src/services/skillPrompt/index.cjs +11 -0
  889. package/dist/src/services/skillPrompt/index.cjs.map +1 -0
  890. package/dist/src/services/skillPrompt/index.mjs +11 -0
  891. package/dist/src/services/skillPrompt/index.mjs.map +1 -0
  892. package/dist/src/services/sqliteSessionHistory/index.cjs +44 -30
  893. package/dist/src/services/sqliteSessionHistory/index.cjs.map +1 -1
  894. package/dist/src/services/sqliteSessionHistory/index.d.mts +7 -4
  895. package/dist/src/services/sqliteSessionHistory/index.d.mts.map +1 -1
  896. package/dist/src/services/sqliteSessionHistory/index.mjs +43 -28
  897. package/dist/src/services/sqliteSessionHistory/index.mjs.map +1 -1
  898. package/dist/src/services/sqliteTranscriptReader/index.cjs +21 -45
  899. package/dist/src/services/sqliteTranscriptReader/index.cjs.map +1 -1
  900. package/dist/src/services/sqliteTranscriptReader/index.d.mts +3 -2
  901. package/dist/src/services/sqliteTranscriptReader/index.d.mts.map +1 -1
  902. package/dist/src/services/sqliteTranscriptReader/index.mjs +16 -38
  903. package/dist/src/services/sqliteTranscriptReader/index.mjs.map +1 -1
  904. package/dist/src/services/testMode/index.cjs +162 -0
  905. package/dist/src/services/testMode/index.cjs.map +1 -0
  906. package/dist/src/services/testMode/index.d.mts +17 -0
  907. package/dist/src/services/testMode/index.d.mts.map +1 -0
  908. package/dist/src/services/testMode/index.mjs +155 -0
  909. package/dist/src/services/testMode/index.mjs.map +1 -0
  910. package/dist/src/services/toolOverrides/index.cjs +6 -6
  911. package/dist/src/services/toolOverrides/index.cjs.map +1 -1
  912. package/dist/src/services/toolOverrides/index.d.mts +3 -3
  913. package/dist/src/services/toolOverrides/index.d.mts.map +1 -1
  914. package/dist/src/services/toolOverrides/index.mjs +6 -6
  915. package/dist/src/services/toolOverrides/index.mjs.map +1 -1
  916. package/dist/src/services/toolPrompt/index.d.mts +17 -0
  917. package/dist/src/services/toolPrompt/index.d.mts.map +1 -0
  918. package/dist/src/services/toolSurface/index.cjs +3 -3
  919. package/dist/src/services/toolSurface/index.cjs.map +1 -1
  920. package/dist/src/services/toolSurface/index.d.mts +3 -3
  921. package/dist/src/services/toolSurface/index.d.mts.map +1 -1
  922. package/dist/src/services/toolSurface/index.mjs +4 -4
  923. package/dist/src/services/toolSurface/index.mjs.map +1 -1
  924. package/dist/src/services/traceContext/index.cjs.map +1 -1
  925. package/dist/src/services/traceContext/index.mjs.map +1 -1
  926. package/dist/src/services/transcriptPages/index.cjs +159 -33
  927. package/dist/src/services/transcriptPages/index.cjs.map +1 -1
  928. package/dist/src/services/transcriptPages/index.mjs +158 -34
  929. package/dist/src/services/transcriptPages/index.mjs.map +1 -1
  930. package/dist/src/services/voiceToolsContract/index.cjs +7 -7
  931. package/dist/src/services/voiceToolsContract/index.cjs.map +1 -1
  932. package/dist/src/services/voiceToolsContract/index.d.mts +4 -4
  933. package/dist/src/services/voiceToolsContract/index.d.mts.map +1 -1
  934. package/dist/src/services/voiceToolsContract/index.mjs +7 -7
  935. package/dist/src/services/voiceToolsContract/index.mjs.map +1 -1
  936. package/dist/src/services/workspaceRegistry/index.cjs +9 -179
  937. package/dist/src/services/workspaceRegistry/index.cjs.map +1 -1
  938. package/dist/src/services/workspaceRegistry/index.d.mts +5 -47
  939. package/dist/src/services/workspaceRegistry/index.mjs +7 -176
  940. package/dist/src/services/workspaceRegistry/index.mjs.map +1 -1
  941. package/dist/src/services/workspaceRegistry/sync.cjs +148 -0
  942. package/dist/src/services/workspaceRegistry/sync.cjs.map +1 -0
  943. package/dist/src/services/workspaceRegistry/sync.d.mts +34 -0
  944. package/dist/src/services/workspaceRegistry/sync.d.mts.map +1 -0
  945. package/dist/src/services/workspaceRegistry/sync.mjs +140 -0
  946. package/dist/src/services/workspaceRegistry/sync.mjs.map +1 -0
  947. package/dist/src/services/workspaceRegistry/workspaceRecords.cjs +114 -0
  948. package/dist/src/services/workspaceRegistry/workspaceRecords.cjs.map +1 -0
  949. package/dist/src/services/workspaceRegistry/workspaceRecords.d.mts +31 -0
  950. package/dist/src/services/workspaceRegistry/workspaceRecords.d.mts.map +1 -0
  951. package/dist/src/services/workspaceRegistry/workspaceRecords.mjs +101 -0
  952. package/dist/src/services/workspaceRegistry/workspaceRecords.mjs.map +1 -0
  953. package/dist/src/systems/child/adapters/headlessChildSessionService.cjs +339 -202
  954. package/dist/src/systems/child/adapters/headlessChildSessionService.cjs.map +1 -1
  955. package/dist/src/systems/child/adapters/headlessChildSessionService.d.mts +16 -21
  956. package/dist/src/systems/child/adapters/headlessChildSessionService.d.mts.map +1 -1
  957. package/dist/src/systems/child/adapters/headlessChildSessionService.mjs +329 -191
  958. package/dist/src/systems/child/adapters/headlessChildSessionService.mjs.map +1 -1
  959. package/dist/src/systems/child/services/childSession/index.cjs +94 -20
  960. package/dist/src/systems/child/services/childSession/index.cjs.map +1 -1
  961. package/dist/src/systems/child/services/childSession/index.d.mts +12 -3
  962. package/dist/src/systems/child/services/childSession/index.d.mts.map +1 -1
  963. package/dist/src/systems/child/services/childSession/index.mjs +94 -20
  964. package/dist/src/systems/child/services/childSession/index.mjs.map +1 -1
  965. package/dist/src/systems/child/types/childSession.cjs +33 -13
  966. package/dist/src/systems/child/types/childSession.cjs.map +1 -1
  967. package/dist/src/systems/child/types/childSession.d.mts +143 -80
  968. package/dist/src/systems/child/types/childSession.d.mts.map +1 -1
  969. package/dist/src/systems/child/types/childSession.mjs +24 -9
  970. package/dist/src/systems/child/types/childSession.mjs.map +1 -1
  971. package/dist/src/systems/main/adapters/headlessHost.cjs +30 -27
  972. package/dist/src/systems/main/adapters/headlessHost.cjs.map +1 -1
  973. package/dist/src/systems/main/adapters/headlessHost.d.mts +22 -22
  974. package/dist/src/systems/main/adapters/headlessHost.d.mts.map +1 -1
  975. package/dist/src/systems/main/adapters/headlessHost.mjs +33 -30
  976. package/dist/src/systems/main/adapters/headlessHost.mjs.map +1 -1
  977. package/dist/src/systems/main/adapters/headlessSessionHost.cjs +248 -229
  978. package/dist/src/systems/main/adapters/headlessSessionHost.cjs.map +1 -1
  979. package/dist/src/systems/main/adapters/headlessSessionHost.d.mts +4 -5
  980. package/dist/src/systems/main/adapters/headlessSessionHost.d.mts.map +1 -1
  981. package/dist/src/systems/main/adapters/headlessSessionHost.mjs +239 -219
  982. package/dist/src/systems/main/adapters/headlessSessionHost.mjs.map +1 -1
  983. package/dist/src/systems/main/types/headlessHost.d.mts +16 -14
  984. package/dist/src/systems/main/types/headlessHost.d.mts.map +1 -1
  985. package/dist/src/testing/pi/testHost.cjs +2 -2
  986. package/dist/src/testing/pi/testHost.cjs.map +1 -1
  987. package/dist/src/testing/pi/testHost.d.mts +3 -2
  988. package/dist/src/testing/pi/testHost.mjs +3 -3
  989. package/dist/src/testing/pi/testHost.mjs.map +1 -1
  990. package/dist/src/types/config.d.mts +1 -1
  991. package/dist/src/types/config.d.mts.map +1 -1
  992. package/dist/src/types/kernel.d.mts +3 -3
  993. package/dist/src/types/server/directHarnessRuntime.d.mts +54 -25
  994. package/dist/src/types/server/directHarnessRuntime.d.mts.map +1 -1
  995. package/dist/src/types/server/sessionToolSurface.d.mts +9 -9
  996. package/dist/src/web/services/apiClient/index.d.mts +1 -0
  997. package/dist/src/web/services/apiPaths/index.cjs.map +1 -1
  998. package/dist/src/web/services/apiPaths/index.d.mts +1 -1
  999. package/dist/src/web/services/apiPaths/index.mjs.map +1 -1
  1000. package/dist/src/web/services/mcpWidget.cjs.map +1 -1
  1001. package/dist/src/web/services/mcpWidget.d.mts +2 -2
  1002. package/dist/src/web/services/mcpWidget.d.mts.map +1 -1
  1003. package/dist/src/web/services/mcpWidget.mjs.map +1 -1
  1004. package/dist/src/web/services/testing/templateRail.cjs +3 -0
  1005. package/dist/src/web/services/testing/templateRail.cjs.map +1 -1
  1006. package/dist/src/web/services/testing/templateRail.mjs +3 -0
  1007. package/dist/src/web/services/testing/templateRail.mjs.map +1 -1
  1008. package/dist/src/web/types/mcpWidget.d.mts +1 -1
  1009. package/dist/src/web/types/nativeTemplate.d.mts +1 -1
  1010. package/dist/src/web/types/nativeTemplate.d.mts.map +1 -1
  1011. package/dist/src/web/types/template.d.mts +8 -0
  1012. package/dist/src/web/types/template.d.mts.map +1 -1
  1013. package/dist/src/web/types/webPlugin.d.mts +17 -5
  1014. package/dist/src/web/types/webPlugin.d.mts.map +1 -1
  1015. package/dist/testMode.cjs +4 -0
  1016. package/dist/testMode.d.mts +2 -0
  1017. package/dist/testMode.mjs +1 -0
  1018. package/dist/testing.cjs +1 -1
  1019. package/dist/testing.d.mts +2 -2
  1020. package/dist/testing.mjs +2 -2
  1021. package/dist/toolInventory.cjs.map +1 -1
  1022. package/dist/toolInventory.mjs.map +1 -1
  1023. package/dist/toolNames.mjs +1 -2
  1024. package/dist/toolOverrides.cjs +4 -4
  1025. package/dist/toolOverrides.d.mts +3 -3
  1026. package/dist/toolOverrides.mjs +3 -3
  1027. package/dist/toolSurface.cjs +4 -4
  1028. package/dist/toolSurface.d.mts +3 -3
  1029. package/dist/toolSurface.mjs +3 -3
  1030. package/dist/transition.cjs +3 -3
  1031. package/dist/transition.d.cjs +3 -3
  1032. package/dist/transition.d.mts +2 -2
  1033. package/dist/transition.mjs +1 -2
  1034. package/dist/transitionClassifier.cjs.map +1 -1
  1035. package/dist/transitionClassifier.d.mts +2 -2
  1036. package/dist/transitionClassifier.d.mts.map +1 -1
  1037. package/dist/transitionClassifier.mjs.map +1 -1
  1038. package/dist/transitionCoordinator.cjs +3 -3
  1039. package/dist/transitionCoordinator.cjs.map +1 -1
  1040. package/dist/transitionCoordinator.d.mts +4 -4
  1041. package/dist/transitionCoordinator.d.mts.map +1 -1
  1042. package/dist/transitionCoordinator.mjs +3 -3
  1043. package/dist/transitionCoordinator.mjs.map +1 -1
  1044. package/dist/typesContextApi.d.mts +2 -1
  1045. package/dist/typesContextApi.d.mts.map +1 -1
  1046. package/dist/uiHub.cjs +3 -3
  1047. package/dist/uiHub.d.mts +2 -2
  1048. package/dist/uiHub.mjs +1 -2
  1049. package/dist/voiceTools.cjs +5 -5
  1050. package/dist/voiceTools.d.mts +3 -3
  1051. package/dist/voiceTools.mjs +3 -3
  1052. package/dist/web.cjs +8 -0
  1053. package/dist/web.d.mts +3 -2
  1054. package/dist/web.mjs +2 -1
  1055. package/dist/webCompositions.cjs.map +1 -1
  1056. package/dist/webCompositions.d.mts +7 -7
  1057. package/dist/webCompositions.d.mts.map +1 -1
  1058. package/dist/webCompositions.mjs.map +1 -1
  1059. package/licenses/Codex-Apache-2.0.txt +201 -0
  1060. package/package.json +58 -53
  1061. package/dist/doomPackage.cjs +0 -61
  1062. package/dist/doomPackage.cjs.map +0 -1
  1063. package/dist/doomPackage.d.mts +0 -17
  1064. package/dist/doomPackage.d.mts.map +0 -1
  1065. package/dist/doomPackage.mjs +0 -54
  1066. package/dist/doomPackage.mjs.map +0 -1
  1067. package/dist/jsonlSessionRepo.cjs +0 -44
  1068. package/dist/jsonlSessionRepo.cjs.map +0 -1
  1069. package/dist/jsonlSessionRepo.d.mts +0 -7
  1070. package/dist/jsonlSessionRepo.d.mts.map +0 -1
  1071. package/dist/jsonlSessionRepo.mjs +0 -42
  1072. package/dist/jsonlSessionRepo.mjs.map +0 -1
  1073. package/dist/runtimeJson.cjs.map +0 -1
  1074. package/dist/runtimeJson.d.mts.map +0 -1
  1075. package/dist/runtimeJson.mjs.map +0 -1
  1076. package/dist/runtimePiSettings.cjs.map +0 -1
  1077. package/dist/runtimePiSettings.d.mts.map +0 -1
  1078. package/dist/runtimePiSettings.mjs.map +0 -1
  1079. package/dist/serverFacet.cjs +0 -34
  1080. package/dist/serverFacet.d.mts +0 -10
  1081. package/dist/serverFacet.mjs +0 -9
  1082. package/dist/src/pi/piWebSocketListener.cjs +0 -115
  1083. package/dist/src/pi/piWebSocketListener.cjs.map +0 -1
  1084. package/dist/src/pi/piWebSocketListener.mjs +0 -115
  1085. package/dist/src/pi/piWebSocketListener.mjs.map +0 -1
  1086. package/dist/src/schemas/serverFacet.cjs +0 -111
  1087. package/dist/src/schemas/serverFacet.cjs.map +0 -1
  1088. package/dist/src/schemas/serverFacet.d.mts +0 -152
  1089. package/dist/src/schemas/serverFacet.d.mts.map +0 -1
  1090. package/dist/src/schemas/serverFacet.mjs +0 -101
  1091. package/dist/src/schemas/serverFacet.mjs.map +0 -1
  1092. package/dist/src/schemas/sessionUpdates.d.mts +0 -34
  1093. package/dist/src/schemas/sessionUpdates.d.mts.map +0 -1
  1094. package/dist/src/server/headlessProtocol.cjs +0 -382
  1095. package/dist/src/server/headlessProtocol.cjs.map +0 -1
  1096. package/dist/src/server/headlessProtocol.mjs +0 -382
  1097. package/dist/src/server/headlessProtocol.mjs.map +0 -1
  1098. package/dist/src/server/nativeChildTranscriptReader.cjs +0 -20
  1099. package/dist/src/server/nativeChildTranscriptReader.cjs.map +0 -1
  1100. package/dist/src/server/nativeChildTranscriptReader.mjs +0 -18
  1101. package/dist/src/server/nativeChildTranscriptReader.mjs.map +0 -1
  1102. package/dist/src/server/serverFacetLoader.cjs +0 -214
  1103. package/dist/src/server/serverFacetLoader.cjs.map +0 -1
  1104. package/dist/src/server/serverFacetLoader.d.mts +0 -72
  1105. package/dist/src/server/serverFacetLoader.d.mts.map +0 -1
  1106. package/dist/src/server/serverFacetLoader.mjs +0 -212
  1107. package/dist/src/server/serverFacetLoader.mjs.map +0 -1
  1108. package/dist/src/services/acpSessionUpdates/index.cjs +0 -129
  1109. package/dist/src/services/acpSessionUpdates/index.cjs.map +0 -1
  1110. package/dist/src/services/acpSessionUpdates/index.mjs +0 -129
  1111. package/dist/src/services/acpSessionUpdates/index.mjs.map +0 -1
  1112. package/dist/src/services/historyImport/index.cjs +0 -8
  1113. package/dist/src/services/historyImport/index.cjs.map +0 -1
  1114. package/dist/src/services/historyImport/index.d.mts +0 -68
  1115. package/dist/src/services/historyImport/index.d.mts.map +0 -1
  1116. package/dist/src/services/historyImport/index.mjs +0 -8
  1117. package/dist/src/services/historyImport/index.mjs.map +0 -1
  1118. package/dist/src/services/openSessionRegistry/index.d.mts.map +0 -1
  1119. package/dist/src/services/requestReceipts/index.cjs.map +0 -1
  1120. package/dist/src/services/requestReceipts/index.d.mts +0 -11
  1121. package/dist/src/services/requestReceipts/index.d.mts.map +0 -1
  1122. package/dist/src/services/requestReceipts/index.mjs.map +0 -1
  1123. package/dist/src/services/rpcTranscript/index.cjs +0 -633
  1124. package/dist/src/services/rpcTranscript/index.cjs.map +0 -1
  1125. package/dist/src/services/rpcTranscript/index.d.mts +0 -50
  1126. package/dist/src/services/rpcTranscript/index.d.mts.map +0 -1
  1127. package/dist/src/services/rpcTranscript/index.mjs +0 -632
  1128. package/dist/src/services/rpcTranscript/index.mjs.map +0 -1
  1129. package/dist/src/services/serverFacet/index.cjs.map +0 -1
  1130. package/dist/src/services/serverFacet/index.d.mts +0 -31
  1131. package/dist/src/services/serverFacet/index.d.mts.map +0 -1
  1132. package/dist/src/services/serverFacet/index.mjs.map +0 -1
  1133. package/dist/src/services/workspaceRegistry/index.d.mts.map +0 -1
  1134. package/dist/src/systems/child/adapters/nativeChildRuntimes.cjs +0 -28
  1135. package/dist/src/systems/child/adapters/nativeChildRuntimes.cjs.map +0 -1
  1136. package/dist/src/systems/child/adapters/nativeChildRuntimes.mjs +0 -25
  1137. package/dist/src/systems/child/adapters/nativeChildRuntimes.mjs.map +0 -1
  1138. package/dist/terminalPiChildSessionService.cjs +0 -324
  1139. package/dist/terminalPiChildSessionService.cjs.map +0 -1
  1140. package/dist/terminalPiChildSessionService.d.mts +0 -46
  1141. package/dist/terminalPiChildSessionService.d.mts.map +0 -1
  1142. package/dist/terminalPiChildSessionService.mjs +0 -318
  1143. package/dist/terminalPiChildSessionService.mjs.map +0 -1
  1144. package/dist/v3Export.cjs +0 -10
  1145. package/dist/v3Export.cjs.map +0 -1
  1146. package/dist/v3Export.d.mts +0 -35
  1147. package/dist/v3Export.d.mts.map +0 -1
  1148. package/dist/v3Export.mjs +0 -9
  1149. package/dist/v3Export.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"extensionFile.cjs","names":[],"sources":["../../../src/extensions/extensionFile.ts"],"sourcesContent":["import type { TSchema } from 'typebox';\n\nimport type {\n ActivityFile,\n ChannelFile,\n CommandContribution,\n CommandFile,\n HookFile,\n MethodFile,\n RootFile,\n RoutedFileOptions,\n RouteFile,\n ServerCommandFile,\n ServerToolFile,\n ServiceFile,\n ToolContribution,\n ToolFile,\n} from '../schemas/extensionFile';\nimport type { DoomHeadlessEventName } from '../schemas/headless';\nimport type { PluginLifecycleHooks } from '../services/pluginLifecycle';\n\n/**\n * Identity helpers for folder-routed backend files, one per surface.\n *\n * A routed file's default export is its whole contract with the host, and\n * nothing else validates it: the generated entry merges the path's identity in\n * and hands the result to a contribution array, where an excess or misspelled\n * key is invisible. These make the shape checkable at the point it is written,\n * and give the factory form a typed context instead of an implicit any.\n *\n * Most return their argument unchanged, so the value is entirely in the\n * position they check and the inference they supply. The two that do not,\n * `defineTool` and `defineCommand`, add the discriminant the host reads to\n * tell a portable contribution from a raw host declaration.\n */\n\n/** Declares non-default route cardinality while preserving the routed surface's inferred host type. */\nexport function defineRoutedContribution<T>(file: T, _options: RoutedFileOptions): T {\n return file;\n}\n\n/** `provider/<name>.server.ts`. Declares one native provider contribution. */\nexport function defineProvider<T>(file: T): T {\n return file;\n}\n\n/** `resource/<name>.ts`. Declares one package resource. */\nexport function defineResource<T>(file: T): T {\n return file;\n}\n\n/** `tool-restriction/<name>.ts`. Declares one tool restriction. */\nexport function defineToolRestriction<T>(file: T): T {\n return file;\n}\n\n/** Declares one mode when it is not represented by a mode gate file. */\nexport function defineMode<T>(file: T): T {\n return file;\n}\n\n/** `tool/<name>.ts`. Adds the discriminant the contribution array expects. */\nexport function defineTool<TContext = unknown>(file: ToolFile<TContext>): ToolContribution<TContext> {\n return typeof file === 'function'\n ? (context) => ({ kind: 'tool' as const, ...file(context) })\n : { kind: 'tool' as const, ...file };\n}\n\n/** `tool/<name>.server.ts`. A native headless tool, handed to the host untouched. */\nexport function defineServerTool<TParameters extends TSchema = TSchema, TContext = unknown>(\n file: ServerToolFile<TParameters, TContext>,\n): ServerToolFile<TParameters, TContext> {\n return file;\n}\n\n/**\n * `root.ts`. Constructs one scope and names what its subtree shares.\n *\n * The answer to a package whose surfaces all read one per-mount object graph.\n * The root builds that graph once, and every routed file beneath it receives\n * it as `context.root`, so the package decomposes into a file per surface\n * without either rebuilding the graph per file or reaching for a module-level\n * singleton.\n */\nexport function defineRoot<TValue, TContext = unknown>(file: RootFile<TValue, TContext>): RootFile<TValue, TContext> {\n return file;\n}\n\n/**\n * Folds every root in a scope chain into one set of lifecycle hooks.\n *\n * Start outermost first and tear down innermost first, which is the order the\n * roots were constructed in and the only order in which an inner scope can\n * still rely on its outer one while stopping.\n */\nexport function composeRootHooks<TContext>(\n ...roots: readonly PluginLifecycleHooks<TContext>[]\n): Required<PluginLifecycleHooks<TContext>> {\n const reversed = [...roots].reverse();\n return {\n async onStart(context) {\n for (const root of roots) await root.onStart?.(context);\n },\n async onStop(context) {\n for (const root of reversed) await root.onStop?.(context);\n },\n async onDispose(context) {\n for (const root of reversed) await root.onDispose?.(context);\n },\n };\n}\n\n/** `command/<name>.server.ts`. A native headless or portable Doom command. */\nexport function defineServerCommand<TContext = unknown>(\n file: ServerCommandFile<TContext>,\n): ServerCommandFile<TContext> {\n return file;\n}\n\n/** `command/<name>.ts`. Adds the discriminant the contribution array expects. */\nexport function defineCommand<TContext = unknown>(file: CommandFile<TContext>): CommandContribution<TContext> {\n return typeof file === 'function'\n ? (context) => ({ kind: 'command' as const, ...file(context) })\n : { kind: 'command' as const, ...file };\n}\n\n/** `hook/<event>.ts`. Name the event here too when the handler needs a precise payload. */\nexport function defineHook<TEvent extends DoomHeadlessEventName = DoomHeadlessEventName, TContext = unknown>(\n file: HookFile<TEvent, TContext>,\n): HookFile<TEvent, TContext> {\n return file;\n}\n\n/** A Cordis service factory for a scope root. */\nexport function defineService<TContext = unknown>(file: ServiceFile<TContext>): ServiceFile<TContext> {\n return file;\n}\n\n/** `channel/<frameType>.ts`. The contribution array holds factories, so this is one. */\nexport function defineChannel(file: ChannelFile): ChannelFile {\n return file;\n}\n\n/** `api/<segments>/route.ts`. The folder path is the route. */\nexport function defineRoute<TContext = unknown>(file: RouteFile<TContext>): RouteFile<TContext> {\n return file;\n}\n\n/** `method/<member>.ts`. Build the value with `defineServerMethod` to keep schema inference. */\nexport function defineMethod<TContext = unknown>(file: MethodFile<TContext>): MethodFile<TContext> {\n return file;\n}\n\n/** A server activity declaration for a session root. */\nexport function defineActivity<TContext = unknown>(file: ActivityFile<TContext>): ActivityFile<TContext> {\n return file;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqCA,SAAgB,yBAA4B,MAAS,UAAgC;CACnF,OAAO;AACT;;AAGA,SAAgB,eAAkB,MAAY;CAC5C,OAAO;AACT;;AAGA,SAAgB,eAAkB,MAAY;CAC5C,OAAO;AACT;;AAGA,SAAgB,sBAAyB,MAAY;CACnD,OAAO;AACT;;AAGA,SAAgB,WAAc,MAAY;CACxC,OAAO;AACT;;AAGA,SAAgB,WAA+B,MAAsD;CACnG,OAAO,OAAO,SAAS,cAClB,aAAa;EAAE,MAAM;EAAiB,GAAG,KAAK,OAAO;CAAE,KACxD;EAAE,MAAM;EAAiB,GAAG;CAAK;AACvC;;AAGA,SAAgB,iBACd,MACuC;CACvC,OAAO;AACT;;;;;;;;;;AAWA,SAAgB,WAAuC,MAA8D;CACnH,OAAO;AACT;;;;;;;;AASA,SAAgB,iBACd,GAAG,OACuC;CAC1C,MAAM,WAAW,CAAC,GAAG,KAAK,CAAC,CAAC,QAAQ;CACpC,OAAO;EACL,MAAM,QAAQ,SAAS;GACrB,KAAK,MAAM,QAAQ,OAAO,MAAM,KAAK,UAAU,OAAO;EACxD;EACA,MAAM,OAAO,SAAS;GACpB,KAAK,MAAM,QAAQ,UAAU,MAAM,KAAK,SAAS,OAAO;EAC1D;EACA,MAAM,UAAU,SAAS;GACvB,KAAK,MAAM,QAAQ,UAAU,MAAM,KAAK,YAAY,OAAO;EAC7D;CACF;AACF;;AAGA,SAAgB,oBACd,MAC6B;CAC7B,OAAO;AACT;;AAGA,SAAgB,cAAkC,MAA4D;CAC5G,OAAO,OAAO,SAAS,cAClB,aAAa;EAAE,MAAM;EAAoB,GAAG,KAAK,OAAO;CAAE,KAC3D;EAAE,MAAM;EAAoB,GAAG;CAAK;AAC1C;;AAGA,SAAgB,WACd,MAC4B;CAC5B,OAAO;AACT;;AAGA,SAAgB,cAAkC,MAAoD;CACpG,OAAO;AACT;;AAGA,SAAgB,cAAc,MAAgC;CAC5D,OAAO;AACT;;AAGA,SAAgB,YAAgC,MAAgD;CAC9F,OAAO;AACT;;AAGA,SAAgB,aAAiC,MAAkD;CACjG,OAAO;AACT;;AAGA,SAAgB,eAAmC,MAAsD;CACvG,OAAO;AACT"}
1
+ {"version":3,"file":"extensionFile.cjs","names":["runCleanups"],"sources":["../../../src/extensions/extensionFile.ts"],"sourcesContent":["import type { TSchema } from 'typebox';\n\nimport type {\n ActivityFile,\n ChannelFile,\n CommandContribution,\n CommandFile,\n HookFile,\n MethodFile,\n RootFile,\n RoutedFileOptions,\n RouteFile,\n ServerCommandFile,\n ServerToolFile,\n ServiceFile,\n ToolContribution,\n ToolFile,\n} from '../schemas/extensionFile';\nimport type { PoHeadlessEventName } from '../schemas/headless';\nimport type { PoApiScope } from '../schemas/packageApi';\nimport type { PoServerContracts } from '../schemas/serverPlugin';\nimport type { PoServiceContract } from '../schemas/serverScope';\nimport { runCleanups, type PluginLifecycleHooks } from '../services/pluginLifecycle';\n\n/**\n * Identity helpers for folder-routed backend files, one per surface.\n *\n * A routed file's default export is its whole contract with the host, and\n * nothing else validates it: the generated entry merges the path's identity in\n * and hands the result to a contribution array, where an excess or misspelled\n * key is invisible. These make the shape checkable at the point it is written,\n * and give the factory form a typed context instead of an implicit any.\n *\n * Most return their argument unchanged, so the value is entirely in the\n * position they check and the inference they supply. The two that do not,\n * `defineTool` and `defineCommand`, add the discriminant the host reads to\n * tell a portable contribution from a raw host declaration.\n */\n\n/** Declares non-default route cardinality while preserving the routed surface's inferred host type. */\nexport function defineRoutedContribution<T>(file: T, _options: RoutedFileOptions): T {\n return file;\n}\n\n/** `provider/<name>.server.ts`. Declares one native provider contribution. */\nexport function defineProvider<T>(file: T): T {\n return file;\n}\n\n/** `resource/<name>.ts`. Declares one package resource. */\nexport function defineResource<T>(file: T): T {\n return file;\n}\n\n/** `tool-restriction/<name>.ts`. Declares one tool restriction. */\nexport function defineToolRestriction<T>(file: T): T {\n return file;\n}\n\n/** Declares one mode when it is not represented by a mode gate file. */\nexport function defineMode<T>(file: T): T {\n return file;\n}\n\n/** `tool/<name>.ts`. Adds the discriminant the contribution array expects. */\nexport function defineTool<TContext = unknown>(file: ToolFile<TContext>): ToolContribution<TContext> {\n return typeof file === 'function'\n ? (context) => ({ kind: 'tool' as const, ...file(context) })\n : { kind: 'tool' as const, ...file };\n}\n\n/** `tool/<name>.server.ts`. A native headless tool, handed to the host untouched. */\nexport function defineServerTool<TParameters extends TSchema = TSchema, TContext = unknown>(\n file: ServerToolFile<TParameters, TContext>,\n): ServerToolFile<TParameters, TContext> {\n return file;\n}\n\n/**\n * `root.ts`. Constructs one scope and names what its subtree shares.\n *\n * The answer to a package whose surfaces all read one per-mount object graph.\n * The root builds that graph once, and every routed file beneath it receives\n * it as `context.root`, so the package decomposes into a file per surface\n * without either rebuilding the graph per file or reaching for a module-level\n * singleton.\n *\n * `inject` names the contracts, from this package or another, that the level\n * waits for before it builds this root and restarts with when they change.\n */\nexport function defineRoot<TValue, TContext = unknown>(\n file: RootFile<TValue, TContext>,\n options?: { readonly inject?: readonly PoServiceContract<unknown>[] },\n): RootFile<TValue, TContext> {\n // Assigned rather than wrapped, so other metadata the factory carries (provider overrides) stays.\n return options?.inject === undefined ? file : Object.assign(file, { inject: options.inject });\n}\n\n/**\n * The contracts each level waits for: every contract injected by the roots that level builds or\n * reuses, once each. A level none of whose roots inject anything is left out.\n */\nexport function composeRootInjects(\n levels: Readonly<Partial<Record<PoApiScope, readonly Pick<RootFile<unknown>, 'inject'>[]>>>,\n): PoServerContracts {\n const injects: Partial<Record<PoApiScope, readonly PoServiceContract<unknown>[]>> = {};\n for (const [level, roots] of Object.entries(levels) as [PoApiScope, readonly Pick<RootFile<unknown>, 'inject'>[]][]) {\n const contracts = new Map(roots.flatMap((root) => root.inject ?? []).map((contract) => [contract.name, contract]));\n if (contracts.size > 0) injects[level] = [...contracts.values()];\n }\n return injects;\n}\n\n/**\n * Folds every root in a scope chain into one set of lifecycle hooks.\n *\n * Start outermost first and tear down innermost first, which is the order the\n * roots were constructed in and the only order in which an inner scope can\n * still rely on its outer one while stopping.\n */\nexport function composeRootHooks<TContext>(\n ...roots: readonly PluginLifecycleHooks<TContext>[]\n): Required<PluginLifecycleHooks<TContext>> {\n const reversed = [...roots].reverse();\n return {\n async onStart(context) {\n for (const root of roots) await root.onStart?.(context);\n },\n async onStop(context) {\n await runCleanups(\n reversed.map((root) => () => root.onStop?.(context)),\n 'Root stop failed.',\n );\n },\n async onDispose(context) {\n await runCleanups(\n reversed.map((root) => () => root.onDispose?.(context)),\n 'Root cleanup failed.',\n );\n },\n };\n}\n\n/** `command/<name>.server.ts`. A native headless or portable Po command. */\nexport function defineServerCommand<TContext = unknown>(\n file: ServerCommandFile<TContext>,\n): ServerCommandFile<TContext> {\n return file;\n}\n\n/** `command/<name>.ts`. Adds the discriminant the contribution array expects. */\nexport function defineCommand<TContext = unknown>(file: CommandFile<TContext>): CommandContribution<TContext> {\n return typeof file === 'function'\n ? (context) => ({ kind: 'command' as const, ...file(context) })\n : { kind: 'command' as const, ...file };\n}\n\n/** `hook/<event>.ts`. Name the event here too when the handler needs a precise payload. */\nexport function defineHook<TEvent extends PoHeadlessEventName = PoHeadlessEventName, TContext = unknown>(\n file: HookFile<TEvent, TContext>,\n): HookFile<TEvent, TContext> {\n return file;\n}\n\n/** A Cordis service factory for a scope root. */\nexport function defineService<TContext = unknown>(file: ServiceFile<TContext>): ServiceFile<TContext> {\n return file;\n}\n\n/** `channel/<frameType>.ts`. The contribution array holds factories, so this is one. */\nexport function defineChannel(file: ChannelFile): ChannelFile {\n return file;\n}\n\n/** `api/<segments>/route.ts`. The folder path is the route. */\nexport function defineRoute<TContext = unknown>(file: RouteFile<TContext>): RouteFile<TContext> {\n return file;\n}\n\n/** `method/<member>.ts`. Build the value with `defineServerMethod` to keep schema inference. */\nexport function defineMethod<TContext = unknown>(file: MethodFile<TContext>): MethodFile<TContext> {\n return file;\n}\n\n/** A server activity declaration for a session root. */\nexport function defineActivity<TContext = unknown>(file: ActivityFile<TContext>): ActivityFile<TContext> {\n return file;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwCA,SAAgB,yBAA4B,MAAS,UAAgC;CACnF,OAAO;AACT;;AAGA,SAAgB,eAAkB,MAAY;CAC5C,OAAO;AACT;;AAGA,SAAgB,eAAkB,MAAY;CAC5C,OAAO;AACT;;AAGA,SAAgB,sBAAyB,MAAY;CACnD,OAAO;AACT;;AAGA,SAAgB,WAAc,MAAY;CACxC,OAAO;AACT;;AAGA,SAAgB,WAA+B,MAAsD;CACnG,OAAO,OAAO,SAAS,cAClB,aAAa;EAAE,MAAM;EAAiB,GAAG,KAAK,OAAO;CAAE,KACxD;EAAE,MAAM;EAAiB,GAAG;CAAK;AACvC;;AAGA,SAAgB,iBACd,MACuC;CACvC,OAAO;AACT;;;;;;;;;;;;;AAcA,SAAgB,WACd,MACA,SAC4B;CAE5B,OAAO,SAAS,WAAW,KAAA,IAAY,OAAO,OAAO,OAAO,MAAM,EAAE,QAAQ,QAAQ,OAAO,CAAC;AAC9F;;;;;AAMA,SAAgB,mBACd,QACmB;CACnB,MAAM,UAA8E,CAAC;CACrF,KAAK,MAAM,CAAC,OAAO,UAAU,OAAO,QAAQ,MAAM,GAAmE;EACnH,MAAM,YAAY,IAAI,IAAI,MAAM,SAAS,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,SAAS,MAAM,QAAQ,CAAC,CAAC;EACjH,IAAI,UAAU,OAAO,GAAG,QAAQ,SAAS,CAAC,GAAG,UAAU,OAAO,CAAC;CACjE;CACA,OAAO;AACT;;;;;;;;AASA,SAAgB,iBACd,GAAG,OACuC;CAC1C,MAAM,WAAW,CAAC,GAAG,KAAK,CAAC,CAAC,QAAQ;CACpC,OAAO;EACL,MAAM,QAAQ,SAAS;GACrB,KAAK,MAAM,QAAQ,OAAO,MAAM,KAAK,UAAU,OAAO;EACxD;EACA,MAAM,OAAO,SAAS;GACpB,MAAMA,cAAAA,YACJ,SAAS,KAAK,eAAe,KAAK,SAAS,OAAO,CAAC,GACnD,mBACF;EACF;EACA,MAAM,UAAU,SAAS;GACvB,MAAMA,cAAAA,YACJ,SAAS,KAAK,eAAe,KAAK,YAAY,OAAO,CAAC,GACtD,sBACF;EACF;CACF;AACF;;AAGA,SAAgB,oBACd,MAC6B;CAC7B,OAAO;AACT;;AAGA,SAAgB,cAAkC,MAA4D;CAC5G,OAAO,OAAO,SAAS,cAClB,aAAa;EAAE,MAAM;EAAoB,GAAG,KAAK,OAAO;CAAE,KAC3D;EAAE,MAAM;EAAoB,GAAG;CAAK;AAC1C;;AAGA,SAAgB,WACd,MAC4B;CAC5B,OAAO;AACT;;AAGA,SAAgB,cAAkC,MAAoD;CACpG,OAAO;AACT;;AAGA,SAAgB,cAAc,MAAgC;CAC5D,OAAO;AACT;;AAGA,SAAgB,YAAgC,MAAgD;CAC9F,OAAO;AACT;;AAGA,SAAgB,aAAiC,MAAkD;CACjG,OAAO;AACT;;AAGA,SAAgB,eAAmC,MAAsD;CACvG,OAAO;AACT"}
@@ -1,5 +1,8 @@
1
1
  import { PluginLifecycleHooks } from "../services/pluginLifecycle/index.mjs";
2
- import { DoomHeadlessEventName } from "../schemas/headless.mjs";
2
+ import { PoApiScope } from "../schemas/packageApi.mjs";
3
+ import { PoHeadlessEventName } from "../schemas/headless.mjs";
4
+ import { PoServiceContract } from "../schemas/serverScope.mjs";
5
+ import { PoServerContracts } from "../schemas/serverPlugin.mjs";
3
6
  import { ActivityFile, ChannelFile, CommandContribution, CommandFile, HookFile, MethodFile, RootFile, RouteFile, RoutedFileOptions, ServerCommandFile, ServerToolFile, ServiceFile, ToolContribution, ToolFile } from "../schemas/extensionFile.mjs";
4
7
  import { TSchema } from "typebox";
5
8
  //#region src/extensions/extensionFile.d.ts
@@ -39,8 +42,18 @@ export declare function defineServerTool<TParameters extends TSchema = TSchema,
39
42
  * it as `context.root`, so the package decomposes into a file per surface
40
43
  * without either rebuilding the graph per file or reaching for a module-level
41
44
  * singleton.
45
+ *
46
+ * `inject` names the contracts, from this package or another, that the level
47
+ * waits for before it builds this root and restarts with when they change.
48
+ */
49
+ export declare function defineRoot<TValue, TContext = unknown>(file: RootFile<TValue, TContext>, options?: {
50
+ readonly inject?: readonly PoServiceContract<unknown>[];
51
+ }): RootFile<TValue, TContext>;
52
+ /**
53
+ * The contracts each level waits for: every contract injected by the roots that level builds or
54
+ * reuses, once each. A level none of whose roots inject anything is left out.
42
55
  */
43
- export declare function defineRoot<TValue, TContext = unknown>(file: RootFile<TValue, TContext>): RootFile<TValue, TContext>;
56
+ export declare function composeRootInjects(levels: Readonly<Partial<Record<PoApiScope, readonly Pick<RootFile<unknown>, 'inject'>[]>>>): PoServerContracts;
44
57
  /**
45
58
  * Folds every root in a scope chain into one set of lifecycle hooks.
46
59
  *
@@ -49,12 +62,12 @@ export declare function defineRoot<TValue, TContext = unknown>(file: RootFile<TV
49
62
  * still rely on its outer one while stopping.
50
63
  */
51
64
  export declare function composeRootHooks<TContext>(...roots: readonly PluginLifecycleHooks<TContext>[]): Required<PluginLifecycleHooks<TContext>>;
52
- /** `command/<name>.server.ts`. A native headless or portable Doom command. */
65
+ /** `command/<name>.server.ts`. A native headless or portable Po command. */
53
66
  export declare function defineServerCommand<TContext = unknown>(file: ServerCommandFile<TContext>): ServerCommandFile<TContext>;
54
67
  /** `command/<name>.ts`. Adds the discriminant the contribution array expects. */
55
68
  export declare function defineCommand<TContext = unknown>(file: CommandFile<TContext>): CommandContribution<TContext>;
56
69
  /** `hook/<event>.ts`. Name the event here too when the handler needs a precise payload. */
57
- export declare function defineHook<TEvent extends DoomHeadlessEventName = DoomHeadlessEventName, TContext = unknown>(file: HookFile<TEvent, TContext>): HookFile<TEvent, TContext>;
70
+ export declare function defineHook<TEvent extends PoHeadlessEventName = PoHeadlessEventName, TContext = unknown>(file: HookFile<TEvent, TContext>): HookFile<TEvent, TContext>;
58
71
  /** A Cordis service factory for a scope root. */
59
72
  export declare function defineService<TContext = unknown>(file: ServiceFile<TContext>): ServiceFile<TContext>;
60
73
  /** `channel/<frameType>.ts`. The contribution array holds factories, so this is one. */
@@ -1 +1 @@
1
- {"version":3,"file":"extensionFile.d.mts","names":[],"sources":["../../../src/extensions/extensionFile.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;wBAqCgB,yBAAyB,GAAG,MAAM,GAAG,UAAU,oBAAoB;;wBAKnE,eAAe,GAAG,MAAM,IAAI;;wBAK5B,eAAe,GAAG,MAAM,IAAI;;wBAK5B,sBAAsB,GAAG,MAAM,IAAI;;wBAKnC,WAAW,GAAG,MAAM,IAAI;;wBAKxB,WAAW,oBAAoB,MAAM,SAAS,YAAY,iBAAiB;;wBAO3E,iBAAiB,oBAAoB,UAAU,SAAS,oBACtE,MAAM,eAAe,aAAa,YACjC,eAAe,aAAa;;;;;;;;;;wBAaf,WAAW,QAAQ,oBAAoB,MAAM,SAAS,QAAQ,YAAY,SAAS,QAAQ;;;;;;;;wBAW3F,iBAAiB,aAC5B,gBAAgB,qBAAqB,cACvC,SAAS,qBAAqB;;wBAgBjB,oBAAoB,oBAClC,MAAM,kBAAkB,YACvB,kBAAkB;;wBAKL,cAAc,oBAAoB,MAAM,YAAY,YAAY,oBAAoB;;wBA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,YAAY,oBAAoB,MAAM,UAAU,YAAY,UAAU;;wBAKtE,aAAa,oBAAoB,MAAM,WAAW,YAAY,WAAW;;wBAKzE,eAAe,oBAAoB,MAAM,aAAa,YAAY,aAAa"}
@@ -1,3 +1,4 @@
1
+ import { runCleanups } from "../services/pluginLifecycle/index.mjs";
1
2
  //#region src/extensions/extensionFile.ts
2
3
  /**
3
4
  * Identity helpers for folder-routed backend files, one per surface.
@@ -55,9 +56,24 @@ function defineServerTool(file) {
55
56
  * it as `context.root`, so the package decomposes into a file per surface
56
57
  * without either rebuilding the graph per file or reaching for a module-level
57
58
  * singleton.
59
+ *
60
+ * `inject` names the contracts, from this package or another, that the level
61
+ * waits for before it builds this root and restarts with when they change.
58
62
  */
59
- function defineRoot(file) {
60
- return file;
63
+ function defineRoot(file, options) {
64
+ return options?.inject === void 0 ? file : Object.assign(file, { inject: options.inject });
65
+ }
66
+ /**
67
+ * The contracts each level waits for: every contract injected by the roots that level builds or
68
+ * reuses, once each. A level none of whose roots inject anything is left out.
69
+ */
70
+ function composeRootInjects(levels) {
71
+ const injects = {};
72
+ for (const [level, roots] of Object.entries(levels)) {
73
+ const contracts = new Map(roots.flatMap((root) => root.inject ?? []).map((contract) => [contract.name, contract]));
74
+ if (contracts.size > 0) injects[level] = [...contracts.values()];
75
+ }
76
+ return injects;
61
77
  }
62
78
  /**
63
79
  * Folds every root in a scope chain into one set of lifecycle hooks.
@@ -73,14 +89,14 @@ function composeRootHooks(...roots) {
73
89
  for (const root of roots) await root.onStart?.(context);
74
90
  },
75
91
  async onStop(context) {
76
- for (const root of reversed) await root.onStop?.(context);
92
+ await runCleanups(reversed.map((root) => () => root.onStop?.(context)), "Root stop failed.");
77
93
  },
78
94
  async onDispose(context) {
79
- for (const root of reversed) await root.onDispose?.(context);
95
+ await runCleanups(reversed.map((root) => () => root.onDispose?.(context)), "Root cleanup failed.");
80
96
  }
81
97
  };
82
98
  }
83
- /** `command/<name>.server.ts`. A native headless or portable Doom command. */
99
+ /** `command/<name>.server.ts`. A native headless or portable Po command. */
84
100
  function defineServerCommand(file) {
85
101
  return file;
86
102
  }
@@ -119,6 +135,6 @@ function defineActivity(file) {
119
135
  return file;
120
136
  }
121
137
  //#endregion
122
- export { composeRootHooks, defineActivity, defineChannel, defineCommand, defineHook, defineMethod, defineMode, defineProvider, defineResource, defineRoot, defineRoute, defineRoutedContribution, defineServerCommand, defineServerTool, defineService, defineTool, defineToolRestriction };
138
+ export { composeRootHooks, composeRootInjects, defineActivity, defineChannel, defineCommand, defineHook, defineMethod, defineMode, defineProvider, defineResource, defineRoot, defineRoute, defineRoutedContribution, defineServerCommand, defineServerTool, defineService, defineTool, defineToolRestriction };
123
139
 
124
140
  //# sourceMappingURL=extensionFile.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"extensionFile.mjs","names":[],"sources":["../../../src/extensions/extensionFile.ts"],"sourcesContent":["import type { TSchema } from 'typebox';\n\nimport type {\n ActivityFile,\n ChannelFile,\n CommandContribution,\n CommandFile,\n HookFile,\n MethodFile,\n RootFile,\n RoutedFileOptions,\n RouteFile,\n ServerCommandFile,\n ServerToolFile,\n ServiceFile,\n ToolContribution,\n ToolFile,\n} from '../schemas/extensionFile';\nimport type { DoomHeadlessEventName } from '../schemas/headless';\nimport type { PluginLifecycleHooks } from '../services/pluginLifecycle';\n\n/**\n * Identity helpers for folder-routed backend files, one per surface.\n *\n * A routed file's default export is its whole contract with the host, and\n * nothing else validates it: the generated entry merges the path's identity in\n * and hands the result to a contribution array, where an excess or misspelled\n * key is invisible. These make the shape checkable at the point it is written,\n * and give the factory form a typed context instead of an implicit any.\n *\n * Most return their argument unchanged, so the value is entirely in the\n * position they check and the inference they supply. The two that do not,\n * `defineTool` and `defineCommand`, add the discriminant the host reads to\n * tell a portable contribution from a raw host declaration.\n */\n\n/** Declares non-default route cardinality while preserving the routed surface's inferred host type. */\nexport function defineRoutedContribution<T>(file: T, _options: RoutedFileOptions): T {\n return file;\n}\n\n/** `provider/<name>.server.ts`. Declares one native provider contribution. */\nexport function defineProvider<T>(file: T): T {\n return file;\n}\n\n/** `resource/<name>.ts`. Declares one package resource. */\nexport function defineResource<T>(file: T): T {\n return file;\n}\n\n/** `tool-restriction/<name>.ts`. Declares one tool restriction. */\nexport function defineToolRestriction<T>(file: T): T {\n return file;\n}\n\n/** Declares one mode when it is not represented by a mode gate file. */\nexport function defineMode<T>(file: T): T {\n return file;\n}\n\n/** `tool/<name>.ts`. Adds the discriminant the contribution array expects. */\nexport function defineTool<TContext = unknown>(file: ToolFile<TContext>): ToolContribution<TContext> {\n return typeof file === 'function'\n ? (context) => ({ kind: 'tool' as const, ...file(context) })\n : { kind: 'tool' as const, ...file };\n}\n\n/** `tool/<name>.server.ts`. A native headless tool, handed to the host untouched. */\nexport function defineServerTool<TParameters extends TSchema = TSchema, TContext = unknown>(\n file: ServerToolFile<TParameters, TContext>,\n): ServerToolFile<TParameters, TContext> {\n return file;\n}\n\n/**\n * `root.ts`. Constructs one scope and names what its subtree shares.\n *\n * The answer to a package whose surfaces all read one per-mount object graph.\n * The root builds that graph once, and every routed file beneath it receives\n * it as `context.root`, so the package decomposes into a file per surface\n * without either rebuilding the graph per file or reaching for a module-level\n * singleton.\n */\nexport function defineRoot<TValue, TContext = unknown>(file: RootFile<TValue, TContext>): RootFile<TValue, TContext> {\n return file;\n}\n\n/**\n * Folds every root in a scope chain into one set of lifecycle hooks.\n *\n * Start outermost first and tear down innermost first, which is the order the\n * roots were constructed in and the only order in which an inner scope can\n * still rely on its outer one while stopping.\n */\nexport function composeRootHooks<TContext>(\n ...roots: readonly PluginLifecycleHooks<TContext>[]\n): Required<PluginLifecycleHooks<TContext>> {\n const reversed = [...roots].reverse();\n return {\n async onStart(context) {\n for (const root of roots) await root.onStart?.(context);\n },\n async onStop(context) {\n for (const root of reversed) await root.onStop?.(context);\n },\n async onDispose(context) {\n for (const root of reversed) await root.onDispose?.(context);\n },\n };\n}\n\n/** `command/<name>.server.ts`. A native headless or portable Doom command. */\nexport function defineServerCommand<TContext = unknown>(\n file: ServerCommandFile<TContext>,\n): ServerCommandFile<TContext> {\n return file;\n}\n\n/** `command/<name>.ts`. Adds the discriminant the contribution array expects. */\nexport function defineCommand<TContext = unknown>(file: CommandFile<TContext>): CommandContribution<TContext> {\n return typeof file === 'function'\n ? (context) => ({ kind: 'command' as const, ...file(context) })\n : { kind: 'command' as const, ...file };\n}\n\n/** `hook/<event>.ts`. Name the event here too when the handler needs a precise payload. */\nexport function defineHook<TEvent extends DoomHeadlessEventName = DoomHeadlessEventName, TContext = unknown>(\n file: HookFile<TEvent, TContext>,\n): HookFile<TEvent, TContext> {\n return file;\n}\n\n/** A Cordis service factory for a scope root. */\nexport function defineService<TContext = unknown>(file: ServiceFile<TContext>): ServiceFile<TContext> {\n return file;\n}\n\n/** `channel/<frameType>.ts`. The contribution array holds factories, so this is one. */\nexport function defineChannel(file: ChannelFile): ChannelFile {\n return file;\n}\n\n/** `api/<segments>/route.ts`. The folder path is the route. */\nexport function defineRoute<TContext = unknown>(file: RouteFile<TContext>): RouteFile<TContext> {\n return file;\n}\n\n/** `method/<member>.ts`. Build the value with `defineServerMethod` to keep schema inference. */\nexport function defineMethod<TContext = unknown>(file: MethodFile<TContext>): MethodFile<TContext> {\n return file;\n}\n\n/** A server activity declaration for a session root. */\nexport function defineActivity<TContext = unknown>(file: ActivityFile<TContext>): ActivityFile<TContext> {\n return file;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqCA,SAAgB,yBAA4B,MAAS,UAAgC;CACnF,OAAO;AACT;;AAGA,SAAgB,eAAkB,MAAY;CAC5C,OAAO;AACT;;AAGA,SAAgB,eAAkB,MAAY;CAC5C,OAAO;AACT;;AAGA,SAAgB,sBAAyB,MAAY;CACnD,OAAO;AACT;;AAGA,SAAgB,WAAc,MAAY;CACxC,OAAO;AACT;;AAGA,SAAgB,WAA+B,MAAsD;CACnG,OAAO,OAAO,SAAS,cAClB,aAAa;EAAE,MAAM;EAAiB,GAAG,KAAK,OAAO;CAAE,KACxD;EAAE,MAAM;EAAiB,GAAG;CAAK;AACvC;;AAGA,SAAgB,iBACd,MACuC;CACvC,OAAO;AACT;;;;;;;;;;AAWA,SAAgB,WAAuC,MAA8D;CACnH,OAAO;AACT;;;;;;;;AASA,SAAgB,iBACd,GAAG,OACuC;CAC1C,MAAM,WAAW,CAAC,GAAG,KAAK,CAAC,CAAC,QAAQ;CACpC,OAAO;EACL,MAAM,QAAQ,SAAS;GACrB,KAAK,MAAM,QAAQ,OAAO,MAAM,KAAK,UAAU,OAAO;EACxD;EACA,MAAM,OAAO,SAAS;GACpB,KAAK,MAAM,QAAQ,UAAU,MAAM,KAAK,SAAS,OAAO;EAC1D;EACA,MAAM,UAAU,SAAS;GACvB,KAAK,MAAM,QAAQ,UAAU,MAAM,KAAK,YAAY,OAAO;EAC7D;CACF;AACF;;AAGA,SAAgB,oBACd,MAC6B;CAC7B,OAAO;AACT;;AAGA,SAAgB,cAAkC,MAA4D;CAC5G,OAAO,OAAO,SAAS,cAClB,aAAa;EAAE,MAAM;EAAoB,GAAG,KAAK,OAAO;CAAE,KAC3D;EAAE,MAAM;EAAoB,GAAG;CAAK;AAC1C;;AAGA,SAAgB,WACd,MAC4B;CAC5B,OAAO;AACT;;AAGA,SAAgB,cAAkC,MAAoD;CACpG,OAAO;AACT;;AAGA,SAAgB,cAAc,MAAgC;CAC5D,OAAO;AACT;;AAGA,SAAgB,YAAgC,MAAgD;CAC9F,OAAO;AACT;;AAGA,SAAgB,aAAiC,MAAkD;CACjG,OAAO;AACT;;AAGA,SAAgB,eAAmC,MAAsD;CACvG,OAAO;AACT"}
1
+ {"version":3,"file":"extensionFile.mjs","names":[],"sources":["../../../src/extensions/extensionFile.ts"],"sourcesContent":["import type { TSchema } from 'typebox';\n\nimport type {\n ActivityFile,\n ChannelFile,\n CommandContribution,\n CommandFile,\n HookFile,\n MethodFile,\n RootFile,\n RoutedFileOptions,\n RouteFile,\n ServerCommandFile,\n ServerToolFile,\n ServiceFile,\n ToolContribution,\n ToolFile,\n} from '../schemas/extensionFile';\nimport type { PoHeadlessEventName } from '../schemas/headless';\nimport type { PoApiScope } from '../schemas/packageApi';\nimport type { PoServerContracts } from '../schemas/serverPlugin';\nimport type { PoServiceContract } from '../schemas/serverScope';\nimport { runCleanups, type PluginLifecycleHooks } from '../services/pluginLifecycle';\n\n/**\n * Identity helpers for folder-routed backend files, one per surface.\n *\n * A routed file's default export is its whole contract with the host, and\n * nothing else validates it: the generated entry merges the path's identity in\n * and hands the result to a contribution array, where an excess or misspelled\n * key is invisible. These make the shape checkable at the point it is written,\n * and give the factory form a typed context instead of an implicit any.\n *\n * Most return their argument unchanged, so the value is entirely in the\n * position they check and the inference they supply. The two that do not,\n * `defineTool` and `defineCommand`, add the discriminant the host reads to\n * tell a portable contribution from a raw host declaration.\n */\n\n/** Declares non-default route cardinality while preserving the routed surface's inferred host type. */\nexport function defineRoutedContribution<T>(file: T, _options: RoutedFileOptions): T {\n return file;\n}\n\n/** `provider/<name>.server.ts`. Declares one native provider contribution. */\nexport function defineProvider<T>(file: T): T {\n return file;\n}\n\n/** `resource/<name>.ts`. Declares one package resource. */\nexport function defineResource<T>(file: T): T {\n return file;\n}\n\n/** `tool-restriction/<name>.ts`. Declares one tool restriction. */\nexport function defineToolRestriction<T>(file: T): T {\n return file;\n}\n\n/** Declares one mode when it is not represented by a mode gate file. */\nexport function defineMode<T>(file: T): T {\n return file;\n}\n\n/** `tool/<name>.ts`. Adds the discriminant the contribution array expects. */\nexport function defineTool<TContext = unknown>(file: ToolFile<TContext>): ToolContribution<TContext> {\n return typeof file === 'function'\n ? (context) => ({ kind: 'tool' as const, ...file(context) })\n : { kind: 'tool' as const, ...file };\n}\n\n/** `tool/<name>.server.ts`. A native headless tool, handed to the host untouched. */\nexport function defineServerTool<TParameters extends TSchema = TSchema, TContext = unknown>(\n file: ServerToolFile<TParameters, TContext>,\n): ServerToolFile<TParameters, TContext> {\n return file;\n}\n\n/**\n * `root.ts`. Constructs one scope and names what its subtree shares.\n *\n * The answer to a package whose surfaces all read one per-mount object graph.\n * The root builds that graph once, and every routed file beneath it receives\n * it as `context.root`, so the package decomposes into a file per surface\n * without either rebuilding the graph per file or reaching for a module-level\n * singleton.\n *\n * `inject` names the contracts, from this package or another, that the level\n * waits for before it builds this root and restarts with when they change.\n */\nexport function defineRoot<TValue, TContext = unknown>(\n file: RootFile<TValue, TContext>,\n options?: { readonly inject?: readonly PoServiceContract<unknown>[] },\n): RootFile<TValue, TContext> {\n // Assigned rather than wrapped, so other metadata the factory carries (provider overrides) stays.\n return options?.inject === undefined ? file : Object.assign(file, { inject: options.inject });\n}\n\n/**\n * The contracts each level waits for: every contract injected by the roots that level builds or\n * reuses, once each. A level none of whose roots inject anything is left out.\n */\nexport function composeRootInjects(\n levels: Readonly<Partial<Record<PoApiScope, readonly Pick<RootFile<unknown>, 'inject'>[]>>>,\n): PoServerContracts {\n const injects: Partial<Record<PoApiScope, readonly PoServiceContract<unknown>[]>> = {};\n for (const [level, roots] of Object.entries(levels) as [PoApiScope, readonly Pick<RootFile<unknown>, 'inject'>[]][]) {\n const contracts = new Map(roots.flatMap((root) => root.inject ?? []).map((contract) => [contract.name, contract]));\n if (contracts.size > 0) injects[level] = [...contracts.values()];\n }\n return injects;\n}\n\n/**\n * Folds every root in a scope chain into one set of lifecycle hooks.\n *\n * Start outermost first and tear down innermost first, which is the order the\n * roots were constructed in and the only order in which an inner scope can\n * still rely on its outer one while stopping.\n */\nexport function composeRootHooks<TContext>(\n ...roots: readonly PluginLifecycleHooks<TContext>[]\n): Required<PluginLifecycleHooks<TContext>> {\n const reversed = [...roots].reverse();\n return {\n async onStart(context) {\n for (const root of roots) await root.onStart?.(context);\n },\n async onStop(context) {\n await runCleanups(\n reversed.map((root) => () => root.onStop?.(context)),\n 'Root stop failed.',\n );\n },\n async onDispose(context) {\n await runCleanups(\n reversed.map((root) => () => root.onDispose?.(context)),\n 'Root cleanup failed.',\n );\n },\n };\n}\n\n/** `command/<name>.server.ts`. A native headless or portable Po command. */\nexport function defineServerCommand<TContext = unknown>(\n file: ServerCommandFile<TContext>,\n): ServerCommandFile<TContext> {\n return file;\n}\n\n/** `command/<name>.ts`. Adds the discriminant the contribution array expects. */\nexport function defineCommand<TContext = unknown>(file: CommandFile<TContext>): CommandContribution<TContext> {\n return typeof file === 'function'\n ? (context) => ({ kind: 'command' as const, ...file(context) })\n : { kind: 'command' as const, ...file };\n}\n\n/** `hook/<event>.ts`. Name the event here too when the handler needs a precise payload. */\nexport function defineHook<TEvent extends PoHeadlessEventName = PoHeadlessEventName, TContext = unknown>(\n file: HookFile<TEvent, TContext>,\n): HookFile<TEvent, TContext> {\n return file;\n}\n\n/** A Cordis service factory for a scope root. */\nexport function defineService<TContext = unknown>(file: ServiceFile<TContext>): ServiceFile<TContext> {\n return file;\n}\n\n/** `channel/<frameType>.ts`. The contribution array holds factories, so this is one. */\nexport function defineChannel(file: ChannelFile): ChannelFile {\n return file;\n}\n\n/** `api/<segments>/route.ts`. The folder path is the route. */\nexport function defineRoute<TContext = unknown>(file: RouteFile<TContext>): RouteFile<TContext> {\n return file;\n}\n\n/** `method/<member>.ts`. Build the value with `defineServerMethod` to keep schema inference. */\nexport function defineMethod<TContext = unknown>(file: MethodFile<TContext>): MethodFile<TContext> {\n return file;\n}\n\n/** A server activity declaration for a session root. */\nexport function defineActivity<TContext = unknown>(file: ActivityFile<TContext>): ActivityFile<TContext> {\n return file;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwCA,SAAgB,yBAA4B,MAAS,UAAgC;CACnF,OAAO;AACT;;AAGA,SAAgB,eAAkB,MAAY;CAC5C,OAAO;AACT;;AAGA,SAAgB,eAAkB,MAAY;CAC5C,OAAO;AACT;;AAGA,SAAgB,sBAAyB,MAAY;CACnD,OAAO;AACT;;AAGA,SAAgB,WAAc,MAAY;CACxC,OAAO;AACT;;AAGA,SAAgB,WAA+B,MAAsD;CACnG,OAAO,OAAO,SAAS,cAClB,aAAa;EAAE,MAAM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,MAC4B;CAC5B,OAAO;AACT;;AAGA,SAAgB,cAAkC,MAAoD;CACpG,OAAO;AACT;;AAGA,SAAgB,cAAc,MAAgC;CAC5D,OAAO;AACT;;AAGA,SAAgB,YAAgC,MAAgD;CAC9F,OAAO;AACT;;AAGA,SAAgB,aAAiC,MAAkD;CACjG,OAAO;AACT;;AAGA,SAAgB,eAAmC,MAAsD;CACvG,OAAO;AACT"}
@@ -1,105 +1,244 @@
1
- const require_headless = require("../schemas/headless.cjs");
2
- const require_serverFacet = require("../schemas/serverFacet.cjs");
3
1
  const require_index = require("../services/pluginLifecycle/index.cjs");
2
+ const require_serverScope = require("../schemas/serverScope.cjs");
3
+ const require_headless = require("../schemas/headless.cjs");
4
+ const require_serverPlugin = require("../schemas/serverPlugin.cjs");
4
5
  //#region src/extensions/serverPlugin.ts
6
+ /**
7
+ * Holds a built root's teardown for the levels that reuse it.
8
+ *
9
+ * The building level keeps the root's hooks in its own lifecycle, but each one runs only when no
10
+ * inner level still holds a lease. Otherwise the last lease to be released runs what the building
11
+ * level held back. So a reload of the building level installs the new build for itself and for every
12
+ * level that mounts from then on, while a session already running keeps the root it mounted with
13
+ * until it closes.
14
+ */
15
+ function holdRoot(built) {
16
+ let leases = 0;
17
+ let owed = {
18
+ stop: false,
19
+ dispose: false
20
+ };
21
+ let stopped = false;
22
+ let disposed = false;
23
+ const stop = async (context) => {
24
+ if (stopped) return;
25
+ stopped = true;
26
+ await built.onStop?.(context);
27
+ };
28
+ const dispose = async (context) => {
29
+ if (disposed) return;
30
+ disposed = true;
31
+ await built.onDispose?.(context);
32
+ };
33
+ return {
34
+ held: {
35
+ value: built.value,
36
+ ...built.activities === void 0 ? {} : { activities: built.activities },
37
+ acquire() {
38
+ leases += 1;
39
+ let released = false;
40
+ return async () => {
41
+ if (released) return;
42
+ released = true;
43
+ leases -= 1;
44
+ if (leases > 0 || owed.context === void 0) return;
45
+ const context = owed.context;
46
+ await require_index.runCleanups([owed.stop ? () => stop(context) : void 0, owed.dispose ? () => dispose(context) : void 0], "Shared root cleanup failed.");
47
+ };
48
+ }
49
+ },
50
+ declaration: {
51
+ ...built,
52
+ onStop: async (context) => {
53
+ owed = {
54
+ ...owed,
55
+ stop: true,
56
+ context
57
+ };
58
+ if (leases === 0) await stop(context);
59
+ },
60
+ onDispose: async (context) => {
61
+ owed = {
62
+ ...owed,
63
+ dispose: true,
64
+ context
65
+ };
66
+ if (leases === 0) await dispose(context);
67
+ }
68
+ }
69
+ };
70
+ }
71
+ const depth = (level) => require_serverScope.PO_SERVER_SCOPE_LEVELS.indexOf(level);
72
+ /** Throws for a contract listed where it cannot work, so a bad declaration fails at load, not at mount. */
73
+ function checkContracts(plugin) {
74
+ for (const level of require_serverScope.PO_SERVER_SCOPE_LEVELS) {
75
+ const provided = plugin.provides?.[level] ?? [];
76
+ if (provided.length > 0 && plugin[level] === void 0) throw new Error(`Server plugin '${plugin.name}' provides contracts at the ${level} level but declares nothing there.`);
77
+ const names = /* @__PURE__ */ new Set();
78
+ for (const contract of provided) {
79
+ if (contract.scope !== level) throw new Error(`Server plugin '${plugin.name}' lists the ${contract.scope} contract '${contract.name}' as provided at the ${level} level.`);
80
+ if (names.has(contract.name)) throw new Error(`Server plugin '${plugin.name}' provides contract '${contract.name}' twice.`);
81
+ names.add(contract.name);
82
+ }
83
+ for (const contract of plugin.injects?.[level] ?? []) if (depth(contract.scope) > depth(level)) throw new Error(`Server plugin '${plugin.name}' cannot inject the ${contract.scope} contract '${contract.name}' at the ${level} level.`);
84
+ }
85
+ }
5
86
  function defineServerPlugin(plugin) {
87
+ checkContracts(plugin);
6
88
  return {
89
+ name: plugin.name,
7
90
  ...plugin.providerOverrides ? { providerOverrides: plugin.providerOverrides } : {},
8
- inject: [.../* @__PURE__ */ new Set([require_serverFacet.DOOM_SERVER_HOST_SERVICE, ...plugin.inject ?? []])],
91
+ ...plugin.provides ? { provides: plugin.provides } : {},
92
+ ...plugin.injects ? { injects: plugin.injects } : {},
93
+ inject: [.../* @__PURE__ */ new Set([
94
+ require_serverPlugin.PO_SERVER_HOST_SERVICE,
95
+ require_serverScope.PO_SERVER_SCOPE_SERVICE,
96
+ ...plugin.inject ?? []
97
+ ])],
9
98
  async apply(context) {
10
- const host = require_serverFacet.requireDoomServerHost(context);
11
- const declaration = plugin[host.scope];
12
- if (!declaration) return;
13
- const agent = host.scope === "session" ? require_headless.readDoomHeadlessHost(context) : void 0;
14
- const lifecycle = require_index.createPluginLifecycle((signal) => ({
15
- context,
16
- host,
17
- agent,
18
- signal
19
- }));
20
- context.effect(() => () => lifecycle.dispose());
21
- const own = (registration) => {
22
- lifecycle.own(() => registration.dispose());
23
- if ("mounted" in registration && registration.mounted === false) throw new Error("Server plugin registration was refused.");
99
+ const level = require_serverPlugin.requirePoServerHost(context).scope;
100
+ const declaration = plugin[level];
101
+ if (!declaration) return void 0;
102
+ const required = (plugin.injects?.[level] ?? []).map((contract) => contract.name);
103
+ if (required.length === 0) return mount(plugin, declaration, context);
104
+ await context.inject(required, (inner) => mount(plugin, declaration, inner));
105
+ }
106
+ };
107
+ }
108
+ async function mount(owner, declaration, context) {
109
+ const host = require_serverPlugin.requirePoServerHost(context);
110
+ const level = host.scope;
111
+ const agent = level === "session" ? require_headless.readPoHeadlessHost(context) : void 0;
112
+ const share = require_serverScope.requirePoServerScope(context).plugin(owner);
113
+ /** Every root this level holds, built here or reused, for the levels inside it. */
114
+ const roots = {};
115
+ /** What this level holds of the build's shared values and outer roots, released once it has unwound. */
116
+ const leases = [];
117
+ let withdraw;
118
+ const lifecycle = require_index.createPluginLifecycle((signal) => ({
119
+ context,
120
+ host,
121
+ agent,
122
+ signal,
123
+ resources: { async acquire(key, create, dispose) {
124
+ signal.throwIfAborted();
125
+ const lease = await share.acquire(key, create, dispose);
126
+ if (signal.aborted) {
127
+ await lease.release();
128
+ signal.throwIfAborted();
129
+ }
130
+ leases.push(() => lease.release());
131
+ return lease.value;
132
+ } },
133
+ async scopeRoot(rootLevel, root, rootContext) {
134
+ const reused = share.outer(rootLevel).map((held) => held[rootLevel]).find((candidate) => candidate !== void 0);
135
+ if (reused !== void 0) {
136
+ leases.push(reused.acquire());
137
+ roots[rootLevel] = reused;
138
+ return {
139
+ value: reused.value,
140
+ ...reused.activities === void 0 ? {} : { activities: reused.activities }
141
+ };
142
+ }
143
+ const { held, declaration: owned } = holdRoot(await root(rootContext));
144
+ roots[rootLevel] = held;
145
+ return owned;
146
+ },
147
+ hosted: (from) => share.outer(from).length > 0
148
+ }));
149
+ context.effect(() => async () => {
150
+ withdraw?.();
151
+ try {
152
+ await lifecycle.dispose();
153
+ } finally {
154
+ for (const release of leases.splice(0).reverse()) try {
155
+ await release();
156
+ } catch (error) {
157
+ host.context.onNotice(`server plugin '${owner.name}' could not release a shared value (${error instanceof Error ? error.message : String(error)})`);
158
+ }
159
+ }
160
+ });
161
+ const own = (registration) => {
162
+ lifecycle.own(() => registration.dispose());
163
+ if ("mounted" in registration && registration.mounted === false) throw new Error("Server plugin registration was refused.");
164
+ };
165
+ await lifecycle.mount(() => typeof declaration === "function" ? declaration(lifecycle.context) : declaration, async (scope) => {
166
+ for (const service of scope.services ?? []) {
167
+ const fiber = context.plugin(service);
168
+ lifecycle.own(() => fiber.dispose());
169
+ await fiber;
170
+ }
171
+ for (const channel of scope.channels ?? []) own(host.registerChannel(channel()));
172
+ for (const api of scope.api ?? []) own(host.registerApi(api));
173
+ for (const method of scope.methods ?? []) own(method.register(host));
174
+ if (!agent) return;
175
+ const session = scope;
176
+ for (const restriction of session.toolRestrictions ?? []) {
177
+ if (!("restrict" in restriction)) {
178
+ own(agent.registerToolRestriction(restriction));
179
+ continue;
180
+ }
181
+ let registration;
182
+ lifecycle.own(() => {
183
+ const current = registration;
184
+ registration = void 0;
185
+ return current?.dispose();
186
+ });
187
+ const refresh = () => {
188
+ if (lifecycle.context.signal.aborted) return;
189
+ const previous = registration;
190
+ registration = void 0;
191
+ previous?.dispose();
192
+ registration = agent.registerToolRestriction(restriction.restrict());
193
+ if ("mounted" in registration && registration.mounted === false) throw new Error(`Server tool restriction ${restriction.source} was refused.`);
24
194
  };
25
- await lifecycle.mount(() => typeof declaration === "function" ? declaration(lifecycle.context) : declaration, async (scope) => {
26
- for (const service of scope.services ?? []) {
27
- const fiber = context.plugin(service);
28
- lifecycle.own(() => fiber.dispose());
29
- await fiber;
30
- }
31
- for (const channel of scope.channels ?? []) own(host.registerChannel(channel()));
32
- for (const api of scope.api ?? []) own(host.registerApi(api));
33
- for (const method of scope.methods ?? []) own(method.register(host));
34
- if (!agent) return;
35
- const session = scope;
36
- for (const restriction of session.toolRestrictions ?? []) {
37
- if (!("restrict" in restriction)) {
38
- own(agent.registerToolRestriction(restriction));
39
- continue;
40
- }
41
- let registration;
42
- lifecycle.own(() => {
43
- const current = registration;
44
- registration = void 0;
45
- return current?.dispose();
195
+ refresh();
196
+ const unsubscribe = restriction.subscribe?.(refresh);
197
+ if (unsubscribe) lifecycle.own(unsubscribe);
198
+ }
199
+ for (const resource of session.resources ?? []) if (resource !== void 0) own(agent.registerResource(resource));
200
+ for (const tool of session.tools ?? []) if ("kind" in tool) own(agent.registerTool({
201
+ ...tool,
202
+ async execute(toolCallId, input, signal, update, execution) {
203
+ const invocationSignal = signal ? AbortSignal.any([signal, lifecycle.context.signal]) : lifecycle.context.signal;
204
+ invocationSignal.throwIfAborted();
205
+ try {
206
+ return await tool.execute(input, {
207
+ toolCallId,
208
+ signal: invocationSignal,
209
+ cwd: execution.cwd,
210
+ update: (result) => update?.(result),
211
+ notify: (request) => execution.client.notify(request)
46
212
  });
47
- const refresh = () => {
48
- if (lifecycle.context.signal.aborted) return;
49
- const previous = registration;
50
- registration = void 0;
51
- previous?.dispose();
52
- registration = agent.registerToolRestriction(restriction.restrict());
53
- if ("mounted" in registration && registration.mounted === false) throw new Error(`Server tool restriction ${restriction.source} was refused.`);
213
+ } catch (error) {
214
+ return {
215
+ content: [{
216
+ type: "text",
217
+ text: error instanceof Error ? error.message : String(error)
218
+ }],
219
+ isError: true
54
220
  };
55
- refresh();
56
- const unsubscribe = restriction.subscribe?.(refresh);
57
- if (unsubscribe) lifecycle.own(unsubscribe);
58
221
  }
59
- for (const resource of session.resources ?? []) if (resource !== void 0) own(agent.registerResource(resource));
60
- for (const tool of session.tools ?? []) if ("kind" in tool) own(agent.registerTool({
61
- ...tool,
62
- async execute(toolCallId, input, signal, update, execution) {
63
- const invocationSignal = signal ? AbortSignal.any([signal, lifecycle.context.signal]) : lifecycle.context.signal;
64
- invocationSignal.throwIfAborted();
65
- try {
66
- return await tool.execute(input, {
67
- toolCallId,
68
- signal: invocationSignal,
69
- cwd: execution.cwd,
70
- update: (result) => update?.(result),
71
- notify: (request) => execution.client.notify(request)
72
- });
73
- } catch (error) {
74
- return {
75
- content: [{
76
- type: "text",
77
- text: error instanceof Error ? error.message : String(error)
78
- }],
79
- isError: true
80
- };
81
- }
82
- }
83
- }));
84
- else own(agent.registerTool(tool));
85
- for (const command of session.commands ?? []) if ("kind" in command) own(agent.registerCommand({
86
- ...command,
87
- execute: (args, execution) => {
88
- lifecycle.context.signal.throwIfAborted();
89
- return command.execute(args, {
90
- cwd: execution.cwd,
91
- signal: lifecycle.context.signal,
92
- notify: (request) => execution.client.notify(request)
93
- });
94
- }
95
- }));
96
- else own(agent.registerCommand(command));
97
- for (const hook of session.hooks ?? []) own(agent.registerHook(hook));
98
- for (const activity of session.activities ?? []) own(agent.registerActivity(activity));
99
- });
100
- return () => lifecycle.dispose();
101
- }
102
- };
222
+ }
223
+ }));
224
+ else own(agent.registerTool(tool));
225
+ for (const command of session.commands ?? []) if ("kind" in command) own(agent.registerCommand({
226
+ ...command,
227
+ execute: (args, execution) => {
228
+ lifecycle.context.signal.throwIfAborted();
229
+ return command.execute(args, {
230
+ cwd: execution.cwd,
231
+ signal: lifecycle.context.signal,
232
+ notify: (request) => execution.client.notify(request)
233
+ });
234
+ }
235
+ }));
236
+ else own(agent.registerCommand(command));
237
+ for (const hook of session.hooks ?? []) own(agent.registerHook(hook));
238
+ for (const activity of session.activities ?? []) own(agent.registerActivity(activity));
239
+ });
240
+ if (level !== "session") withdraw = share.run(roots);
241
+ return () => lifecycle.dispose();
103
242
  }
104
243
  //#endregion
105
244
  exports.defineServerPlugin = defineServerPlugin;
@@ -1 +1 @@
1
- {"version":3,"file":"serverPlugin.cjs","names":["DOOM_SERVER_HOST_SERVICE","requireDoomServerHost","readDoomHeadlessHost","createPluginLifecycle"],"sources":["../../../src/extensions/serverPlugin.ts"],"sourcesContent":["import { readDoomHeadlessHost } from '../schemas/headless';\nimport {\n DOOM_SERVER_HOST_SERVICE,\n requireDoomServerHost,\n type DoomServerFacet,\n type DoomServerPluginDefinition,\n type DoomServerPluginContext,\n type DoomServerSessionPlugin,\n} from '../schemas/serverFacet';\nimport { createPluginLifecycle } from '../services/pluginLifecycle';\n\nexport function defineServerPlugin(plugin: DoomServerPluginDefinition): DoomServerFacet {\n return {\n ...(plugin.providerOverrides ? { providerOverrides: plugin.providerOverrides } : {}),\n inject: [...new Set([DOOM_SERVER_HOST_SERVICE, ...(plugin.inject ?? [])])],\n async apply(context) {\n const host = requireDoomServerHost(context);\n const declaration = plugin[host.scope];\n if (!declaration) return;\n const agent = host.scope === 'session' ? readDoomHeadlessHost(context) : undefined;\n const lifecycle = createPluginLifecycle<DoomServerPluginContext>((signal) => ({ context, host, agent, signal }));\n context.effect(() => () => lifecycle.dispose());\n const own = <T extends { dispose(): void | Promise<void>; mounted?: boolean }>(registration: T): void => {\n lifecycle.own(() => registration.dispose());\n if ('mounted' in registration && registration.mounted === false)\n throw new Error('Server plugin registration was refused.');\n };\n await lifecycle.mount(\n () => (typeof declaration === 'function' ? declaration(lifecycle.context) : declaration),\n async (scope) => {\n for (const service of scope.services ?? []) {\n const fiber = context.plugin(service);\n lifecycle.own(() => fiber.dispose());\n await fiber;\n }\n for (const channel of scope.channels ?? []) own(host.registerChannel(channel()));\n for (const api of scope.api ?? []) own(host.registerApi(api));\n for (const method of scope.methods ?? []) own(method.register(host));\n if (!agent) return;\n const session: DoomServerSessionPlugin = scope;\n for (const restriction of session.toolRestrictions ?? []) {\n if (!('restrict' in restriction)) {\n own(agent.registerToolRestriction(restriction));\n continue;\n }\n let registration: ReturnType<typeof agent.registerToolRestriction> | undefined;\n lifecycle.own(() => {\n const current = registration;\n registration = undefined;\n return current?.dispose();\n });\n const refresh = (): void => {\n if (lifecycle.context.signal.aborted) return;\n const previous = registration;\n registration = undefined;\n previous?.dispose();\n registration = agent.registerToolRestriction(restriction.restrict());\n if ('mounted' in registration && registration.mounted === false)\n throw new Error(`Server tool restriction ${restriction.source} was refused.`);\n };\n refresh();\n const unsubscribe = restriction.subscribe?.(refresh);\n if (unsubscribe) lifecycle.own(unsubscribe);\n }\n for (const resource of session.resources ?? []) {\n // Generated optional and many-valued contributions can leave an undefined\n // member when a package has no resource for the current runtime.\n if (resource !== undefined) own(agent.registerResource(resource));\n }\n for (const tool of session.tools ?? []) {\n if ('kind' in tool) {\n own(\n agent.registerTool({\n ...tool,\n async execute(toolCallId, input, signal, update, execution) {\n const invocationSignal = signal\n ? AbortSignal.any([signal, lifecycle.context.signal])\n : lifecycle.context.signal;\n invocationSignal.throwIfAborted();\n try {\n return await tool.execute(input, {\n toolCallId,\n signal: invocationSignal,\n cwd: execution.cwd,\n update: (result) => update?.(result),\n notify: (request) => execution.client.notify(request),\n });\n } catch (error) {\n return {\n content: [{ type: 'text', text: error instanceof Error ? error.message : String(error) }],\n isError: true,\n };\n }\n },\n }),\n );\n } else own(agent.registerTool(tool));\n }\n for (const command of session.commands ?? []) {\n if ('kind' in command) {\n own(\n agent.registerCommand({\n ...command,\n execute: (args, execution) => {\n lifecycle.context.signal.throwIfAborted();\n return command.execute(args, {\n cwd: execution.cwd,\n signal: lifecycle.context.signal,\n notify: (request) => execution.client.notify(request),\n });\n },\n }),\n );\n } else own(agent.registerCommand(command));\n }\n for (const hook of session.hooks ?? []) own(agent.registerHook(hook));\n for (const activity of session.activities ?? []) own(agent.registerActivity(activity));\n },\n );\n return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QACxF,SAAS;OACX;MACF;KACF;IACF,CAAC,CACH;SACK,IAAI,MAAM,aAAa,IAAI,CAAC;IAErC,KAAK,MAAM,WAAW,QAAQ,YAAY,CAAC,GACzC,IAAI,UAAU,SACZ,IACE,MAAM,gBAAgB;KACpB,GAAG;KACH,UAAU,MAAM,cAAc;MAC5B,UAAU,QAAQ,OAAO,eAAe;MACxC,OAAO,QAAQ,QAAQ,MAAM;OAC3B,KAAK,UAAU;OACf,QAAQ,UAAU,QAAQ;OAC1B,SAAS,YAAY,UAAU,OAAO,OAAO,OAAO;MACtD,CAAC;KACH;IACF,CAAC,CACH;SACK,IAAI,MAAM,gBAAgB,OAAO,CAAC;IAE3C,KAAK,MAAM,QAAQ,QAAQ,SAAS,CAAC,GAAG,IAAI,MAAM,aAAa,IAAI,CAAC;IACpE,KAAK,MAAM,YAAY,QAAQ,cAAc,CAAC,GAAG,IAAI,MAAM,iBAAiB,QAAQ,CAAC;GACvF,CACF;GACA,aAAa,UAAU,QAAQ;EACjC;CACF;AACF"}
1
+ {"version":3,"file":"serverPlugin.cjs","names":["runCleanups","PO_SERVER_SCOPE_LEVELS","PO_SERVER_HOST_SERVICE","PO_SERVER_SCOPE_SERVICE","requirePoServerHost","readPoHeadlessHost","requirePoServerScope","createPluginLifecycle"],"sources":["../../../src/extensions/serverPlugin.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis';\n\nimport type { RootDeclaration } from '../schemas/extensionFile';\nimport { readPoHeadlessHost } from '../schemas/headless';\nimport type { PoApiScope } from '../schemas/packageApi';\nimport {\n PO_SERVER_HOST_SERVICE,\n requirePoServerHost,\n type PoServerPlugin,\n type PoServerPluginDefinition,\n type PoServerPluginContext,\n type PoServerSessionPlugin,\n} from '../schemas/serverPlugin';\nimport { PO_SERVER_SCOPE_LEVELS, PO_SERVER_SCOPE_SERVICE, requirePoServerScope } from '../schemas/serverScope';\nimport { createPluginLifecycle, runCleanups } from '../services/pluginLifecycle';\n\n/** A root one level built, as the levels inside it reuse it. */\ninterface HeldRoot {\n readonly value: unknown;\n readonly activities?: RootDeclaration<unknown>['activities'];\n /** Takes a lease; the root's own stop and dispose hooks wait until every lease is released. */\n acquire(): () => Promise<void>;\n}\n\n/** What a level running a plugin build holds for the levels inside it: every root it built or reused. */\ntype LevelRoots = Partial<Record<PoApiScope, HeldRoot>>;\n\n/**\n * Holds a built root's teardown for the levels that reuse it.\n *\n * The building level keeps the root's hooks in its own lifecycle, but each one runs only when no\n * inner level still holds a lease. Otherwise the last lease to be released runs what the building\n * level held back. So a reload of the building level installs the new build for itself and for every\n * level that mounts from then on, while a session already running keeps the root it mounted with\n * until it closes.\n */\nfunction holdRoot<TValue, TContext>(\n built: RootDeclaration<TValue, TContext>,\n): { readonly held: HeldRoot; readonly declaration: RootDeclaration<TValue, TContext> } {\n let leases = 0;\n let owed: { stop: boolean; dispose: boolean; context?: TContext } = { stop: false, dispose: false };\n let stopped = false;\n let disposed = false;\n const stop = async (context: TContext): Promise<void> => {\n if (stopped) return;\n stopped = true;\n await built.onStop?.(context);\n };\n const dispose = async (context: TContext): Promise<void> => {\n if (disposed) return;\n disposed = true;\n await built.onDispose?.(context);\n };\n const held: HeldRoot = {\n value: built.value,\n ...(built.activities === undefined ? {} : { activities: built.activities }),\n acquire() {\n leases += 1;\n let released = false;\n return async () => {\n if (released) return;\n released = true;\n leases -= 1;\n if (leases > 0 || owed.context === undefined) return;\n const context = owed.context;\n await runCleanups(\n [owed.stop ? () => stop(context) : undefined, owed.dispose ? () => dispose(context) : undefined],\n 'Shared root cleanup failed.',\n );\n };\n },\n };\n return {\n held,\n declaration: {\n ...built,\n onStop: async (context) => {\n owed = { ...owed, stop: true, context };\n if (leases === 0) await stop(context);\n },\n onDispose: async (context) => {\n owed = { ...owed, dispose: true, context };\n if (leases === 0) await dispose(context);\n },\n },\n };\n}\n\nconst depth = (level: PoApiScope): number => PO_SERVER_SCOPE_LEVELS.indexOf(level);\n\n/** Throws for a contract listed where it cannot work, so a bad declaration fails at load, not at mount. */\nfunction checkContracts(plugin: PoServerPluginDefinition): void {\n for (const level of PO_SERVER_SCOPE_LEVELS) {\n const provided = plugin.provides?.[level] ?? [];\n if (provided.length > 0 && plugin[level] === undefined)\n throw new Error(\n `Server plugin '${plugin.name}' provides contracts at the ${level} level but declares nothing there.`,\n );\n const names = new Set<string>();\n for (const contract of provided) {\n if (contract.scope !== level)\n throw new Error(\n `Server plugin '${plugin.name}' lists the ${contract.scope} contract '${contract.name}' as provided at the ${level} level.`,\n );\n if (names.has(contract.name))\n throw new Error(`Server plugin '${plugin.name}' provides contract '${contract.name}' twice.`);\n names.add(contract.name);\n }\n for (const contract of plugin.injects?.[level] ?? []) {\n if (depth(contract.scope) > depth(level))\n throw new Error(\n `Server plugin '${plugin.name}' cannot inject the ${contract.scope} contract '${contract.name}' at the ${level} level.`,\n );\n }\n }\n}\n\nexport function defineServerPlugin(plugin: PoServerPluginDefinition): PoServerPlugin {\n checkContracts(plugin);\n return {\n name: plugin.name,\n ...(plugin.providerOverrides ? { providerOverrides: plugin.providerOverrides } : {}),\n ...(plugin.provides ? { provides: plugin.provides } : {}),\n ...(plugin.injects ? { injects: plugin.injects } : {}),\n inject: [...new Set([PO_SERVER_HOST_SERVICE, PO_SERVER_SCOPE_SERVICE, ...(plugin.inject ?? [])])],\n async apply(context) {\n const level = requirePoServerHost(context).scope;\n const declaration = plugin[level];\n if (!declaration) return undefined;\n // What an outer level running this build holds is read once, when this level mounts, and what\n // this level reuses from it is leased, so that level reloading never pulls a root from under a\n // running session. The contracts this level injects it waits for, and restarts with.\n const required = (plugin.injects?.[level] ?? []).map((contract) => contract.name);\n if (required.length === 0) return mount(plugin, declaration, context);\n // The inner fiber belongs to this one, so it unwinds with it.\n await context.inject(required, (inner) => mount(plugin, declaration, inner));\n return undefined;\n },\n };\n}\n\nasync function mount(\n owner: PoServerPluginDefinition,\n declaration: NonNullable<PoServerPluginDefinition[PoApiScope]>,\n context: Context,\n): Promise<() => Promise<void>> {\n const host = requirePoServerHost(context);\n const level = host.scope;\n const agent = level === 'session' ? readPoHeadlessHost(context) : undefined;\n // The definition object is the build: a reload imports a new module, and so a new store.\n const share = requirePoServerScope(context).plugin<LevelRoots>(owner);\n /** Every root this level holds, built here or reused, for the levels inside it. */\n const roots: LevelRoots = {};\n /** What this level holds of the build's shared values and outer roots, released once it has unwound. */\n const leases: (() => Promise<void>)[] = [];\n let withdraw: (() => void) | undefined;\n const lifecycle = createPluginLifecycle<PoServerPluginContext>((signal) => ({\n context,\n host,\n agent,\n signal,\n resources: {\n async acquire(key, create, dispose) {\n signal.throwIfAborted();\n const lease = await share.acquire(key, create, dispose);\n if (signal.aborted) {\n // This level unwound while the value was created, so it keeps no share of it.\n await lease.release();\n signal.throwIfAborted();\n }\n leases.push(() => lease.release());\n return lease.value;\n },\n },\n async scopeRoot(rootLevel, root, rootContext) {\n // The innermost outer level holding this root built it, or reused it from further out.\n const reused = share\n .outer(rootLevel)\n .map((held) => held[rootLevel])\n .find((candidate) => candidate !== undefined);\n if (reused !== undefined) {\n leases.push(reused.acquire());\n roots[rootLevel] = reused;\n return {\n value: reused.value as Awaited<ReturnType<typeof root>>['value'],\n ...(reused.activities === undefined ? {} : { activities: reused.activities }),\n };\n }\n const { held, declaration: owned } = holdRoot(await root(rootContext));\n roots[rootLevel] = held;\n return owned;\n },\n hosted: (from) => share.outer(from).length > 0,\n }));\n context.effect(() => async () => {\n // First, so no level mounting from here on reuses what this one is about to tear down.\n withdraw?.();\n try {\n await lifecycle.dispose();\n } finally {\n // Last, so a value or an outer root this level holds outlives everything here that could use it.\n for (const release of leases.splice(0).reverse()) {\n try {\n await release();\n } catch (error) {\n host.context.onNotice(\n `server plugin '${owner.name}' could not release a shared value (${error instanceof Error ? error.message : String(error)})`,\n );\n }\n }\n }\n });\n const own = <T extends { dispose(): void | Promise<void>; mounted?: boolean }>(registration: T): void => {\n lifecycle.own(() => registration.dispose());\n if ('mounted' in registration && registration.mounted === false)\n throw new Error('Server plugin registration was refused.');\n };\n await lifecycle.mount(\n () => (typeof declaration === 'function' ? declaration(lifecycle.context) : declaration),\n async (scope) => {\n for (const service of scope.services ?? []) {\n const fiber = context.plugin(service);\n lifecycle.own(() => fiber.dispose());\n await fiber;\n }\n for (const channel of scope.channels ?? []) own(host.registerChannel(channel()));\n for (const api of scope.api ?? []) own(host.registerApi(api));\n for (const method of scope.methods ?? []) own(method.register(host));\n if (!agent) return;\n const session: PoServerSessionPlugin = scope;\n for (const restriction of session.toolRestrictions ?? []) {\n if (!('restrict' in restriction)) {\n own(agent.registerToolRestriction(restriction));\n continue;\n }\n let registration: ReturnType<typeof agent.registerToolRestriction> | undefined;\n lifecycle.own(() => {\n const current = registration;\n registration = undefined;\n return current?.dispose();\n });\n const refresh = (): void => {\n if (lifecycle.context.signal.aborted) return;\n const previous = registration;\n registration = undefined;\n previous?.dispose();\n registration = agent.registerToolRestriction(restriction.restrict());\n if ('mounted' in registration && registration.mounted === false)\n throw new Error(`Server tool restriction ${restriction.source} was refused.`);\n };\n refresh();\n const unsubscribe = restriction.subscribe?.(refresh);\n if (unsubscribe) lifecycle.own(unsubscribe);\n }\n for (const resource of session.resources ?? []) {\n // Generated optional and many-valued contributions can leave an undefined\n // member when a package has no resource for the current runtime.\n if (resource !== undefined) own(agent.registerResource(resource));\n }\n for (const tool of session.tools ?? []) {\n if ('kind' in tool) {\n own(\n agent.registerTool({\n ...tool,\n async execute(toolCallId, input, signal, update, execution) {\n const invocationSignal = signal\n ? AbortSignal.any([signal, lifecycle.context.signal])\n : lifecycle.context.signal;\n invocationSignal.throwIfAborted();\n try {\n return await tool.execute(input, {\n toolCallId,\n signal: invocationSignal,\n cwd: execution.cwd,\n update: (result) => update?.(result),\n notify: (request) => execution.client.notify(request),\n });\n } catch (error) {\n return {\n content: [{ type: 'text', text: error instanceof Error ? error.message : String(error) }],\n isError: true,\n };\n }\n },\n }),\n );\n } else own(agent.registerTool(tool));\n }\n for (const command of session.commands ?? []) {\n if ('kind' in command) {\n own(\n agent.registerCommand({\n ...command,\n execute: (args, execution) => {\n lifecycle.context.signal.throwIfAborted();\n return command.execute(args, {\n cwd: execution.cwd,\n signal: lifecycle.context.signal,\n notify: (request) => execution.client.notify(request),\n });\n },\n }),\n );\n } else own(agent.registerCommand(command));\n }\n for (const hook of session.hooks ?? []) own(agent.registerHook(hook));\n for (const activity of session.activities ?? []) own(agent.registerActivity(activity));\n },\n );\n // Published once mounted, so a level inside this one reuses its roots instead of building them again.\n if (level !== 'session') withdraw = share.run(roots);\n return () => lifecycle.dispose();\n}\n"],"mappings":";;;;;;;;;;;;;;AAoCA,SAAS,SACP,OACsF;CACtF,IAAI,SAAS;CACb,IAAI,OAAgE;EAAE,MAAM;EAAO,SAAS;CAAM;CAClG,IAAI,UAAU;CACd,IAAI,WAAW;CACf,MAAM,OAAO,OAAO,YAAqC;EACvD,IAAI,SAAS;EACb,UAAU;EACV,MAAM,MAAM,SAAS,OAAO;CAC9B;CACA,MAAM,UAAU,OAAO,YAAqC;EAC1D,IAAI,UAAU;EACd,WAAW;EACX,MAAM,MAAM,YAAY,OAAO;CACjC;CAoBA,OAAO;EACL,MAAA;GAnBA,OAAO,MAAM;GACb,GAAI,MAAM,eAAe,KAAA,IAAY,CAAC,IAAI,EAAE,YAAY,MAAM,WAAW;GACzE,UAAU;IACR,UAAU;IACV,IAAI,WAAW;IACf,OAAO,YAAY;KACjB,IAAI,UAAU;KACd,WAAW;KACX,UAAU;KACV,IAAI,SAAS,KAAK,KAAK,YAAY,KAAA,GAAW;KAC9C,MAAM,UAAU,KAAK;KACrB,MAAMA,cAAAA,YACJ,CAAC,KAAK,aAAa,KAAK,OAAO,IAAI,KAAA,GAAW,KAAK,gBAAgB,QAAQ,OAAO,IAAI,KAAA,CAAS,GAC/F,6BACF;IACF;GACF;EAGG;EACH,aAAa;GACX,GAAG;GACH,QAAQ,OAAO,YAAY;IACzB,OAAO;KAAE,GAAG;KAAM,MAAM;KAAM;IAAQ;IACtC,IAAI,WAAW,GAAG,M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AAS,YAAY,UAAU,OAAO,OAAO,OAAO;KACtD,CAAC;IACH,SAAS,OAAO;KACd,OAAO;MACL,SAAS,CAAC;OAAE,MAAM;OAAQ,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;MAAE,CAAC;MACxF,SAAS;KACX;IACF;GACF;EACF,CAAC,CACH;OACK,IAAI,MAAM,aAAa,IAAI,CAAC;EAErC,KAAK,MAAM,WAAW,QAAQ,YAAY,CAAC,GACzC,IAAI,UAAU,SACZ,IACE,MAAM,gBAAgB;GACpB,GAAG;GACH,UAAU,MAAM,cAAc;IAC5B,UAAU,QAAQ,OAAO,eAAe;IACxC,OAAO,QAAQ,QAAQ,MAAM;KAC3B,KAAK,UAAU;KACf,QAAQ,UAAU,QAAQ;KAC1B,SAAS,YAAY,UAAU,OAAO,OAAO,OAAO;IACtD,CAAC;GACH;EACF,CAAC,CACH;OACK,IAAI,MAAM,gBAAgB,OAAO,CAAC;EAE3C,KAAK,MAAM,QAAQ,QAAQ,SAAS,CAAC,GAAG,IAAI,MAAM,aAAa,IAAI,CAAC;EACpE,KAAK,MAAM,YAAY,QAAQ,cAAc,CAAC,GAAG,IAAI,MAAM,iBAAiB,QAAQ,CAAC;CACvF,CACF;CAEA,IAAI,UAAU,WAAW,WAAW,MAAM,IAAI,KAAK;CACnD,aAAa,UAAU,QAAQ;AACjC"}
@@ -1,5 +1,5 @@
1
- import { DoomServerFacet, DoomServerPluginDefinition } from "../schemas/serverFacet.mjs";
1
+ import { PoServerPlugin, PoServerPluginDefinition } from "../schemas/serverPlugin.mjs";
2
2
  //#region src/extensions/serverPlugin.d.ts
3
- export declare function defineServerPlugin(plugin: DoomServerPluginDefinition): DoomServerFacet;
3
+ export declare function defineServerPlugin(plugin: PoServerPluginDefinition): PoServerPlugin;
4
4
  //#endregion
5
5
  //# sourceMappingURL=serverPlugin.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serverPlugin.d.mts","names":[],"sources":["../../../src/extensions/serverPlugin.ts"],"mappings":";;wBAWgB,mBAAmB,QAAQ,6BAA6B"}
1
+ {"version":3,"file":"serverPlugin.d.mts","names":[],"sources":["../../../src/extensions/serverPlugin.ts"],"mappings":";;wBAqHgB,mBAAmB,QAAQ,2BAA2B"}