@lesliechan721/aw 0.1.0-beta.6 → 0.1.0-beta.60

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 (621) hide show
  1. package/dist/authoring/assets/aw-config.mjs +100 -501
  2. package/dist/authoring/assets/aw-config.mjs.map +1 -1
  3. package/dist/authoring/assets/aw-runtime-config.d.mts +13 -0
  4. package/dist/authoring/assets/aw-runtime-config.mjs +199 -0
  5. package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -0
  6. package/dist/authoring/scripts/add-skill.mjs +4 -4
  7. package/dist/authoring/scripts/add-skill.mjs.map +1 -1
  8. package/dist/authoring/scripts/init-plugin.mjs +67 -97
  9. package/dist/authoring/scripts/init-plugin.mjs.map +1 -1
  10. package/dist/authoring/scripts/lib/plugin-root.mjs +4 -4
  11. package/dist/authoring/scripts/lib/plugin-root.mjs.map +1 -1
  12. package/dist/authoring/scripts/lib/plugin-version-check.d.mts +1 -0
  13. package/dist/authoring/scripts/lib/plugin-version-check.mjs +229 -8
  14. package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -1
  15. package/dist/authoring/scripts/lib/skill-scaffold.d.mts +77 -92
  16. package/dist/authoring/scripts/lib/skill-scaffold.mjs +99 -124
  17. package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -1
  18. package/dist/authoring/scripts/plugin-status.mjs +8 -11
  19. package/dist/authoring/scripts/plugin-status.mjs.map +1 -1
  20. package/dist/authoring/scripts/remove-plugin.mjs +3 -2
  21. package/dist/authoring/scripts/remove-plugin.mjs.map +1 -1
  22. package/dist/authoring/scripts/validate-plugin.mjs +552 -1142
  23. package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
  24. package/dist/native-runtime/reader-runtime.mjs +34 -0
  25. package/dist/native-runtime/reader.d.mts +6 -0
  26. package/dist/native-runtime/reader.mjs +11 -0
  27. package/dist/scripts/aw-skill-eval-materializer.d.ts +26 -0
  28. package/dist/scripts/aw-skill-eval-materializer.js +306 -0
  29. package/dist/scripts/aw-skill-eval-materializer.js.map +1 -0
  30. package/dist/scripts/bundle-plugins.d.ts +1 -0
  31. package/dist/scripts/bundle-plugins.js +19 -8
  32. package/dist/scripts/bundle-plugins.js.map +1 -1
  33. package/dist/scripts/plugin-staging.d.ts +7 -9
  34. package/dist/scripts/plugin-staging.js +18 -29
  35. package/dist/scripts/plugin-staging.js.map +1 -1
  36. package/dist/scripts/plugin-test-reporter.d.mts +2 -0
  37. package/dist/scripts/plugin-test-reporter.mjs +21 -0
  38. package/dist/scripts/plugin-test-reporter.mjs.map +1 -0
  39. package/dist/scripts/test-plugin-scripts.d.ts +5 -0
  40. package/dist/scripts/test-plugin-scripts.js +208 -89
  41. package/dist/scripts/test-plugin-scripts.js.map +1 -1
  42. package/dist/scripts/test-workers.d.mts +24 -0
  43. package/dist/scripts/test-workers.mjs +59 -0
  44. package/dist/scripts/test-workers.mjs.map +1 -0
  45. package/dist/src/adapters/helpers.d.ts +7 -0
  46. package/dist/src/adapters/helpers.js +2 -2
  47. package/dist/src/adapters/helpers.js.map +1 -1
  48. package/dist/src/authoring/workspace-commands.d.ts +19 -1
  49. package/dist/src/authoring/workspace-commands.js +24 -5
  50. package/dist/src/authoring/workspace-commands.js.map +1 -1
  51. package/dist/src/commands/aw-capabilities.d.ts +78 -0
  52. package/dist/src/commands/aw-capabilities.js +266 -0
  53. package/dist/src/commands/aw-capabilities.js.map +1 -0
  54. package/dist/src/commands/catalog-dev-source.d.ts +154 -0
  55. package/dist/src/commands/catalog-dev-source.js +655 -0
  56. package/dist/src/commands/catalog-dev-source.js.map +1 -0
  57. package/dist/src/commands/catalog-generation.d.ts +21 -0
  58. package/dist/src/commands/catalog-generation.js +9 -0
  59. package/dist/src/commands/catalog-generation.js.map +1 -0
  60. package/dist/src/commands/catalog-publication-inspection.d.ts +71 -30
  61. package/dist/src/commands/catalog-publication-inspection.js +475 -63
  62. package/dist/src/commands/catalog-publication-inspection.js.map +1 -1
  63. package/dist/src/commands/catalog-publication-journal.d.ts +68 -0
  64. package/dist/src/commands/catalog-publication-journal.js +292 -0
  65. package/dist/src/commands/catalog-publication-journal.js.map +1 -0
  66. package/dist/src/commands/catalog-publication-target.d.ts +18 -0
  67. package/dist/src/commands/catalog-publication-target.js +95 -0
  68. package/dist/src/commands/catalog-publication-target.js.map +1 -0
  69. package/dist/src/commands/catalog-publish.d.ts +73 -15
  70. package/dist/src/commands/catalog-publish.js +701 -212
  71. package/dist/src/commands/catalog-publish.js.map +1 -1
  72. package/dist/src/commands/catalog-source.d.ts +60 -22
  73. package/dist/src/commands/catalog-source.js +311 -91
  74. package/dist/src/commands/catalog-source.js.map +1 -1
  75. package/dist/src/commands/catalog-status.d.ts +18 -22
  76. package/dist/src/commands/catalog-status.js +81 -115
  77. package/dist/src/commands/catalog-status.js.map +1 -1
  78. package/dist/src/commands/catalog-store.d.ts +104 -0
  79. package/dist/src/commands/catalog-store.js +685 -0
  80. package/dist/src/commands/catalog-store.js.map +1 -0
  81. package/dist/src/commands/catalog-workspace-resolution.d.ts +13 -0
  82. package/dist/src/commands/catalog-workspace-resolution.js +42 -0
  83. package/dist/src/commands/catalog-workspace-resolution.js.map +1 -0
  84. package/dist/src/commands/console.js +28 -17
  85. package/dist/src/commands/console.js.map +1 -1
  86. package/dist/src/commands/dependency-operation-plan.d.ts +52 -15
  87. package/dist/src/commands/dependency-operation-plan.js +289 -7
  88. package/dist/src/commands/dependency-operation-plan.js.map +1 -1
  89. package/dist/src/commands/init.d.ts +5 -11
  90. package/dist/src/commands/init.js +30 -51
  91. package/dist/src/commands/init.js.map +1 -1
  92. package/dist/src/commands/managed-commands.d.ts +28 -0
  93. package/dist/src/commands/managed-commands.js +315 -0
  94. package/dist/src/commands/managed-commands.js.map +1 -0
  95. package/dist/src/commands/offline-cleanup-evidence.d.ts +67 -0
  96. package/dist/src/commands/offline-cleanup-evidence.js +181 -0
  97. package/dist/src/commands/offline-cleanup-evidence.js.map +1 -0
  98. package/dist/src/commands/operation-plan.d.ts +182 -0
  99. package/dist/src/commands/operation-plan.js +71 -0
  100. package/dist/src/commands/operation-plan.js.map +1 -0
  101. package/dist/src/commands/operation-planner.d.ts +47 -0
  102. package/dist/src/commands/operation-planner.js +142 -0
  103. package/dist/src/commands/operation-planner.js.map +1 -0
  104. package/dist/src/commands/options.d.ts +9 -7
  105. package/dist/src/commands/options.js +83 -21
  106. package/dist/src/commands/options.js.map +1 -1
  107. package/dist/src/commands/plugin-capabilities.js +65 -4
  108. package/dist/src/commands/plugin-capabilities.js.map +1 -1
  109. package/dist/src/commands/rebuild-command.d.ts +78 -31
  110. package/dist/src/commands/rebuild-command.js +5229 -942
  111. package/dist/src/commands/rebuild-command.js.map +1 -1
  112. package/dist/src/commands/rebuild-integration.d.ts +143 -21
  113. package/dist/src/commands/rebuild-integration.js +3384 -1342
  114. package/dist/src/commands/rebuild-integration.js.map +1 -1
  115. package/dist/src/commands/rebuild-operations.d.ts +60 -30
  116. package/dist/src/commands/rebuild-operations.js +267 -320
  117. package/dist/src/commands/rebuild-operations.js.map +1 -1
  118. package/dist/src/commands/reconcile-operation-plan.d.ts +28 -0
  119. package/dist/src/commands/reconcile-operation-plan.js +47 -0
  120. package/dist/src/commands/reconcile-operation-plan.js.map +1 -0
  121. package/dist/src/commands/review-inspection.d.ts +60 -0
  122. package/dist/src/commands/review-inspection.js +422 -0
  123. package/dist/src/commands/review-inspection.js.map +1 -0
  124. package/dist/src/commands/review-preparation.d.ts +49 -0
  125. package/dist/src/commands/review-preparation.js +427 -0
  126. package/dist/src/commands/review-preparation.js.map +1 -0
  127. package/dist/src/commands/runtime.d.ts +1 -5
  128. package/dist/src/commands/runtime.js +27 -53
  129. package/dist/src/commands/runtime.js.map +1 -1
  130. package/dist/src/commands/skill-eval.d.ts +39 -0
  131. package/dist/src/commands/skill-eval.js +400 -0
  132. package/dist/src/commands/skill-eval.js.map +1 -0
  133. package/dist/src/commands/status-v6.d.ts +279 -0
  134. package/dist/src/commands/status-v6.js +2785 -0
  135. package/dist/src/commands/status-v6.js.map +1 -0
  136. package/dist/src/commands/sync-command.d.ts +40 -0
  137. package/dist/src/commands/sync-command.js +254 -0
  138. package/dist/src/commands/sync-command.js.map +1 -0
  139. package/dist/src/commands/wizard.d.ts +8 -5
  140. package/dist/src/commands/wizard.js +6 -4
  141. package/dist/src/commands/wizard.js.map +1 -1
  142. package/dist/src/commands/write-commands.d.ts +9 -3
  143. package/dist/src/commands/write-commands.js +136 -31
  144. package/dist/src/commands/write-commands.js.map +1 -1
  145. package/dist/src/constants.d.ts +7 -2
  146. package/dist/src/constants.js +7 -2
  147. package/dist/src/constants.js.map +1 -1
  148. package/dist/src/eval/manifest-v1.d.ts +68 -0
  149. package/dist/src/eval/manifest-v1.js +353 -0
  150. package/dist/src/eval/manifest-v1.js.map +1 -0
  151. package/dist/src/generators/local-plugin.d.ts +5 -1
  152. package/dist/src/generators/local-plugin.js +261 -109
  153. package/dist/src/generators/local-plugin.js.map +1 -1
  154. package/dist/src/generators/permissions.d.ts +5 -2
  155. package/dist/src/generators/permissions.js +28 -15
  156. package/dist/src/generators/permissions.js.map +1 -1
  157. package/dist/src/index.d.ts +10 -4
  158. package/dist/src/index.js +1774 -609
  159. package/dist/src/index.js.map +1 -1
  160. package/dist/src/output/command-receipt.d.ts +47 -46
  161. package/dist/src/output/command-receipt.js +277 -79
  162. package/dist/src/output/command-receipt.js.map +1 -1
  163. package/dist/src/output/model.d.ts +3 -44
  164. package/dist/src/output/model.js +1 -144
  165. package/dist/src/output/model.js.map +1 -1
  166. package/dist/src/output/rebuild-progress.js +15 -13
  167. package/dist/src/output/rebuild-progress.js.map +1 -1
  168. package/dist/src/portable/commands.d.ts +46 -7
  169. package/dist/src/portable/commands.js +349 -37
  170. package/dist/src/portable/commands.js.map +1 -1
  171. package/dist/src/portable/materializer.d.ts +17 -4
  172. package/dist/src/portable/materializer.js +186 -41
  173. package/dist/src/portable/materializer.js.map +1 -1
  174. package/dist/src/portable/skills-cli.d.ts +15 -7
  175. package/dist/src/portable/skills-cli.js +74 -20
  176. package/dist/src/portable/skills-cli.js.map +1 -1
  177. package/dist/src/review/eval-source-input.d.ts +43 -0
  178. package/dist/src/review/eval-source-input.js +207 -0
  179. package/dist/src/review/eval-source-input.js.map +1 -0
  180. package/dist/src/review/review-profile.d.ts +17 -0
  181. package/dist/src/review/review-profile.js +234 -0
  182. package/dist/src/review/review-profile.js.map +1 -0
  183. package/dist/src/review/review-selection.d.ts +30 -0
  184. package/dist/src/review/review-selection.js +527 -0
  185. package/dist/src/review/review-selection.js.map +1 -0
  186. package/dist/src/review/review-types.d.ts +68 -0
  187. package/dist/src/review/review-types.js +16 -0
  188. package/dist/src/review/review-types.js.map +1 -0
  189. package/dist/src/review/skill-materialization.d.ts +26 -0
  190. package/dist/src/review/skill-materialization.js +217 -0
  191. package/dist/src/review/skill-materialization.js.map +1 -0
  192. package/dist/src/review/source-binding.d.ts +183 -0
  193. package/dist/src/review/source-binding.js +708 -0
  194. package/dist/src/review/source-binding.js.map +1 -0
  195. package/dist/src/tui/catalog-freshness.d.ts +1 -0
  196. package/dist/src/tui/catalog-freshness.js +2 -0
  197. package/dist/src/tui/catalog-freshness.js.map +1 -0
  198. package/dist/src/tui/catalog-generation.d.ts +21 -0
  199. package/dist/src/tui/catalog-generation.js +156 -0
  200. package/dist/src/tui/catalog-generation.js.map +1 -0
  201. package/dist/src/tui/catalog-sources/projection.d.ts +4 -0
  202. package/dist/src/tui/catalog-sources/projection.js +17 -0
  203. package/dist/src/tui/catalog-sources/projection.js.map +1 -0
  204. package/dist/src/tui/catalog-sources/review.d.ts +3 -0
  205. package/dist/src/tui/catalog-sources/review.js +13 -0
  206. package/dist/src/tui/catalog-sources/review.js.map +1 -0
  207. package/dist/src/tui/catalog-sources/screens.d.ts +12 -0
  208. package/dist/src/tui/catalog-sources/screens.js +40 -0
  209. package/dist/src/tui/catalog-sources/screens.js.map +1 -0
  210. package/dist/src/tui/catalog-sources/session.d.ts +32 -0
  211. package/dist/src/tui/catalog-sources/session.js +300 -0
  212. package/dist/src/tui/catalog-sources/session.js.map +1 -0
  213. package/dist/src/tui/catalog-sources/types.d.ts +54 -0
  214. package/dist/src/tui/catalog-sources/types.js +2 -0
  215. package/dist/src/tui/catalog-sources/types.js.map +1 -0
  216. package/dist/src/tui/catalog-store-task.d.ts +16 -0
  217. package/dist/src/tui/catalog-store-task.js +19 -0
  218. package/dist/src/tui/catalog-store-task.js.map +1 -0
  219. package/dist/src/tui/clipboard.d.ts +13 -0
  220. package/dist/src/tui/clipboard.js +95 -0
  221. package/dist/src/tui/clipboard.js.map +1 -0
  222. package/dist/src/tui/components.d.ts +110 -3
  223. package/dist/src/tui/components.js +183 -36
  224. package/dist/src/tui/components.js.map +1 -1
  225. package/dist/src/tui/config-array-draft.d.ts +29 -0
  226. package/dist/src/tui/config-array-draft.js +48 -0
  227. package/dist/src/tui/config-array-draft.js.map +1 -0
  228. package/dist/src/tui/config-leaf-editor.d.ts +19 -0
  229. package/dist/src/tui/config-leaf-editor.js +212 -0
  230. package/dist/src/tui/config-leaf-editor.js.map +1 -0
  231. package/dist/src/tui/config-references.d.ts +34 -0
  232. package/dist/src/tui/config-references.js +70 -0
  233. package/dist/src/tui/config-references.js.map +1 -0
  234. package/dist/src/tui/config-value-presentation.d.ts +20 -0
  235. package/dist/src/tui/config-value-presentation.js +104 -0
  236. package/dist/src/tui/config-value-presentation.js.map +1 -0
  237. package/dist/src/tui/console-app-v4.d.ts +14 -4
  238. package/dist/src/tui/console-app-v4.js +9205 -1951
  239. package/dist/src/tui/console-app-v4.js.map +1 -1
  240. package/dist/src/tui/content-item-card.d.ts +13 -0
  241. package/dist/src/tui/content-item-card.js +51 -0
  242. package/dist/src/tui/content-item-card.js.map +1 -0
  243. package/dist/src/tui/controller-runtime.d.ts +10 -2
  244. package/dist/src/tui/controller-runtime.js +3289 -388
  245. package/dist/src/tui/controller-runtime.js.map +1 -1
  246. package/dist/src/tui/controller.d.ts +622 -45
  247. package/dist/src/tui/controller.js +3589 -768
  248. package/dist/src/tui/controller.js.map +1 -1
  249. package/dist/src/tui/dependency-graph-view.d.ts +39 -0
  250. package/dist/src/tui/dependency-graph-view.js +121 -0
  251. package/dist/src/tui/dependency-graph-view.js.map +1 -0
  252. package/dist/src/tui/dependency-graph.d.ts +81 -0
  253. package/dist/src/tui/dependency-graph.js +452 -0
  254. package/dist/src/tui/dependency-graph.js.map +1 -0
  255. package/dist/src/tui/diagnostic-projection.d.ts +23 -0
  256. package/dist/src/tui/diagnostic-projection.js +595 -0
  257. package/dist/src/tui/diagnostic-projection.js.map +1 -0
  258. package/dist/src/tui/diagnostics.d.ts +3 -3
  259. package/dist/src/tui/diagnostics.js +14 -2
  260. package/dist/src/tui/diagnostics.js.map +1 -1
  261. package/dist/src/tui/entity-cards.d.ts +55 -0
  262. package/dist/src/tui/entity-cards.js +220 -0
  263. package/dist/src/tui/entity-cards.js.map +1 -0
  264. package/dist/src/tui/glossary.d.ts +23 -0
  265. package/dist/src/tui/glossary.js +42 -0
  266. package/dist/src/tui/glossary.js.map +1 -0
  267. package/dist/src/tui/index.d.ts +6 -1
  268. package/dist/src/tui/index.js +5 -1
  269. package/dist/src/tui/index.js.map +1 -1
  270. package/dist/src/tui/input-display.d.ts +9 -0
  271. package/dist/src/tui/input-display.js +58 -0
  272. package/dist/src/tui/input-display.js.map +1 -0
  273. package/dist/src/tui/keys.d.ts +44 -0
  274. package/dist/src/tui/keys.js +43 -15
  275. package/dist/src/tui/keys.js.map +1 -1
  276. package/dist/src/tui/lifecycle-action-view.d.ts +6 -0
  277. package/dist/src/tui/lifecycle-action-view.js +36 -0
  278. package/dist/src/tui/lifecycle-action-view.js.map +1 -0
  279. package/dist/src/tui/model.d.ts +224 -31
  280. package/dist/src/tui/model.js +1510 -397
  281. package/dist/src/tui/model.js.map +1 -1
  282. package/dist/src/tui/operation-diagnostic-screens.d.ts +8 -0
  283. package/dist/src/tui/operation-diagnostic-screens.js +71 -0
  284. package/dist/src/tui/operation-diagnostic-screens.js.map +1 -0
  285. package/dist/src/tui/operation-history.d.ts +81 -0
  286. package/dist/src/tui/operation-history.js +136 -0
  287. package/dist/src/tui/operation-history.js.map +1 -0
  288. package/dist/src/tui/operation-review-planner.d.ts +21 -0
  289. package/dist/src/tui/operation-review-planner.js +1392 -0
  290. package/dist/src/tui/operation-review-planner.js.map +1 -0
  291. package/dist/src/tui/plugin-content.d.ts +31 -0
  292. package/dist/src/tui/plugin-content.js +680 -0
  293. package/dist/src/tui/plugin-content.js.map +1 -0
  294. package/dist/src/tui/plugin-detail.d.ts +52 -0
  295. package/dist/src/tui/plugin-detail.js +165 -0
  296. package/dist/src/tui/plugin-detail.js.map +1 -0
  297. package/dist/src/tui/plugin-write-task.d.ts +69 -0
  298. package/dist/src/tui/plugin-write-task.js +286 -0
  299. package/dist/src/tui/plugin-write-task.js.map +1 -0
  300. package/dist/src/tui/project-inventory.d.ts +68 -0
  301. package/dist/src/tui/project-inventory.js +203 -0
  302. package/dist/src/tui/project-inventory.js.map +1 -0
  303. package/dist/src/tui/prompt.js +4 -15
  304. package/dist/src/tui/prompt.js.map +1 -1
  305. package/dist/src/tui/query-header.d.ts +30 -0
  306. package/dist/src/tui/query-header.js +40 -0
  307. package/dist/src/tui/query-header.js.map +1 -0
  308. package/dist/src/tui/reader.d.ts +37 -0
  309. package/dist/src/tui/reader.js +47 -0
  310. package/dist/src/tui/reader.js.map +1 -0
  311. package/dist/src/tui/router.d.ts +197 -10
  312. package/dist/src/tui/router.js +338 -50
  313. package/dist/src/tui/router.js.map +1 -1
  314. package/dist/src/tui/screen-registry.d.ts +701 -0
  315. package/dist/src/tui/screen-registry.js +230 -0
  316. package/dist/src/tui/screen-registry.js.map +1 -0
  317. package/dist/src/tui/session-console-app.d.ts +6 -0
  318. package/dist/src/tui/session-console-app.js +13 -0
  319. package/dist/src/tui/session-console-app.js.map +1 -0
  320. package/dist/src/tui/session-host.d.ts +45 -0
  321. package/dist/src/tui/session-host.js +209 -0
  322. package/dist/src/tui/session-host.js.map +1 -0
  323. package/dist/src/tui/source-detail-card.d.ts +29 -0
  324. package/dist/src/tui/source-detail-card.js +45 -0
  325. package/dist/src/tui/source-detail-card.js.map +1 -0
  326. package/dist/src/tui/source-ref-presets.d.ts +3 -0
  327. package/dist/src/tui/source-ref-presets.js +11 -0
  328. package/dist/src/tui/source-ref-presets.js.map +1 -0
  329. package/dist/src/tui/theme.d.ts +12 -0
  330. package/dist/src/tui/theme.js +12 -0
  331. package/dist/src/tui/theme.js.map +1 -1
  332. package/dist/src/tui/viewport.d.ts +1 -0
  333. package/dist/src/tui/viewport.js +23 -0
  334. package/dist/src/tui/viewport.js.map +1 -1
  335. package/dist/src/tui/views.js +31 -3
  336. package/dist/src/tui/views.js.map +1 -1
  337. package/dist/src/tui/wizard.js +37 -13
  338. package/dist/src/tui/wizard.js.map +1 -1
  339. package/dist/src/types.d.ts +264 -21
  340. package/dist/src/types.js +1 -0
  341. package/dist/src/types.js.map +1 -1
  342. package/dist/src/utils/agent-version.d.ts +7 -1
  343. package/dist/src/utils/agent-version.js +36 -7
  344. package/dist/src/utils/agent-version.js.map +1 -1
  345. package/dist/src/utils/artifact-plan.d.ts +8 -6
  346. package/dist/src/utils/artifact-plan.js +67 -13
  347. package/dist/src/utils/artifact-plan.js.map +1 -1
  348. package/dist/src/utils/artifact-renderer.d.ts +24 -10
  349. package/dist/src/utils/artifact-renderer.js +230 -220
  350. package/dist/src/utils/artifact-renderer.js.map +1 -1
  351. package/dist/src/utils/artifact-request.d.ts +32 -0
  352. package/dist/src/utils/artifact-request.js +90 -0
  353. package/dist/src/utils/artifact-request.js.map +1 -0
  354. package/dist/src/utils/artifact-sources.d.ts +4 -0
  355. package/dist/src/utils/artifact-sources.js +17 -0
  356. package/dist/src/utils/artifact-sources.js.map +1 -1
  357. package/dist/src/utils/aw-home-mutation-lock.d.ts +1 -0
  358. package/dist/src/utils/aw-home-mutation-lock.js +32 -4
  359. package/dist/src/utils/aw-home-mutation-lock.js.map +1 -1
  360. package/dist/src/utils/bundle-integrity.d.ts +0 -1
  361. package/dist/src/utils/bundle-integrity.js +0 -25
  362. package/dist/src/utils/bundle-integrity.js.map +1 -1
  363. package/dist/src/utils/bundle-layout.js +29 -29
  364. package/dist/src/utils/bundle-layout.js.map +1 -1
  365. package/dist/src/utils/catalog-capability-projection.d.ts +8 -0
  366. package/dist/src/utils/catalog-capability-projection.js +14 -0
  367. package/dist/src/utils/catalog-capability-projection.js.map +1 -0
  368. package/dist/src/utils/catalog-digests.d.ts +10 -0
  369. package/dist/src/utils/catalog-digests.js +57 -20
  370. package/dist/src/utils/catalog-digests.js.map +1 -1
  371. package/dist/src/utils/catalog-generation-control-snapshot.d.ts +11 -0
  372. package/dist/src/utils/catalog-generation-control-snapshot.js +45 -0
  373. package/dist/src/utils/catalog-generation-control-snapshot.js.map +1 -0
  374. package/dist/src/utils/catalog-generation-error.d.ts +16 -0
  375. package/dist/src/utils/catalog-generation-error.js +30 -0
  376. package/dist/src/utils/catalog-generation-error.js.map +1 -0
  377. package/dist/src/utils/catalog-generation-resolver.d.ts +44 -0
  378. package/dist/src/utils/catalog-generation-resolver.js +273 -0
  379. package/dist/src/utils/catalog-generation-resolver.js.map +1 -0
  380. package/dist/src/utils/catalog-generation-service.d.ts +172 -0
  381. package/dist/src/utils/catalog-generation-service.js +1271 -0
  382. package/dist/src/utils/catalog-generation-service.js.map +1 -0
  383. package/dist/src/utils/catalog-generation-state.d.ts +22 -0
  384. package/dist/src/utils/catalog-generation-state.js +192 -0
  385. package/dist/src/utils/catalog-generation-state.js.map +1 -0
  386. package/dist/src/utils/catalog-generation-store.d.ts +58 -0
  387. package/dist/src/utils/catalog-generation-store.js +452 -0
  388. package/dist/src/utils/catalog-generation-store.js.map +1 -0
  389. package/dist/src/utils/catalog-manifest-v7.d.ts +5 -0
  390. package/dist/src/utils/{catalog-manifest-v4.js → catalog-manifest-v7.js} +35 -43
  391. package/dist/src/utils/catalog-manifest-v7.js.map +1 -0
  392. package/dist/src/utils/catalog-operation-context.d.ts +20 -0
  393. package/dist/src/utils/catalog-operation-context.js +142 -0
  394. package/dist/src/utils/catalog-operation-context.js.map +1 -0
  395. package/dist/src/utils/catalog-public-error.d.ts +7 -3
  396. package/dist/src/utils/catalog-public-error.js +28 -8
  397. package/dist/src/utils/catalog-public-error.js.map +1 -1
  398. package/dist/src/utils/catalog-runtime-projection.d.ts +3 -0
  399. package/dist/src/utils/catalog-runtime-projection.js +5 -40
  400. package/dist/src/utils/catalog-runtime-projection.js.map +1 -1
  401. package/dist/src/utils/catalog-snapshot.d.ts +5 -3
  402. package/dist/src/utils/catalog-snapshot.js +11 -3
  403. package/dist/src/utils/catalog-snapshot.js.map +1 -1
  404. package/dist/src/utils/catalog-source-identity.d.ts +1 -0
  405. package/dist/src/utils/catalog-source-identity.js +21 -2
  406. package/dist/src/utils/catalog-source-identity.js.map +1 -1
  407. package/dist/src/utils/catalog-source-impact.d.ts +21 -0
  408. package/dist/src/utils/catalog-source-impact.js +344 -0
  409. package/dist/src/utils/catalog-source-impact.js.map +1 -0
  410. package/dist/src/utils/catalog-source-references.d.ts +3 -2
  411. package/dist/src/utils/catalog-source-references.js +195 -347
  412. package/dist/src/utils/catalog-source-references.js.map +1 -1
  413. package/dist/src/utils/catalog-sources.d.ts +15 -1
  414. package/dist/src/utils/catalog-sources.js +206 -27
  415. package/dist/src/utils/catalog-sources.js.map +1 -1
  416. package/dist/src/utils/claude-skills-root.d.ts +8 -0
  417. package/dist/src/utils/claude-skills-root.js +76 -0
  418. package/dist/src/utils/claude-skills-root.js.map +1 -0
  419. package/dist/src/utils/codex-config.d.ts +2 -0
  420. package/dist/src/utils/codex-config.js +26 -5
  421. package/dist/src/utils/codex-config.js.map +1 -1
  422. package/dist/src/utils/codex-manager.d.ts +79 -0
  423. package/dist/src/utils/codex-manager.js +735 -0
  424. package/dist/src/utils/codex-manager.js.map +1 -0
  425. package/dist/src/utils/codex-marketplace-path.d.ts +5 -0
  426. package/dist/src/utils/codex-marketplace-path.js +45 -0
  427. package/dist/src/utils/codex-marketplace-path.js.map +1 -0
  428. package/dist/src/utils/codex-native-observation.d.ts +49 -0
  429. package/dist/src/utils/codex-native-observation.js +154 -0
  430. package/dist/src/utils/codex-native-observation.js.map +1 -0
  431. package/dist/src/utils/codex-native-render-receipt.d.ts +40 -0
  432. package/dist/src/utils/codex-native-render-receipt.js +205 -0
  433. package/dist/src/utils/codex-native-render-receipt.js.map +1 -0
  434. package/dist/src/utils/codex-reconciler.d.ts +126 -0
  435. package/dist/src/utils/codex-reconciler.js +298 -0
  436. package/dist/src/utils/codex-reconciler.js.map +1 -0
  437. package/dist/src/utils/codex-shared-native.d.ts +43 -0
  438. package/dist/src/utils/codex-shared-native.js +81 -0
  439. package/dist/src/utils/codex-shared-native.js.map +1 -0
  440. package/dist/src/utils/codex-skill-staging.d.ts +2 -0
  441. package/dist/src/utils/codex-skill-staging.js.map +1 -1
  442. package/dist/src/utils/codex-skills-root.d.ts +4 -0
  443. package/dist/src/utils/codex-skills-root.js +25 -0
  444. package/dist/src/utils/codex-skills-root.js.map +1 -0
  445. package/dist/src/utils/codex-surface-analysis.d.ts +46 -0
  446. package/dist/src/utils/codex-surface-analysis.js +247 -0
  447. package/dist/src/utils/codex-surface-analysis.js.map +1 -0
  448. package/dist/src/utils/dynamic-skill-tree.d.ts +5 -0
  449. package/dist/src/utils/dynamic-skill-tree.js +56 -7
  450. package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
  451. package/dist/src/utils/git-catalog-provider.d.ts +16 -0
  452. package/dist/src/utils/git-catalog-provider.js +177 -145
  453. package/dist/src/utils/git-catalog-provider.js.map +1 -1
  454. package/dist/src/utils/local-marketplace.d.ts +27 -1
  455. package/dist/src/utils/local-marketplace.js +434 -84
  456. package/dist/src/utils/local-marketplace.js.map +1 -1
  457. package/dist/src/utils/managed-command-closure.d.ts +3 -0
  458. package/dist/src/utils/managed-command-closure.js +35 -0
  459. package/dist/src/utils/managed-command-closure.js.map +1 -0
  460. package/dist/src/utils/managed-command-evidence.d.ts +7 -0
  461. package/dist/src/utils/managed-command-evidence.js +86 -0
  462. package/dist/src/utils/managed-command-evidence.js.map +1 -0
  463. package/dist/src/utils/managed-command-materialization.d.ts +115 -0
  464. package/dist/src/utils/managed-command-materialization.js +359 -0
  465. package/dist/src/utils/managed-command-materialization.js.map +1 -0
  466. package/dist/src/utils/managed-command-runtime.d.ts +33 -0
  467. package/dist/src/utils/managed-command-runtime.js +121 -0
  468. package/dist/src/utils/managed-command-runtime.js.map +1 -0
  469. package/dist/src/utils/managed-command-store.d.ts +128 -0
  470. package/dist/src/utils/managed-command-store.js +589 -0
  471. package/dist/src/utils/managed-command-store.js.map +1 -0
  472. package/dist/src/utils/manifest.d.ts +1 -3
  473. package/dist/src/utils/manifest.js +1 -3
  474. package/dist/src/utils/manifest.js.map +1 -1
  475. package/dist/src/utils/multi-source-catalog.d.ts +3 -9
  476. package/dist/src/utils/multi-source-catalog.js +54 -110
  477. package/dist/src/utils/multi-source-catalog.js.map +1 -1
  478. package/dist/src/utils/native-cli.d.ts +61 -7
  479. package/dist/src/utils/native-cli.js +426 -58
  480. package/dist/src/utils/native-cli.js.map +1 -1
  481. package/dist/src/utils/native-tool-context.d.ts +14 -0
  482. package/dist/src/utils/native-tool-context.js +38 -0
  483. package/dist/src/utils/native-tool-context.js.map +1 -0
  484. package/dist/src/utils/native-tool-review.d.ts +21 -0
  485. package/dist/src/utils/native-tool-review.js +102 -0
  486. package/dist/src/utils/native-tool-review.js.map +1 -0
  487. package/dist/src/utils/orphan-marketplace-cleanup.js +0 -4
  488. package/dist/src/utils/orphan-marketplace-cleanup.js.map +1 -1
  489. package/dist/src/utils/ownership.d.ts +88 -20
  490. package/dist/src/utils/ownership.js +185 -223
  491. package/dist/src/utils/ownership.js.map +1 -1
  492. package/dist/src/utils/path-catalog-provider.d.ts +1 -1
  493. package/dist/src/utils/path-catalog-provider.js +54 -65
  494. package/dist/src/utils/path-catalog-provider.js.map +1 -1
  495. package/dist/src/utils/paths.d.ts +0 -1
  496. package/dist/src/utils/paths.js +0 -1
  497. package/dist/src/utils/paths.js.map +1 -1
  498. package/dist/src/utils/plugin-config-impact.d.ts +40 -0
  499. package/dist/src/utils/plugin-config-impact.js +373 -0
  500. package/dist/src/utils/plugin-config-impact.js.map +1 -0
  501. package/dist/src/utils/plugin-config-write.d.ts +52 -27
  502. package/dist/src/utils/plugin-config-write.js +1112 -298
  503. package/dist/src/utils/plugin-config-write.js.map +1 -1
  504. package/dist/src/utils/plugin-config.d.ts +153 -93
  505. package/dist/src/utils/plugin-config.js +1116 -968
  506. package/dist/src/utils/plugin-config.js.map +1 -1
  507. package/dist/src/utils/plugin-intent-state.d.ts +49 -0
  508. package/dist/src/utils/plugin-intent-state.js +320 -0
  509. package/dist/src/utils/plugin-intent-state.js.map +1 -0
  510. package/dist/src/utils/plugin-scripts.d.ts +66 -125
  511. package/dist/src/utils/plugin-scripts.js +518 -526
  512. package/dist/src/utils/plugin-scripts.js.map +1 -1
  513. package/dist/src/utils/process-lock.js +14 -5
  514. package/dist/src/utils/process-lock.js.map +1 -1
  515. package/dist/src/utils/process-tree.d.ts +2 -2
  516. package/dist/src/utils/process-tree.js +1 -1
  517. package/dist/src/utils/process-tree.js.map +1 -1
  518. package/dist/src/utils/project-boundary.d.ts +11 -13
  519. package/dist/src/utils/project-boundary.js +28 -34
  520. package/dist/src/utils/project-boundary.js.map +1 -1
  521. package/dist/src/utils/rendered-contract.js +18 -1
  522. package/dist/src/utils/rendered-contract.js.map +1 -1
  523. package/dist/src/utils/runtime-config.d.ts +20 -0
  524. package/dist/src/utils/runtime-config.js +75 -0
  525. package/dist/src/utils/runtime-config.js.map +1 -0
  526. package/dist/src/utils/runtime-skill-closure.js +47 -6
  527. package/dist/src/utils/runtime-skill-closure.js.map +1 -1
  528. package/dist/src/utils/safe-fs.d.ts +21 -0
  529. package/dist/src/utils/safe-fs.js +111 -0
  530. package/dist/src/utils/safe-fs.js.map +1 -0
  531. package/dist/src/utils/safe-operation-diagnostic.d.ts +15 -0
  532. package/dist/src/utils/safe-operation-diagnostic.js +33 -0
  533. package/dist/src/utils/safe-operation-diagnostic.js.map +1 -0
  534. package/dist/src/utils/sensitive-content.d.ts +4 -0
  535. package/dist/src/utils/sensitive-content.js +36 -0
  536. package/dist/src/utils/sensitive-content.js.map +1 -0
  537. package/dist/src/utils/state-paths.js +7 -2
  538. package/dist/src/utils/state-paths.js.map +1 -1
  539. package/dist/src/utils/target-eligibility.d.ts +8 -2
  540. package/dist/src/utils/target-eligibility.js +17 -8
  541. package/dist/src/utils/target-eligibility.js.map +1 -1
  542. package/dist/src/utils/windows-claude-shim.d.ts +7 -0
  543. package/dist/src/utils/windows-claude-shim.js +10 -0
  544. package/dist/src/utils/windows-claude-shim.js.map +1 -0
  545. package/dist/src/utils/windows-npm-shim.d.ts +14 -0
  546. package/dist/src/utils/windows-npm-shim.js +140 -0
  547. package/dist/src/utils/windows-npm-shim.js.map +1 -0
  548. package/dist/vitest.config.js +100 -9
  549. package/dist/vitest.config.js.map +1 -1
  550. package/package.json +31 -21
  551. package/dist/authoring/scripts/check-plugin-versions.d.mts +0 -2
  552. package/dist/authoring/scripts/check-plugin-versions.mjs +0 -5
  553. package/dist/authoring/scripts/check-plugin-versions.mjs.map +0 -1
  554. package/dist/scripts/aw-skill-eval-engine.d.ts +0 -13
  555. package/dist/scripts/aw-skill-eval-engine.js +0 -31
  556. package/dist/scripts/aw-skill-eval-engine.js.map +0 -1
  557. package/dist/scripts/codex-eval-app-server.d.ts +0 -89
  558. package/dist/scripts/codex-eval-app-server.js +0 -1228
  559. package/dist/scripts/codex-eval-app-server.js.map +0 -1
  560. package/dist/scripts/codex-eval-isolation.d.ts +0 -61
  561. package/dist/scripts/codex-eval-isolation.js +0 -318
  562. package/dist/scripts/codex-eval-isolation.js.map +0 -1
  563. package/dist/scripts/codex-eval-process-management.d.ts +0 -8
  564. package/dist/scripts/codex-eval-process-management.js +0 -69
  565. package/dist/scripts/codex-eval-process-management.js.map +0 -1
  566. package/dist/scripts/codex-eval-process-tree.d.ts +0 -38
  567. package/dist/scripts/codex-eval-process-tree.js +0 -803
  568. package/dist/scripts/codex-eval-process-tree.js.map +0 -1
  569. package/dist/scripts/codex-eval-runtime-config.d.ts +0 -62
  570. package/dist/scripts/codex-eval-runtime-config.js +0 -843
  571. package/dist/scripts/codex-eval-runtime-config.js.map +0 -1
  572. package/dist/scripts/codex-trigger-eval.d.ts +0 -84
  573. package/dist/scripts/codex-trigger-eval.js +0 -968
  574. package/dist/scripts/codex-trigger-eval.js.map +0 -1
  575. package/dist/scripts/eval-plugin-skills-audited.d.ts +0 -6
  576. package/dist/scripts/eval-plugin-skills-audited.js +0 -261
  577. package/dist/scripts/eval-plugin-skills-audited.js.map +0 -1
  578. package/dist/scripts/eval-plugin-skills.d.ts +0 -45
  579. package/dist/scripts/eval-plugin-skills.js +0 -1586
  580. package/dist/scripts/eval-plugin-skills.js.map +0 -1
  581. package/dist/scripts/eval-run-layout.d.ts +0 -17
  582. package/dist/scripts/eval-run-layout.js +0 -26
  583. package/dist/scripts/eval-run-layout.js.map +0 -1
  584. package/dist/scripts/plugin-eval-contract.d.ts +0 -185
  585. package/dist/scripts/plugin-eval-contract.js +0 -695
  586. package/dist/scripts/plugin-eval-contract.js.map +0 -1
  587. package/dist/scripts/plugin-eval-materializer.d.ts +0 -13
  588. package/dist/scripts/plugin-eval-materializer.js +0 -421
  589. package/dist/scripts/plugin-eval-materializer.js.map +0 -1
  590. package/dist/scripts/skill-reporting.d.ts +0 -212
  591. package/dist/scripts/skill-reporting.js +0 -922
  592. package/dist/scripts/skill-reporting.js.map +0 -1
  593. package/dist/src/commands/review-publication.d.ts +0 -99
  594. package/dist/src/commands/review-publication.js +0 -904
  595. package/dist/src/commands/review-publication.js.map +0 -1
  596. package/dist/src/commands/status-v4.d.ts +0 -123
  597. package/dist/src/commands/status-v4.js +0 -905
  598. package/dist/src/commands/status-v4.js.map +0 -1
  599. package/dist/src/commands/status.d.ts +0 -93
  600. package/dist/src/commands/status.js +0 -442
  601. package/dist/src/commands/status.js.map +0 -1
  602. package/dist/src/utils/active-marketplace-runtime-lock.d.ts +0 -12
  603. package/dist/src/utils/active-marketplace-runtime-lock.js +0 -133
  604. package/dist/src/utils/active-marketplace-runtime-lock.js.map +0 -1
  605. package/dist/src/utils/catalog-manifest-v3.d.ts +0 -2
  606. package/dist/src/utils/catalog-manifest-v3.js +0 -3
  607. package/dist/src/utils/catalog-manifest-v3.js.map +0 -1
  608. package/dist/src/utils/catalog-manifest-v4.d.ts +0 -5
  609. package/dist/src/utils/catalog-manifest-v4.js.map +0 -1
  610. package/dist/src/utils/catalog-source-cache.d.ts +0 -62
  611. package/dist/src/utils/catalog-source-cache.js +0 -296
  612. package/dist/src/utils/catalog-source-cache.js.map +0 -1
  613. package/dist/src/utils/codex-project-surface.d.ts +0 -3
  614. package/dist/src/utils/codex-project-surface.js +0 -49
  615. package/dist/src/utils/codex-project-surface.js.map +0 -1
  616. package/dist/src/utils/lifecycle-active-store.d.ts +0 -175
  617. package/dist/src/utils/lifecycle-active-store.js +0 -1276
  618. package/dist/src/utils/lifecycle-active-store.js.map +0 -1
  619. package/dist/src/utils/plugin-release.d.ts +0 -2
  620. package/dist/src/utils/plugin-release.js +0 -2
  621. package/dist/src/utils/plugin-release.js.map +0 -1
@@ -0,0 +1,126 @@
1
+ import type { CodexSharedNativeInspection } from './codex-shared-native.js';
2
+ import type { CodexSurfaceAnalysis, CodexSurfaceComponent } from './codex-surface-analysis.js';
3
+ import type { PluginIntentState } from './plugin-intent-state.js';
4
+ import type { CodexOperationRequirement, Scope } from '../types.js';
5
+ export type CodexReconcileOperation = 'install' | 'uninstall' | 'reinstall' | 'cleanup' | 'sync';
6
+ export type CodexSharedNativeAction = 'reuse' | 'install' | 'replace' | 'repair' | 'none';
7
+ export type CodexActivationAction = 'enable' | 'disable' | 'remove' | 'none';
8
+ export interface CodexReconcilerCatalogTarget {
9
+ pluginId: string;
10
+ pluginName: string;
11
+ codexPluginId: string;
12
+ version: string;
13
+ payloadDigest: string;
14
+ relation: 'requested' | 'dependency';
15
+ resolvedScope: Scope;
16
+ desiredScopes?: Scope[];
17
+ intentScopes?: Scope[];
18
+ surface: CodexSurfaceAnalysis;
19
+ }
20
+ export type CodexLiveExtensionState = 'absent' | 'present' | 'drifted' | 'foreign';
21
+ export interface CodexReconcilerLiveEvidence {
22
+ codexPluginId: string;
23
+ sharedNative: CodexSharedNativeInspection;
24
+ activations: {
25
+ user?: boolean;
26
+ project?: boolean;
27
+ };
28
+ extensions?: Array<{
29
+ componentKey: string;
30
+ scope: Scope;
31
+ state: CodexLiveExtensionState;
32
+ owner?: string;
33
+ }>;
34
+ projectionDigest?: string;
35
+ }
36
+ export interface CodexReconcilerInput {
37
+ scope: Scope;
38
+ cwd: string;
39
+ operation: CodexReconcileOperation;
40
+ intentBefore: PluginIntentState;
41
+ intentAfter: PluginIntentState;
42
+ relatedIntentBefore?: PluginIntentState;
43
+ relatedIntentAfter?: PluginIntentState;
44
+ catalogClosure: CodexReconcilerCatalogTarget[];
45
+ liveEvidence: CodexReconcilerLiveEvidence[];
46
+ activationSupport?: 'observed' | 'assumed';
47
+ }
48
+ export interface CodexSharedNativePlanAction {
49
+ pluginId: string;
50
+ codexPluginId: string;
51
+ action: CodexSharedNativeAction;
52
+ desiredVersion: string;
53
+ affectsOtherScopes: boolean;
54
+ }
55
+ export interface CodexActivationPlanAction {
56
+ pluginId: string;
57
+ codexPluginId: string;
58
+ scope: Scope;
59
+ action: CodexActivationAction;
60
+ desired: boolean;
61
+ }
62
+ export interface CodexExtensionPlanAction {
63
+ pluginId: string;
64
+ componentKey: string;
65
+ kind: CodexSurfaceComponent['kind'];
66
+ scope: Scope;
67
+ action: 'write' | 'remove';
68
+ }
69
+ export interface CodexReconcilePostcheckDescriptor {
70
+ requirement: CodexOperationRequirement;
71
+ support: 'observed' | 'assumed';
72
+ plugins: Array<{
73
+ pluginId: string;
74
+ codexPluginId: string;
75
+ expectedUserEnabled: boolean;
76
+ expectedProjectEnabled: boolean;
77
+ exactCwd: string;
78
+ neutralCwdRequired: boolean;
79
+ }>;
80
+ }
81
+ export interface CodexReconcileReviewDescriptor {
82
+ requiresConfirmation: boolean;
83
+ sharedImpact: {
84
+ pluginIds: string[];
85
+ warning?: string;
86
+ };
87
+ }
88
+ export interface CodexReconcilePlan {
89
+ requirement: CodexOperationRequirement;
90
+ desiredTargets: Array<{
91
+ pluginId: string;
92
+ scopes: Scope[];
93
+ }>;
94
+ sharedNativeActions: CodexSharedNativePlanAction[];
95
+ activationActions: {
96
+ user: CodexActivationPlanAction[];
97
+ project: CodexActivationPlanAction[];
98
+ };
99
+ extensionWrites: CodexExtensionPlanAction[];
100
+ extensionRemovals: CodexExtensionPlanAction[];
101
+ staleActivationRemovals: Array<{
102
+ scope: Scope;
103
+ codexPluginId: string;
104
+ }>;
105
+ managedInventory: {
106
+ before: string[];
107
+ desired: string[];
108
+ ownershipSuperset: string[];
109
+ converged: string[];
110
+ related: {
111
+ before: string[];
112
+ desired: string[];
113
+ ownershipSuperset: string[];
114
+ converged: string[];
115
+ };
116
+ };
117
+ warnings: string[];
118
+ postcheck: CodexReconcilePostcheckDescriptor;
119
+ review: CodexReconcileReviewDescriptor;
120
+ }
121
+ export declare class CodexReconcilePlanError extends Error {
122
+ readonly code: 'codexSharedNativeForeign' | 'codexSharedNativeCorrupt' | 'codexExtensionScopeConflict' | 'codexSurfaceOwnerCollision' | 'codexReconcileEvidenceInvalid';
123
+ constructor(code: CodexReconcilePlanError['code'], detail: string);
124
+ }
125
+ export declare function createCodexReconcilePlan(input: CodexReconcilerInput): CodexReconcilePlan;
126
+ export declare const planCodexReconciliation: typeof createCodexReconcilePlan;
@@ -0,0 +1,298 @@
1
+ import { getCodexOperationRequirement } from './agent-version.js';
2
+ export class CodexReconcilePlanError extends Error {
3
+ code;
4
+ constructor(code, detail) {
5
+ super(`${code}: ${detail}`);
6
+ this.name = 'CodexReconcilePlanError';
7
+ this.code = code;
8
+ }
9
+ }
10
+ function compareText(left, right) {
11
+ return left < right ? -1 : left > right ? 1 : 0;
12
+ }
13
+ function canonicalStrings(values) {
14
+ return [...new Set(values)].sort(compareText);
15
+ }
16
+ function targetKey(target) {
17
+ return `${target.pluginId}\0${target.codexPluginId}`;
18
+ }
19
+ function desiredScopes(target) {
20
+ return [...new Set(target.desiredScopes ?? [target.resolvedScope])].sort(compareText);
21
+ }
22
+ function assertTarget(target) {
23
+ if (!target.surface.ok) {
24
+ throw new CodexReconcilePlanError('codexSurfaceOwnerCollision', `${target.pluginId} has an ambiguous or unsupported Codex surface.`);
25
+ }
26
+ if (!target.codexPluginId.includes('@')) {
27
+ throw new CodexReconcilePlanError('codexReconcileEvidenceInvalid', `${target.pluginId} has an invalid Codex plugin ID.`);
28
+ }
29
+ if (!/^sha256:[0-9a-f]{64}$/u.test(target.payloadDigest)) {
30
+ throw new CodexReconcilePlanError('codexReconcileEvidenceInvalid', `${target.pluginId} has an invalid payload digest.`);
31
+ }
32
+ }
33
+ function nativeAction(options) {
34
+ const { operation, target, evidence } = options;
35
+ const requiresNative = target.surface.nativeKinds.length > 0
36
+ && desiredScopes(target).length > 0;
37
+ if (!requiresNative || operation === 'uninstall')
38
+ return 'none';
39
+ const state = evidence.sharedNative;
40
+ if (state.state === 'unobserved') {
41
+ return operation === 'cleanup' ? 'none' : 'install';
42
+ }
43
+ if (state.state === 'blocked') {
44
+ throw new CodexReconcilePlanError(state.reason === 'foreign' ? 'codexSharedNativeForeign' : 'codexSharedNativeCorrupt', `${target.codexPluginId} shared native state is ${state.reason}.`);
45
+ }
46
+ if (operation === 'reinstall') {
47
+ return state.state === 'missing' ? 'install' : 'replace';
48
+ }
49
+ if (state.state === 'missing')
50
+ return 'install';
51
+ if (state.state === 'replaceable') {
52
+ return state.reason === 'damaged' ? 'repair' : 'replace';
53
+ }
54
+ return 'reuse';
55
+ }
56
+ function activationAction(options) {
57
+ if (options.desired)
58
+ return options.actual === true ? 'none' : 'enable';
59
+ if (options.scope === 'user' && options.nativeDesiredSomewhere) {
60
+ return options.actual === false ? 'none' : 'disable';
61
+ }
62
+ return options.actual === undefined ? 'none' : 'remove';
63
+ }
64
+ function liveExtensionState(evidence, componentKey, scope) {
65
+ return evidence.extensions?.find((entry) => entry.componentKey === componentKey && entry.scope === scope)?.state ?? 'absent';
66
+ }
67
+ function addExtensionActions(options) {
68
+ const scopes = desiredScopes(options.target);
69
+ const awComponents = options.target.surface.components.filter((component) => component.owner === 'aw');
70
+ if (awComponents.length > 0 && scopes.includes('user') && scopes.includes('project')) {
71
+ throw new CodexReconcilePlanError('codexExtensionScopeConflict', `${options.target.pluginId} has AW-owned output at both user and project scope.`);
72
+ }
73
+ for (const component of awComponents) {
74
+ for (const scope of ['user', 'project']) {
75
+ const state = liveExtensionState(options.evidence, component.key, scope);
76
+ if (state === 'foreign') {
77
+ throw new CodexReconcilePlanError('codexSurfaceOwnerCollision', `${options.target.pluginId} extension ${component.key} is foreign at ${scope} scope.`);
78
+ }
79
+ const desired = scopes.includes(scope) && component.scopes.includes(scope);
80
+ const refreshOnSync = options.input.operation === 'sync'
81
+ && component.dynamic
82
+ && (component.refreshKeys?.length ?? 0) > 0;
83
+ const shouldWrite = desired && (state !== 'present'
84
+ || options.input.operation === 'reinstall'
85
+ || refreshOnSync);
86
+ if (shouldWrite) {
87
+ options.writes.push({
88
+ pluginId: options.target.pluginId,
89
+ componentKey: component.key,
90
+ kind: component.kind,
91
+ scope,
92
+ action: 'write',
93
+ });
94
+ }
95
+ else if (!desired && state !== 'absent') {
96
+ options.removals.push({
97
+ pluginId: options.target.pluginId,
98
+ componentKey: component.key,
99
+ kind: component.kind,
100
+ scope,
101
+ action: 'remove',
102
+ });
103
+ }
104
+ }
105
+ }
106
+ }
107
+ function sortActivationActions(actions) {
108
+ actions.sort((left, right) => compareText(`${left.codexPluginId}\0${left.pluginId}`, `${right.codexPluginId}\0${right.pluginId}`));
109
+ }
110
+ function sortExtensionActions(actions) {
111
+ actions.sort((left, right) => compareText(`${left.scope}\0${left.pluginId}\0${left.componentKey}`, `${right.scope}\0${right.pluginId}\0${right.componentKey}`));
112
+ }
113
+ function evidenceFor(target, evidenceById) {
114
+ const evidence = evidenceById.get(target.codexPluginId);
115
+ if (!evidence) {
116
+ throw new CodexReconcilePlanError('codexReconcileEvidenceInvalid', `Missing live evidence for ${target.codexPluginId}.`);
117
+ }
118
+ return evidence;
119
+ }
120
+ export function createCodexReconcilePlan(input) {
121
+ const sortedTargets = [...input.catalogClosure].sort((left, right) => compareText(targetKey(left), targetKey(right)));
122
+ const duplicateTarget = sortedTargets.find((target, index) => index > 0 && targetKey(sortedTargets[index - 1]) === targetKey(target));
123
+ if (duplicateTarget) {
124
+ throw new CodexReconcilePlanError('codexReconcileEvidenceInvalid', `Duplicate catalog target ${duplicateTarget.pluginId}.`);
125
+ }
126
+ sortedTargets.forEach(assertTarget);
127
+ const ownersByCodexPluginId = new Map();
128
+ for (const target of sortedTargets) {
129
+ const owners = ownersByCodexPluginId.get(target.codexPluginId) ?? new Set();
130
+ owners.add(target.pluginId);
131
+ ownersByCodexPluginId.set(target.codexPluginId, owners);
132
+ }
133
+ const ownerCollision = [...ownersByCodexPluginId.entries()].find(([, owners]) => owners.size > 1);
134
+ if (ownerCollision) {
135
+ throw new CodexReconcilePlanError('codexSurfaceOwnerCollision', `${ownerCollision[0]} has multiple Catalog owners: ${[...ownerCollision[1]].sort(compareText).join(', ')}.`);
136
+ }
137
+ const evidenceById = new Map();
138
+ for (const evidence of input.liveEvidence) {
139
+ if (evidenceById.has(evidence.codexPluginId)) {
140
+ throw new CodexReconcilePlanError('codexReconcileEvidenceInvalid', `Duplicate live evidence for ${evidence.codexPluginId}.`);
141
+ }
142
+ evidenceById.set(evidence.codexPluginId, evidence);
143
+ }
144
+ const sharedNativeActions = [];
145
+ const userActions = [];
146
+ const projectActions = [];
147
+ const extensionWrites = [];
148
+ const extensionRemovals = [];
149
+ const warnings = [];
150
+ const postcheckPlugins = [];
151
+ let projectObservationRequired = input.scope === 'project'
152
+ || sortedTargets.some((target) => target.resolvedScope === 'project');
153
+ for (const target of sortedTargets) {
154
+ const evidence = evidenceFor(target, evidenceById);
155
+ const scopes = desiredScopes(target);
156
+ const hasNative = target.surface.nativeKinds.length > 0;
157
+ const userDesired = hasNative && scopes.includes('user');
158
+ const projectDesired = hasNative && scopes.includes('project');
159
+ const nativeDesiredSomewhere = userDesired || projectDesired;
160
+ projectObservationRequired ||= projectDesired;
161
+ const action = nativeAction({ operation: input.operation, target, evidence });
162
+ if (hasNative || action !== 'none') {
163
+ sharedNativeActions.push({
164
+ pluginId: target.pluginId,
165
+ codexPluginId: target.codexPluginId,
166
+ action,
167
+ desiredVersion: target.version,
168
+ affectsOtherScopes: action === 'replace' || action === 'repair',
169
+ });
170
+ }
171
+ if (action === 'replace' || action === 'repair') {
172
+ warnings.push(`codexSharedNativeAffectsOtherScopes:${target.codexPluginId}`);
173
+ }
174
+ const userAction = {
175
+ pluginId: target.pluginId,
176
+ codexPluginId: target.codexPluginId,
177
+ scope: 'user',
178
+ action: activationAction({
179
+ actual: evidence.activations.user,
180
+ desired: userDesired,
181
+ scope: 'user',
182
+ nativeDesiredSomewhere,
183
+ }),
184
+ desired: userDesired,
185
+ };
186
+ const projectAction = {
187
+ pluginId: target.pluginId,
188
+ codexPluginId: target.codexPluginId,
189
+ scope: 'project',
190
+ action: activationAction({
191
+ actual: evidence.activations.project,
192
+ desired: projectDesired,
193
+ scope: 'project',
194
+ nativeDesiredSomewhere,
195
+ }),
196
+ desired: projectDesired,
197
+ };
198
+ userActions.push(userAction);
199
+ projectActions.push(projectAction);
200
+ addExtensionActions({
201
+ input,
202
+ target,
203
+ evidence,
204
+ writes: extensionWrites,
205
+ removals: extensionRemovals,
206
+ });
207
+ if (hasNative && (userDesired || projectDesired)) {
208
+ postcheckPlugins.push({
209
+ pluginId: target.pluginId,
210
+ codexPluginId: target.codexPluginId,
211
+ expectedUserEnabled: userDesired,
212
+ expectedProjectEnabled: projectDesired,
213
+ exactCwd: input.cwd,
214
+ neutralCwdRequired: projectDesired,
215
+ });
216
+ }
217
+ }
218
+ const actualDesiredIds = canonicalStrings(sortedTargets.flatMap((target) => target.surface.nativeKinds.length > 0 && desiredScopes(target).length > 0
219
+ ? [target.codexPluginId]
220
+ : []));
221
+ const desiredIds = canonicalStrings(sortedTargets.flatMap((target) => (target.intentScopes ?? desiredScopes(target)).includes(input.scope)
222
+ ? [target.codexPluginId]
223
+ : []));
224
+ const relatedScope = input.scope === 'user' ? 'project' : 'user';
225
+ const relatedDesiredIds = canonicalStrings(sortedTargets.flatMap((target) => (target.intentScopes ?? desiredScopes(target)).includes(relatedScope)
226
+ ? [target.codexPluginId]
227
+ : []));
228
+ const beforeIds = [];
229
+ const relatedBeforeIds = [];
230
+ const nativeReconciledPluginIds = new Set(sortedTargets.flatMap((target) => target.surface.nativeKinds.length > 0 ? [target.codexPluginId] : []));
231
+ const reconciledPluginIds = new Set(sortedTargets.map((target) => target.codexPluginId));
232
+ const staleActivationRemovals = canonicalStrings([...beforeIds, ...relatedBeforeIds].filter((pluginId) => nativeReconciledPluginIds.has(pluginId)
233
+ && !actualDesiredIds.includes(pluginId))).flatMap((codexPluginId) => [
234
+ { scope: 'user', codexPluginId },
235
+ { scope: 'project', codexPluginId },
236
+ ]);
237
+ const requirement = getCodexOperationRequirement(projectObservationRequired ? 'project' : 'user');
238
+ const support = input.activationSupport ?? 'observed';
239
+ if (support === 'assumed')
240
+ warnings.push('codexProjectActivationAssumed');
241
+ sharedNativeActions.sort((left, right) => compareText(left.codexPluginId, right.codexPluginId));
242
+ sortActivationActions(userActions);
243
+ sortActivationActions(projectActions);
244
+ sortExtensionActions(extensionWrites);
245
+ sortExtensionActions(extensionRemovals);
246
+ postcheckPlugins.sort((left, right) => compareText(left.codexPluginId, right.codexPluginId));
247
+ const ownershipSuperset = canonicalStrings([...beforeIds, ...desiredIds]);
248
+ const convergedIds = canonicalStrings([
249
+ ...beforeIds.filter((pluginId) => !reconciledPluginIds.has(pluginId)),
250
+ ...desiredIds,
251
+ ]);
252
+ const relatedOwnershipSuperset = canonicalStrings([...relatedBeforeIds, ...relatedDesiredIds]);
253
+ const relatedConvergedIds = canonicalStrings([
254
+ ...relatedBeforeIds.filter((pluginId) => !reconciledPluginIds.has(pluginId)),
255
+ ...relatedDesiredIds,
256
+ ]);
257
+ const planDescriptor = {
258
+ requirement,
259
+ desiredTargets: sortedTargets.map((target) => ({
260
+ pluginId: target.pluginId,
261
+ scopes: desiredScopes(target),
262
+ })),
263
+ sharedNativeActions,
264
+ activationActions: { user: userActions, project: projectActions },
265
+ extensionWrites,
266
+ extensionRemovals,
267
+ staleActivationRemovals,
268
+ managedInventory: {
269
+ before: beforeIds,
270
+ desired: desiredIds,
271
+ ownershipSuperset,
272
+ converged: convergedIds,
273
+ related: {
274
+ before: relatedBeforeIds,
275
+ desired: relatedDesiredIds,
276
+ ownershipSuperset: relatedOwnershipSuperset,
277
+ converged: relatedConvergedIds,
278
+ },
279
+ },
280
+ warnings: canonicalStrings(warnings),
281
+ postcheck: { requirement, support, plugins: postcheckPlugins },
282
+ };
283
+ const sharedImpactPluginIds = sharedNativeActions.flatMap((entry) => entry.affectsOtherScopes ? [entry.codexPluginId] : []);
284
+ return {
285
+ ...planDescriptor,
286
+ review: {
287
+ requiresConfirmation: sharedImpactPluginIds.length > 0,
288
+ sharedImpact: {
289
+ pluginIds: sharedImpactPluginIds,
290
+ ...(sharedImpactPluginIds.length > 0 ? {
291
+ warning: 'Replacing or reinstalling shared Codex native state can affect other projects.',
292
+ } : {}),
293
+ },
294
+ },
295
+ };
296
+ }
297
+ export const planCodexReconciliation = createCodexReconcilePlan;
298
+ //# sourceMappingURL=codex-reconciler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-reconciler.js","sourceRoot":"","sources":["../../../src/utils/codex-reconciler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,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AC;IAEzD,OAAO;QACL,GAAG,cAAc;QACjB,MAAM,EAAE;YACN,oBAAoB,EAAE,qBAAqB,CAAC,MAAM,GAAG,CAAC;YACtD,YAAY,EAAE;gBACZ,SAAS,EAAE,qBAAqB;gBAChC,GAAG,CAAC,qBAAqB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;oBACrC,OAAO,EAAE,gFAAgF;iBAC1F,CAAC,CAAC,CAAC,EAAE,CAAC;aACR;SACF;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,CAAC"}
@@ -0,0 +1,43 @@
1
+ import type { CodexMarketplaceSnapshot } from './codex-config.js';
2
+ import type { CodexNativePluginObservation } from './codex-native-observation.js';
3
+ export type CodexSharedNativeDiagnostic = 'staleCacheObserved' | 'marketplaceRegistrationForeign' | 'marketplacePathUnsafe' | 'pluginListUnavailable' | 'pluginListDuplicate' | 'pluginNameCollision' | 'pluginListVersionMismatch' | 'manifestMissing' | 'manifestUnreadable' | 'manifestIdentityMismatch' | 'manifestVersionInvalid' | 'payloadPathUnsafe' | 'payloadDigestMismatch' | 'projectionReceiptMissing' | 'projectionReceiptUnreadable' | 'projectionExpectedPayloadDigestMissing' | 'projectionReceiptIdentityMismatch' | 'projectionPayloadDigestMismatch' | 'projectionRenderDrift';
4
+ export type CodexSharedNativeState = 'missing' | 'usable' | 'replaceable' | 'blocked' | 'unobserved';
5
+ export type CodexSharedNativeInspection = {
6
+ state: 'unobserved';
7
+ staleCacheObserved?: true;
8
+ } | {
9
+ state: 'missing';
10
+ staleCacheObserved?: true;
11
+ } | {
12
+ state: 'usable';
13
+ version?: string;
14
+ } | {
15
+ state: 'replaceable';
16
+ reason: 'outdated' | 'damaged' | 'renderDrift';
17
+ version?: string;
18
+ desiredVersion?: string;
19
+ diagnostic?: CodexSharedNativeDiagnostic;
20
+ } | {
21
+ state: 'blocked';
22
+ reason: 'foreign' | 'unreadable';
23
+ diagnostic: CodexSharedNativeDiagnostic;
24
+ };
25
+ export interface CodexSharedNativeEvidence {
26
+ pluginName: string;
27
+ pluginId: string;
28
+ marketplaceName: string;
29
+ canonicalMarketplaceRoot: string;
30
+ desiredVersion: string;
31
+ expectedPayloadDigest?: string;
32
+ marketplaceRegistration?: CodexMarketplaceSnapshot;
33
+ marketplacePathSafe: boolean;
34
+ observation: CodexNativePluginObservation;
35
+ sourceProjection?: 'current' | 'drifted';
36
+ sourceProjectionIssue?: {
37
+ reason: 'damaged' | 'foreign' | 'unreadable';
38
+ diagnostic: CodexSharedNativeDiagnostic;
39
+ };
40
+ }
41
+ export declare function isCanonicalCodexMarketplaceRegistration(registration: CodexMarketplaceSnapshot | undefined, canonicalMarketplaceRoot: string): boolean;
42
+ export declare function inspectCodexSharedNative(evidence: CodexSharedNativeEvidence): CodexSharedNativeInspection;
43
+ export declare const classifyCodexSharedNativeEvidence: typeof inspectCodexSharedNative;
@@ -0,0 +1,81 @@
1
+ import path from 'node:path';
2
+ import { tryParseStrictSemVer } from './manifest.js';
3
+ function samePath(left, right) {
4
+ return path.resolve(left) === path.resolve(right);
5
+ }
6
+ export function isCanonicalCodexMarketplaceRegistration(registration, canonicalMarketplaceRoot) {
7
+ return registration?.sourceType === 'local'
8
+ && registration.sourcePointsToManifest === false
9
+ && typeof registration.source === 'string'
10
+ && samePath(registration.source, canonicalMarketplaceRoot);
11
+ }
12
+ function blocked(reason, diagnostic) {
13
+ return { state: 'blocked', reason, diagnostic };
14
+ }
15
+ export function inspectCodexSharedNative(evidence) {
16
+ const expectedPluginId = `${evidence.pluginName}@${evidence.marketplaceName}`;
17
+ if (evidence.pluginId !== expectedPluginId) {
18
+ throw new Error(`Invalid Codex shared native identity: expected ${expectedPluginId}.`);
19
+ }
20
+ if (!tryParseStrictSemVer(evidence.desiredVersion)) {
21
+ throw new Error(`Invalid desired Codex shared native version: ${evidence.desiredVersion}.`);
22
+ }
23
+ if (evidence.expectedPayloadDigest !== undefined
24
+ && !/^sha256:[0-9a-f]{64}$/u.test(evidence.expectedPayloadDigest)) {
25
+ throw new Error('Invalid expected Codex shared native payload digest.');
26
+ }
27
+ if (!evidence.marketplacePathSafe)
28
+ return blocked('foreign', 'marketplacePathUnsafe');
29
+ if (evidence.observation.state === 'unobserved') {
30
+ return { state: 'unobserved' };
31
+ }
32
+ if (evidence.observation.state === 'failed') {
33
+ return blocked('unreadable', evidence.observation.reason === 'duplicate' ? 'pluginListDuplicate' : 'pluginListUnavailable');
34
+ }
35
+ if (evidence.observation.value === 'absent') {
36
+ return { state: 'missing' };
37
+ }
38
+ const listEntry = evidence.observation.entry;
39
+ if (evidence.marketplaceRegistration && !isCanonicalCodexMarketplaceRegistration(evidence.marketplaceRegistration, evidence.canonicalMarketplaceRoot)) {
40
+ return blocked('foreign', 'marketplaceRegistrationForeign');
41
+ }
42
+ if (!evidence.marketplaceRegistration) {
43
+ return blocked('foreign', 'marketplaceRegistrationForeign');
44
+ }
45
+ if (evidence.sourceProjectionIssue
46
+ && evidence.sourceProjectionIssue.reason !== 'damaged') {
47
+ return blocked(evidence.sourceProjectionIssue.reason, evidence.sourceProjectionIssue.diagnostic);
48
+ }
49
+ if (listEntry.version !== undefined && listEntry.version !== evidence.desiredVersion) {
50
+ return {
51
+ state: 'replaceable',
52
+ reason: 'outdated',
53
+ version: listEntry.version,
54
+ desiredVersion: evidence.desiredVersion,
55
+ };
56
+ }
57
+ if (evidence.sourceProjectionIssue?.reason === 'damaged') {
58
+ return {
59
+ state: 'replaceable',
60
+ reason: 'damaged',
61
+ ...(listEntry.version ? { version: listEntry.version } : {}),
62
+ desiredVersion: evidence.desiredVersion,
63
+ diagnostic: evidence.sourceProjectionIssue.diagnostic,
64
+ };
65
+ }
66
+ if (evidence.sourceProjection === 'drifted') {
67
+ return {
68
+ state: 'replaceable',
69
+ reason: 'renderDrift',
70
+ ...(listEntry.version ? { version: listEntry.version } : {}),
71
+ desiredVersion: evidence.desiredVersion,
72
+ diagnostic: 'projectionRenderDrift',
73
+ };
74
+ }
75
+ return {
76
+ state: 'usable',
77
+ ...(listEntry.version ? { version: listEntry.version } : {}),
78
+ };
79
+ }
80
+ export const classifyCodexSharedNativeEvidence = inspectCodexSharedNative;
81
+ //# sourceMappingURL=codex-shared-native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-shared-native.js","sourceRoot":"","sources":["../../../src/utils/codex-shared-native.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAqErD,SAAS,QAAQ,CAAC,IAAY,EAAE,KAAa;IAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,uCAAuC,CACrD,YAAkD,EAClD,wBAAgC;IAEhC,OAAO,YAAY,EAAE,UAAU,KAAK,OAAO;WACtC,YAAY,CAAC,sBAAsB,KAAK,KAAK;WAC7C,OAAO,YAAY,CAAC,MAAM,KAAK,QAAQ;WACvC,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,OAAO,CACd,MAAgC,EAChC,UAAuC;IAEvC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,QAAmC;IAEnC,MAAM,gBAAgB,GAAG,GAAG,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,eAAe,EAAE,CAAC;IAC9E,IAAI,QAAQ,CAAC,QAAQ,KAAK,gBAAgB,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,kDAAkD,gBAAgB,GAAG,CAAC,CAAC;IACzF,CAAC;IACD,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;QACnD,MAAM,IAAI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AO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC7D,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,iCAAiC,GAAG,wBAAwB,CAAC"}
@@ -5,5 +5,7 @@ export declare function createCodexSkillExpectedTree(options: {
5
5
  artifact: Pick<CodexSkillArtifact, 'target' | 'skillKey' | 'state' | 'content'>;
6
6
  sourceDirs?: string[];
7
7
  requireReadme?: boolean;
8
+ requirementsReceipt?: Buffer;
9
+ sourceRequirementsReceiptPolicy?: 'reject' | 'allow' | 'ignore';
8
10
  }): Promise<CodexSkillStagingTree>;
9
11
  export declare function createCodexSkillStagingTreeContentDigest(tree: CodexSkillStagingTree): string;
@@ -1 +1 @@
1
- {"version":3,"file":"codex-skill-staging.js","sourceRoot":"","sources":["../../../src/utils/codex-skill-staging.ts"],"names":[],"mappings":"AACA,OAAO,EACL,8BAA8B,EAC9B,mCAAmC,GAEpC,MAAM,yBAAyB,CAAC;AAIjC,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,OAIlD;IACC,OAAO,8BAA8B,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,wCAAwC,CACtD,IAA2B;IAE3B,OAAO,mCAAmC,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC"}
1
+ {"version":3,"file":"codex-skill-staging.js","sourceRoot":"","sources":["../../../src/utils/codex-skill-staging.ts"],"names":[],"mappings":"AACA,OAAO,EACL,8BAA8B,EAC9B,mCAAmC,GAEpC,MAAM,yBAAyB,CAAC;AAIjC,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,OAMlD;IACC,OAAO,8BAA8B,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,wCAAwC,CACtD,IAA2B;IAE3B,OAAO,mCAAmC,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { PluginMeta } from '../types.js';
2
+ export declare function resolveCodexSkillsRelativeRoot(plugin: Pick<PluginMeta, 'rootDir'> & {
3
+ manifest: Pick<PluginMeta['manifest'], 'skills'>;
4
+ }, marketplaceFallbackRoot?: string): Promise<string>;
@@ -0,0 +1,25 @@
1
+ import path from 'node:path';
2
+ import fs from 'fs-extra';
3
+ export async function resolveCodexSkillsRelativeRoot(plugin, marketplaceFallbackRoot) {
4
+ const manifestPaths = [
5
+ path.join(plugin.rootDir, '.codex-plugin', 'plugin.json'),
6
+ ...(marketplaceFallbackRoot
7
+ ? [path.join(marketplaceFallbackRoot, '.codex-plugin', 'plugin.json')]
8
+ : []),
9
+ ];
10
+ let manifest = null;
11
+ for (const manifestPath of manifestPaths) {
12
+ manifest = await fs.readJson(manifestPath).catch(() => null);
13
+ if (manifest)
14
+ break;
15
+ }
16
+ const raw = typeof manifest?.skills === 'string' && manifest.skills.trim() !== ''
17
+ ? manifest.skills
18
+ : plugin.manifest.skills ?? './codex/skills';
19
+ const normalized = path.posix.normalize(raw.replace(/^\.\//u, ''));
20
+ if (normalized === '..' || normalized.startsWith('../') || path.isAbsolute(normalized)) {
21
+ throw new Error(`Codex plugin skills root 越界:${raw}`);
22
+ }
23
+ return normalized;
24
+ }
25
+ //# sourceMappingURL=codex-skills-root.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-skills-root.js","sourceRoot":"","sources":["../../../src/utils/codex-skills-root.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAI1B,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,MAA0F,EAC1F,uBAAgC;IAEhC,MAAM,aAAa,GAAG;QACpB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,aAAa,CAAC;QACzD,GAAG,CAAC,uBAAuB;YACzB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,u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