@agimon-ai/doompi 0.0.1-alpha.0 → 0.0.1-alpha.10

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 (803) hide show
  1. package/README.md +72 -18
  2. package/dist/adapters/bootstrapLocator.cjs +2 -0
  3. package/dist/adapters/bootstrapLocator.cjs.map +1 -0
  4. package/dist/adapters/bootstrapLocator.d.cts +6 -0
  5. package/dist/adapters/bootstrapLocator.d.cts.map +1 -0
  6. package/dist/adapters/bootstrapLocator.d.mts +6 -0
  7. package/dist/adapters/bootstrapLocator.d.mts.map +1 -0
  8. package/dist/adapters/bootstrapLocator.mjs +2 -0
  9. package/dist/adapters/bootstrapLocator.mjs.map +1 -0
  10. package/dist/adapters/compatibility/antigravity.cjs +2 -0
  11. package/dist/{services → adapters}/compatibility/antigravity.cjs.map +1 -1
  12. package/dist/adapters/compatibility/antigravity.d.cts +11 -0
  13. package/dist/{services → adapters}/compatibility/antigravity.d.cts.map +1 -1
  14. package/dist/adapters/compatibility/antigravity.d.mts +11 -0
  15. package/dist/{services → adapters}/compatibility/antigravity.d.mts.map +1 -1
  16. package/dist/adapters/compatibility/antigravity.mjs +2 -0
  17. package/dist/{services → adapters}/compatibility/antigravity.mjs.map +1 -1
  18. package/dist/adapters/compatibility/codex.cjs +2 -0
  19. package/dist/{services → adapters}/compatibility/codex.cjs.map +1 -1
  20. package/dist/adapters/compatibility/codex.d.cts +19 -0
  21. package/dist/{services → adapters}/compatibility/codex.d.cts.map +1 -1
  22. package/dist/adapters/compatibility/codex.d.mts +19 -0
  23. package/dist/{services → adapters}/compatibility/codex.d.mts.map +1 -1
  24. package/dist/adapters/compatibility/codex.mjs +2 -0
  25. package/dist/{services → adapters}/compatibility/codex.mjs.map +1 -1
  26. package/dist/adapters/compatibility/index.cjs +2 -0
  27. package/dist/adapters/compatibility/index.cjs.map +1 -0
  28. package/dist/adapters/compatibility/index.d.cts +16 -0
  29. package/dist/{services → adapters}/compatibility/index.d.cts.map +1 -1
  30. package/dist/adapters/compatibility/index.d.mts +16 -0
  31. package/dist/{services → adapters}/compatibility/index.d.mts.map +1 -1
  32. package/dist/adapters/compatibility/index.mjs +2 -0
  33. package/dist/adapters/compatibility/index.mjs.map +1 -0
  34. package/dist/adapters/compatibility/process.cjs +2 -0
  35. package/dist/{services → adapters}/compatibility/process.cjs.map +1 -1
  36. package/dist/adapters/compatibility/process.d.cts +35 -0
  37. package/dist/{services → adapters}/compatibility/process.d.cts.map +1 -1
  38. package/dist/adapters/compatibility/process.d.mts +35 -0
  39. package/dist/{services → adapters}/compatibility/process.d.mts.map +1 -1
  40. package/dist/adapters/compatibility/process.mjs +2 -0
  41. package/dist/{services → adapters}/compatibility/process.mjs.map +1 -1
  42. package/dist/adapters/compatibility/shared.cjs +2 -0
  43. package/dist/{services → adapters}/compatibility/shared.cjs.map +1 -1
  44. package/dist/adapters/compatibility/shared.d.cts +33 -0
  45. package/dist/{services → adapters}/compatibility/shared.d.cts.map +1 -1
  46. package/dist/adapters/compatibility/shared.d.mts +33 -0
  47. package/dist/{services → adapters}/compatibility/shared.d.mts.map +1 -1
  48. package/dist/adapters/compatibility/shared.mjs +2 -0
  49. package/dist/{services → adapters}/compatibility/shared.mjs.map +1 -1
  50. package/dist/adapters/compatibilityContext.cjs +2 -0
  51. package/dist/adapters/compatibilityContext.cjs.map +1 -0
  52. package/dist/adapters/compatibilityContext.d.cts +23 -0
  53. package/dist/{services → adapters}/compatibilityContext.d.cts.map +1 -1
  54. package/dist/adapters/compatibilityContext.d.mts +23 -0
  55. package/dist/{services → adapters}/compatibilityContext.d.mts.map +1 -1
  56. package/dist/adapters/compatibilityContext.mjs +2 -0
  57. package/dist/adapters/compatibilityContext.mjs.map +1 -0
  58. package/dist/adapters/composer.cjs +2 -0
  59. package/dist/adapters/composer.cjs.map +1 -0
  60. package/dist/adapters/composer.d.cts +113 -0
  61. package/dist/adapters/composer.d.cts.map +1 -0
  62. package/dist/adapters/composer.d.mts +113 -0
  63. package/dist/adapters/composer.d.mts.map +1 -0
  64. package/dist/adapters/composer.mjs +2 -0
  65. package/dist/adapters/composer.mjs.map +1 -0
  66. package/dist/adapters/compositionState.cjs +2 -0
  67. package/dist/adapters/compositionState.cjs.map +1 -0
  68. package/dist/adapters/compositionState.d.cts +12 -0
  69. package/dist/adapters/compositionState.d.cts.map +1 -0
  70. package/dist/adapters/compositionState.d.mts +12 -0
  71. package/dist/adapters/compositionState.d.mts.map +1 -0
  72. package/dist/adapters/compositionState.mjs +2 -0
  73. package/dist/adapters/compositionState.mjs.map +1 -0
  74. package/dist/adapters/config/harnessState.cjs +2 -0
  75. package/dist/adapters/config/harnessState.cjs.map +1 -0
  76. package/dist/adapters/config/harnessState.d.cts +26 -0
  77. package/dist/adapters/config/harnessState.d.cts.map +1 -0
  78. package/dist/adapters/config/harnessState.d.mts +26 -0
  79. package/dist/adapters/config/harnessState.d.mts.map +1 -0
  80. package/dist/adapters/config/harnessState.mjs +2 -0
  81. package/dist/adapters/config/harnessState.mjs.map +1 -0
  82. package/dist/adapters/deferredSkills.cjs +12 -0
  83. package/dist/adapters/deferredSkills.cjs.map +1 -0
  84. package/dist/adapters/deferredSkills.mjs +12 -0
  85. package/dist/adapters/deferredSkills.mjs.map +1 -0
  86. package/dist/adapters/extensionCompiler.cjs +3 -0
  87. package/dist/adapters/extensionCompiler.cjs.map +1 -0
  88. package/dist/adapters/extensionCompiler.mjs +3 -0
  89. package/dist/adapters/extensionCompiler.mjs.map +1 -0
  90. package/dist/adapters/harnessContext.cjs +2 -0
  91. package/dist/adapters/harnessContext.cjs.map +1 -0
  92. package/dist/adapters/harnessContext.d.cts +61 -0
  93. package/dist/{services → adapters}/harnessContext.d.cts.map +1 -1
  94. package/dist/adapters/harnessContext.d.mts +61 -0
  95. package/dist/{services → adapters}/harnessContext.d.mts.map +1 -1
  96. package/dist/adapters/harnessContext.mjs +2 -0
  97. package/dist/adapters/harnessContext.mjs.map +1 -0
  98. package/dist/adapters/matrixSwitcher.cjs +2 -0
  99. package/dist/adapters/matrixSwitcher.cjs.map +1 -0
  100. package/dist/adapters/matrixSwitcher.d.cts +46 -0
  101. package/dist/{services → adapters}/matrixSwitcher.d.cts.map +1 -1
  102. package/dist/adapters/matrixSwitcher.d.mts +46 -0
  103. package/dist/{services → adapters}/matrixSwitcher.d.mts.map +1 -1
  104. package/dist/adapters/matrixSwitcher.mjs +2 -0
  105. package/dist/adapters/matrixSwitcher.mjs.map +1 -0
  106. package/dist/adapters/mcpFilter.cjs +3 -0
  107. package/dist/adapters/mcpFilter.cjs.map +1 -0
  108. package/dist/adapters/mcpFilter.d.cts +40 -0
  109. package/dist/adapters/mcpFilter.d.cts.map +1 -0
  110. package/dist/adapters/mcpFilter.d.mts +40 -0
  111. package/dist/adapters/mcpFilter.d.mts.map +1 -0
  112. package/dist/adapters/mcpFilter.mjs +3 -0
  113. package/dist/adapters/mcpFilter.mjs.map +1 -0
  114. package/dist/adapters/modules/moduleResolution.cjs +2 -0
  115. package/dist/adapters/modules/moduleResolution.cjs.map +1 -0
  116. package/dist/adapters/modules/moduleResolution.d.cts +56 -0
  117. package/dist/adapters/modules/moduleResolution.d.cts.map +1 -0
  118. package/dist/adapters/modules/moduleResolution.d.mts +56 -0
  119. package/dist/adapters/modules/moduleResolution.d.mts.map +1 -0
  120. package/dist/adapters/modules/moduleResolution.mjs +2 -0
  121. package/dist/adapters/modules/moduleResolution.mjs.map +1 -0
  122. package/dist/adapters/packageBootstrap.cjs +2 -0
  123. package/dist/adapters/packageBootstrap.cjs.map +1 -0
  124. package/dist/adapters/packageBootstrap.d.cts +8 -0
  125. package/dist/adapters/packageBootstrap.d.cts.map +1 -0
  126. package/dist/adapters/packageBootstrap.d.mts +8 -0
  127. package/dist/adapters/packageBootstrap.d.mts.map +1 -0
  128. package/dist/adapters/packageBootstrap.mjs +2 -0
  129. package/dist/adapters/packageBootstrap.mjs.map +1 -0
  130. package/dist/adapters/piExtensionAlias.cjs +2 -0
  131. package/dist/adapters/piExtensionAlias.cjs.map +1 -0
  132. package/dist/adapters/piExtensionAlias.mjs +2 -0
  133. package/dist/adapters/piExtensionAlias.mjs.map +1 -0
  134. package/dist/adapters/piSettings.cjs +2 -0
  135. package/dist/adapters/piSettings.cjs.map +1 -0
  136. package/dist/adapters/piSettings.d.cts +24 -0
  137. package/dist/adapters/piSettings.d.cts.map +1 -0
  138. package/dist/adapters/piSettings.d.mts +24 -0
  139. package/dist/adapters/piSettings.d.mts.map +1 -0
  140. package/dist/adapters/piSettings.mjs +2 -0
  141. package/dist/adapters/piSettings.mjs.map +1 -0
  142. package/dist/adapters/repository/repository.cjs +2 -0
  143. package/dist/adapters/repository/repository.cjs.map +1 -0
  144. package/dist/adapters/repository/repository.d.cts +21 -0
  145. package/dist/adapters/repository/repository.d.cts.map +1 -0
  146. package/dist/adapters/repository/repository.d.mts +21 -0
  147. package/dist/adapters/repository/repository.d.mts.map +1 -0
  148. package/dist/adapters/repository/repository.mjs +2 -0
  149. package/dist/adapters/repository/repository.mjs.map +1 -0
  150. package/dist/adapters/resourceCollector.cjs +3 -0
  151. package/dist/adapters/resourceCollector.cjs.map +1 -0
  152. package/dist/adapters/resourceCollector.d.cts +25 -0
  153. package/dist/adapters/resourceCollector.d.cts.map +1 -0
  154. package/dist/adapters/resourceCollector.d.mts +25 -0
  155. package/dist/adapters/resourceCollector.d.mts.map +1 -0
  156. package/dist/adapters/resourceCollector.mjs +3 -0
  157. package/dist/adapters/resourceCollector.mjs.map +1 -0
  158. package/dist/adapters/runtimeBundle.cjs +2 -0
  159. package/dist/adapters/runtimeBundle.cjs.map +1 -0
  160. package/dist/adapters/runtimeBundle.d.cts +64 -0
  161. package/dist/adapters/runtimeBundle.d.cts.map +1 -0
  162. package/dist/adapters/runtimeBundle.d.mts +64 -0
  163. package/dist/adapters/runtimeBundle.d.mts.map +1 -0
  164. package/dist/adapters/runtimeBundle.mjs +2 -0
  165. package/dist/adapters/runtimeBundle.mjs.map +1 -0
  166. package/dist/adapters/serialization/json.cjs +2 -0
  167. package/dist/adapters/serialization/json.cjs.map +1 -0
  168. package/dist/adapters/serialization/json.d.cts +23 -0
  169. package/dist/adapters/serialization/json.d.cts.map +1 -0
  170. package/dist/adapters/serialization/json.d.mts +23 -0
  171. package/dist/adapters/serialization/json.d.mts.map +1 -0
  172. package/dist/adapters/serialization/json.mjs +2 -0
  173. package/dist/adapters/serialization/json.mjs.map +1 -0
  174. package/dist/adapters/skillCatalog.cjs +2 -0
  175. package/dist/adapters/skillCatalog.cjs.map +1 -0
  176. package/dist/adapters/skillCatalog.d.cts +56 -0
  177. package/dist/{services → adapters}/skillCatalog.d.cts.map +1 -1
  178. package/dist/adapters/skillCatalog.d.mts +56 -0
  179. package/dist/{services → adapters}/skillCatalog.d.mts.map +1 -1
  180. package/dist/adapters/skillCatalog.mjs +2 -0
  181. package/dist/adapters/skillCatalog.mjs.map +1 -0
  182. package/dist/adapters/skillSources.cjs +2 -0
  183. package/dist/{services → adapters}/skillSources.cjs.map +1 -1
  184. package/dist/adapters/skillSources.d.cts +24 -0
  185. package/dist/{services → adapters}/skillSources.d.cts.map +1 -1
  186. package/dist/adapters/skillSources.d.mts +24 -0
  187. package/dist/{services → adapters}/skillSources.d.mts.map +1 -1
  188. package/dist/adapters/skillSources.mjs +2 -0
  189. package/dist/{services → adapters}/skillSources.mjs.map +1 -1
  190. package/dist/adapters/syncState.cjs +2 -0
  191. package/dist/adapters/syncState.cjs.map +1 -0
  192. package/dist/adapters/syncState.d.cts +118 -0
  193. package/dist/adapters/syncState.d.cts.map +1 -0
  194. package/dist/adapters/syncState.d.mts +118 -0
  195. package/dist/adapters/syncState.d.mts.map +1 -0
  196. package/dist/adapters/syncState.mjs +2 -0
  197. package/dist/adapters/syncState.mjs.map +1 -0
  198. package/dist/adapters/syncStateContract.cjs +2 -0
  199. package/dist/adapters/syncStateContract.cjs.map +1 -0
  200. package/dist/adapters/syncStateContract.d.cts +12 -0
  201. package/dist/adapters/syncStateContract.d.cts.map +1 -0
  202. package/dist/adapters/syncStateContract.d.mts +12 -0
  203. package/dist/adapters/syncStateContract.d.mts.map +1 -0
  204. package/dist/adapters/syncStateContract.mjs +2 -0
  205. package/dist/adapters/syncStateContract.mjs.map +1 -0
  206. package/dist/adapters/telemetry/logSinkTelemetry.cjs +2 -0
  207. package/dist/adapters/telemetry/logSinkTelemetry.cjs.map +1 -0
  208. package/dist/adapters/telemetry/logSinkTelemetry.d.cts +51 -0
  209. package/dist/adapters/telemetry/logSinkTelemetry.d.cts.map +1 -0
  210. package/dist/adapters/telemetry/logSinkTelemetry.d.mts +51 -0
  211. package/dist/adapters/telemetry/logSinkTelemetry.d.mts.map +1 -0
  212. package/dist/adapters/telemetry/logSinkTelemetry.mjs +2 -0
  213. package/dist/adapters/telemetry/logSinkTelemetry.mjs.map +1 -0
  214. package/dist/bin/cli.cjs +1 -1
  215. package/dist/bin/cli.cjs.map +1 -1
  216. package/dist/bin/cli.mjs +1 -1
  217. package/dist/bin/cli.mjs.map +1 -1
  218. package/dist/cli/cliApp.cjs +1 -2
  219. package/dist/cli/cliApp.d.cts +2 -50
  220. package/dist/cli/cliApp.d.mts +2 -50
  221. package/dist/cli/cliApp.mjs +1 -2
  222. package/dist/cli/compatibilityOptions.cjs +1 -2
  223. package/dist/cli/compatibilityOptions.d.cts +2 -15
  224. package/dist/cli/compatibilityOptions.d.mts +2 -15
  225. package/dist/cli/compatibilityOptions.mjs +1 -2
  226. package/dist/cli/help.cjs +1 -61
  227. package/dist/cli/help.d.cts +2 -6
  228. package/dist/cli/help.d.mts +2 -6
  229. package/dist/cli/help.mjs +1 -61
  230. package/dist/cli/index.cjs +1 -1
  231. package/dist/cli/index.d.cts +4 -4
  232. package/dist/cli/index.d.mts +4 -4
  233. package/dist/cli/index.mjs +1 -1
  234. package/dist/cli/matrixOptions.cjs +1 -2
  235. package/dist/cli/matrixOptions.d.cts +2 -99
  236. package/dist/cli/matrixOptions.d.mts +2 -99
  237. package/dist/cli/matrixOptions.mjs +1 -2
  238. package/dist/cli/options.cjs +1 -2
  239. package/dist/cli/options.d.cts +2 -7
  240. package/dist/cli/options.d.mts +2 -7
  241. package/dist/cli/options.mjs +1 -2
  242. package/dist/commands/baseCommand.cjs.map +1 -1
  243. package/dist/commands/baseCommand.d.cts +3 -3
  244. package/dist/commands/baseCommand.d.mts +3 -3
  245. package/dist/commands/baseCommand.mjs.map +1 -1
  246. package/dist/commands/buildCommand.cjs +3 -0
  247. package/dist/commands/buildCommand.cjs.map +1 -0
  248. package/dist/commands/buildCommand.d.cts +23 -0
  249. package/dist/commands/buildCommand.d.cts.map +1 -0
  250. package/dist/commands/buildCommand.d.mts +23 -0
  251. package/dist/commands/buildCommand.d.mts.map +1 -0
  252. package/dist/commands/buildCommand.mjs +3 -0
  253. package/dist/commands/buildCommand.mjs.map +1 -0
  254. package/dist/commands/cli/cliApp.cjs +2 -0
  255. package/dist/commands/cli/cliApp.cjs.map +1 -0
  256. package/dist/commands/cli/cliApp.d.cts +45 -0
  257. package/dist/commands/cli/cliApp.d.cts.map +1 -0
  258. package/dist/commands/cli/cliApp.d.mts +45 -0
  259. package/dist/commands/cli/cliApp.d.mts.map +1 -0
  260. package/dist/commands/cli/cliApp.mjs +2 -0
  261. package/dist/commands/cli/cliApp.mjs.map +1 -0
  262. package/dist/commands/cli/compatibilityOptions.cjs +2 -0
  263. package/dist/commands/cli/compatibilityOptions.cjs.map +1 -0
  264. package/dist/commands/cli/compatibilityOptions.d.cts +15 -0
  265. package/dist/commands/cli/compatibilityOptions.d.cts.map +1 -0
  266. package/dist/commands/cli/compatibilityOptions.d.mts +15 -0
  267. package/dist/commands/cli/compatibilityOptions.d.mts.map +1 -0
  268. package/dist/commands/cli/compatibilityOptions.mjs +2 -0
  269. package/dist/commands/cli/compatibilityOptions.mjs.map +1 -0
  270. package/dist/commands/cli/help.cjs +63 -0
  271. package/dist/commands/cli/help.cjs.map +1 -0
  272. package/dist/commands/cli/help.d.cts +6 -0
  273. package/dist/commands/cli/help.d.cts.map +1 -0
  274. package/dist/commands/cli/help.d.mts +6 -0
  275. package/dist/commands/cli/help.d.mts.map +1 -0
  276. package/dist/commands/cli/help.mjs +63 -0
  277. package/dist/commands/cli/help.mjs.map +1 -0
  278. package/dist/commands/cli/index.cjs +1 -0
  279. package/dist/commands/cli/index.d.cts +4 -0
  280. package/dist/commands/cli/index.d.mts +4 -0
  281. package/dist/commands/cli/index.mjs +1 -0
  282. package/dist/commands/cli/matrixOptions.cjs +2 -0
  283. package/dist/commands/cli/matrixOptions.cjs.map +1 -0
  284. package/dist/commands/cli/matrixOptions.d.cts +99 -0
  285. package/dist/commands/cli/matrixOptions.d.cts.map +1 -0
  286. package/dist/commands/cli/matrixOptions.d.mts +99 -0
  287. package/dist/commands/cli/matrixOptions.d.mts.map +1 -0
  288. package/dist/commands/cli/matrixOptions.mjs +2 -0
  289. package/dist/commands/cli/matrixOptions.mjs.map +1 -0
  290. package/dist/commands/cli/options.cjs +2 -0
  291. package/dist/commands/cli/options.cjs.map +1 -0
  292. package/dist/commands/cli/options.d.cts +7 -0
  293. package/dist/commands/cli/options.d.cts.map +1 -0
  294. package/dist/commands/cli/options.d.mts +7 -0
  295. package/dist/commands/cli/options.d.mts.map +1 -0
  296. package/dist/commands/cli/options.mjs +2 -0
  297. package/dist/commands/cli/options.mjs.map +1 -0
  298. package/dist/commands/compatibilityCommand.cjs +1 -1
  299. package/dist/commands/compatibilityCommand.cjs.map +1 -1
  300. package/dist/commands/compatibilityCommand.d.cts +1 -1
  301. package/dist/commands/compatibilityCommand.d.cts.map +1 -1
  302. package/dist/commands/compatibilityCommand.d.mts +1 -1
  303. package/dist/commands/compatibilityCommand.d.mts.map +1 -1
  304. package/dist/commands/compatibilityCommand.mjs +1 -1
  305. package/dist/commands/compatibilityCommand.mjs.map +1 -1
  306. package/dist/commands/emitMcpCommand.cjs +1 -1
  307. package/dist/commands/emitMcpCommand.cjs.map +1 -1
  308. package/dist/commands/emitMcpCommand.d.cts +2 -2
  309. package/dist/commands/emitMcpCommand.d.mts +2 -2
  310. package/dist/commands/emitMcpCommand.mjs +1 -1
  311. package/dist/commands/emitMcpCommand.mjs.map +1 -1
  312. package/dist/commands/explainCommand.cjs +4 -4
  313. package/dist/commands/explainCommand.cjs.map +1 -1
  314. package/dist/commands/explainCommand.d.cts +2 -2
  315. package/dist/commands/explainCommand.d.mts +2 -2
  316. package/dist/commands/explainCommand.mjs +4 -4
  317. package/dist/commands/explainCommand.mjs.map +1 -1
  318. package/dist/commands/index.cjs +1 -1
  319. package/dist/commands/index.d.cts +2 -1
  320. package/dist/commands/index.d.mts +2 -1
  321. package/dist/commands/index.mjs +1 -1
  322. package/dist/commands/initCommand.cjs.map +1 -1
  323. package/dist/commands/initCommand.mjs.map +1 -1
  324. package/dist/commands/launchCommand.cjs +1 -1
  325. package/dist/commands/launchCommand.cjs.map +1 -1
  326. package/dist/commands/launchCommand.d.cts +6 -4
  327. package/dist/commands/launchCommand.d.cts.map +1 -1
  328. package/dist/commands/launchCommand.d.mts +6 -4
  329. package/dist/commands/launchCommand.d.mts.map +1 -1
  330. package/dist/commands/launchCommand.mjs +1 -1
  331. package/dist/commands/launchCommand.mjs.map +1 -1
  332. package/dist/commands/syncCommand.cjs +5 -5
  333. package/dist/commands/syncCommand.cjs.map +1 -1
  334. package/dist/commands/syncCommand.d.cts +2 -2
  335. package/dist/commands/syncCommand.d.cts.map +1 -1
  336. package/dist/commands/syncCommand.d.mts +2 -2
  337. package/dist/commands/syncCommand.d.mts.map +1 -1
  338. package/dist/commands/syncCommand.mjs +5 -5
  339. package/dist/commands/syncCommand.mjs.map +1 -1
  340. package/dist/config/harnessState.cjs +1 -2
  341. package/dist/config/harnessState.d.cts +2 -24
  342. package/dist/config/harnessState.d.mts +2 -24
  343. package/dist/config/harnessState.mjs +1 -2
  344. package/dist/config/index.cjs +1 -1
  345. package/dist/config/index.d.cts +4 -7
  346. package/dist/config/index.d.mts +4 -7
  347. package/dist/config/index.mjs +1 -1
  348. package/dist/config/projectTrust.cjs +1 -2
  349. package/dist/config/projectTrust.d.cts +2 -14
  350. package/dist/config/projectTrust.d.mts +2 -14
  351. package/dist/config/projectTrust.mjs +1 -2
  352. package/dist/entries/autoStop.cjs +1 -2
  353. package/dist/entries/autoStop.d.cts +2 -6
  354. package/dist/entries/autoStop.d.mts +2 -7
  355. package/dist/entries/autoStop.mjs +1 -2
  356. package/dist/entries/components/matrixPicker.cjs +1 -2
  357. package/dist/entries/components/matrixPicker.d.cts +2 -55
  358. package/dist/entries/components/matrixPicker.d.mts +2 -55
  359. package/dist/entries/components/matrixPicker.mjs +1 -2
  360. package/dist/entries/components/skillsOverlay.cjs +1 -4
  361. package/dist/entries/components/skillsOverlay.d.cts +2 -58
  362. package/dist/entries/components/skillsOverlay.d.mts +2 -58
  363. package/dist/entries/components/skillsOverlay.mjs +1 -4
  364. package/dist/entries/domains.cjs +1 -2
  365. package/dist/entries/domains.d.cts +2 -10
  366. package/dist/entries/domains.d.mts +2 -10
  367. package/dist/entries/domains.mjs +1 -2
  368. package/dist/entries/doom.cjs +1 -2
  369. package/dist/entries/doom.d.cts +2 -13
  370. package/dist/entries/doom.d.mts +2 -14
  371. package/dist/entries/doom.mjs +1 -2
  372. package/dist/entries/effort.cjs +1 -2
  373. package/dist/entries/effort.d.cts +2 -10
  374. package/dist/entries/effort.d.mts +2 -10
  375. package/dist/entries/effort.mjs +1 -2
  376. package/dist/entries/majorMode.cjs +1 -6
  377. package/dist/entries/majorMode.d.cts +2 -29
  378. package/dist/entries/majorMode.d.mts +2 -29
  379. package/dist/entries/majorMode.mjs +1 -6
  380. package/dist/entries/notifications.cjs +1 -2
  381. package/dist/entries/notifications.d.cts +2 -13
  382. package/dist/entries/notifications.d.mts +2 -13
  383. package/dist/entries/notifications.mjs +1 -2
  384. package/dist/entries/ollamaProvider.cjs +1 -2
  385. package/dist/entries/ollamaProvider.d.cts +2 -6
  386. package/dist/entries/ollamaProvider.d.mts +2 -7
  387. package/dist/entries/ollamaProvider.mjs +1 -2
  388. package/dist/entries/persona.cjs +1 -2
  389. package/dist/entries/persona.d.cts +2 -14
  390. package/dist/entries/persona.d.mts +2 -15
  391. package/dist/entries/persona.mjs +1 -2
  392. package/dist/entries/profile.cjs +1 -3
  393. package/dist/entries/profile.d.cts +2 -16
  394. package/dist/entries/profile.d.mts +2 -16
  395. package/dist/entries/profile.mjs +1 -3
  396. package/dist/entries/repositoryHooks.cjs +1 -9
  397. package/dist/entries/repositoryHooks.d.cts +2 -7
  398. package/dist/entries/repositoryHooks.d.mts +2 -8
  399. package/dist/entries/repositoryHooks.mjs +1 -9
  400. package/dist/entries/skills.cjs +1 -2
  401. package/dist/entries/skills.d.cts +2 -34
  402. package/dist/entries/skills.d.mts +2 -34
  403. package/dist/entries/skills.mjs +1 -2
  404. package/dist/entries/styleSystem.cjs +1 -4
  405. package/dist/entries/styleSystem.d.cts +2 -32
  406. package/dist/entries/styleSystem.d.mts +2 -32
  407. package/dist/entries/styleSystem.mjs +1 -4
  408. package/dist/extensions/entries/autoStop.cjs +2 -0
  409. package/dist/extensions/entries/autoStop.cjs.map +1 -0
  410. package/dist/extensions/entries/autoStop.d.cts +7 -0
  411. package/dist/extensions/entries/autoStop.d.cts.map +1 -0
  412. package/dist/extensions/entries/autoStop.d.mts +7 -0
  413. package/dist/extensions/entries/autoStop.d.mts.map +1 -0
  414. package/dist/extensions/entries/autoStop.mjs +2 -0
  415. package/dist/extensions/entries/autoStop.mjs.map +1 -0
  416. package/dist/extensions/entries/components/matrixPicker.cjs +2 -0
  417. package/dist/extensions/entries/components/matrixPicker.cjs.map +1 -0
  418. package/dist/extensions/entries/components/matrixPicker.d.cts +55 -0
  419. package/dist/extensions/entries/components/matrixPicker.d.cts.map +1 -0
  420. package/dist/extensions/entries/components/matrixPicker.d.mts +55 -0
  421. package/dist/extensions/entries/components/matrixPicker.d.mts.map +1 -0
  422. package/dist/extensions/entries/components/matrixPicker.mjs +2 -0
  423. package/dist/extensions/entries/components/matrixPicker.mjs.map +1 -0
  424. package/dist/extensions/entries/components/skillsOverlay.cjs +4 -0
  425. package/dist/extensions/entries/components/skillsOverlay.cjs.map +1 -0
  426. package/dist/extensions/entries/components/skillsOverlay.d.cts +58 -0
  427. package/dist/extensions/entries/components/skillsOverlay.d.cts.map +1 -0
  428. package/dist/extensions/entries/components/skillsOverlay.d.mts +58 -0
  429. package/dist/extensions/entries/components/skillsOverlay.d.mts.map +1 -0
  430. package/dist/extensions/entries/components/skillsOverlay.mjs +4 -0
  431. package/dist/extensions/entries/components/skillsOverlay.mjs.map +1 -0
  432. package/dist/extensions/entries/domains.cjs +2 -0
  433. package/dist/extensions/entries/domains.cjs.map +1 -0
  434. package/dist/extensions/entries/domains.d.cts +10 -0
  435. package/dist/extensions/entries/domains.d.cts.map +1 -0
  436. package/dist/extensions/entries/domains.d.mts +10 -0
  437. package/dist/extensions/entries/domains.d.mts.map +1 -0
  438. package/dist/extensions/entries/domains.mjs +2 -0
  439. package/dist/extensions/entries/domains.mjs.map +1 -0
  440. package/dist/extensions/entries/doom.cjs +2 -0
  441. package/dist/extensions/entries/doom.cjs.map +1 -0
  442. package/dist/extensions/entries/doom.d.cts +14 -0
  443. package/dist/extensions/entries/doom.d.cts.map +1 -0
  444. package/dist/extensions/entries/doom.d.mts +14 -0
  445. package/dist/extensions/entries/doom.d.mts.map +1 -0
  446. package/dist/extensions/entries/doom.mjs +2 -0
  447. package/dist/extensions/entries/doom.mjs.map +1 -0
  448. package/dist/extensions/entries/effort.cjs +2 -0
  449. package/dist/extensions/entries/effort.cjs.map +1 -0
  450. package/dist/extensions/entries/effort.d.cts +10 -0
  451. package/dist/extensions/entries/effort.d.cts.map +1 -0
  452. package/dist/extensions/entries/effort.d.mts +10 -0
  453. package/dist/extensions/entries/effort.d.mts.map +1 -0
  454. package/dist/extensions/entries/effort.mjs +2 -0
  455. package/dist/extensions/entries/effort.mjs.map +1 -0
  456. package/dist/extensions/entries/majorMode.cjs +6 -0
  457. package/dist/extensions/entries/majorMode.cjs.map +1 -0
  458. package/dist/extensions/entries/majorMode.d.cts +29 -0
  459. package/dist/extensions/entries/majorMode.d.cts.map +1 -0
  460. package/dist/extensions/entries/majorMode.d.mts +29 -0
  461. package/dist/extensions/entries/majorMode.d.mts.map +1 -0
  462. package/dist/extensions/entries/majorMode.mjs +6 -0
  463. package/dist/extensions/entries/majorMode.mjs.map +1 -0
  464. package/dist/extensions/entries/notifications.cjs +2 -0
  465. package/dist/extensions/entries/notifications.cjs.map +1 -0
  466. package/dist/extensions/entries/notifications.d.cts +14 -0
  467. package/dist/extensions/entries/notifications.d.cts.map +1 -0
  468. package/dist/extensions/entries/notifications.d.mts +14 -0
  469. package/dist/extensions/entries/notifications.d.mts.map +1 -0
  470. package/dist/extensions/entries/notifications.mjs +2 -0
  471. package/dist/extensions/entries/notifications.mjs.map +1 -0
  472. package/dist/extensions/entries/ollamaProvider.cjs +2 -0
  473. package/dist/extensions/entries/ollamaProvider.cjs.map +1 -0
  474. package/dist/extensions/entries/ollamaProvider.d.cts +7 -0
  475. package/dist/extensions/entries/ollamaProvider.d.cts.map +1 -0
  476. package/dist/extensions/entries/ollamaProvider.d.mts +7 -0
  477. package/dist/extensions/entries/ollamaProvider.d.mts.map +1 -0
  478. package/dist/extensions/entries/ollamaProvider.mjs +2 -0
  479. package/dist/extensions/entries/ollamaProvider.mjs.map +1 -0
  480. package/dist/extensions/entries/persona.cjs +2 -0
  481. package/dist/extensions/entries/persona.cjs.map +1 -0
  482. package/dist/extensions/entries/persona.d.cts +15 -0
  483. package/dist/extensions/entries/persona.d.cts.map +1 -0
  484. package/dist/extensions/entries/persona.d.mts +15 -0
  485. package/dist/extensions/entries/persona.d.mts.map +1 -0
  486. package/dist/extensions/entries/persona.mjs +2 -0
  487. package/dist/extensions/entries/persona.mjs.map +1 -0
  488. package/dist/extensions/entries/profile.cjs +3 -0
  489. package/dist/extensions/entries/profile.cjs.map +1 -0
  490. package/dist/extensions/entries/profile.d.cts +18 -0
  491. package/dist/extensions/entries/profile.d.cts.map +1 -0
  492. package/dist/extensions/entries/profile.d.mts +18 -0
  493. package/dist/extensions/entries/profile.d.mts.map +1 -0
  494. package/dist/extensions/entries/profile.mjs +3 -0
  495. package/dist/extensions/entries/profile.mjs.map +1 -0
  496. package/dist/extensions/entries/repositoryHooks.cjs +9 -0
  497. package/dist/extensions/entries/repositoryHooks.cjs.map +1 -0
  498. package/dist/extensions/entries/repositoryHooks.d.cts +8 -0
  499. package/dist/extensions/entries/repositoryHooks.d.cts.map +1 -0
  500. package/dist/extensions/entries/repositoryHooks.d.mts +8 -0
  501. package/dist/extensions/entries/repositoryHooks.d.mts.map +1 -0
  502. package/dist/extensions/entries/repositoryHooks.mjs +9 -0
  503. package/dist/extensions/entries/repositoryHooks.mjs.map +1 -0
  504. package/dist/extensions/entries/shellTitleController.cjs +27 -0
  505. package/dist/extensions/entries/shellTitleController.cjs.map +1 -0
  506. package/dist/extensions/entries/shellTitleController.d.cts +11 -0
  507. package/dist/extensions/entries/shellTitleController.d.cts.map +1 -0
  508. package/dist/extensions/entries/shellTitleController.d.mts +11 -0
  509. package/dist/extensions/entries/shellTitleController.d.mts.map +1 -0
  510. package/dist/extensions/entries/shellTitleController.mjs +27 -0
  511. package/dist/extensions/entries/shellTitleController.mjs.map +1 -0
  512. package/dist/extensions/entries/skills.cjs +3 -0
  513. package/dist/extensions/entries/skills.cjs.map +1 -0
  514. package/dist/extensions/entries/skills.d.cts +34 -0
  515. package/dist/extensions/entries/skills.d.cts.map +1 -0
  516. package/dist/extensions/entries/skills.d.mts +34 -0
  517. package/dist/extensions/entries/skills.d.mts.map +1 -0
  518. package/dist/extensions/entries/skills.mjs +3 -0
  519. package/dist/extensions/entries/skills.mjs.map +1 -0
  520. package/dist/extensions/entries/styleSystem.cjs +4 -0
  521. package/dist/extensions/entries/styleSystem.cjs.map +1 -0
  522. package/dist/extensions/entries/styleSystem.d.cts +32 -0
  523. package/dist/extensions/entries/styleSystem.d.cts.map +1 -0
  524. package/dist/extensions/entries/styleSystem.d.mts +32 -0
  525. package/dist/extensions/entries/styleSystem.d.mts.map +1 -0
  526. package/dist/extensions/entries/styleSystem.mjs +4 -0
  527. package/dist/{entries/styleSystem.cjs.map → extensions/entries/styleSystem.mjs.map} +1 -1
  528. package/dist/extensions/pi.cjs +1 -0
  529. package/dist/extensions/pi.d.cts +2 -0
  530. package/dist/extensions/pi.d.mts +2 -0
  531. package/dist/extensions/pi.mjs +1 -0
  532. package/dist/index.cjs +1 -1
  533. package/dist/index.d.cts +31 -26
  534. package/dist/index.d.mts +31 -26
  535. package/dist/index.mjs +1 -1
  536. package/dist/logSinkTelemetry.cjs +1 -2
  537. package/dist/logSinkTelemetry.d.cts +2 -49
  538. package/dist/logSinkTelemetry.d.mts +2 -49
  539. package/dist/logSinkTelemetry.mjs +1 -2
  540. package/dist/services/compatibility/antigravity.cjs +1 -2
  541. package/dist/services/compatibility/antigravity.d.cts +2 -11
  542. package/dist/services/compatibility/antigravity.d.mts +2 -11
  543. package/dist/services/compatibility/antigravity.mjs +1 -2
  544. package/dist/services/compatibility/codex.cjs +1 -2
  545. package/dist/services/compatibility/codex.d.cts +2 -19
  546. package/dist/services/compatibility/codex.d.mts +2 -19
  547. package/dist/services/compatibility/codex.mjs +1 -2
  548. package/dist/services/compatibility/index.cjs +1 -2
  549. package/dist/services/compatibility/index.d.cts +6 -16
  550. package/dist/services/compatibility/index.d.mts +6 -16
  551. package/dist/services/compatibility/index.mjs +1 -2
  552. package/dist/services/compatibility/process.cjs +1 -2
  553. package/dist/services/compatibility/process.d.cts +2 -35
  554. package/dist/services/compatibility/process.d.mts +2 -35
  555. package/dist/services/compatibility/process.mjs +1 -2
  556. package/dist/services/compatibility/shared.cjs +1 -2
  557. package/dist/services/compatibility/shared.d.cts +2 -33
  558. package/dist/services/compatibility/shared.d.mts +2 -33
  559. package/dist/services/compatibility/shared.mjs +1 -2
  560. package/dist/services/compatibilityContext.cjs +1 -2
  561. package/dist/services/compatibilityContext.d.cts +2 -23
  562. package/dist/services/compatibilityContext.d.mts +2 -23
  563. package/dist/services/compatibilityContext.mjs +1 -2
  564. package/dist/services/composer.cjs +1 -2
  565. package/dist/services/composer.d.cts +4 -133
  566. package/dist/services/composer.d.mts +4 -133
  567. package/dist/services/composer.mjs +1 -2
  568. package/dist/services/config/index.cjs +1 -0
  569. package/dist/services/config/index.d.cts +7 -0
  570. package/dist/services/config/index.d.mts +7 -0
  571. package/dist/services/config/index.mjs +1 -0
  572. package/dist/services/config/projectTrust.cjs +2 -0
  573. package/dist/services/config/projectTrust.cjs.map +1 -0
  574. package/dist/services/config/projectTrust.d.cts +14 -0
  575. package/dist/services/config/projectTrust.d.cts.map +1 -0
  576. package/dist/services/config/projectTrust.d.mts +14 -0
  577. package/dist/services/config/projectTrust.d.mts.map +1 -0
  578. package/dist/services/config/projectTrust.mjs +2 -0
  579. package/dist/services/config/projectTrust.mjs.map +1 -0
  580. package/dist/services/extensionAssembler.cjs +1 -1
  581. package/dist/services/extensionAssembler.cjs.map +1 -1
  582. package/dist/services/extensionAssembler.d.cts.map +1 -1
  583. package/dist/services/extensionAssembler.d.mts.map +1 -1
  584. package/dist/services/extensionAssembler.mjs +1 -1
  585. package/dist/services/extensionAssembler.mjs.map +1 -1
  586. package/dist/services/harnessContext.cjs +1 -2
  587. package/dist/services/harnessContext.d.cts +2 -61
  588. package/dist/services/harnessContext.d.mts +2 -61
  589. package/dist/services/harnessContext.mjs +1 -2
  590. package/dist/services/index.cjs +1 -1
  591. package/dist/services/index.d.cts +16 -13
  592. package/dist/services/index.d.mts +16 -13
  593. package/dist/services/index.mjs +1 -1
  594. package/dist/services/matrixSwitcher.cjs +1 -2
  595. package/dist/services/matrixSwitcher.d.cts +2 -46
  596. package/dist/services/matrixSwitcher.d.mts +2 -46
  597. package/dist/services/matrixSwitcher.mjs +1 -2
  598. package/dist/services/mcpFilter.cjs +1 -3
  599. package/dist/services/mcpFilter.d.cts +2 -40
  600. package/dist/services/mcpFilter.d.mts +2 -40
  601. package/dist/services/mcpFilter.mjs +1 -3
  602. package/dist/services/piSettings.cjs +1 -2
  603. package/dist/services/piSettings.d.cts +2 -24
  604. package/dist/services/piSettings.d.mts +2 -24
  605. package/dist/services/piSettings.mjs +1 -2
  606. package/dist/services/resourceCollector.cjs +1 -3
  607. package/dist/services/resourceCollector.d.cts +2 -16
  608. package/dist/services/resourceCollector.d.mts +2 -16
  609. package/dist/services/resourceCollector.mjs +1 -3
  610. package/dist/services/skillCatalog.cjs +1 -2
  611. package/dist/services/skillCatalog.d.cts +2 -56
  612. package/dist/services/skillCatalog.d.mts +2 -56
  613. package/dist/services/skillCatalog.mjs +1 -2
  614. package/dist/services/skillSources.cjs +1 -2
  615. package/dist/services/skillSources.d.cts +2 -24
  616. package/dist/services/skillSources.d.mts +2 -24
  617. package/dist/services/skillSources.mjs +1 -2
  618. package/dist/services/syncState.cjs +1 -2
  619. package/dist/services/syncState.d.cts +3 -130
  620. package/dist/services/syncState.d.mts +3 -130
  621. package/dist/services/syncState.mjs +1 -2
  622. package/dist/services/tools/toolNames.cjs +2 -0
  623. package/dist/services/tools/toolNames.cjs.map +1 -0
  624. package/dist/services/tools/toolNames.d.cts +25 -0
  625. package/dist/services/tools/toolNames.d.cts.map +1 -0
  626. package/dist/services/tools/toolNames.d.mts +25 -0
  627. package/dist/services/tools/toolNames.d.mts.map +1 -0
  628. package/dist/services/tools/toolNames.mjs +2 -0
  629. package/dist/services/tools/toolNames.mjs.map +1 -0
  630. package/dist/{interfaces → types/interfaces}/compatibility.d.cts +1 -1
  631. package/dist/types/interfaces/compatibility.d.cts.map +1 -0
  632. package/dist/{interfaces → types/interfaces}/compatibility.d.mts +1 -1
  633. package/dist/types/interfaces/compatibility.d.mts.map +1 -0
  634. package/dist/{interfaces → types/interfaces}/harness.d.cts +2 -1
  635. package/dist/types/interfaces/harness.d.cts.map +1 -0
  636. package/dist/{interfaces → types/interfaces}/harness.d.mts +2 -1
  637. package/dist/types/interfaces/harness.d.mts.map +1 -0
  638. package/dist/utils/index.cjs +1 -1
  639. package/dist/utils/index.d.cts +4 -4
  640. package/dist/utils/index.d.mts +4 -4
  641. package/dist/utils/index.mjs +1 -1
  642. package/dist/utils/json.cjs +1 -2
  643. package/dist/utils/json.d.cts +2 -23
  644. package/dist/utils/json.d.mts +2 -23
  645. package/dist/utils/json.mjs +1 -2
  646. package/dist/utils/moduleResolution.cjs +1 -2
  647. package/dist/utils/moduleResolution.d.cts +2 -56
  648. package/dist/utils/moduleResolution.d.mts +2 -56
  649. package/dist/utils/moduleResolution.mjs +1 -2
  650. package/dist/utils/repository.cjs +1 -2
  651. package/dist/utils/repository.d.cts +2 -21
  652. package/dist/utils/repository.d.mts +2 -21
  653. package/dist/utils/repository.mjs +1 -2
  654. package/dist/utils/toolNames.cjs +1 -2
  655. package/dist/utils/toolNames.d.cts +2 -25
  656. package/dist/utils/toolNames.d.mts +2 -25
  657. package/dist/utils/toolNames.mjs +1 -2
  658. package/package.json +32 -18
  659. package/dist/cli/cliApp.cjs.map +0 -1
  660. package/dist/cli/cliApp.d.cts.map +0 -1
  661. package/dist/cli/cliApp.d.mts.map +0 -1
  662. package/dist/cli/cliApp.mjs.map +0 -1
  663. package/dist/cli/compatibilityOptions.cjs.map +0 -1
  664. package/dist/cli/compatibilityOptions.d.cts.map +0 -1
  665. package/dist/cli/compatibilityOptions.d.mts.map +0 -1
  666. package/dist/cli/compatibilityOptions.mjs.map +0 -1
  667. package/dist/cli/help.cjs.map +0 -1
  668. package/dist/cli/help.d.cts.map +0 -1
  669. package/dist/cli/help.d.mts.map +0 -1
  670. package/dist/cli/help.mjs.map +0 -1
  671. package/dist/cli/matrixOptions.cjs.map +0 -1
  672. package/dist/cli/matrixOptions.d.cts.map +0 -1
  673. package/dist/cli/matrixOptions.d.mts.map +0 -1
  674. package/dist/cli/matrixOptions.mjs.map +0 -1
  675. package/dist/cli/options.cjs.map +0 -1
  676. package/dist/cli/options.d.cts.map +0 -1
  677. package/dist/cli/options.d.mts.map +0 -1
  678. package/dist/cli/options.mjs.map +0 -1
  679. package/dist/config/harnessState.cjs.map +0 -1
  680. package/dist/config/harnessState.d.cts.map +0 -1
  681. package/dist/config/harnessState.d.mts.map +0 -1
  682. package/dist/config/harnessState.mjs.map +0 -1
  683. package/dist/config/projectTrust.cjs.map +0 -1
  684. package/dist/config/projectTrust.d.cts.map +0 -1
  685. package/dist/config/projectTrust.d.mts.map +0 -1
  686. package/dist/config/projectTrust.mjs.map +0 -1
  687. package/dist/entries/autoStop.cjs.map +0 -1
  688. package/dist/entries/autoStop.d.cts.map +0 -1
  689. package/dist/entries/autoStop.d.mts.map +0 -1
  690. package/dist/entries/autoStop.mjs.map +0 -1
  691. package/dist/entries/components/matrixPicker.cjs.map +0 -1
  692. package/dist/entries/components/matrixPicker.d.cts.map +0 -1
  693. package/dist/entries/components/matrixPicker.d.mts.map +0 -1
  694. package/dist/entries/components/matrixPicker.mjs.map +0 -1
  695. package/dist/entries/components/skillsOverlay.cjs.map +0 -1
  696. package/dist/entries/components/skillsOverlay.d.cts.map +0 -1
  697. package/dist/entries/components/skillsOverlay.d.mts.map +0 -1
  698. package/dist/entries/components/skillsOverlay.mjs.map +0 -1
  699. package/dist/entries/domains.cjs.map +0 -1
  700. package/dist/entries/domains.d.cts.map +0 -1
  701. package/dist/entries/domains.d.mts.map +0 -1
  702. package/dist/entries/domains.mjs.map +0 -1
  703. package/dist/entries/doom.cjs.map +0 -1
  704. package/dist/entries/doom.d.cts.map +0 -1
  705. package/dist/entries/doom.d.mts.map +0 -1
  706. package/dist/entries/doom.mjs.map +0 -1
  707. package/dist/entries/effort.cjs.map +0 -1
  708. package/dist/entries/effort.d.cts.map +0 -1
  709. package/dist/entries/effort.d.mts.map +0 -1
  710. package/dist/entries/effort.mjs.map +0 -1
  711. package/dist/entries/majorMode.cjs.map +0 -1
  712. package/dist/entries/majorMode.d.cts.map +0 -1
  713. package/dist/entries/majorMode.d.mts.map +0 -1
  714. package/dist/entries/majorMode.mjs.map +0 -1
  715. package/dist/entries/notifications.cjs.map +0 -1
  716. package/dist/entries/notifications.d.cts.map +0 -1
  717. package/dist/entries/notifications.d.mts.map +0 -1
  718. package/dist/entries/notifications.mjs.map +0 -1
  719. package/dist/entries/ollamaProvider.cjs.map +0 -1
  720. package/dist/entries/ollamaProvider.d.cts.map +0 -1
  721. package/dist/entries/ollamaProvider.d.mts.map +0 -1
  722. package/dist/entries/ollamaProvider.mjs.map +0 -1
  723. package/dist/entries/persona.cjs.map +0 -1
  724. package/dist/entries/persona.d.cts.map +0 -1
  725. package/dist/entries/persona.d.mts.map +0 -1
  726. package/dist/entries/persona.mjs.map +0 -1
  727. package/dist/entries/profile.cjs.map +0 -1
  728. package/dist/entries/profile.d.cts.map +0 -1
  729. package/dist/entries/profile.d.mts.map +0 -1
  730. package/dist/entries/profile.mjs.map +0 -1
  731. package/dist/entries/repositoryHooks.cjs.map +0 -1
  732. package/dist/entries/repositoryHooks.d.cts.map +0 -1
  733. package/dist/entries/repositoryHooks.d.mts.map +0 -1
  734. package/dist/entries/repositoryHooks.mjs.map +0 -1
  735. package/dist/entries/skills.cjs.map +0 -1
  736. package/dist/entries/skills.d.cts.map +0 -1
  737. package/dist/entries/skills.d.mts.map +0 -1
  738. package/dist/entries/skills.mjs.map +0 -1
  739. package/dist/entries/styleSystem.d.cts.map +0 -1
  740. package/dist/entries/styleSystem.d.mts.map +0 -1
  741. package/dist/entries/styleSystem.mjs.map +0 -1
  742. package/dist/interfaces/compatibility.d.cts.map +0 -1
  743. package/dist/interfaces/compatibility.d.mts.map +0 -1
  744. package/dist/interfaces/harness.d.cts.map +0 -1
  745. package/dist/interfaces/harness.d.mts.map +0 -1
  746. package/dist/logSinkTelemetry.cjs.map +0 -1
  747. package/dist/logSinkTelemetry.d.cts.map +0 -1
  748. package/dist/logSinkTelemetry.d.mts.map +0 -1
  749. package/dist/logSinkTelemetry.mjs.map +0 -1
  750. package/dist/node_modules/.pnpm/@juicesharp_rpiv-ask-user-question@2.2.0_@earendil-works_pi-coding-agent@0.84.1_support_6ba1249e24a50b62791c1c91c9f324c6/node_modules/@juicesharp/rpiv-ask-user-question/events.cjs +0 -2
  751. package/dist/node_modules/.pnpm/@juicesharp_rpiv-ask-user-question@2.2.0_@earendil-works_pi-coding-agent@0.84.1_support_6ba1249e24a50b62791c1c91c9f324c6/node_modules/@juicesharp/rpiv-ask-user-question/events.cjs.map +0 -1
  752. package/dist/node_modules/.pnpm/@juicesharp_rpiv-ask-user-question@2.2.0_@earendil-works_pi-coding-agent@0.84.1_support_6ba1249e24a50b62791c1c91c9f324c6/node_modules/@juicesharp/rpiv-ask-user-question/events.mjs +0 -2
  753. package/dist/node_modules/.pnpm/@juicesharp_rpiv-ask-user-question@2.2.0_@earendil-works_pi-coding-agent@0.84.1_support_6ba1249e24a50b62791c1c91c9f324c6/node_modules/@juicesharp/rpiv-ask-user-question/events.mjs.map +0 -1
  754. package/dist/services/compatibility/index.cjs.map +0 -1
  755. package/dist/services/compatibility/index.mjs.map +0 -1
  756. package/dist/services/compatibilityContext.cjs.map +0 -1
  757. package/dist/services/compatibilityContext.mjs.map +0 -1
  758. package/dist/services/composer.cjs.map +0 -1
  759. package/dist/services/composer.d.cts.map +0 -1
  760. package/dist/services/composer.d.mts.map +0 -1
  761. package/dist/services/composer.mjs.map +0 -1
  762. package/dist/services/extensionCompiler.cjs +0 -2
  763. package/dist/services/extensionCompiler.cjs.map +0 -1
  764. package/dist/services/extensionCompiler.mjs +0 -2
  765. package/dist/services/extensionCompiler.mjs.map +0 -1
  766. package/dist/services/harnessContext.cjs.map +0 -1
  767. package/dist/services/harnessContext.mjs.map +0 -1
  768. package/dist/services/matrixSwitcher.cjs.map +0 -1
  769. package/dist/services/matrixSwitcher.mjs.map +0 -1
  770. package/dist/services/mcpFilter.cjs.map +0 -1
  771. package/dist/services/mcpFilter.d.cts.map +0 -1
  772. package/dist/services/mcpFilter.d.mts.map +0 -1
  773. package/dist/services/mcpFilter.mjs.map +0 -1
  774. package/dist/services/piSettings.cjs.map +0 -1
  775. package/dist/services/piSettings.d.cts.map +0 -1
  776. package/dist/services/piSettings.d.mts.map +0 -1
  777. package/dist/services/piSettings.mjs.map +0 -1
  778. package/dist/services/resourceCollector.cjs.map +0 -1
  779. package/dist/services/resourceCollector.d.cts.map +0 -1
  780. package/dist/services/resourceCollector.d.mts.map +0 -1
  781. package/dist/services/resourceCollector.mjs.map +0 -1
  782. package/dist/services/skillCatalog.cjs.map +0 -1
  783. package/dist/services/skillCatalog.mjs.map +0 -1
  784. package/dist/services/syncState.cjs.map +0 -1
  785. package/dist/services/syncState.d.cts.map +0 -1
  786. package/dist/services/syncState.d.mts.map +0 -1
  787. package/dist/services/syncState.mjs.map +0 -1
  788. package/dist/utils/json.cjs.map +0 -1
  789. package/dist/utils/json.d.cts.map +0 -1
  790. package/dist/utils/json.d.mts.map +0 -1
  791. package/dist/utils/json.mjs.map +0 -1
  792. package/dist/utils/moduleResolution.cjs.map +0 -1
  793. package/dist/utils/moduleResolution.d.cts.map +0 -1
  794. package/dist/utils/moduleResolution.d.mts.map +0 -1
  795. package/dist/utils/moduleResolution.mjs.map +0 -1
  796. package/dist/utils/repository.cjs.map +0 -1
  797. package/dist/utils/repository.d.cts.map +0 -1
  798. package/dist/utils/repository.d.mts.map +0 -1
  799. package/dist/utils/repository.mjs.map +0 -1
  800. package/dist/utils/toolNames.cjs.map +0 -1
  801. package/dist/utils/toolNames.d.cts.map +0 -1
  802. package/dist/utils/toolNames.d.mts.map +0 -1
  803. package/dist/utils/toolNames.mjs.map +0 -1
package/README.md CHANGED
@@ -102,6 +102,7 @@ result where Pi looks, then run `pi` yourself.
102
102
 
103
103
  ```bash
104
104
  doompi init # seed ~/.pi/.doom, once per machine
105
+ doompi build # warm the selected launch bundle and skill cache
105
106
  doompi sync # resolve the selection into .pi/
106
107
  pi # the agent
107
108
 
@@ -109,7 +110,7 @@ doompi sync --check # exit non-zero when the synced config is out of date
109
110
  ```
110
111
 
111
112
  A synced session takes `--major-mode`, `--domains`, `--profile`, and `--mute` the same way
112
- the launcher does, and `/major-mode`, `/domains`, and `/profile` all switch in place: the
113
+ the launcher does, and `/mode`, `/domains`, and `/profile` all switch in place: the
113
114
  extension set is composed on every load rather than frozen at startup, so a reload is
114
115
  enough.
115
116
 
@@ -117,6 +118,14 @@ Both paths compose the extension set from the same function, `assembleExtensions
117
118
  owns load order. Two things differ. A synced session forces `--auto-stop` off, and it
118
119
  reads mute from `DOOMPI_MUTE` instead of an argument.
119
120
 
121
+ `doompi build` is the launcher warm-up step, analogous to `doom build`: it resolves the
122
+ selected matrix, compiles its exact extension graph into one `.pi/doom/dist` ESM file,
123
+ and warms the persistent skill manifest without starting Pi or changing
124
+ `.pi/settings.json`. A sidecar manifest retains every original extension and exact
125
+ `SKILL.md` path, so resource discovery never depends on the bundle's location.
126
+ Launch still builds on a cache miss, so the command is optional; run it after installing
127
+ or upgrading Doom packages when first-input latency matters.
128
+
120
129
  Syncing does not disturb the launcher. Pi merges the extensions a project declares with
121
130
  the ones passed on the command line, so the synced entry stands down whenever it sees the
122
131
  composed set already there, which is what the launcher and every detached subagent pass.
@@ -165,6 +174,7 @@ extension is loaded:
165
174
  | `SPC e f` | `@agimon-ai/doompi-file-edit` | session edits |
166
175
  | `SPC e s` | `@agimon-ai/doompi` | skills catalog |
167
176
  | `SPC e c` | `@agimon-ai/doompi-ui` | config panel (core binding) |
177
+ | `SPC g s/e/p` | `@agimon-ai/doompi-goal` | start/end/history |
168
178
 
169
179
  Contributions go through the public `@agimon-ai/doompi-ui/leader` API:
170
180
 
@@ -228,7 +238,18 @@ layer wants it.
228
238
  **A major mode is the one you actually pick.** You do not assemble layers one by one at the
229
239
  prompt. You select one named major mode with `--major-mode <name>`, and
230
240
  `.doom/modes.yaml` says which layers it contains. A session has exactly one, the way
231
- an Emacs buffer has exactly one major mode.
241
+ an Emacs buffer has exactly one major mode. The file can choose the fallback without
242
+ renaming that mode:
243
+
244
+ ```yaml
245
+ defaultMajorMode: minimal
246
+ majorMode:
247
+ minimal: [guardrails, team]
248
+ copilot: [guardrails, team, plan-mode, runner]
249
+ ```
250
+
251
+ An explicit `--major-mode` wins, then `DOOMPI_MAJOR_MODE`, then
252
+ `defaultMajorMode`. Omitting the field preserves the compatible `copilot` fallback.
232
253
 
233
254
  The flag is `--major-mode` and not `--mode` because Pi already owns `--mode` for its output
234
255
  mode (`text`, `json`, `rpc`), and for any other value it consumes the argument and ignores
@@ -238,7 +259,19 @@ it without a diagnostic. Use `--output-format` for Pi's output mode.
238
259
  plugins contribute their skills and subagents, which MCP servers the session can reach,
239
260
  and whether the always-on shared skills apply. A domain can take a whole plugin or a named
240
261
  subset of one. This is the choice that decides how much the agent can see, so it is also
241
- the lever for keeping context small.
262
+ the lever for keeping context small. Defaults are plural because domains compose:
263
+
264
+ ```yaml
265
+ defaultDomains: [development, qa]
266
+ domains:
267
+ development:
268
+ plugins: [plugins/development]
269
+ qa:
270
+ plugins: [plugins/qa]
271
+ ```
272
+
273
+ Explicit `--domain` or `--domains` flags win, then `DOOMPI_DOMAINS`, then
274
+ `defaultDomains`.
242
275
 
243
276
  **Profiles are a persona and a brand.** `.doom/profiles.yaml` points at a directory under
244
277
  `agents/<brand>/<person>/`, and doom concatenates that person's `profile.md`, `SOUL.md`,
@@ -247,7 +280,7 @@ then role and rules. A profile also carries environment defaults, and nothing el
247
280
  cannot select domains, major modes, models, presets, or policy, and an exported value
248
281
  always beats a profile default.
249
282
 
250
- Switching is live. `/major-mode`, `/domains`, and `/profile` re-resolve into the running
283
+ Switching is live. `/mode`, `/domains`, and `/profile` re-resolve into the running
251
284
  session and reload. A domain or profile switch always applies in place. A major mode switch
252
285
  applies in place too unless the new mode changes which extension packages load, since Pi
253
286
  freezes the `--extension` set at construction; the picker tells you when a relaunch is
@@ -261,13 +294,28 @@ which extensions are loaded.
261
294
 
262
295
  | Minor mode | Toggle | Owned by |
263
296
  | ---------- | -------------------- | ---------------------------- |
297
+ | goal | `/goal`, `SPC g` | `@agimon-ai/doompi-goal` |
264
298
  | plan | `/plan`, `SPC p` | `@agimon-ai/doompi-plan` |
265
299
  | loop | `/loop`, `SPC l` | `@agimon-ai/doompi-loop` |
266
300
  | workflow | `/workflow`, `SPC w` | `@agimon-ai/doompi-workflow` |
267
301
 
268
- Each one publishes a label to a shared `MODES` line rather than painting a row of its own,
269
- so three enabled modes cost one line rather than three. The registry is
270
- `@agimon-ai/doompi-extension-contracts/mode`.
302
+ Goal is assembled in `minimal`, `copilot`, custom major modes, and detached children rather
303
+ than selected by a layer. It starts dormant: `/goal` is available, but its tools, system
304
+ prompt, automatic continuation, and `GOAL` status stay off until an objective is accepted
305
+ or an active Goal is restored. Paused, blocked, limited, and queue-waiting Goals retain the
306
+ status item without retaining execution capabilities. Parent hosts load the Doom entry;
307
+ detached children load the UI-independent Pi entry.
308
+
309
+ Each enabled minor mode publishes a label to a shared `MODES` line rather than painting a
310
+ row of its own. The registry is `@agimon-ai/doompi-extension-contracts/mode`.
311
+
312
+ Existing `pi-goal.json` files remain readable. Both legacy `toolVisibility` values now mean
313
+ that Goal tools are managed only while execution is operational; neither exposes tools in
314
+ a dormant session. `experimental.goals` controls queues only.
315
+
316
+ If an edited `modes.yaml` still defines or selects a Goal layer, remove that definition and
317
+ its major-mode references, then run `doompi sync`. Normal `doompi init` preserves edited
318
+ files. `doompi init --force` is a full template reset and may overwrite unrelated edits.
271
319
 
272
320
  ## For autonomous agents
273
321
 
@@ -379,10 +427,10 @@ is doing what.
379
427
 
380
428
  ## Core is not a layer
381
429
 
382
- Telemetry, workflow orchestration, the dispatch loop, and editor plumbing ship
383
- unconditionally and are absent from `modes.yaml` on purpose. They are the reason the
384
- harness exists, so making them optional would only create broken configurations. Layers
385
- are for opinions, not foundations.
430
+ Telemetry, workflow orchestration, Goal's dormant runtime, the dispatch loop, and editor
431
+ plumbing ship unconditionally and are absent from `modes.yaml` on purpose. They are the
432
+ reason the harness exists, so making them optional would only create broken configurations.
433
+ Layers are for opinions, not foundations.
386
434
 
387
435
  ## Who owns what
388
436
 
@@ -413,8 +461,11 @@ Under the launcher, everything is resolved per run and nothing is written back i
413
461
  repository. Editing a YAML file is the entire change.
414
462
 
415
463
  `doompi sync` trades that for a pinned setup: the same resolution runs once and lands in
416
- `.pi/doom/`, and a Pi session reads it instead of recomputing it. Edit a YAML file and the
417
- next session says the config changed, the way doom emacs asks you to re-run `doom sync`.
464
+ `.pi/doom/`, while `.pi/settings.json` keeps the stable `@agimon-ai/doompi` extension name.
465
+ An internal `.pi/@agimon-ai/doompi` package alias lets Pi resolve that stable name; the
466
+ package entry then locates and dynamically loads the generated bootstrap from synced state.
467
+ Edit a YAML file and the next session says the config changed, the way doom emacs asks you
468
+ to re-run `doom sync`.
418
469
 
419
470
  `doompi init` seeds `~/.pi/.doom` with all five file names, but only `config.yaml` from
420
471
  there is read at runtime. Major modes, domains, profiles, and hooks are always read from the
@@ -510,9 +561,10 @@ exactly one name, reject a comma, and can be given only once. The removed `--lay
510
561
  does the removed `DOOMPI_LAYER` variable: a stale export is worth an error rather than a
511
562
  session quietly starting on the default.
512
563
 
513
- Defaults when you name nothing: major mode `copilot`, domains `default`. The `marketing`
514
- major mode is the one exception and defaults to the `marketing` domain. That is the only
515
- place where one choice influences another.
564
+ Defaults when you name nothing: `defaultMajorMode` from `.doom/modes.yaml` and the
565
+ `defaultDomains` list from `.doom/domains.yaml`. Omitting those fields preserves the
566
+ compatible fallbacks: major mode `copilot`, plus domain `marketing` for the legacy
567
+ `marketing` mode or `default` for every other mode.
516
568
 
517
569
  Environment equivalents are `DOOMPI_MAJOR_MODE`, `DOOMPI_DOMAINS`, and `DOOMPI_PROFILE`.
518
570
  `DOOMPI_PRESET` and `DOOMPI_ADDITIONAL_DIRS` work the same way for `--preset` and
@@ -530,8 +582,10 @@ export in a shell profile is worth an error.
530
582
  `DOOMPI_LAYERS`, plural, is a different variable from `DOOMPI_LAYER`. It carries the
531
583
  resolved layer components rather than the mode that selected them.
532
584
 
533
- A repository can declare what it selects by default, which is what a bare `doompi sync`
534
- pins. A flag still wins, then an exported variable, then this:
585
+ A repository can also pin the full selection used by a bare `doompi sync` or
586
+ `doompi build`. A flag still wins, then an exported variable, then the matching
587
+ `selection` field, then `modes.yaml`'s `defaultMajorMode` or `domains.yaml`'s
588
+ `defaultDomains`:
535
589
 
536
590
  ```yaml
537
591
  # .doom/config.yaml
@@ -0,0 +1,2 @@
1
+ const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`./repository/repository.cjs`);require(`./syncStateContract.cjs`);let n=require(`node:fs`);n=e.__toESM(n,1);let r=require(`node:path`);r=e.__toESM(r,1);const i=r.default.join(`.pi`,`doom`,`state.json`);function a(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function o(e){return r.default.join(e,i)}function s(e){if(n.default.existsSync(o(e)))return e;try{let r=t.findRepositoryRoot(e);return n.default.existsSync(o(r))?r:void 0}catch{return}}function c(e){let t=o(e);if(!n.default.existsSync(t))return;let r;try{r=JSON.parse(n.default.readFileSync(t,`utf8`))}catch(e){throw Error(`Doom sync state at ${t} is not valid JSON`,{cause:e})}if(!a(r))throw Error(`Doom sync state at ${t} must be an object`);if(r.version!==6)throw Error(`Doom sync state at ${t} has version ${String(r.version)}, expected 6. Run doompi sync.`);if(typeof r.root!=`string`||typeof r.inputsHash!=`string`)throw Error(`Doom sync state at ${t} requires string root and inputsHash`);if(!a(r.selection)||typeof r.selection.majorMode!=`string`)throw Error(`Doom sync state at ${t} requires a selection with a majorMode`);if(!a(r.baseline)||typeof r.baseline.themePath!=`string`)throw Error(`Doom sync state at ${t} requires a baseline with a themePath`);if(!a(r.env))throw Error(`Doom sync state at ${t} requires env to be an object`);if(!a(r.resolved))throw Error(`Doom sync state at ${t} requires resolved to be an object`);if(r.compiled!==void 0&&!a(r.compiled))throw Error(`Doom sync state at ${t} requires compiled to be an object`);if(r.bundles!==void 0&&!a(r.bundles))throw Error(`Doom sync state at ${t} requires bundles to be an object`);return typeof r.bootstrap==`string`?r.bootstrap:void 0}exports.findSyncedRoot=s,exports.readBootstrapPointer=c;
2
+ //# sourceMappingURL=bootstrapLocator.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrapLocator.cjs","names":["path","fs","findRepositoryRoot"],"sources":["../../src/adapters/bootstrapLocator.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { findRepositoryRoot } from './repository/repository.ts';\nimport { SYNC_STATE_VERSION } from './syncStateContract.ts';\n\nconst STATE_PATH = path.join('.pi', 'doom', 'state.json');\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nexport function bootstrapStatePath(repoRoot: string): string {\n return path.join(repoRoot, STATE_PATH);\n}\n\n/** Finds the nearest configured repository with generated Doom sync state. */\nexport function findSyncedRoot(cwd: string): string | undefined {\n if (fs.existsSync(bootstrapStatePath(cwd))) return cwd;\n try {\n const root = findRepositoryRoot(cwd);\n return fs.existsSync(bootstrapStatePath(root)) ? root : undefined;\n } catch {\n return undefined;\n }\n}\n\n/** Reads only the generated bootstrap pointer while retaining state validation. */\nexport function readBootstrapPointer(repoRoot: string): string | undefined {\n const statePath = bootstrapStatePath(repoRoot);\n if (!fs.existsSync(statePath)) return undefined;\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(fs.readFileSync(statePath, 'utf8'));\n } catch (error) {\n throw new Error(`Doom sync state at ${statePath} is not valid JSON`, { cause: error });\n }\n if (!isRecord(parsed)) throw new Error(`Doom sync state at ${statePath} must be an object`);\n if (parsed.version !== SYNC_STATE_VERSION) {\n throw new Error(\n `Doom sync state at ${statePath} has version ${String(parsed.version)}, expected ${SYNC_STATE_VERSION}. Run doompi sync.`,\n );\n }\n if (typeof parsed.root !== 'string' || typeof parsed.inputsHash !== 'string') {\n throw new Error(`Doom sync state at ${statePath} requires string root and inputsHash`);\n }\n if (!isRecord(parsed.selection) || typeof parsed.selection.majorMode !== 'string') {\n throw new Error(`Doom sync state at ${statePath} requires a selection with a majorMode`);\n }\n if (!isRecord(parsed.baseline) || typeof parsed.baseline.themePath !== 'string') {\n throw new Error(`Doom sync state at ${statePath} requires a baseline with a themePath`);\n }\n if (!isRecord(parsed.env)) throw new Error(`Doom sync state at ${statePath} requires env to be an object`);\n if (!isRecord(parsed.resolved)) throw new Error(`Doom sync state at ${statePath} requires resolved to be an object`);\n if (parsed.compiled !== undefined && !isRecord(parsed.compiled)) {\n throw new Error(`Doom sync state at ${statePath} requires compiled to be an object`);\n }\n if (parsed.bundles !== undefined && !isRecord(parsed.bundles)) {\n throw new Error(`Doom sync state at ${statePath} requires bundles to be an object`);\n }\n return typeof parsed.bootstrap === 'string' ? parsed.bootstrap : undefined;\n}\n"],"mappings":"uNAKA,MAAM,EAAaA,EAAAA,QAAK,KAAK,MAAO,OAAQ,aAAa,CAEzD,SAAS,EAAS,EAAkD,CAClE,OAAO,OAAO,GAAU,YAAY,GAAkB,CAAC,MAAM,QAAQ,EAAM,CAG7E,SAAgB,EAAmB,EAA0B,CAC3D,OAAOA,EAAAA,QAAK,KAAK,EAAU,EAAW,CAIxC,SAAgB,EAAe,EAAiC,CAC9D,GAAIC,EAAAA,QAAG,WAAW,EAAmB,EAAI,CAAC,CAAE,OAAO,EACnD,GAAI,CACF,IAAM,EAAOC,EAAAA,mBAAmB,EAAI,CACpC,OAAOD,EAAAA,QAAG,WAAW,EAAmB,EAAK,CAAC,CAAG,EAAO,IAAA,QAClD,CACN,QAKJ,SAAgB,EAAqB,EAAsC,CACzE,IAAM,EAAY,EAAmB,EAAS,CAC9C,GAAI,CAACA,EAAAA,QAAG,WAAW,EAAU,CAAE,OAE/B,IAAI,EACJ,GAAI,CACF,EAAS,KAAK,MAAMA,EAAAA,QAAG,aAAa,EAAW,OAAO,CAAC,OAChD,EAAO,CACd,MAAU,MAAM,sBAAsB,EAAU,oBAAqB,CAAE,MAAO,EAAO,CAAC,CAExF,GAAI,CAAC,EAAS,EAAO,CAAE,MAAU,MAAM,sBAAsB,EAAU,oBAAoB,CAC3F,GAAI,EAAO,UAAA,EACT,MAAU,MACR,sBAAsB,EAAU,eAAe,OAAO,EAAO,QAAQ,CAAC,gCACvE,CAEH,GAAI,OAAO,EAAO,MAAS,UAAY,OAAO,EAAO,YAAe,SAClE,MAAU,MAAM,sBAAsB,EAAU,sCAAsC,CAExF,GAAI,CAAC,EAAS,EAAO,UAAU,EAAI,OAAO,EAAO,UAAU,WAAc,SACvE,MAAU,MAAM,sBAAsB,EAAU,wCAAwC,CAE1F,GAAI,CAAC,EAAS,EAAO,SAAS,EAAI,OAAO,EAAO,SAAS,WAAc,SACrE,MAAU,MAAM,sBAAsB,EAAU,uCAAuC,CAEzF,GAAI,CAAC,EAAS,EAAO,IAAI,CAAE,MAAU,MAAM,sBAAsB,EAAU,+BAA+B,CAC1G,GAAI,CAAC,EAAS,EAAO,SAAS,CAAE,MAAU,MAAM,sBAAsB,EAAU,oCAAoC,CACpH,GAAI,EAAO,WAAa,IAAA,IAAa,CAAC,EAAS,EAAO,SAAS,CAC7D,MAAU,MAAM,sBAAsB,EAAU,oCAAoC,CAEtF,GAAI,EAAO,UAAY,IAAA,IAAa,CAAC,EAAS,EAAO,QAAQ,CAC3D,MAAU,MAAM,sBAAsB,EAAU,mCAAmC,CAErF,OAAO,OAAO,EAAO,WAAc,SAAW,EAAO,UAAY,IAAA"}
@@ -0,0 +1,6 @@
1
+ //#region src/adapters/bootstrapLocator.d.ts
2
+ /** Finds the nearest configured repository with generated Doom sync state. */
3
+ declare function findSyncedRoot(cwd: string): string | undefined;
4
+ //#endregion
5
+ export { findSyncedRoot };
6
+ //# sourceMappingURL=bootstrapLocator.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrapLocator.d.cts","names":[],"sources":["../../src/adapters/bootstrapLocator.ts"],"mappings":";AAgBA;AAAA,iBAAgB,cAAA,CAAe,GAAA"}
@@ -0,0 +1,6 @@
1
+ //#region src/adapters/bootstrapLocator.d.ts
2
+ /** Finds the nearest configured repository with generated Doom sync state. */
3
+ declare function findSyncedRoot(cwd: string): string | undefined;
4
+ //#endregion
5
+ export { findSyncedRoot };
6
+ //# sourceMappingURL=bootstrapLocator.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrapLocator.d.mts","names":[],"sources":["../../src/adapters/bootstrapLocator.ts"],"mappings":";AAgBA;AAAA,iBAAgB,cAAA,CAAe,GAAA"}
@@ -0,0 +1,2 @@
1
+ import{findRepositoryRoot as e}from"./repository/repository.mjs";import"./syncStateContract.mjs";import t from"node:fs";import n from"node:path";const r=n.join(`.pi`,`doom`,`state.json`);function i(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function a(e){return n.join(e,r)}function o(n){if(t.existsSync(a(n)))return n;try{let r=e(n);return t.existsSync(a(r))?r:void 0}catch{return}}function s(e){let n=a(e);if(!t.existsSync(n))return;let r;try{r=JSON.parse(t.readFileSync(n,`utf8`))}catch(e){throw Error(`Doom sync state at ${n} is not valid JSON`,{cause:e})}if(!i(r))throw Error(`Doom sync state at ${n} must be an object`);if(r.version!==6)throw Error(`Doom sync state at ${n} has version ${String(r.version)}, expected 6. Run doompi sync.`);if(typeof r.root!=`string`||typeof r.inputsHash!=`string`)throw Error(`Doom sync state at ${n} requires string root and inputsHash`);if(!i(r.selection)||typeof r.selection.majorMode!=`string`)throw Error(`Doom sync state at ${n} requires a selection with a majorMode`);if(!i(r.baseline)||typeof r.baseline.themePath!=`string`)throw Error(`Doom sync state at ${n} requires a baseline with a themePath`);if(!i(r.env))throw Error(`Doom sync state at ${n} requires env to be an object`);if(!i(r.resolved))throw Error(`Doom sync state at ${n} requires resolved to be an object`);if(r.compiled!==void 0&&!i(r.compiled))throw Error(`Doom sync state at ${n} requires compiled to be an object`);if(r.bundles!==void 0&&!i(r.bundles))throw Error(`Doom sync state at ${n} requires bundles to be an object`);return typeof r.bootstrap==`string`?r.bootstrap:void 0}export{o as findSyncedRoot,s as readBootstrapPointer};
2
+ //# sourceMappingURL=bootstrapLocator.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrapLocator.mjs","names":[],"sources":["../../src/adapters/bootstrapLocator.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { findRepositoryRoot } from './repository/repository.ts';\nimport { SYNC_STATE_VERSION } from './syncStateContract.ts';\n\nconst STATE_PATH = path.join('.pi', 'doom', 'state.json');\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nexport function bootstrapStatePath(repoRoot: string): string {\n return path.join(repoRoot, STATE_PATH);\n}\n\n/** Finds the nearest configured repository with generated Doom sync state. */\nexport function findSyncedRoot(cwd: string): string | undefined {\n if (fs.existsSync(bootstrapStatePath(cwd))) return cwd;\n try {\n const root = findRepositoryRoot(cwd);\n return fs.existsSync(bootstrapStatePath(root)) ? root : undefined;\n } catch {\n return undefined;\n }\n}\n\n/** Reads only the generated bootstrap pointer while retaining state validation. */\nexport function readBootstrapPointer(repoRoot: string): string | undefined {\n const statePath = bootstrapStatePath(repoRoot);\n if (!fs.existsSync(statePath)) return undefined;\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(fs.readFileSync(statePath, 'utf8'));\n } catch (error) {\n throw new Error(`Doom sync state at ${statePath} is not valid JSON`, { cause: error });\n }\n if (!isRecord(parsed)) throw new Error(`Doom sync state at ${statePath} must be an object`);\n if (parsed.version !== SYNC_STATE_VERSION) {\n throw new Error(\n `Doom sync state at ${statePath} has version ${String(parsed.version)}, expected ${SYNC_STATE_VERSION}. Run doompi sync.`,\n );\n }\n if (typeof parsed.root !== 'string' || typeof parsed.inputsHash !== 'string') {\n throw new Error(`Doom sync state at ${statePath} requires string root and inputsHash`);\n }\n if (!isRecord(parsed.selection) || typeof parsed.selection.majorMode !== 'string') {\n throw new Error(`Doom sync state at ${statePath} requires a selection with a majorMode`);\n }\n if (!isRecord(parsed.baseline) || typeof parsed.baseline.themePath !== 'string') {\n throw new Error(`Doom sync state at ${statePath} requires a baseline with a themePath`);\n }\n if (!isRecord(parsed.env)) throw new Error(`Doom sync state at ${statePath} requires env to be an object`);\n if (!isRecord(parsed.resolved)) throw new Error(`Doom sync state at ${statePath} requires resolved to be an object`);\n if (parsed.compiled !== undefined && !isRecord(parsed.compiled)) {\n throw new Error(`Doom sync state at ${statePath} requires compiled to be an object`);\n }\n if (parsed.bundles !== undefined && !isRecord(parsed.bundles)) {\n throw new Error(`Doom sync state at ${statePath} requires bundles to be an object`);\n }\n return typeof parsed.bootstrap === 'string' ? parsed.bootstrap : undefined;\n}\n"],"mappings":"iJAKA,MAAM,EAAa,EAAK,KAAK,MAAO,OAAQ,aAAa,CAEzD,SAAS,EAAS,EAAkD,CAClE,OAAO,OAAO,GAAU,YAAY,GAAkB,CAAC,MAAM,QAAQ,EAAM,CAG7E,SAAgB,EAAmB,EAA0B,CAC3D,OAAO,EAAK,KAAK,EAAU,EAAW,CAIxC,SAAgB,EAAe,EAAiC,CAC9D,GAAI,EAAG,WAAW,EAAmB,EAAI,CAAC,CAAE,OAAO,EACnD,GAAI,CACF,IAAM,EAAO,EAAmB,EAAI,CACpC,OAAO,EAAG,WAAW,EAAmB,EAAK,CAAC,CAAG,EAAO,IAAA,QAClD,CACN,QAKJ,SAAgB,EAAqB,EAAsC,CACzE,IAAM,EAAY,EAAmB,EAAS,CAC9C,GAAI,CAAC,EAAG,WAAW,EAAU,CAAE,OAE/B,IAAI,EACJ,GAAI,CACF,EAAS,KAAK,MAAM,EAAG,aAAa,EAAW,OAAO,CAAC,OAChD,EAAO,CACd,MAAU,MAAM,sBAAsB,EAAU,oBAAqB,CAAE,MAAO,EAAO,CAAC,CAExF,GAAI,CAAC,EAAS,EAAO,CAAE,MAAU,MAAM,sBAAsB,EAAU,oBAAoB,CAC3F,GAAI,EAAO,UAAA,EACT,MAAU,MACR,sBAAsB,EAAU,eAAe,OAAO,EAAO,QAAQ,CAAC,gCACvE,CAEH,GAAI,OAAO,EAAO,MAAS,UAAY,OAAO,EAAO,YAAe,SAClE,MAAU,MAAM,sBAAsB,EAAU,sCAAsC,CAExF,GAAI,CAAC,EAAS,EAAO,UAAU,EAAI,OAAO,EAAO,UAAU,WAAc,SACvE,MAAU,MAAM,sBAAsB,EAAU,wCAAwC,CAE1F,GAAI,CAAC,EAAS,EAAO,SAAS,EAAI,OAAO,EAAO,SAAS,WAAc,SACrE,MAAU,MAAM,sBAAsB,EAAU,uCAAuC,CAEzF,GAAI,CAAC,EAAS,EAAO,IAAI,CAAE,MAAU,MAAM,sBAAsB,EAAU,+BAA+B,CAC1G,GAAI,CAAC,EAAS,EAAO,SAAS,CAAE,MAAU,MAAM,sBAAsB,EAAU,oCAAoC,CACpH,GAAI,EAAO,WAAa,IAAA,IAAa,CAAC,EAAS,EAAO,SAAS,CAC7D,MAAU,MAAM,sBAAsB,EAAU,oCAAoC,CAEtF,GAAI,EAAO,UAAY,IAAA,IAAa,CAAC,EAAS,EAAO,QAAQ,CAC3D,MAAU,MAAM,sBAAsB,EAAU,mCAAmC,CAErF,OAAO,OAAO,EAAO,WAAc,SAAW,EAAO,UAAY,IAAA"}
@@ -0,0 +1,2 @@
1
+ const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../serialization/json.cjs`);require(`../../utils/index.cjs`);const n=require(`./process.cjs`),r=require(`./shared.cjs`);let i=require(`node:fs`);i=e.__toESM(i,1);let a=require(`node:path`);a=e.__toESM(a,1);const o=`.doom-pi-managed.json`,s=`mcp-proxy`,c=`project-mcp`,l=`pencil`,u=`.agents`,d=`_agents`,f=`mcp_config.json`,p=`hooks.json`,m=`plugins`,h=`.gemini`,g=`antigravity-cli`;function _(e,t){if(typeof e.command==`string`){let n={...e,command:e.command,args:Array.isArray(e.args)?e.args.map(String):[],cwd:typeof e.cwd==`string`?e.cwd:t};return delete n.type,n}let n=typeof e.url==`string`?e.url:void 0;if(!n)return;let r={...e,serverUrl:n};return delete r.type,delete r.url,r}function v(e){let n=e.options.repoRoot,d=a.default.join(n,u,f),p=a.default.join(n,u,o),m=t.readJson(d),g=m[r.MCP_SERVERS_KEY],v=t.isRecord(g)?{...g}:{},y=t.readJson(p),b=y[r.MCP_SERVERS_KEY],x=Array.isArray(b)?b.map(String):[];for(let e of new Set([...x,s,c,l]))delete v[e];let S=t.readJson(e.mcpConfigPath)[r.MCP_SERVERS_KEY],C=t.isRecord(S)?S:{},w=e.mcpAllowlist?.servers,T=e=>!w||w.length===0||w.includes(e),E=[];T(`agiflow-proxy`)&&(v[s]={command:`npx`,args:r.mcpProxyArguments(r.ANTIGRAVITY_MCP_PROXY_PACKAGE,e.proxyConfigPath,!0),cwd:n,timeout:12e5},E.push(s));let D=e.mcpAllowlist?w??[]:[c,l];for(let e of D){if(e===`agiflow-proxy`)continue;let r=C[e];if(!t.isRecord(r))continue;let i=_(r,n);i&&(v[e]=i,E.push(e))}t.writeJson(d,{...m,[r.MCP_SERVERS_KEY]:v}),t.writeJson(p,{...y,[r.MCP_SERVERS_KEY]:E});let O=e.environment.HOME;if(O)for(let e of[a.default.join(O,h,`config`,f),a.default.join(O,h,`config`,r.PLUGINS_DIRECTORY,`shared`,f)]){if(!i.default.existsSync(e))continue;let n=t.readJson(e),a=n[r.MCP_SERVERS_KEY],o=t.isRecord(a)?{...a}:{};for(let e of[s,r.AGIFLOW_PROXY_SERVER_NAME,c,l])delete o[e];t.writeJson(e,{...n,[r.MCP_SERVERS_KEY]:o})}}function y(e){return a.default.join(e,h,g,`settings.json`)}function b(e){let n=e.environment.HOME;if(!n)throw Error(`HOME is required for Antigravity compatibility`);let r=y(n),i=t.readJson(r);i.model||=e.environment.AGY_MODEL??`Gemini 3.5 Flash`;let a=Array.isArray(i.trustedWorkspaces)?i.trustedWorkspaces.map(String):[];a.includes(e.options.repoRoot)||a.push(e.options.repoRoot),i.trustedWorkspaces=a,t.writeJson(r,i)}function x(e){let t=i.default.lstatSync(e,{throwIfNoEntry:!1});if(t&&!t.isDirectory())throw Error(`Refusing to use unmanaged Antigravity path: ${e}`);t||i.default.mkdirSync(e,{recursive:!0})}function S(e,t){if(i.default.existsSync(e)||i.default.lstatSync(e,{throwIfNoEntry:!1})){if(!i.default.lstatSync(e).isSymbolicLink())throw Error(`Refusing to replace unmanaged Antigravity path: ${e}`);i.default.rmSync(e,{force:!0})}i.default.symlinkSync(t,e,`dir`)}function C(e){let s=e.options.repoRoot,c=a.default.join(s,r.PLUGINS_DIRECTORY),l=a.default.join(s,d),f=a.default.join(l,r.PLUGINS_DIRECTORY),p=a.default.join(s,u,o),h=t.readJson(p),g=h[m],_=new Set(Array.isArray(g)?g.map(String):[]);x(l),x(f);let v=new Set;for(let n of e.plugins){let e=a.default.join(n.directory,`.codex-plugin`,r.PLUGIN_MANIFEST_FILENAME);if(!i.default.existsSync(e))continue;let o=t.readJson(e),s=typeof o.name==`string`&&o.name?o.name:a.default.basename(n.directory);if(s===`.`||s===`..`||s.toLowerCase()===`core`||s.includes(`/`)||s.includes(`\\`))throw Error(`Invalid Antigravity plugin name: ${s}`);let c=a.default.join(f,s);v.add(s),x(c),t.writeJson(a.default.join(c,r.PLUGIN_MANIFEST_FILENAME),{name:s});let l=a.default.join(n.directory,r.SKILLS_DIRECTORY),u=a.default.join(c,r.SKILLS_DIRECTORY);i.default.existsSync(l)?S(u,l):i.default.lstatSync(u,{throwIfNoEntry:!1})?.isSymbolicLink()&&i.default.rmSync(u,{force:!0})}for(let e of i.default.readdirSync(f,{withFileTypes:!0})){if(e.name===`core`||v.has(e.name))continue;let t=a.default.join(f,e.name);if(_.has(e.name)){i.default.rmSync(t,{recursive:!0,force:!0});continue}if(!e.isDirectory())continue;let o=a.default.join(t,r.SKILLS_DIRECTORY);i.default.lstatSync(o,{throwIfNoEntry:!1})?.isSymbolicLink()&&n.pathInside(c,a.default.resolve(a.default.dirname(o),i.default.readlinkSync(o)))&&i.default.rmSync(t,{recursive:!0,force:!0})}t.writeJson(p,{...h,[m]:[...v]})}function w(e){t.readJson(a.default.join(e,`plugin.json`)).name===`core`&&i.default.rmSync(e,{recursive:!0,force:!0})}function T(e){let n=a.default.join(e.options.repoRoot,d,r.PLUGINS_DIRECTORY,r.CORE_PLUGIN_NAME);if(i.default.lstatSync(n,{throwIfNoEntry:!1})?.isSymbolicLink())throw Error(`Refusing to use unmanaged Antigravity path: ${n}`);if(!e.sharedSkills){w(n);return}let o=a.default.join(e.options.repoRoot,`.claude`,r.SKILLS_DIRECTORY);if(!i.default.existsSync(o)){w(n);return}x(n);let s=a.default.join(n,r.SKILLS_DIRECTORY);x(s),t.writeJson(a.default.join(n,r.PLUGIN_MANIFEST_FILENAME),{name:r.CORE_PLUGIN_NAME});let c=new Set;for(let e of i.default.readdirSync(o,{withFileTypes:!0}))e.isDirectory()&&(c.add(e.name),S(a.default.join(s,e.name),a.default.join(o,e.name)));for(let e of i.default.readdirSync(s)){if(c.has(e))continue;let t=a.default.join(s,e);i.default.lstatSync(t).isSymbolicLink()&&i.default.rmSync(t,{force:!0})}}function E(e){let n=a.default.join(e.options.repoRoot,`.antigravity-local`,p),r=a.default.join(e.options.repoRoot,u,p),s=a.default.join(e.options.repoRoot,u,o),c=t.readJson(s);if(!i.default.existsSync(n)){c.hooks===!0&&i.default.rmSync(r,{force:!0}),t.writeJson(s,{...c,hooks:!1});return}let l=i.default.readFileSync(n,`utf8`).replaceAll(`$AGY_REPO_ROOT`,e.options.repoRoot),d=i.default.lstatSync(r,{throwIfNoEntry:!1});if(d&&c.hooks!==!0&&(!d.isFile()||i.default.readFileSync(r,`utf8`)!==l))throw Error(`Refusing to replace unmanaged Antigravity path: ${r}`);t.writeFileAtomic(r,l),t.writeJson(s,{...c,hooks:!0})}function D(e){return[r.SKIP_PERMISSIONS_OPTION,...r.additionalDirectoryArgs(e),...e.options.providerArgs]}async function O(e){let t=e.environment.HOME;if(!t)throw Error(`HOME is required for Antigravity compatibility`);let r=await n.acquireDirectoryLock(a.default.join(t,h,g,`.doom-pi-sync.lock`));try{v(e),b(e),C(e),T(e),E(e)}finally{await r()}return n.runInteractive(`agy`,D(e),e.options.repoRoot,e.environment)}exports.adaptAntigravityMcpDefinition=_,exports.antigravityCompatibilityArgs=D,exports.launchAntigravity=O;
2
+ //# sourceMappingURL=antigravity.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity.cjs","names":["path","readJson","MCP_SERVERS_KEY","isRecord","mcpProxyArguments","ANTIGRAVITY_MCP_PROXY_PACKAGE","PLUGINS_DIRECTORY","fs","AGIFLOW_PROXY_SERVER_NAME","PLUGIN_MANIFEST_FILENAME","SKILLS_DIRECTORY","pathInside","CORE_PLUGIN_NAME","SKIP_PERMISSIONS_OPTION","additionalDirectoryArgs","acquireDirectoryLock","runInteractive"],"sources":["../../../src/services/compatibility/antigravity.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { type JsonObject, isRecord, readJson, writeFileAtomic, writeJson } from '../../utils/index.ts';\nimport type { CompatibilityContext } from '../compatibilityContext.ts';\nimport { acquireDirectoryLock, pathInside, runInteractive } from './process.ts';\nimport {\n AGIFLOW_PROXY_SERVER_NAME,\n ANTIGRAVITY_MCP_PROXY_PACKAGE,\n CORE_PLUGIN_NAME,\n MCP_SERVERS_KEY,\n NPX_COMMAND,\n PLUGIN_MANIFEST_FILENAME,\n PLUGINS_DIRECTORY,\n SKILLS_DIRECTORY,\n SKIP_PERMISSIONS_OPTION,\n additionalDirectoryArgs,\n mcpProxyArguments,\n} from './shared.ts';\n\n/**\n * Antigravity state synchronisation.\n *\n * Antigravity reads its configuration from the workspace and from the user's\n * home directory rather than from arguments, so every selection has to be\n * written to disk before launch and reverted when it is no longer selected.\n * Everything the harness writes is tracked in a managed-state file so a file\n * the user created by hand is never silently replaced.\n */\n\nconst ANTIGRAVITY_PROVIDER = 'agy';\nconst AGY_MANAGED_STATE = '.doom-pi-managed.json';\nconst ANTIGRAVITY_PROXY_SERVER_NAME = 'mcp-proxy';\nconst PROJECT_MCP_SERVER_NAME = 'project-mcp';\nconst PENCIL_SERVER_NAME = 'pencil';\nconst ANTIGRAVITY_SYNC_LOCK = '.doom-pi-sync.lock';\nconst AGENTS_DIRECTORY = '.agents';\nconst GENERATED_AGENTS_DIRECTORY = '_agents';\nconst CODEX_PLUGIN_DIRECTORY = '.codex-plugin';\nconst MCP_CONFIG_FILENAME = 'mcp_config.json';\nconst HOOKS_CONFIG_FILENAME = 'hooks.json';\nconst MANAGED_PLUGINS_KEY = 'plugins';\nconst MCP_PROXY_TIMEOUT_MS = 1_200_000;\nconst GEMINI_DIRECTORY = '.gemini';\nconst ANTIGRAVITY_CLI_DIRECTORY = 'antigravity-cli';\nconst ANTIGRAVITY_SETTINGS_FILENAME = 'settings.json';\nconst ANTIGRAVITY_LOCAL_DIRECTORY = '.antigravity-local';\nconst CLAUDE_DIRECTORY = '.claude';\nconst DEFAULT_ANTIGRAVITY_MODEL = 'Gemini 3.5 Flash';\nconst REPO_ROOT_PLACEHOLDER = '$AGY_REPO_ROOT';\n\n/** Rewrites one MCP server definition into the shape Antigravity expects. */\nexport function adaptAntigravityMcpDefinition(definition: JsonObject, repoRoot: string): JsonObject | undefined {\n if (typeof definition.command === 'string') {\n const adapted: JsonObject = {\n ...definition,\n command: definition.command,\n args: Array.isArray(definition.args) ? definition.args.map(String) : [],\n cwd: typeof definition.cwd === 'string' ? definition.cwd : repoRoot,\n };\n delete adapted.type;\n return adapted;\n }\n const url = typeof definition.url === 'string' ? definition.url : undefined;\n if (!url) return undefined;\n const adapted: JsonObject = { ...definition, serverUrl: url };\n delete adapted.type;\n delete adapted.url;\n return adapted;\n}\n\nfunction syncAntigravityMcp(context: CompatibilityContext): void {\n const repoRoot = context.options.repoRoot;\n const workspacePath = path.join(repoRoot, AGENTS_DIRECTORY, MCP_CONFIG_FILENAME);\n const managedPath = path.join(repoRoot, AGENTS_DIRECTORY, AGY_MANAGED_STATE);\n const workspace = readJson(workspacePath);\n const workspaceMcpServers = workspace[MCP_SERVERS_KEY];\n const workspaceServers = isRecord(workspaceMcpServers) ? { ...workspaceMcpServers } : {};\n const previousManaged = readJson(managedPath);\n const previousMcpServers = previousManaged[MCP_SERVERS_KEY];\n const previousNames = Array.isArray(previousMcpServers) ? previousMcpServers.map(String) : [];\n for (const name of new Set([\n ...previousNames,\n ANTIGRAVITY_PROXY_SERVER_NAME,\n PROJECT_MCP_SERVER_NAME,\n PENCIL_SERVER_NAME,\n ])) {\n delete workspaceServers[name];\n }\n\n const selectedConfig = readJson(context.mcpConfigPath);\n const selectedMcpServers = selectedConfig[MCP_SERVERS_KEY];\n const selectedServers = isRecord(selectedMcpServers) ? selectedMcpServers : {};\n const allowed = context.mcpAllowlist?.servers;\n const keeps = (name: string): boolean => !allowed || allowed.length === 0 || allowed.includes(name);\n const managedNames: string[] = [];\n\n if (keeps(AGIFLOW_PROXY_SERVER_NAME)) {\n workspaceServers[ANTIGRAVITY_PROXY_SERVER_NAME] = {\n command: NPX_COMMAND,\n args: mcpProxyArguments(ANTIGRAVITY_MCP_PROXY_PACKAGE, context.proxyConfigPath, true),\n cwd: repoRoot,\n timeout: MCP_PROXY_TIMEOUT_MS,\n };\n managedNames.push(ANTIGRAVITY_PROXY_SERVER_NAME);\n }\n\n const directNames = context.mcpAllowlist ? (allowed ?? []) : [PROJECT_MCP_SERVER_NAME, PENCIL_SERVER_NAME];\n for (const name of directNames) {\n if (name === AGIFLOW_PROXY_SERVER_NAME) continue;\n const definition = selectedServers[name];\n if (!isRecord(definition)) continue;\n const adapted = adaptAntigravityMcpDefinition(definition, repoRoot);\n if (!adapted) continue;\n workspaceServers[name] = adapted;\n managedNames.push(name);\n }\n\n writeJson(workspacePath, { ...workspace, [MCP_SERVERS_KEY]: workspaceServers });\n writeJson(managedPath, { ...previousManaged, [MCP_SERVERS_KEY]: managedNames });\n\n const home = context.environment.HOME;\n if (!home) return;\n // Earlier releases wrote these servers into the Gemini config. Leaving them\n // there would double every tool, so they are removed wherever they are found.\n for (const legacyPath of [\n path.join(home, GEMINI_DIRECTORY, 'config', MCP_CONFIG_FILENAME),\n path.join(home, GEMINI_DIRECTORY, 'config', PLUGINS_DIRECTORY, 'shared', MCP_CONFIG_FILENAME),\n ]) {\n if (!fs.existsSync(legacyPath)) continue;\n const legacy = readJson(legacyPath);\n const legacyMcpServers = legacy[MCP_SERVERS_KEY];\n const servers = isRecord(legacyMcpServers) ? { ...legacyMcpServers } : {};\n for (const name of [\n ANTIGRAVITY_PROXY_SERVER_NAME,\n AGIFLOW_PROXY_SERVER_NAME,\n PROJECT_MCP_SERVER_NAME,\n PENCIL_SERVER_NAME,\n ]) {\n delete servers[name];\n }\n writeJson(legacyPath, { ...legacy, [MCP_SERVERS_KEY]: servers });\n }\n}\n\nfunction antigravitySettingsPath(home: string): string {\n return path.join(home, GEMINI_DIRECTORY, ANTIGRAVITY_CLI_DIRECTORY, ANTIGRAVITY_SETTINGS_FILENAME);\n}\n\nfunction syncAntigravityModel(context: CompatibilityContext): void {\n const home = context.environment.HOME;\n if (!home) throw new Error('HOME is required for Antigravity compatibility');\n const settingsPath = antigravitySettingsPath(home);\n const settings = readJson(settingsPath);\n if (!settings.model) settings.model = context.environment.AGY_MODEL ?? DEFAULT_ANTIGRAVITY_MODEL;\n const trusted = Array.isArray(settings.trustedWorkspaces) ? settings.trustedWorkspaces.map(String) : [];\n if (!trusted.includes(context.options.repoRoot)) trusted.push(context.options.repoRoot);\n settings.trustedWorkspaces = trusted;\n writeJson(settingsPath, settings);\n}\n\nfunction ensureManagedDirectory(directory: string): void {\n const stat = fs.lstatSync(directory, { throwIfNoEntry: false });\n if (stat && !stat.isDirectory()) {\n throw new Error(`Refusing to use unmanaged Antigravity path: ${directory}`);\n }\n if (!stat) fs.mkdirSync(directory, { recursive: true });\n}\n\nfunction replaceManagedSkillLink(linkPath: string, sourcePath: string): void {\n if (fs.existsSync(linkPath) || fs.lstatSync(linkPath, { throwIfNoEntry: false })) {\n const stat = fs.lstatSync(linkPath);\n if (!stat.isSymbolicLink()) throw new Error(`Refusing to replace unmanaged Antigravity path: ${linkPath}`);\n fs.rmSync(linkPath, { force: true });\n }\n fs.symlinkSync(sourcePath, linkPath, 'dir');\n}\n\nfunction syncAntigravityPlugins(context: CompatibilityContext): void {\n const repoRoot = context.options.repoRoot;\n const pluginsRoot = path.join(repoRoot, PLUGINS_DIRECTORY);\n const agentsRoot = path.join(repoRoot, GENERATED_AGENTS_DIRECTORY);\n const targetRoot = path.join(agentsRoot, PLUGINS_DIRECTORY);\n const managedPath = path.join(repoRoot, AGENTS_DIRECTORY, AGY_MANAGED_STATE);\n const managed = readJson(managedPath);\n const previousPlugins = managed[MANAGED_PLUGINS_KEY];\n const previousNames = new Set(Array.isArray(previousPlugins) ? previousPlugins.map(String) : []);\n ensureManagedDirectory(agentsRoot);\n ensureManagedDirectory(targetRoot);\n const selectedNames = new Set<string>();\n\n for (const plugin of context.plugins) {\n const manifestPath = path.join(plugin.directory, CODEX_PLUGIN_DIRECTORY, PLUGIN_MANIFEST_FILENAME);\n if (!fs.existsSync(manifestPath)) continue;\n const manifest = readJson(manifestPath);\n const pluginName =\n typeof manifest.name === 'string' && manifest.name ? manifest.name : path.basename(plugin.directory);\n if (\n pluginName === '.' ||\n pluginName === '..' ||\n pluginName.toLowerCase() === CORE_PLUGIN_NAME ||\n pluginName.includes('/') ||\n pluginName.includes('\\\\')\n ) {\n throw new Error(`Invalid Antigravity plugin name: ${pluginName}`);\n }\n const target = path.join(targetRoot, pluginName);\n selectedNames.add(pluginName);\n ensureManagedDirectory(target);\n writeJson(path.join(target, PLUGIN_MANIFEST_FILENAME), { name: pluginName });\n const skills = path.join(plugin.directory, SKILLS_DIRECTORY);\n const skillsLink = path.join(target, SKILLS_DIRECTORY);\n if (fs.existsSync(skills)) {\n replaceManagedSkillLink(skillsLink, skills);\n } else if (fs.lstatSync(skillsLink, { throwIfNoEntry: false })?.isSymbolicLink()) {\n fs.rmSync(skillsLink, { force: true });\n }\n }\n\n for (const entry of fs.readdirSync(targetRoot, { withFileTypes: true })) {\n if (entry.name === CORE_PLUGIN_NAME || selectedNames.has(entry.name)) continue;\n const target = path.join(targetRoot, entry.name);\n if (previousNames.has(entry.name)) {\n fs.rmSync(target, { recursive: true, force: true });\n continue;\n }\n if (!entry.isDirectory()) continue;\n // Not in the managed list, but its skills link points into this repository's\n // plugins, so an earlier run created it before the state file existed.\n const skillsLink = path.join(target, SKILLS_DIRECTORY);\n const stat = fs.lstatSync(skillsLink, { throwIfNoEntry: false });\n if (!stat?.isSymbolicLink()) continue;\n const source = path.resolve(path.dirname(skillsLink), fs.readlinkSync(skillsLink));\n if (pathInside(pluginsRoot, source)) fs.rmSync(target, { recursive: true, force: true });\n }\n\n writeJson(managedPath, { ...managed, [MANAGED_PLUGINS_KEY]: [...selectedNames] });\n}\n\nfunction removeManagedCorePlugin(core: string): void {\n if (readJson(path.join(core, PLUGIN_MANIFEST_FILENAME)).name === CORE_PLUGIN_NAME) {\n fs.rmSync(core, { recursive: true, force: true });\n }\n}\n\nfunction syncAntigravitySharedSkills(context: CompatibilityContext): void {\n const core = path.join(context.options.repoRoot, GENERATED_AGENTS_DIRECTORY, PLUGINS_DIRECTORY, CORE_PLUGIN_NAME);\n const coreStat = fs.lstatSync(core, { throwIfNoEntry: false });\n if (coreStat?.isSymbolicLink()) throw new Error(`Refusing to use unmanaged Antigravity path: ${core}`);\n if (!context.sharedSkills) {\n removeManagedCorePlugin(core);\n return;\n }\n\n const source = path.join(context.options.repoRoot, CLAUDE_DIRECTORY, SKILLS_DIRECTORY);\n if (!fs.existsSync(source)) {\n removeManagedCorePlugin(core);\n return;\n }\n ensureManagedDirectory(core);\n const target = path.join(core, SKILLS_DIRECTORY);\n ensureManagedDirectory(target);\n writeJson(path.join(core, PLUGIN_MANIFEST_FILENAME), { name: CORE_PLUGIN_NAME });\n const selected = new Set<string>();\n for (const entry of fs.readdirSync(source, { withFileTypes: true })) {\n if (!entry.isDirectory()) continue;\n selected.add(entry.name);\n replaceManagedSkillLink(path.join(target, entry.name), path.join(source, entry.name));\n }\n for (const entry of fs.readdirSync(target)) {\n if (selected.has(entry)) continue;\n const candidate = path.join(target, entry);\n if (fs.lstatSync(candidate).isSymbolicLink()) fs.rmSync(candidate, { force: true });\n }\n}\n\nfunction syncAntigravityHooks(context: CompatibilityContext): void {\n const source = path.join(context.options.repoRoot, ANTIGRAVITY_LOCAL_DIRECTORY, HOOKS_CONFIG_FILENAME);\n const target = path.join(context.options.repoRoot, AGENTS_DIRECTORY, HOOKS_CONFIG_FILENAME);\n const managedPath = path.join(context.options.repoRoot, AGENTS_DIRECTORY, AGY_MANAGED_STATE);\n const managed = readJson(managedPath);\n if (!fs.existsSync(source)) {\n if (managed.hooks === true) fs.rmSync(target, { force: true });\n writeJson(managedPath, { ...managed, hooks: false });\n return;\n }\n const content = fs.readFileSync(source, 'utf8').replaceAll(REPO_ROOT_PLACEHOLDER, context.options.repoRoot);\n const targetStat = fs.lstatSync(target, { throwIfNoEntry: false });\n if (targetStat && managed.hooks !== true) {\n if (!targetStat.isFile() || fs.readFileSync(target, 'utf8') !== content) {\n throw new Error(`Refusing to replace unmanaged Antigravity path: ${target}`);\n }\n }\n writeFileAtomic(target, content);\n writeJson(managedPath, { ...managed, hooks: true });\n}\n\nexport function antigravityCompatibilityArgs(context: CompatibilityContext): string[] {\n return [SKIP_PERMISSIONS_OPTION, ...additionalDirectoryArgs(context), ...context.options.providerArgs];\n}\n\nexport async function launchAntigravity(context: CompatibilityContext): Promise<number> {\n const home = context.environment.HOME;\n if (!home) throw new Error('HOME is required for Antigravity compatibility');\n // Every step below writes shared state under the user's home directory, so\n // two repositories launching at once have to be serialised.\n const lockPath = path.join(home, GEMINI_DIRECTORY, ANTIGRAVITY_CLI_DIRECTORY, ANTIGRAVITY_SYNC_LOCK);\n const releaseLock = await acquireDirectoryLock(lockPath);\n try {\n syncAntigravityMcp(context);\n syncAntigravityModel(context);\n syncAntigravityPlugins(context);\n syncAntigravitySharedSkills(context);\n syncAntigravityHooks(context);\n } finally {\n await releaseLock();\n }\n return runInteractive(\n ANTIGRAVITY_PROVIDER,\n antigravityCompatibilityArgs(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ANTIGRAVITY_MCP_PROXY_PACKAGE","PLUGINS_DIRECTORY","fs","AGIFLOW_PROXY_SERVER_NAME","PLUGIN_MANIFEST_FILENAME","SKILLS_DIRECTORY","pathInside","CORE_PLUGIN_NAME","SKIP_PERMISSIONS_OPTION","additionalDirectoryArgs","acquireDirectoryLock","runInteractive"],"sources":["../../../src/adapters/compatibility/antigravity.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { isRecord, type JsonObject, readJson, writeFileAtomic, writeJson } from '../../utils/index.ts';\nimport type { CompatibilityContext } from '../compatibilityContext.ts';\nimport { acquireDirectoryLock, pathInside, runInteractive } from './process.ts';\nimport {\n AGIFLOW_PROXY_SERVER_NAME,\n ANTIGRAVITY_MCP_PROXY_PACKAGE,\n additionalDirectoryArgs,\n CORE_PLUGIN_NAME,\n MCP_SERVERS_KEY,\n mcpProxyArguments,\n NPX_COMMAND,\n PLUGIN_MANIFEST_FILENAME,\n PLUGINS_DIRECTORY,\n SKILLS_DIRECTORY,\n SKIP_PERMISSIONS_OPTION,\n} from './shared.ts';\n\n/**\n * Antigravity state synchronisation.\n *\n * Antigravity reads its configuration from the workspace and from the user's\n * home directory rather than from arguments, so every selection has to be\n * written to disk before launch and reverted when it is no longer selected.\n * Everything the harness writes is tracked in a managed-state file so a file\n * the user created by hand is never silently replaced.\n */\n\nconst ANTIGRAVITY_PROVIDER = 'agy';\nconst AGY_MANAGED_STATE = '.doom-pi-managed.json';\nconst ANTIGRAVITY_PROXY_SERVER_NAME = 'mcp-proxy';\nconst PROJECT_MCP_SERVER_NAME = 'project-mcp';\nconst PENCIL_SERVER_NAME = 'pencil';\nconst ANTIGRAVITY_SYNC_LOCK = '.doom-pi-sync.lock';\nconst AGENTS_DIRECTORY = '.agents';\nconst GENERATED_AGENTS_DIRECTORY = '_agents';\nconst CODEX_PLUGIN_DIRECTORY = '.codex-plugin';\nconst MCP_CONFIG_FILENAME = 'mcp_config.json';\nconst HOOKS_CONFIG_FILENAME = 'hooks.json';\nconst MANAGED_PLUGINS_KEY = 'plugins';\nconst MCP_PROXY_TIMEOUT_MS = 1_200_000;\nconst GEMINI_DIRECTORY = '.gemini';\nconst ANTIGRAVITY_CLI_DIRECTORY = 'antigravity-cli';\nconst ANTIGRAVITY_SETTINGS_FILENAME = 'settings.json';\nconst ANTIGRAVITY_LOCAL_DIRECTORY = '.antigravity-local';\nconst CLAUDE_DIRECTORY = '.claude';\nconst DEFAULT_ANTIGRAVITY_MODEL = 'Gemini 3.5 Flash';\nconst REPO_ROOT_PLACEHOLDER = '$AGY_REPO_ROOT';\n\n/** Rewrites one MCP server definition into the shape Antigravity expects. */\nexport function adaptAntigravityMcpDefinition(definition: JsonObject, repoRoot: string): JsonObject | undefined {\n if (typeof definition.command === 'string') {\n const adapted: JsonObject = {\n ...definition,\n command: definition.command,\n args: Array.isArray(definition.args) ? definition.args.map(String) : [],\n cwd: typeof definition.cwd === 'string' ? definition.cwd : repoRoot,\n };\n delete adapted.type;\n return adapted;\n }\n const url = typeof definition.url === 'string' ? definition.url : undefined;\n if (!url) return undefined;\n const adapted: JsonObject = { ...definition, serverUrl: url };\n delete adapted.type;\n delete adapted.url;\n return adapted;\n}\n\nfunction syncAntigravityMcp(context: CompatibilityContext): void {\n const repoRoot = context.options.repoRoot;\n const workspacePath = path.join(repoRoot, AGENTS_DIRECTORY, MCP_CONFIG_FILENAME);\n const managedPath = path.join(repoRoot, AGENTS_DIRECTORY, AGY_MANAGED_STATE);\n const workspace = readJson(workspacePath);\n const workspaceMcpServers = workspace[MCP_SERVERS_KEY];\n const workspaceServers = isRecord(workspaceMcpServers) ? { ...workspaceMcpServers } : {};\n const previousManaged = readJson(managedPath);\n const previousMcpServers = previousManaged[MCP_SERVERS_KEY];\n const previousNames = Array.isArray(previousMcpServers) ? previousMcpServers.map(String) : [];\n for (const name of new Set([\n ...previousNames,\n ANTIGRAVITY_PROXY_SERVER_NAME,\n PROJECT_MCP_SERVER_NAME,\n PENCIL_SERVER_NAME,\n ])) {\n delete workspaceServers[name];\n }\n\n const selectedConfig = readJson(context.mcpConfigPath);\n const selectedMcpServers = selectedConfig[MCP_SERVERS_KEY];\n const selectedServers = isRecord(selectedMcpServers) ? selectedMcpServers : {};\n const allowed = context.mcpAllowlist?.servers;\n const keeps = (name: string): boolean => !allowed || allowed.length === 0 || allowed.includes(name);\n const managedNames: string[] = [];\n\n if (keeps(AGIFLOW_PROXY_SERVER_NAME)) {\n workspaceServers[ANTIGRAVITY_PROXY_SERVER_NAME] = {\n command: NPX_COMMAND,\n args: mcpProxyArguments(ANTIGRAVITY_MCP_PROXY_PACKAGE, context.proxyConfigPath, true),\n cwd: repoRoot,\n timeout: MCP_PROXY_TIMEOUT_MS,\n };\n managedNames.push(ANTIGRAVITY_PROXY_SERVER_NAME);\n }\n\n const directNames = context.mcpAllowlist ? (allowed ?? []) : [PROJECT_MCP_SERVER_NAME, PENCIL_SERVER_NAME];\n for (const name of directNames) {\n if (name === AGIFLOW_PROXY_SERVER_NAME) continue;\n const definition = selectedServers[name];\n if (!isRecord(definition)) continue;\n const adapted = adaptAntigravityMcpDefinition(definition, repoRoot);\n if (!adapted) continue;\n workspaceServers[name] = adapted;\n managedNames.push(name);\n }\n\n writeJson(workspacePath, { ...workspace, [MCP_SERVERS_KEY]: workspaceServers });\n writeJson(managedPath, { ...previousManaged, [MCP_SERVERS_KEY]: managedNames });\n\n const home = context.environment.HOME;\n if (!home) return;\n // Earlier releases wrote these servers into the Gemini config. Leaving them\n // there would double every tool, so they are removed wherever they are found.\n for (const legacyPath of [\n path.join(home, GEMINI_DIRECTORY, 'config', MCP_CONFIG_FILENAME),\n path.join(home, GEMINI_DIRECTORY, 'config', PLUGINS_DIRECTORY, 'shared', MCP_CONFIG_FILENAME),\n ]) {\n if (!fs.existsSync(legacyPath)) continue;\n const legacy = readJson(legacyPath);\n const legacyMcpServers = legacy[MCP_SERVERS_KEY];\n const servers = isRecord(legacyMcpServers) ? { ...legacyMcpServers } : {};\n for (const name of [\n ANTIGRAVITY_PROXY_SERVER_NAME,\n AGIFLOW_PROXY_SERVER_NAME,\n PROJECT_MCP_SERVER_NAME,\n PENCIL_SERVER_NAME,\n ]) {\n delete servers[name];\n }\n writeJson(legacyPath, { ...legacy, [MCP_SERVERS_KEY]: servers });\n }\n}\n\nfunction antigravitySettingsPath(home: string): string {\n return path.join(home, GEMINI_DIRECTORY, ANTIGRAVITY_CLI_DIRECTORY, ANTIGRAVITY_SETTINGS_FILENAME);\n}\n\nfunction syncAntigravityModel(context: CompatibilityContext): void {\n const home = context.environment.HOME;\n if (!home) throw new Error('HOME is required for Antigravity compatibility');\n const settingsPath = antigravitySettingsPath(home);\n const settings = readJson(settingsPath);\n if (!settings.model) settings.model = context.environment.AGY_MODEL ?? DEFAULT_ANTIGRAVITY_MODEL;\n const trusted = Array.isArray(settings.trustedWorkspaces) ? settings.trustedWorkspaces.map(String) : [];\n if (!trusted.includes(context.options.repoRoot)) trusted.push(context.options.repoRoot);\n settings.trustedWorkspaces = trusted;\n writeJson(settingsPath, settings);\n}\n\nfunction ensureManagedDirectory(directory: string): void {\n const stat = fs.lstatSync(directory, { throwIfNoEntry: false });\n if (stat && !stat.isDirectory()) {\n throw new Error(`Refusing to use unmanaged Antigravity path: ${directory}`);\n }\n if (!stat) fs.mkdirSync(directory, { recursive: true });\n}\n\nfunction replaceManagedSkillLink(linkPath: string, sourcePath: string): void {\n if (fs.existsSync(linkPath) || fs.lstatSync(linkPath, { throwIfNoEntry: false })) {\n const stat = fs.lstatSync(linkPath);\n if (!stat.isSymbolicLink()) throw new Error(`Refusing to replace unmanaged Antigravity path: ${linkPath}`);\n fs.rmSync(linkPath, { force: true });\n }\n fs.symlinkSync(sourcePath, linkPath, 'dir');\n}\n\nfunction syncAntigravityPlugins(context: CompatibilityContext): void {\n const repoRoot = context.options.repoRoot;\n const pluginsRoot = path.join(repoRoot, PLUGINS_DIRECTORY);\n const agentsRoot = path.join(repoRoot, GENERATED_AGENTS_DIRECTORY);\n const targetRoot = path.join(agentsRoot, PLUGINS_DIRECTORY);\n const managedPath = path.join(repoRoot, AGENTS_DIRECTORY, AGY_MANAGED_STATE);\n const managed = readJson(managedPath);\n const previousPlugins = managed[MANAGED_PLUGINS_KEY];\n const previousNames = new Set(Array.isArray(previousPlugins) ? previousPlugins.map(String) : []);\n ensureManagedDirectory(agentsRoot);\n ensureManagedDirectory(targetRoot);\n const selectedNames = new Set<string>();\n\n for (const plugin of context.plugins) {\n const manifestPath = path.join(plugin.directory, CODEX_PLUGIN_DIRECTORY, PLUGIN_MANIFEST_FILENAME);\n if (!fs.existsSync(manifestPath)) continue;\n const manifest = readJson(manifestPath);\n const pluginName =\n typeof manifest.name === 'string' && manifest.name ? manifest.name : path.basename(plugin.directory);\n if (\n pluginName === '.' ||\n pluginName === '..' ||\n pluginName.toLowerCase() === CORE_PLUGIN_NAME ||\n pluginName.includes('/') ||\n pluginName.includes('\\\\')\n ) {\n throw new Error(`Invalid Antigravity plugin name: ${pluginName}`);\n }\n const target = path.join(targetRoot, pluginName);\n selectedNames.add(pluginName);\n ensureManagedDirectory(target);\n writeJson(path.join(target, PLUGIN_MANIFEST_FILENAME), { name: pluginName });\n const skills = path.join(plugin.directory, SKILLS_DIRECTORY);\n const skillsLink = path.join(target, SKILLS_DIRECTORY);\n if (fs.existsSync(skills)) {\n replaceManagedSkillLink(skillsLink, skills);\n } else if (fs.lstatSync(skillsLink, { throwIfNoEntry: false })?.isSymbolicLink()) {\n fs.rmSync(skillsLink, { force: true });\n }\n }\n\n for (const entry of fs.readdirSync(targetRoot, { withFileTypes: true })) {\n if (entry.name === CORE_PLUGIN_NAME || selectedNames.has(entry.name)) continue;\n const target = path.join(targetRoot, entry.name);\n if (previousNames.has(entry.name)) {\n fs.rmSync(target, { recursive: true, force: true });\n continue;\n }\n if (!entry.isDirectory()) continue;\n // Not in the managed list, but its skills link points into this repository's\n // plugins, so an earlier run created it before the state file existed.\n const skillsLink = path.join(target, SKILLS_DIRECTORY);\n const stat = fs.lstatSync(skillsLink, { throwIfNoEntry: false });\n if (!stat?.isSymbolicLink()) continue;\n const source = path.resolve(path.dirname(skillsLink), fs.readlinkSync(skillsLink));\n if (pathInside(pluginsRoot, source)) fs.rmSync(target, { recursive: true, force: true });\n }\n\n writeJson(managedPath, { ...managed, [MANAGED_PLUGINS_KEY]: [...selectedNames] });\n}\n\nfunction removeManagedCorePlugin(core: string): void {\n if (readJson(path.join(core, PLUGIN_MANIFEST_FILENAME)).name === CORE_PLUGIN_NAME) {\n fs.rmSync(core, { recursive: true, force: true });\n }\n}\n\nfunction syncAntigravitySharedSkills(context: CompatibilityContext): void {\n const core = path.join(context.options.repoRoot, GENERATED_AGENTS_DIRECTORY, PLUGINS_DIRECTORY, CORE_PLUGIN_NAME);\n const coreStat = fs.lstatSync(core, { throwIfNoEntry: false });\n if (coreStat?.isSymbolicLink()) throw new Error(`Refusing to use unmanaged Antigravity path: ${core}`);\n if (!context.sharedSkills) {\n removeManagedCorePlugin(core);\n return;\n }\n\n const source = path.join(context.options.repoRoot, CLAUDE_DIRECTORY, SKILLS_DIRECTORY);\n if (!fs.existsSync(source)) {\n removeManagedCorePlugin(core);\n return;\n }\n ensureManagedDirectory(core);\n const target = path.join(core, SKILLS_DIRECTORY);\n ensureManagedDirectory(target);\n writeJson(path.join(core, PLUGIN_MANIFEST_FILENAME), { name: CORE_PLUGIN_NAME });\n const selected = new Set<string>();\n for (const entry of fs.readdirSync(source, { withFileTypes: true })) {\n if (!entry.isDirectory()) continue;\n selected.add(entry.name);\n replaceManagedSkillLink(path.join(target, entry.name), path.join(source, entry.name));\n }\n for (const entry of fs.readdirSync(target)) {\n if (selected.has(entry)) continue;\n const candidate = path.join(target, entry);\n if (fs.lstatSync(candidate).isSymbolicLink()) fs.rmSync(candidate, { force: true });\n }\n}\n\nfunction syncAntigravityHooks(context: CompatibilityContext): void {\n const source = path.join(context.options.repoRoot, ANTIGRAVITY_LOCAL_DIRECTORY, HOOKS_CONFIG_FILENAME);\n const target = path.join(context.options.repoRoot, AGENTS_DIRECTORY, HOOKS_CONFIG_FILENAME);\n const managedPath = path.join(context.options.repoRoot, AGENTS_DIRECTORY, AGY_MANAGED_STATE);\n const managed = readJson(managedPath);\n if (!fs.existsSync(source)) {\n if (managed.hooks === true) fs.rmSync(target, { force: true });\n writeJson(managedPath, { ...managed, hooks: false });\n return;\n }\n const content = fs.readFileSync(source, 'utf8').replaceAll(REPO_ROOT_PLACEHOLDER, context.options.repoRoot);\n const targetStat = fs.lstatSync(target, { throwIfNoEntry: false });\n if (targetStat && managed.hooks !== true) {\n if (!targetStat.isFile() || fs.readFileSync(target, 'utf8') !== content) {\n throw new Error(`Refusing to replace unmanaged Antigravity path: ${target}`);\n }\n }\n writeFileAtomic(target, content);\n writeJson(managedPath, { ...managed, hooks: true });\n}\n\nexport function antigravityCompatibilityArgs(context: CompatibilityContext): string[] {\n return [SKIP_PERMISSIONS_OPTION, ...additionalDirectoryArgs(context), ...context.options.providerArgs];\n}\n\nexport async function launchAntigravity(context: CompatibilityContext): Promise<number> {\n const home = context.environment.HOME;\n if (!home) throw new Error('HOME is required for Antigravity compatibility');\n // Every step below writes shared state under the user's home directory, so\n // two repositories launching at once have to be serialised.\n const lockPath = path.join(home, GEMINI_DIRECTORY, ANTIGRAVITY_CLI_DIRECTORY, ANTIGRAVITY_SYNC_LOCK);\n const releaseLock = await acquireDirectoryLock(lockPath);\n try {\n syncAntigravityMcp(context);\n syncAntigravityModel(context);\n syncAntigravityPlugins(context);\n syncAntigravitySharedSkills(context);\n syncAntigravityHooks(context);\n } finally {\n await releaseLock();\n }\n return runInteractive(\n ANTIGRAVITY_PROVIDER,\n antigravityCompatibilityArgs(context),\n context.options.repoRoot,\n context.environment,\n );\n}\n"],"mappings":"iRA6BA,MACM,EAAoB,wBACpB,EAAgC,YAChC,EAA0B,cAC1B,EAAqB,SAErB,EAAmB,UACnB,EAA6B,UAE7B,EAAsB,kBACtB,EAAwB,aACxB,EAAsB,UAEtB,EAAmB,UAC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,MAAO,GAAO,CAAC,CACpD,OAEF,IAAM,EAAUA,EAAAA,QAAG,aAAa,EAAQ,OAAO,CAAC,WAAW,iBAAuB,EAAQ,QAAQ,SAAS,CACrG,EAAaA,EAAAA,QAAG,UAAU,EAAQ,CAAE,eAAgB,GAAO,CAAC,CAClE,GAAI,GAAc,EAAQ,QAAU,KAC9B,CAAC,EAAW,QAAQ,EAAIA,EAAAA,QAAG,aAAa,EAAQ,OAAO,GAAK,GAC9D,MAAU,MAAM,mDAAmD,IAAS,CAGhF,EAAA,gBAAgB,EAAQ,EAAQ,CAChC,EAAA,UAAU,EAAa,CAAE,GAAG,EAAS,MAAO,GAAM,CAAC,CAGrD,SAAgB,EAA6B,EAAyC,CACpF,MAAO,CAACM,EAAAA,wBAAyB,GAAGC,EAAAA,wBAAwB,EAAQ,CAAE,GAAG,EAAQ,QAAQ,aAAa,CAGxG,eAAsB,EAAkB,EAAgD,CACtF,IAAM,EAAO,EAAQ,YAAY,KACjC,GAAI,CAAC,EAAM,MAAU,MAAM,iDAAiD,CAI5E,IAAM,EAAc,MAAMC,EAAAA,qBADTf,EAAAA,QAAK,KAAK,EAAM,EAAkB,EAA2B,qBACvB,CAAC,CACxD,GAAI,CACF,EAAmB,EAAQ,CAC3B,EAAqB,EAAQ,CAC7B,EAAuB,EAAQ,CAC/B,EAA4B,EAAQ,CACpC,EAAqB,EAAQ,QACrB,CACR,MAAM,GAAa,CAErB,OAAOgB,EAAAA,eACL,MACA,EAA6B,EAAQ,CACrC,EAAQ,QAAQ,SAChB,EAAQ,YACT"}
@@ -0,0 +1,11 @@
1
+ import { CompatibilityContext } from "../compatibilityContext.cjs";
2
+ import { JsonObject } from "../serialization/json.cjs";
3
+
4
+ //#region src/adapters/compatibility/antigravity.d.ts
5
+ /** Rewrites one MCP server definition into the shape Antigravity expects. */
6
+ declare function adaptAntigravityMcpDefinition(definition: JsonObject, repoRoot: string): JsonObject | undefined;
7
+ declare function antigravityCompatibilityArgs(context: CompatibilityContext): string[];
8
+ declare function launchAntigravity(context: CompatibilityContext): Promise<number>;
9
+ //#endregion
10
+ export { adaptAntigravityMcpDefinition, antigravityCompatibilityArgs, launchAntigravity };
11
+ //# sourceMappingURL=antigravity.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity.d.cts","names":[],"sources":["../../../src/services/compatibility/antigravity.ts"],"mappings":";;;;;iBAmDgB,6BAAA,CAA8B,UAAA,EAAY,UAAA,EAAY,QAAA,WAAmB,UAAA;AAAA,iBAqPzE,4BAAA,CAA6B,OAAA,EAAS,oBAAA;AAAA,iBAIhC,iBAAA,CAAkB,OAAA,EAAS,oBAAA,GAAuB,OAAA"}
1
+ {"version":3,"file":"antigravity.d.cts","names":[],"sources":["../../../src/adapters/compatibility/antigravity.ts"],"mappings":";;;;;iBAmDgB,6BAAA,CAA8B,UAAA,EAAY,UAAA,EAAY,QAAA,WAAmB,UAAA;AAAA,iBAqPzE,4BAAA,CAA6B,OAAA,EAAS,oBAAA;AAAA,iBAIhC,iBAAA,CAAkB,OAAA,EAAS,oBAAA,GAAuB,OAAA"}
@@ -0,0 +1,11 @@
1
+ import { CompatibilityContext } from "../compatibilityContext.mjs";
2
+ import { JsonObject } from "../serialization/json.mjs";
3
+
4
+ //#region src/adapters/compatibility/antigravity.d.ts
5
+ /** Rewrites one MCP server definition into the shape Antigravity expects. */
6
+ declare function adaptAntigravityMcpDefinition(definition: JsonObject, repoRoot: string): JsonObject | undefined;
7
+ declare function antigravityCompatibilityArgs(context: CompatibilityContext): string[];
8
+ declare function launchAntigravity(context: CompatibilityContext): Promise<number>;
9
+ //#endregion
10
+ export { adaptAntigravityMcpDefinition, antigravityCompatibilityArgs, launchAntigravity };
11
+ //# sourceMappingURL=antigravity.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity.d.mts","names":[],"sources":["../../../src/services/compatibility/antigravity.ts"],"mappings":";;;;;iBAmDgB,6BAAA,CAA8B,UAAA,EAAY,UAAA,EAAY,QAAA,WAAmB,UAAA;AAAA,iBAqPzE,4BAAA,CAA6B,OAAA,EAAS,oBAAA;AAAA,iBAIhC,iBAAA,CAAkB,OAAA,EAAS,oBAAA,GAAuB,OAAA"}
1
+ {"version":3,"file":"antigravity.d.mts","names":[],"sources":["../../../src/adapters/compatibility/antigravity.ts"],"mappings":";;;;;iBAmDgB,6BAAA,CAA8B,UAAA,EAAY,UAAA,EAAY,QAAA,WAAmB,UAAA;AAAA,iBAqPzE,4BAAA,CAA6B,OAAA,EAAS,oBAAA;AAAA,iBAIhC,iBAAA,CAAkB,OAAA,EAAS,oBAAA,GAAuB,OAAA"}
@@ -0,0 +1,2 @@
1
+ import{isRecord as e,readJson as t,writeFileAtomic as n,writeJson as r}from"../serialization/json.mjs";import"../../utils/index.mjs";import{acquireDirectoryLock as i,pathInside as a,runInteractive as o}from"./process.mjs";import{AGIFLOW_PROXY_SERVER_NAME as s,ANTIGRAVITY_MCP_PROXY_PACKAGE as c,CORE_PLUGIN_NAME as l,MCP_SERVERS_KEY as u,PLUGINS_DIRECTORY as d,PLUGIN_MANIFEST_FILENAME as f,SKILLS_DIRECTORY as p,SKIP_PERMISSIONS_OPTION as m,additionalDirectoryArgs as h,mcpProxyArguments as g}from"./shared.mjs";import _ from"node:fs";import v from"node:path";const y=`.doom-pi-managed.json`,b=`mcp-proxy`,x=`project-mcp`,S=`pencil`,C=`.agents`,w=`_agents`,T=`mcp_config.json`,E=`hooks.json`,D=`plugins`,O=`.gemini`,k=`antigravity-cli`;function A(e,t){if(typeof e.command==`string`){let n={...e,command:e.command,args:Array.isArray(e.args)?e.args.map(String):[],cwd:typeof e.cwd==`string`?e.cwd:t};return delete n.type,n}let n=typeof e.url==`string`?e.url:void 0;if(!n)return;let r={...e,serverUrl:n};return delete r.type,delete r.url,r}function j(n){let i=n.options.repoRoot,a=v.join(i,C,T),o=v.join(i,C,y),l=t(a),f=l[u],p=e(f)?{...f}:{},m=t(o),h=m[u],w=Array.isArray(h)?h.map(String):[];for(let e of new Set([...w,b,x,S]))delete p[e];let E=t(n.mcpConfigPath)[u],D=e(E)?E:{},k=n.mcpAllowlist?.servers,j=e=>!k||k.length===0||k.includes(e),M=[];j(`agiflow-proxy`)&&(p[b]={command:`npx`,args:g(c,n.proxyConfigPath,!0),cwd:i,timeout:12e5},M.push(b));let N=n.mcpAllowlist?k??[]:[x,S];for(let t of N){if(t===`agiflow-proxy`)continue;let n=D[t];if(!e(n))continue;let r=A(n,i);r&&(p[t]=r,M.push(t))}r(a,{...l,[u]:p}),r(o,{...m,[u]:M});let P=n.environment.HOME;if(P)for(let n of[v.join(P,O,`config`,T),v.join(P,O,`config`,d,`shared`,T)]){if(!_.existsSync(n))continue;let i=t(n),a=i[u],o=e(a)?{...a}:{};for(let e of[b,s,x,S])delete o[e];r(n,{...i,[u]:o})}}function M(e){return v.join(e,O,k,`settings.json`)}function N(e){let n=e.environment.HOME;if(!n)throw Error(`HOME is required for Antigravity compatibility`);let i=M(n),a=t(i);a.model||=e.environment.AGY_MODEL??`Gemini 3.5 Flash`;let o=Array.isArray(a.trustedWorkspaces)?a.trustedWorkspaces.map(String):[];o.includes(e.options.repoRoot)||o.push(e.options.repoRoot),a.trustedWorkspaces=o,r(i,a)}function P(e){let t=_.lstatSync(e,{throwIfNoEntry:!1});if(t&&!t.isDirectory())throw Error(`Refusing to use unmanaged Antigravity path: ${e}`);t||_.mkdirSync(e,{recursive:!0})}function F(e,t){if(_.existsSync(e)||_.lstatSync(e,{throwIfNoEntry:!1})){if(!_.lstatSync(e).isSymbolicLink())throw Error(`Refusing to replace unmanaged Antigravity path: ${e}`);_.rmSync(e,{force:!0})}_.symlinkSync(t,e,`dir`)}function I(e){let n=e.options.repoRoot,i=v.join(n,d),o=v.join(n,w),s=v.join(o,d),c=v.join(n,C,y),l=t(c),u=l[D],m=new Set(Array.isArray(u)?u.map(String):[]);P(o),P(s);let h=new Set;for(let n of e.plugins){let e=v.join(n.directory,`.codex-plugin`,f);if(!_.existsSync(e))continue;let i=t(e),a=typeof i.name==`string`&&i.name?i.name:v.basename(n.directory);if(a===`.`||a===`..`||a.toLowerCase()===`core`||a.includes(`/`)||a.includes(`\\`))throw Error(`Invalid Antigravity plugin name: ${a}`);let o=v.join(s,a);h.add(a),P(o),r(v.join(o,f),{name:a});let c=v.join(n.directory,p),l=v.join(o,p);_.existsSync(c)?F(l,c):_.lstatSync(l,{throwIfNoEntry:!1})?.isSymbolicLink()&&_.rmSync(l,{force:!0})}for(let e of _.readdirSync(s,{withFileTypes:!0})){if(e.name===`core`||h.has(e.name))continue;let t=v.join(s,e.name);if(m.has(e.name)){_.rmSync(t,{recursive:!0,force:!0});continue}if(!e.isDirectory())continue;let n=v.join(t,p);_.lstatSync(n,{throwIfNoEntry:!1})?.isSymbolicLink()&&a(i,v.resolve(v.dirname(n),_.readlinkSync(n)))&&_.rmSync(t,{recursive:!0,force:!0})}r(c,{...l,[D]:[...h]})}function L(e){t(v.join(e,`plugin.json`)).name===`core`&&_.rmSync(e,{recursive:!0,force:!0})}function R(e){let t=v.join(e.options.repoRoot,w,d,l);if(_.lstatSync(t,{throwIfNoEntry:!1})?.isSymbolicLink())throw Error(`Refusing to use unmanaged Antigravity path: ${t}`);if(!e.sharedSkills){L(t);return}let n=v.join(e.options.repoRoot,`.claude`,p);if(!_.existsSync(n)){L(t);return}P(t);let i=v.join(t,p);P(i),r(v.join(t,f),{name:l});let a=new Set;for(let e of _.readdirSync(n,{withFileTypes:!0}))e.isDirectory()&&(a.add(e.name),F(v.join(i,e.name),v.join(n,e.name)));for(let e of _.readdirSync(i)){if(a.has(e))continue;let t=v.join(i,e);_.lstatSync(t).isSymbolicLink()&&_.rmSync(t,{force:!0})}}function z(e){let i=v.join(e.options.repoRoot,`.antigravity-local`,E),a=v.join(e.options.repoRoot,C,E),o=v.join(e.options.repoRoot,C,y),s=t(o);if(!_.existsSync(i)){s.hooks===!0&&_.rmSync(a,{force:!0}),r(o,{...s,hooks:!1});return}let c=_.readFileSync(i,`utf8`).replaceAll(`$AGY_REPO_ROOT`,e.options.repoRoot),l=_.lstatSync(a,{throwIfNoEntry:!1});if(l&&s.hooks!==!0&&(!l.isFile()||_.readFileSync(a,`utf8`)!==c))throw Error(`Refusing to replace unmanaged Antigravity path: ${a}`);n(a,c),r(o,{...s,hooks:!0})}function B(e){return[m,...h(e),...e.options.providerArgs]}async function V(e){let t=e.environment.HOME;if(!t)throw Error(`HOME is required for Antigravity compatibility`);let n=await i(v.join(t,O,k,`.doom-pi-sync.lock`));try{j(e),N(e),I(e),R(e),z(e)}finally{await n()}return o(`agy`,B(e),e.options.repoRoot,e.environment)}export{A as adaptAntigravityMcpDefinition,B as antigravityCompatibilityArgs,V as launchAntigravity};
2
+ //# sourceMappingURL=antigravity.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity.mjs","names":[],"sources":["../../../src/services/compatibility/antigravity.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { type JsonObject, isRecord, readJson, writeFileAtomic, writeJson } from '../../utils/index.ts';\nimport type { CompatibilityContext } from '../compatibilityContext.ts';\nimport { acquireDirectoryLock, pathInside, runInteractive } from './process.ts';\nimport {\n AGIFLOW_PROXY_SERVER_NAME,\n ANTIGRAVITY_MCP_PROXY_PACKAGE,\n CORE_PLUGIN_NAME,\n MCP_SERVERS_KEY,\n NPX_COMMAND,\n PLUGIN_MANIFEST_FILENAME,\n PLUGINS_DIRECTORY,\n SKILLS_DIRECTORY,\n SKIP_PERMISSIONS_OPTION,\n additionalDirectoryArgs,\n mcpProxyArguments,\n} from './shared.ts';\n\n/**\n * Antigravity state synchronisation.\n *\n * Antigravity reads its configuration from the workspace and from the user's\n * home directory rather than from arguments, so every selection has to be\n * written to disk before launch and reverted when it is no longer selected.\n * Everything the harness writes is tracked in a managed-state file so a file\n * the user created by hand is never silently replaced.\n */\n\nconst ANTIGRAVITY_PROVIDER = 'agy';\nconst AGY_MANAGED_STATE = '.doom-pi-managed.json';\nconst ANTIGRAVITY_PROXY_SERVER_NAME = 'mcp-proxy';\nconst PROJECT_MCP_SERVER_NAME = 'project-mcp';\nconst PENCIL_SERVER_NAME = 'pencil';\nconst ANTIGRAVITY_SYNC_LOCK = '.doom-pi-sync.lock';\nconst AGENTS_DIRECTORY = '.agents';\nconst GENERATED_AGENTS_DIRECTORY = '_agents';\nconst CODEX_PLUGIN_DIRECTORY = '.codex-plugin';\nconst MCP_CONFIG_FILENAME = 'mcp_config.json';\nconst HOOKS_CONFIG_FILENAME = 'hooks.json';\nconst MANAGED_PLUGINS_KEY = 'plugins';\nconst MCP_PROXY_TIMEOUT_MS = 1_200_000;\nconst GEMINI_DIRECTORY = '.gemini';\nconst ANTIGRAVITY_CLI_DIRECTORY = 'antigravity-cli';\nconst ANTIGRAVITY_SETTINGS_FILENAME = 'settings.json';\nconst ANTIGRAVITY_LOCAL_DIRECTORY = '.antigravity-local';\nconst CLAUDE_DIRECTORY = '.claude';\nconst DEFAULT_ANTIGRAVITY_MODEL = 'Gemini 3.5 Flash';\nconst REPO_ROOT_PLACEHOLDER = '$AGY_REPO_ROOT';\n\n/** Rewrites one MCP server definition into the shape Antigravity expects. */\nexport function adaptAntigravityMcpDefinition(definition: JsonObject, repoRoot: string): JsonObject | undefined {\n if (typeof definition.command === 'string') {\n const adapted: JsonObject = {\n ...definition,\n command: definition.command,\n args: Array.isArray(definition.args) ? definition.args.map(String) : [],\n cwd: typeof definition.cwd === 'string' ? definition.cwd : repoRoot,\n };\n delete adapted.type;\n return adapted;\n }\n const url = typeof definition.url === 'string' ? definition.url : undefined;\n if (!url) return undefined;\n const adapted: JsonObject = { ...definition, serverUrl: url };\n delete adapted.type;\n delete adapted.url;\n return adapted;\n}\n\nfunction syncAntigravityMcp(context: CompatibilityContext): void {\n const repoRoot = context.options.repoRoot;\n const workspacePath = path.join(repoRoot, AGENTS_DIRECTORY, MCP_CONFIG_FILENAME);\n const managedPath = path.join(repoRoot, AGENTS_DIRECTORY, AGY_MANAGED_STATE);\n const workspace = readJson(workspacePath);\n const workspaceMcpServers = workspace[MCP_SERVERS_KEY];\n const workspaceServers = isRecord(workspaceMcpServers) ? { ...workspaceMcpServers } : {};\n const previousManaged = readJson(managedPath);\n const previousMcpServers = previousManaged[MCP_SERVERS_KEY];\n const previousNames = Array.isArray(previousMcpServers) ? previousMcpServers.map(String) : [];\n for (const name of new Set([\n ...previousNames,\n ANTIGRAVITY_PROXY_SERVER_NAME,\n PROJECT_MCP_SERVER_NAME,\n PENCIL_SERVER_NAME,\n ])) {\n delete workspaceServers[name];\n }\n\n const selectedConfig = readJson(context.mcpConfigPath);\n const selectedMcpServers = selectedConfig[MCP_SERVERS_KEY];\n const selectedServers = isRecord(selectedMcpServers) ? selectedMcpServers : {};\n const allowed = context.mcpAllowlist?.servers;\n const keeps = (name: string): boolean => !allowed || allowed.length === 0 || allowed.includes(name);\n const managedNames: string[] = [];\n\n if (keeps(AGIFLOW_PROXY_SERVER_NAME)) {\n workspaceServers[ANTIGRAVITY_PROXY_SERVER_NAME] = {\n command: NPX_COMMAND,\n args: mcpProxyArguments(ANTIGRAVITY_MCP_PROXY_PACKAGE, context.proxyConfigPath, true),\n cwd: repoRoot,\n timeout: MCP_PROXY_TIMEOUT_MS,\n };\n managedNames.push(ANTIGRAVITY_PROXY_SERVER_NAME);\n }\n\n const directNames = context.mcpAllowlist ? (allowed ?? []) : [PROJECT_MCP_SERVER_NAME, PENCIL_SERVER_NAME];\n for (const name of directNames) {\n if (name === AGIFLOW_PROXY_SERVER_NAME) continue;\n const definition = selectedServers[name];\n if (!isRecord(definition)) continue;\n const adapted = adaptAntigravityMcpDefinition(definition, repoRoot);\n if (!adapted) continue;\n workspaceServers[name] = adapted;\n managedNames.push(name);\n }\n\n writeJson(workspacePath, { ...workspace, [MCP_SERVERS_KEY]: workspaceServers });\n writeJson(managedPath, { ...previousManaged, [MCP_SERVERS_KEY]: managedNames });\n\n const home = context.environment.HOME;\n if (!home) return;\n // Earlier releases wrote these servers into the Gemini config. Leaving them\n // there would double every tool, so they are removed wherever they are found.\n for (const legacyPath of [\n path.join(home, GEMINI_DIRECTORY, 'config', MCP_CONFIG_FILENAME),\n path.join(home, GEMINI_DIRECTORY, 'config', PLUGINS_DIRECTORY, 'shared', MCP_CONFIG_FILENAME),\n ]) {\n if (!fs.existsSync(legacyPath)) continue;\n const legacy = readJson(legacyPath);\n const legacyMcpServers = legacy[MCP_SERVERS_KEY];\n const servers = isRecord(legacyMcpServers) ? { ...legacyMcpServers } : {};\n for (const name of [\n ANTIGRAVITY_PROXY_SERVER_NAME,\n AGIFLOW_PROXY_SERVER_NAME,\n PROJECT_MCP_SERVER_NAME,\n PENCIL_SERVER_NAME,\n ]) {\n delete servers[name];\n }\n writeJson(legacyPath, { ...legacy, [MCP_SERVERS_KEY]: servers });\n }\n}\n\nfunction antigravitySettingsPath(home: string): string {\n return path.join(home, GEMINI_DIRECTORY, ANTIGRAVITY_CLI_DIRECTORY, ANTIGRAVITY_SETTINGS_FILENAME);\n}\n\nfunction syncAntigravityModel(context: CompatibilityContext): void {\n const home = context.environment.HOME;\n if (!home) throw new Error('HOME is required for Antigravity compatibility');\n const settingsPath = antigravitySettingsPath(home);\n const settings = readJson(settingsPath);\n if (!settings.model) settings.model = context.environment.AGY_MODEL ?? DEFAULT_ANTIGRAVITY_MODEL;\n const trusted = Array.isArray(settings.trustedWorkspaces) ? settings.trustedWorkspaces.map(String) : [];\n if (!trusted.includes(context.options.repoRoot)) trusted.push(context.options.repoRoot);\n settings.trustedWorkspaces = trusted;\n writeJson(settingsPath, settings);\n}\n\nfunction ensureManagedDirectory(directory: string): void {\n const stat = fs.lstatSync(directory, { throwIfNoEntry: false });\n if (stat && !stat.isDirectory()) {\n throw new Error(`Refusing to use unmanaged Antigravity path: ${directory}`);\n }\n if (!stat) fs.mkdirSync(directory, { recursive: true });\n}\n\nfunction replaceManagedSkillLink(linkPath: string, sourcePath: string): void {\n if (fs.existsSync(linkPath) || fs.lstatSync(linkPath, { throwIfNoEntry: false })) {\n const stat = fs.lstatSync(linkPath);\n if (!stat.isSymbolicLink()) throw new Error(`Refusing to replace unmanaged Antigravity path: ${linkPath}`);\n fs.rmSync(linkPath, { force: true });\n }\n fs.symlinkSync(sourcePath, linkPath, 'dir');\n}\n\nfunction syncAntigravityPlugins(context: CompatibilityContext): void {\n const repoRoot = context.options.repoRoot;\n const pluginsRoot = path.join(repoRoot, PLUGINS_DIRECTORY);\n const agentsRoot = path.join(repoRoot, GENERATED_AGENTS_DIRECTORY);\n const targetRoot = path.join(agentsRoot, PLUGINS_DIRECTORY);\n const managedPath = path.join(repoRoot, AGENTS_DIRECTORY, AGY_MANAGED_STATE);\n const managed = readJson(managedPath);\n const previousPlugins = managed[MANAGED_PLUGINS_KEY];\n const previousNames = new Set(Array.isArray(previousPlugins) ? previousPlugins.map(String) : []);\n ensureManagedDirectory(agentsRoot);\n ensureManagedDirectory(targetRoot);\n const selectedNames = new Set<string>();\n\n for (const plugin of context.plugins) {\n const manifestPath = path.join(plugin.directory, CODEX_PLUGIN_DIRECTORY, PLUGIN_MANIFEST_FILENAME);\n if (!fs.existsSync(manifestPath)) continue;\n const manifest = readJson(manifestPath);\n const pluginName =\n typeof manifest.name === 'string' && manifest.name ? manifest.name : path.basename(plugin.directory);\n if (\n pluginName === '.' ||\n pluginName === '..' ||\n pluginName.toLowerCase() === CORE_PLUGIN_NAME ||\n pluginName.includes('/') ||\n pluginName.includes('\\\\')\n ) {\n throw new Error(`Invalid Antigravity plugin name: ${pluginName}`);\n }\n const target = path.join(targetRoot, pluginName);\n selectedNames.add(pluginName);\n ensureManagedDirectory(target);\n writeJson(path.join(target, PLUGIN_MANIFEST_FILENAME), { name: pluginName });\n const skills = path.join(plugin.directory, SKILLS_DIRECTORY);\n const skillsLink = path.join(target, SKILLS_DIRECTORY);\n if (fs.existsSync(skills)) {\n replaceManagedSkillLink(skillsLink, skills);\n } else if (fs.lstatSync(skillsLink, { throwIfNoEntry: false })?.isSymbolicLink()) {\n fs.rmSync(skillsLink, { force: true });\n }\n }\n\n for (const entry of fs.readdirSync(targetRoot, { withFileTypes: true })) {\n if (entry.name === CORE_PLUGIN_NAME || selectedNames.has(entry.name)) continue;\n const target = path.join(targetRoot, entry.name);\n if (previousNames.has(entry.name)) {\n fs.rmSync(target, { recursive: true, force: true });\n continue;\n }\n if (!entry.isDirectory()) continue;\n // Not in the managed list, but its skills link points into this repository's\n // plugins, so an earlier run created it before the state file existed.\n const skillsLink = path.join(target, SKILLS_DIRECTORY);\n const stat = fs.lstatSync(skillsLink, { throwIfNoEntry: false });\n if (!stat?.isSymbolicLink()) continue;\n const source = path.resolve(path.dirname(skillsLink), fs.readlinkSync(skillsLink));\n if (pathInside(pluginsRoot, source)) fs.rmSync(target, { recursive: true, force: true });\n }\n\n writeJson(managedPath, { ...managed, [MANAGED_PLUGINS_KEY]: [...selectedNames] });\n}\n\nfunction removeManagedCorePlugin(core: string): void {\n if (readJson(path.join(core, PLUGIN_MANIFEST_FILENAME)).name === CORE_PLUGIN_NAME) {\n fs.rmSync(core, { recursive: true, force: true });\n }\n}\n\nfunction syncAntigravitySharedSkills(context: CompatibilityContext): void {\n const core = path.join(context.options.repoRoot, GENERATED_AGENTS_DIRECTORY, PLUGINS_DIRECTORY, CORE_PLUGIN_NAME);\n const coreStat = fs.lstatSync(core, { throwIfNoEntry: false });\n if (coreStat?.isSymbolicLink()) throw new Error(`Refusing to use unmanaged Antigravity path: ${core}`);\n if (!context.sharedSkills) {\n removeManagedCorePlugin(core);\n return;\n }\n\n const source = path.join(context.options.repoRoot, CLAUDE_DIRECTORY, SKILLS_DIRECTORY);\n if (!fs.existsSync(source)) {\n removeManagedCorePlugin(core);\n return;\n }\n ensureManagedDirectory(core);\n const target = path.join(core, SKILLS_DIRECTORY);\n ensureManagedDirectory(target);\n writeJson(path.join(core, PLUGIN_MANIFEST_FILENAME), { name: CORE_PLUGIN_NAME });\n const selected = new Set<string>();\n for (const entry of fs.readdirSync(source, { withFileTypes: true })) {\n if (!entry.isDirectory()) continue;\n selected.add(entry.name);\n replaceManagedSkillLink(path.join(target, entry.name), path.join(source, entry.name));\n }\n for (const entry of fs.readdirSync(target)) {\n if (selected.has(entry)) continue;\n const candidate = path.join(target, entry);\n if (fs.lstatSync(candidate).isSymbolicLink()) fs.rmSync(candidate, { force: true });\n }\n}\n\nfunction syncAntigravityHooks(context: CompatibilityContext): void {\n const source = path.join(context.options.repoRoot, ANTIGRAVITY_LOCAL_DIRECTORY, HOOKS_CONFIG_FILENAME);\n const target = path.join(context.options.repoRoot, AGENTS_DIRECTORY, HOOKS_CONFIG_FILENAME);\n const managedPath = path.join(context.options.repoRoot, AGENTS_DIRECTORY, AGY_MANAGED_STATE);\n const managed = readJson(managedPath);\n if (!fs.existsSync(source)) {\n if (managed.hooks === true) fs.rmSync(target, { force: true });\n writeJson(managedPath, { ...managed, hooks: false });\n return;\n }\n const content = fs.readFileSync(source, 'utf8').replaceAll(REPO_ROOT_PLACEHOLDER, context.options.repoRoot);\n const targetStat = fs.lstatSync(target, { throwIfNoEntry: false });\n if (targetStat && managed.hooks !== true) {\n if (!targetStat.isFile() || fs.readFileSync(target, 'utf8') !== content) {\n throw new Error(`Refusing to replace unmanaged Antigravity path: ${target}`);\n }\n }\n writeFileAtomic(target, content);\n writeJson(managedPath, { ...managed, hooks: true });\n}\n\nexport function antigravityCompatibilityArgs(context: CompatibilityContext): string[] {\n return [SKIP_PERMISSIONS_OPTION, ...additionalDirectoryArgs(context), ...context.options.providerArgs];\n}\n\nexport async function launchAntigravity(context: CompatibilityContext): Promise<number> {\n const home = context.environment.HOME;\n if (!home) throw new Error('HOME is required for Antigravity compatibility');\n // Every step below writes shared state under the user's home directory, so\n // two repositories launching at once have to be serialised.\n const lockPath = path.join(home, GEMINI_DIRECTORY, ANTIGRAVITY_CLI_DIRECTORY, ANTIGRAVITY_SYNC_LOCK);\n const releaseLock = await acquireDirectoryLock(lockPath);\n try {\n syncAntigravityMcp(context);\n syncAntigravityModel(context);\n syncAntigravityPlugins(context);\n syncAntigravitySharedSkills(context);\n syncAntigravityHooks(context);\n } finally {\n await releaseLock();\n }\n return runInteractive(\n ANTIGRAVITY_PROVIDER,\n antigravityCompatibilityArgs(context),\n context.options.repoRoot,\n context.environment,\n );\n}\n"],"mappings":"4iBA6BA,MACM,EAAoB,wBACpB,EAAgC,YAChC,EAA0B,cAC1B,EAAqB,SAErB,EAAmB,UACnB,EAA6B,UAE7B,EAAsB,kBACtB,EAAwB,aACxB,EAAsB,UAEtB,EAAmB,UACnB,EAA4B,kBAQlC,SAAgB,EAA8B,EAAwB,EAA0C,CAC9G,GAAI,OAAO,EAAW,SAAY,SAAU,CAC1C,IAAM,EAAsB,CAC1B,GAAG,EACH,QAAS,EAAW,QACpB,KAAM,MAAM,QAAQ,EAAW,KAAK,CAAG,EAAW,KAAK,IAAI,OAAO,CAAG,EAAE,CACvE,IAAK,OAAO,EAAW,KAAQ,SAAW,EAAW,IAAM,EAC5D,CAED,OADA,OAAO,EAAQ,KACR,EAET,IAAM,EAAM,OAAO,EAAW,KAAQ,SAAW,EAAW,IAAM,IAAA,GAClE,GAAI,CAAC,EAAK,OACV,IAAM,EAAsB,CAAE,GAAG,EAAY,UAAW,EAAK,CAG7D,OAFA,OAAO,EAAQ,KACf,OAAO,EAAQ,IACR,EAGT,SAAS,EAAmB,EAAqC,CAC/D,IAAM,EAAW,EAAQ,QAAQ,SAC3B,EAAgB,EAAK,KAAK,EAAU,EAAkB,EAAoB,CAC1E,EAAc,EAAK,KAAK,EAAU,EAAkB,EAAkB,CACtE,EAAY,EAAS,EAAc,CACnC,EAAsB,EAAU,GAChC,EAAmB,EAAS,EAAoB,CAAG,CAAE,GAAG,EAAqB,CAAG,EAAE,CAClF,EAAkB,EAAS,EAAY,CACvC,EAAqB,EAAgB,GACrC,EAAgB,MAAM,QAAQ,EAAmB,CAAG,EAAmB,IAAI,OAAO,CAAG,EAAE,CAC7F,IAAK,IAAM,KAAQ,IAAI,IAAI,CACzB,GAAG,EACH,EACA,EACA,EACD,CAAC,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AAM,EAAO,EAAQ,YAAY,KACjC,GAAI,CAAC,EAAM,MAAU,MAAM,iDAAiD,CAI5E,IAAM,EAAc,MAAM,EADT,EAAK,KAAK,EAAM,EAAkB,EAA2B,qBACvB,CAAC,CACxD,GAAI,CACF,EAAmB,EAAQ,CAC3B,EAAqB,EAAQ,CAC7B,EAAuB,EAAQ,CAC/B,EAA4B,EAAQ,CACpC,EAAqB,EAAQ,QACrB,CACR,MAAM,GAAa,CAErB,OAAO,EACL,MACA,EAA6B,EAAQ,CACrC,EAAQ,QAAQ,SAChB,EAAQ,YACT"}
1
+ {"version":3,"file":"antigravity.mjs","names":[],"sources":["../../../src/adapters/compatibility/antigravity.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { isRecord, type JsonObject, readJson, writeFileAtomic, writeJson } from '../../utils/index.ts';\nimport type { CompatibilityContext } from '../compatibilityContext.ts';\nimport { acquireDirectoryLock, pathInside, runInteractive } from './process.ts';\nimport {\n AGIFLOW_PROXY_SERVER_NAME,\n ANTIGRAVITY_MCP_PROXY_PACKAGE,\n additionalDirectoryArgs,\n CORE_PLUGIN_NAME,\n MCP_SERVERS_KEY,\n mcpProxyArguments,\n NPX_COMMAND,\n PLUGIN_MANIFEST_FILENAME,\n PLUGINS_DIRECTORY,\n SKILLS_DIRECTORY,\n SKIP_PERMISSIONS_OPTION,\n} from './shared.ts';\n\n/**\n * Antigravity state synchronisation.\n *\n * Antigravity reads its configuration from the workspace and from the user's\n * home directory rather than from arguments, so every selection has to be\n * written to disk before launch and reverted when it is no longer selected.\n * Everything the harness writes is tracked in a managed-state file so a file\n * the user created by hand is never silently replaced.\n */\n\nconst ANTIGRAVITY_PROVIDER = 'agy';\nconst AGY_MANAGED_STATE = '.doom-pi-managed.json';\nconst ANTIGRAVITY_PROXY_SERVER_NAME = 'mcp-proxy';\nconst PROJECT_MCP_SERVER_NAME = 'project-mcp';\nconst PENCIL_SERVER_NAME = 'pencil';\nconst ANTIGRAVITY_SYNC_LOCK = '.doom-pi-sync.lock';\nconst AGENTS_DIRECTORY = '.agents';\nconst GENERATED_AGENTS_DIRECTORY = '_agents';\nconst CODEX_PLUGIN_DIRECTORY = '.codex-plugin';\nconst MCP_CONFIG_FILENAME = 'mcp_config.json';\nconst HOOKS_CONFIG_FILENAME = 'hooks.json';\nconst MANAGED_PLUGINS_KEY = 'plugins';\nconst MCP_PROXY_TIMEOUT_MS = 1_200_000;\nconst GEMINI_DIRECTORY = '.gemini';\nconst ANTIGRAVITY_CLI_DIRECTORY = 'antigravity-cli';\nconst ANTIGRAVITY_SETTINGS_FILENAME = 'settings.json';\nconst ANTIGRAVITY_LOCAL_DIRECTORY = '.antigravity-local';\nconst CLAUDE_DIRECTORY = '.claude';\nconst DEFAULT_ANTIGRAVITY_MODEL = 'Gemini 3.5 Flash';\nconst REPO_ROOT_PLACEHOLDER = '$AGY_REPO_ROOT';\n\n/** Rewrites one MCP server definition into the shape Antigravity expects. */\nexport function adaptAntigravityMcpDefinition(definition: JsonObject, repoRoot: string): JsonObject | undefined {\n if (typeof definition.command === 'string') {\n const adapted: JsonObject = {\n ...definition,\n command: definition.command,\n args: Array.isArray(definition.args) ? definition.args.map(String) : [],\n cwd: typeof definition.cwd === 'string' ? definition.cwd : repoRoot,\n };\n delete adapted.type;\n return adapted;\n }\n const url = typeof definition.url === 'string' ? definition.url : undefined;\n if (!url) return undefined;\n const adapted: JsonObject = { ...definition, serverUrl: url };\n delete adapted.type;\n delete adapted.url;\n return adapted;\n}\n\nfunction syncAntigravityMcp(context: CompatibilityContext): void {\n const repoRoot = context.options.repoRoot;\n const workspacePath = path.join(repoRoot, AGENTS_DIRECTORY, MCP_CONFIG_FILENAME);\n const managedPath = path.join(repoRoot, AGENTS_DIRECTORY, AGY_MANAGED_STATE);\n const workspace = readJson(workspacePath);\n const workspaceMcpServers = workspace[MCP_SERVERS_KEY];\n const workspaceServers = isRecord(workspaceMcpServers) ? { ...workspaceMcpServers } : {};\n const previousManaged = readJson(managedPath);\n const previousMcpServers = previousManaged[MCP_SERVERS_KEY];\n const previousNames = Array.isArray(previousMcpServers) ? previousMcpServers.map(String) : [];\n for (const name of new Set([\n ...previousNames,\n ANTIGRAVITY_PROXY_SERVER_NAME,\n PROJECT_MCP_SERVER_NAME,\n PENCIL_SERVER_NAME,\n ])) {\n delete workspaceServers[name];\n }\n\n const selectedConfig = readJson(context.mcpConfigPath);\n const selectedMcpServers = selectedConfig[MCP_SERVERS_KEY];\n const selectedServers = isRecord(selectedMcpServers) ? selectedMcpServers : {};\n const allowed = context.mcpAllowlist?.servers;\n const keeps = (name: string): boolean => !allowed || allowed.length === 0 || allowed.includes(name);\n const managedNames: string[] = [];\n\n if (keeps(AGIFLOW_PROXY_SERVER_NAME)) {\n workspaceServers[ANTIGRAVITY_PROXY_SERVER_NAME] = {\n command: NPX_COMMAND,\n args: mcpProxyArguments(ANTIGRAVITY_MCP_PROXY_PACKAGE, context.proxyConfigPath, true),\n cwd: repoRoot,\n timeout: MCP_PROXY_TIMEOUT_MS,\n };\n managedNames.push(ANTIGRAVITY_PROXY_SERVER_NAME);\n }\n\n const directNames = context.mcpAllowlist ? (allowed ?? []) : [PROJECT_MCP_SERVER_NAME, PENCIL_SERVER_NAME];\n for (const name of directNames) {\n if (name === AGIFLOW_PROXY_SERVER_NAME) continue;\n const definition = selectedServers[name];\n if (!isRecord(definition)) continue;\n const adapted = adaptAntigravityMcpDefinition(definition, repoRoot);\n if (!adapted) continue;\n workspaceServers[name] = adapted;\n managedNames.push(name);\n }\n\n writeJson(workspacePath, { ...workspace, [MCP_SERVERS_KEY]: workspaceServers });\n writeJson(managedPath, { ...previousManaged, [MCP_SERVERS_KEY]: managedNames });\n\n const home = context.environment.HOME;\n if (!home) return;\n // Earlier releases wrote these servers into the Gemini config. Leaving them\n // there would double every tool, so they are removed wherever they are found.\n for (const legacyPath of [\n path.join(home, GEMINI_DIRECTORY, 'config', MCP_CONFIG_FILENAME),\n path.join(home, GEMINI_DIRECTORY, 'config', PLUGINS_DIRECTORY, 'shared', MCP_CONFIG_FILENAME),\n ]) {\n if (!fs.existsSync(legacyPath)) continue;\n const legacy = readJson(legacyPath);\n const legacyMcpServers = legacy[MCP_SERVERS_KEY];\n const servers = isRecord(legacyMcpServers) ? { ...legacyMcpServers } : {};\n for (const name of [\n ANTIGRAVITY_PROXY_SERVER_NAME,\n AGIFLOW_PROXY_SERVER_NAME,\n PROJECT_MCP_SERVER_NAME,\n PENCIL_SERVER_NAME,\n ]) {\n delete servers[name];\n }\n writeJson(legacyPath, { ...legacy, [MCP_SERVERS_KEY]: servers });\n }\n}\n\nfunction antigravitySettingsPath(home: string): string {\n return path.join(home, GEMINI_DIRECTORY, ANTIGRAVITY_CLI_DIRECTORY, ANTIGRAVITY_SETTINGS_FILENAME);\n}\n\nfunction syncAntigravityModel(context: CompatibilityContext): void {\n const home = context.environment.HOME;\n if (!home) throw new Error('HOME is required for Antigravity compatibility');\n const settingsPath = antigravitySettingsPath(home);\n const settings = readJson(settingsPath);\n if (!settings.model) settings.model = context.environment.AGY_MODEL ?? DEFAULT_ANTIGRAVITY_MODEL;\n const trusted = Array.isArray(settings.trustedWorkspaces) ? settings.trustedWorkspaces.map(String) : [];\n if (!trusted.includes(context.options.repoRoot)) trusted.push(context.options.repoRoot);\n settings.trustedWorkspaces = trusted;\n writeJson(settingsPath, settings);\n}\n\nfunction ensureManagedDirectory(directory: string): void {\n const stat = fs.lstatSync(directory, { throwIfNoEntry: false });\n if (stat && !stat.isDirectory()) {\n throw new Error(`Refusing to use unmanaged Antigravity path: ${directory}`);\n }\n if (!stat) fs.mkdirSync(directory, { recursive: true });\n}\n\nfunction replaceManagedSkillLink(linkPath: string, sourcePath: string): void {\n if (fs.existsSync(linkPath) || fs.lstatSync(linkPath, { throwIfNoEntry: false })) {\n const stat = fs.lstatSync(linkPath);\n if (!stat.isSymbolicLink()) throw new Error(`Refusing to replace unmanaged Antigravity path: ${linkPath}`);\n fs.rmSync(linkPath, { force: true });\n }\n fs.symlinkSync(sourcePath, linkPath, 'dir');\n}\n\nfunction syncAntigravityPlugins(context: CompatibilityContext): void {\n const repoRoot = context.options.repoRoot;\n const pluginsRoot = path.join(repoRoot, PLUGINS_DIRECTORY);\n const agentsRoot = path.join(repoRoot, GENERATED_AGENTS_DIRECTORY);\n const targetRoot = path.join(agentsRoot, PLUGINS_DIRECTORY);\n const managedPath = path.join(repoRoot, AGENTS_DIRECTORY, AGY_MANAGED_STATE);\n const managed = readJson(managedPath);\n const previousPlugins = managed[MANAGED_PLUGINS_KEY];\n const previousNames = new Set(Array.isArray(previousPlugins) ? previousPlugins.map(String) : []);\n ensureManagedDirectory(agentsRoot);\n ensureManagedDirectory(targetRoot);\n const selectedNames = new Set<string>();\n\n for (const plugin of context.plugins) {\n const manifestPath = path.join(plugin.directory, CODEX_PLUGIN_DIRECTORY, PLUGIN_MANIFEST_FILENAME);\n if (!fs.existsSync(manifestPath)) continue;\n const manifest = readJson(manifestPath);\n const pluginName =\n typeof manifest.name === 'string' && manifest.name ? manifest.name : path.basename(plugin.directory);\n if (\n pluginName === '.' ||\n pluginName === '..' ||\n pluginName.toLowerCase() === CORE_PLUGIN_NAME ||\n pluginName.includes('/') ||\n pluginName.includes('\\\\')\n ) {\n throw new Error(`Invalid Antigravity plugin name: ${pluginName}`);\n }\n const target = path.join(targetRoot, pluginName);\n selectedNames.add(pluginName);\n ensureManagedDirectory(target);\n writeJson(path.join(target, PLUGIN_MANIFEST_FILENAME), { name: pluginName });\n const skills = path.join(plugin.directory, SKILLS_DIRECTORY);\n const skillsLink = path.join(target, SKILLS_DIRECTORY);\n if (fs.existsSync(skills)) {\n replaceManagedSkillLink(skillsLink, skills);\n } else if (fs.lstatSync(skillsLink, { throwIfNoEntry: false })?.isSymbolicLink()) {\n fs.rmSync(skillsLink, { force: true });\n }\n }\n\n for (const entry of fs.readdirSync(targetRoot, { withFileTypes: true })) {\n if (entry.name === CORE_PLUGIN_NAME || selectedNames.has(entry.name)) continue;\n const target = path.join(targetRoot, entry.name);\n if (previousNames.has(entry.name)) {\n fs.rmSync(target, { recursive: true, force: true });\n continue;\n }\n if (!entry.isDirectory()) continue;\n // Not in the managed list, but its skills link points into this repository's\n // plugins, so an earlier run created it before the state file existed.\n const skillsLink = path.join(target, SKILLS_DIRECTORY);\n const stat = fs.lstatSync(skillsLink, { throwIfNoEntry: false });\n if (!stat?.isSymbolicLink()) continue;\n const source = path.resolve(path.dirname(skillsLink), fs.readlinkSync(skillsLink));\n if (pathInside(pluginsRoot, source)) fs.rmSync(target, { recursive: true, force: true });\n }\n\n writeJson(managedPath, { ...managed, [MANAGED_PLUGINS_KEY]: [...selectedNames] });\n}\n\nfunction removeManagedCorePlugin(core: string): void {\n if (readJson(path.join(core, PLUGIN_MANIFEST_FILENAME)).name === CORE_PLUGIN_NAME) {\n fs.rmSync(core, { recursive: true, force: true });\n }\n}\n\nfunction syncAntigravitySharedSkills(context: CompatibilityContext): void {\n const core = path.join(context.options.repoRoot, GENERATED_AGENTS_DIRECTORY, PLUGINS_DIRECTORY, CORE_PLUGIN_NAME);\n const coreStat = fs.lstatSync(core, { throwIfNoEntry: false });\n if (coreStat?.isSymbolicLink()) throw new Error(`Refusing to use unmanaged Antigravity path: ${core}`);\n if (!context.sharedSkills) {\n removeManagedCorePlugin(core);\n return;\n }\n\n const source = path.join(context.options.repoRoot, CLAUDE_DIRECTORY, SKILLS_DIRECTORY);\n if (!fs.existsSync(source)) {\n removeManagedCorePlugin(core);\n return;\n }\n ensureManagedDirectory(core);\n const target = path.join(core, SKILLS_DIRECTORY);\n ensureManagedDirectory(target);\n writeJson(path.join(core, PLUGIN_MANIFEST_FILENAME), { name: CORE_PLUGIN_NAME });\n const selected = new Set<string>();\n for (const entry of fs.readdirSync(source, { withFileTypes: true })) {\n if (!entry.isDirectory()) continue;\n selected.add(entry.name);\n replaceManagedSkillLink(path.join(target, entry.name), path.join(source, entry.name));\n }\n for (const entry of fs.readdirSync(target)) {\n if (selected.has(entry)) continue;\n const candidate = path.join(target, entry);\n if (fs.lstatSync(candidate).isSymbolicLink()) fs.rmSync(candidate, { force: true });\n }\n}\n\nfunction syncAntigravityHooks(context: CompatibilityContext): void {\n const source = path.join(context.options.repoRoot, ANTIGRAVITY_LOCAL_DIRECTORY, HOOKS_CONFIG_FILENAME);\n const target = path.join(context.options.repoRoot, AGENTS_DIRECTORY, HOOKS_CONFIG_FILENAME);\n const managedPath = path.join(context.options.repoRoot, AGENTS_DIRECTORY, AGY_MANAGED_STATE);\n const managed = readJson(managedPath);\n if (!fs.existsSync(source)) {\n if (managed.hooks === true) fs.rmSync(target, { force: true });\n writeJson(managedPath, { ...managed, hooks: false });\n return;\n }\n const content = fs.readFileSync(source, 'utf8').replaceAll(REPO_ROOT_PLACEHOLDER, context.options.repoRoot);\n const targetStat = fs.lstatSync(target, { throwIfNoEntry: false });\n if (targetStat && managed.hooks !== true) {\n if (!targetStat.isFile() || fs.readFileSync(target, 'utf8') !== content) {\n throw new Error(`Refusing to replace unmanaged Antigravity path: ${target}`);\n }\n }\n writeFileAtomic(target, content);\n writeJson(managedPath, { ...managed, hooks: true });\n}\n\nexport function antigravityCompatibilityArgs(context: CompatibilityContext): string[] {\n return [SKIP_PERMISSIONS_OPTION, ...additionalDirectoryArgs(context), ...context.options.providerArgs];\n}\n\nexport async function launchAntigravity(context: CompatibilityContext): Promise<number> {\n const home = context.environment.HOME;\n if (!home) throw new Error('HOME is required for Antigravity compatibility');\n // Every step below writes shared state under the user's home directory, so\n // two repositories launching at once have to be serialised.\n const lockPath = path.join(home, GEMINI_DIRECTORY, ANTIGRAVITY_CLI_DIRECTORY, ANTIGRAVITY_SYNC_LOCK);\n const releaseLock = await acquireDirectoryLock(lockPath);\n try {\n syncAntigravityMcp(context);\n syncAntigravityModel(context);\n syncAntigravityPlugins(context);\n syncAntigravitySharedSkills(context);\n syncAntigravityHooks(context);\n } finally {\n await releaseLock();\n }\n return runInteractive(\n ANTIGRAVITY_PROVIDER,\n antigravityCompatibilityArgs(context),\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K,EAAM,EAAkB,EAA2B,qBACvB,CAAC,CACxD,GAAI,CACF,EAAmB,EAAQ,CAC3B,EAAqB,EAAQ,CAC7B,EAAuB,EAAQ,CAC/B,EAA4B,EAAQ,CACpC,EAAqB,EAAQ,QACrB,CACR,MAAM,GAAa,CAErB,OAAO,EACL,MACA,EAA6B,EAAQ,CACrC,EAAQ,QAAQ,SAChB,EAAQ,YACT"}
@@ -0,0 +1,2 @@
1
+ const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`./process.cjs`),n=require(`./shared.cjs`);let r=require(`node:fs`);r=e.__toESM(r,1);let i=require(`node:path`);i=e.__toESM(i,1);let a=require(`node:child_process`);const o=`codex`,s=`--profile`,c=`--profile-v2`,l=/^[A-Za-z0-9_-]+$/,u=[`tools`,`harness`,`sync-codex-state.cjs`];function d(e){return new Set([s,c,`-c`,n.MCP_CONFIG_OPTION,`--enable`,`--disable`,`--remote`,`--remote-auth-token-env`,`-i`,`--image`,`-m`,`--model`,`--local-provider`,`-s`,`--sandbox`,`-C`,`--cd`,n.ADD_DIRECTORY_OPTION,`-a`,`--ask-for-approval`]).has(e)}function f(e){let t=!1,n=``,r=``;for(let i of e){if(t){t=!1;continue}if(d(i)){t=!0;continue}if(!i.startsWith(`-`)){if(!n){n=i;continue}n===`debug`&&!r&&(r=i);break}}return!n||[`exec`,`e`,`review`,`resume`,`fork`].includes(n)?!0:n===`debug`?r===`prompt-input`:![`login`,`logout`,`mcp`,`plugin`,`mcp-server`,`app-server`,`remote-control`,`app`,`completion`,`update`,`doctor`,`sandbox`,`apply`,`a`,`cloud`,`exec-server`,`features`,`archive`,`delete`,`unarchive`,`help`].includes(n)}function p(e){let t=i.default.join(e.options.repoRoot,n.PLUGINS_DIRECTORY);return e.plugins.map(e=>{let n=i.default.relative(t,e.directory);if(!n||n===`..`||n.startsWith(`..${i.default.sep}`)||n.includes(i.default.sep))throw Error(`Codex compatibility requires a direct repository plugin: ${e.directory}`);return n})}function m(e){return n.mcpProxyArguments(n.MCP_PROXY_PACKAGE,e.proxyConfigPath,!0,!0)}function h(e,t,i){let a=[`--yolo`,`--enable`,`hooks`,...n.additionalDirectoryArgs(e)];if(f(e.options.providerArgs)){if(a.push(i,t),e.personaFile){let t=r.default.readFileSync(e.personaFile,`utf8`);a.push(`-c`,`developer_instructions=${JSON.stringify(t)}`)}e.mcpAllowlist&&a.push(`-c`,`mcp_servers.${n.AGIFLOW_PROXY_SERVER_NAME}.args=${JSON.stringify(m(e))}`)}return[...a,...e.options.providerArgs]}function g(e){let t={...e.environment},n=(0,a.spawnSync)(`git`,[`-C`,e.options.repoRoot,`remote`,`get-url`,`origin`],{encoding:`utf8`,env:t});return t.CODEX_REPO_ORIGIN=n.status===0?n.stdout.trim():``,t.CODEX_PROFILE_NAMES=e.options.domains.join(`,`),t.CODEX_PLUGIN_DIRS=p(e).join(`,`),t.CODEX_ENABLE_XCODE_MCP=(0,a.spawnSync)(`xcrun`,[`mcpbridge`,`--help`],{env:t,stdio:`ignore`}).status===0?`1`:`0`,t}async function _(e){let r=g(e),a=i.default.join(e.options.repoRoot,...u),d=t.runCaptured(process.execPath,[a,`owner-key`],e.options.repoRoot,r),f=r.HOME;r.CODEX_LEGACY_HOME=f?i.default.join(f,`.codex`,`agirepo`):void 0,r.CODEX_HOME=f?i.default.join(f,`.codex`,d):i.default.join(e.options.repoRoot,`.codex-local`,`state`,d),t.runChecked(`npx`,[...n.mcpProxyArguments(n.MCP_PROXY_PACKAGE,e.proxyConfigPath,!0),n.MCP_PRESTART_OPTION],e.options.repoRoot,r);let p=t.runCaptured(process.execPath,[a,`sync`],e.options.repoRoot,r),m=JSON.parse(p);if(typeof m.profileConfigName!=`string`||!l.test(m.profileConfigName))throw Error(`Codex sync returned an invalid profile config name`);let _=t.runCaptured(`codex`,[`--help`],e.options.repoRoot,r).includes(c)?c:s;return t.runInteractive(o,h(e,m.profileConfigName,_),e.options.repoRoot,r)}exports.CODEX_PROVIDER=o,exports.codexCompatibilityArgs=h,exports.codexEnvironment=g,exports.codexPluginDirectories=p,exports.launchCodex=_,exports.supportsCodexManagedProfile=f;
2
+ //# sourceMappingURL=codex.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex.cjs","names":["MCP_CONFIG_OPTION","ADD_DIRECTORY_OPTION","path","PLUGINS_DIRECTORY","mcpProxyArguments","MCP_PROXY_PACKAGE","additionalDirectoryArgs","fs","AGIFLOW_PROXY_SERVER_NAME","runCaptured","MCP_PRESTART_OPTION","runInteractive"],"sources":["../../../src/services/compatibility/codex.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport type { JsonObject } from '../../utils/index.ts';\nimport type { CompatibilityContext } from '../compatibilityContext.ts';\nimport { runCaptured, runChecked, runInteractive } from './process.ts';\nimport {\n ADD_DIRECTORY_OPTION,\n AGIFLOW_PROXY_SERVER_NAME,\n MCP_CONFIG_OPTION,\n MCP_PRESTART_OPTION,\n MCP_PROXY_PACKAGE,\n NPX_COMMAND,\n PLUGINS_DIRECTORY,\n additionalDirectoryArgs,\n mcpProxyArguments,\n} from './shared.ts';\n\nexport const CODEX_PROVIDER = 'codex';\n\nconst PROFILE_FLAG = '--profile';\nconst PROFILE_V2_FLAG = '--profile-v2';\nconst PROFILE_CONFIG_NAME_PATTERN = /^[A-Za-z0-9_-]+$/;\nconst SYNC_SCRIPT_RELATIVE_PATH = ['tools', 'harness', 'sync-codex-state.cjs'];\n\n/** Codex options that consume the following argument, so it is not a subcommand. */\nfunction optionRequiresValue(argument: string): boolean {\n return new Set([\n PROFILE_FLAG,\n PROFILE_V2_FLAG,\n '-c',\n MCP_CONFIG_OPTION,\n '--enable',\n '--disable',\n '--remote',\n '--remote-auth-token-env',\n '-i',\n '--image',\n '-m',\n '--model',\n '--local-provider',\n '-s',\n '--sandbox',\n '-C',\n '--cd',\n ADD_DIRECTORY_OPTION,\n '-a',\n '--ask-for-approval',\n ]).has(argument);\n}\n\n/**\n * Whether the managed profile, persona, and proxy config apply to this run.\n *\n * Codex management subcommands reject session options, so injecting them would\n * turn `codex login` into an error.\n */\nexport function supportsCodexManagedProfile(args: string[]): boolean {\n let previousRequiresValue = false;\n let command = '';\n let debugSubcommand = '';\n\n for (const argument of args) {\n if (previousRequiresValue) {\n previousRequiresValue = false;\n continue;\n }\n if (optionRequiresValue(argument)) {\n previousRequiresValue = true;\n continue;\n }\n if (argument.startsWith('-')) continue;\n if (!command) {\n command = argument;\n continue;\n }\n if (command === 'debug' && !debugSubcommand) debugSubcommand = argument;\n break;\n }\n\n if (!command || ['exec', 'e', 'review', 'resume', 'fork'].includes(command)) return true;\n if (command === 'debug') return debugSubcommand === 'prompt-input';\n if (\n [\n 'login',\n 'logout',\n 'mcp',\n 'plugin',\n 'mcp-server',\n 'app-server',\n 'remote-control',\n 'app',\n 'completion',\n 'update',\n 'doctor',\n 'sandbox',\n 'apply',\n 'a',\n 'cloud',\n 'exec-server',\n 'features',\n 'archive',\n 'delete',\n 'unarchive',\n 'help',\n ].includes(command)\n ) {\n return false;\n }\n return true;\n}\n\n/** Plugin directory names relative to `plugins/`, which is all Codex accepts. */\nexport function codexPluginDirectories(context: CompatibilityContext): string[] {\n const pluginsRoot = path.join(context.options.repoRoot, PLUGINS_DIRECTORY);\n return context.plugins.map((plugin) => {\n const relative = path.relative(pluginsRoot, plugin.directory);\n if (!relative || relative === '..' || relative.startsWith(`..${path.sep}`) || relative.includes(path.sep)) {\n throw new Error(`Codex compatibility requires a direct repository plugin: ${plugin.directory}`);\n }\n return relative;\n });\n}\n\nfunction codexProxyArguments(context: CompatibilityContext): string[] {\n return mcpProxyArguments(MCP_PROXY_PACKAGE, context.proxyConfigPath, true, true);\n}\n\nexport function codexCompatibilityArgs(\n context: CompatibilityContext,\n managedProfileName: string,\n managedProfileFlag: string,\n): string[] {\n const args = ['--yolo', '--enable', 'hooks', ...additionalDirectoryArgs(context)];\n if (supportsCodexManagedProfile(context.options.providerArgs)) {\n args.push(managedProfileFlag, managedProfileName);\n if (context.personaFile) {\n const persona = fs.readFileSync(context.personaFile, 'utf8');\n args.push('-c', `developer_instructions=${JSON.stringify(persona)}`);\n }\n if (context.mcpAllowlist) {\n args.push('-c', `mcp_servers.${AGIFLOW_PROXY_SERVER_NAME}.args=${JSON.stringify(codexProxyArguments(context))}`);\n }\n }\n return [...args, ...context.options.providerArgs];\n}\n\nexport function codexEnvironment(context: CompatibilityContext): NodeJS.ProcessEnv {\n const environment = { ...context.environment };\n const originResult = spawnSync('git', ['-C', context.options.repoRoot, 'remote', 'get-url', 'origin'], {\n encoding: 'utf8',\n env: environment,\n });\n environment.CODEX_REPO_ORIGIN = originResult.status === 0 ? originResult.stdout.trim() : '';\n environment.CODEX_PROFILE_NAMES = context.options.domains.join(',');\n environment.CODEX_PLUGIN_DIRS = codexPluginDirectories(context).join(',');\n environment.CODEX_ENABLE_XCODE_MCP =\n spawnSync('xcrun', ['mcpbridge', '--help'], { env: environment, stdio: 'ignore' }).status === 0 ? '1' : '0';\n return environment;\n}\n\nexport async function launchCodex(context: CompatibilityContext): Promise<number> {\n const environment = codexEnvironment(context);\n const syncScript = path.join(context.options.repoRoot, ...SYNC_SCRIPT_RELATIVE_PATH);\n const stateName = runCaptured(process.execPath, [syncScript, 'owner-key'], context.options.repoRoot, environment);\n const home = environment.HOME;\n environment.CODEX_LEGACY_HOME = home ? path.join(home, '.codex', 'agirepo') : undefined;\n environment.CODEX_HOME = home\n ? path.join(home, '.codex', stateName)\n : path.join(context.options.repoRoot, '.codex-local', 'state', stateName);\n\n runChecked(\n NPX_COMMAND,\n [...mcpProxyArguments(MCP_PROXY_PACKAGE, context.proxyConfigPath, true), MCP_PRESTART_OPTION],\n context.options.repoRoot,\n environment,\n );\n\n const syncOutput = runCaptured(process.execPath, [syncScript, 'sync'], context.options.repoRoot, environment);\n const syncResult = JSON.parse(syncOutput) as JsonObject;\n if (\n typeof syncResult.profileConfigName !== 'string' ||\n !PROFILE_CONFIG_NAME_PATTERN.test(syncResult.profileConfigName)\n ) {\n throw new Error('Codex sync returned an invalid profile config name');\n }\n // Older Codex builds only understand --profile, so the flag is probed rather\n // than assumed.\n const help = runCaptured(CODEX_PROVIDER, ['--help'], context.options.repoRoot, environment);\n const profileFlag = help.includes(PROFILE_V2_FLAG) ? PROFILE_V2_FLAG : PROFILE_FLAG;\n return runInteractive(\n CODEX_PROVIDER,\n codexCompatibilityArgs(context, syncResult.profileConfigName, profileFlag),\n context.options.repoRoot,\n environment,\n );\n}\n"],"mappings":"0SAkBA,MAAa,EAAiB,QAExB,EAAe,YACf,EAAkB,eAClB,EAA8B,mBAC9B,EAA4B,CAAC,QAAS,UAAW,uBAAuB,CAG9E,SAAS,EAAoB,EAA2B,CACtD,OAAO,IAAI,IAAI,CACb,EACA,EACA,KACAA,EAAAA,kBACA,WACA,YACA,WACA,0BACA,KACA,UACA,KACA,UACA,mBACA,KACA,YACA,KACA,OACAC,EAAAA,qBACA,KACA,qBACD,CAAC,CAAC,IAAI,EAAS,CASlB,SAAgB,EAA4B,EAAyB,CACnE,IAAI,EAAwB,GACxB,EAAU,GACV,EAAkB,GAEtB,IAAK,IAAM,KAAY,EAAM,CAC3B,GAAI,EAAuB,CACzB,EAAwB,GACxB,SAEF,GAAI,EAAoB,EAAS,CAAE,CACjC,EAAwB,GACxB,SAEE,MAAS,WAAW,IAAI,CAC5B,IAAI,CAAC,EAAS,CACZ,EAAU,EACV,SAEE,IAAY,SAAW,CAAC,IAAiB,EAAkB,GAC/D,OAgCF,MA7BI,CAAC,GAAW,CAAC,OAAQ,IAAK,SAAU,SAAU,OAAO,CAAC,SAAS,EAAQ,CAAS,GAChF,IAAY,QAAgB,IAAoB,eACpD,CACE,CACE,QACA,SACA,MACA,SACA,aACA,aACA,iBACA,MACA,aACA,SACA,SACA,UACA,QACA,IACA,QACA,cACA,WACA,UACA,SACA,YACA,OACD,CAAC,SAAS,EAAQ,CAQvB,SAAgB,EAAuB,EAAyC,CAC9E,IAAM,EAAcC,EAAAA,QAAK,KA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s","names":["MCP_CONFIG_OPTION","ADD_DIRECTORY_OPTION","path","PLUGINS_DIRECTORY","mcpProxyArguments","MCP_PROXY_PACKAGE","additionalDirectoryArgs","fs","AGIFLOW_PROXY_SERVER_NAME","runCaptured","MCP_PRESTART_OPTION","runInteractive"],"sources":["../../../src/adapters/compatibility/codex.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport type { JsonObject } from '../../utils/index.ts';\nimport type { CompatibilityContext } from '../compatibilityContext.ts';\nimport { runCaptured, runChecked, runInteractive } from './process.ts';\nimport {\n ADD_DIRECTORY_OPTION,\n AGIFLOW_PROXY_SERVER_NAME,\n additionalDirectoryArgs,\n MCP_CONFIG_OPTION,\n MCP_PRESTART_OPTION,\n MCP_PROXY_PACKAGE,\n mcpProxyArguments,\n NPX_COMMAND,\n PLUGINS_DIRECTORY,\n} from './shared.ts';\n\nexport const CODEX_PROVIDER = 'codex';\n\nconst PROFILE_FLAG = '--profile';\nconst PROFILE_V2_FLAG = '--profile-v2';\nconst PROFILE_CONFIG_NAME_PATTERN = /^[A-Za-z0-9_-]+$/;\nconst SYNC_SCRIPT_RELATIVE_PATH = ['tools', 'harness', 'sync-codex-state.cjs'];\n\n/** Codex options that consume the following argument, so it is not a subcommand. */\nfunction optionRequiresValue(argument: string): boolean {\n return new Set([\n PROFILE_FLAG,\n PROFILE_V2_FLAG,\n '-c',\n MCP_CONFIG_OPTION,\n '--enable',\n '--disable',\n '--remote',\n '--remote-auth-token-env',\n '-i',\n '--image',\n '-m',\n '--model',\n '--local-provider',\n '-s',\n '--sandbox',\n '-C',\n '--cd',\n ADD_DIRECTORY_OPTION,\n '-a',\n '--ask-for-approval',\n ]).has(argument);\n}\n\n/**\n * Whether the managed profile, persona, and proxy config apply to this run.\n *\n * Codex management subcommands reject session options, so injecting them would\n * turn `codex login` into an error.\n */\nexport function supportsCodexManagedProfile(args: string[]): boolean {\n let previousRequiresValue = false;\n let command = '';\n let debugSubcommand = '';\n\n for (const argument of args) {\n if (previousRequiresValue) {\n previousRequiresValue = false;\n continue;\n }\n if (optionRequiresValue(argument)) {\n previousRequiresValue = true;\n continue;\n }\n if (argument.startsWith('-')) continue;\n if (!command) {\n command = argument;\n continue;\n }\n if (command === 'debug' && !debugSubcommand) debugSubcommand = argument;\n break;\n }\n\n if (!command || ['exec', 'e', 'review', 'resume', 'fork'].includes(command)) return true;\n if (command === 'debug') return debugSubcommand === 'prompt-input';\n if (\n [\n 'login',\n 'logout',\n 'mcp',\n 'plugin',\n 'mcp-server',\n 'app-server',\n 'remote-control',\n 'app',\n 'completion',\n 'update',\n 'doctor',\n 'sandbox',\n 'apply',\n 'a',\n 'cloud',\n 'exec-server',\n 'features',\n 'archive',\n 'delete',\n 'unarchive',\n 'help',\n ].includes(command)\n ) {\n return false;\n }\n return true;\n}\n\n/** Plugin directory names relative to `plugins/`, which is all Codex accepts. */\nexport function codexPluginDirectories(context: CompatibilityContext): string[] {\n const pluginsRoot = path.join(context.options.repoRoot, PLUGINS_DIRECTORY);\n return context.plugins.map((plugin) => {\n const relative = path.relative(pluginsRoot, plugin.directory);\n if (!relative || relative === '..' || relative.startsWith(`..${path.sep}`) || relative.includes(path.sep)) {\n throw new Error(`Codex compatibility requires a direct repository plugin: ${plugin.directory}`);\n }\n return relative;\n });\n}\n\nfunction codexProxyArguments(context: CompatibilityContext): string[] {\n return mcpProxyArguments(MCP_PROXY_PACKAGE, context.proxyConfigPath, true, true);\n}\n\nexport function codexCompatibilityArgs(\n context: CompatibilityContext,\n managedProfileName: string,\n managedProfileFlag: string,\n): string[] {\n const args = ['--yolo', '--enable', 'hooks', ...additionalDirectoryArgs(context)];\n if (supportsCodexManagedProfile(context.options.providerArgs)) {\n args.push(managedProfileFlag, managedProfileName);\n if (context.personaFile) {\n const persona = fs.readFileSync(context.personaFile, 'utf8');\n args.push('-c', `developer_instructions=${JSON.stringify(persona)}`);\n }\n if (context.mcpAllowlist) {\n args.push('-c', `mcp_servers.${AGIFLOW_PROXY_SERVER_NAME}.args=${JSON.stringify(codexProxyArguments(context))}`);\n }\n }\n return [...args, ...context.options.providerArgs];\n}\n\nexport function codexEnvironment(context: CompatibilityContext): NodeJS.ProcessEnv {\n const environment = { ...context.environment };\n const originResult = spawnSync('git', ['-C', context.options.repoRoot, 'remote', 'get-url', 'origin'], {\n encoding: 'utf8',\n env: environment,\n });\n environment.CODEX_REPO_ORIGIN = originResult.status === 0 ? originResult.stdout.trim() : '';\n environment.CODEX_PROFILE_NAMES = context.options.domains.join(',');\n environment.CODEX_PLUGIN_DIRS = codexPluginDirectories(context).join(',');\n environment.CODEX_ENABLE_XCODE_MCP =\n spawnSync('xcrun', ['mcpbridge', '--help'], { env: environment, stdio: 'ignore' }).status === 0 ? '1' : '0';\n return environment;\n}\n\nexport async function launchCodex(context: CompatibilityContext): Promise<number> {\n const environment = codexEnvironment(context);\n const syncScript = path.join(context.options.repoRoot, ...SYNC_SCRIPT_RELATIVE_PATH);\n const stateName = runCaptured(process.execPath, [syncScript, 'owner-key'], context.options.repoRoot, environment);\n const home = environment.HOME;\n environment.CODEX_LEGACY_HOME = home ? path.join(home, '.codex', 'agirepo') : undefined;\n environment.CODEX_HOME = home\n ? path.join(home, '.codex', stateName)\n : path.join(context.options.repoRoot, '.codex-local', 'state', stateName);\n\n runChecked(\n NPX_COMMAND,\n [...mcpProxyArguments(MCP_PROXY_PACKAGE, context.proxyConfigPath, true), MCP_PRESTART_OPTION],\n context.options.repoRoot,\n environment,\n );\n\n const syncOutput = runCaptured(process.execPath, [syncScript, 'sync'], context.options.repoRoot, environment);\n const syncResult = JSON.parse(syncOutput) as JsonObject;\n if (\n typeof syncResult.profileConfigName !== 'string' ||\n !PROFILE_CONFIG_NAME_PATTERN.test(syncResult.profileConfigName)\n ) {\n throw new Error('Codex sync returned an invalid profile config name');\n }\n // Older Codex builds only understand --profile, so the flag is probed rather\n // than assumed.\n const help = runCaptured(CODEX_PROVIDER, ['--help'], context.options.repoRoot, environment);\n const profileFlag = help.includes(PROFILE_V2_FLAG) ? PROFILE_V2_FLAG : PROFILE_FLAG;\n return runInteractive(\n CODEX_PROVIDER,\n codexCompatibilityArgs(context, syncResult.profileConfigName, profileFlag),\n context.options.repoRoot,\n environment,\n );\n}\n"],"mappings":"uOAkBA,MAAa,EAAiB,QAExB,EAAe,YACf,EAAkB,eAClB,EAA8B,mBAC9B,EAA4B,CAAC,QAAS,UAAW,uBAAuB,CAG9E,SAAS,EAAoB,EAA2B,CACtD,OAAO,IAAI,IAAI,CACb,EACA,EACA,KACAA,EAAAA,kBACA,WACA,YACA,WACA,0BACA,KACA,UACA,KACA,UACA,mBACA,KACA,YACA,KACA,OACAC,EAAAA,qBACA,KACA,qBACD,CAAC,CAAC,IAAI,EAAS,CASlB,SAAgB,EAA4B,EAAyB,CACnE,IAAI,EAAwB,GACxB,EAAU,GACV,EAAkB,GAEtB,IAAK,IAAM,KAAY,EAAM,CAC3B,GAAI,EAAuB,CACzB,EAAwB,GACxB,SAEF,GAAI,EAAoB,EAAS,CAAE,CACjC,EAAwB,GACxB,SAEE,MAAS,WAAW,IAAI,CAC5B,IAAI,CAAC,EAAS,CACZ,EAAU,EACV,SAEE,IAAY,SAAW,CAAC,IAAiB,EAAkB,GAC/D,OAgCF,MA7BI,CAAC,GAAW,CAAC,OAAQ,IAAK,SAAU,SAAU,OAAO,CAAC,SAAS,EAAQ,CAAS,GAChF,IAAY,QAAgB,IAAoB,eACpD,CACE,CACE,QACA,SACA,MACA,SACA,aACA,aACA,iBACA,MACA,aACA,SACA,SACA,UACA,QACA,IACA,QACA,cACA,WACA,UACA,SACA,YACA,OACD,CAAC,SAAS,EAAQ,CAQvB,SAAgB,EAAuB,EAAyC,CAC9E,IAAM,EAAcC,EAAAA,QAAK,KAAK,EAAQ,QAAQ,SAAUC,EAAAA,kBAAkB,CAC1E,OAAO,EAAQ,QAAQ,IAAK,GAAW,CACrC,IAAM,EAAWD,EAAAA,QAAK,SAAS,EAAa,EAAO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