@agimon-ai/doompi 0.0.1-alpha.59 → 0.0.1-alpha.65

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 (295) hide show
  1. package/dist/bin/doomRunner.d.cts +1 -2
  2. package/dist/bin/doomRunner.d.cts.map +1 -1
  3. package/dist/bin/doomRunner.d.mts +1 -2
  4. package/dist/bin/doomRunner.d.mts.map +1 -1
  5. package/dist/entries/agentModel.cjs +1 -0
  6. package/dist/entries/agentModel.d.cts +2 -0
  7. package/dist/entries/agentModel.d.mts +2 -0
  8. package/dist/entries/agentModel.mjs +1 -0
  9. package/dist/src/adapters/bootstrapLocator.cjs +1 -1
  10. package/dist/src/adapters/bootstrapLocator.cjs.map +1 -1
  11. package/dist/src/adapters/bootstrapLocator.d.cts +1 -2
  12. package/dist/src/adapters/bootstrapLocator.d.cts.map +1 -1
  13. package/dist/src/adapters/bootstrapLocator.d.mts +1 -2
  14. package/dist/src/adapters/bootstrapLocator.d.mts.map +1 -1
  15. package/dist/src/adapters/bootstrapLocator.mjs +1 -1
  16. package/dist/src/adapters/bootstrapLocator.mjs.map +1 -1
  17. package/dist/src/adapters/compatibility/antigravity.d.cts +3 -4
  18. package/dist/src/adapters/compatibility/antigravity.d.cts.map +1 -1
  19. package/dist/src/adapters/compatibility/antigravity.d.mts +3 -4
  20. package/dist/src/adapters/compatibility/antigravity.d.mts.map +1 -1
  21. package/dist/src/adapters/compatibility/codex.d.cts +6 -7
  22. package/dist/src/adapters/compatibility/codex.d.cts.map +1 -1
  23. package/dist/src/adapters/compatibility/codex.d.mts +6 -7
  24. package/dist/src/adapters/compatibility/codex.d.mts.map +1 -1
  25. package/dist/src/adapters/compatibility/index.d.cts +3 -3
  26. package/dist/src/adapters/compatibility/index.d.cts.map +1 -1
  27. package/dist/src/adapters/compatibility/index.d.mts +3 -3
  28. package/dist/src/adapters/compatibility/index.d.mts.map +1 -1
  29. package/dist/src/adapters/compatibility/process.d.cts +10 -11
  30. package/dist/src/adapters/compatibility/process.d.cts.map +1 -1
  31. package/dist/src/adapters/compatibility/process.d.mts +10 -11
  32. package/dist/src/adapters/compatibility/process.d.mts.map +1 -1
  33. package/dist/src/adapters/compatibility/shared.d.cts +16 -17
  34. package/dist/src/adapters/compatibility/shared.d.cts.map +1 -1
  35. package/dist/src/adapters/compatibility/shared.d.mts +16 -17
  36. package/dist/src/adapters/compatibility/shared.d.mts.map +1 -1
  37. package/dist/src/adapters/compatibilityContext.d.cts +2 -3
  38. package/dist/src/adapters/compatibilityContext.d.cts.map +1 -1
  39. package/dist/src/adapters/compatibilityContext.d.mts +2 -3
  40. package/dist/src/adapters/compatibilityContext.d.mts.map +1 -1
  41. package/dist/src/adapters/composer.d.cts +18 -18
  42. package/dist/src/adapters/composer.d.cts.map +1 -1
  43. package/dist/src/adapters/composer.d.mts +18 -18
  44. package/dist/src/adapters/composer.d.mts.map +1 -1
  45. package/dist/src/adapters/compositionState.d.cts +3 -4
  46. package/dist/src/adapters/compositionState.d.cts.map +1 -1
  47. package/dist/src/adapters/compositionState.d.mts +3 -4
  48. package/dist/src/adapters/compositionState.d.mts.map +1 -1
  49. package/dist/src/adapters/config/harnessState.d.cts +5 -5
  50. package/dist/src/adapters/config/harnessState.d.cts.map +1 -1
  51. package/dist/src/adapters/config/harnessState.d.mts +2 -2
  52. package/dist/src/adapters/config/harnessState.d.mts.map +1 -1
  53. package/dist/src/adapters/contextApi.d.cts +3 -4
  54. package/dist/src/adapters/contextApi.d.cts.map +1 -1
  55. package/dist/src/adapters/contextApi.d.mts +3 -4
  56. package/dist/src/adapters/contextApi.d.mts.map +1 -1
  57. package/dist/src/adapters/contextDetailStore.d.cts +1 -2
  58. package/dist/src/adapters/contextDetailStore.d.cts.map +1 -1
  59. package/dist/src/adapters/contextDetailStore.d.mts +1 -2
  60. package/dist/src/adapters/contextDetailStore.d.mts.map +1 -1
  61. package/dist/src/adapters/harnessContext.d.cts +4 -5
  62. package/dist/src/adapters/harnessContext.d.cts.map +1 -1
  63. package/dist/src/adapters/harnessContext.d.mts +4 -5
  64. package/dist/src/adapters/harnessContext.d.mts.map +1 -1
  65. package/dist/src/adapters/launchPlan.d.cts +5 -6
  66. package/dist/src/adapters/launchPlan.d.cts.map +1 -1
  67. package/dist/src/adapters/launchPlan.d.mts +5 -6
  68. package/dist/src/adapters/launchPlan.d.mts.map +1 -1
  69. package/dist/src/adapters/launcherComposition.cjs +1 -1
  70. package/dist/src/adapters/launcherComposition.cjs.map +1 -1
  71. package/dist/src/adapters/launcherComposition.mjs +1 -1
  72. package/dist/src/adapters/launcherComposition.mjs.map +1 -1
  73. package/dist/src/adapters/layerPackageInstaller.d.cts +5 -6
  74. package/dist/src/adapters/layerPackageInstaller.d.cts.map +1 -1
  75. package/dist/src/adapters/layerPackageInstaller.d.mts +5 -6
  76. package/dist/src/adapters/layerPackageInstaller.d.mts.map +1 -1
  77. package/dist/src/adapters/mcpSchemaCost.d.cts +1 -2
  78. package/dist/src/adapters/mcpSchemaCost.d.cts.map +1 -1
  79. package/dist/src/adapters/mcpSchemaCost.d.mts +1 -2
  80. package/dist/src/adapters/mcpSchemaCost.d.mts.map +1 -1
  81. package/dist/src/adapters/modules/moduleResolution.d.cts +14 -15
  82. package/dist/src/adapters/modules/moduleResolution.d.cts.map +1 -1
  83. package/dist/src/adapters/modules/moduleResolution.d.mts +14 -15
  84. package/dist/src/adapters/modules/moduleResolution.d.mts.map +1 -1
  85. package/dist/src/adapters/packageBootstrap.d.cts +2 -2
  86. package/dist/src/adapters/packageBootstrap.d.cts.map +1 -1
  87. package/dist/src/adapters/packageBootstrap.d.mts +2 -2
  88. package/dist/src/adapters/packageBootstrap.d.mts.map +1 -1
  89. package/dist/src/adapters/piSettings.d.cts +10 -11
  90. package/dist/src/adapters/piSettings.d.cts.map +1 -1
  91. package/dist/src/adapters/piSettings.d.mts +10 -11
  92. package/dist/src/adapters/piSettings.d.mts.map +1 -1
  93. package/dist/src/adapters/projectPiSettings.d.cts +7 -8
  94. package/dist/src/adapters/projectPiSettings.d.cts.map +1 -1
  95. package/dist/src/adapters/projectPiSettings.d.mts +7 -8
  96. package/dist/src/adapters/projectPiSettings.d.mts.map +1 -1
  97. package/dist/src/adapters/repository/repository.d.cts +3 -4
  98. package/dist/src/adapters/repository/repository.d.cts.map +1 -1
  99. package/dist/src/adapters/repository/repository.d.mts +3 -4
  100. package/dist/src/adapters/repository/repository.d.mts.map +1 -1
  101. package/dist/src/adapters/runtimeBundle.d.cts +4 -5
  102. package/dist/src/adapters/runtimeBundle.d.cts.map +1 -1
  103. package/dist/src/adapters/runtimeBundle.d.mts +4 -5
  104. package/dist/src/adapters/runtimeBundle.d.mts.map +1 -1
  105. package/dist/src/adapters/runtimeIdentity.d.cts +2 -3
  106. package/dist/src/adapters/runtimeIdentity.d.cts.map +1 -1
  107. package/dist/src/adapters/runtimeIdentity.d.mts +2 -3
  108. package/dist/src/adapters/runtimeIdentity.d.mts.map +1 -1
  109. package/dist/src/adapters/serialization/json.d.cts +5 -6
  110. package/dist/src/adapters/serialization/json.d.cts.map +1 -1
  111. package/dist/src/adapters/serialization/json.d.mts +5 -6
  112. package/dist/src/adapters/serialization/json.d.mts.map +1 -1
  113. package/dist/src/adapters/syncDrift.d.cts +5 -6
  114. package/dist/src/adapters/syncDrift.d.cts.map +1 -1
  115. package/dist/src/adapters/syncDrift.d.mts +5 -6
  116. package/dist/src/adapters/syncDrift.d.mts.map +1 -1
  117. package/dist/src/adapters/syncLocation.d.cts +2 -3
  118. package/dist/src/adapters/syncLocation.d.cts.map +1 -1
  119. package/dist/src/adapters/syncLocation.d.mts +2 -3
  120. package/dist/src/adapters/syncLocation.d.mts.map +1 -1
  121. package/dist/src/adapters/syncRegistration.d.cts +3 -4
  122. package/dist/src/adapters/syncRegistration.d.cts.map +1 -1
  123. package/dist/src/adapters/syncRegistration.d.mts +3 -4
  124. package/dist/src/adapters/syncRegistration.d.mts.map +1 -1
  125. package/dist/src/adapters/syncState.d.cts +30 -30
  126. package/dist/src/adapters/syncState.d.cts.map +1 -1
  127. package/dist/src/adapters/syncState.d.mts +30 -30
  128. package/dist/src/adapters/syncState.d.mts.map +1 -1
  129. package/dist/src/adapters/syncStateContract.d.cts +1 -2
  130. package/dist/src/adapters/syncStateContract.d.cts.map +1 -1
  131. package/dist/src/adapters/syncStateContract.d.mts +1 -2
  132. package/dist/src/adapters/syncStateContract.d.mts.map +1 -1
  133. package/dist/src/adapters/syncedRuntimeBuilder.d.cts +3 -4
  134. package/dist/src/adapters/syncedRuntimeBuilder.d.cts.map +1 -1
  135. package/dist/src/adapters/syncedRuntimeBuilder.d.mts +3 -4
  136. package/dist/src/adapters/syncedRuntimeBuilder.d.mts.map +1 -1
  137. package/dist/src/adapters/telemetry/logSinkTelemetry.d.cts +9 -10
  138. package/dist/src/adapters/telemetry/logSinkTelemetry.d.cts.map +1 -1
  139. package/dist/src/adapters/telemetry/logSinkTelemetry.d.mts +9 -10
  140. package/dist/src/adapters/telemetry/logSinkTelemetry.d.mts.map +1 -1
  141. package/dist/src/commands/baseCommand.d.cts +1 -2
  142. package/dist/src/commands/baseCommand.d.cts.map +1 -1
  143. package/dist/src/commands/baseCommand.d.mts +1 -2
  144. package/dist/src/commands/baseCommand.d.mts.map +1 -1
  145. package/dist/src/commands/cli/cliApp.d.cts +3 -4
  146. package/dist/src/commands/cli/cliApp.d.cts.map +1 -1
  147. package/dist/src/commands/cli/cliApp.d.mts +3 -4
  148. package/dist/src/commands/cli/cliApp.d.mts.map +1 -1
  149. package/dist/src/commands/cli/compatibilityOptions.d.cts +2 -3
  150. package/dist/src/commands/cli/compatibilityOptions.d.cts.map +1 -1
  151. package/dist/src/commands/cli/compatibilityOptions.d.mts +2 -3
  152. package/dist/src/commands/cli/compatibilityOptions.d.mts.map +1 -1
  153. package/dist/src/commands/cli/harnessOptions.d.cts +2 -3
  154. package/dist/src/commands/cli/harnessOptions.d.cts.map +1 -1
  155. package/dist/src/commands/cli/harnessOptions.d.mts +2 -3
  156. package/dist/src/commands/cli/harnessOptions.d.mts.map +1 -1
  157. package/dist/src/commands/cli/help.d.cts +2 -3
  158. package/dist/src/commands/cli/help.d.cts.map +1 -1
  159. package/dist/src/commands/cli/help.d.mts +2 -3
  160. package/dist/src/commands/cli/help.d.mts.map +1 -1
  161. package/dist/src/commands/cli/matrixOptions.d.cts +27 -28
  162. package/dist/src/commands/cli/matrixOptions.d.cts.map +1 -1
  163. package/dist/src/commands/cli/matrixOptions.d.mts +27 -28
  164. package/dist/src/commands/cli/matrixOptions.d.mts.map +1 -1
  165. package/dist/src/commands/cli/options.cjs +1 -1
  166. package/dist/src/commands/cli/options.cjs.map +1 -1
  167. package/dist/src/commands/cli/options.d.cts +1 -2
  168. package/dist/src/commands/cli/options.d.cts.map +1 -1
  169. package/dist/src/commands/cli/options.d.mts +1 -2
  170. package/dist/src/commands/cli/options.d.mts.map +1 -1
  171. package/dist/src/commands/cli/options.mjs +1 -1
  172. package/dist/src/commands/cli/options.mjs.map +1 -1
  173. package/dist/src/commands/compatibilityCommand.d.cts +1 -2
  174. package/dist/src/commands/compatibilityCommand.d.cts.map +1 -1
  175. package/dist/src/commands/compatibilityCommand.d.mts +1 -2
  176. package/dist/src/commands/compatibilityCommand.d.mts.map +1 -1
  177. package/dist/src/commands/emitMcpCommand.d.cts +1 -2
  178. package/dist/src/commands/emitMcpCommand.d.cts.map +1 -1
  179. package/dist/src/commands/emitMcpCommand.d.mts +1 -2
  180. package/dist/src/commands/emitMcpCommand.d.mts.map +1 -1
  181. package/dist/src/commands/explainCommand.d.cts +4 -5
  182. package/dist/src/commands/explainCommand.d.cts.map +1 -1
  183. package/dist/src/commands/explainCommand.d.mts +4 -5
  184. package/dist/src/commands/explainCommand.d.mts.map +1 -1
  185. package/dist/src/commands/initCommand.d.cts +1 -2
  186. package/dist/src/commands/initCommand.d.cts.map +1 -1
  187. package/dist/src/commands/initCommand.d.mts +1 -2
  188. package/dist/src/commands/initCommand.d.mts.map +1 -1
  189. package/dist/src/commands/initPresenter.d.cts +1 -2
  190. package/dist/src/commands/initPresenter.d.cts.map +1 -1
  191. package/dist/src/commands/initPresenter.d.mts +1 -2
  192. package/dist/src/commands/initPresenter.d.mts.map +1 -1
  193. package/dist/src/commands/launchCommand.d.cts +5 -6
  194. package/dist/src/commands/launchCommand.d.cts.map +1 -1
  195. package/dist/src/commands/launchCommand.d.mts +5 -6
  196. package/dist/src/commands/launchCommand.d.mts.map +1 -1
  197. package/dist/src/commands/syncCommand.d.cts +10 -11
  198. package/dist/src/commands/syncCommand.d.cts.map +1 -1
  199. package/dist/src/commands/syncCommand.d.mts +10 -11
  200. package/dist/src/commands/syncCommand.d.mts.map +1 -1
  201. package/dist/src/commands/syncPresenter.d.cts +1 -2
  202. package/dist/src/commands/syncPresenter.d.cts.map +1 -1
  203. package/dist/src/commands/syncPresenter.d.mts +1 -2
  204. package/dist/src/commands/syncPresenter.d.mts.map +1 -1
  205. package/dist/src/extensions/entries/agentModel.cjs +2 -0
  206. package/dist/src/extensions/entries/agentModel.cjs.map +1 -0
  207. package/dist/src/extensions/entries/agentModel.d.cts +22 -0
  208. package/dist/src/extensions/entries/agentModel.d.cts.map +1 -0
  209. package/dist/src/extensions/entries/agentModel.d.mts +22 -0
  210. package/dist/src/extensions/entries/agentModel.d.mts.map +1 -0
  211. package/dist/src/extensions/entries/agentModel.mjs +2 -0
  212. package/dist/src/extensions/entries/agentModel.mjs.map +1 -0
  213. package/dist/src/extensions/entries/cordisFinalizer.d.cts +2 -2
  214. package/dist/src/extensions/entries/cordisFinalizer.d.cts.map +1 -1
  215. package/dist/src/extensions/entries/cordisFinalizer.d.mts +2 -2
  216. package/dist/src/extensions/entries/cordisFinalizer.d.mts.map +1 -1
  217. package/dist/src/extensions/entries/cordisHost.d.cts +2 -2
  218. package/dist/src/extensions/entries/cordisHost.d.cts.map +1 -1
  219. package/dist/src/extensions/entries/cordisHost.d.mts +2 -2
  220. package/dist/src/extensions/entries/cordisHost.d.mts.map +1 -1
  221. package/dist/src/extensions/entries/doom.d.cts +2 -2
  222. package/dist/src/extensions/entries/doom.d.cts.map +1 -1
  223. package/dist/src/extensions/entries/doom.d.mts +2 -2
  224. package/dist/src/extensions/entries/doom.d.mts.map +1 -1
  225. package/dist/src/extensions/entries/effort.d.cts +3 -4
  226. package/dist/src/extensions/entries/effort.d.cts.map +1 -1
  227. package/dist/src/extensions/entries/effort.d.mts +3 -4
  228. package/dist/src/extensions/entries/effort.d.mts.map +1 -1
  229. package/dist/src/extensions/entries/launcherBootstrap.d.cts +2 -2
  230. package/dist/src/extensions/entries/launcherBootstrap.d.cts.map +1 -1
  231. package/dist/src/extensions/entries/launcherBootstrap.d.mts +2 -2
  232. package/dist/src/extensions/entries/launcherBootstrap.d.mts.map +1 -1
  233. package/dist/src/extensions/entries/modeCatalog.d.cts +2 -2
  234. package/dist/src/extensions/entries/modeCatalog.d.cts.map +1 -1
  235. package/dist/src/extensions/entries/modeCatalog.d.mts +2 -2
  236. package/dist/src/extensions/entries/modeCatalog.d.mts.map +1 -1
  237. package/dist/src/extensions/entries/ollamaProvider.d.mts +1 -2
  238. package/dist/src/extensions/entries/ollamaProvider.d.mts.map +1 -1
  239. package/dist/src/extensions/entries/styleSystem.cjs +1 -1
  240. package/dist/src/extensions/entries/styleSystem.cjs.map +1 -1
  241. package/dist/src/extensions/entries/styleSystem.d.cts +8 -9
  242. package/dist/src/extensions/entries/styleSystem.d.cts.map +1 -1
  243. package/dist/src/extensions/entries/styleSystem.d.mts +8 -9
  244. package/dist/src/extensions/entries/styleSystem.d.mts.map +1 -1
  245. package/dist/src/extensions/entries/styleSystem.mjs +1 -1
  246. package/dist/src/extensions/entries/styleSystem.mjs.map +1 -1
  247. package/dist/src/extensions/entries/transitionCoordinator.d.cts +3 -3
  248. package/dist/src/extensions/entries/transitionCoordinator.d.cts.map +1 -1
  249. package/dist/src/extensions/entries/transitionCoordinator.d.mts +3 -3
  250. package/dist/src/extensions/entries/transitionCoordinator.d.mts.map +1 -1
  251. package/dist/src/services/config/projectTrust.d.cts +5 -5
  252. package/dist/src/services/config/projectTrust.d.cts.map +1 -1
  253. package/dist/src/services/config/projectTrust.d.mts +5 -5
  254. package/dist/src/services/config/projectTrust.d.mts.map +1 -1
  255. package/dist/src/services/contextProjection.d.cts +1 -2
  256. package/dist/src/services/contextProjection.d.cts.map +1 -1
  257. package/dist/src/services/contextProjection.d.mts +1 -2
  258. package/dist/src/services/contextProjection.d.mts.map +1 -1
  259. package/dist/src/services/extensionAssembler.cjs +1 -1
  260. package/dist/src/services/extensionAssembler.cjs.map +1 -1
  261. package/dist/src/services/extensionAssembler.d.cts +15 -16
  262. package/dist/src/services/extensionAssembler.d.cts.map +1 -1
  263. package/dist/src/services/extensionAssembler.d.mts +15 -16
  264. package/dist/src/services/extensionAssembler.d.mts.map +1 -1
  265. package/dist/src/services/extensionAssembler.mjs +1 -1
  266. package/dist/src/services/extensionAssembler.mjs.map +1 -1
  267. package/dist/src/services/modeCatalog.cjs +1 -1
  268. package/dist/src/services/modeCatalog.cjs.map +1 -1
  269. package/dist/src/services/modeCatalog.d.cts +2 -3
  270. package/dist/src/services/modeCatalog.d.cts.map +1 -1
  271. package/dist/src/services/modeCatalog.d.mts +2 -3
  272. package/dist/src/services/modeCatalog.d.mts.map +1 -1
  273. package/dist/src/services/modeCatalog.mjs +1 -1
  274. package/dist/src/services/modeCatalog.mjs.map +1 -1
  275. package/dist/src/services/tools/toolNames.d.cts +2 -3
  276. package/dist/src/services/tools/toolNames.d.cts.map +1 -1
  277. package/dist/src/services/tools/toolNames.d.mts +2 -3
  278. package/dist/src/services/tools/toolNames.d.mts.map +1 -1
  279. package/dist/src/services/transitionClassifier.d.cts +2 -3
  280. package/dist/src/services/transitionClassifier.d.cts.map +1 -1
  281. package/dist/src/services/transitionClassifier.d.mts +2 -3
  282. package/dist/src/services/transitionClassifier.d.mts.map +1 -1
  283. package/dist/src/types/contextApi.d.cts +13 -14
  284. package/dist/src/types/contextApi.d.cts.map +1 -1
  285. package/dist/src/types/contextApi.d.mts +13 -14
  286. package/dist/src/types/contextApi.d.mts.map +1 -1
  287. package/dist/src/types/interfaces/compatibility.d.cts +3 -4
  288. package/dist/src/types/interfaces/compatibility.d.cts.map +1 -1
  289. package/dist/src/types/interfaces/compatibility.d.mts +3 -4
  290. package/dist/src/types/interfaces/compatibility.d.mts.map +1 -1
  291. package/dist/src/types/interfaces/harness.d.cts +4 -5
  292. package/dist/src/types/interfaces/harness.d.cts.map +1 -1
  293. package/dist/src/types/interfaces/harness.d.mts +4 -5
  294. package/dist/src/types/interfaces/harness.d.mts.map +1 -1
  295. package/package.json +27 -22
@@ -7,7 +7,6 @@
7
7
  * closure. The Runner package's own entry only self-invokes when it is argv[1],
8
8
  * which it is not once this shim imports it by absolute path.
9
9
  */
10
- declare function main(argv?: readonly string[]): Promise<number>;
10
+ export declare function main(argv?: readonly string[]): Promise<number>;
11
11
  //#endregion
12
- export { main };
13
12
  //# sourceMappingURL=doomRunner.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"doomRunner.d.cts","names":[],"sources":["../../src/bin/doomRunner.ts"],"mappings":";;;;;;;;;iBAqBsB,KAAK,2BAAkD"}
1
+ {"version":3,"file":"doomRunner.d.cts","names":[],"sources":["../../src/bin/doomRunner.ts"],"mappings":";;;;;;;;;wBAqBsB,KAAK,2BAAkD"}
@@ -7,7 +7,6 @@
7
7
  * closure. The Runner package's own entry only self-invokes when it is argv[1],
8
8
  * which it is not once this shim imports it by absolute path.
9
9
  */
10
- declare function main(argv?: readonly string[]): Promise<number>;
10
+ export declare function main(argv?: readonly string[]): Promise<number>;
11
11
  //#endregion
12
- export { main };
13
12
  //# sourceMappingURL=doomRunner.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"doomRunner.d.mts","names":[],"sources":["../../src/bin/doomRunner.ts"],"mappings":";;;;;;;;;iBAqBsB,KAAK,2BAAkD"}
1
+ {"version":3,"file":"doomRunner.d.mts","names":[],"sources":["../../src/bin/doomRunner.ts"],"mappings":";;;;;;;;;wBAqBsB,KAAK,2BAAkD"}
@@ -0,0 +1 @@
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../src/extensions/entries/agentModel.cjs");exports.agentModelExtension=e.agentModelExtension,exports.default=e.agentModelExtension,exports.publishAgentModel=e.publishAgentModel;
@@ -0,0 +1,2 @@
1
+ import { agentModelExtension, publishAgentModel } from "../src/extensions/entries/agentModel.cjs";
2
+ export { agentModelExtension, agentModelExtension as default, publishAgentModel };
@@ -0,0 +1,2 @@
1
+ import { agentModelExtension, publishAgentModel } from "../src/extensions/entries/agentModel.mjs";
2
+ export { agentModelExtension, agentModelExtension as default, publishAgentModel };
@@ -0,0 +1 @@
1
+ import{agentModelExtension as e,publishAgentModel as t}from"../src/extensions/entries/agentModel.mjs";export{e as agentModelExtension,e as default,t as publishAgentModel};
@@ -1,2 +1,2 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("./repository/repository.cjs"),n=require("./syncRegistration.cjs");require("./syncStateContract.cjs");const r=require("./syncState.cjs");let i=require("node:url"),a=require("node:path");a=e.__toESM(a,1);let o=require("node:crypto");o=e.__toESM(o,1);let s=require("node:fs");s=e.__toESM(s,1);let c=require("node:os");c=e.__toESM(c,1);const l=new Map;function u(e){try{return o.default.createHash(`sha256`).update(s.default.readFileSync(e)).digest(`hex`)}catch{return}}function d(e){let t;try{t=s.default.statSync(e)}catch{return}if(!t.isFile())return;let n=u(e);if(n!==void 0)return{path:e,size:t.size,mtimeMs:t.mtimeMs,sha256:n}}function f(e){if(m(e)&&typeof e.path==`string`&&typeof e.size==`number`&&typeof e.mtimeMs==`number`&&typeof e.sha256==`string`)return{path:e.path,size:e.size,mtimeMs:e.mtimeMs,sha256:e.sha256}}function p(e){let t=[],n=o.default.createHash(`sha256`);for(let r of e){let e;try{e=s.default.statSync(r.path)}catch{return!1}if(!e.isFile())return!1;n.update(`${r.path} ${String(e.size)} ${String(e.mtimeMs)} `),(e.size!==r.size||e.mtimeMs!==r.mtimeMs)&&t.push(r)}if(t.length===0)return!0;let r=n.digest(`hex`),i=l.get(r);if(i!==void 0)return i;let a=t.every(e=>u(e.path)===e.sha256);return l.set(r,a),a}function m(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function h(e){return m(e)?Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`)):{}}function g(e){let t=a.default.resolve(e);try{return s.default.realpathSync(t)}catch{let e=a.default.dirname(t);return e===t?t:a.default.join(g(e),a.default.basename(t))}}function _(e,t){let n=a.default.relative(g(e),g(t));return n===``||!n.startsWith(`..`)&&!a.default.isAbsolute(n)}function v(e=require("url").pathToFileURL(__filename).href){let t=process.env.DOOMPI_BOOTSTRAP_ENTRY;if(t)return t;let n=e.endsWith(`.ts`)?`ts`:`mjs`,r=a.default.dirname(a.default.dirname((0,i.fileURLToPath)(e)));return a.default.join(r,`extensions`,`entries`,`doom.${n}`)}function y(e,t){return n.readSyncRegistration(e,t)!==void 0}function b(e,n=c.default.homedir()){if(y(e,n))return g(e);let r=t.resolveDoomConfigurationRoot(e,n);return y(r,n)?g(r):void 0}function x(e,t=c.default.homedir()){let i=n.readSyncRegistration(e,t);if(!i)return;let a=i.statePath,o=i.generationRoot,s=r.readSyncState(e,t);if(!s)return;let l=typeof s.bootstrap==`string`?s.bootstrap:void 0;if(l&&!_(o,l))throw Error(`Doom bootstrap must stay inside ${o}: ${l}`);let u;if(s.precompile!==void 0){let e=s.precompile;if(!m(e)||typeof e.version!=`number`||e.strategy!==`bundle`||typeof e.bootstrapEntry!=`string`||typeof e.bootstrapManifest!=`string`||!m(e.bundleManifests)||Object.values(e.bundleManifests).some(e=>typeof e!=`string`))throw Error(`Doom sync state at ${a} has an invalid precompile record`);u={version:e.version,strategy:e.strategy,bootstrapEntry:e.bootstrapEntry,bootstrapManifest:e.bootstrapManifest,bundleManifests:e.bundleManifests}}return{statePath:a,generatedDirectory:o,bootstrap:l,bundles:h(s.bundles),precompile:u}}function S(e,t){if(_(t,e))try{let n=JSON.parse(s.default.readFileSync(e,`utf8`));if(!m(n)||typeof n.output!=`string`||!Array.isArray(n.artifacts)||n.artifacts.some(e=>typeof e!=`string`)||!Array.isArray(n.entries)||n.entries.some(e=>typeof e!=`string`)||!Array.isArray(n.inputs))return;let r=[];for(let e of n.inputs){let t=f(e);if(t===void 0)return;r.push(t)}let i=n.artifacts,a=n.entries;return!_(t,n.output)||i.some(e=>!_(t,e))?void 0:{output:n.output,artifacts:i,entries:a,inputs:r}}catch{return}}function C(e){return!s.default.existsSync(e.output)||e.artifacts.some(e=>!s.default.existsSync(e))?!1:p(e.inputs)}function w(e,t){if(!e.bootstrap||!e.precompile||e.precompile.version!==5||g(e.precompile.bootstrapEntry)!==g(t))return;let n=S(e.precompile.bootstrapManifest,e.generatedDirectory);if(!(!n||!C(n)||n.output!==e.bootstrap||n.entries.length!==1||g(n.entries[0]??``)!==g(t)))return n}function T(e,t,n=c.default.homedir()){let r=x(e,n),i=t??v();return r?{bootstrap:r.bootstrap,fresh:w(r,i)!==void 0}:{bootstrap:void 0,fresh:!1}}function E(e,t,n=c.default.homedir()){let r=x(e,n),i=r?.bundles[t],a=r?.precompile?.bundleManifests[t];if(!r||r.precompile?.version!==5||!i||!a)return{bundle:i,fresh:!1};let o=S(a,r.generatedDirectory);return{bundle:i,fresh:!!(o&&o.output===i&&C(o))}}function D(e,t,n=c.default.homedir()){let r=x(e,n),i=t??v();if(!r?.bootstrap||!r.precompile||!w(r,i))return{bootstrap:r?.bootstrap,fresh:!1};let a=Object.values(r.precompile.bundleManifests);if(new Set(a).size!==a.length)return{bootstrap:r.bootstrap,fresh:!1};let o=Object.entries(r.bundles).every(([e,t])=>{let n=r.precompile?.bundleManifests[e];if(!n)return!1;let i=S(n,r.generatedDirectory);return!!(i&&i.output===t&&C(i))});return{bootstrap:r.bootstrap,fresh:o}}exports.findSyncedRoot=b,exports.fingerprintInput=d,exports.inputsAreFresh=p,exports.parseInputFingerprint=f,exports.readBootstrapStatus=D,exports.readBundleStatus=E,exports.readStartupBootstrapStatus=T;
1
+ const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("./repository/repository.cjs"),n=require("./syncRegistration.cjs");require("./syncStateContract.cjs");const r=require("./syncState.cjs");let i=require("node:url"),a=require("node:path");a=e.__toESM(a,1);let o=require("node:crypto");o=e.__toESM(o,1);let s=require("node:fs");s=e.__toESM(s,1);let c=require("node:os");c=e.__toESM(c,1);const l=new Map;function u(e){try{return o.default.createHash(`sha256`).update(s.default.readFileSync(e)).digest(`hex`)}catch{return}}function d(e){let t;try{t=s.default.statSync(e)}catch{return}if(!t.isFile())return;let n=u(e);if(n!==void 0)return{path:e,size:t.size,mtimeMs:t.mtimeMs,sha256:n}}function f(e){if(m(e)&&typeof e.path==`string`&&typeof e.size==`number`&&typeof e.mtimeMs==`number`&&typeof e.sha256==`string`)return{path:e.path,size:e.size,mtimeMs:e.mtimeMs,sha256:e.sha256}}function p(e){let t=[],n=o.default.createHash(`sha256`);for(let r of e){let e;try{e=s.default.statSync(r.path)}catch{return!1}if(!e.isFile())return!1;n.update(`${r.path} ${String(e.size)} ${String(e.mtimeMs)} `),(e.size!==r.size||e.mtimeMs!==r.mtimeMs)&&t.push(r)}if(t.length===0)return!0;let r=n.digest(`hex`),i=l.get(r);if(i!==void 0)return i;let a=t.every(e=>u(e.path)===e.sha256);return l.set(r,a),a}function m(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function h(e){return m(e)?Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`)):{}}function g(e){let t=a.default.resolve(e);try{return s.default.realpathSync(t)}catch{let e=a.default.dirname(t);return e===t?t:a.default.join(g(e),a.default.basename(t))}}function _(e,t){let n=a.default.relative(g(e),g(t));return n===``||!n.startsWith(`..`)&&!a.default.isAbsolute(n)}function v(e=require("url").pathToFileURL(__filename).href){let t=process.env.DOOMPI_BOOTSTRAP_ENTRY;if(t)return t;let n=e.endsWith(`.ts`)?`ts`:`mjs`,r=a.default.dirname(a.default.dirname((0,i.fileURLToPath)(e)));return a.default.join(r,`extensions`,`entries`,`doom.${n}`)}function y(e,t){return n.readSyncRegistration(e,t)!==void 0}function b(e,n=c.default.homedir()){if(y(e,n))return g(e);let r=t.resolveDoomConfigurationRoot(e,n);return y(r,n)?g(r):void 0}function x(e,t=c.default.homedir()){let i=n.readSyncRegistration(e,t);if(!i)return;let a=i.statePath,o=i.generationRoot,s=r.readSyncState(e,t);if(!s)return;let l=typeof s.bootstrap==`string`?s.bootstrap:void 0;if(l&&!_(o,l))throw Error(`Doom bootstrap must stay inside ${o}: ${l}`);let u;if(s.precompile!==void 0){let e=s.precompile;if(!m(e)||typeof e.version!=`number`||e.strategy!==`bundle`||typeof e.bootstrapEntry!=`string`||typeof e.bootstrapManifest!=`string`||!m(e.bundleManifests)||Object.values(e.bundleManifests).some(e=>typeof e!=`string`))throw Error(`Doom sync state at ${a} has an invalid precompile record`);u={version:e.version,strategy:e.strategy,bootstrapEntry:e.bootstrapEntry,bootstrapManifest:e.bootstrapManifest,bundleManifests:e.bundleManifests}}return{statePath:a,generatedDirectory:o,bootstrap:l,bundles:h(s.bundles),precompile:u}}function S(e,t){if(_(t,e))try{let n=JSON.parse(s.default.readFileSync(e,`utf8`));if(!m(n)||typeof n.output!=`string`||!Array.isArray(n.artifacts)||n.artifacts.some(e=>typeof e!=`string`)||!Array.isArray(n.entries)||n.entries.some(e=>typeof e!=`string`)||!Array.isArray(n.inputs))return;let r=[];for(let e of n.inputs){let t=f(e);if(t===void 0)return;r.push(t)}let i=n.artifacts,a=n.entries;return!_(t,n.output)||i.some(e=>!_(t,e))?void 0:{output:n.output,artifacts:i,entries:a,inputs:r}}catch{return}}function C(e){return!s.default.existsSync(e.output)||e.artifacts.some(e=>!s.default.existsSync(e))?!1:p(e.inputs)}function w(e,t){if(!e.bootstrap||!e.precompile||e.precompile.version!==5||g(e.precompile.bootstrapEntry)!==g(t))return;let n=S(e.precompile.bootstrapManifest,e.generatedDirectory);if(n&&C(n)&&n.output===e.bootstrap&&n.entries.length===1&&g(n.entries[0]??``)===g(t))return n}function T(e,t,n=c.default.homedir()){let r=x(e,n),i=t??v();return r?{bootstrap:r.bootstrap,fresh:w(r,i)!==void 0}:{bootstrap:void 0,fresh:!1}}function E(e,t,n=c.default.homedir()){let r=x(e,n),i=r?.bundles[t],a=r?.precompile?.bundleManifests[t];if(!r||r.precompile?.version!==5||!i||!a)return{bundle:i,fresh:!1};let o=S(a,r.generatedDirectory);return{bundle:i,fresh:!!(o&&o.output===i&&C(o))}}function D(e,t,n=c.default.homedir()){let r=x(e,n),i=t??v();if(!r?.bootstrap||!r.precompile||!w(r,i))return{bootstrap:r?.bootstrap,fresh:!1};let a=Object.values(r.precompile.bundleManifests);if(new Set(a).size!==a.length)return{bootstrap:r.bootstrap,fresh:!1};let o=Object.entries(r.bundles).every(([e,t])=>{let n=r.precompile?.bundleManifests[e];if(!n)return!1;let i=S(n,r.generatedDirectory);return!!(i&&i.output===t&&C(i))});return{bootstrap:r.bootstrap,fresh:o}}exports.findSyncedRoot=b,exports.fingerprintInput=d,exports.inputsAreFresh=p,exports.parseInputFingerprint=f,exports.readBootstrapStatus=D,exports.readBundleStatus=E,exports.readStartupBootstrapStatus=T;
2
2
  //# sourceMappingURL=bootstrapLocator.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrapLocator.cjs","names":["crypto","fs","path","fileURLToPath","readSyncRegistration","os","resolveDoomConfigurationRoot","readSyncState"],"sources":["../../../src/adapters/bootstrapLocator.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { resolveDoomConfigurationRoot } from './repository/repository.ts';\nimport { readSyncRegistration } from './syncRegistration.ts';\nimport { readSyncState } from './syncState.ts';\nimport { BUNDLED_PRECOMPILE_STRATEGY, PRECOMPILE_STATE_VERSION } from './syncStateContract.ts';\n\nconst BOOTSTRAP_ENTRY_ENV = 'DOOMPI_BOOTSTRAP_ENTRY';\n\n/**\n * One recorded build input: the stat pair for speed, the digest for truth.\n *\n * Comparing only `size` and `mtimeMs` makes every rebuild look like a change,\n * including one that restored byte-identical output from a build cache, and a\n * sync triggered that way republishes a generation nobody asked for. Comparing\n * content alone is correct but reads every input on every check, and the\n * cockpit polls this. Recording both lets the stat pair answer the common\n * \"nothing was touched\" case without opening a file, while the digest stays the\n * authority for anything whose stat moved.\n */\nexport interface InputFingerprint {\n path: string;\n size: number;\n mtimeMs: number;\n sha256: string;\n}\n\n/**\n * Verdicts already reached, so a rebuild that rewrote every input without\n * changing it does not re-hash the whole graph on every poll.\n *\n * Keyed by the stats actually found on disk, so it can never answer for a set\n * it did not see. Bounded by the compiler manifests in one composition, which\n * is single digits.\n */\nconst freshnessVerdicts = new Map<string, boolean>();\n\nfunction digestOf(filePath: string): string | undefined {\n try {\n return crypto.createHash('sha256').update(fs.readFileSync(filePath)).digest('hex');\n } catch {\n // Unreadable is indistinguishable from absent here: either way the recorded\n // digest cannot be confirmed, so the caller must treat the build as stale.\n return undefined;\n }\n}\n\n/** Records one build input, or undefined when it is not a readable regular file. */\nexport function fingerprintInput(target: string): InputFingerprint | undefined {\n let stat: fs.Stats;\n try {\n stat = fs.statSync(target);\n } catch {\n // A path that vanished between discovery and recording is simply not an\n // input; the compiler records the set it could read.\n return undefined;\n }\n if (!stat.isFile()) return undefined;\n const sha256 = digestOf(target);\n if (sha256 === undefined) return undefined;\n return { path: target, size: stat.size, mtimeMs: stat.mtimeMs, sha256 };\n}\n\n/** Parses one recorded input, rejecting a record written before digests existed. */\nexport function parseInputFingerprint(value: unknown): InputFingerprint | undefined {\n if (!isRecord(value)) return undefined;\n if (\n typeof value.path !== 'string' ||\n typeof value.size !== 'number' ||\n typeof value.mtimeMs !== 'number' ||\n typeof value.sha256 !== 'string'\n ) {\n return undefined;\n }\n return { path: value.path, size: value.size, mtimeMs: value.mtimeMs, sha256: value.sha256 };\n}\n\n/** Whether every recorded input still holds the bytes it was recorded with. */\nexport function inputsAreFresh(inputs: readonly InputFingerprint[]): boolean {\n const moved: InputFingerprint[] = [];\n const key = crypto.createHash('sha256');\n for (const input of inputs) {\n let stat: fs.Stats;\n try {\n stat = fs.statSync(input.path);\n } catch {\n // A recorded input that is gone cannot be confirmed, and no digest will\n // bring it back; the build it describes is stale.\n return false;\n }\n if (!stat.isFile()) return false;\n key.update(`${input.path} ${String(stat.size)} ${String(stat.mtimeMs)} `);\n if (stat.size !== input.size || stat.mtimeMs !== input.mtimeMs) moved.push(input);\n }\n if (moved.length === 0) return true;\n\n const cacheKey = key.digest('hex');\n const remembered = freshnessVerdicts.get(cacheKey);\n if (remembered !== undefined) return remembered;\n const fresh = moved.every((input) => digestOf(input.path) === input.sha256);\n freshnessVerdicts.set(cacheKey, fresh);\n return fresh;\n}\n\n/** Test seam: the memo is process-local and must not leak between cases. */\nexport function resetInputFreshnessCache(): void {\n freshnessVerdicts.clear();\n}\n\ninterface CompilerManifest {\n output: string;\n artifacts: string[];\n entries: string[];\n inputs: InputFingerprint[];\n}\n\ninterface BootstrapState {\n statePath: string;\n generatedDirectory: string;\n bootstrap?: string;\n bundles: Record<string, string>;\n precompile?: {\n version: number;\n strategy: 'bundle';\n bootstrapEntry: string;\n bootstrapManifest: string;\n bundleManifests: Record<string, string>;\n };\n}\n\nexport interface BootstrapStatus {\n bootstrap?: string;\n fresh: boolean;\n}\n\nexport interface BundleStatus {\n bundle?: string;\n fresh: boolean;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction stringRecord(value: unknown): Record<string, string> {\n if (!isRecord(value)) return {};\n return Object.fromEntries(\n Object.entries(value).filter((entry): entry is [string, string] => typeof entry[1] === 'string'),\n );\n}\n\nfunction canonicalPath(target: string): string {\n const absolute = path.resolve(target);\n try {\n return fs.realpathSync(absolute);\n } catch {\n const parent = path.dirname(absolute);\n if (parent === absolute) return absolute;\n return path.join(canonicalPath(parent), path.basename(absolute));\n }\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 packagedDoomEntry(moduleUrl: string = import.meta.url): string {\n const configuredEntry = process.env[BOOTSTRAP_ENTRY_ENV];\n if (configuredEntry) return configuredEntry;\n const extension = moduleUrl.endsWith('.ts') ? 'ts' : 'mjs';\n const sourceRoot = path.dirname(path.dirname(fileURLToPath(moduleUrl)));\n return path.join(sourceRoot, 'extensions', 'entries', `doom.${extension}`);\n}\n\nfunction locationHasState(repoRoot: string, homeDirectory: string): boolean {\n return readSyncRegistration(repoRoot, homeDirectory) !== undefined;\n}\n\n/** Finds the nearest configured repository with generated Doom sync state. */\nexport function findSyncedRoot(cwd: string, homeDirectory: string = os.homedir()): string | undefined {\n if (locationHasState(cwd, homeDirectory)) return canonicalPath(cwd);\n const root = resolveDoomConfigurationRoot(cwd, homeDirectory);\n return locationHasState(root, homeDirectory) ? canonicalPath(root) : undefined;\n}\n\nfunction readBootstrapState(repoRoot: string, homeDirectory: string = os.homedir()): BootstrapState | undefined {\n const registration = readSyncRegistration(repoRoot, homeDirectory);\n if (!registration) return undefined;\n const statePath = registration.statePath;\n const generatedDirectory = registration.generationRoot;\n const state = readSyncState(repoRoot, homeDirectory);\n if (!state) return undefined;\n const bootstrap = typeof state.bootstrap === 'string' ? state.bootstrap : undefined;\n if (bootstrap && !isInside(generatedDirectory, bootstrap)) {\n throw new Error(`Doom bootstrap must stay inside ${generatedDirectory}: ${bootstrap}`);\n }\n\n let precompile: BootstrapState['precompile'];\n if (state.precompile !== undefined) {\n const value = state.precompile;\n if (\n !isRecord(value) ||\n typeof value.version !== 'number' ||\n value.strategy !== BUNDLED_PRECOMPILE_STRATEGY ||\n typeof value.bootstrapEntry !== 'string' ||\n typeof value.bootstrapManifest !== 'string' ||\n !isRecord(value.bundleManifests) ||\n Object.values(value.bundleManifests).some((manifest) => typeof manifest !== 'string')\n ) {\n throw new Error(`Doom sync state at ${statePath} has an invalid precompile record`);\n }\n precompile = {\n version: value.version,\n strategy: value.strategy,\n bootstrapEntry: value.bootstrapEntry,\n bootstrapManifest: value.bootstrapManifest,\n bundleManifests: value.bundleManifests as Record<string, string>,\n };\n }\n\n return {\n statePath,\n generatedDirectory,\n bootstrap,\n bundles: stringRecord(state.bundles),\n precompile,\n };\n}\n\nfunction readCompilerManifest(manifestPath: string, generatedDirectory: string): CompilerManifest | undefined {\n if (!isInside(generatedDirectory, manifestPath)) return undefined;\n try {\n const parsed = JSON.parse(fs.readFileSync(manifestPath, 'utf8')) as unknown;\n if (\n !isRecord(parsed) ||\n typeof parsed.output !== 'string' ||\n !Array.isArray(parsed.artifacts) ||\n parsed.artifacts.some((artifact) => typeof artifact !== 'string') ||\n !Array.isArray(parsed.entries) ||\n parsed.entries.some((entry) => typeof entry !== 'string') ||\n !Array.isArray(parsed.inputs)\n ) {\n return undefined;\n }\n const inputs: InputFingerprint[] = [];\n for (const input of parsed.inputs) {\n // A manifest written before digests were recorded cannot be confirmed by\n // content, so it reads as absent and the next sync rewrites it.\n const fingerprint = parseInputFingerprint(input);\n if (fingerprint === undefined) return undefined;\n inputs.push(fingerprint);\n }\n const artifacts = parsed.artifacts as string[];\n const entries = parsed.entries as string[];\n if (\n !isInside(generatedDirectory, parsed.output) ||\n artifacts.some((artifact) => !isInside(generatedDirectory, artifact))\n ) {\n return undefined;\n }\n return { output: parsed.output, artifacts, entries, inputs };\n } catch {\n return undefined;\n }\n}\n\nfunction compilerManifestIsFresh(manifest: CompilerManifest): boolean {\n if (!fs.existsSync(manifest.output) || manifest.artifacts.some((artifact) => !fs.existsSync(artifact))) return false;\n return inputsAreFresh(manifest.inputs);\n}\n\nfunction freshBootstrapRecord(state: BootstrapState, expectedBootstrapEntry: string): CompilerManifest | undefined {\n if (!state.bootstrap || !state.precompile) return undefined;\n if (\n state.precompile.version !== PRECOMPILE_STATE_VERSION ||\n canonicalPath(state.precompile.bootstrapEntry) !== canonicalPath(expectedBootstrapEntry)\n ) {\n return undefined;\n }\n const record = readCompilerManifest(state.precompile.bootstrapManifest, state.generatedDirectory);\n if (\n !record ||\n !compilerManifestIsFresh(record) ||\n record.output !== state.bootstrap ||\n record.entries.length !== 1 ||\n canonicalPath(record.entries[0] ?? '') !== canonicalPath(expectedBootstrapEntry)\n ) {\n return undefined;\n }\n return record;\n}\n\n/** Validates only the bootstrap graph needed before the generated bootstrap is imported. */\nexport function readStartupBootstrapStatus(\n repoRoot: string,\n expectedBootstrapEntry?: string,\n homeDirectory: string = os.homedir(),\n): BootstrapStatus {\n const state = readBootstrapState(repoRoot, homeDirectory);\n const expected = expectedBootstrapEntry ?? packagedDoomEntry();\n if (!state) return { bootstrap: undefined, fresh: false };\n return {\n bootstrap: state.bootstrap,\n fresh: freshBootstrapRecord(state, expected) !== undefined,\n };\n}\n\n/** Validates one selected composition without touching any inactive bundle inputs. */\nexport function readBundleStatus(\n repoRoot: string,\n compositionFingerprint: string,\n homeDirectory: string = os.homedir(),\n): BundleStatus {\n const state = readBootstrapState(repoRoot, homeDirectory);\n const bundle = state?.bundles[compositionFingerprint];\n const manifestPath = state?.precompile?.bundleManifests[compositionFingerprint];\n if (!state || state.precompile?.version !== PRECOMPILE_STATE_VERSION || !bundle || !manifestPath) {\n return { bundle, fresh: false };\n }\n const manifest = readCompilerManifest(manifestPath, state.generatedDirectory);\n return {\n bundle,\n fresh: Boolean(manifest && manifest.output === bundle && compilerManifestIsFresh(manifest)),\n };\n}\n\n/** Validates the bootstrap and every bundle for `doompi sync --check` diagnostics. */\nexport function readBootstrapStatus(\n repoRoot: string,\n expectedBootstrapEntry?: string,\n homeDirectory: string = os.homedir(),\n): BootstrapStatus {\n const state = readBootstrapState(repoRoot, homeDirectory);\n const expected = expectedBootstrapEntry ?? packagedDoomEntry();\n if (!state?.bootstrap || !state.precompile || !freshBootstrapRecord(state, expected)) {\n return { bootstrap: state?.bootstrap, fresh: false };\n }\n const manifests = Object.values(state.precompile.bundleManifests);\n if (new Set(manifests).size !== manifests.length) return { bootstrap: state.bootstrap, fresh: false };\n const fresh = Object.entries(state.bundles).every(([fingerprint, bundle]) => {\n const manifestPath = state.precompile?.bundleManifests[fingerprint];\n if (!manifestPath) return false;\n const manifest = readCompilerManifest(manifestPath, state.generatedDirectory);\n return Boolean(manifest && manifest.output === bundle && compilerManifestIsFresh(manifest));\n });\n return { bootstrap: state.bootstrap, fresh };\n}\n\n/** Reads only the generated bootstrap pointer while retaining state validation. */\nexport function readBootstrapPointer(repoRoot: string, homeDirectory: string = os.homedir()): string | undefined {\n return readBootstrapState(repoRoot, homeDirectory)?.bootstrap;\n}\n"],"mappings":"+YAUA,MA4BM,EAAoB,IAAI,IAE9B,SAAS,EAAS,EAAsC,CACtD,GAAI,CACF,OAAOA,EAAAA,QAAO,WAAW,QAAQ,CAAC,CAAC,OAAOC,EAAAA,QAAG,aAAa,CAAQ,CAAC,CAAC,CAAC,OAAO,KAAK,CACnF,MAAQ,CAGN,MACF,CACF,CAGA,SAAgB,EAAiB,EAA8C,CAC7E,IAAI,EACJ,GAAI,CACF,EAAOA,EAAAA,QAAG,SAAS,CAAM,CAC3B,MAAQ,CAGN,MACF,CACA,GAAI,CAAC,EAAK,OAAO,EAAG,OACpB,IAAM,EAAS,EAAS,CAAM,EAC1B,OAAW,IAAA,GACf,MAAO,CAAE,KAAM,EAAQ,KAAM,EAAK,KAAM,QAAS,EAAK,QAAS,QAAO,CACxE,CAGA,SAAgB,EAAsB,EAA8C,CAC7E,KAAS,CAAK,GAEjB,OAAO,EAAM,MAAS,UACtB,OAAO,EAAM,MAAS,UACtB,OAAO,EAAM,SAAY,UACzB,OAAO,EAAM,QAAW,SAI1B,MAAO,CAAE,KAAM,EAAM,KAAM,KAAM,EAAM,KAAM,QAAS,EAAM,QAAS,OAAQ,EAAM,MAAO,CAC5F,CAGA,SAAgB,EAAe,EAA8C,CAC3E,I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AO,EAAM,EAEhC,IAAM,EAAW,EAAqB,EAAc,EAAM,kBAAkB,EAC5E,MAAO,CACL,SACA,MAAO,GAAQ,GAAY,EAAS,SAAW,GAAU,EAAwB,CAAQ,EAC3F,CACF,CAGA,SAAgB,EACd,EACA,EACA,EAAwBA,EAAAA,QAAG,QAAQ,EAClB,CACjB,IAAM,EAAQ,EAAmB,EAAU,CAAa,EAClD,EAAW,GAA0B,EAAkB,EAC7D,GAAI,CAAC,GAAO,WAAa,CAAC,EAAM,YAAc,CAAC,EAAqB,EAAO,CAAQ,EACjF,MAAO,CAAE,UAAW,GAAO,UAAW,MAAO,EAAM,EAErD,IAAM,EAAY,OAAO,OAAO,EAAM,WAAW,eAAe,EAChE,GAAI,IAAI,IAAI,CAAS,CAAC,CAAC,OAAS,EAAU,OAAQ,MAAO,CAAE,UAAW,EAAM,UAAW,MAAO,EAAM,EACpG,IAAM,EAAQ,OAAO,QAAQ,EAAM,OAAO,CAAC,CAAC,OAAO,CAAC,EAAa,KAAY,CAC3E,IAAM,EAAe,EAAM,YAAY,gBAAgB,GACvD,GAAI,CAAC,EAAc,MAAO,GAC1B,IAAM,EAAW,EAAqB,EAAc,EAAM,kBAAkB,EAC5E,MAAO,GAAQ,GAAY,EAAS,SAAW,GAAU,EAAwB,CAAQ,EAC3F,CAAC,EACD,MAAO,CAAE,UAAW,EAAM,UAAW,OAAM,CAC7C"}
1
+ {"version":3,"file":"bootstrapLocator.cjs","names":["crypto","fs","path","fileURLToPath","readSyncRegistration","os","resolveDoomConfigurationRoot","readSyncState"],"sources":["../../../src/adapters/bootstrapLocator.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { resolveDoomConfigurationRoot } from './repository/repository.ts';\nimport { readSyncRegistration } from './syncRegistration.ts';\nimport { readSyncState } from './syncState.ts';\nimport { BUNDLED_PRECOMPILE_STRATEGY, PRECOMPILE_STATE_VERSION } from './syncStateContract.ts';\n\nconst BOOTSTRAP_ENTRY_ENV = 'DOOMPI_BOOTSTRAP_ENTRY';\n\n/**\n * One recorded build input: the stat pair for speed, the digest for truth.\n *\n * Comparing only `size` and `mtimeMs` makes every rebuild look like a change,\n * including one that restored byte-identical output from a build cache, and a\n * sync triggered that way republishes a generation nobody asked for. Comparing\n * content alone is correct but reads every input on every check, and the\n * cockpit polls this. Recording both lets the stat pair answer the common\n * \"nothing was touched\" case without opening a file, while the digest stays the\n * authority for anything whose stat moved.\n */\nexport interface InputFingerprint {\n path: string;\n size: number;\n mtimeMs: number;\n sha256: string;\n}\n\n/**\n * Verdicts already reached, so a rebuild that rewrote every input without\n * changing it does not re-hash the whole graph on every poll.\n *\n * Keyed by the stats actually found on disk, so it can never answer for a set\n * it did not see. Bounded by the compiler manifests in one composition, which\n * is single digits.\n */\nconst freshnessVerdicts = new Map<string, boolean>();\n\nfunction digestOf(filePath: string): string | undefined {\n try {\n return crypto.createHash('sha256').update(fs.readFileSync(filePath)).digest('hex');\n } catch {\n // Unreadable is indistinguishable from absent here: either way the recorded\n // digest cannot be confirmed, so the caller must treat the build as stale.\n return undefined;\n }\n}\n\n/** Records one build input, or undefined when it is not a readable regular file. */\nexport function fingerprintInput(target: string): InputFingerprint | undefined {\n let stat: fs.Stats;\n try {\n stat = fs.statSync(target);\n } catch {\n // A path that vanished between discovery and recording is simply not an\n // input; the compiler records the set it could read.\n return undefined;\n }\n if (!stat.isFile()) return undefined;\n const sha256 = digestOf(target);\n if (sha256 === undefined) return undefined;\n return { path: target, size: stat.size, mtimeMs: stat.mtimeMs, sha256 };\n}\n\n/** Parses one recorded input, rejecting a record written before digests existed. */\nexport function parseInputFingerprint(value: unknown): InputFingerprint | undefined {\n if (!isRecord(value)) return undefined;\n if (\n typeof value.path !== 'string' ||\n typeof value.size !== 'number' ||\n typeof value.mtimeMs !== 'number' ||\n typeof value.sha256 !== 'string'\n ) {\n return undefined;\n }\n return { path: value.path, size: value.size, mtimeMs: value.mtimeMs, sha256: value.sha256 };\n}\n\n/** Whether every recorded input still holds the bytes it was recorded with. */\nexport function inputsAreFresh(inputs: readonly InputFingerprint[]): boolean {\n const moved: InputFingerprint[] = [];\n const key = crypto.createHash('sha256');\n for (const input of inputs) {\n let stat: fs.Stats;\n try {\n stat = fs.statSync(input.path);\n } catch {\n // A recorded input that is gone cannot be confirmed, and no digest will\n // bring it back; the build it describes is stale.\n return false;\n }\n if (!stat.isFile()) return false;\n key.update(`${input.path} ${String(stat.size)} ${String(stat.mtimeMs)} `);\n if (stat.size !== input.size || stat.mtimeMs !== input.mtimeMs) moved.push(input);\n }\n if (moved.length === 0) return true;\n\n const cacheKey = key.digest('hex');\n const remembered = freshnessVerdicts.get(cacheKey);\n if (remembered !== undefined) return remembered;\n const fresh = moved.every((input) => digestOf(input.path) === input.sha256);\n freshnessVerdicts.set(cacheKey, fresh);\n return fresh;\n}\n\n/** Test seam: the memo is process-local and must not leak between cases. */\nexport function resetInputFreshnessCache(): void {\n freshnessVerdicts.clear();\n}\n\ninterface CompilerManifest {\n output: string;\n artifacts: string[];\n entries: string[];\n inputs: InputFingerprint[];\n}\n\ninterface BootstrapState {\n statePath: string;\n generatedDirectory: string;\n bootstrap?: string;\n bundles: Record<string, string>;\n precompile?: {\n version: number;\n strategy: 'bundle';\n bootstrapEntry: string;\n bootstrapManifest: string;\n bundleManifests: Record<string, string>;\n };\n}\n\nexport interface BootstrapStatus {\n bootstrap?: string;\n fresh: boolean;\n}\n\nexport interface BundleStatus {\n bundle?: string;\n fresh: boolean;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction stringRecord(value: unknown): Record<string, string> {\n if (!isRecord(value)) return {};\n return Object.fromEntries(\n Object.entries(value).filter((entry): entry is [string, string] => typeof entry[1] === 'string'),\n );\n}\n\nfunction canonicalPath(target: string): string {\n const absolute = path.resolve(target);\n try {\n return fs.realpathSync(absolute);\n } catch {\n const parent = path.dirname(absolute);\n if (parent === absolute) return absolute;\n return path.join(canonicalPath(parent), path.basename(absolute));\n }\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 packagedDoomEntry(moduleUrl: string = import.meta.url): string {\n const configuredEntry = process.env[BOOTSTRAP_ENTRY_ENV];\n if (configuredEntry) return configuredEntry;\n const extension = moduleUrl.endsWith('.ts') ? 'ts' : 'mjs';\n const sourceRoot = path.dirname(path.dirname(fileURLToPath(moduleUrl)));\n return path.join(sourceRoot, 'extensions', 'entries', `doom.${extension}`);\n}\n\nfunction locationHasState(repoRoot: string, homeDirectory: string): boolean {\n return readSyncRegistration(repoRoot, homeDirectory) !== undefined;\n}\n\n/** Finds the nearest configured repository with generated Doom sync state. */\nexport function findSyncedRoot(cwd: string, homeDirectory: string = os.homedir()): string | undefined {\n if (locationHasState(cwd, homeDirectory)) return canonicalPath(cwd);\n const root = resolveDoomConfigurationRoot(cwd, homeDirectory);\n return locationHasState(root, homeDirectory) ? canonicalPath(root) : undefined;\n}\n\nfunction readBootstrapState(repoRoot: string, homeDirectory: string = os.homedir()): BootstrapState | undefined {\n const registration = readSyncRegistration(repoRoot, homeDirectory);\n if (!registration) return undefined;\n const statePath = registration.statePath;\n const generatedDirectory = registration.generationRoot;\n const state = readSyncState(repoRoot, homeDirectory);\n if (!state) return undefined;\n const bootstrap = typeof state.bootstrap === 'string' ? state.bootstrap : undefined;\n if (bootstrap && !isInside(generatedDirectory, bootstrap)) {\n throw new Error(`Doom bootstrap must stay inside ${generatedDirectory}: ${bootstrap}`);\n }\n\n let precompile: BootstrapState['precompile'];\n if (state.precompile !== undefined) {\n const value = state.precompile;\n if (\n !isRecord(value) ||\n typeof value.version !== 'number' ||\n value.strategy !== BUNDLED_PRECOMPILE_STRATEGY ||\n typeof value.bootstrapEntry !== 'string' ||\n typeof value.bootstrapManifest !== 'string' ||\n !isRecord(value.bundleManifests) ||\n Object.values(value.bundleManifests).some((manifest) => typeof manifest !== 'string')\n ) {\n throw new Error(`Doom sync state at ${statePath} has an invalid precompile record`);\n }\n precompile = {\n version: value.version,\n strategy: value.strategy,\n bootstrapEntry: value.bootstrapEntry,\n bootstrapManifest: value.bootstrapManifest,\n bundleManifests: value.bundleManifests as Record<string, string>,\n };\n }\n\n return {\n statePath,\n generatedDirectory,\n bootstrap,\n bundles: stringRecord(state.bundles),\n precompile,\n };\n}\n\nfunction readCompilerManifest(manifestPath: string, generatedDirectory: string): CompilerManifest | undefined {\n if (!isInside(generatedDirectory, manifestPath)) return undefined;\n try {\n const parsed = JSON.parse(fs.readFileSync(manifestPath, 'utf8')) as unknown;\n if (\n !isRecord(parsed) ||\n typeof parsed.output !== 'string' ||\n !Array.isArray(parsed.artifacts) ||\n parsed.artifacts.some((artifact) => typeof artifact !== 'string') ||\n !Array.isArray(parsed.entries) ||\n parsed.entries.some((entry) => typeof entry !== 'string') ||\n !Array.isArray(parsed.inputs)\n ) {\n return undefined;\n }\n const inputs: InputFingerprint[] = [];\n for (const input of parsed.inputs) {\n // A manifest written before digests were recorded cannot be confirmed by\n // content, so it reads as absent and the next sync rewrites it.\n const fingerprint = parseInputFingerprint(input);\n if (fingerprint === undefined) return undefined;\n inputs.push(fingerprint);\n }\n const artifacts = parsed.artifacts as string[];\n const entries = parsed.entries as string[];\n if (\n !isInside(generatedDirectory, parsed.output) ||\n artifacts.some((artifact) => !isInside(generatedDirectory, artifact))\n ) {\n return undefined;\n }\n return { output: parsed.output, artifacts, entries, inputs };\n } catch {\n return undefined;\n }\n}\n\nfunction compilerManifestIsFresh(manifest: CompilerManifest): boolean {\n if (!fs.existsSync(manifest.output) || manifest.artifacts.some((artifact) => !fs.existsSync(artifact))) return false;\n return inputsAreFresh(manifest.inputs);\n}\n\nfunction freshBootstrapRecord(state: BootstrapState, expectedBootstrapEntry: string): CompilerManifest | undefined {\n if (!state.bootstrap || !state.precompile) return undefined;\n if (\n state.precompile.version !== PRECOMPILE_STATE_VERSION ||\n canonicalPath(state.precompile.bootstrapEntry) !== canonicalPath(expectedBootstrapEntry)\n ) {\n return undefined;\n }\n const record = readCompilerManifest(state.precompile.bootstrapManifest, state.generatedDirectory);\n if (\n !record ||\n !compilerManifestIsFresh(record) ||\n record.output !== state.bootstrap ||\n record.entries.length !== 1 ||\n canonicalPath(record.entries[0] ?? '') !== canonicalPath(expectedBootstrapEntry)\n ) {\n return undefined;\n }\n return record;\n}\n\n/** Validates only the bootstrap graph needed before the generated bootstrap is imported. */\nexport function readStartupBootstrapStatus(\n repoRoot: string,\n expectedBootstrapEntry?: string,\n homeDirectory: string = os.homedir(),\n): BootstrapStatus {\n const state = readBootstrapState(repoRoot, homeDirectory);\n const expected = expectedBootstrapEntry ?? packagedDoomEntry();\n if (!state) return { bootstrap: undefined, fresh: false };\n return {\n bootstrap: state.bootstrap,\n fresh: freshBootstrapRecord(state, expected) !== undefined,\n };\n}\n\n/** Validates one selected composition without touching any inactive bundle inputs. */\nexport function readBundleStatus(\n repoRoot: string,\n compositionFingerprint: string,\n homeDirectory: string = os.homedir(),\n): BundleStatus {\n const state = readBootstrapState(repoRoot, homeDirectory);\n const bundle = state?.bundles[compositionFingerprint];\n const manifestPath = state?.precompile?.bundleManifests[compositionFingerprint];\n if (!state || state.precompile?.version !== PRECOMPILE_STATE_VERSION || !bundle || !manifestPath) {\n return { bundle, fresh: false };\n }\n const manifest = readCompilerManifest(manifestPath, state.generatedDirectory);\n return {\n bundle,\n fresh: Boolean(manifest && manifest.output === bundle && compilerManifestIsFresh(manifest)),\n };\n}\n\n/** Validates the bootstrap and every bundle for `doompi sync --check` diagnostics. */\nexport function readBootstrapStatus(\n repoRoot: string,\n expectedBootstrapEntry?: string,\n homeDirectory: string = os.homedir(),\n): BootstrapStatus {\n const state = readBootstrapState(repoRoot, homeDirectory);\n const expected = expectedBootstrapEntry ?? packagedDoomEntry();\n if (!state?.bootstrap || !state.precompile || !freshBootstrapRecord(state, expected)) {\n return { bootstrap: state?.bootstrap, fresh: false };\n }\n const manifests = Object.values(state.precompile.bundleManifests);\n if (new Set(manifests).size !== manifests.length) return { bootstrap: state.bootstrap, fresh: false };\n const fresh = Object.entries(state.bundles).every(([fingerprint, bundle]) => {\n const manifestPath = state.precompile?.bundleManifests[fingerprint];\n if (!manifestPath) return false;\n const manifest = readCompilerManifest(manifestPath, state.generatedDirectory);\n return Boolean(manifest && manifest.output === bundle && compilerManifestIsFresh(manifest));\n });\n return { bootstrap: state.bootstrap, fresh };\n}\n\n/** Reads only the generated bootstrap pointer while retaining state validation. */\nexport function readBootstrapPointer(repoRoot: string, homeDirectory: string = os.homedir()): string | undefined {\n return readBootstrapState(repoRoot, homeDirectory)?.bootstrap;\n}\n"],"mappings":"+YAUA,MA4BM,EAAoB,IAAI,IAE9B,SAAS,EAAS,EAAsC,CACtD,GAAI,CACF,OAAOA,EAAAA,QAAO,WAAW,QAAQ,CAAC,CAAC,OAAOC,EAAAA,QAAG,aAAa,CAAQ,CAAC,CAAC,CAAC,OAAO,KAAK,CACnF,MAAQ,CAGN,MACF,CACF,CAGA,SAAgB,EAAiB,EAA8C,CAC7E,IAAI,EACJ,GAAI,CACF,EAAOA,EAAAA,QAAG,SAAS,CAAM,CAC3B,MAAQ,CAGN,MACF,CACA,GAAI,CAAC,EAAK,OAAO,EAAG,OACpB,IAAM,EAAS,EAAS,CAAM,EAC1B,OAAW,IAAA,GACf,MAAO,CAAE,KAAM,EAAQ,KAAM,EAAK,KAAM,QAAS,EAAK,QAAS,QAAO,CACxE,CAGA,SAAgB,EAAsB,EAA8C,CAC7E,KAAS,CAAK,GAEjB,OAAO,EAAM,MAAS,UACtB,OAAO,EAAM,MAAS,UACtB,OAAO,EAAM,SAAY,UACzB,OAAO,EAAM,QAAW,SAI1B,MAAO,CAAE,KAAM,EAAM,KAAM,KAAM,EAAM,KAAM,QAAS,EAAM,QAAS,OAAQ,EAAM,MAAO,CA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CAAC,EAClF,MAAO,CAAE,SAAQ,MAAO,EAAM,EAEhC,IAAM,EAAW,EAAqB,EAAc,EAAM,kBAAkB,EAC5E,MAAO,CACL,SACA,MAAO,GAAQ,GAAY,EAAS,SAAW,GAAU,EAAwB,CAAQ,EAC3F,CACF,CAGA,SAAgB,EACd,EACA,EACA,EAAwBA,EAAAA,QAAG,QAAQ,EAClB,CACjB,IAAM,EAAQ,EAAmB,EAAU,CAAa,EAClD,EAAW,GAA0B,EAAkB,EAC7D,GAAI,CAAC,GAAO,WAAa,CAAC,EAAM,YAAc,CAAC,EAAqB,EAAO,CAAQ,EACjF,MAAO,CAAE,UAAW,GAAO,UAAW,MAAO,EAAM,EAErD,IAAM,EAAY,OAAO,OAAO,EAAM,WAAW,eAAe,EAChE,GAAI,IAAI,IAAI,CAAS,CAAC,CAAC,OAAS,EAAU,OAAQ,MAAO,CAAE,UAAW,EAAM,UAAW,MAAO,EAAM,EACpG,IAAM,EAAQ,OAAO,QAAQ,EAAM,OAAO,CAAC,CAAC,OAAO,CAAC,EAAa,KAAY,CAC3E,IAAM,EAAe,EAAM,YAAY,gBAAgB,GACvD,GAAI,CAAC,EAAc,MAAO,GAC1B,IAAM,EAAW,EAAqB,EAAc,EAAM,kBAAkB,EAC5E,MAAO,GAAQ,GAAY,EAAS,SAAW,GAAU,EAAwB,CAAQ,EAC3F,CAAC,EACD,MAAO,CAAE,UAAW,EAAM,UAAW,OAAM,CAC7C"}
@@ -1,6 +1,5 @@
1
1
  //#region src/adapters/bootstrapLocator.d.ts
2
2
  /** Finds the nearest configured repository with generated Doom sync state. */
3
- declare function findSyncedRoot(cwd: string, homeDirectory?: string): string | undefined;
3
+ export declare function findSyncedRoot(cwd: string, homeDirectory?: string): string | undefined;
4
4
  //#endregion
5
- export { findSyncedRoot };
6
5
  //# sourceMappingURL=bootstrapLocator.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrapLocator.d.cts","names":[],"sources":["../../../src/adapters/bootstrapLocator.ts"],"mappings":";;iBAuLgB,eAAe,aAAa"}
1
+ {"version":3,"file":"bootstrapLocator.d.cts","names":[],"sources":["../../../src/adapters/bootstrapLocator.ts"],"mappings":";;wBAuLgB,eAAe,aAAa"}
@@ -1,6 +1,5 @@
1
1
  //#region src/adapters/bootstrapLocator.d.ts
2
2
  /** Finds the nearest configured repository with generated Doom sync state. */
3
- declare function findSyncedRoot(cwd: string, homeDirectory?: string): string | undefined;
3
+ export declare function findSyncedRoot(cwd: string, homeDirectory?: string): string | undefined;
4
4
  //#endregion
5
- export { findSyncedRoot };
6
5
  //# sourceMappingURL=bootstrapLocator.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrapLocator.d.mts","names":[],"sources":["../../../src/adapters/bootstrapLocator.ts"],"mappings":";;iBAuLgB,eAAe,aAAa"}
1
+ {"version":3,"file":"bootstrapLocator.d.mts","names":[],"sources":["../../../src/adapters/bootstrapLocator.ts"],"mappings":";;wBAuLgB,eAAe,aAAa"}
@@ -1,2 +1,2 @@
1
- import{resolveDoomConfigurationRoot as e}from"./repository/repository.mjs";import{readSyncRegistration as t}from"./syncRegistration.mjs";import"./syncStateContract.mjs";import{readSyncState as n}from"./syncState.mjs";import{fileURLToPath as r}from"node:url";import i from"node:path";import a from"node:crypto";import o from"node:fs";import s from"node:os";const c=new Map;function l(e){try{return a.createHash(`sha256`).update(o.readFileSync(e)).digest(`hex`)}catch{return}}function u(e){let t;try{t=o.statSync(e)}catch{return}if(!t.isFile())return;let n=l(e);if(n!==void 0)return{path:e,size:t.size,mtimeMs:t.mtimeMs,sha256:n}}function d(e){if(p(e)&&typeof e.path==`string`&&typeof e.size==`number`&&typeof e.mtimeMs==`number`&&typeof e.sha256==`string`)return{path:e.path,size:e.size,mtimeMs:e.mtimeMs,sha256:e.sha256}}function f(e){let t=[],n=a.createHash(`sha256`);for(let r of e){let e;try{e=o.statSync(r.path)}catch{return!1}if(!e.isFile())return!1;n.update(`${r.path} ${String(e.size)} ${String(e.mtimeMs)} `),(e.size!==r.size||e.mtimeMs!==r.mtimeMs)&&t.push(r)}if(t.length===0)return!0;let r=n.digest(`hex`),i=c.get(r);if(i!==void 0)return i;let s=t.every(e=>l(e.path)===e.sha256);return c.set(r,s),s}function p(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function m(e){return p(e)?Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`)):{}}function h(e){let t=i.resolve(e);try{return o.realpathSync(t)}catch{let e=i.dirname(t);return e===t?t:i.join(h(e),i.basename(t))}}function g(e,t){let n=i.relative(h(e),h(t));return n===``||!n.startsWith(`..`)&&!i.isAbsolute(n)}function _(e=import.meta.url){let t=process.env.DOOMPI_BOOTSTRAP_ENTRY;if(t)return t;let n=e.endsWith(`.ts`)?`ts`:`mjs`,a=i.dirname(i.dirname(r(e)));return i.join(a,`extensions`,`entries`,`doom.${n}`)}function v(e,n){return t(e,n)!==void 0}function y(t,n=s.homedir()){if(v(t,n))return h(t);let r=e(t,n);return v(r,n)?h(r):void 0}function b(e,r=s.homedir()){let i=t(e,r);if(!i)return;let a=i.statePath,o=i.generationRoot,c=n(e,r);if(!c)return;let l=typeof c.bootstrap==`string`?c.bootstrap:void 0;if(l&&!g(o,l))throw Error(`Doom bootstrap must stay inside ${o}: ${l}`);let u;if(c.precompile!==void 0){let e=c.precompile;if(!p(e)||typeof e.version!=`number`||e.strategy!==`bundle`||typeof e.bootstrapEntry!=`string`||typeof e.bootstrapManifest!=`string`||!p(e.bundleManifests)||Object.values(e.bundleManifests).some(e=>typeof e!=`string`))throw Error(`Doom sync state at ${a} has an invalid precompile record`);u={version:e.version,strategy:e.strategy,bootstrapEntry:e.bootstrapEntry,bootstrapManifest:e.bootstrapManifest,bundleManifests:e.bundleManifests}}return{statePath:a,generatedDirectory:o,bootstrap:l,bundles:m(c.bundles),precompile:u}}function x(e,t){if(g(t,e))try{let n=JSON.parse(o.readFileSync(e,`utf8`));if(!p(n)||typeof n.output!=`string`||!Array.isArray(n.artifacts)||n.artifacts.some(e=>typeof e!=`string`)||!Array.isArray(n.entries)||n.entries.some(e=>typeof e!=`string`)||!Array.isArray(n.inputs))return;let r=[];for(let e of n.inputs){let t=d(e);if(t===void 0)return;r.push(t)}let i=n.artifacts,a=n.entries;return!g(t,n.output)||i.some(e=>!g(t,e))?void 0:{output:n.output,artifacts:i,entries:a,inputs:r}}catch{return}}function S(e){return!o.existsSync(e.output)||e.artifacts.some(e=>!o.existsSync(e))?!1:f(e.inputs)}function C(e,t){if(!e.bootstrap||!e.precompile||e.precompile.version!==5||h(e.precompile.bootstrapEntry)!==h(t))return;let n=x(e.precompile.bootstrapManifest,e.generatedDirectory);if(!(!n||!S(n)||n.output!==e.bootstrap||n.entries.length!==1||h(n.entries[0]??``)!==h(t)))return n}function w(e,t,n=s.homedir()){let r=b(e,n),i=t??_();return r?{bootstrap:r.bootstrap,fresh:C(r,i)!==void 0}:{bootstrap:void 0,fresh:!1}}function T(e,t,n=s.homedir()){let r=b(e,n),i=r?.bundles[t],a=r?.precompile?.bundleManifests[t];if(!r||r.precompile?.version!==5||!i||!a)return{bundle:i,fresh:!1};let o=x(a,r.generatedDirectory);return{bundle:i,fresh:!!(o&&o.output===i&&S(o))}}function E(e,t,n=s.homedir()){let r=b(e,n),i=t??_();if(!r?.bootstrap||!r.precompile||!C(r,i))return{bootstrap:r?.bootstrap,fresh:!1};let a=Object.values(r.precompile.bundleManifests);if(new Set(a).size!==a.length)return{bootstrap:r.bootstrap,fresh:!1};let o=Object.entries(r.bundles).every(([e,t])=>{let n=r.precompile?.bundleManifests[e];if(!n)return!1;let i=x(n,r.generatedDirectory);return!!(i&&i.output===t&&S(i))});return{bootstrap:r.bootstrap,fresh:o}}export{y as findSyncedRoot,u as fingerprintInput,f as inputsAreFresh,d as parseInputFingerprint,E as readBootstrapStatus,T as readBundleStatus,w as readStartupBootstrapStatus};
1
+ import{resolveDoomConfigurationRoot as e}from"./repository/repository.mjs";import{readSyncRegistration as t}from"./syncRegistration.mjs";import"./syncStateContract.mjs";import{readSyncState as n}from"./syncState.mjs";import{fileURLToPath as r}from"node:url";import i from"node:path";import a from"node:crypto";import o from"node:fs";import s from"node:os";const c=new Map;function l(e){try{return a.createHash(`sha256`).update(o.readFileSync(e)).digest(`hex`)}catch{return}}function u(e){let t;try{t=o.statSync(e)}catch{return}if(!t.isFile())return;let n=l(e);if(n!==void 0)return{path:e,size:t.size,mtimeMs:t.mtimeMs,sha256:n}}function d(e){if(p(e)&&typeof e.path==`string`&&typeof e.size==`number`&&typeof e.mtimeMs==`number`&&typeof e.sha256==`string`)return{path:e.path,size:e.size,mtimeMs:e.mtimeMs,sha256:e.sha256}}function f(e){let t=[],n=a.createHash(`sha256`);for(let r of e){let e;try{e=o.statSync(r.path)}catch{return!1}if(!e.isFile())return!1;n.update(`${r.path} ${String(e.size)} ${String(e.mtimeMs)} `),(e.size!==r.size||e.mtimeMs!==r.mtimeMs)&&t.push(r)}if(t.length===0)return!0;let r=n.digest(`hex`),i=c.get(r);if(i!==void 0)return i;let s=t.every(e=>l(e.path)===e.sha256);return c.set(r,s),s}function p(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function m(e){return p(e)?Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`)):{}}function h(e){let t=i.resolve(e);try{return o.realpathSync(t)}catch{let e=i.dirname(t);return e===t?t:i.join(h(e),i.basename(t))}}function g(e,t){let n=i.relative(h(e),h(t));return n===``||!n.startsWith(`..`)&&!i.isAbsolute(n)}function _(e=import.meta.url){let t=process.env.DOOMPI_BOOTSTRAP_ENTRY;if(t)return t;let n=e.endsWith(`.ts`)?`ts`:`mjs`,a=i.dirname(i.dirname(r(e)));return i.join(a,`extensions`,`entries`,`doom.${n}`)}function v(e,n){return t(e,n)!==void 0}function y(t,n=s.homedir()){if(v(t,n))return h(t);let r=e(t,n);return v(r,n)?h(r):void 0}function b(e,r=s.homedir()){let i=t(e,r);if(!i)return;let a=i.statePath,o=i.generationRoot,c=n(e,r);if(!c)return;let l=typeof c.bootstrap==`string`?c.bootstrap:void 0;if(l&&!g(o,l))throw Error(`Doom bootstrap must stay inside ${o}: ${l}`);let u;if(c.precompile!==void 0){let e=c.precompile;if(!p(e)||typeof e.version!=`number`||e.strategy!==`bundle`||typeof e.bootstrapEntry!=`string`||typeof e.bootstrapManifest!=`string`||!p(e.bundleManifests)||Object.values(e.bundleManifests).some(e=>typeof e!=`string`))throw Error(`Doom sync state at ${a} has an invalid precompile record`);u={version:e.version,strategy:e.strategy,bootstrapEntry:e.bootstrapEntry,bootstrapManifest:e.bootstrapManifest,bundleManifests:e.bundleManifests}}return{statePath:a,generatedDirectory:o,bootstrap:l,bundles:m(c.bundles),precompile:u}}function x(e,t){if(g(t,e))try{let n=JSON.parse(o.readFileSync(e,`utf8`));if(!p(n)||typeof n.output!=`string`||!Array.isArray(n.artifacts)||n.artifacts.some(e=>typeof e!=`string`)||!Array.isArray(n.entries)||n.entries.some(e=>typeof e!=`string`)||!Array.isArray(n.inputs))return;let r=[];for(let e of n.inputs){let t=d(e);if(t===void 0)return;r.push(t)}let i=n.artifacts,a=n.entries;return!g(t,n.output)||i.some(e=>!g(t,e))?void 0:{output:n.output,artifacts:i,entries:a,inputs:r}}catch{return}}function S(e){return!o.existsSync(e.output)||e.artifacts.some(e=>!o.existsSync(e))?!1:f(e.inputs)}function C(e,t){if(!e.bootstrap||!e.precompile||e.precompile.version!==5||h(e.precompile.bootstrapEntry)!==h(t))return;let n=x(e.precompile.bootstrapManifest,e.generatedDirectory);if(n&&S(n)&&n.output===e.bootstrap&&n.entries.length===1&&h(n.entries[0]??``)===h(t))return n}function w(e,t,n=s.homedir()){let r=b(e,n),i=t??_();return r?{bootstrap:r.bootstrap,fresh:C(r,i)!==void 0}:{bootstrap:void 0,fresh:!1}}function T(e,t,n=s.homedir()){let r=b(e,n),i=r?.bundles[t],a=r?.precompile?.bundleManifests[t];if(!r||r.precompile?.version!==5||!i||!a)return{bundle:i,fresh:!1};let o=x(a,r.generatedDirectory);return{bundle:i,fresh:!!(o&&o.output===i&&S(o))}}function E(e,t,n=s.homedir()){let r=b(e,n),i=t??_();if(!r?.bootstrap||!r.precompile||!C(r,i))return{bootstrap:r?.bootstrap,fresh:!1};let a=Object.values(r.precompile.bundleManifests);if(new Set(a).size!==a.length)return{bootstrap:r.bootstrap,fresh:!1};let o=Object.entries(r.bundles).every(([e,t])=>{let n=r.precompile?.bundleManifests[e];if(!n)return!1;let i=x(n,r.generatedDirectory);return!!(i&&i.output===t&&S(i))});return{bootstrap:r.bootstrap,fresh:o}}export{y as findSyncedRoot,u as fingerprintInput,f as inputsAreFresh,d as parseInputFingerprint,E as readBootstrapStatus,T as readBundleStatus,w as readStartupBootstrapStatus};
2
2
  //# sourceMappingURL=bootstrapLocator.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrapLocator.mjs","names":[],"sources":["../../../src/adapters/bootstrapLocator.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { resolveDoomConfigurationRoot } from './repository/repository.ts';\nimport { readSyncRegistration } from './syncRegistration.ts';\nimport { readSyncState } from './syncState.ts';\nimport { BUNDLED_PRECOMPILE_STRATEGY, PRECOMPILE_STATE_VERSION } from './syncStateContract.ts';\n\nconst BOOTSTRAP_ENTRY_ENV = 'DOOMPI_BOOTSTRAP_ENTRY';\n\n/**\n * One recorded build input: the stat pair for speed, the digest for truth.\n *\n * Comparing only `size` and `mtimeMs` makes every rebuild look like a change,\n * including one that restored byte-identical output from a build cache, and a\n * sync triggered that way republishes a generation nobody asked for. Comparing\n * content alone is correct but reads every input on every check, and the\n * cockpit polls this. Recording both lets the stat pair answer the common\n * \"nothing was touched\" case without opening a file, while the digest stays the\n * authority for anything whose stat moved.\n */\nexport interface InputFingerprint {\n path: string;\n size: number;\n mtimeMs: number;\n sha256: string;\n}\n\n/**\n * Verdicts already reached, so a rebuild that rewrote every input without\n * changing it does not re-hash the whole graph on every poll.\n *\n * Keyed by the stats actually found on disk, so it can never answer for a set\n * it did not see. Bounded by the compiler manifests in one composition, which\n * is single digits.\n */\nconst freshnessVerdicts = new Map<string, boolean>();\n\nfunction digestOf(filePath: string): string | undefined {\n try {\n return crypto.createHash('sha256').update(fs.readFileSync(filePath)).digest('hex');\n } catch {\n // Unreadable is indistinguishable from absent here: either way the recorded\n // digest cannot be confirmed, so the caller must treat the build as stale.\n return undefined;\n }\n}\n\n/** Records one build input, or undefined when it is not a readable regular file. */\nexport function fingerprintInput(target: string): InputFingerprint | undefined {\n let stat: fs.Stats;\n try {\n stat = fs.statSync(target);\n } catch {\n // A path that vanished between discovery and recording is simply not an\n // input; the compiler records the set it could read.\n return undefined;\n }\n if (!stat.isFile()) return undefined;\n const sha256 = digestOf(target);\n if (sha256 === undefined) return undefined;\n return { path: target, size: stat.size, mtimeMs: stat.mtimeMs, sha256 };\n}\n\n/** Parses one recorded input, rejecting a record written before digests existed. */\nexport function parseInputFingerprint(value: unknown): InputFingerprint | undefined {\n if (!isRecord(value)) return undefined;\n if (\n typeof value.path !== 'string' ||\n typeof value.size !== 'number' ||\n typeof value.mtimeMs !== 'number' ||\n typeof value.sha256 !== 'string'\n ) {\n return undefined;\n }\n return { path: value.path, size: value.size, mtimeMs: value.mtimeMs, sha256: value.sha256 };\n}\n\n/** Whether every recorded input still holds the bytes it was recorded with. */\nexport function inputsAreFresh(inputs: readonly InputFingerprint[]): boolean {\n const moved: InputFingerprint[] = [];\n const key = crypto.createHash('sha256');\n for (const input of inputs) {\n let stat: fs.Stats;\n try {\n stat = fs.statSync(input.path);\n } catch {\n // A recorded input that is gone cannot be confirmed, and no digest will\n // bring it back; the build it describes is stale.\n return false;\n }\n if (!stat.isFile()) return false;\n key.update(`${input.path} ${String(stat.size)} ${String(stat.mtimeMs)} `);\n if (stat.size !== input.size || stat.mtimeMs !== input.mtimeMs) moved.push(input);\n }\n if (moved.length === 0) return true;\n\n const cacheKey = key.digest('hex');\n const remembered = freshnessVerdicts.get(cacheKey);\n if (remembered !== undefined) return remembered;\n const fresh = moved.every((input) => digestOf(input.path) === input.sha256);\n freshnessVerdicts.set(cacheKey, fresh);\n return fresh;\n}\n\n/** Test seam: the memo is process-local and must not leak between cases. */\nexport function resetInputFreshnessCache(): void {\n freshnessVerdicts.clear();\n}\n\ninterface CompilerManifest {\n output: string;\n artifacts: string[];\n entries: string[];\n inputs: InputFingerprint[];\n}\n\ninterface BootstrapState {\n statePath: string;\n generatedDirectory: string;\n bootstrap?: string;\n bundles: Record<string, string>;\n precompile?: {\n version: number;\n strategy: 'bundle';\n bootstrapEntry: string;\n bootstrapManifest: string;\n bundleManifests: Record<string, string>;\n };\n}\n\nexport interface BootstrapStatus {\n bootstrap?: string;\n fresh: boolean;\n}\n\nexport interface BundleStatus {\n bundle?: string;\n fresh: boolean;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction stringRecord(value: unknown): Record<string, string> {\n if (!isRecord(value)) return {};\n return Object.fromEntries(\n Object.entries(value).filter((entry): entry is [string, string] => typeof entry[1] === 'string'),\n );\n}\n\nfunction canonicalPath(target: string): string {\n const absolute = path.resolve(target);\n try {\n return fs.realpathSync(absolute);\n } catch {\n const parent = path.dirname(absolute);\n if (parent === absolute) return absolute;\n return path.join(canonicalPath(parent), path.basename(absolute));\n }\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 packagedDoomEntry(moduleUrl: string = import.meta.url): string {\n const configuredEntry = process.env[BOOTSTRAP_ENTRY_ENV];\n if (configuredEntry) return configuredEntry;\n const extension = moduleUrl.endsWith('.ts') ? 'ts' : 'mjs';\n const sourceRoot = path.dirname(path.dirname(fileURLToPath(moduleUrl)));\n return path.join(sourceRoot, 'extensions', 'entries', `doom.${extension}`);\n}\n\nfunction locationHasState(repoRoot: string, homeDirectory: string): boolean {\n return readSyncRegistration(repoRoot, homeDirectory) !== undefined;\n}\n\n/** Finds the nearest configured repository with generated Doom sync state. */\nexport function findSyncedRoot(cwd: string, homeDirectory: string = os.homedir()): string | undefined {\n if (locationHasState(cwd, homeDirectory)) return canonicalPath(cwd);\n const root = resolveDoomConfigurationRoot(cwd, homeDirectory);\n return locationHasState(root, homeDirectory) ? canonicalPath(root) : undefined;\n}\n\nfunction readBootstrapState(repoRoot: string, homeDirectory: string = os.homedir()): BootstrapState | undefined {\n const registration = readSyncRegistration(repoRoot, homeDirectory);\n if (!registration) return undefined;\n const statePath = registration.statePath;\n const generatedDirectory = registration.generationRoot;\n const state = readSyncState(repoRoot, homeDirectory);\n if (!state) return undefined;\n const bootstrap = typeof state.bootstrap === 'string' ? state.bootstrap : undefined;\n if (bootstrap && !isInside(generatedDirectory, bootstrap)) {\n throw new Error(`Doom bootstrap must stay inside ${generatedDirectory}: ${bootstrap}`);\n }\n\n let precompile: BootstrapState['precompile'];\n if (state.precompile !== undefined) {\n const value = state.precompile;\n if (\n !isRecord(value) ||\n typeof value.version !== 'number' ||\n value.strategy !== BUNDLED_PRECOMPILE_STRATEGY ||\n typeof value.bootstrapEntry !== 'string' ||\n typeof value.bootstrapManifest !== 'string' ||\n !isRecord(value.bundleManifests) ||\n Object.values(value.bundleManifests).some((manifest) => typeof manifest !== 'string')\n ) {\n throw new Error(`Doom sync state at ${statePath} has an invalid precompile record`);\n }\n precompile = {\n version: value.version,\n strategy: value.strategy,\n bootstrapEntry: value.bootstrapEntry,\n bootstrapManifest: value.bootstrapManifest,\n bundleManifests: value.bundleManifests as Record<string, string>,\n };\n }\n\n return {\n statePath,\n generatedDirectory,\n bootstrap,\n bundles: stringRecord(state.bundles),\n precompile,\n };\n}\n\nfunction readCompilerManifest(manifestPath: string, generatedDirectory: string): CompilerManifest | undefined {\n if (!isInside(generatedDirectory, manifestPath)) return undefined;\n try {\n const parsed = JSON.parse(fs.readFileSync(manifestPath, 'utf8')) as unknown;\n if (\n !isRecord(parsed) ||\n typeof parsed.output !== 'string' ||\n !Array.isArray(parsed.artifacts) ||\n parsed.artifacts.some((artifact) => typeof artifact !== 'string') ||\n !Array.isArray(parsed.entries) ||\n parsed.entries.some((entry) => typeof entry !== 'string') ||\n !Array.isArray(parsed.inputs)\n ) {\n return undefined;\n }\n const inputs: InputFingerprint[] = [];\n for (const input of parsed.inputs) {\n // A manifest written before digests were recorded cannot be confirmed by\n // content, so it reads as absent and the next sync rewrites it.\n const fingerprint = parseInputFingerprint(input);\n if (fingerprint === undefined) return undefined;\n inputs.push(fingerprint);\n }\n const artifacts = parsed.artifacts as string[];\n const entries = parsed.entries as string[];\n if (\n !isInside(generatedDirectory, parsed.output) ||\n artifacts.some((artifact) => !isInside(generatedDirectory, artifact))\n ) {\n return undefined;\n }\n return { output: parsed.output, artifacts, entries, inputs };\n } catch {\n return undefined;\n }\n}\n\nfunction compilerManifestIsFresh(manifest: CompilerManifest): boolean {\n if (!fs.existsSync(manifest.output) || manifest.artifacts.some((artifact) => !fs.existsSync(artifact))) return false;\n return inputsAreFresh(manifest.inputs);\n}\n\nfunction freshBootstrapRecord(state: BootstrapState, expectedBootstrapEntry: string): CompilerManifest | undefined {\n if (!state.bootstrap || !state.precompile) return undefined;\n if (\n state.precompile.version !== PRECOMPILE_STATE_VERSION ||\n canonicalPath(state.precompile.bootstrapEntry) !== canonicalPath(expectedBootstrapEntry)\n ) {\n return undefined;\n }\n const record = readCompilerManifest(state.precompile.bootstrapManifest, state.generatedDirectory);\n if (\n !record ||\n !compilerManifestIsFresh(record) ||\n record.output !== state.bootstrap ||\n record.entries.length !== 1 ||\n canonicalPath(record.entries[0] ?? '') !== canonicalPath(expectedBootstrapEntry)\n ) {\n return undefined;\n }\n return record;\n}\n\n/** Validates only the bootstrap graph needed before the generated bootstrap is imported. */\nexport function readStartupBootstrapStatus(\n repoRoot: string,\n expectedBootstrapEntry?: string,\n homeDirectory: string = os.homedir(),\n): BootstrapStatus {\n const state = readBootstrapState(repoRoot, homeDirectory);\n const expected = expectedBootstrapEntry ?? packagedDoomEntry();\n if (!state) return { bootstrap: undefined, fresh: false };\n return {\n bootstrap: state.bootstrap,\n fresh: freshBootstrapRecord(state, expected) !== undefined,\n };\n}\n\n/** Validates one selected composition without touching any inactive bundle inputs. */\nexport function readBundleStatus(\n repoRoot: string,\n compositionFingerprint: string,\n homeDirectory: string = os.homedir(),\n): BundleStatus {\n const state = readBootstrapState(repoRoot, homeDirectory);\n const bundle = state?.bundles[compositionFingerprint];\n const manifestPath = state?.precompile?.bundleManifests[compositionFingerprint];\n if (!state || state.precompile?.version !== PRECOMPILE_STATE_VERSION || !bundle || !manifestPath) {\n return { bundle, fresh: false };\n }\n const manifest = readCompilerManifest(manifestPath, state.generatedDirectory);\n return {\n bundle,\n fresh: Boolean(manifest && manifest.output === bundle && compilerManifestIsFresh(manifest)),\n };\n}\n\n/** Validates the bootstrap and every bundle for `doompi sync --check` diagnostics. */\nexport function readBootstrapStatus(\n repoRoot: string,\n expectedBootstrapEntry?: string,\n homeDirectory: string = os.homedir(),\n): BootstrapStatus {\n const state = readBootstrapState(repoRoot, homeDirectory);\n const expected = expectedBootstrapEntry ?? packagedDoomEntry();\n if (!state?.bootstrap || !state.precompile || !freshBootstrapRecord(state, expected)) {\n return { bootstrap: state?.bootstrap, fresh: false };\n }\n const manifests = Object.values(state.precompile.bundleManifests);\n if (new Set(manifests).size !== manifests.length) return { bootstrap: state.bootstrap, fresh: false };\n const fresh = Object.entries(state.bundles).every(([fingerprint, bundle]) => {\n const manifestPath = state.precompile?.bundleManifests[fingerprint];\n if (!manifestPath) return false;\n const manifest = readCompilerManifest(manifestPath, state.generatedDirectory);\n return Boolean(manifest && manifest.output === bundle && compilerManifestIsFresh(manifest));\n });\n return { bootstrap: state.bootstrap, fresh };\n}\n\n/** Reads only the generated bootstrap pointer while retaining state validation. */\nexport function readBootstrapPointer(repoRoot: string, homeDirectory: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AAC,EAAc,MAAO,GAC1B,IAAM,EAAW,EAAqB,EAAc,EAAM,kBAAkB,EAC5E,MAAO,GAAQ,GAAY,EAAS,SAAW,GAAU,EAAwB,CAAQ,EAC3F,CAAC,EACD,MAAO,CAAE,UAAW,EAAM,UAAW,OAAM,CAC7C"}
1
+ {"version":3,"file":"bootstrapLocator.mjs","names":[],"sources":["../../../src/adapters/bootstrapLocator.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { resolveDoomConfigurationRoot } from './repository/repository.ts';\nimport { readSyncRegistration } from './syncRegistration.ts';\nimport { readSyncState } from './syncState.ts';\nimport { BUNDLED_PRECOMPILE_STRATEGY, PRECOMPILE_STATE_VERSION } from './syncStateContract.ts';\n\nconst BOOTSTRAP_ENTRY_ENV = 'DOOMPI_BOOTSTRAP_ENTRY';\n\n/**\n * One recorded build input: the stat pair for speed, the digest for truth.\n *\n * Comparing only `size` and `mtimeMs` makes every rebuild look like a change,\n * including one that restored byte-identical output from a build cache, and a\n * sync triggered that way republishes a generation nobody asked for. Comparing\n * content alone is correct but reads every input on every check, and the\n * cockpit polls this. Recording both lets the stat pair answer the common\n * \"nothing was touched\" case without opening a file, while the digest stays the\n * authority for anything whose stat moved.\n */\nexport interface InputFingerprint {\n path: string;\n size: number;\n mtimeMs: number;\n sha256: string;\n}\n\n/**\n * Verdicts already reached, so a rebuild that rewrote every input without\n * changing it does not re-hash the whole graph on every poll.\n *\n * Keyed by the stats actually found on disk, so it can never answer for a set\n * it did not see. Bounded by the compiler manifests in one composition, which\n * is single digits.\n */\nconst freshnessVerdicts = new Map<string, boolean>();\n\nfunction digestOf(filePath: string): string | undefined {\n try {\n return crypto.createHash('sha256').update(fs.readFileSync(filePath)).digest('hex');\n } catch {\n // Unreadable is indistinguishable from absent here: either way the recorded\n // digest cannot be confirmed, so the caller must treat the build as stale.\n return undefined;\n }\n}\n\n/** Records one build input, or undefined when it is not a readable regular file. */\nexport function fingerprintInput(target: string): InputFingerprint | undefined {\n let stat: fs.Stats;\n try {\n stat = fs.statSync(target);\n } catch {\n // A path that vanished between discovery and recording is simply not an\n // input; the compiler records the set it could read.\n return undefined;\n }\n if (!stat.isFile()) return undefined;\n const sha256 = digestOf(target);\n if (sha256 === undefined) return undefined;\n return { path: target, size: stat.size, mtimeMs: stat.mtimeMs, sha256 };\n}\n\n/** Parses one recorded input, rejecting a record written before digests existed. */\nexport function parseInputFingerprint(value: unknown): InputFingerprint | undefined {\n if (!isRecord(value)) return undefined;\n if (\n typeof value.path !== 'string' ||\n typeof value.size !== 'number' ||\n typeof value.mtimeMs !== 'number' ||\n typeof value.sha256 !== 'string'\n ) {\n return undefined;\n }\n return { path: value.path, size: value.size, mtimeMs: value.mtimeMs, sha256: value.sha256 };\n}\n\n/** Whether every recorded input still holds the bytes it was recorded with. */\nexport function inputsAreFresh(inputs: readonly InputFingerprint[]): boolean {\n const moved: InputFingerprint[] = [];\n const key = crypto.createHash('sha256');\n for (const input of inputs) {\n let stat: fs.Stats;\n try {\n stat = fs.statSync(input.path);\n } catch {\n // A recorded input that is gone cannot be confirmed, and no digest will\n // bring it back; the build it describes is stale.\n return false;\n }\n if (!stat.isFile()) return false;\n key.update(`${input.path} ${String(stat.size)} ${String(stat.mtimeMs)} `);\n if (stat.size !== input.size || stat.mtimeMs !== input.mtimeMs) moved.push(input);\n }\n if (moved.length === 0) return true;\n\n const cacheKey = key.digest('hex');\n const remembered = freshnessVerdicts.get(cacheKey);\n if (remembered !== undefined) return remembered;\n const fresh = moved.every((input) => digestOf(input.path) === input.sha256);\n freshnessVerdicts.set(cacheKey, fresh);\n return fresh;\n}\n\n/** Test seam: the memo is process-local and must not leak between cases. */\nexport function resetInputFreshnessCache(): void {\n freshnessVerdicts.clear();\n}\n\ninterface CompilerManifest {\n output: string;\n artifacts: string[];\n entries: string[];\n inputs: InputFingerprint[];\n}\n\ninterface BootstrapState {\n statePath: string;\n generatedDirectory: string;\n bootstrap?: string;\n bundles: Record<string, string>;\n precompile?: {\n version: number;\n strategy: 'bundle';\n bootstrapEntry: string;\n bootstrapManifest: string;\n bundleManifests: Record<string, string>;\n };\n}\n\nexport interface BootstrapStatus {\n bootstrap?: string;\n fresh: boolean;\n}\n\nexport interface BundleStatus {\n bundle?: string;\n fresh: boolean;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction stringRecord(value: unknown): Record<string, string> {\n if (!isRecord(value)) return {};\n return Object.fromEntries(\n Object.entries(value).filter((entry): entry is [string, string] => typeof entry[1] === 'string'),\n );\n}\n\nfunction canonicalPath(target: string): string {\n const absolute = path.resolve(target);\n try {\n return fs.realpathSync(absolute);\n } catch {\n const parent = path.dirname(absolute);\n if (parent === absolute) return absolute;\n return path.join(canonicalPath(parent), path.basename(absolute));\n }\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 packagedDoomEntry(moduleUrl: string = import.meta.url): string {\n const configuredEntry = process.env[BOOTSTRAP_ENTRY_ENV];\n if (configuredEntry) return configuredEntry;\n const extension = moduleUrl.endsWith('.ts') ? 'ts' : 'mjs';\n const sourceRoot = path.dirname(path.dirname(fileURLToPath(moduleUrl)));\n return path.join(sourceRoot, 'extensions', 'entries', `doom.${extension}`);\n}\n\nfunction locationHasState(repoRoot: string, homeDirectory: string): boolean {\n return readSyncRegistration(repoRoot, homeDirectory) !== undefined;\n}\n\n/** Finds the nearest configured repository with generated Doom sync state. */\nexport function findSyncedRoot(cwd: string, homeDirectory: string = os.homedir()): string | undefined {\n if (locationHasState(cwd, homeDirectory)) return canonicalPath(cwd);\n const root = resolveDoomConfigurationRoot(cwd, homeDirectory);\n return locationHasState(root, homeDirectory) ? canonicalPath(root) : undefined;\n}\n\nfunction readBootstrapState(repoRoot: string, homeDirectory: string = os.homedir()): BootstrapState | undefined {\n const registration = readSyncRegistration(repoRoot, homeDirectory);\n if (!registration) return undefined;\n const statePath = registration.statePath;\n const generatedDirectory = registration.generationRoot;\n const state = readSyncState(repoRoot, homeDirectory);\n if (!state) return undefined;\n const bootstrap = typeof state.bootstrap === 'string' ? state.bootstrap : undefined;\n if (bootstrap && !isInside(generatedDirectory, bootstrap)) {\n throw new Error(`Doom bootstrap must stay inside ${generatedDirectory}: ${bootstrap}`);\n }\n\n let precompile: BootstrapState['precompile'];\n if (state.precompile !== undefined) {\n const value = state.precompile;\n if (\n !isRecord(value) ||\n typeof value.version !== 'number' ||\n value.strategy !== BUNDLED_PRECOMPILE_STRATEGY ||\n typeof value.bootstrapEntry !== 'string' ||\n typeof value.bootstrapManifest !== 'string' ||\n !isRecord(value.bundleManifests) ||\n Object.values(value.bundleManifests).some((manifest) => typeof manifest !== 'string')\n ) {\n throw new Error(`Doom sync state at ${statePath} has an invalid precompile record`);\n }\n precompile = {\n version: value.version,\n strategy: value.strategy,\n bootstrapEntry: value.bootstrapEntry,\n bootstrapManifest: value.bootstrapManifest,\n bundleManifests: value.bundleManifests as Record<string, string>,\n };\n }\n\n return {\n statePath,\n generatedDirectory,\n bootstrap,\n bundles: stringRecord(state.bundles),\n precompile,\n };\n}\n\nfunction readCompilerManifest(manifestPath: string, generatedDirectory: string): CompilerManifest | undefined {\n if (!isInside(generatedDirectory, manifestPath)) return undefined;\n try {\n const parsed = JSON.parse(fs.readFileSync(manifestPath, 'utf8')) as unknown;\n if (\n !isRecord(parsed) ||\n typeof parsed.output !== 'string' ||\n !Array.isArray(parsed.artifacts) ||\n parsed.artifacts.some((artifact) => typeof artifact !== 'string') ||\n !Array.isArray(parsed.entries) ||\n parsed.entries.some((entry) => typeof entry !== 'string') ||\n !Array.isArray(parsed.inputs)\n ) {\n return undefined;\n }\n const inputs: InputFingerprint[] = [];\n for (const input of parsed.inputs) {\n // A manifest written before digests were recorded cannot be confirmed by\n // content, so it reads as absent and the next sync rewrites it.\n const fingerprint = parseInputFingerprint(input);\n if (fingerprint === undefined) return undefined;\n inputs.push(fingerprint);\n }\n const artifacts = parsed.artifacts as string[];\n const entries = parsed.entries as string[];\n if (\n !isInside(generatedDirectory, parsed.output) ||\n artifacts.some((artifact) => !isInside(generatedDirectory, artifact))\n ) {\n return undefined;\n }\n return { output: parsed.output, artifacts, entries, inputs };\n } catch {\n return undefined;\n }\n}\n\nfunction compilerManifestIsFresh(manifest: CompilerManifest): boolean {\n if (!fs.existsSync(manifest.output) || manifest.artifacts.some((artifact) => !fs.existsSync(artifact))) return false;\n return inputsAreFresh(manifest.inputs);\n}\n\nfunction freshBootstrapRecord(state: BootstrapState, expectedBootstrapEntry: string): CompilerManifest | undefined {\n if (!state.bootstrap || !state.precompile) return undefined;\n if (\n state.precompile.version !== PRECOMPILE_STATE_VERSION ||\n canonicalPath(state.precompile.bootstrapEntry) !== canonicalPath(expectedBootstrapEntry)\n ) {\n return undefined;\n }\n const record = readCompilerManifest(state.precompile.bootstrapManifest, state.generatedDirectory);\n if (\n !record ||\n !compilerManifestIsFresh(record) ||\n record.output !== state.bootstrap ||\n record.entries.length !== 1 ||\n canonicalPath(record.entries[0] ?? '') !== canonicalPath(expectedBootstrapEntry)\n ) {\n return undefined;\n }\n return record;\n}\n\n/** Validates only the bootstrap graph needed before the generated bootstrap is imported. */\nexport function readStartupBootstrapStatus(\n repoRoot: string,\n expectedBootstrapEntry?: string,\n homeDirectory: string = os.homedir(),\n): BootstrapStatus {\n const state = readBootstrapState(repoRoot, homeDirectory);\n const expected = expectedBootstrapEntry ?? packagedDoomEntry();\n if (!state) return { bootstrap: undefined, fresh: false };\n return {\n bootstrap: state.bootstrap,\n fresh: freshBootstrapRecord(state, expected) !== undefined,\n };\n}\n\n/** Validates one selected composition without touching any inactive bundle inputs. */\nexport function readBundleStatus(\n repoRoot: string,\n compositionFingerprint: string,\n homeDirectory: string = os.homedir(),\n): BundleStatus {\n const state = readBootstrapState(repoRoot, homeDirectory);\n const bundle = state?.bundles[compositionFingerprint];\n const manifestPath = state?.precompile?.bundleManifests[compositionFingerprint];\n if (!state || state.precompile?.version !== PRECOMPILE_STATE_VERSION || !bundle || !manifestPath) {\n return { bundle, fresh: false };\n }\n const manifest = readCompilerManifest(manifestPath, state.generatedDirectory);\n return {\n bundle,\n fresh: Boolean(manifest && manifest.output === bundle && compilerManifestIsFresh(manifest)),\n };\n}\n\n/** Validates the bootstrap and every bundle for `doompi sync --check` diagnostics. */\nexport function readBootstrapStatus(\n repoRoot: string,\n expectedBootstrapEntry?: string,\n homeDirectory: string = os.homedir(),\n): BootstrapStatus {\n const state = readBootstrapState(repoRoot, homeDirectory);\n const expected = expectedBootstrapEntry ?? packagedDoomEntry();\n if (!state?.bootstrap || !state.precompile || !freshBootstrapRecord(state, expected)) {\n return { bootstrap: state?.bootstrap, fresh: false };\n }\n const manifests = Object.values(state.precompile.bundleManifests);\n if (new Set(manifests).size !== manifests.length) return { bootstrap: state.bootstrap, fresh: false };\n const fresh = Object.entries(state.bundles).every(([fingerprint, bundle]) => {\n const manifestPath = state.precompile?.bundleManifests[fingerprint];\n if (!manifestPath) return false;\n const manifest = readCompilerManifest(manifestPath, state.generatedDirectory);\n return Boolean(manifest && manifest.output === bundle && compilerManifestIsFresh(manifest));\n });\n return { bootstrap: state.bootstrap, fresh };\n}\n\n/** Reads only the generated bootstrap pointer while retaining state validation. */\nexport function readBootstrapPointer(repoRoot: string, homeDirectory: string = os.homedir()): string | undefined {\n return readBootstrapState(repoRoot, homeDirectory)?.bootstrap;\n}\n"],"mappings":"oWAUA,MA4BM,EAAoB,IAAI,IAE9B,SAAS,EAAS,EAAsC,CACtD,GAAI,CACF,OAAO,EAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,EAAG,aAAa,CAAQ,CAAC,CAAC,CAAC,OAAO,KAAK,CACnF,MAAQ,CAGN,MACF,CACF,CAGA,SAAgB,EAAiB,EAA8C,CAC7E,IAAI,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K1D,CAGA,SAAgB,EACd,EACA,EACA,EAAwB,EAAG,QAAQ,EACrB,CACd,IAAM,EAAQ,EAAmB,EAAU,CAAa,EAClD,EAAS,GAAO,QAAQ,GACxB,EAAe,GAAO,YAAY,gBAAgB,GACxD,GAAI,CAAC,GAAS,EAAM,YAAY,UAAA,GAAwC,CAAC,GAAU,CAAC,EAClF,MAAO,CAAE,SAAQ,MAAO,EAAM,EAEhC,IAAM,EAAW,EAAqB,EAAc,EAAM,kBAAkB,EAC5E,MAAO,CACL,SACA,MAAO,GAAQ,GAAY,EAAS,SAAW,GAAU,EAAwB,CAAQ,EAC3F,CACF,CAGA,SAAgB,EACd,EACA,EACA,EAAwB,EAAG,QAAQ,EAClB,CACjB,IAAM,EAAQ,EAAmB,EAAU,CAAa,EAClD,EAAW,GAA0B,EAAkB,EAC7D,GAAI,CAAC,GAAO,WAAa,CAAC,EAAM,YAAc,CAAC,EAAqB,EAAO,CAAQ,EACjF,MAAO,CAAE,UAAW,GAAO,UAAW,MAAO,EAAM,EAErD,IAAM,EAAY,OAAO,OAAO,EAAM,WAAW,eAAe,EAChE,GAAI,IAAI,IAAI,CAAS,CAAC,CAAC,OAAS,EAAU,OAAQ,MAAO,CAAE,UAAW,EAAM,UAAW,MAAO,EAAM,EACpG,IAAM,EAAQ,OAAO,QAAQ,EAAM,OAAO,CAAC,CAAC,OAAO,CAAC,EAAa,KAAY,CAC3E,IAAM,EAAe,EAAM,YAAY,gBAAgB,GACvD,GAAI,CAAC,EAAc,MAAO,GAC1B,IAAM,EAAW,EAAqB,EAAc,EAAM,kBAAkB,EAC5E,MAAO,GAAQ,GAAY,EAAS,SAAW,GAAU,EAAwB,CAAQ,EAC3F,CAAC,EACD,MAAO,CAAE,UAAW,EAAM,UAAW,OAAM,CAC7C"}
@@ -2,9 +2,8 @@ import { CompatibilityContext } from "../compatibilityContext.cjs";
2
2
  import { JsonObject } from "../serialization/json.cjs";
3
3
  //#region src/adapters/compatibility/antigravity.d.ts
4
4
  /** Rewrites one MCP server definition into the shape Antigravity expects. */
5
- declare function adaptAntigravityMcpDefinition(definition: JsonObject, repoRoot: string): JsonObject | undefined;
6
- declare function antigravityCompatibilityArgs(context: CompatibilityContext): string[];
7
- declare function launchAntigravity(context: CompatibilityContext): Promise<number>;
5
+ export declare function adaptAntigravityMcpDefinition(definition: JsonObject, repoRoot: string): JsonObject | undefined;
6
+ export declare function antigravityCompatibilityArgs(context: CompatibilityContext): string[];
7
+ export declare function launchAntigravity(context: CompatibilityContext): Promise<number>;
8
8
  //#endregion
9
- export { adaptAntigravityMcpDefinition, antigravityCompatibilityArgs, launchAntigravity };
10
9
  //# sourceMappingURL=antigravity.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity.d.cts","names":[],"sources":["../../../../src/adapters/compatibility/antigravity.ts"],"mappings":";;;;iBAoDgB,8BAA8B,YAAY,YAAY,mBAAmB;iBA0PzE,6BAA6B,SAAS;iBAQhC,kBAAkB,SAAS,uBAAuB"}
1
+ {"version":3,"file":"antigravity.d.cts","names":[],"sources":["../../../../src/adapters/compatibility/antigravity.ts"],"mappings":";;;;wBAoDgB,8BAA8B,YAAY,YAAY,mBAAmB;wBA0PzE,6BAA6B,SAAS;wBAQhC,kBAAkB,SAAS,uBAAuB"}
@@ -2,9 +2,8 @@ import { CompatibilityContext } from "../compatibilityContext.mjs";
2
2
  import { JsonObject } from "../serialization/json.mjs";
3
3
  //#region src/adapters/compatibility/antigravity.d.ts
4
4
  /** Rewrites one MCP server definition into the shape Antigravity expects. */
5
- declare function adaptAntigravityMcpDefinition(definition: JsonObject, repoRoot: string): JsonObject | undefined;
6
- declare function antigravityCompatibilityArgs(context: CompatibilityContext): string[];
7
- declare function launchAntigravity(context: CompatibilityContext): Promise<number>;
5
+ export declare function adaptAntigravityMcpDefinition(definition: JsonObject, repoRoot: string): JsonObject | undefined;
6
+ export declare function antigravityCompatibilityArgs(context: CompatibilityContext): string[];
7
+ export declare function launchAntigravity(context: CompatibilityContext): Promise<number>;
8
8
  //#endregion
9
- export { adaptAntigravityMcpDefinition, antigravityCompatibilityArgs, launchAntigravity };
10
9
  //# sourceMappingURL=antigravity.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity.d.mts","names":[],"sources":["../../../../src/adapters/compatibility/antigravity.ts"],"mappings":";;;;iBAoDgB,8BAA8B,YAAY,YAAY,mBAAmB;iBA0PzE,6BAA6B,SAAS;iBAQhC,kBAAkB,SAAS,uBAAuB"}
1
+ {"version":3,"file":"antigravity.d.mts","names":[],"sources":["../../../../src/adapters/compatibility/antigravity.ts"],"mappings":";;;;wBAoDgB,8BAA8B,YAAY,YAAY,mBAAmB;wBA0PzE,6BAA6B,SAAS;wBAQhC,kBAAkB,SAAS,uBAAuB"}
@@ -1,18 +1,17 @@
1
1
  import { CompatibilityContext } from "../compatibilityContext.cjs";
2
2
  //#region src/adapters/compatibility/codex.d.ts
3
- declare const CODEX_PROVIDER = "codex";
3
+ export declare const CODEX_PROVIDER = "codex";
4
4
  /**
5
5
  * Whether the managed profile, persona, and proxy config apply to this run.
6
6
  *
7
7
  * Codex management subcommands reject session options, so injecting them would
8
8
  * turn `codex login` into an error.
9
9
  */
10
- declare function supportsCodexManagedProfile(args: string[]): boolean;
10
+ export declare function supportsCodexManagedProfile(args: string[]): boolean;
11
11
  /** Plugin directory names relative to `plugins/`, which is all Codex accepts. */
12
- declare function codexPluginDirectories(context: CompatibilityContext): string[];
13
- declare function codexCompatibilityArgs(context: CompatibilityContext, managedProfileName: string, managedProfileFlag: string): string[];
14
- declare function codexEnvironment(context: CompatibilityContext): NodeJS.ProcessEnv;
15
- declare function launchCodex(context: CompatibilityContext): Promise<number>;
12
+ export declare function codexPluginDirectories(context: CompatibilityContext): string[];
13
+ export declare function codexCompatibilityArgs(context: CompatibilityContext, managedProfileName: string, managedProfileFlag: string): string[];
14
+ export declare function codexEnvironment(context: CompatibilityContext): NodeJS.ProcessEnv;
15
+ export declare function launchCodex(context: CompatibilityContext): Promise<number>;
16
16
  //#endregion
17
- export { CODEX_PROVIDER, codexCompatibilityArgs, codexEnvironment, codexPluginDirectories, launchCodex, supportsCodexManagedProfile };
18
17
  //# sourceMappingURL=codex.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex.d.cts","names":[],"sources":["../../../../src/adapters/compatibility/codex.ts"],"mappings":";;cAkBa;;;;;;;iBAuCG,4BAA4B;;iBAwD5B,uBAAuB,SAAS;iBAkBhC,uBACd,SAAS,sBACT,4BACA;iBAqBc,iBAAiB,SAAS,uBAAuB,OAAO;iBAclD,YAAY,SAAS,uBAAuB"}
1
+ {"version":3,"file":"codex.d.cts","names":[],"sources":["../../../../src/adapters/compatibility/codex.ts"],"mappings":";;qBAkBa;;;;;;;wBAuCG,4BAA4B;;wBAwD5B,uBAAuB,SAAS;wBAkBhC,uBACd,SAAS,sBACT,4BACA;wBAqBc,iBAAiB,SAAS,uBAAuB,OAAO;wBAclD,YAAY,SAAS,uBAAuB"}
@@ -1,18 +1,17 @@
1
1
  import { CompatibilityContext } from "../compatibilityContext.mjs";
2
2
  //#region src/adapters/compatibility/codex.d.ts
3
- declare const CODEX_PROVIDER = "codex";
3
+ export declare const CODEX_PROVIDER = "codex";
4
4
  /**
5
5
  * Whether the managed profile, persona, and proxy config apply to this run.
6
6
  *
7
7
  * Codex management subcommands reject session options, so injecting them would
8
8
  * turn `codex login` into an error.
9
9
  */
10
- declare function supportsCodexManagedProfile(args: string[]): boolean;
10
+ export declare function supportsCodexManagedProfile(args: string[]): boolean;
11
11
  /** Plugin directory names relative to `plugins/`, which is all Codex accepts. */
12
- declare function codexPluginDirectories(context: CompatibilityContext): string[];
13
- declare function codexCompatibilityArgs(context: CompatibilityContext, managedProfileName: string, managedProfileFlag: string): string[];
14
- declare function codexEnvironment(context: CompatibilityContext): NodeJS.ProcessEnv;
15
- declare function launchCodex(context: CompatibilityContext): Promise<number>;
12
+ export declare function codexPluginDirectories(context: CompatibilityContext): string[];
13
+ export declare function codexCompatibilityArgs(context: CompatibilityContext, managedProfileName: string, managedProfileFlag: string): string[];
14
+ export declare function codexEnvironment(context: CompatibilityContext): NodeJS.ProcessEnv;
15
+ export declare function launchCodex(context: CompatibilityContext): Promise<number>;
16
16
  //#endregion
17
- export { CODEX_PROVIDER, codexCompatibilityArgs, codexEnvironment, codexPluginDirectories, launchCodex, supportsCodexManagedProfile };
18
17
  //# sourceMappingURL=codex.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex.d.mts","names":[],"sources":["../../../../src/adapters/compatibility/codex.ts"],"mappings":";;cAkBa;;;;;;;iBAuCG,4BAA4B;;iBAwD5B,uBAAuB,SAAS;iBAkBhC,uBACd,SAAS,sBACT,4BACA;iBAqBc,iBAAiB,SAAS,uBAAuB,OAAO;iBAclD,YAAY,SAAS,uBAAuB"}
1
+ {"version":3,"file":"codex.d.mts","names":[],"sources":["../../../../src/adapters/compatibility/codex.ts"],"mappings":";;qBAkBa;;;;;;;wBAuCG,4BAA4B;;wBAwD5B,uBAAuB,SAAS;wBAkBhC,uBACd,SAAS,sBACT,4BACA;wBAqBc,iBAAiB,SAAS,uBAAuB,OAAO;wBAclD,YAAY,SAAS,uBAAuB"}
@@ -8,8 +8,8 @@ import { mcpProxyArguments } from "./shared.cjs";
8
8
  * Claude needs no state sync: everything it reads is passed as an argument, so
9
9
  * a run leaves nothing behind to revert.
10
10
  */
11
- declare function claudeCompatibilityArgs(context: CompatibilityContext): string[];
12
- declare function launchCompatibility(context: CompatibilityContext): Promise<number>;
11
+ export declare function claudeCompatibilityArgs(context: CompatibilityContext): string[];
12
+ export declare function launchCompatibility(context: CompatibilityContext): Promise<number>;
13
13
  //#endregion
14
- export { acquireDirectoryLock, adaptAntigravityMcpDefinition, antigravityCompatibilityArgs, claudeCompatibilityArgs, codexCompatibilityArgs, codexEnvironment, codexPluginDirectories, forwardSignals, isFileSystemError, launchAntigravity, launchCodex, launchCompatibility, lockOwnerIsRunning, mcpProxyArguments, pathInside, runCaptured, runChecked, runInteractive, signalExitCode, supportsCodexManagedProfile, waitForExit };
14
+ export { acquireDirectoryLock, adaptAntigravityMcpDefinition, antigravityCompatibilityArgs, codexCompatibilityArgs, codexEnvironment, codexPluginDirectories, forwardSignals, isFileSystemError, launchAntigravity, launchCodex, lockOwnerIsRunning, mcpProxyArguments, pathInside, runCaptured, runChecked, runInteractive, signalExitCode, supportsCodexManagedProfile, waitForExit };
15
15
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../../../src/adapters/compatibility/index.ts"],"mappings":";;;;;;;;;;iBAyCgB,wBAAwB,SAAS;iBAsB3B,oBAAoB,SAAS,uBAAuB"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../../../src/adapters/compatibility/index.ts"],"mappings":";;;;;;;;;;wBAyCgB,wBAAwB,SAAS;wBAsB3B,oBAAoB,SAAS,uBAAuB"}
@@ -8,8 +8,8 @@ import { mcpProxyArguments } from "./shared.mjs";
8
8
  * Claude needs no state sync: everything it reads is passed as an argument, so
9
9
  * a run leaves nothing behind to revert.
10
10
  */
11
- declare function claudeCompatibilityArgs(context: CompatibilityContext): string[];
12
- declare function launchCompatibility(context: CompatibilityContext): Promise<number>;
11
+ export declare function claudeCompatibilityArgs(context: CompatibilityContext): string[];
12
+ export declare function launchCompatibility(context: CompatibilityContext): Promise<number>;
13
13
  //#endregion
14
- export { acquireDirectoryLock, adaptAntigravityMcpDefinition, antigravityCompatibilityArgs, claudeCompatibilityArgs, codexCompatibilityArgs, codexEnvironment, codexPluginDirectories, forwardSignals, isFileSystemError, launchAntigravity, launchCodex, launchCompatibility, lockOwnerIsRunning, mcpProxyArguments, pathInside, runCaptured, runChecked, runInteractive, signalExitCode, supportsCodexManagedProfile, waitForExit };
14
+ export { acquireDirectoryLock, adaptAntigravityMcpDefinition, antigravityCompatibilityArgs, codexCompatibilityArgs, codexEnvironment, codexPluginDirectories, forwardSignals, isFileSystemError, launchAntigravity, launchCodex, lockOwnerIsRunning, mcpProxyArguments, pathInside, runCaptured, runChecked, runInteractive, signalExitCode, supportsCodexManagedProfile, waitForExit };
15
15
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/adapters/compatibility/index.ts"],"mappings":";;;;;;;;;;iBAyCgB,wBAAwB,SAAS;iBAsB3B,oBAAoB,SAAS,uBAAuB"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/adapters/compatibility/index.ts"],"mappings":";;;;;;;;;;wBAyCgB,wBAAwB,SAAS;wBAsB3B,oBAAoB,SAAS,uBAAuB"}
@@ -1,11 +1,11 @@
1
1
  import { ChildProcess } from "node:child_process";
2
2
  //#region src/adapters/compatibility/process.d.ts
3
3
  /** Runs a command and returns its trimmed stdout, throwing on a non-zero exit. */
4
- declare function runCaptured(command: string, args: string[], cwd: string, environment: NodeJS.ProcessEnv): string;
4
+ export declare function runCaptured(command: string, args: string[], cwd: string, environment: NodeJS.ProcessEnv): string;
5
5
  /** Runs a command with inherited stdio, throwing on a non-zero exit. */
6
- declare function runChecked(command: string, args: string[], cwd: string, environment: NodeJS.ProcessEnv): void;
6
+ export declare function runChecked(command: string, args: string[], cwd: string, environment: NodeJS.ProcessEnv): void;
7
7
  /** The conventional 128+n exit code for a child killed by a signal. */
8
- declare function signalExitCode(signal: NodeJS.Signals | null): number;
8
+ export declare function signalExitCode(signal: NodeJS.Signals | null): number;
9
9
  /**
10
10
  * Runs an interactive child, forwarding terminal signals for its lifetime.
11
11
  *
@@ -13,22 +13,21 @@ declare function signalExitCode(signal: NodeJS.Signals | null): number;
13
13
  * reaches the child, and removed in a finally so repeated launches in one
14
14
  * process do not accumulate handlers.
15
15
  */
16
- declare function forwardSignals(child: ChildProcess): () => void;
16
+ export declare function forwardSignals(child: ChildProcess): () => void;
17
17
  /** Resolves with the child's exit code, or the conventional code for its signal. */
18
- declare function waitForExit(child: ChildProcess): Promise<number>;
19
- declare function runInteractive(command: string, args: string[], cwd: string, environment: NodeJS.ProcessEnv): Promise<number>;
20
- declare function isFileSystemError(error: unknown): error is NodeJS.ErrnoException;
18
+ export declare function waitForExit(child: ChildProcess): Promise<number>;
19
+ export declare function runInteractive(command: string, args: string[], cwd: string, environment: NodeJS.ProcessEnv): Promise<number>;
20
+ export declare function isFileSystemError(error: unknown): error is NodeJS.ErrnoException;
21
21
  /** True when the recorded lock owner is still a live process. */
22
- declare function lockOwnerIsRunning(lockPath: string): boolean;
22
+ export declare function lockOwnerIsRunning(lockPath: string): boolean;
23
23
  /**
24
24
  * Takes an exclusive lock by creating a directory, which is atomic everywhere.
25
25
  *
26
26
  * A lock older than the stale window whose owner is gone is reclaimed, so a
27
27
  * harness killed mid-sync cannot block every other repository forever.
28
28
  */
29
- declare function acquireDirectoryLock(lockPath: string): Promise<() => Promise<void>>;
29
+ export declare function acquireDirectoryLock(lockPath: string): Promise<() => Promise<void>>;
30
30
  /** True when `candidate` is `root` itself or sits underneath it. */
31
- declare function pathInside(root: string, candidate: string): boolean;
31
+ export declare function pathInside(root: string, candidate: string): boolean;
32
32
  //#endregion
33
- export { acquireDirectoryLock, forwardSignals, isFileSystemError, lockOwnerIsRunning, pathInside, runCaptured, runChecked, runInteractive, signalExitCode, waitForExit };
34
33
  //# sourceMappingURL=process.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"process.d.cts","names":[],"sources":["../../../../src/adapters/compatibility/process.ts"],"mappings":";;;iBA2BgB,YAAY,iBAAiB,gBAAgB,aAAa,aAAa,OAAO;;iBAW9E,WAAW,iBAAiB,gBAAgB,aAAa,aAAa,OAAO;;iBAO7E,eAAe,QAAQ,OAAO;;;;;;;;iBAa9B,eAAe,OAAO;;iBAWtB,YAAY,OAAO,eAAe;iBAO5B,eACpB,iBACA,gBACA,aACA,aAAa,OAAO,aACnB;iBAUa,kBAAkB,iBAAiB,SAAS,OAAO;;iBAKnD,mBAAmB;;;;;;;iBAmBb,qBAAqB,mBAAmB,cAAc;;iBAqC5D,WAAW,cAAc"}
1
+ {"version":3,"file":"process.d.cts","names":[],"sources":["../../../../src/adapters/compatibility/process.ts"],"mappings":";;;wBA2BgB,YAAY,iBAAiB,gBAAgB,aAAa,aAAa,OAAO;;wBAW9E,WAAW,iBAAiB,gBAAgB,aAAa,aAAa,OAAO;;wBAO7E,eAAe,QAAQ,OAAO;;;;;;;;wBAa9B,eAAe,OAAO;;wBAWtB,YAAY,OAAO,eAAe;wBAO5B,eACpB,iBACA,gBACA,aACA,aAAa,OAAO,aACnB;wBAUa,kBAAkB,iBAAiB,SAAS,OAAO;;wBAKnD,mBAAmB;;;;;;;wBAmBb,qBAAqB,mBAAmB,cAAc;;wBAqC5D,WAAW,cAAc"}
@@ -1,11 +1,11 @@
1
1
  import { ChildProcess } from "node:child_process";
2
2
  //#region src/adapters/compatibility/process.d.ts
3
3
  /** Runs a command and returns its trimmed stdout, throwing on a non-zero exit. */
4
- declare function runCaptured(command: string, args: string[], cwd: string, environment: NodeJS.ProcessEnv): string;
4
+ export declare function runCaptured(command: string, args: string[], cwd: string, environment: NodeJS.ProcessEnv): string;
5
5
  /** Runs a command with inherited stdio, throwing on a non-zero exit. */
6
- declare function runChecked(command: string, args: string[], cwd: string, environment: NodeJS.ProcessEnv): void;
6
+ export declare function runChecked(command: string, args: string[], cwd: string, environment: NodeJS.ProcessEnv): void;
7
7
  /** The conventional 128+n exit code for a child killed by a signal. */
8
- declare function signalExitCode(signal: NodeJS.Signals | null): number;
8
+ export declare function signalExitCode(signal: NodeJS.Signals | null): number;
9
9
  /**
10
10
  * Runs an interactive child, forwarding terminal signals for its lifetime.
11
11
  *
@@ -13,22 +13,21 @@ declare function signalExitCode(signal: NodeJS.Signals | null): number;
13
13
  * reaches the child, and removed in a finally so repeated launches in one
14
14
  * process do not accumulate handlers.
15
15
  */
16
- declare function forwardSignals(child: ChildProcess): () => void;
16
+ export declare function forwardSignals(child: ChildProcess): () => void;
17
17
  /** Resolves with the child's exit code, or the conventional code for its signal. */
18
- declare function waitForExit(child: ChildProcess): Promise<number>;
19
- declare function runInteractive(command: string, args: string[], cwd: string, environment: NodeJS.ProcessEnv): Promise<number>;
20
- declare function isFileSystemError(error: unknown): error is NodeJS.ErrnoException;
18
+ export declare function waitForExit(child: ChildProcess): Promise<number>;
19
+ export declare function runInteractive(command: string, args: string[], cwd: string, environment: NodeJS.ProcessEnv): Promise<number>;
20
+ export declare function isFileSystemError(error: unknown): error is NodeJS.ErrnoException;
21
21
  /** True when the recorded lock owner is still a live process. */
22
- declare function lockOwnerIsRunning(lockPath: string): boolean;
22
+ export declare function lockOwnerIsRunning(lockPath: string): boolean;
23
23
  /**
24
24
  * Takes an exclusive lock by creating a directory, which is atomic everywhere.
25
25
  *
26
26
  * A lock older than the stale window whose owner is gone is reclaimed, so a
27
27
  * harness killed mid-sync cannot block every other repository forever.
28
28
  */
29
- declare function acquireDirectoryLock(lockPath: string): Promise<() => Promise<void>>;
29
+ export declare function acquireDirectoryLock(lockPath: string): Promise<() => Promise<void>>;
30
30
  /** True when `candidate` is `root` itself or sits underneath it. */
31
- declare function pathInside(root: string, candidate: string): boolean;
31
+ export declare function pathInside(root: string, candidate: string): boolean;
32
32
  //#endregion
33
- export { acquireDirectoryLock, forwardSignals, isFileSystemError, lockOwnerIsRunning, pathInside, runCaptured, runChecked, runInteractive, signalExitCode, waitForExit };
34
33
  //# sourceMappingURL=process.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"process.d.mts","names":[],"sources":["../../../../src/adapters/compatibility/process.ts"],"mappings":";;;iBA2BgB,YAAY,iBAAiB,gBAAgB,aAAa,aAAa,OAAO;;iBAW9E,WAAW,iBAAiB,gBAAgB,aAAa,aAAa,OAAO;;iBAO7E,eAAe,QAAQ,OAAO;;;;;;;;iBAa9B,eAAe,OAAO;;iBAWtB,YAAY,OAAO,eAAe;iBAO5B,eACpB,iBACA,gBACA,aACA,aAAa,OAAO,aACnB;iBAUa,kBAAkB,iBAAiB,SAAS,OAAO;;iBAKnD,mBAAmB;;;;;;;iBAmBb,qBAAqB,mBAAmB,cAAc;;iBAqC5D,WAAW,cAAc"}
1
+ {"version":3,"file":"process.d.mts","names":[],"sources":["../../../../src/adapters/compatibility/process.ts"],"mappings":";;;wBA2BgB,YAAY,iBAAiB,gBAAgB,aAAa,aAAa,OAAO;;wBAW9E,WAAW,iBAAiB,gBAAgB,aAAa,aAAa,OAAO;;wBAO7E,eAAe,QAAQ,OAAO;;;;;;;;wBAa9B,eAAe,OAAO;;wBAWtB,YAAY,OAAO,eAAe;wBAO5B,eACpB,iBACA,gBACA,aACA,aAAa,OAAO,aACnB;wBAUa,kBAAkB,iBAAiB,SAAS,OAAO;;wBAKnD,mBAAmB;;;;;;;wBAmBb,qBAAqB,mBAAmB,cAAc;;wBAqC5D,WAAW,cAAc"}