@agimon-ai/doompi-core 0.0.1-alpha.100

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 (1233) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +5 -0
  3. package/dist/_virtual/_rolldown/runtime.cjs +23 -0
  4. package/dist/agentModel.cjs +4 -0
  5. package/dist/agentModel.d.mts +2 -0
  6. package/dist/agentModel.mjs +2 -0
  7. package/dist/apiContracts.cjs +2009 -0
  8. package/dist/apiContracts.cjs.map +1 -0
  9. package/dist/apiContracts.d.mts +1018 -0
  10. package/dist/apiContracts.d.mts.map +1 -0
  11. package/dist/apiContracts.mjs +1989 -0
  12. package/dist/apiContracts.mjs.map +1 -0
  13. package/dist/askUser.cjs +8 -0
  14. package/dist/askUser.d.mts +2 -0
  15. package/dist/askUser.mjs +2 -0
  16. package/dist/authorTools.cjs +5 -0
  17. package/dist/authorTools.d.mts +2 -0
  18. package/dist/authorTools.mjs +2 -0
  19. package/dist/backgroundWork.cjs +7 -0
  20. package/dist/backgroundWork.d.mts +2 -0
  21. package/dist/backgroundWork.mjs +2 -0
  22. package/dist/bundleAssetPolicy.cjs +5 -0
  23. package/dist/bundleAssetPolicy.d.mts +2 -0
  24. package/dist/bundleAssetPolicy.mjs +2 -0
  25. package/dist/childProcess.cjs +15 -0
  26. package/dist/childProcess.d.mts +2 -0
  27. package/dist/childProcess.mjs +2 -0
  28. package/dist/childSession.cjs +8 -0
  29. package/dist/childSession.d.mts +3 -0
  30. package/dist/childSession.mjs +3 -0
  31. package/dist/cockpitContainer.cjs +4 -0
  32. package/dist/cockpitContainer.d.mts +2 -0
  33. package/dist/cockpitContainer.mjs +2 -0
  34. package/dist/config.cjs +13 -0
  35. package/dist/config.d.mts +3 -0
  36. package/dist/config.mjs +2 -0
  37. package/dist/contextApi.cjs +10 -0
  38. package/dist/contextApi.d.mts +4 -0
  39. package/dist/contextApi.mjs +3 -0
  40. package/dist/contextContributions.cjs +7 -0
  41. package/dist/contextContributions.d.mts +3 -0
  42. package/dist/contextContributions.mjs +3 -0
  43. package/dist/contextDetail.cjs +65 -0
  44. package/dist/contextDetail.cjs.map +1 -0
  45. package/dist/contextDetail.d.mts +19 -0
  46. package/dist/contextDetail.d.mts.map +1 -0
  47. package/dist/contextDetail.mjs +64 -0
  48. package/dist/contextDetail.mjs.map +1 -0
  49. package/dist/contextDetailStore.cjs +100 -0
  50. package/dist/contextDetailStore.cjs.map +1 -0
  51. package/dist/contextDetailStore.d.mts +19 -0
  52. package/dist/contextDetailStore.d.mts.map +1 -0
  53. package/dist/contextDetailStore.mjs +91 -0
  54. package/dist/contextDetailStore.mjs.map +1 -0
  55. package/dist/contextProjection.cjs +121 -0
  56. package/dist/contextProjection.cjs.map +1 -0
  57. package/dist/contextProjection.d.mts +130 -0
  58. package/dist/contextProjection.d.mts.map +1 -0
  59. package/dist/contextProjection.mjs +117 -0
  60. package/dist/contextProjection.mjs.map +1 -0
  61. package/dist/cordisHost.cjs +11 -0
  62. package/dist/cordisHost.d.mts +2 -0
  63. package/dist/cordisHost.mjs +2 -0
  64. package/dist/delegation.cjs +18 -0
  65. package/dist/delegation.d.mts +2 -0
  66. package/dist/delegation.mjs +2 -0
  67. package/dist/doomPackage.cjs +61 -0
  68. package/dist/doomPackage.cjs.map +1 -0
  69. package/dist/doomPackage.d.mts +17 -0
  70. package/dist/doomPackage.d.mts.map +1 -0
  71. package/dist/doomPackage.mjs +54 -0
  72. package/dist/doomPackage.mjs.map +1 -0
  73. package/dist/executionBudget.cjs +231 -0
  74. package/dist/executionBudget.cjs.map +1 -0
  75. package/dist/executionBudget.d.mts +11 -0
  76. package/dist/executionBudget.d.mts.map +1 -0
  77. package/dist/executionBudget.mjs +225 -0
  78. package/dist/executionBudget.mjs.map +1 -0
  79. package/dist/extensionFile.cjs +24 -0
  80. package/dist/extensionFile.d.mts +3 -0
  81. package/dist/extensionFile.mjs +2 -0
  82. package/dist/footer.cjs +6 -0
  83. package/dist/footer.d.mts +2 -0
  84. package/dist/footer.mjs +2 -0
  85. package/dist/headless.cjs +9 -0
  86. package/dist/headless.d.mts +2 -0
  87. package/dist/headless.mjs +2 -0
  88. package/dist/headlessHub.cjs +914 -0
  89. package/dist/headlessHub.cjs.map +1 -0
  90. package/dist/headlessHub.d.mts +157 -0
  91. package/dist/headlessHub.d.mts.map +1 -0
  92. package/dist/headlessHub.mjs +911 -0
  93. package/dist/headlessHub.mjs.map +1 -0
  94. package/dist/headlessServer.cjs +910 -0
  95. package/dist/headlessServer.cjs.map +1 -0
  96. package/dist/headlessServer.d.mts +64 -0
  97. package/dist/headlessServer.d.mts.map +1 -0
  98. package/dist/headlessServer.mjs +904 -0
  99. package/dist/headlessServer.mjs.map +1 -0
  100. package/dist/headlessSessionHost.cjs +0 -0
  101. package/dist/headlessSessionHost.d.mts +71 -0
  102. package/dist/headlessSessionHost.d.mts.map +1 -0
  103. package/dist/headlessSessionHost.mjs +1 -0
  104. package/dist/headlessSessionManager.cjs +51 -0
  105. package/dist/headlessSessionManager.cjs.map +1 -0
  106. package/dist/headlessSessionManager.d.mts +6 -0
  107. package/dist/headlessSessionManager.d.mts.map +1 -0
  108. package/dist/headlessSessionManager.mjs +50 -0
  109. package/dist/headlessSessionManager.mjs.map +1 -0
  110. package/dist/help.cjs +24 -0
  111. package/dist/help.d.mts +3 -0
  112. package/dist/help.mjs +3 -0
  113. package/dist/history.cjs +25 -0
  114. package/dist/history.d.mts +10 -0
  115. package/dist/history.mjs +10 -0
  116. package/dist/historyImport.cjs +553 -0
  117. package/dist/historyImport.cjs.map +1 -0
  118. package/dist/historyImport.d.mts +76 -0
  119. package/dist/historyImport.d.mts.map +1 -0
  120. package/dist/historyImport.mjs +547 -0
  121. package/dist/historyImport.mjs.map +1 -0
  122. package/dist/historyOwnership.cjs +253 -0
  123. package/dist/historyOwnership.cjs.map +1 -0
  124. package/dist/historyOwnership.d.mts +23 -0
  125. package/dist/historyOwnership.d.mts.map +1 -0
  126. package/dist/historyOwnership.mjs +247 -0
  127. package/dist/historyOwnership.mjs.map +1 -0
  128. package/dist/hubChannel.cjs +4 -0
  129. package/dist/hubChannel.d.mts +2 -0
  130. package/dist/hubChannel.mjs +2 -0
  131. package/dist/index.cjs +44 -0
  132. package/dist/index.d.mts +6 -0
  133. package/dist/index.mjs +6 -0
  134. package/dist/json.cjs +6 -0
  135. package/dist/json.d.mts +2 -0
  136. package/dist/json.mjs +2 -0
  137. package/dist/jsonlSessionRepo.cjs +217 -0
  138. package/dist/jsonlSessionRepo.cjs.map +1 -0
  139. package/dist/jsonlSessionRepo.d.mts +7 -0
  140. package/dist/jsonlSessionRepo.d.mts.map +1 -0
  141. package/dist/jsonlSessionRepo.mjs +212 -0
  142. package/dist/jsonlSessionRepo.mjs.map +1 -0
  143. package/dist/kernel.cjs +3 -0
  144. package/dist/kernel.d.mts +3 -0
  145. package/dist/kernel.mjs +2 -0
  146. package/dist/leader.cjs +9 -0
  147. package/dist/leader.d.mts +2 -0
  148. package/dist/leader.mjs +2 -0
  149. package/dist/logSinkTelemetry.cjs +5 -0
  150. package/dist/logSinkTelemetry.d.mts +2 -0
  151. package/dist/logSinkTelemetry.mjs +2 -0
  152. package/dist/machineApi.cjs +92 -0
  153. package/dist/machineApi.cjs.map +1 -0
  154. package/dist/machineApi.d.mts +7 -0
  155. package/dist/machineApi.d.mts.map +1 -0
  156. package/dist/machineApi.mjs +88 -0
  157. package/dist/machineApi.mjs.map +1 -0
  158. package/dist/main.cjs +11 -0
  159. package/dist/main.d.mts +5 -0
  160. package/dist/main.mjs +4 -0
  161. package/dist/mcpFacet.cjs +12 -0
  162. package/dist/mcpFacet.d.mts +4 -0
  163. package/dist/mcpFacet.mjs +4 -0
  164. package/dist/mcpProjection.cjs +16 -0
  165. package/dist/mcpProjection.d.mts +2 -0
  166. package/dist/mcpProjection.mjs +2 -0
  167. package/dist/mcpSchemaCost.cjs +195 -0
  168. package/dist/mcpSchemaCost.cjs.map +1 -0
  169. package/dist/mcpSchemaCost.d.mts +35 -0
  170. package/dist/mcpSchemaCost.d.mts.map +1 -0
  171. package/dist/mcpSchemaCost.mjs +190 -0
  172. package/dist/mcpSchemaCost.mjs.map +1 -0
  173. package/dist/mcpSession.cjs +9 -0
  174. package/dist/mcpSession.d.mts +2 -0
  175. package/dist/mcpSession.mjs +2 -0
  176. package/dist/mcpStatus.cjs +7 -0
  177. package/dist/mcpStatus.d.mts +2 -0
  178. package/dist/mcpStatus.mjs +2 -0
  179. package/dist/mcpToolResolver.cjs +5 -0
  180. package/dist/mcpToolResolver.d.mts +2 -0
  181. package/dist/mcpToolResolver.mjs +2 -0
  182. package/dist/mcpWidget.cjs +0 -0
  183. package/dist/mcpWidget.d.mts +2 -0
  184. package/dist/mcpWidget.mjs +1 -0
  185. package/dist/moduleResolution.cjs +405 -0
  186. package/dist/moduleResolution.cjs.map +1 -0
  187. package/dist/moduleResolution.d.mts +67 -0
  188. package/dist/moduleResolution.d.mts.map +1 -0
  189. package/dist/moduleResolution.mjs +389 -0
  190. package/dist/moduleResolution.mjs.map +1 -0
  191. package/dist/narration.cjs +10 -0
  192. package/dist/narration.d.mts +2 -0
  193. package/dist/narration.mjs +2 -0
  194. package/dist/notification.cjs +17 -0
  195. package/dist/notification.d.mts +2 -0
  196. package/dist/notification.mjs +2 -0
  197. package/dist/packageApi.cjs +16 -0
  198. package/dist/packageApi.d.mts +3 -0
  199. package/dist/packageApi.mjs +3 -0
  200. package/dist/packageApiServer.cjs +191 -0
  201. package/dist/packageApiServer.cjs.map +1 -0
  202. package/dist/packageApiServer.d.mts +57 -0
  203. package/dist/packageApiServer.d.mts.map +1 -0
  204. package/dist/packageApiServer.mjs +189 -0
  205. package/dist/packageApiServer.mjs.map +1 -0
  206. package/dist/piExtension.cjs +13 -0
  207. package/dist/piExtension.d.mts +5 -0
  208. package/dist/piExtension.mjs +4 -0
  209. package/dist/piSettings.cjs +12 -0
  210. package/dist/piSettings.d.mts +2 -0
  211. package/dist/piSettings.mjs +2 -0
  212. package/dist/pluginProtocol.cjs +10 -0
  213. package/dist/pluginProtocol.d.mts +2 -0
  214. package/dist/pluginProtocol.mjs +2 -0
  215. package/dist/profileIdentity.cjs +6 -0
  216. package/dist/profileIdentity.d.mts +2 -0
  217. package/dist/profileIdentity.mjs +2 -0
  218. package/dist/protocol.cjs +10 -0
  219. package/dist/protocol.d.mts +2 -0
  220. package/dist/protocol.mjs +2 -0
  221. package/dist/readiness.cjs +8 -0
  222. package/dist/readiness.d.mts +2 -0
  223. package/dist/readiness.mjs +2 -0
  224. package/dist/relaunchHandoff.cjs +6 -0
  225. package/dist/relaunchHandoff.d.mts +2 -0
  226. package/dist/relaunchHandoff.mjs +2 -0
  227. package/dist/remoteApi.cjs +42 -0
  228. package/dist/remoteApi.cjs.map +1 -0
  229. package/dist/remoteApi.d.mts +7 -0
  230. package/dist/remoteApi.d.mts.map +1 -0
  231. package/dist/remoteApi.mjs +41 -0
  232. package/dist/remoteApi.mjs.map +1 -0
  233. package/dist/remoteRuntime.cjs +460 -0
  234. package/dist/remoteRuntime.cjs.map +1 -0
  235. package/dist/remoteRuntime.d.mts +28 -0
  236. package/dist/remoteRuntime.d.mts.map +1 -0
  237. package/dist/remoteRuntime.mjs +456 -0
  238. package/dist/remoteRuntime.mjs.map +1 -0
  239. package/dist/runtimeConfig.cjs +232 -0
  240. package/dist/runtimeConfig.cjs.map +1 -0
  241. package/dist/runtimeConfig.d.mts +313 -0
  242. package/dist/runtimeConfig.d.mts.map +1 -0
  243. package/dist/runtimeConfig.mjs +221 -0
  244. package/dist/runtimeConfig.mjs.map +1 -0
  245. package/dist/runtimeContextApi.cjs +64 -0
  246. package/dist/runtimeContextApi.cjs.map +1 -0
  247. package/dist/runtimeContextApi.d.mts +16 -0
  248. package/dist/runtimeContextApi.d.mts.map +1 -0
  249. package/dist/runtimeContextApi.mjs +62 -0
  250. package/dist/runtimeContextApi.mjs.map +1 -0
  251. package/dist/runtimeCordisHost.cjs +193 -0
  252. package/dist/runtimeCordisHost.cjs.map +1 -0
  253. package/dist/runtimeCordisHost.d.mts +63 -0
  254. package/dist/runtimeCordisHost.d.mts.map +1 -0
  255. package/dist/runtimeCordisHost.mjs +184 -0
  256. package/dist/runtimeCordisHost.mjs.map +1 -0
  257. package/dist/runtimeHeadlessSessionManager.cjs +0 -0
  258. package/dist/runtimeHeadlessSessionManager.d.mts +18 -0
  259. package/dist/runtimeHeadlessSessionManager.d.mts.map +1 -0
  260. package/dist/runtimeHeadlessSessionManager.mjs +1 -0
  261. package/dist/runtimeIdentity.cjs +26 -0
  262. package/dist/runtimeIdentity.cjs.map +1 -0
  263. package/dist/runtimeIdentity.d.mts +7 -0
  264. package/dist/runtimeIdentity.d.mts.map +1 -0
  265. package/dist/runtimeIdentity.mjs +21 -0
  266. package/dist/runtimeIdentity.mjs.map +1 -0
  267. package/dist/runtimeJson.cjs +46 -0
  268. package/dist/runtimeJson.cjs.map +1 -0
  269. package/dist/runtimeJson.d.mts +22 -0
  270. package/dist/runtimeJson.d.mts.map +1 -0
  271. package/dist/runtimeJson.mjs +39 -0
  272. package/dist/runtimeJson.mjs.map +1 -0
  273. package/dist/runtimeLogSinkTelemetry.cjs +102 -0
  274. package/dist/runtimeLogSinkTelemetry.cjs.map +1 -0
  275. package/dist/runtimeLogSinkTelemetry.d.mts +49 -0
  276. package/dist/runtimeLogSinkTelemetry.d.mts.map +1 -0
  277. package/dist/runtimeLogSinkTelemetry.mjs +99 -0
  278. package/dist/runtimeLogSinkTelemetry.mjs.map +1 -0
  279. package/dist/runtimePiExtension.cjs +339 -0
  280. package/dist/runtimePiExtension.cjs.map +1 -0
  281. package/dist/runtimePiExtension.d.mts +160 -0
  282. package/dist/runtimePiExtension.d.mts.map +1 -0
  283. package/dist/runtimePiExtension.mjs +333 -0
  284. package/dist/runtimePiExtension.mjs.map +1 -0
  285. package/dist/runtimePiSettings.cjs +116 -0
  286. package/dist/runtimePiSettings.cjs.map +1 -0
  287. package/dist/runtimePiSettings.d.mts +29 -0
  288. package/dist/runtimePiSettings.d.mts.map +1 -0
  289. package/dist/runtimePiSettings.mjs +103 -0
  290. package/dist/runtimePiSettings.mjs.map +1 -0
  291. package/dist/runtimeProtocol.cjs +223 -0
  292. package/dist/runtimeProtocol.cjs.map +1 -0
  293. package/dist/runtimeProtocol.d.mts +84 -0
  294. package/dist/runtimeProtocol.d.mts.map +1 -0
  295. package/dist/runtimeProtocol.mjs +215 -0
  296. package/dist/runtimeProtocol.mjs.map +1 -0
  297. package/dist/runtimeToolNames.cjs +51 -0
  298. package/dist/runtimeToolNames.cjs.map +1 -0
  299. package/dist/runtimeToolNames.d.mts +24 -0
  300. package/dist/runtimeToolNames.d.mts.map +1 -0
  301. package/dist/runtimeToolNames.mjs +49 -0
  302. package/dist/runtimeToolNames.mjs.map +1 -0
  303. package/dist/runtimeTransition.cjs +27 -0
  304. package/dist/runtimeTransition.cjs.map +1 -0
  305. package/dist/runtimeTransition.d.mts +114 -0
  306. package/dist/runtimeTransition.d.mts.map +1 -0
  307. package/dist/runtimeTransition.mjs +24 -0
  308. package/dist/runtimeTransition.mjs.map +1 -0
  309. package/dist/sandboxHarness.cjs +6 -0
  310. package/dist/sandboxHarness.d.mts +2 -0
  311. package/dist/sandboxHarness.mjs +2 -0
  312. package/dist/server.cjs +17 -0
  313. package/dist/server.d.mts +10 -0
  314. package/dist/server.mjs +7 -0
  315. package/dist/serverFacet.cjs +30 -0
  316. package/dist/serverFacet.d.mts +8 -0
  317. package/dist/serverFacet.mjs +8 -0
  318. package/dist/serverTelemetry.cjs +25 -0
  319. package/dist/serverTelemetry.cjs.map +1 -0
  320. package/dist/serverTelemetry.d.mts +12 -0
  321. package/dist/serverTelemetry.d.mts.map +1 -0
  322. package/dist/serverTelemetry.mjs +23 -0
  323. package/dist/serverTelemetry.mjs.map +1 -0
  324. package/dist/sessionFilesApi.cjs +96 -0
  325. package/dist/sessionFilesApi.cjs.map +1 -0
  326. package/dist/sessionFilesApi.d.mts +7 -0
  327. package/dist/sessionFilesApi.d.mts.map +1 -0
  328. package/dist/sessionFilesApi.mjs +91 -0
  329. package/dist/sessionFilesApi.mjs.map +1 -0
  330. package/dist/sessionMcp.cjs +6 -0
  331. package/dist/sessionMcp.d.mts +5 -0
  332. package/dist/sessionMcp.mjs +3 -0
  333. package/dist/sessionProtocol.cjs +8 -0
  334. package/dist/sessionProtocol.d.mts +3 -0
  335. package/dist/sessionProtocol.mjs +2 -0
  336. package/dist/skills.cjs +9 -0
  337. package/dist/skills.d.mts +2 -0
  338. package/dist/skills.mjs +2 -0
  339. package/dist/sqliteHistoryImport.cjs +151 -0
  340. package/dist/sqliteHistoryImport.cjs.map +1 -0
  341. package/dist/sqliteHistoryImport.d.mts +8 -0
  342. package/dist/sqliteHistoryImport.d.mts.map +1 -0
  343. package/dist/sqliteHistoryImport.mjs +146 -0
  344. package/dist/sqliteHistoryImport.mjs.map +1 -0
  345. package/dist/sqliteSessionStorage.cjs +53 -0
  346. package/dist/sqliteSessionStorage.cjs.map +1 -0
  347. package/dist/sqliteSessionStorage.d.mts +7 -0
  348. package/dist/sqliteSessionStorage.d.mts.map +1 -0
  349. package/dist/sqliteSessionStorage.mjs +49 -0
  350. package/dist/sqliteSessionStorage.mjs.map +1 -0
  351. package/dist/src/constants/authorTools.cjs +10 -0
  352. package/dist/src/constants/authorTools.cjs.map +1 -0
  353. package/dist/src/constants/authorTools.d.mts +6 -0
  354. package/dist/src/constants/authorTools.d.mts.map +1 -0
  355. package/dist/src/constants/authorTools.mjs +8 -0
  356. package/dist/src/constants/authorTools.mjs.map +1 -0
  357. package/dist/src/constants/contextApi.cjs +28 -0
  358. package/dist/src/constants/contextApi.cjs.map +1 -0
  359. package/dist/src/constants/contextApi.d.mts +21 -0
  360. package/dist/src/constants/contextApi.d.mts.map +1 -0
  361. package/dist/src/constants/contextApi.mjs +23 -0
  362. package/dist/src/constants/contextApi.mjs.map +1 -0
  363. package/dist/src/constants/remote.cjs +90 -0
  364. package/dist/src/constants/remote.cjs.map +1 -0
  365. package/dist/src/constants/remote.mjs +69 -0
  366. package/dist/src/constants/remote.mjs.map +1 -0
  367. package/dist/src/constants/voiceReloadHandoff.cjs +12 -0
  368. package/dist/src/constants/voiceReloadHandoff.cjs.map +1 -0
  369. package/dist/src/constants/voiceReloadHandoff.d.mts +7 -0
  370. package/dist/src/constants/voiceReloadHandoff.d.mts.map +1 -0
  371. package/dist/src/constants/voiceReloadHandoff.mjs +9 -0
  372. package/dist/src/constants/voiceReloadHandoff.mjs.map +1 -0
  373. package/dist/src/constants/voiceTools.cjs +96 -0
  374. package/dist/src/constants/voiceTools.cjs.map +1 -0
  375. package/dist/src/constants/voiceTools.d.mts +58 -0
  376. package/dist/src/constants/voiceTools.d.mts.map +1 -0
  377. package/dist/src/constants/voiceTools.mjs +60 -0
  378. package/dist/src/constants/voiceTools.mjs.map +1 -0
  379. package/dist/src/extensions/extensionFile.cjs +165 -0
  380. package/dist/src/extensions/extensionFile.cjs.map +1 -0
  381. package/dist/src/extensions/extensionFile.d.mts +79 -0
  382. package/dist/src/extensions/extensionFile.d.mts.map +1 -0
  383. package/dist/src/extensions/extensionFile.mjs +144 -0
  384. package/dist/src/extensions/extensionFile.mjs.map +1 -0
  385. package/dist/src/extensions/serverPlugin.cjs +106 -0
  386. package/dist/src/extensions/serverPlugin.cjs.map +1 -0
  387. package/dist/src/extensions/serverPlugin.d.mts +5 -0
  388. package/dist/src/extensions/serverPlugin.d.mts.map +1 -0
  389. package/dist/src/extensions/serverPlugin.mjs +106 -0
  390. package/dist/src/extensions/serverPlugin.mjs.map +1 -0
  391. package/dist/src/extensions/webPlugin.cjs +131 -0
  392. package/dist/src/extensions/webPlugin.cjs.map +1 -0
  393. package/dist/src/extensions/webPlugin.d.mts +66 -0
  394. package/dist/src/extensions/webPlugin.d.mts.map +1 -0
  395. package/dist/src/extensions/webPlugin.mjs +110 -0
  396. package/dist/src/extensions/webPlugin.mjs.map +1 -0
  397. package/dist/src/pi/piSessionRuntime.cjs +572 -0
  398. package/dist/src/pi/piSessionRuntime.cjs.map +1 -0
  399. package/dist/src/pi/piSessionRuntime.d.mts +43 -0
  400. package/dist/src/pi/piSessionRuntime.d.mts.map +1 -0
  401. package/dist/src/pi/piSessionRuntime.mjs +571 -0
  402. package/dist/src/pi/piSessionRuntime.mjs.map +1 -0
  403. package/dist/src/pi/piWebSocketListener.cjs +115 -0
  404. package/dist/src/pi/piWebSocketListener.cjs.map +1 -0
  405. package/dist/src/pi/piWebSocketListener.mjs +115 -0
  406. package/dist/src/pi/piWebSocketListener.mjs.map +1 -0
  407. package/dist/src/schemas/agentModel.cjs +33 -0
  408. package/dist/src/schemas/agentModel.cjs.map +1 -0
  409. package/dist/src/schemas/agentModel.d.mts +26 -0
  410. package/dist/src/schemas/agentModel.d.mts.map +1 -0
  411. package/dist/src/schemas/agentModel.mjs +32 -0
  412. package/dist/src/schemas/agentModel.mjs.map +1 -0
  413. package/dist/src/schemas/apiContracts.d.mts +58 -0
  414. package/dist/src/schemas/apiContracts.d.mts.map +1 -0
  415. package/dist/src/schemas/askUser.cjs +42 -0
  416. package/dist/src/schemas/askUser.cjs.map +1 -0
  417. package/dist/src/schemas/askUser.d.mts +47 -0
  418. package/dist/src/schemas/askUser.d.mts.map +1 -0
  419. package/dist/src/schemas/askUser.mjs +37 -0
  420. package/dist/src/schemas/askUser.mjs.map +1 -0
  421. package/dist/src/schemas/backgroundWork.cjs +31 -0
  422. package/dist/src/schemas/backgroundWork.cjs.map +1 -0
  423. package/dist/src/schemas/backgroundWork.d.mts +72 -0
  424. package/dist/src/schemas/backgroundWork.d.mts.map +1 -0
  425. package/dist/src/schemas/backgroundWork.mjs +27 -0
  426. package/dist/src/schemas/backgroundWork.mjs.map +1 -0
  427. package/dist/src/schemas/childProcess.cjs +67 -0
  428. package/dist/src/schemas/childProcess.cjs.map +1 -0
  429. package/dist/src/schemas/childProcess.d.mts +30 -0
  430. package/dist/src/schemas/childProcess.d.mts.map +1 -0
  431. package/dist/src/schemas/childProcess.mjs +55 -0
  432. package/dist/src/schemas/childProcess.mjs.map +1 -0
  433. package/dist/src/schemas/cockpitContainer.cjs +31 -0
  434. package/dist/src/schemas/cockpitContainer.cjs.map +1 -0
  435. package/dist/src/schemas/cockpitContainer.d.mts +80 -0
  436. package/dist/src/schemas/cockpitContainer.d.mts.map +1 -0
  437. package/dist/src/schemas/cockpitContainer.mjs +30 -0
  438. package/dist/src/schemas/cockpitContainer.mjs.map +1 -0
  439. package/dist/src/schemas/contextContributions.cjs +17 -0
  440. package/dist/src/schemas/contextContributions.cjs.map +1 -0
  441. package/dist/src/schemas/contextContributions.d.mts +49 -0
  442. package/dist/src/schemas/contextContributions.d.mts.map +1 -0
  443. package/dist/src/schemas/contextContributions.mjs +15 -0
  444. package/dist/src/schemas/contextContributions.mjs.map +1 -0
  445. package/dist/src/schemas/delegation.cjs +91 -0
  446. package/dist/src/schemas/delegation.cjs.map +1 -0
  447. package/dist/src/schemas/delegation.d.mts +95 -0
  448. package/dist/src/schemas/delegation.d.mts.map +1 -0
  449. package/dist/src/schemas/delegation.mjs +76 -0
  450. package/dist/src/schemas/delegation.mjs.map +1 -0
  451. package/dist/src/schemas/extensionFile.d.mts +136 -0
  452. package/dist/src/schemas/extensionFile.d.mts.map +1 -0
  453. package/dist/src/schemas/footer.cjs +48 -0
  454. package/dist/src/schemas/footer.cjs.map +1 -0
  455. package/dist/src/schemas/footer.d.mts +48 -0
  456. package/dist/src/schemas/footer.d.mts.map +1 -0
  457. package/dist/src/schemas/footer.mjs +45 -0
  458. package/dist/src/schemas/footer.mjs.map +1 -0
  459. package/dist/src/schemas/headless.cjs +44 -0
  460. package/dist/src/schemas/headless.cjs.map +1 -0
  461. package/dist/src/schemas/headless.d.mts +370 -0
  462. package/dist/src/schemas/headless.d.mts.map +1 -0
  463. package/dist/src/schemas/headless.mjs +38 -0
  464. package/dist/src/schemas/headless.mjs.map +1 -0
  465. package/dist/src/schemas/help.cjs +281 -0
  466. package/dist/src/schemas/help.cjs.map +1 -0
  467. package/dist/src/schemas/help.d.mts +119 -0
  468. package/dist/src/schemas/help.d.mts.map +1 -0
  469. package/dist/src/schemas/help.mjs +262 -0
  470. package/dist/src/schemas/help.mjs.map +1 -0
  471. package/dist/src/schemas/hubChannel.cjs +20 -0
  472. package/dist/src/schemas/hubChannel.cjs.map +1 -0
  473. package/dist/src/schemas/hubChannel.d.mts +236 -0
  474. package/dist/src/schemas/hubChannel.d.mts.map +1 -0
  475. package/dist/src/schemas/hubChannel.mjs +19 -0
  476. package/dist/src/schemas/hubChannel.mjs.map +1 -0
  477. package/dist/src/schemas/leader.cjs +57 -0
  478. package/dist/src/schemas/leader.cjs.map +1 -0
  479. package/dist/src/schemas/leader.d.mts +107 -0
  480. package/dist/src/schemas/leader.d.mts.map +1 -0
  481. package/dist/src/schemas/leader.mjs +51 -0
  482. package/dist/src/schemas/leader.mjs.map +1 -0
  483. package/dist/src/schemas/mcpBundle.cjs +92 -0
  484. package/dist/src/schemas/mcpBundle.cjs.map +1 -0
  485. package/dist/src/schemas/mcpBundle.d.mts +33 -0
  486. package/dist/src/schemas/mcpBundle.d.mts.map +1 -0
  487. package/dist/src/schemas/mcpBundle.mjs +90 -0
  488. package/dist/src/schemas/mcpBundle.mjs.map +1 -0
  489. package/dist/src/schemas/mcpFacet.cjs +24 -0
  490. package/dist/src/schemas/mcpFacet.cjs.map +1 -0
  491. package/dist/src/schemas/mcpFacet.d.mts +91 -0
  492. package/dist/src/schemas/mcpFacet.d.mts.map +1 -0
  493. package/dist/src/schemas/mcpFacet.mjs +21 -0
  494. package/dist/src/schemas/mcpFacet.mjs.map +1 -0
  495. package/dist/src/schemas/mcpProjection.cjs +117 -0
  496. package/dist/src/schemas/mcpProjection.cjs.map +1 -0
  497. package/dist/src/schemas/mcpProjection.d.mts +124 -0
  498. package/dist/src/schemas/mcpProjection.d.mts.map +1 -0
  499. package/dist/src/schemas/mcpProjection.mjs +104 -0
  500. package/dist/src/schemas/mcpProjection.mjs.map +1 -0
  501. package/dist/src/schemas/mcpSession.cjs +57 -0
  502. package/dist/src/schemas/mcpSession.cjs.map +1 -0
  503. package/dist/src/schemas/mcpSession.d.mts +57 -0
  504. package/dist/src/schemas/mcpSession.d.mts.map +1 -0
  505. package/dist/src/schemas/mcpSession.mjs +51 -0
  506. package/dist/src/schemas/mcpSession.mjs.map +1 -0
  507. package/dist/src/schemas/mcpStatus.cjs +52 -0
  508. package/dist/src/schemas/mcpStatus.cjs.map +1 -0
  509. package/dist/src/schemas/mcpStatus.d.mts +73 -0
  510. package/dist/src/schemas/mcpStatus.d.mts.map +1 -0
  511. package/dist/src/schemas/mcpStatus.mjs +48 -0
  512. package/dist/src/schemas/mcpStatus.mjs.map +1 -0
  513. package/dist/src/schemas/mcpToolResolver.cjs +17 -0
  514. package/dist/src/schemas/mcpToolResolver.cjs.map +1 -0
  515. package/dist/src/schemas/mcpToolResolver.d.mts +24 -0
  516. package/dist/src/schemas/mcpToolResolver.d.mts.map +1 -0
  517. package/dist/src/schemas/mcpToolResolver.mjs +15 -0
  518. package/dist/src/schemas/mcpToolResolver.mjs.map +1 -0
  519. package/dist/src/schemas/narration.cjs +54 -0
  520. package/dist/src/schemas/narration.cjs.map +1 -0
  521. package/dist/src/schemas/narration.d.mts +29 -0
  522. package/dist/src/schemas/narration.d.mts.map +1 -0
  523. package/dist/src/schemas/narration.mjs +47 -0
  524. package/dist/src/schemas/narration.mjs.map +1 -0
  525. package/dist/src/schemas/notification.cjs +122 -0
  526. package/dist/src/schemas/notification.cjs.map +1 -0
  527. package/dist/src/schemas/notification.d.mts +48 -0
  528. package/dist/src/schemas/notification.d.mts.map +1 -0
  529. package/dist/src/schemas/notification.mjs +108 -0
  530. package/dist/src/schemas/notification.mjs.map +1 -0
  531. package/dist/src/schemas/packageApi.cjs +73 -0
  532. package/dist/src/schemas/packageApi.cjs.map +1 -0
  533. package/dist/src/schemas/packageApi.d.mts +249 -0
  534. package/dist/src/schemas/packageApi.d.mts.map +1 -0
  535. package/dist/src/schemas/packageApi.mjs +64 -0
  536. package/dist/src/schemas/packageApi.mjs.map +1 -0
  537. package/dist/src/schemas/piTool.cjs +26 -0
  538. package/dist/src/schemas/piTool.cjs.map +1 -0
  539. package/dist/src/schemas/piTool.d.mts +25 -0
  540. package/dist/src/schemas/piTool.d.mts.map +1 -0
  541. package/dist/src/schemas/piTool.mjs +26 -0
  542. package/dist/src/schemas/piTool.mjs.map +1 -0
  543. package/dist/src/schemas/pluginContributions.cjs +19 -0
  544. package/dist/src/schemas/pluginContributions.cjs.map +1 -0
  545. package/dist/src/schemas/pluginContributions.d.mts +56 -0
  546. package/dist/src/schemas/pluginContributions.d.mts.map +1 -0
  547. package/dist/src/schemas/pluginContributions.mjs +18 -0
  548. package/dist/src/schemas/pluginContributions.mjs.map +1 -0
  549. package/dist/src/schemas/pluginProtocol.cjs +103 -0
  550. package/dist/src/schemas/pluginProtocol.cjs.map +1 -0
  551. package/dist/src/schemas/pluginProtocol.d.mts +68 -0
  552. package/dist/src/schemas/pluginProtocol.d.mts.map +1 -0
  553. package/dist/src/schemas/pluginProtocol.mjs +96 -0
  554. package/dist/src/schemas/pluginProtocol.mjs.map +1 -0
  555. package/dist/src/schemas/profileIdentity.cjs +67 -0
  556. package/dist/src/schemas/profileIdentity.cjs.map +1 -0
  557. package/dist/src/schemas/profileIdentity.d.mts +50 -0
  558. package/dist/src/schemas/profileIdentity.d.mts.map +1 -0
  559. package/dist/src/schemas/profileIdentity.mjs +64 -0
  560. package/dist/src/schemas/profileIdentity.mjs.map +1 -0
  561. package/dist/src/schemas/readiness.cjs +251 -0
  562. package/dist/src/schemas/readiness.cjs.map +1 -0
  563. package/dist/src/schemas/readiness.d.mts +84 -0
  564. package/dist/src/schemas/readiness.d.mts.map +1 -0
  565. package/dist/src/schemas/readiness.mjs +246 -0
  566. package/dist/src/schemas/readiness.mjs.map +1 -0
  567. package/dist/src/schemas/relaunchHandoff.cjs +47 -0
  568. package/dist/src/schemas/relaunchHandoff.cjs.map +1 -0
  569. package/dist/src/schemas/relaunchHandoff.d.mts +25 -0
  570. package/dist/src/schemas/relaunchHandoff.d.mts.map +1 -0
  571. package/dist/src/schemas/relaunchHandoff.mjs +44 -0
  572. package/dist/src/schemas/relaunchHandoff.mjs.map +1 -0
  573. package/dist/src/schemas/sandboxHarness.cjs +29 -0
  574. package/dist/src/schemas/sandboxHarness.cjs.map +1 -0
  575. package/dist/src/schemas/sandboxHarness.d.mts +39 -0
  576. package/dist/src/schemas/sandboxHarness.d.mts.map +1 -0
  577. package/dist/src/schemas/sandboxHarness.mjs +26 -0
  578. package/dist/src/schemas/sandboxHarness.mjs.map +1 -0
  579. package/dist/src/schemas/serverBundle.cjs +79 -0
  580. package/dist/src/schemas/serverBundle.cjs.map +1 -0
  581. package/dist/src/schemas/serverBundle.d.mts +34 -0
  582. package/dist/src/schemas/serverBundle.d.mts.map +1 -0
  583. package/dist/src/schemas/serverBundle.mjs +77 -0
  584. package/dist/src/schemas/serverBundle.mjs.map +1 -0
  585. package/dist/src/schemas/serverFacet.cjs +102 -0
  586. package/dist/src/schemas/serverFacet.cjs.map +1 -0
  587. package/dist/src/schemas/serverFacet.d.mts +141 -0
  588. package/dist/src/schemas/serverFacet.d.mts.map +1 -0
  589. package/dist/src/schemas/serverFacet.mjs +93 -0
  590. package/dist/src/schemas/serverFacet.mjs.map +1 -0
  591. package/dist/src/schemas/sessionMcpActivity.d.mts +45 -0
  592. package/dist/src/schemas/sessionMcpActivity.d.mts.map +1 -0
  593. package/dist/src/schemas/sessionProtocol.cjs +17 -0
  594. package/dist/src/schemas/sessionProtocol.cjs.map +1 -0
  595. package/dist/src/schemas/sessionProtocol.d.mts +308 -0
  596. package/dist/src/schemas/sessionProtocol.d.mts.map +1 -0
  597. package/dist/src/schemas/sessionProtocol.mjs +12 -0
  598. package/dist/src/schemas/sessionProtocol.mjs.map +1 -0
  599. package/dist/src/schemas/sessionUpdates.d.mts +34 -0
  600. package/dist/src/schemas/sessionUpdates.d.mts.map +1 -0
  601. package/dist/src/schemas/skills.cjs +115 -0
  602. package/dist/src/schemas/skills.cjs.map +1 -0
  603. package/dist/src/schemas/skills.d.mts +65 -0
  604. package/dist/src/schemas/skills.d.mts.map +1 -0
  605. package/dist/src/schemas/skills.mjs +109 -0
  606. package/dist/src/schemas/skills.mjs.map +1 -0
  607. package/dist/src/schemas/toolOverrides.cjs +17 -0
  608. package/dist/src/schemas/toolOverrides.cjs.map +1 -0
  609. package/dist/src/schemas/toolOverrides.d.mts +29 -0
  610. package/dist/src/schemas/toolOverrides.d.mts.map +1 -0
  611. package/dist/src/schemas/toolOverrides.mjs +15 -0
  612. package/dist/src/schemas/toolOverrides.mjs.map +1 -0
  613. package/dist/src/schemas/toolSurface.cjs +17 -0
  614. package/dist/src/schemas/toolSurface.cjs.map +1 -0
  615. package/dist/src/schemas/toolSurface.d.mts +70 -0
  616. package/dist/src/schemas/toolSurface.d.mts.map +1 -0
  617. package/dist/src/schemas/toolSurface.mjs +15 -0
  618. package/dist/src/schemas/toolSurface.mjs.map +1 -0
  619. package/dist/src/schemas/uiHub.cjs +17 -0
  620. package/dist/src/schemas/uiHub.cjs.map +1 -0
  621. package/dist/src/schemas/uiHub.d.mts +23 -0
  622. package/dist/src/schemas/uiHub.d.mts.map +1 -0
  623. package/dist/src/schemas/uiHub.mjs +15 -0
  624. package/dist/src/schemas/uiHub.mjs.map +1 -0
  625. package/dist/src/schemas/voiceReloadHandoff.cjs +78 -0
  626. package/dist/src/schemas/voiceReloadHandoff.cjs.map +1 -0
  627. package/dist/src/schemas/voiceReloadHandoff.d.mts +31 -0
  628. package/dist/src/schemas/voiceReloadHandoff.d.mts.map +1 -0
  629. package/dist/src/schemas/voiceReloadHandoff.mjs +75 -0
  630. package/dist/src/schemas/voiceReloadHandoff.mjs.map +1 -0
  631. package/dist/src/schemas/voiceTools.cjs +205 -0
  632. package/dist/src/schemas/voiceTools.cjs.map +1 -0
  633. package/dist/src/schemas/voiceTools.d.mts +120 -0
  634. package/dist/src/schemas/voiceTools.d.mts.map +1 -0
  635. package/dist/src/schemas/voiceTools.mjs +194 -0
  636. package/dist/src/schemas/voiceTools.mjs.map +1 -0
  637. package/dist/src/server/devProxyForward.cjs +141 -0
  638. package/dist/src/server/devProxyForward.cjs.map +1 -0
  639. package/dist/src/server/devProxyForward.mjs +139 -0
  640. package/dist/src/server/devProxyForward.mjs.map +1 -0
  641. package/dist/src/server/devProxyRoutes.cjs +97 -0
  642. package/dist/src/server/devProxyRoutes.cjs.map +1 -0
  643. package/dist/src/server/devProxyRoutes.mjs +97 -0
  644. package/dist/src/server/devProxyRoutes.mjs.map +1 -0
  645. package/dist/src/server/devProxySocket.cjs +87 -0
  646. package/dist/src/server/devProxySocket.cjs.map +1 -0
  647. package/dist/src/server/devProxySocket.mjs +87 -0
  648. package/dist/src/server/devProxySocket.mjs.map +1 -0
  649. package/dist/src/server/directHarnessRuntime.cjs +1964 -0
  650. package/dist/src/server/directHarnessRuntime.cjs.map +1 -0
  651. package/dist/src/server/directHarnessRuntime.d.mts +3 -0
  652. package/dist/src/server/directHarnessRuntime.mjs +1958 -0
  653. package/dist/src/server/directHarnessRuntime.mjs.map +1 -0
  654. package/dist/src/server/harnessErrorMessage.cjs +13 -0
  655. package/dist/src/server/harnessErrorMessage.cjs.map +1 -0
  656. package/dist/src/server/harnessErrorMessage.mjs +13 -0
  657. package/dist/src/server/harnessErrorMessage.mjs.map +1 -0
  658. package/dist/src/server/headlessProtocol.cjs +366 -0
  659. package/dist/src/server/headlessProtocol.cjs.map +1 -0
  660. package/dist/src/server/headlessProtocol.mjs +366 -0
  661. package/dist/src/server/headlessProtocol.mjs.map +1 -0
  662. package/dist/src/server/jsonlTranscriptReader.cjs +85 -0
  663. package/dist/src/server/jsonlTranscriptReader.cjs.map +1 -0
  664. package/dist/src/server/jsonlTranscriptReader.mjs +83 -0
  665. package/dist/src/server/jsonlTranscriptReader.mjs.map +1 -0
  666. package/dist/src/server/mcpBundleLoader.cjs +115 -0
  667. package/dist/src/server/mcpBundleLoader.cjs.map +1 -0
  668. package/dist/src/server/mcpBundleLoader.d.mts +27 -0
  669. package/dist/src/server/mcpBundleLoader.d.mts.map +1 -0
  670. package/dist/src/server/mcpBundleLoader.mjs +111 -0
  671. package/dist/src/server/mcpBundleLoader.mjs.map +1 -0
  672. package/dist/src/server/nativeChildTranscriptReader.cjs +20 -0
  673. package/dist/src/server/nativeChildTranscriptReader.cjs.map +1 -0
  674. package/dist/src/server/nativeChildTranscriptReader.mjs +18 -0
  675. package/dist/src/server/nativeChildTranscriptReader.mjs.map +1 -0
  676. package/dist/src/server/remoteRoutes.cjs +386 -0
  677. package/dist/src/server/remoteRoutes.cjs.map +1 -0
  678. package/dist/src/server/remoteRoutes.mjs +386 -0
  679. package/dist/src/server/remoteRoutes.mjs.map +1 -0
  680. package/dist/src/server/serverFacetLoader.cjs +220 -0
  681. package/dist/src/server/serverFacetLoader.cjs.map +1 -0
  682. package/dist/src/server/serverFacetLoader.d.mts +77 -0
  683. package/dist/src/server/serverFacetLoader.d.mts.map +1 -0
  684. package/dist/src/server/serverFacetLoader.mjs +215 -0
  685. package/dist/src/server/serverFacetLoader.mjs.map +1 -0
  686. package/dist/src/server/sessionMcpHandler.cjs +494 -0
  687. package/dist/src/server/sessionMcpHandler.cjs.map +1 -0
  688. package/dist/src/server/sessionMcpHandler.d.mts +47 -0
  689. package/dist/src/server/sessionMcpHandler.d.mts.map +1 -0
  690. package/dist/src/server/sessionMcpHandler.mjs +493 -0
  691. package/dist/src/server/sessionMcpHandler.mjs.map +1 -0
  692. package/dist/src/server/sessionMcpRoutes.cjs +780 -0
  693. package/dist/src/server/sessionMcpRoutes.cjs.map +1 -0
  694. package/dist/src/server/sessionMcpRoutes.mjs +775 -0
  695. package/dist/src/server/sessionMcpRoutes.mjs.map +1 -0
  696. package/dist/src/server/threadJournals.cjs +172 -0
  697. package/dist/src/server/threadJournals.cjs.map +1 -0
  698. package/dist/src/server/threadJournals.mjs +169 -0
  699. package/dist/src/server/threadJournals.mjs.map +1 -0
  700. package/dist/src/services/acpSessionUpdates/index.cjs +129 -0
  701. package/dist/src/services/acpSessionUpdates/index.cjs.map +1 -0
  702. package/dist/src/services/acpSessionUpdates/index.mjs +129 -0
  703. package/dist/src/services/acpSessionUpdates/index.mjs.map +1 -0
  704. package/dist/src/services/apiSurfaceAssert/index.cjs +60 -0
  705. package/dist/src/services/apiSurfaceAssert/index.cjs.map +1 -0
  706. package/dist/src/services/apiSurfaceAssert/index.d.mts +24 -0
  707. package/dist/src/services/apiSurfaceAssert/index.d.mts.map +1 -0
  708. package/dist/src/services/apiSurfaceAssert/index.mjs +60 -0
  709. package/dist/src/services/apiSurfaceAssert/index.mjs.map +1 -0
  710. package/dist/src/services/bundlePublication/index.cjs +88 -0
  711. package/dist/src/services/bundlePublication/index.cjs.map +1 -0
  712. package/dist/src/services/bundlePublication/index.mjs +85 -0
  713. package/dist/src/services/bundlePublication/index.mjs.map +1 -0
  714. package/dist/src/services/contextApiUrls/index.cjs +14 -0
  715. package/dist/src/services/contextApiUrls/index.cjs.map +1 -0
  716. package/dist/src/services/contextApiUrls/index.d.mts +6 -0
  717. package/dist/src/services/contextApiUrls/index.d.mts.map +1 -0
  718. package/dist/src/services/contextApiUrls/index.mjs +14 -0
  719. package/dist/src/services/contextApiUrls/index.mjs.map +1 -0
  720. package/dist/src/services/contextContributions/index.cjs +79 -0
  721. package/dist/src/services/contextContributions/index.cjs.map +1 -0
  722. package/dist/src/services/contextContributions/index.d.mts +6 -0
  723. package/dist/src/services/contextContributions/index.d.mts.map +1 -0
  724. package/dist/src/services/contextContributions/index.mjs +79 -0
  725. package/dist/src/services/contextContributions/index.mjs.map +1 -0
  726. package/dist/src/services/contextUsage/index.cjs +27 -0
  727. package/dist/src/services/contextUsage/index.cjs.map +1 -0
  728. package/dist/src/services/contextUsage/index.mjs +25 -0
  729. package/dist/src/services/contextUsage/index.mjs.map +1 -0
  730. package/dist/src/services/devProxyPolicy/index.cjs +168 -0
  731. package/dist/src/services/devProxyPolicy/index.cjs.map +1 -0
  732. package/dist/src/services/devProxyPolicy/index.mjs +165 -0
  733. package/dist/src/services/devProxyPolicy/index.mjs.map +1 -0
  734. package/dist/src/services/devProxyStore/index.cjs +107 -0
  735. package/dist/src/services/devProxyStore/index.cjs.map +1 -0
  736. package/dist/src/services/devProxyStore/index.mjs +104 -0
  737. package/dist/src/services/devProxyStore/index.mjs.map +1 -0
  738. package/dist/src/services/deviceAuth/index.cjs +125 -0
  739. package/dist/src/services/deviceAuth/index.cjs.map +1 -0
  740. package/dist/src/services/deviceAuth/index.d.mts +9 -0
  741. package/dist/src/services/deviceAuth/index.d.mts.map +1 -0
  742. package/dist/src/services/deviceAuth/index.mjs +125 -0
  743. package/dist/src/services/deviceAuth/index.mjs.map +1 -0
  744. package/dist/src/services/deviceSessions/index.cjs +147 -0
  745. package/dist/src/services/deviceSessions/index.cjs.map +1 -0
  746. package/dist/src/services/deviceSessions/index.d.mts +15 -0
  747. package/dist/src/services/deviceSessions/index.d.mts.map +1 -0
  748. package/dist/src/services/deviceSessions/index.mjs +141 -0
  749. package/dist/src/services/deviceSessions/index.mjs.map +1 -0
  750. package/dist/src/services/headlessClient/index.cjs +125 -0
  751. package/dist/src/services/headlessClient/index.cjs.map +1 -0
  752. package/dist/src/services/headlessClient/index.mjs +125 -0
  753. package/dist/src/services/headlessClient/index.mjs.map +1 -0
  754. package/dist/src/services/historyCreationFileSystem/index.cjs +115 -0
  755. package/dist/src/services/historyCreationFileSystem/index.cjs.map +1 -0
  756. package/dist/src/services/historyCreationFileSystem/index.mjs +115 -0
  757. package/dist/src/services/historyCreationFileSystem/index.mjs.map +1 -0
  758. package/dist/src/services/hubChannelHarness/index.cjs +50 -0
  759. package/dist/src/services/hubChannelHarness/index.cjs.map +1 -0
  760. package/dist/src/services/hubChannelHarness/index.d.mts +17 -0
  761. package/dist/src/services/hubChannelHarness/index.d.mts.map +1 -0
  762. package/dist/src/services/hubChannelHarness/index.mjs +50 -0
  763. package/dist/src/services/hubChannelHarness/index.mjs.map +1 -0
  764. package/dist/src/services/kernel/index.cjs +147 -0
  765. package/dist/src/services/kernel/index.cjs.map +1 -0
  766. package/dist/src/services/kernel/index.d.mts +9 -0
  767. package/dist/src/services/kernel/index.d.mts.map +1 -0
  768. package/dist/src/services/kernel/index.mjs +147 -0
  769. package/dist/src/services/kernel/index.mjs.map +1 -0
  770. package/dist/src/services/loginFlow/index.cjs +131 -0
  771. package/dist/src/services/loginFlow/index.cjs.map +1 -0
  772. package/dist/src/services/loginFlow/index.mjs +131 -0
  773. package/dist/src/services/loginFlow/index.mjs.map +1 -0
  774. package/dist/src/services/loopbackAddress/index.cjs +58 -0
  775. package/dist/src/services/loopbackAddress/index.cjs.map +1 -0
  776. package/dist/src/services/loopbackAddress/index.mjs +56 -0
  777. package/dist/src/services/loopbackAddress/index.mjs.map +1 -0
  778. package/dist/src/services/openSessionRegistry/index.cjs +144 -0
  779. package/dist/src/services/openSessionRegistry/index.cjs.map +1 -0
  780. package/dist/src/services/openSessionRegistry/index.d.mts +40 -0
  781. package/dist/src/services/openSessionRegistry/index.d.mts.map +1 -0
  782. package/dist/src/services/openSessionRegistry/index.mjs +141 -0
  783. package/dist/src/services/openSessionRegistry/index.mjs.map +1 -0
  784. package/dist/src/services/packageApiHarness/index.cjs +36 -0
  785. package/dist/src/services/packageApiHarness/index.cjs.map +1 -0
  786. package/dist/src/services/packageApiHarness/index.d.mts +40 -0
  787. package/dist/src/services/packageApiHarness/index.d.mts.map +1 -0
  788. package/dist/src/services/packageApiHarness/index.mjs +36 -0
  789. package/dist/src/services/packageApiHarness/index.mjs.map +1 -0
  790. package/dist/src/services/packageResource/index.cjs +54 -0
  791. package/dist/src/services/packageResource/index.cjs.map +1 -0
  792. package/dist/src/services/packageResource/index.d.mts +26 -0
  793. package/dist/src/services/packageResource/index.d.mts.map +1 -0
  794. package/dist/src/services/packageResource/index.mjs +51 -0
  795. package/dist/src/services/packageResource/index.mjs.map +1 -0
  796. package/dist/src/services/pairingFlow/index.cjs +145 -0
  797. package/dist/src/services/pairingFlow/index.cjs.map +1 -0
  798. package/dist/src/services/pairingFlow/index.d.mts +44 -0
  799. package/dist/src/services/pairingFlow/index.d.mts.map +1 -0
  800. package/dist/src/services/pairingFlow/index.mjs +145 -0
  801. package/dist/src/services/pairingFlow/index.mjs.map +1 -0
  802. package/dist/src/services/pairingPage/index.cjs +450 -0
  803. package/dist/src/services/pairingPage/index.cjs.map +1 -0
  804. package/dist/src/services/pairingPage/index.mjs +447 -0
  805. package/dist/src/services/pairingPage/index.mjs.map +1 -0
  806. package/dist/src/services/piExtensionHost/index.cjs +821 -0
  807. package/dist/src/services/piExtensionHost/index.cjs.map +1 -0
  808. package/dist/src/services/piExtensionHost/index.mjs +817 -0
  809. package/dist/src/services/piExtensionHost/index.mjs.map +1 -0
  810. package/dist/src/services/piHelpTools/index.cjs +68 -0
  811. package/dist/src/services/piHelpTools/index.cjs.map +1 -0
  812. package/dist/src/services/piHelpTools/index.d.mts +10 -0
  813. package/dist/src/services/piHelpTools/index.d.mts.map +1 -0
  814. package/dist/src/services/piHelpTools/index.mjs +68 -0
  815. package/dist/src/services/piHelpTools/index.mjs.map +1 -0
  816. package/dist/src/services/piSessionEntries/index.cjs +112 -0
  817. package/dist/src/services/piSessionEntries/index.cjs.map +1 -0
  818. package/dist/src/services/piSessionEntries/index.mjs +108 -0
  819. package/dist/src/services/piSessionEntries/index.mjs.map +1 -0
  820. package/dist/src/services/pluginLifecycle/index.cjs +71 -0
  821. package/dist/src/services/pluginLifecycle/index.cjs.map +1 -0
  822. package/dist/src/services/pluginLifecycle/index.d.mts +11 -0
  823. package/dist/src/services/pluginLifecycle/index.d.mts.map +1 -0
  824. package/dist/src/services/pluginLifecycle/index.mjs +71 -0
  825. package/dist/src/services/pluginLifecycle/index.mjs.map +1 -0
  826. package/dist/src/services/providerAuth/index.cjs +156 -0
  827. package/dist/src/services/providerAuth/index.cjs.map +1 -0
  828. package/dist/src/services/providerAuth/index.mjs +154 -0
  829. package/dist/src/services/providerAuth/index.mjs.map +1 -0
  830. package/dist/src/services/remoteAccess/index.cjs +396 -0
  831. package/dist/src/services/remoteAccess/index.cjs.map +1 -0
  832. package/dist/src/services/remoteAccess/index.d.mts +81 -0
  833. package/dist/src/services/remoteAccess/index.d.mts.map +1 -0
  834. package/dist/src/services/remoteAccess/index.mjs +396 -0
  835. package/dist/src/services/remoteAccess/index.mjs.map +1 -0
  836. package/dist/src/services/remoteAccessSettings/index.cjs +151 -0
  837. package/dist/src/services/remoteAccessSettings/index.cjs.map +1 -0
  838. package/dist/src/services/remoteAccessSettings/index.mjs +149 -0
  839. package/dist/src/services/remoteAccessSettings/index.mjs.map +1 -0
  840. package/dist/src/services/remoteAccessStore/index.cjs +126 -0
  841. package/dist/src/services/remoteAccessStore/index.cjs.map +1 -0
  842. package/dist/src/services/remoteAccessStore/index.mjs +121 -0
  843. package/dist/src/services/remoteAccessStore/index.mjs.map +1 -0
  844. package/dist/src/services/remoteGuardPolicy/index.cjs +190 -0
  845. package/dist/src/services/remoteGuardPolicy/index.cjs.map +1 -0
  846. package/dist/src/services/remoteGuardPolicy/index.d.mts +7 -0
  847. package/dist/src/services/remoteGuardPolicy/index.d.mts.map +1 -0
  848. package/dist/src/services/remoteGuardPolicy/index.mjs +186 -0
  849. package/dist/src/services/remoteGuardPolicy/index.mjs.map +1 -0
  850. package/dist/src/services/requestReceipts/index.cjs +161 -0
  851. package/dist/src/services/requestReceipts/index.cjs.map +1 -0
  852. package/dist/src/services/requestReceipts/index.d.mts +11 -0
  853. package/dist/src/services/requestReceipts/index.d.mts.map +1 -0
  854. package/dist/src/services/requestReceipts/index.mjs +161 -0
  855. package/dist/src/services/requestReceipts/index.mjs.map +1 -0
  856. package/dist/src/services/rpcTranscript/index.cjs +590 -0
  857. package/dist/src/services/rpcTranscript/index.cjs.map +1 -0
  858. package/dist/src/services/rpcTranscript/index.d.mts +50 -0
  859. package/dist/src/services/rpcTranscript/index.d.mts.map +1 -0
  860. package/dist/src/services/rpcTranscript/index.mjs +589 -0
  861. package/dist/src/services/rpcTranscript/index.mjs.map +1 -0
  862. package/dist/src/services/serverFacet/index.cjs +197 -0
  863. package/dist/src/services/serverFacet/index.cjs.map +1 -0
  864. package/dist/src/services/serverFacet/index.d.mts +31 -0
  865. package/dist/src/services/serverFacet/index.d.mts.map +1 -0
  866. package/dist/src/services/serverFacet/index.mjs +197 -0
  867. package/dist/src/services/serverFacet/index.mjs.map +1 -0
  868. package/dist/src/services/sessionGitStatus/index.cjs +46 -0
  869. package/dist/src/services/sessionGitStatus/index.cjs.map +1 -0
  870. package/dist/src/services/sessionGitStatus/index.mjs +46 -0
  871. package/dist/src/services/sessionGitStatus/index.mjs.map +1 -0
  872. package/dist/src/services/sessionGitStatus/type.d.mts +8 -0
  873. package/dist/src/services/sessionGitStatus/type.d.mts.map +1 -0
  874. package/dist/src/services/sessionMcpActivity/index.cjs +115 -0
  875. package/dist/src/services/sessionMcpActivity/index.cjs.map +1 -0
  876. package/dist/src/services/sessionMcpActivity/index.mjs +111 -0
  877. package/dist/src/services/sessionMcpActivity/index.mjs.map +1 -0
  878. package/dist/src/services/sessionMcpAuthorization/index.cjs +432 -0
  879. package/dist/src/services/sessionMcpAuthorization/index.cjs.map +1 -0
  880. package/dist/src/services/sessionMcpAuthorization/index.d.mts +123 -0
  881. package/dist/src/services/sessionMcpAuthorization/index.d.mts.map +1 -0
  882. package/dist/src/services/sessionMcpAuthorization/index.mjs +430 -0
  883. package/dist/src/services/sessionMcpAuthorization/index.mjs.map +1 -0
  884. package/dist/src/services/sessionMcpConversations/index.cjs +217 -0
  885. package/dist/src/services/sessionMcpConversations/index.cjs.map +1 -0
  886. package/dist/src/services/sessionMcpConversations/index.mjs +212 -0
  887. package/dist/src/services/sessionMcpConversations/index.mjs.map +1 -0
  888. package/dist/src/services/sessionMcpRegistrationStore/index.cjs +86 -0
  889. package/dist/src/services/sessionMcpRegistrationStore/index.cjs.map +1 -0
  890. package/dist/src/services/sessionMcpRegistrationStore/index.mjs +83 -0
  891. package/dist/src/services/sessionMcpRegistrationStore/index.mjs.map +1 -0
  892. package/dist/src/services/sessionPresentation/index.cjs +119 -0
  893. package/dist/src/services/sessionPresentation/index.cjs.map +1 -0
  894. package/dist/src/services/sessionPresentation/index.mjs +119 -0
  895. package/dist/src/services/sessionPresentation/index.mjs.map +1 -0
  896. package/dist/src/services/sqliteSessionHistory/index.cjs +105 -0
  897. package/dist/src/services/sqliteSessionHistory/index.cjs.map +1 -0
  898. package/dist/src/services/sqliteSessionHistory/index.d.mts +29 -0
  899. package/dist/src/services/sqliteSessionHistory/index.d.mts.map +1 -0
  900. package/dist/src/services/sqliteSessionHistory/index.mjs +100 -0
  901. package/dist/src/services/sqliteSessionHistory/index.mjs.map +1 -0
  902. package/dist/src/services/sqliteTranscriptReader/index.cjs +70 -0
  903. package/dist/src/services/sqliteTranscriptReader/index.cjs.map +1 -0
  904. package/dist/src/services/sqliteTranscriptReader/index.d.mts +14 -0
  905. package/dist/src/services/sqliteTranscriptReader/index.d.mts.map +1 -0
  906. package/dist/src/services/sqliteTranscriptReader/index.mjs +67 -0
  907. package/dist/src/services/sqliteTranscriptReader/index.mjs.map +1 -0
  908. package/dist/src/services/toolCost/index.cjs +47 -0
  909. package/dist/src/services/toolCost/index.cjs.map +1 -0
  910. package/dist/src/services/toolCost/index.d.mts +38 -0
  911. package/dist/src/services/toolCost/index.d.mts.map +1 -0
  912. package/dist/src/services/toolCost/index.mjs +46 -0
  913. package/dist/src/services/toolCost/index.mjs.map +1 -0
  914. package/dist/src/services/toolOverrides/index.cjs +45 -0
  915. package/dist/src/services/toolOverrides/index.cjs.map +1 -0
  916. package/dist/src/services/toolOverrides/index.d.mts +6 -0
  917. package/dist/src/services/toolOverrides/index.d.mts.map +1 -0
  918. package/dist/src/services/toolOverrides/index.mjs +45 -0
  919. package/dist/src/services/toolOverrides/index.mjs.map +1 -0
  920. package/dist/src/services/toolPrompt/index.cjs +13 -0
  921. package/dist/src/services/toolPrompt/index.cjs.map +1 -0
  922. package/dist/src/services/toolPrompt/index.mjs +13 -0
  923. package/dist/src/services/toolPrompt/index.mjs.map +1 -0
  924. package/dist/src/services/toolSurface/index.cjs +134 -0
  925. package/dist/src/services/toolSurface/index.cjs.map +1 -0
  926. package/dist/src/services/toolSurface/index.d.mts +19 -0
  927. package/dist/src/services/toolSurface/index.d.mts.map +1 -0
  928. package/dist/src/services/toolSurface/index.mjs +134 -0
  929. package/dist/src/services/toolSurface/index.mjs.map +1 -0
  930. package/dist/src/services/traceContext/index.cjs +13 -0
  931. package/dist/src/services/traceContext/index.cjs.map +1 -0
  932. package/dist/src/services/traceContext/index.mjs +13 -0
  933. package/dist/src/services/traceContext/index.mjs.map +1 -0
  934. package/dist/src/services/transcriptPages/index.cjs +74 -0
  935. package/dist/src/services/transcriptPages/index.cjs.map +1 -0
  936. package/dist/src/services/transcriptPages/index.mjs +73 -0
  937. package/dist/src/services/transcriptPages/index.mjs.map +1 -0
  938. package/dist/src/services/tunnelOutput/index.cjs +58 -0
  939. package/dist/src/services/tunnelOutput/index.cjs.map +1 -0
  940. package/dist/src/services/tunnelOutput/index.mjs +54 -0
  941. package/dist/src/services/tunnelOutput/index.mjs.map +1 -0
  942. package/dist/src/services/tunnelProcess/index.cjs +487 -0
  943. package/dist/src/services/tunnelProcess/index.cjs.map +1 -0
  944. package/dist/src/services/tunnelProcess/index.mjs +481 -0
  945. package/dist/src/services/tunnelProcess/index.mjs.map +1 -0
  946. package/dist/src/services/voiceReloadHandoff/index.cjs +136 -0
  947. package/dist/src/services/voiceReloadHandoff/index.cjs.map +1 -0
  948. package/dist/src/services/voiceReloadHandoff/index.d.mts +34 -0
  949. package/dist/src/services/voiceReloadHandoff/index.d.mts.map +1 -0
  950. package/dist/src/services/voiceReloadHandoff/index.mjs +135 -0
  951. package/dist/src/services/voiceReloadHandoff/index.mjs.map +1 -0
  952. package/dist/src/services/voiceToolsContract/index.cjs +26 -0
  953. package/dist/src/services/voiceToolsContract/index.cjs.map +1 -0
  954. package/dist/src/services/voiceToolsContract/index.d.mts +76 -0
  955. package/dist/src/services/voiceToolsContract/index.d.mts.map +1 -0
  956. package/dist/src/services/voiceToolsContract/index.mjs +24 -0
  957. package/dist/src/services/voiceToolsContract/index.mjs.map +1 -0
  958. package/dist/src/services/webauthn/index.cjs +262 -0
  959. package/dist/src/services/webauthn/index.cjs.map +1 -0
  960. package/dist/src/services/webauthn/index.d.mts +39 -0
  961. package/dist/src/services/webauthn/index.d.mts.map +1 -0
  962. package/dist/src/services/webauthn/index.mjs +262 -0
  963. package/dist/src/services/webauthn/index.mjs.map +1 -0
  964. package/dist/src/services/webauthnPolicy/index.cjs +163 -0
  965. package/dist/src/services/webauthnPolicy/index.cjs.map +1 -0
  966. package/dist/src/services/webauthnPolicy/index.d.mts +41 -0
  967. package/dist/src/services/webauthnPolicy/index.d.mts.map +1 -0
  968. package/dist/src/services/webauthnPolicy/index.mjs +156 -0
  969. package/dist/src/services/webauthnPolicy/index.mjs.map +1 -0
  970. package/dist/src/services/workspaceRegistry/index.cjs +151 -0
  971. package/dist/src/services/workspaceRegistry/index.cjs.map +1 -0
  972. package/dist/src/services/workspaceRegistry/index.d.mts +47 -0
  973. package/dist/src/services/workspaceRegistry/index.d.mts.map +1 -0
  974. package/dist/src/services/workspaceRegistry/index.mjs +144 -0
  975. package/dist/src/services/workspaceRegistry/index.mjs.map +1 -0
  976. package/dist/src/systems/child/adapters/headlessChildSessionService.cjs +261 -0
  977. package/dist/src/systems/child/adapters/headlessChildSessionService.cjs.map +1 -0
  978. package/dist/src/systems/child/adapters/headlessChildSessionService.d.mts +32 -0
  979. package/dist/src/systems/child/adapters/headlessChildSessionService.d.mts.map +1 -0
  980. package/dist/src/systems/child/adapters/headlessChildSessionService.mjs +254 -0
  981. package/dist/src/systems/child/adapters/headlessChildSessionService.mjs.map +1 -0
  982. package/dist/src/systems/child/adapters/nativeChildRuntimes.cjs +28 -0
  983. package/dist/src/systems/child/adapters/nativeChildRuntimes.cjs.map +1 -0
  984. package/dist/src/systems/child/adapters/nativeChildRuntimes.mjs +25 -0
  985. package/dist/src/systems/child/adapters/nativeChildRuntimes.mjs.map +1 -0
  986. package/dist/src/systems/child/services/childSession/index.cjs +219 -0
  987. package/dist/src/systems/child/services/childSession/index.cjs.map +1 -0
  988. package/dist/src/systems/child/services/childSession/index.d.mts +14 -0
  989. package/dist/src/systems/child/services/childSession/index.d.mts.map +1 -0
  990. package/dist/src/systems/child/services/childSession/index.mjs +219 -0
  991. package/dist/src/systems/child/services/childSession/index.mjs.map +1 -0
  992. package/dist/src/systems/child/types/childSession.cjs +19 -0
  993. package/dist/src/systems/child/types/childSession.cjs.map +1 -0
  994. package/dist/src/systems/child/types/childSession.d.mts +148 -0
  995. package/dist/src/systems/child/types/childSession.d.mts.map +1 -0
  996. package/dist/src/systems/child/types/childSession.mjs +16 -0
  997. package/dist/src/systems/child/types/childSession.mjs.map +1 -0
  998. package/dist/src/systems/main/adapters/headlessHost.cjs +554 -0
  999. package/dist/src/systems/main/adapters/headlessHost.cjs.map +1 -0
  1000. package/dist/src/systems/main/adapters/headlessHost.d.mts +111 -0
  1001. package/dist/src/systems/main/adapters/headlessHost.d.mts.map +1 -0
  1002. package/dist/src/systems/main/adapters/headlessHost.mjs +552 -0
  1003. package/dist/src/systems/main/adapters/headlessHost.mjs.map +1 -0
  1004. package/dist/src/systems/main/adapters/headlessSessionHost.cjs +1293 -0
  1005. package/dist/src/systems/main/adapters/headlessSessionHost.cjs.map +1 -0
  1006. package/dist/src/systems/main/adapters/headlessSessionHost.d.mts +14 -0
  1007. package/dist/src/systems/main/adapters/headlessSessionHost.d.mts.map +1 -0
  1008. package/dist/src/systems/main/adapters/headlessSessionHost.mjs +1288 -0
  1009. package/dist/src/systems/main/adapters/headlessSessionHost.mjs.map +1 -0
  1010. package/dist/src/systems/main/types/headlessHost.d.mts +36 -0
  1011. package/dist/src/systems/main/types/headlessHost.d.mts.map +1 -0
  1012. package/dist/src/testing/pi/extensionScenarios.cjs +73 -0
  1013. package/dist/src/testing/pi/extensionScenarios.cjs.map +1 -0
  1014. package/dist/src/testing/pi/extensionScenarios.d.mts +41 -0
  1015. package/dist/src/testing/pi/extensionScenarios.d.mts.map +1 -0
  1016. package/dist/src/testing/pi/extensionScenarios.mjs +73 -0
  1017. package/dist/src/testing/pi/extensionScenarios.mjs.map +1 -0
  1018. package/dist/src/testing/pi/testHost.cjs +398 -0
  1019. package/dist/src/testing/pi/testHost.cjs.map +1 -0
  1020. package/dist/src/testing/pi/testHost.d.mts +160 -0
  1021. package/dist/src/testing/pi/testHost.d.mts.map +1 -0
  1022. package/dist/src/testing/pi/testHost.mjs +398 -0
  1023. package/dist/src/testing/pi/testHost.mjs.map +1 -0
  1024. package/dist/src/types/config.d.mts +20 -0
  1025. package/dist/src/types/config.d.mts.map +1 -0
  1026. package/dist/src/types/kernel.d.mts +69 -0
  1027. package/dist/src/types/kernel.d.mts.map +1 -0
  1028. package/dist/src/types/remote.d.mts +124 -0
  1029. package/dist/src/types/remote.d.mts.map +1 -0
  1030. package/dist/src/types/server/directHarnessRuntime.d.mts +209 -0
  1031. package/dist/src/types/server/directHarnessRuntime.d.mts.map +1 -0
  1032. package/dist/src/types/server/session.d.mts +5 -0
  1033. package/dist/src/types/server/session.d.mts.map +1 -0
  1034. package/dist/src/types/server/sessionToolSurface.d.mts +44 -0
  1035. package/dist/src/types/server/sessionToolSurface.d.mts.map +1 -0
  1036. package/dist/src/web/models/globalStore.cjs +23 -0
  1037. package/dist/src/web/models/globalStore.cjs.map +1 -0
  1038. package/dist/src/web/models/globalStore.d.mts +6 -0
  1039. package/dist/src/web/models/globalStore.d.mts.map +1 -0
  1040. package/dist/src/web/models/globalStore.mjs +23 -0
  1041. package/dist/src/web/models/globalStore.mjs.map +1 -0
  1042. package/dist/src/web/models/sessionStore.cjs +56 -0
  1043. package/dist/src/web/models/sessionStore.cjs.map +1 -0
  1044. package/dist/src/web/models/sessionStore.d.mts +14 -0
  1045. package/dist/src/web/models/sessionStore.d.mts.map +1 -0
  1046. package/dist/src/web/models/sessionStore.mjs +56 -0
  1047. package/dist/src/web/models/sessionStore.mjs.map +1 -0
  1048. package/dist/src/web/models/workspaceStore.cjs +50 -0
  1049. package/dist/src/web/models/workspaceStore.cjs.map +1 -0
  1050. package/dist/src/web/models/workspaceStore.d.mts +18 -0
  1051. package/dist/src/web/models/workspaceStore.d.mts.map +1 -0
  1052. package/dist/src/web/models/workspaceStore.mjs +50 -0
  1053. package/dist/src/web/models/workspaceStore.mjs.map +1 -0
  1054. package/dist/src/web/schemas/bundleAssetPolicy.cjs +20 -0
  1055. package/dist/src/web/schemas/bundleAssetPolicy.cjs.map +1 -0
  1056. package/dist/src/web/schemas/bundleAssetPolicy.d.mts +10 -0
  1057. package/dist/src/web/schemas/bundleAssetPolicy.d.mts.map +1 -0
  1058. package/dist/src/web/schemas/bundleAssetPolicy.mjs +18 -0
  1059. package/dist/src/web/schemas/bundleAssetPolicy.mjs.map +1 -0
  1060. package/dist/src/web/schemas/template.cjs +15 -0
  1061. package/dist/src/web/schemas/template.cjs.map +1 -0
  1062. package/dist/src/web/schemas/template.d.mts +6 -0
  1063. package/dist/src/web/schemas/template.d.mts.map +1 -0
  1064. package/dist/src/web/schemas/template.mjs +15 -0
  1065. package/dist/src/web/schemas/template.mjs.map +1 -0
  1066. package/dist/src/web/services/apiClient/index.cjs +156 -0
  1067. package/dist/src/web/services/apiClient/index.cjs.map +1 -0
  1068. package/dist/src/web/services/apiClient/index.d.mts +152 -0
  1069. package/dist/src/web/services/apiClient/index.d.mts.map +1 -0
  1070. package/dist/src/web/services/apiClient/index.mjs +154 -0
  1071. package/dist/src/web/services/apiClient/index.mjs.map +1 -0
  1072. package/dist/src/web/services/apiPaths/index.cjs +83 -0
  1073. package/dist/src/web/services/apiPaths/index.cjs.map +1 -0
  1074. package/dist/src/web/services/apiPaths/index.d.mts +81 -0
  1075. package/dist/src/web/services/apiPaths/index.d.mts.map +1 -0
  1076. package/dist/src/web/services/apiPaths/index.mjs +78 -0
  1077. package/dist/src/web/services/apiPaths/index.mjs.map +1 -0
  1078. package/dist/src/web/services/apiRoutes/index.cjs +47 -0
  1079. package/dist/src/web/services/apiRoutes/index.cjs.map +1 -0
  1080. package/dist/src/web/services/apiRoutes/index.d.mts +21 -0
  1081. package/dist/src/web/services/apiRoutes/index.d.mts.map +1 -0
  1082. package/dist/src/web/services/apiRoutes/index.mjs +43 -0
  1083. package/dist/src/web/services/apiRoutes/index.mjs.map +1 -0
  1084. package/dist/src/web/services/mcpWidget.cjs +9 -0
  1085. package/dist/src/web/services/mcpWidget.cjs.map +1 -0
  1086. package/dist/src/web/services/mcpWidget.d.mts +6 -0
  1087. package/dist/src/web/services/mcpWidget.d.mts.map +1 -0
  1088. package/dist/src/web/services/mcpWidget.mjs +9 -0
  1089. package/dist/src/web/services/mcpWidget.mjs.map +1 -0
  1090. package/dist/src/web/services/sessionRegistry/index.cjs +70 -0
  1091. package/dist/src/web/services/sessionRegistry/index.cjs.map +1 -0
  1092. package/dist/src/web/services/sessionRegistry/index.d.mts +29 -0
  1093. package/dist/src/web/services/sessionRegistry/index.d.mts.map +1 -0
  1094. package/dist/src/web/services/sessionRegistry/index.mjs +66 -0
  1095. package/dist/src/web/services/sessionRegistry/index.mjs.map +1 -0
  1096. package/dist/src/web/services/testing/channels.cjs +11 -0
  1097. package/dist/src/web/services/testing/channels.cjs.map +1 -0
  1098. package/dist/src/web/services/testing/channels.d.mts +8 -0
  1099. package/dist/src/web/services/testing/channels.d.mts.map +1 -0
  1100. package/dist/src/web/services/testing/channels.mjs +11 -0
  1101. package/dist/src/web/services/testing/channels.mjs.map +1 -0
  1102. package/dist/src/web/services/testing/index.cjs +27 -0
  1103. package/dist/src/web/services/testing/index.cjs.map +1 -0
  1104. package/dist/src/web/services/testing/index.d.mts +31 -0
  1105. package/dist/src/web/services/testing/index.d.mts.map +1 -0
  1106. package/dist/src/web/services/testing/index.mjs +27 -0
  1107. package/dist/src/web/services/testing/index.mjs.map +1 -0
  1108. package/dist/src/web/services/testing/rpcStub.cjs +58 -0
  1109. package/dist/src/web/services/testing/rpcStub.cjs.map +1 -0
  1110. package/dist/src/web/services/testing/rpcStub.d.mts +37 -0
  1111. package/dist/src/web/services/testing/rpcStub.d.mts.map +1 -0
  1112. package/dist/src/web/services/testing/rpcStub.mjs +58 -0
  1113. package/dist/src/web/services/testing/rpcStub.mjs.map +1 -0
  1114. package/dist/src/web/services/testing/slotProps.cjs +91 -0
  1115. package/dist/src/web/services/testing/slotProps.cjs.map +1 -0
  1116. package/dist/src/web/services/testing/slotProps.d.mts +69 -0
  1117. package/dist/src/web/services/testing/slotProps.d.mts.map +1 -0
  1118. package/dist/src/web/services/testing/slotProps.mjs +90 -0
  1119. package/dist/src/web/services/testing/slotProps.mjs.map +1 -0
  1120. package/dist/src/web/services/testing/templateRail.cjs +128 -0
  1121. package/dist/src/web/services/testing/templateRail.cjs.map +1 -0
  1122. package/dist/src/web/services/testing/templateRail.d.mts +31 -0
  1123. package/dist/src/web/services/testing/templateRail.d.mts.map +1 -0
  1124. package/dist/src/web/services/testing/templateRail.mjs +126 -0
  1125. package/dist/src/web/services/testing/templateRail.mjs.map +1 -0
  1126. package/dist/src/web/services/toolResult/index.cjs +30 -0
  1127. package/dist/src/web/services/toolResult/index.cjs.map +1 -0
  1128. package/dist/src/web/services/toolResult/index.d.mts +14 -0
  1129. package/dist/src/web/services/toolResult/index.d.mts.map +1 -0
  1130. package/dist/src/web/services/toolResult/index.mjs +29 -0
  1131. package/dist/src/web/services/toolResult/index.mjs.map +1 -0
  1132. package/dist/src/web/types/extensionFile.d.mts +59 -0
  1133. package/dist/src/web/types/extensionFile.d.mts.map +1 -0
  1134. package/dist/src/web/types/mcpWidget.d.mts +14 -0
  1135. package/dist/src/web/types/mcpWidget.d.mts.map +1 -0
  1136. package/dist/src/web/types/modelContext.d.mts +43 -0
  1137. package/dist/src/web/types/modelContext.d.mts.map +1 -0
  1138. package/dist/src/web/types/sessionRegistry.d.mts +43 -0
  1139. package/dist/src/web/types/sessionRegistry.d.mts.map +1 -0
  1140. package/dist/src/web/types/template.d.mts +155 -0
  1141. package/dist/src/web/types/template.d.mts.map +1 -0
  1142. package/dist/src/web/types/webPlugin.d.mts +896 -0
  1143. package/dist/src/web/types/webPlugin.d.mts.map +1 -0
  1144. package/dist/syncLocation.cjs +244 -0
  1145. package/dist/syncLocation.cjs.map +1 -0
  1146. package/dist/syncLocation.d.mts +37 -0
  1147. package/dist/syncLocation.d.mts.map +1 -0
  1148. package/dist/syncLocation.mjs +231 -0
  1149. package/dist/syncLocation.mjs.map +1 -0
  1150. package/dist/syncRegistration.cjs +171 -0
  1151. package/dist/syncRegistration.cjs.map +1 -0
  1152. package/dist/syncRegistration.d.mts +48 -0
  1153. package/dist/syncRegistration.d.mts.map +1 -0
  1154. package/dist/syncRegistration.mjs +159 -0
  1155. package/dist/syncRegistration.mjs.map +1 -0
  1156. package/dist/syncStateContract.cjs +19 -0
  1157. package/dist/syncStateContract.cjs.map +1 -0
  1158. package/dist/syncStateContract.d.mts +14 -0
  1159. package/dist/syncStateContract.d.mts.map +1 -0
  1160. package/dist/syncStateContract.mjs +16 -0
  1161. package/dist/syncStateContract.mjs.map +1 -0
  1162. package/dist/terminalPiChildSessionService.cjs +267 -0
  1163. package/dist/terminalPiChildSessionService.cjs.map +1 -0
  1164. package/dist/terminalPiChildSessionService.d.mts +42 -0
  1165. package/dist/terminalPiChildSessionService.d.mts.map +1 -0
  1166. package/dist/terminalPiChildSessionService.mjs +260 -0
  1167. package/dist/terminalPiChildSessionService.mjs.map +1 -0
  1168. package/dist/testing.cjs +11 -0
  1169. package/dist/testing.d.mts +6 -0
  1170. package/dist/testing.mjs +6 -0
  1171. package/dist/toolInventory.cjs +136 -0
  1172. package/dist/toolInventory.cjs.map +1 -0
  1173. package/dist/toolInventory.d.mts +66 -0
  1174. package/dist/toolInventory.d.mts.map +1 -0
  1175. package/dist/toolInventory.mjs +133 -0
  1176. package/dist/toolInventory.mjs.map +1 -0
  1177. package/dist/toolNames.cjs +4 -0
  1178. package/dist/toolNames.d.mts +2 -0
  1179. package/dist/toolNames.mjs +2 -0
  1180. package/dist/toolOverrides.cjs +7 -0
  1181. package/dist/toolOverrides.d.mts +3 -0
  1182. package/dist/toolOverrides.mjs +3 -0
  1183. package/dist/toolSurface.cjs +7 -0
  1184. package/dist/toolSurface.d.mts +3 -0
  1185. package/dist/toolSurface.mjs +3 -0
  1186. package/dist/transition.cjs +5 -0
  1187. package/dist/transition.d.cjs +5 -0
  1188. package/dist/transition.d.mts +2 -0
  1189. package/dist/transition.mjs +2 -0
  1190. package/dist/transitionClassifier.cjs +112 -0
  1191. package/dist/transitionClassifier.cjs.map +1 -0
  1192. package/dist/transitionClassifier.d.mts +18 -0
  1193. package/dist/transitionClassifier.d.mts.map +1 -0
  1194. package/dist/transitionClassifier.mjs +111 -0
  1195. package/dist/transitionClassifier.mjs.map +1 -0
  1196. package/dist/transitionCoordinator.cjs +131 -0
  1197. package/dist/transitionCoordinator.cjs.map +1 -0
  1198. package/dist/transitionCoordinator.d.mts +16 -0
  1199. package/dist/transitionCoordinator.d.mts.map +1 -0
  1200. package/dist/transitionCoordinator.mjs +130 -0
  1201. package/dist/transitionCoordinator.mjs.map +1 -0
  1202. package/dist/typesContextApi.cjs +0 -0
  1203. package/dist/typesContextApi.d.mts +73 -0
  1204. package/dist/typesContextApi.d.mts.map +1 -0
  1205. package/dist/typesContextApi.mjs +1 -0
  1206. package/dist/uiHub.cjs +5 -0
  1207. package/dist/uiHub.d.mts +2 -0
  1208. package/dist/uiHub.mjs +2 -0
  1209. package/dist/v3Export.cjs +1004 -0
  1210. package/dist/v3Export.cjs.map +1 -0
  1211. package/dist/v3Export.d.mts +34 -0
  1212. package/dist/v3Export.d.mts.map +1 -0
  1213. package/dist/v3Export.mjs +1000 -0
  1214. package/dist/v3Export.mjs.map +1 -0
  1215. package/dist/voiceReloadHandoff.cjs +14 -0
  1216. package/dist/voiceReloadHandoff.d.mts +4 -0
  1217. package/dist/voiceReloadHandoff.mjs +4 -0
  1218. package/dist/voiceTools.cjs +56 -0
  1219. package/dist/voiceTools.d.mts +4 -0
  1220. package/dist/voiceTools.mjs +4 -0
  1221. package/dist/web.cjs +64 -0
  1222. package/dist/web.d.mts +19 -0
  1223. package/dist/web.mjs +13 -0
  1224. package/dist/webCompositions.cjs +100 -0
  1225. package/dist/webCompositions.cjs.map +1 -0
  1226. package/dist/webCompositions.d.mts +20 -0
  1227. package/dist/webCompositions.d.mts.map +1 -0
  1228. package/dist/webCompositions.mjs +95 -0
  1229. package/dist/webCompositions.mjs.map +1 -0
  1230. package/dist/webTesting.cjs +14 -0
  1231. package/dist/webTesting.d.mts +6 -0
  1232. package/dist/webTesting.mjs +6 -0
  1233. package/package.json +616 -0
@@ -0,0 +1,171 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
3
+ const require_runtimeJson = require("./runtimeJson.cjs");
4
+ const require_syncLocation = require("./syncLocation.cjs");
5
+ const require_serverBundle = require("./src/schemas/serverBundle.cjs");
6
+ require("./serverFacet.cjs");
7
+ const require_mcpBundle = require("./src/schemas/mcpBundle.cjs");
8
+ require("./doomPackage.cjs");
9
+ let node_crypto = require("node:crypto");
10
+ node_crypto = require_runtime.__toESM(node_crypto, 1);
11
+ let node_fs = require("node:fs");
12
+ node_fs = require_runtime.__toESM(node_fs, 1);
13
+ let node_path = require("node:path");
14
+ node_path = require_runtime.__toESM(node_path, 1);
15
+ //#region src/services/syncRegistration/index.ts
16
+ /** Current registration schema shared by sync, the managed dispatcher, and runtime consumers. */
17
+ const SYNC_REGISTRATION_VERSION = 2;
18
+ /** Legacy schema accepted only with exact producer npm-version validation. */
19
+ const LEGACY_SYNC_REGISTRATION_VERSION = 1;
20
+ /** Runtime API contract shared by synchronized generations and DoomPi releases. */
21
+ const DOOMPI_API_VERSION = 1;
22
+ const SHA256 = /^[a-f0-9]{64}$/u;
23
+ const PRIVATE_FILE_MODE = 384;
24
+ function canonicalPath(target) {
25
+ return node_fs.default.realpathSync.native(node_path.default.resolve(target));
26
+ }
27
+ function isInside(directory, target) {
28
+ const relative = node_path.default.relative(canonicalPath(directory), canonicalPath(target));
29
+ return relative === "" || !relative.startsWith("..") && !node_path.default.isAbsolute(relative);
30
+ }
31
+ function requiredString(value, field, recordPath) {
32
+ if (typeof value !== "string" || value === "") throw new Error(`Doom sync registration at ${recordPath} has an invalid ${field}`);
33
+ return value;
34
+ }
35
+ function identityFrom(value, recordPath) {
36
+ if (!require_runtimeJson.isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} has no identity`);
37
+ return {
38
+ repositoryId: requiredString(value.repositoryId, "repository id", recordPath),
39
+ worktreeId: requiredString(value.worktreeId, "worktree id", recordPath)
40
+ };
41
+ }
42
+ function packageFrom(value, recordPath) {
43
+ if (!require_runtimeJson.isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} has no package record`);
44
+ return {
45
+ root: requiredString(value.root, "package root", recordPath),
46
+ version: requiredString(value.version, "package version", recordPath),
47
+ ...value.apiVersion === void 0 ? {} : { apiVersion: value.apiVersion },
48
+ manifestPath: requiredString(value.manifestPath, "package manifest", recordPath),
49
+ entry: requiredString(value.entry, "package entry", recordPath)
50
+ };
51
+ }
52
+ function sha256File(filePath) {
53
+ return node_crypto.default.createHash("sha256").update(node_fs.default.readFileSync(filePath)).digest("hex");
54
+ }
55
+ function validatePackage(value, recordPath, recordVersion) {
56
+ const packageRoot = canonicalPath(value.root);
57
+ if (packageRoot !== node_path.default.resolve(value.root)) throw new Error(`Doom sync registration at ${recordPath} has a noncanonical package root`);
58
+ if (!isInside(packageRoot, value.manifestPath) || !isInside(packageRoot, value.entry)) throw new Error(`Doom sync registration at ${recordPath} references package material outside ${packageRoot}`);
59
+ if (canonicalPath(value.manifestPath) !== canonicalPath(node_path.default.join(packageRoot, "package.json"))) throw new Error(`Doom sync registration at ${recordPath} has an invalid package manifest path`);
60
+ const manifest = JSON.parse(node_fs.default.readFileSync(value.manifestPath, "utf8"));
61
+ if (manifest.name !== "@agimon-ai/doompi" || typeof manifest.version !== "string") throw new Error(`Doom sync registration at ${recordPath} does not match its DoomPi package`);
62
+ if (recordVersion === 1 && value.apiVersion === void 0) {
63
+ if (manifest.version !== value.version) throw new Error(`Doom sync registration at ${recordPath} does not match its DoomPi package`);
64
+ } else {
65
+ if (value.apiVersion === void 0) throw new Error(`Doom sync registration at ${recordPath} has no package API version`);
66
+ if (!Number.isSafeInteger(value.apiVersion) || value.apiVersion < 1) throw new Error(`Doom sync registration at ${recordPath} has an invalid package API version`);
67
+ if (manifest.doompiApiVersion !== value.apiVersion) throw new Error(`Doom sync registration at ${recordPath} has a mismatched package API version`);
68
+ if (value.apiVersion !== 1) throw new Error(`Unsupported DoomPi package API version at ${recordPath}`);
69
+ }
70
+ const extensions = manifest.pi?.extensions;
71
+ if (!Array.isArray(extensions) || !extensions.some((entry) => typeof entry === "string" && canonicalPath(node_path.default.resolve(packageRoot, entry)) === canonicalPath(value.entry))) throw new Error(`Doom sync registration at ${recordPath} does not match the package Pi entry`);
72
+ }
73
+ /** Validates one parsed registration against its canonical repository/worktree location. */
74
+ function validateSyncRegistration(registration, location) {
75
+ const recordPath = location.registrationPath;
76
+ const recordVersion = registration.version;
77
+ if (recordVersion !== 2 && recordVersion !== 1) throw new Error(`Unsupported Doom sync registration version at ${recordPath}`);
78
+ const canonicalRoot = canonicalPath(registration.root);
79
+ if (canonicalRoot !== location.root || node_path.default.resolve(registration.root) !== canonicalRoot) throw new Error(`Doom sync registration at ${recordPath} has an invalid repository root`);
80
+ if (registration.identity.repositoryId !== location.identity.repositoryId || registration.identity.worktreeId !== location.identity.worktreeId) throw new Error(`Doom sync registration at ${recordPath} belongs to another repository or worktree`);
81
+ const expectedGenerationRoot = require_syncLocation.syncGenerationDirectory(location, registration.generation);
82
+ if (node_path.default.resolve(registration.generationRoot) !== node_path.default.resolve(expectedGenerationRoot)) throw new Error(`Doom sync registration at ${recordPath} has an invalid generation root`);
83
+ const generationStat = node_fs.default.lstatSync(registration.generationRoot, { throwIfNoEntry: false });
84
+ if (!generationStat?.isDirectory() || generationStat.isSymbolicLink()) throw new Error(`Doom sync registration at ${recordPath} has an unavailable generation`);
85
+ for (const target of [registration.statePath, registration.apiDirectory]) if (!isInside(registration.generationRoot, target)) throw new Error(`Doom sync registration at ${recordPath} references material outside its generation`);
86
+ if (registration.webDirectory !== null && !isInside(registration.generationRoot, registration.webDirectory)) throw new Error(`Doom sync registration at ${recordPath} references web material outside its generation`);
87
+ if (!SHA256.test(registration.stateSha256) || sha256File(registration.statePath) !== registration.stateSha256) throw new Error(`Doom sync registration at ${recordPath} has a mismatched state hash`);
88
+ let state = {};
89
+ try {
90
+ const parsed = JSON.parse(node_fs.default.readFileSync(registration.statePath, "utf8"));
91
+ if (require_runtimeJson.isRecord(parsed)) state = parsed;
92
+ } catch (error) {
93
+ if (registration.serverBundle !== void 0) throw error;
94
+ }
95
+ if (registration.serverBundle !== void 0) {
96
+ const bundle = registration.serverBundle;
97
+ if (!isInside(registration.generationRoot, bundle.path) || canonicalPath(bundle.path) !== canonicalPath(node_path.default.join(registration.apiDirectory, "server.bundle.json"))) throw new Error(`Doom sync registration at ${recordPath} has an invalid server descriptor path`);
98
+ if (!SHA256.test(bundle.sha256) || sha256File(bundle.path) !== bundle.sha256) throw new Error(`Doom sync registration at ${recordPath} has a mismatched server descriptor hash`);
99
+ const descriptor = require_serverBundle.parseDoomServerBundle(JSON.parse(node_fs.default.readFileSync(bundle.path, "utf8")));
100
+ const recorded = state.serverBundle;
101
+ if (descriptor.generation !== registration.generation || descriptor.fingerprint !== bundle.fingerprint || !require_runtimeJson.isRecord(recorded) || recorded.fingerprint !== bundle.fingerprint || recorded.descriptorPath !== bundle.path) throw new Error(`Doom sync registration at ${recordPath} has mismatched server bundle identity`);
102
+ } else if (state.serverBundle !== void 0) throw new Error(`Doom sync registration at ${recordPath} is missing its server bundle record`);
103
+ if (registration.mcpBundle !== void 0) {
104
+ const bundle = registration.mcpBundle;
105
+ if (!isInside(registration.generationRoot, bundle.path) || canonicalPath(bundle.path) !== canonicalPath(node_path.default.join(registration.generationRoot, "mcp", "mcp.bundle.json"))) throw new Error(`Doom sync registration at ${recordPath} has an invalid MCP descriptor path`);
106
+ if (!SHA256.test(bundle.sha256) || sha256File(bundle.path) !== bundle.sha256) throw new Error(`Doom sync registration at ${recordPath} has a mismatched MCP descriptor hash`);
107
+ const descriptor = require_mcpBundle.parseDoomMcpBundle(JSON.parse(node_fs.default.readFileSync(bundle.path, "utf8")));
108
+ const recorded = state.mcpBundle;
109
+ if (descriptor.generation !== registration.generation || descriptor.fingerprint !== bundle.fingerprint || !require_runtimeJson.isRecord(recorded) || recorded.fingerprint !== bundle.fingerprint || recorded.descriptorPath !== bundle.path) throw new Error(`Doom sync registration at ${recordPath} has mismatched MCP bundle identity`);
110
+ for (const entry of descriptor.entries) {
111
+ const modulePath = node_path.default.resolve(node_path.default.dirname(bundle.path), entry.module);
112
+ if (!isInside(registration.generationRoot, modulePath) || sha256File(modulePath) !== entry.sha256) throw new Error(`Doom sync registration at ${recordPath} has a mismatched MCP artifact hash`);
113
+ }
114
+ } else if (state.mcpBundle !== void 0) throw new Error(`Doom sync registration at ${recordPath} is missing its MCP bundle record`);
115
+ validatePackage(registration.package, recordPath, recordVersion);
116
+ return registration;
117
+ }
118
+ function parseSyncRegistration(value, recordPath) {
119
+ if (!require_runtimeJson.isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} is not an object`);
120
+ return {
121
+ version: value.version,
122
+ root: requiredString(value.root, "repository root", recordPath),
123
+ identity: identityFrom(value.identity, recordPath),
124
+ generation: requiredString(value.generation, "generation", recordPath),
125
+ generationRoot: requiredString(value.generationRoot, "generation root", recordPath),
126
+ statePath: requiredString(value.statePath, "state path", recordPath),
127
+ stateSha256: requiredString(value.stateSha256, "state hash", recordPath),
128
+ webDirectory: value.webDirectory === null ? null : requiredString(value.webDirectory, "web directory", recordPath),
129
+ apiDirectory: requiredString(value.apiDirectory, "API directory", recordPath),
130
+ ...value.serverBundle === void 0 ? {} : { serverBundle: bundleFrom(value.serverBundle, recordPath, "server") },
131
+ ...value.mcpBundle === void 0 ? {} : { mcpBundle: bundleFrom(value.mcpBundle, recordPath, "MCP") },
132
+ package: packageFrom(value.package, recordPath)
133
+ };
134
+ }
135
+ function bundleFrom(value, recordPath, kind) {
136
+ if (!require_runtimeJson.isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} has an invalid ${kind} bundle record`);
137
+ return {
138
+ path: requiredString(value.path, "server descriptor path", recordPath),
139
+ sha256: requiredString(value.sha256, "server descriptor hash", recordPath),
140
+ fingerprint: requiredString(value.fingerprint, "server descriptor fingerprint", recordPath)
141
+ };
142
+ }
143
+ /** Reads only the exact registration for this repository/worktree. */
144
+ function readSyncRegistration(repoRoot, homeDirectory) {
145
+ const location = require_syncLocation.resolveSyncLocation(repoRoot, homeDirectory);
146
+ if (!node_fs.default.existsSync(location.registrationPath)) return void 0;
147
+ return validateSyncRegistration(parseSyncRegistration(JSON.parse(node_fs.default.readFileSync(location.registrationPath, "utf8")), location.registrationPath), location);
148
+ }
149
+ /** Atomically activates one fully staged generation for its worktree. */
150
+ function publishSyncRegistration(repoRoot, registration, homeDirectory) {
151
+ const location = require_syncLocation.resolveSyncLocation(repoRoot, homeDirectory);
152
+ require_syncLocation.assertSyncLocationSafe(location);
153
+ validateSyncRegistration(registration, location);
154
+ require_runtimeJson.writeFileAtomic(location.registrationPath, `${JSON.stringify(registration, null, 2)}\n`);
155
+ node_fs.default.chmodSync(location.registrationPath, PRIVATE_FILE_MODE);
156
+ return location.registrationPath;
157
+ }
158
+ function syncStateSha256(statePath) {
159
+ return sha256File(statePath);
160
+ }
161
+ //#endregion
162
+ exports.DOOMPI_API_VERSION = DOOMPI_API_VERSION;
163
+ exports.LEGACY_SYNC_REGISTRATION_VERSION = LEGACY_SYNC_REGISTRATION_VERSION;
164
+ exports.SYNC_REGISTRATION_VERSION = SYNC_REGISTRATION_VERSION;
165
+ exports.parseSyncRegistration = parseSyncRegistration;
166
+ exports.publishSyncRegistration = publishSyncRegistration;
167
+ exports.readSyncRegistration = readSyncRegistration;
168
+ exports.syncStateSha256 = syncStateSha256;
169
+ exports.validateSyncRegistration = validateSyncRegistration;
170
+
171
+ //# sourceMappingURL=syncRegistration.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syncRegistration.cjs","names":["fs","path","isRecord","crypto","syncGenerationDirectory","parseDoomServerBundle","parseDoomMcpBundle","resolveSyncLocation"],"sources":["../src/services/syncRegistration/index.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { DOOM_SERVER_BUNDLE_FILE, parseDoomServerBundle } from '../../exports/serverFacet';\nimport { DOOM_MCP_BUNDLE_FILE, parseDoomMcpBundle } from '../../schemas/mcpBundle';\nimport { DOOM_PACKAGE_NAME } from '../doomPackage';\nimport { isRecord, writeFileAtomic } from '../json';\nimport {\n assertSyncLocationSafe,\n resolveSyncLocation,\n syncGenerationDirectory,\n type SyncIdentity,\n type SyncLocation,\n} from '../syncLocation';\n\n/** Current registration schema shared by sync, the managed dispatcher, and runtime consumers. */\nexport const SYNC_REGISTRATION_VERSION = 2;\n/** Legacy schema accepted only with exact producer npm-version validation. */\nexport const LEGACY_SYNC_REGISTRATION_VERSION = 1;\n/** Runtime API contract shared by synchronized generations and DoomPi releases. */\nexport const DOOMPI_API_VERSION = 1;\n\nconst SHA256 = /^[a-f0-9]{64}$/u;\nconst PRIVATE_FILE_MODE = 0o600;\n\nexport interface SyncPackageRegistration {\n root: string;\n version: string;\n /** Present in registrations written by the API-versioned sync protocol. */\n apiVersion?: number;\n manifestPath: string;\n entry: string;\n}\n\nexport interface SyncServerBundleRegistration {\n path: string;\n sha256: string;\n fingerprint: string;\n}\n\nexport type SyncMcpBundleRegistration = SyncServerBundleRegistration;\n\nexport interface SyncRegistration {\n version: number;\n root: string;\n identity: SyncIdentity;\n generation: string;\n generationRoot: string;\n statePath: string;\n stateSha256: string;\n webDirectory: string | null;\n apiDirectory: string;\n /** Missing only for explicitly supported pre-cutover generations. */\n serverBundle?: SyncServerBundleRegistration;\n /** Explicit MCP runtime admitted with this generation. */\n mcpBundle?: SyncMcpBundleRegistration;\n package: SyncPackageRegistration;\n}\n\nfunction canonicalPath(target: string): string {\n return fs.realpathSync.native(path.resolve(target));\n}\n\nfunction isInside(directory: string, target: string): boolean {\n const relative = path.relative(canonicalPath(directory), canonicalPath(target));\n return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));\n}\n\nfunction requiredString(value: unknown, field: string, recordPath: string): string {\n if (typeof value !== 'string' || value === '') {\n throw new Error(`Doom sync registration at ${recordPath} has an invalid ${field}`);\n }\n return value;\n}\n\nfunction identityFrom(value: unknown, recordPath: string): SyncIdentity {\n if (!isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} has no identity`);\n return {\n repositoryId: requiredString(value.repositoryId, 'repository id', recordPath),\n worktreeId: requiredString(value.worktreeId, 'worktree id', recordPath),\n };\n}\n\nfunction packageFrom(value: unknown, recordPath: string): SyncPackageRegistration {\n if (!isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} has no package record`);\n return {\n root: requiredString(value.root, 'package root', recordPath),\n version: requiredString(value.version, 'package version', recordPath),\n ...(value.apiVersion === undefined ? {} : { apiVersion: value.apiVersion as number }),\n manifestPath: requiredString(value.manifestPath, 'package manifest', recordPath),\n entry: requiredString(value.entry, 'package entry', recordPath),\n };\n}\n\nfunction sha256File(filePath: string): string {\n return crypto.createHash('sha256').update(fs.readFileSync(filePath)).digest('hex');\n}\n\nfunction validatePackage(value: SyncPackageRegistration, recordPath: string, recordVersion: number): void {\n const packageRoot = canonicalPath(value.root);\n if (packageRoot !== path.resolve(value.root)) {\n throw new Error(`Doom sync registration at ${recordPath} has a noncanonical package root`);\n }\n if (!isInside(packageRoot, value.manifestPath) || !isInside(packageRoot, value.entry)) {\n throw new Error(`Doom sync registration at ${recordPath} references package material outside ${packageRoot}`);\n }\n if (canonicalPath(value.manifestPath) !== canonicalPath(path.join(packageRoot, 'package.json'))) {\n throw new Error(`Doom sync registration at ${recordPath} has an invalid package manifest path`);\n }\n const manifest = JSON.parse(fs.readFileSync(value.manifestPath, 'utf8')) as {\n name?: unknown;\n version?: unknown;\n doompiApiVersion?: unknown;\n pi?: { extensions?: unknown };\n };\n if (manifest.name !== DOOM_PACKAGE_NAME || typeof manifest.version !== 'string') {\n throw new Error(`Doom sync registration at ${recordPath} does not match its DoomPi package`);\n }\n if (recordVersion === LEGACY_SYNC_REGISTRATION_VERSION && value.apiVersion === undefined) {\n // Registrations written before API compatibility was persisted remain valid\n // only when their exact producer release is still installed.\n if (manifest.version !== value.version) {\n throw new Error(`Doom sync registration at ${recordPath} does not match its DoomPi package`);\n }\n } else {\n if (value.apiVersion === undefined) {\n throw new Error(`Doom sync registration at ${recordPath} has no package API version`);\n }\n if (!Number.isSafeInteger(value.apiVersion) || value.apiVersion < 1) {\n throw new Error(`Doom sync registration at ${recordPath} has an invalid package API version`);\n }\n if (manifest.doompiApiVersion !== value.apiVersion) {\n throw new Error(`Doom sync registration at ${recordPath} has a mismatched package API version`);\n }\n if (value.apiVersion !== DOOMPI_API_VERSION) {\n throw new Error(`Unsupported DoomPi package API version at ${recordPath}`);\n }\n }\n const extensions = manifest.pi?.extensions;\n if (\n !Array.isArray(extensions) ||\n !extensions.some(\n (entry) =>\n typeof entry === 'string' && canonicalPath(path.resolve(packageRoot, entry)) === canonicalPath(value.entry),\n )\n ) {\n throw new Error(`Doom sync registration at ${recordPath} does not match the package Pi entry`);\n }\n}\n\n/** Validates one parsed registration against its canonical repository/worktree location. */\nexport function validateSyncRegistration(registration: SyncRegistration, location: SyncLocation): SyncRegistration {\n const recordPath = location.registrationPath;\n const recordVersion = registration.version;\n if (recordVersion !== SYNC_REGISTRATION_VERSION && recordVersion !== LEGACY_SYNC_REGISTRATION_VERSION) {\n throw new Error(`Unsupported Doom sync registration version at ${recordPath}`);\n }\n const canonicalRoot = canonicalPath(registration.root);\n if (canonicalRoot !== location.root || path.resolve(registration.root) !== canonicalRoot) {\n throw new Error(`Doom sync registration at ${recordPath} has an invalid repository root`);\n }\n if (\n registration.identity.repositoryId !== location.identity.repositoryId ||\n registration.identity.worktreeId !== location.identity.worktreeId\n ) {\n throw new Error(`Doom sync registration at ${recordPath} belongs to another repository or worktree`);\n }\n const expectedGenerationRoot = syncGenerationDirectory(location, registration.generation);\n if (path.resolve(registration.generationRoot) !== path.resolve(expectedGenerationRoot)) {\n throw new Error(`Doom sync registration at ${recordPath} has an invalid generation root`);\n }\n const generationStat = fs.lstatSync(registration.generationRoot, { throwIfNoEntry: false });\n if (!generationStat?.isDirectory() || generationStat.isSymbolicLink()) {\n throw new Error(`Doom sync registration at ${recordPath} has an unavailable generation`);\n }\n for (const target of [registration.statePath, registration.apiDirectory]) {\n if (!isInside(registration.generationRoot, target)) {\n throw new Error(`Doom sync registration at ${recordPath} references material outside its generation`);\n }\n }\n if (registration.webDirectory !== null && !isInside(registration.generationRoot, registration.webDirectory)) {\n throw new Error(`Doom sync registration at ${recordPath} references web material outside its generation`);\n }\n if (!SHA256.test(registration.stateSha256) || sha256File(registration.statePath) !== registration.stateSha256) {\n throw new Error(`Doom sync registration at ${recordPath} has a mismatched state hash`);\n }\n let state: Record<string, unknown> = {};\n try {\n const parsed: unknown = JSON.parse(fs.readFileSync(registration.statePath, 'utf8'));\n if (isRecord(parsed)) state = parsed;\n } catch (error) {\n // Legacy state validation remains the state reader's responsibility. New\n // descriptor generations require their state identity during admission.\n if (registration.serverBundle !== undefined) throw error;\n }\n if (registration.serverBundle !== undefined) {\n const bundle = registration.serverBundle;\n if (\n !isInside(registration.generationRoot, bundle.path) ||\n canonicalPath(bundle.path) !== canonicalPath(path.join(registration.apiDirectory, DOOM_SERVER_BUNDLE_FILE))\n ) {\n throw new Error(`Doom sync registration at ${recordPath} has an invalid server descriptor path`);\n }\n if (!SHA256.test(bundle.sha256) || sha256File(bundle.path) !== bundle.sha256) {\n throw new Error(`Doom sync registration at ${recordPath} has a mismatched server descriptor hash`);\n }\n const descriptor = parseDoomServerBundle(JSON.parse(fs.readFileSync(bundle.path, 'utf8')));\n const recorded = state.serverBundle;\n if (\n descriptor.generation !== registration.generation ||\n descriptor.fingerprint !== bundle.fingerprint ||\n !isRecord(recorded) ||\n recorded.fingerprint !== bundle.fingerprint ||\n recorded.descriptorPath !== bundle.path\n ) {\n throw new Error(`Doom sync registration at ${recordPath} has mismatched server bundle identity`);\n }\n } else if (state.serverBundle !== undefined) {\n throw new Error(`Doom sync registration at ${recordPath} is missing its server bundle record`);\n }\n if (registration.mcpBundle !== undefined) {\n const bundle = registration.mcpBundle;\n if (\n !isInside(registration.generationRoot, bundle.path) ||\n canonicalPath(bundle.path) !== canonicalPath(path.join(registration.generationRoot, 'mcp', DOOM_MCP_BUNDLE_FILE))\n )\n throw new Error(`Doom sync registration at ${recordPath} has an invalid MCP descriptor path`);\n if (!SHA256.test(bundle.sha256) || sha256File(bundle.path) !== bundle.sha256)\n throw new Error(`Doom sync registration at ${recordPath} has a mismatched MCP descriptor hash`);\n const descriptor = parseDoomMcpBundle(JSON.parse(fs.readFileSync(bundle.path, 'utf8')));\n const recorded = state.mcpBundle;\n if (\n descriptor.generation !== registration.generation ||\n descriptor.fingerprint !== bundle.fingerprint ||\n !isRecord(recorded) ||\n recorded.fingerprint !== bundle.fingerprint ||\n recorded.descriptorPath !== bundle.path\n )\n throw new Error(`Doom sync registration at ${recordPath} has mismatched MCP bundle identity`);\n for (const entry of descriptor.entries) {\n const modulePath = path.resolve(path.dirname(bundle.path), entry.module);\n if (!isInside(registration.generationRoot, modulePath) || sha256File(modulePath) !== entry.sha256)\n throw new Error(`Doom sync registration at ${recordPath} has a mismatched MCP artifact hash`);\n }\n } else if (state.mcpBundle !== undefined) {\n throw new Error(`Doom sync registration at ${recordPath} is missing its MCP bundle record`);\n }\n validatePackage(registration.package, recordPath, recordVersion);\n return registration;\n}\n\nexport function parseSyncRegistration(value: unknown, recordPath: string): SyncRegistration {\n if (!isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} is not an object`);\n return {\n version: value.version as number,\n root: requiredString(value.root, 'repository root', recordPath),\n identity: identityFrom(value.identity, recordPath),\n generation: requiredString(value.generation, 'generation', recordPath),\n generationRoot: requiredString(value.generationRoot, 'generation root', recordPath),\n statePath: requiredString(value.statePath, 'state path', recordPath),\n stateSha256: requiredString(value.stateSha256, 'state hash', recordPath),\n webDirectory: value.webDirectory === null ? null : requiredString(value.webDirectory, 'web directory', recordPath),\n apiDirectory: requiredString(value.apiDirectory, 'API directory', recordPath),\n ...(value.serverBundle === undefined ? {} : { serverBundle: bundleFrom(value.serverBundle, recordPath, 'server') }),\n ...(value.mcpBundle === undefined ? {} : { mcpBundle: bundleFrom(value.mcpBundle, recordPath, 'MCP') }),\n package: packageFrom(value.package, recordPath),\n };\n}\n\nfunction bundleFrom(value: unknown, recordPath: string, kind: 'server' | 'MCP'): SyncServerBundleRegistration {\n if (!isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} has an invalid ${kind} bundle record`);\n return {\n path: requiredString(value.path, 'server descriptor path', recordPath),\n sha256: requiredString(value.sha256, 'server descriptor hash', recordPath),\n fingerprint: requiredString(value.fingerprint, 'server descriptor fingerprint', recordPath),\n };\n}\n\n/** Reads only the exact registration for this repository/worktree. */\nexport function readSyncRegistration(repoRoot: string, homeDirectory?: string): SyncRegistration | undefined {\n const location = resolveSyncLocation(repoRoot, homeDirectory);\n if (!fs.existsSync(location.registrationPath)) return undefined;\n const parsed = parseSyncRegistration(\n JSON.parse(fs.readFileSync(location.registrationPath, 'utf8')),\n location.registrationPath,\n );\n return validateSyncRegistration(parsed, location);\n}\n\n/** Atomically activates one fully staged generation for its worktree. */\nexport function publishSyncRegistration(\n repoRoot: string,\n registration: SyncRegistration,\n homeDirectory?: string,\n): string {\n const location = resolveSyncLocation(repoRoot, homeDirectory);\n assertSyncLocationSafe(location);\n validateSyncRegistration(registration, location);\n writeFileAtomic(location.registrationPath, `${JSON.stringify(registration, null, 2)}\\n`);\n fs.chmodSync(location.registrationPath, PRIVATE_FILE_MODE);\n return location.registrationPath;\n}\n\nexport function syncStateSha256(statePath: string): string {\n return sha256File(statePath);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAa,4BAA4B;;AAEzC,MAAa,mCAAmC;;AAEhD,MAAa,qBAAqB;AAElC,MAAM,SAAS;AACf,MAAM,oBAAoB;AAoC1B,SAAS,cAAc,QAAwB;CAC7C,OAAOA,QAAAA,QAAG,aAAa,OAAOC,UAAAA,QAAK,QAAQ,MAAM,CAAC;AACpD;AAEA,SAAS,SAAS,WAAmB,QAAyB;CAC5D,MAAM,WAAWA,UAAAA,QAAK,SAAS,cAAc,SAAS,GAAG,cAAc,MAAM,CAAC;CAC9E,OAAO,aAAa,MAAO,CAAC,SAAS,WAAW,IAAI,KAAK,CAACA,UAAAA,QAAK,WAAW,QAAQ;AACpF;AAEA,SAAS,eAAe,OAAgB,OAAe,YAA4B;CACjF,IAAI,OAAO,UAAU,YAAY,UAAU,IACzC,MAAM,IAAI,MAAM,6BAA6B,WAAW,kBAAkB,OAAO;CAEnF,OAAO;AACT;AAEA,SAAS,aAAa,OAAgB,YAAkC;CACtE,IAAI,CAACC,oBAAAA,SAAS,KAAK,GAAG,MAAM,IAAI,MAAM,6BAA6B,WAAW,iBAAiB;CAC/F,OAAO;EACL,cAAc,eAAe,MAAM,cAAc,iBAAiB,UAAU;EAC5E,YAAY,eAAe,MAAM,YAAY,eAAe,UAAU;CACxE;AACF;AAEA,SAAS,YAAY,OAAgB,YAA6C;CAChF,IAAI,CAACA,oBAAAA,SAAS,KAAK,GAAG,MAAM,IAAI,MAAM,6BAA6B,WAAW,uBAAuB;CACrG,OAAO;EACL,MAAM,eAAe,MAAM,MAAM,gBAAgB,UAAU;EAC3D,SAAS,eAAe,M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AAW,SAAS,gBAAgB,GAAG,OAAO,KAAA;CAKtD,OAAO,yBAJQ,sBACb,KAAK,MAAMA,QAAAA,QAAG,aAAa,SAAS,kBAAkB,MAAM,CAAC,GAC7D,SAAS,gBAE0B,GAAG,QAAQ;AAClD;;AAGA,SAAgB,wBACd,UACA,cACA,eACQ;CACR,MAAM,WAAWO,qBAAAA,oBAAoB,UAAU,aAAa;CAC5D,qBAAA,uBAAuB,QAAQ;CAC/B,yBAAyB,cAAc,QAAQ;CAC/C,oBAAA,gBAAgB,SAAS,kBAAkB,GAAG,KAAK,UAAU,cAAc,MAAM,CAAC,EAAE,GAAG;CACvF,QAAA,QAAG,UAAU,SAAS,kBAAkB,iBAAiB;CACzD,OAAO,SAAS;AAClB;AAEA,SAAgB,gBAAgB,WAA2B;CACzD,OAAO,WAAW,SAAS;AAC7B"}
@@ -0,0 +1,48 @@
1
+ import { SyncIdentity, SyncLocation } from "./syncLocation.mjs";
2
+ //#region src/services/syncRegistration/index.d.ts
3
+ /** Current registration schema shared by sync, the managed dispatcher, and runtime consumers. */
4
+ export declare const SYNC_REGISTRATION_VERSION = 2;
5
+ /** Legacy schema accepted only with exact producer npm-version validation. */
6
+ export declare const LEGACY_SYNC_REGISTRATION_VERSION = 1;
7
+ /** Runtime API contract shared by synchronized generations and DoomPi releases. */
8
+ export declare const DOOMPI_API_VERSION = 1;
9
+ export interface SyncPackageRegistration {
10
+ root: string;
11
+ version: string;
12
+ /** Present in registrations written by the API-versioned sync protocol. */
13
+ apiVersion?: number;
14
+ manifestPath: string;
15
+ entry: string;
16
+ }
17
+ export interface SyncServerBundleRegistration {
18
+ path: string;
19
+ sha256: string;
20
+ fingerprint: string;
21
+ }
22
+ export type SyncMcpBundleRegistration = SyncServerBundleRegistration;
23
+ export interface SyncRegistration {
24
+ version: number;
25
+ root: string;
26
+ identity: SyncIdentity;
27
+ generation: string;
28
+ generationRoot: string;
29
+ statePath: string;
30
+ stateSha256: string;
31
+ webDirectory: string | null;
32
+ apiDirectory: string;
33
+ /** Missing only for explicitly supported pre-cutover generations. */
34
+ serverBundle?: SyncServerBundleRegistration;
35
+ /** Explicit MCP runtime admitted with this generation. */
36
+ mcpBundle?: SyncMcpBundleRegistration;
37
+ package: SyncPackageRegistration;
38
+ }
39
+ /** Validates one parsed registration against its canonical repository/worktree location. */
40
+ export declare function validateSyncRegistration(registration: SyncRegistration, location: SyncLocation): SyncRegistration;
41
+ export declare function parseSyncRegistration(value: unknown, recordPath: string): SyncRegistration;
42
+ /** Reads only the exact registration for this repository/worktree. */
43
+ export declare function readSyncRegistration(repoRoot: string, homeDirectory?: string): SyncRegistration | undefined;
44
+ /** Atomically activates one fully staged generation for its worktree. */
45
+ export declare function publishSyncRegistration(repoRoot: string, registration: SyncRegistration, homeDirectory?: string): string;
46
+ export declare function syncStateSha256(statePath: string): string;
47
+ //#endregion
48
+ //# sourceMappingURL=syncRegistration.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syncRegistration.d.mts","names":[],"sources":["../src/services/syncRegistration/index.ts"],"mappings":";;;qBAiBa;;qBAEA;;qBAEA;iBAKI;EACf;EACA;;EAEA;EACA;EACA;;iBAGe;EACf;EACA;EACA;;YAGU,4BAA4B;iBAEvB;EACf;EACA;EACA,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;;EAEA,eAAe;;EAEf,YAAY;EACZ,SAAS;;;wBA+FK,yBAAyB,cAAc,kBAAkB,UAAU,eAAe;wBAoGlF,sBAAsB,gBAAgB,qBAAqB;;wBA4B3D,qBAAqB,kBAAkB,yBAAyB;;wBAWhE,wBACd,kBACA,cAAc,kBACd;wBAUc,gBAAgB"}
@@ -0,0 +1,159 @@
1
+ import { isRecord, writeFileAtomic } from "./runtimeJson.mjs";
2
+ import { assertSyncLocationSafe, resolveSyncLocation, syncGenerationDirectory } from "./syncLocation.mjs";
3
+ import { parseDoomServerBundle } from "./src/schemas/serverBundle.mjs";
4
+ import "./serverFacet.mjs";
5
+ import { parseDoomMcpBundle } from "./src/schemas/mcpBundle.mjs";
6
+ import "./doomPackage.mjs";
7
+ import crypto from "node:crypto";
8
+ import fs from "node:fs";
9
+ import path from "node:path";
10
+ //#region src/services/syncRegistration/index.ts
11
+ /** Current registration schema shared by sync, the managed dispatcher, and runtime consumers. */
12
+ const SYNC_REGISTRATION_VERSION = 2;
13
+ /** Legacy schema accepted only with exact producer npm-version validation. */
14
+ const LEGACY_SYNC_REGISTRATION_VERSION = 1;
15
+ /** Runtime API contract shared by synchronized generations and DoomPi releases. */
16
+ const DOOMPI_API_VERSION = 1;
17
+ const SHA256 = /^[a-f0-9]{64}$/u;
18
+ const PRIVATE_FILE_MODE = 384;
19
+ function canonicalPath(target) {
20
+ return fs.realpathSync.native(path.resolve(target));
21
+ }
22
+ function isInside(directory, target) {
23
+ const relative = path.relative(canonicalPath(directory), canonicalPath(target));
24
+ return relative === "" || !relative.startsWith("..") && !path.isAbsolute(relative);
25
+ }
26
+ function requiredString(value, field, recordPath) {
27
+ if (typeof value !== "string" || value === "") throw new Error(`Doom sync registration at ${recordPath} has an invalid ${field}`);
28
+ return value;
29
+ }
30
+ function identityFrom(value, recordPath) {
31
+ if (!isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} has no identity`);
32
+ return {
33
+ repositoryId: requiredString(value.repositoryId, "repository id", recordPath),
34
+ worktreeId: requiredString(value.worktreeId, "worktree id", recordPath)
35
+ };
36
+ }
37
+ function packageFrom(value, recordPath) {
38
+ if (!isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} has no package record`);
39
+ return {
40
+ root: requiredString(value.root, "package root", recordPath),
41
+ version: requiredString(value.version, "package version", recordPath),
42
+ ...value.apiVersion === void 0 ? {} : { apiVersion: value.apiVersion },
43
+ manifestPath: requiredString(value.manifestPath, "package manifest", recordPath),
44
+ entry: requiredString(value.entry, "package entry", recordPath)
45
+ };
46
+ }
47
+ function sha256File(filePath) {
48
+ return crypto.createHash("sha256").update(fs.readFileSync(filePath)).digest("hex");
49
+ }
50
+ function validatePackage(value, recordPath, recordVersion) {
51
+ const packageRoot = canonicalPath(value.root);
52
+ if (packageRoot !== path.resolve(value.root)) throw new Error(`Doom sync registration at ${recordPath} has a noncanonical package root`);
53
+ if (!isInside(packageRoot, value.manifestPath) || !isInside(packageRoot, value.entry)) throw new Error(`Doom sync registration at ${recordPath} references package material outside ${packageRoot}`);
54
+ if (canonicalPath(value.manifestPath) !== canonicalPath(path.join(packageRoot, "package.json"))) throw new Error(`Doom sync registration at ${recordPath} has an invalid package manifest path`);
55
+ const manifest = JSON.parse(fs.readFileSync(value.manifestPath, "utf8"));
56
+ if (manifest.name !== "@agimon-ai/doompi" || typeof manifest.version !== "string") throw new Error(`Doom sync registration at ${recordPath} does not match its DoomPi package`);
57
+ if (recordVersion === 1 && value.apiVersion === void 0) {
58
+ if (manifest.version !== value.version) throw new Error(`Doom sync registration at ${recordPath} does not match its DoomPi package`);
59
+ } else {
60
+ if (value.apiVersion === void 0) throw new Error(`Doom sync registration at ${recordPath} has no package API version`);
61
+ if (!Number.isSafeInteger(value.apiVersion) || value.apiVersion < 1) throw new Error(`Doom sync registration at ${recordPath} has an invalid package API version`);
62
+ if (manifest.doompiApiVersion !== value.apiVersion) throw new Error(`Doom sync registration at ${recordPath} has a mismatched package API version`);
63
+ if (value.apiVersion !== 1) throw new Error(`Unsupported DoomPi package API version at ${recordPath}`);
64
+ }
65
+ const extensions = manifest.pi?.extensions;
66
+ if (!Array.isArray(extensions) || !extensions.some((entry) => typeof entry === "string" && canonicalPath(path.resolve(packageRoot, entry)) === canonicalPath(value.entry))) throw new Error(`Doom sync registration at ${recordPath} does not match the package Pi entry`);
67
+ }
68
+ /** Validates one parsed registration against its canonical repository/worktree location. */
69
+ function validateSyncRegistration(registration, location) {
70
+ const recordPath = location.registrationPath;
71
+ const recordVersion = registration.version;
72
+ if (recordVersion !== 2 && recordVersion !== 1) throw new Error(`Unsupported Doom sync registration version at ${recordPath}`);
73
+ const canonicalRoot = canonicalPath(registration.root);
74
+ if (canonicalRoot !== location.root || path.resolve(registration.root) !== canonicalRoot) throw new Error(`Doom sync registration at ${recordPath} has an invalid repository root`);
75
+ if (registration.identity.repositoryId !== location.identity.repositoryId || registration.identity.worktreeId !== location.identity.worktreeId) throw new Error(`Doom sync registration at ${recordPath} belongs to another repository or worktree`);
76
+ const expectedGenerationRoot = syncGenerationDirectory(location, registration.generation);
77
+ if (path.resolve(registration.generationRoot) !== path.resolve(expectedGenerationRoot)) throw new Error(`Doom sync registration at ${recordPath} has an invalid generation root`);
78
+ const generationStat = fs.lstatSync(registration.generationRoot, { throwIfNoEntry: false });
79
+ if (!generationStat?.isDirectory() || generationStat.isSymbolicLink()) throw new Error(`Doom sync registration at ${recordPath} has an unavailable generation`);
80
+ for (const target of [registration.statePath, registration.apiDirectory]) if (!isInside(registration.generationRoot, target)) throw new Error(`Doom sync registration at ${recordPath} references material outside its generation`);
81
+ if (registration.webDirectory !== null && !isInside(registration.generationRoot, registration.webDirectory)) throw new Error(`Doom sync registration at ${recordPath} references web material outside its generation`);
82
+ if (!SHA256.test(registration.stateSha256) || sha256File(registration.statePath) !== registration.stateSha256) throw new Error(`Doom sync registration at ${recordPath} has a mismatched state hash`);
83
+ let state = {};
84
+ try {
85
+ const parsed = JSON.parse(fs.readFileSync(registration.statePath, "utf8"));
86
+ if (isRecord(parsed)) state = parsed;
87
+ } catch (error) {
88
+ if (registration.serverBundle !== void 0) throw error;
89
+ }
90
+ if (registration.serverBundle !== void 0) {
91
+ const bundle = registration.serverBundle;
92
+ if (!isInside(registration.generationRoot, bundle.path) || canonicalPath(bundle.path) !== canonicalPath(path.join(registration.apiDirectory, "server.bundle.json"))) throw new Error(`Doom sync registration at ${recordPath} has an invalid server descriptor path`);
93
+ if (!SHA256.test(bundle.sha256) || sha256File(bundle.path) !== bundle.sha256) throw new Error(`Doom sync registration at ${recordPath} has a mismatched server descriptor hash`);
94
+ const descriptor = parseDoomServerBundle(JSON.parse(fs.readFileSync(bundle.path, "utf8")));
95
+ const recorded = state.serverBundle;
96
+ if (descriptor.generation !== registration.generation || descriptor.fingerprint !== bundle.fingerprint || !isRecord(recorded) || recorded.fingerprint !== bundle.fingerprint || recorded.descriptorPath !== bundle.path) throw new Error(`Doom sync registration at ${recordPath} has mismatched server bundle identity`);
97
+ } else if (state.serverBundle !== void 0) throw new Error(`Doom sync registration at ${recordPath} is missing its server bundle record`);
98
+ if (registration.mcpBundle !== void 0) {
99
+ const bundle = registration.mcpBundle;
100
+ if (!isInside(registration.generationRoot, bundle.path) || canonicalPath(bundle.path) !== canonicalPath(path.join(registration.generationRoot, "mcp", "mcp.bundle.json"))) throw new Error(`Doom sync registration at ${recordPath} has an invalid MCP descriptor path`);
101
+ if (!SHA256.test(bundle.sha256) || sha256File(bundle.path) !== bundle.sha256) throw new Error(`Doom sync registration at ${recordPath} has a mismatched MCP descriptor hash`);
102
+ const descriptor = parseDoomMcpBundle(JSON.parse(fs.readFileSync(bundle.path, "utf8")));
103
+ const recorded = state.mcpBundle;
104
+ if (descriptor.generation !== registration.generation || descriptor.fingerprint !== bundle.fingerprint || !isRecord(recorded) || recorded.fingerprint !== bundle.fingerprint || recorded.descriptorPath !== bundle.path) throw new Error(`Doom sync registration at ${recordPath} has mismatched MCP bundle identity`);
105
+ for (const entry of descriptor.entries) {
106
+ const modulePath = path.resolve(path.dirname(bundle.path), entry.module);
107
+ if (!isInside(registration.generationRoot, modulePath) || sha256File(modulePath) !== entry.sha256) throw new Error(`Doom sync registration at ${recordPath} has a mismatched MCP artifact hash`);
108
+ }
109
+ } else if (state.mcpBundle !== void 0) throw new Error(`Doom sync registration at ${recordPath} is missing its MCP bundle record`);
110
+ validatePackage(registration.package, recordPath, recordVersion);
111
+ return registration;
112
+ }
113
+ function parseSyncRegistration(value, recordPath) {
114
+ if (!isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} is not an object`);
115
+ return {
116
+ version: value.version,
117
+ root: requiredString(value.root, "repository root", recordPath),
118
+ identity: identityFrom(value.identity, recordPath),
119
+ generation: requiredString(value.generation, "generation", recordPath),
120
+ generationRoot: requiredString(value.generationRoot, "generation root", recordPath),
121
+ statePath: requiredString(value.statePath, "state path", recordPath),
122
+ stateSha256: requiredString(value.stateSha256, "state hash", recordPath),
123
+ webDirectory: value.webDirectory === null ? null : requiredString(value.webDirectory, "web directory", recordPath),
124
+ apiDirectory: requiredString(value.apiDirectory, "API directory", recordPath),
125
+ ...value.serverBundle === void 0 ? {} : { serverBundle: bundleFrom(value.serverBundle, recordPath, "server") },
126
+ ...value.mcpBundle === void 0 ? {} : { mcpBundle: bundleFrom(value.mcpBundle, recordPath, "MCP") },
127
+ package: packageFrom(value.package, recordPath)
128
+ };
129
+ }
130
+ function bundleFrom(value, recordPath, kind) {
131
+ if (!isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} has an invalid ${kind} bundle record`);
132
+ return {
133
+ path: requiredString(value.path, "server descriptor path", recordPath),
134
+ sha256: requiredString(value.sha256, "server descriptor hash", recordPath),
135
+ fingerprint: requiredString(value.fingerprint, "server descriptor fingerprint", recordPath)
136
+ };
137
+ }
138
+ /** Reads only the exact registration for this repository/worktree. */
139
+ function readSyncRegistration(repoRoot, homeDirectory) {
140
+ const location = resolveSyncLocation(repoRoot, homeDirectory);
141
+ if (!fs.existsSync(location.registrationPath)) return void 0;
142
+ return validateSyncRegistration(parseSyncRegistration(JSON.parse(fs.readFileSync(location.registrationPath, "utf8")), location.registrationPath), location);
143
+ }
144
+ /** Atomically activates one fully staged generation for its worktree. */
145
+ function publishSyncRegistration(repoRoot, registration, homeDirectory) {
146
+ const location = resolveSyncLocation(repoRoot, homeDirectory);
147
+ assertSyncLocationSafe(location);
148
+ validateSyncRegistration(registration, location);
149
+ writeFileAtomic(location.registrationPath, `${JSON.stringify(registration, null, 2)}\n`);
150
+ fs.chmodSync(location.registrationPath, PRIVATE_FILE_MODE);
151
+ return location.registrationPath;
152
+ }
153
+ function syncStateSha256(statePath) {
154
+ return sha256File(statePath);
155
+ }
156
+ //#endregion
157
+ export { DOOMPI_API_VERSION, LEGACY_SYNC_REGISTRATION_VERSION, SYNC_REGISTRATION_VERSION, parseSyncRegistration, publishSyncRegistration, readSyncRegistration, syncStateSha256, validateSyncRegistration };
158
+
159
+ //# sourceMappingURL=syncRegistration.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syncRegistration.mjs","names":[],"sources":["../src/services/syncRegistration/index.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { DOOM_SERVER_BUNDLE_FILE, parseDoomServerBundle } from '../../exports/serverFacet';\nimport { DOOM_MCP_BUNDLE_FILE, parseDoomMcpBundle } from '../../schemas/mcpBundle';\nimport { DOOM_PACKAGE_NAME } from '../doomPackage';\nimport { isRecord, writeFileAtomic } from '../json';\nimport {\n assertSyncLocationSafe,\n resolveSyncLocation,\n syncGenerationDirectory,\n type SyncIdentity,\n type SyncLocation,\n} from '../syncLocation';\n\n/** Current registration schema shared by sync, the managed dispatcher, and runtime consumers. */\nexport const SYNC_REGISTRATION_VERSION = 2;\n/** Legacy schema accepted only with exact producer npm-version validation. */\nexport const LEGACY_SYNC_REGISTRATION_VERSION = 1;\n/** Runtime API contract shared by synchronized generations and DoomPi releases. */\nexport const DOOMPI_API_VERSION = 1;\n\nconst SHA256 = /^[a-f0-9]{64}$/u;\nconst PRIVATE_FILE_MODE = 0o600;\n\nexport interface SyncPackageRegistration {\n root: string;\n version: string;\n /** Present in registrations written by the API-versioned sync protocol. */\n apiVersion?: number;\n manifestPath: string;\n entry: string;\n}\n\nexport interface SyncServerBundleRegistration {\n path: string;\n sha256: string;\n fingerprint: string;\n}\n\nexport type SyncMcpBundleRegistration = SyncServerBundleRegistration;\n\nexport interface SyncRegistration {\n version: number;\n root: string;\n identity: SyncIdentity;\n generation: string;\n generationRoot: string;\n statePath: string;\n stateSha256: string;\n webDirectory: string | null;\n apiDirectory: string;\n /** Missing only for explicitly supported pre-cutover generations. */\n serverBundle?: SyncServerBundleRegistration;\n /** Explicit MCP runtime admitted with this generation. */\n mcpBundle?: SyncMcpBundleRegistration;\n package: SyncPackageRegistration;\n}\n\nfunction canonicalPath(target: string): string {\n return fs.realpathSync.native(path.resolve(target));\n}\n\nfunction isInside(directory: string, target: string): boolean {\n const relative = path.relative(canonicalPath(directory), canonicalPath(target));\n return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));\n}\n\nfunction requiredString(value: unknown, field: string, recordPath: string): string {\n if (typeof value !== 'string' || value === '') {\n throw new Error(`Doom sync registration at ${recordPath} has an invalid ${field}`);\n }\n return value;\n}\n\nfunction identityFrom(value: unknown, recordPath: string): SyncIdentity {\n if (!isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} has no identity`);\n return {\n repositoryId: requiredString(value.repositoryId, 'repository id', recordPath),\n worktreeId: requiredString(value.worktreeId, 'worktree id', recordPath),\n };\n}\n\nfunction packageFrom(value: unknown, recordPath: string): SyncPackageRegistration {\n if (!isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} has no package record`);\n return {\n root: requiredString(value.root, 'package root', recordPath),\n version: requiredString(value.version, 'package version', recordPath),\n ...(value.apiVersion === undefined ? {} : { apiVersion: value.apiVersion as number }),\n manifestPath: requiredString(value.manifestPath, 'package manifest', recordPath),\n entry: requiredString(value.entry, 'package entry', recordPath),\n };\n}\n\nfunction sha256File(filePath: string): string {\n return crypto.createHash('sha256').update(fs.readFileSync(filePath)).digest('hex');\n}\n\nfunction validatePackage(value: SyncPackageRegistration, recordPath: string, recordVersion: number): void {\n const packageRoot = canonicalPath(value.root);\n if (packageRoot !== path.resolve(value.root)) {\n throw new Error(`Doom sync registration at ${recordPath} has a noncanonical package root`);\n }\n if (!isInside(packageRoot, value.manifestPath) || !isInside(packageRoot, value.entry)) {\n throw new Error(`Doom sync registration at ${recordPath} references package material outside ${packageRoot}`);\n }\n if (canonicalPath(value.manifestPath) !== canonicalPath(path.join(packageRoot, 'package.json'))) {\n throw new Error(`Doom sync registration at ${recordPath} has an invalid package manifest path`);\n }\n const manifest = JSON.parse(fs.readFileSync(value.manifestPath, 'utf8')) as {\n name?: unknown;\n version?: unknown;\n doompiApiVersion?: unknown;\n pi?: { extensions?: unknown };\n };\n if (manifest.name !== DOOM_PACKAGE_NAME || typeof manifest.version !== 'string') {\n throw new Error(`Doom sync registration at ${recordPath} does not match its DoomPi package`);\n }\n if (recordVersion === LEGACY_SYNC_REGISTRATION_VERSION && value.apiVersion === undefined) {\n // Registrations written before API compatibility was persisted remain valid\n // only when their exact producer release is still installed.\n if (manifest.version !== value.version) {\n throw new Error(`Doom sync registration at ${recordPath} does not match its DoomPi package`);\n }\n } else {\n if (value.apiVersion === undefined) {\n throw new Error(`Doom sync registration at ${recordPath} has no package API version`);\n }\n if (!Number.isSafeInteger(value.apiVersion) || value.apiVersion < 1) {\n throw new Error(`Doom sync registration at ${recordPath} has an invalid package API version`);\n }\n if (manifest.doompiApiVersion !== value.apiVersion) {\n throw new Error(`Doom sync registration at ${recordPath} has a mismatched package API version`);\n }\n if (value.apiVersion !== DOOMPI_API_VERSION) {\n throw new Error(`Unsupported DoomPi package API version at ${recordPath}`);\n }\n }\n const extensions = manifest.pi?.extensions;\n if (\n !Array.isArray(extensions) ||\n !extensions.some(\n (entry) =>\n typeof entry === 'string' && canonicalPath(path.resolve(packageRoot, entry)) === canonicalPath(value.entry),\n )\n ) {\n throw new Error(`Doom sync registration at ${recordPath} does not match the package Pi entry`);\n }\n}\n\n/** Validates one parsed registration against its canonical repository/worktree location. */\nexport function validateSyncRegistration(registration: SyncRegistration, location: SyncLocation): SyncRegistration {\n const recordPath = location.registrationPath;\n const recordVersion = registration.version;\n if (recordVersion !== SYNC_REGISTRATION_VERSION && recordVersion !== LEGACY_SYNC_REGISTRATION_VERSION) {\n throw new Error(`Unsupported Doom sync registration version at ${recordPath}`);\n }\n const canonicalRoot = canonicalPath(registration.root);\n if (canonicalRoot !== location.root || path.resolve(registration.root) !== canonicalRoot) {\n throw new Error(`Doom sync registration at ${recordPath} has an invalid repository root`);\n }\n if (\n registration.identity.repositoryId !== location.identity.repositoryId ||\n registration.identity.worktreeId !== location.identity.worktreeId\n ) {\n throw new Error(`Doom sync registration at ${recordPath} belongs to another repository or worktree`);\n }\n const expectedGenerationRoot = syncGenerationDirectory(location, registration.generation);\n if (path.resolve(registration.generationRoot) !== path.resolve(expectedGenerationRoot)) {\n throw new Error(`Doom sync registration at ${recordPath} has an invalid generation root`);\n }\n const generationStat = fs.lstatSync(registration.generationRoot, { throwIfNoEntry: false });\n if (!generationStat?.isDirectory() || generationStat.isSymbolicLink()) {\n throw new Error(`Doom sync registration at ${recordPath} has an unavailable generation`);\n }\n for (const target of [registration.statePath, registration.apiDirectory]) {\n if (!isInside(registration.generationRoot, target)) {\n throw new Error(`Doom sync registration at ${recordPath} references material outside its generation`);\n }\n }\n if (registration.webDirectory !== null && !isInside(registration.generationRoot, registration.webDirectory)) {\n throw new Error(`Doom sync registration at ${recordPath} references web material outside its generation`);\n }\n if (!SHA256.test(registration.stateSha256) || sha256File(registration.statePath) !== registration.stateSha256) {\n throw new Error(`Doom sync registration at ${recordPath} has a mismatched state hash`);\n }\n let state: Record<string, unknown> = {};\n try {\n const parsed: unknown = JSON.parse(fs.readFileSync(registration.statePath, 'utf8'));\n if (isRecord(parsed)) state = parsed;\n } catch (error) {\n // Legacy state validation remains the state reader's responsibility. New\n // descriptor generations require their state identity during admission.\n if (registration.serverBundle !== undefined) throw error;\n }\n if (registration.serverBundle !== undefined) {\n const bundle = registration.serverBundle;\n if (\n !isInside(registration.generationRoot, bundle.path) ||\n canonicalPath(bundle.path) !== canonicalPath(path.join(registration.apiDirectory, DOOM_SERVER_BUNDLE_FILE))\n ) {\n throw new Error(`Doom sync registration at ${recordPath} has an invalid server descriptor path`);\n }\n if (!SHA256.test(bundle.sha256) || sha256File(bundle.path) !== bundle.sha256) {\n throw new Error(`Doom sync registration at ${recordPath} has a mismatched server descriptor hash`);\n }\n const descriptor = parseDoomServerBundle(JSON.parse(fs.readFileSync(bundle.path, 'utf8')));\n const recorded = state.serverBundle;\n if (\n descriptor.generation !== registration.generation ||\n descriptor.fingerprint !== bundle.fingerprint ||\n !isRecord(recorded) ||\n recorded.fingerprint !== bundle.fingerprint ||\n recorded.descriptorPath !== bundle.path\n ) {\n throw new Error(`Doom sync registration at ${recordPath} has mismatched server bundle identity`);\n }\n } else if (state.serverBundle !== undefined) {\n throw new Error(`Doom sync registration at ${recordPath} is missing its server bundle record`);\n }\n if (registration.mcpBundle !== undefined) {\n const bundle = registration.mcpBundle;\n if (\n !isInside(registration.generationRoot, bundle.path) ||\n canonicalPath(bundle.path) !== canonicalPath(path.join(registration.generationRoot, 'mcp', DOOM_MCP_BUNDLE_FILE))\n )\n throw new Error(`Doom sync registration at ${recordPath} has an invalid MCP descriptor path`);\n if (!SHA256.test(bundle.sha256) || sha256File(bundle.path) !== bundle.sha256)\n throw new Error(`Doom sync registration at ${recordPath} has a mismatched MCP descriptor hash`);\n const descriptor = parseDoomMcpBundle(JSON.parse(fs.readFileSync(bundle.path, 'utf8')));\n const recorded = state.mcpBundle;\n if (\n descriptor.generation !== registration.generation ||\n descriptor.fingerprint !== bundle.fingerprint ||\n !isRecord(recorded) ||\n recorded.fingerprint !== bundle.fingerprint ||\n recorded.descriptorPath !== bundle.path\n )\n throw new Error(`Doom sync registration at ${recordPath} has mismatched MCP bundle identity`);\n for (const entry of descriptor.entries) {\n const modulePath = path.resolve(path.dirname(bundle.path), entry.module);\n if (!isInside(registration.generationRoot, modulePath) || sha256File(modulePath) !== entry.sha256)\n throw new Error(`Doom sync registration at ${recordPath} has a mismatched MCP artifact hash`);\n }\n } else if (state.mcpBundle !== undefined) {\n throw new Error(`Doom sync registration at ${recordPath} is missing its MCP bundle record`);\n }\n validatePackage(registration.package, recordPath, recordVersion);\n return registration;\n}\n\nexport function parseSyncRegistration(value: unknown, recordPath: string): SyncRegistration {\n if (!isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} is not an object`);\n return {\n version: value.version as number,\n root: requiredString(value.root, 'repository root', recordPath),\n identity: identityFrom(value.identity, recordPath),\n generation: requiredString(value.generation, 'generation', recordPath),\n generationRoot: requiredString(value.generationRoot, 'generation root', recordPath),\n statePath: requiredString(value.statePath, 'state path', recordPath),\n stateSha256: requiredString(value.stateSha256, 'state hash', recordPath),\n webDirectory: value.webDirectory === null ? null : requiredString(value.webDirectory, 'web directory', recordPath),\n apiDirectory: requiredString(value.apiDirectory, 'API directory', recordPath),\n ...(value.serverBundle === undefined ? {} : { serverBundle: bundleFrom(value.serverBundle, recordPath, 'server') }),\n ...(value.mcpBundle === undefined ? {} : { mcpBundle: bundleFrom(value.mcpBundle, recordPath, 'MCP') }),\n package: packageFrom(value.package, recordPath),\n };\n}\n\nfunction bundleFrom(value: unknown, recordPath: string, kind: 'server' | 'MCP'): SyncServerBundleRegistration {\n if (!isRecord(value)) throw new Error(`Doom sync registration at ${recordPath} has an invalid ${kind} bundle record`);\n return {\n path: requiredString(value.path, 'server descriptor path', recordPath),\n sha256: requiredString(value.sha256, 'server descriptor hash', recordPath),\n fingerprint: requiredString(value.fingerprint, 'server descriptor fingerprint', recordPath),\n };\n}\n\n/** Reads only the exact registration for this repository/worktree. */\nexport function readSyncRegistration(repoRoot: string, homeDirectory?: string): SyncRegistration | undefined {\n const location = resolveSyncLocation(repoRoot, homeDirectory);\n if (!fs.existsSync(location.registrationPath)) return undefined;\n const parsed = parseSyncRegistration(\n JSON.parse(fs.readFileSync(location.registrationPath, 'utf8')),\n location.registrationPath,\n );\n return validateSyncRegistration(parsed, location);\n}\n\n/** Atomically activates one fully staged generation for its worktree. */\nexport function publishSyncRegistration(\n repoRoot: string,\n registration: SyncRegistration,\n homeDirectory?: string,\n): string {\n const location = resolveSyncLocation(repoRoot, homeDirectory);\n assertSyncLocationSafe(location);\n validateSyncRegistration(registration, location);\n writeFileAtomic(location.registrationPath, `${JSON.stringify(registration, null, 2)}\\n`);\n fs.chmodSync(location.registrationPath, PRIVATE_FILE_MODE);\n return location.registrationPath;\n}\n\nexport function syncStateSha256(statePath: string): string {\n return sha256File(statePath);\n}\n"],"mappings":";;;;;;;;;;;AAiBA,MAAa,4BAA4B;;AAEzC,MAAa,mCAAmC;;AAEhD,MAAa,qBAAqB;AAElC,MAAM,SAAS;AACf,MAAM,oBAAoB;AAoC1B,SAAS,cAAc,QAAwB;CAC7C,OAAO,GAAG,aAAa,OAAO,KAAK,QAAQ,MAAM,CAAC;AACpD;AAEA,SAAS,SAAS,WAAmB,QAAyB;CAC5D,MAAM,WAAW,KAAK,SAAS,cAAc,SAAS,GAAG,cAAc,MAAM,CAAC;CAC9E,OAAO,aAAa,MAAO,CAAC,SAAS,WAAW,IAAI,KAAK,CAAC,KAAK,WAAW,QAAQ;AACpF;AAEA,SAAS,eAAe,OAAgB,OAAe,YAA4B;CACjF,IAAI,OAAO,UAAU,YAAY,UAAU,IACzC,MAAM,IAAI,MAAM,6BAA6B,WAAW,kBAAkB,OAAO;CAEnF,OAAO;AACT;AAEA,SAAS,aAAa,OAAgB,YAAkC;CACtE,IAAI,CAAC,SAAS,KAAK,GAAG,MAAM,IAAI,MAAM,6BAA6B,WAAW,iBAAiB;CAC/F,OAAO;EACL,cAAc,eAAe,MAAM,cAAc,iBAAiB,UAAU;EAC5E,YAAY,eAAe,MAAM,YAAY,eAAe,UAAU;CACxE;AACF;AAEA,SAAS,YAAY,OAAgB,YAA6C;CAChF,IAAI,CAAC,SAAS,KAAK,GAAG,MAAM,IAAI,MAAM,6BAA6B,WAAW,uBAAuB;CACrG,OAAO;EACL,MAAM,eAAe,MAAM,MAAM,gBAAgB,UAAU;EAC3D,SAAS,eAAe,MAAM,SAAS,mBAAmB,UAAU;EACpE,GAAI,MAAM,eAAe,KAAA,IAAY,CAAC,IAAI,EAAE,YAAY,MAAM,WAAqB;EACnF,cAAc,eAAe,MAAM,cAAc,oBAAoB,UAAU;EAC/E,OAAO,eAAe,MAAM,OAAO,iBAAiB,UAAU;CAChE;AACF;AAEA,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gB,gBAAgB,WAA2B;CACzD,OAAO,WAAW,SAAS;AAC7B"}
@@ -0,0 +1,19 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/services/syncStateContract/index.ts
3
+ /**
4
+ * Bumped whenever the persisted sync-state shape changes.
5
+ *
6
+ * Version 13 carries the immutable MCP projection as file-only state. Older
7
+ * records relied on process environment and cannot safely select MCP servers
8
+ * after an in-process reload.
9
+ */
10
+ const SYNC_STATE_VERSION = 13;
11
+ /** Version 5 maps each composition fingerprint directly to its compiler manifest. */
12
+ const PRECOMPILE_STATE_VERSION = 5;
13
+ const BUNDLED_PRECOMPILE_STRATEGY = "bundle";
14
+ //#endregion
15
+ exports.BUNDLED_PRECOMPILE_STRATEGY = BUNDLED_PRECOMPILE_STRATEGY;
16
+ exports.PRECOMPILE_STATE_VERSION = PRECOMPILE_STATE_VERSION;
17
+ exports.SYNC_STATE_VERSION = SYNC_STATE_VERSION;
18
+
19
+ //# sourceMappingURL=syncStateContract.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syncStateContract.cjs","names":[],"sources":["../src/services/syncStateContract/index.ts"],"sourcesContent":["/**\n * Bumped whenever the persisted sync-state shape changes.\n *\n * Version 13 carries the immutable MCP projection as file-only state. Older\n * records relied on process environment and cannot safely select MCP servers\n * after an in-process reload.\n */\nexport const SYNC_STATE_VERSION = 13;\n\n/** Version 5 maps each composition fingerprint directly to its compiler manifest. */\nexport const PRECOMPILE_STATE_VERSION = 5;\n\nexport const BUNDLED_PRECOMPILE_STRATEGY = 'bundle';\n"],"mappings":";;;;;;;;;AAOA,MAAa,qBAAqB;;AAGlC,MAAa,2BAA2B;AAExC,MAAa,8BAA8B"}
@@ -0,0 +1,14 @@
1
+ //#region src/services/syncStateContract/index.d.ts
2
+ /**
3
+ * Bumped whenever the persisted sync-state shape changes.
4
+ *
5
+ * Version 13 carries the immutable MCP projection as file-only state. Older
6
+ * records relied on process environment and cannot safely select MCP servers
7
+ * after an in-process reload.
8
+ */
9
+ export declare const SYNC_STATE_VERSION = 13;
10
+ /** Version 5 maps each composition fingerprint directly to its compiler manifest. */
11
+ export declare const PRECOMPILE_STATE_VERSION = 5;
12
+ export declare const BUNDLED_PRECOMPILE_STRATEGY = "bundle";
13
+ //#endregion
14
+ //# sourceMappingURL=syncStateContract.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syncStateContract.d.mts","names":[],"sources":["../src/services/syncStateContract/index.ts"],"mappings":";;;;;;;;qBAOa;;qBAGA;qBAEA"}
@@ -0,0 +1,16 @@
1
+ //#region src/services/syncStateContract/index.ts
2
+ /**
3
+ * Bumped whenever the persisted sync-state shape changes.
4
+ *
5
+ * Version 13 carries the immutable MCP projection as file-only state. Older
6
+ * records relied on process environment and cannot safely select MCP servers
7
+ * after an in-process reload.
8
+ */
9
+ const SYNC_STATE_VERSION = 13;
10
+ /** Version 5 maps each composition fingerprint directly to its compiler manifest. */
11
+ const PRECOMPILE_STATE_VERSION = 5;
12
+ const BUNDLED_PRECOMPILE_STRATEGY = "bundle";
13
+ //#endregion
14
+ export { BUNDLED_PRECOMPILE_STRATEGY, PRECOMPILE_STATE_VERSION, SYNC_STATE_VERSION };
15
+
16
+ //# sourceMappingURL=syncStateContract.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syncStateContract.mjs","names":[],"sources":["../src/services/syncStateContract/index.ts"],"sourcesContent":["/**\n * Bumped whenever the persisted sync-state shape changes.\n *\n * Version 13 carries the immutable MCP projection as file-only state. Older\n * records relied on process environment and cannot safely select MCP servers\n * after an in-process reload.\n */\nexport const SYNC_STATE_VERSION = 13;\n\n/** Version 5 maps each composition fingerprint directly to its compiler manifest. */\nexport const PRECOMPILE_STATE_VERSION = 5;\n\nexport const BUNDLED_PRECOMPILE_STRATEGY = 'bundle';\n"],"mappings":";;;;;;;;AAOA,MAAa,qBAAqB;;AAGlC,MAAa,2BAA2B;AAExC,MAAa,8BAA8B"}