@lesliechan721/aw 0.1.0-beta.10 → 0.1.0-beta.101

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 (864) hide show
  1. package/dist/authoring/assets/aw-config.d.mts +1 -50
  2. package/dist/authoring/assets/aw-config.mjs +58 -928
  3. package/dist/authoring/assets/aw-config.mjs.map +1 -1
  4. package/dist/authoring/assets/aw-runtime-config.d.mts +13 -0
  5. package/dist/authoring/assets/aw-runtime-config.mjs +221 -0
  6. package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -0
  7. package/dist/authoring/assets/command-runtime-config.d.mts +9 -0
  8. package/dist/authoring/assets/command-runtime-config.mjs +134 -0
  9. package/dist/authoring/assets/command-runtime-config.mjs.map +1 -0
  10. package/dist/authoring/scripts/add-skill.mjs +16 -39
  11. package/dist/authoring/scripts/add-skill.mjs.map +1 -1
  12. package/dist/authoring/scripts/init-plugin.mjs +43 -71
  13. package/dist/authoring/scripts/init-plugin.mjs.map +1 -1
  14. package/dist/authoring/scripts/lib/plugin-root.mjs +4 -4
  15. package/dist/authoring/scripts/lib/plugin-root.mjs.map +1 -1
  16. package/dist/authoring/scripts/lib/plugin-version-check.d.mts +1 -0
  17. package/dist/authoring/scripts/lib/plugin-version-check.mjs +230 -9
  18. package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -1
  19. package/dist/authoring/scripts/lib/skill-scaffold.d.mts +3 -3
  20. package/dist/authoring/scripts/lib/skill-scaffold.mjs +5 -8
  21. package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -1
  22. package/dist/authoring/scripts/remove-plugin.mjs +1 -1
  23. package/dist/authoring/scripts/remove-plugin.mjs.map +1 -1
  24. package/dist/authoring/scripts/validate-plugin.mjs +408 -1748
  25. package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
  26. package/dist/authoring/scripts/validate-skill.mjs +1 -1
  27. package/dist/index.js +2 -6
  28. package/dist/index.js.map +1 -1
  29. package/dist/native-runtime/reader-runtime.mjs +34 -0
  30. package/dist/native-runtime/reader.d.mts +6 -0
  31. package/dist/native-runtime/reader.mjs +11 -0
  32. package/dist/scripts/aw-skill-eval-materializer.d.ts +11 -1
  33. package/dist/scripts/aw-skill-eval-materializer.js +119 -114
  34. package/dist/scripts/aw-skill-eval-materializer.js.map +1 -1
  35. package/dist/scripts/bundle-plugins.js +32 -7
  36. package/dist/scripts/bundle-plugins.js.map +1 -1
  37. package/dist/scripts/plugin-staging.d.ts +1 -1
  38. package/dist/scripts/plugin-staging.js +5 -2
  39. package/dist/scripts/plugin-staging.js.map +1 -1
  40. package/dist/scripts/plugin-test-context-guard.d.mts +1 -0
  41. package/dist/scripts/plugin-test-context-guard.mjs +59 -0
  42. package/dist/scripts/plugin-test-context-guard.mjs.map +1 -0
  43. package/dist/scripts/plugin-test-reporter.d.mts +2 -0
  44. package/dist/scripts/plugin-test-reporter.mjs +21 -0
  45. package/dist/scripts/plugin-test-reporter.mjs.map +1 -0
  46. package/dist/scripts/test-plugin-scripts.d.ts +5 -0
  47. package/dist/scripts/test-plugin-scripts.js +343 -58
  48. package/dist/scripts/test-plugin-scripts.js.map +1 -1
  49. package/dist/scripts/test-workers.d.mts +24 -0
  50. package/dist/scripts/test-workers.mjs +59 -0
  51. package/dist/scripts/test-workers.mjs.map +1 -0
  52. package/dist/src/adapters/helpers.d.ts +7 -0
  53. package/dist/src/adapters/helpers.js.map +1 -1
  54. package/dist/src/authoring/workspace-commands.d.ts +3 -0
  55. package/dist/src/authoring/workspace-commands.js +7 -2
  56. package/dist/src/authoring/workspace-commands.js.map +1 -1
  57. package/dist/src/commands/aw-capabilities.d.ts +1 -1
  58. package/dist/src/commands/aw-capabilities.js +48 -19
  59. package/dist/src/commands/aw-capabilities.js.map +1 -1
  60. package/dist/src/commands/catalog-dev-source.d.ts +40 -3
  61. package/dist/src/commands/catalog-dev-source.js +333 -42
  62. package/dist/src/commands/catalog-dev-source.js.map +1 -1
  63. package/dist/src/commands/catalog-generation.d.ts +5 -0
  64. package/dist/src/commands/catalog-generation.js.map +1 -1
  65. package/dist/src/commands/catalog-publication-inspection.d.ts +11 -3
  66. package/dist/src/commands/catalog-publication-inspection.js +211 -59
  67. package/dist/src/commands/catalog-publication-inspection.js.map +1 -1
  68. package/dist/src/commands/catalog-publication-journal.d.ts +12 -0
  69. package/dist/src/commands/catalog-publication-journal.js +78 -1
  70. package/dist/src/commands/catalog-publication-journal.js.map +1 -1
  71. package/dist/src/commands/catalog-publish.d.ts +21 -1
  72. package/dist/src/commands/catalog-publish.js +133 -92
  73. package/dist/src/commands/catalog-publish.js.map +1 -1
  74. package/dist/src/commands/catalog-source.d.ts +26 -5
  75. package/dist/src/commands/catalog-source.js +154 -27
  76. package/dist/src/commands/catalog-source.js.map +1 -1
  77. package/dist/src/commands/catalog-status.js +2 -2
  78. package/dist/src/commands/catalog-status.js.map +1 -1
  79. package/dist/src/commands/catalog-store.d.ts +35 -7
  80. package/dist/src/commands/catalog-store.js +469 -79
  81. package/dist/src/commands/catalog-store.js.map +1 -1
  82. package/dist/src/commands/catalog-workspace-resolution.d.ts +4 -0
  83. package/dist/src/commands/catalog-workspace-resolution.js +18 -3
  84. package/dist/src/commands/catalog-workspace-resolution.js.map +1 -1
  85. package/dist/src/commands/console.js +33 -20
  86. package/dist/src/commands/console.js.map +1 -1
  87. package/dist/src/commands/dependency-operation-plan.d.ts +7 -0
  88. package/dist/src/commands/dependency-operation-plan.js +66 -30
  89. package/dist/src/commands/dependency-operation-plan.js.map +1 -1
  90. package/dist/src/commands/deployment-confirmation.d.ts +11 -0
  91. package/dist/src/commands/deployment-confirmation.js +101 -0
  92. package/dist/src/commands/deployment-confirmation.js.map +1 -0
  93. package/dist/src/commands/init.js +1 -1
  94. package/dist/src/commands/init.js.map +1 -1
  95. package/dist/src/commands/intent-command.d.ts +35 -0
  96. package/dist/src/commands/intent-command.js +174 -0
  97. package/dist/src/commands/intent-command.js.map +1 -0
  98. package/dist/src/commands/lifecycle-command-package.d.ts +45 -0
  99. package/dist/src/commands/lifecycle-command-package.js +199 -0
  100. package/dist/src/commands/lifecycle-command-package.js.map +1 -0
  101. package/dist/src/commands/managed-commands.d.ts +41 -0
  102. package/dist/src/commands/managed-commands.js +408 -0
  103. package/dist/src/commands/managed-commands.js.map +1 -0
  104. package/dist/src/commands/offline-cleanup-evidence.d.ts +12 -2
  105. package/dist/src/commands/offline-cleanup-evidence.js +57 -35
  106. package/dist/src/commands/offline-cleanup-evidence.js.map +1 -1
  107. package/dist/src/commands/operation-plan.d.ts +72 -2
  108. package/dist/src/commands/operation-plan.js +54 -3
  109. package/dist/src/commands/operation-plan.js.map +1 -1
  110. package/dist/src/commands/operation-planner.d.ts +6 -5
  111. package/dist/src/commands/operation-planner.js +23 -20
  112. package/dist/src/commands/operation-planner.js.map +1 -1
  113. package/dist/src/commands/options.d.ts +11 -16
  114. package/dist/src/commands/options.js +31 -25
  115. package/dist/src/commands/options.js.map +1 -1
  116. package/dist/src/commands/permission-batch.d.ts +5 -0
  117. package/dist/src/commands/permission-batch.js +83 -0
  118. package/dist/src/commands/permission-batch.js.map +1 -0
  119. package/dist/src/commands/plugin-capabilities.js +128 -58
  120. package/dist/src/commands/plugin-capabilities.js.map +1 -1
  121. package/dist/src/commands/public-config-confirmation.d.ts +14 -0
  122. package/dist/src/commands/public-config-confirmation.js +73 -0
  123. package/dist/src/commands/public-config-confirmation.js.map +1 -0
  124. package/dist/src/commands/public-interruption.d.ts +9 -0
  125. package/dist/src/commands/public-interruption.js +23 -0
  126. package/dist/src/commands/public-interruption.js.map +1 -0
  127. package/dist/src/commands/public-lifecycle-result.d.ts +107 -0
  128. package/dist/src/commands/public-lifecycle-result.js +536 -0
  129. package/dist/src/commands/public-lifecycle-result.js.map +1 -0
  130. package/dist/src/commands/public-lifecycle.d.ts +28 -0
  131. package/dist/src/commands/public-lifecycle.js +633 -0
  132. package/dist/src/commands/public-lifecycle.js.map +1 -0
  133. package/dist/src/commands/public-plugin-query.d.ts +16 -0
  134. package/dist/src/commands/public-plugin-query.js +235 -0
  135. package/dist/src/commands/public-plugin-query.js.map +1 -0
  136. package/dist/src/commands/rebuild-command.d.ts +177 -16
  137. package/dist/src/commands/rebuild-command.js +3374 -1558
  138. package/dist/src/commands/rebuild-command.js.map +1 -1
  139. package/dist/src/commands/rebuild-integration.d.ts +100 -55
  140. package/dist/src/commands/rebuild-integration.js +866 -3275
  141. package/dist/src/commands/rebuild-integration.js.map +1 -1
  142. package/dist/src/commands/rebuild-operations.d.ts +68 -13
  143. package/dist/src/commands/rebuild-operations.js +309 -120
  144. package/dist/src/commands/rebuild-operations.js.map +1 -1
  145. package/dist/src/commands/rebuild-platform-integration.d.ts +99 -0
  146. package/dist/src/commands/rebuild-platform-integration.js +2329 -0
  147. package/dist/src/commands/rebuild-platform-integration.js.map +1 -0
  148. package/dist/src/commands/reconcile-operation-plan.d.ts +14 -9
  149. package/dist/src/commands/reconcile-operation-plan.js +26 -6
  150. package/dist/src/commands/reconcile-operation-plan.js.map +1 -1
  151. package/dist/src/commands/review-inspection.d.ts +60 -0
  152. package/dist/src/commands/review-inspection.js +437 -0
  153. package/dist/src/commands/review-inspection.js.map +1 -0
  154. package/dist/src/commands/review-preparation.d.ts +51 -0
  155. package/dist/src/commands/review-preparation.js +400 -0
  156. package/dist/src/commands/review-preparation.js.map +1 -0
  157. package/dist/src/commands/runtime.d.ts +7 -1
  158. package/dist/src/commands/runtime.js +41 -8
  159. package/dist/src/commands/runtime.js.map +1 -1
  160. package/dist/src/commands/skill-eval.d.ts +8 -0
  161. package/dist/src/commands/skill-eval.js +126 -73
  162. package/dist/src/commands/skill-eval.js.map +1 -1
  163. package/dist/src/commands/status-v6.d.ts +148 -35
  164. package/dist/src/commands/status-v6.js +1166 -307
  165. package/dist/src/commands/status-v6.js.map +1 -1
  166. package/dist/src/commands/targets-command.d.ts +38 -0
  167. package/dist/src/commands/targets-command.js +210 -0
  168. package/dist/src/commands/targets-command.js.map +1 -0
  169. package/dist/src/commands/wizard.d.ts +7 -3
  170. package/dist/src/commands/wizard.js +7 -4
  171. package/dist/src/commands/wizard.js.map +1 -1
  172. package/dist/src/commands/write-commands.d.ts +7 -1
  173. package/dist/src/commands/write-commands.js +129 -38
  174. package/dist/src/commands/write-commands.js.map +1 -1
  175. package/dist/src/constants.d.ts +2 -3
  176. package/dist/src/constants.js +2 -3
  177. package/dist/src/constants.js.map +1 -1
  178. package/dist/src/eval/manifest-v1.d.ts +6 -3
  179. package/dist/src/eval/manifest-v1.js +44 -33
  180. package/dist/src/eval/manifest-v1.js.map +1 -1
  181. package/dist/src/generators/local-plugin.d.ts +4 -2
  182. package/dist/src/generators/local-plugin.js +319 -353
  183. package/dist/src/generators/local-plugin.js.map +1 -1
  184. package/dist/src/generators/permissions.d.ts +20 -2
  185. package/dist/src/generators/permissions.js +82 -15
  186. package/dist/src/generators/permissions.js.map +1 -1
  187. package/dist/src/index.d.ts +3 -34
  188. package/dist/src/index.js +1711 -1935
  189. package/dist/src/index.js.map +1 -1
  190. package/dist/src/intent/deployment-preferences.d.ts +63 -0
  191. package/dist/src/intent/deployment-preferences.js +170 -0
  192. package/dist/src/intent/deployment-preferences.js.map +1 -0
  193. package/dist/src/intent/diagnostics.d.ts +11 -0
  194. package/dist/src/intent/diagnostics.js +14 -0
  195. package/dist/src/intent/diagnostics.js.map +1 -0
  196. package/dist/src/intent/intent-codec.d.ts +19 -0
  197. package/dist/src/intent/intent-codec.js +117 -0
  198. package/dist/src/intent/intent-codec.js.map +1 -0
  199. package/dist/src/intent/intent-store.d.ts +43 -0
  200. package/dist/src/intent/intent-store.js +118 -0
  201. package/dist/src/intent/intent-store.js.map +1 -0
  202. package/dist/src/intent/scope-context.d.ts +35 -0
  203. package/dist/src/intent/scope-context.js +179 -0
  204. package/dist/src/intent/scope-context.js.map +1 -0
  205. package/dist/src/intent/work-context.d.ts +13 -0
  206. package/dist/src/intent/work-context.js +22 -0
  207. package/dist/src/intent/work-context.js.map +1 -0
  208. package/dist/src/output/cli-progress.d.ts +30 -0
  209. package/dist/src/output/cli-progress.js +424 -0
  210. package/dist/src/output/cli-progress.js.map +1 -0
  211. package/dist/src/output/command-receipt.d.ts +6 -2
  212. package/dist/src/output/command-receipt.js +67 -32
  213. package/dist/src/output/command-receipt.js.map +1 -1
  214. package/dist/src/output/component-delivery.d.ts +28 -0
  215. package/dist/src/output/component-delivery.js +141 -0
  216. package/dist/src/output/component-delivery.js.map +1 -0
  217. package/dist/src/output/model.d.ts +123 -1
  218. package/dist/src/output/model.js +45 -1
  219. package/dist/src/output/model.js.map +1 -1
  220. package/dist/src/output/public-command-ids.d.ts +8 -0
  221. package/dist/src/output/public-command-ids.js +38 -0
  222. package/dist/src/output/public-command-ids.js.map +1 -0
  223. package/dist/src/output/public-result.d.ts +71 -0
  224. package/dist/src/output/public-result.js +40 -0
  225. package/dist/src/output/public-result.js.map +1 -0
  226. package/dist/src/output/rebuild-progress.d.ts +3 -0
  227. package/dist/src/output/rebuild-progress.js +34 -9
  228. package/dist/src/output/rebuild-progress.js.map +1 -1
  229. package/dist/src/output/receipt-projection.d.ts +7 -0
  230. package/dist/src/output/receipt-projection.js +670 -0
  231. package/dist/src/output/receipt-projection.js.map +1 -0
  232. package/dist/src/output/render/document.d.ts +55 -0
  233. package/dist/src/output/render/document.js +176 -0
  234. package/dist/src/output/render/document.js.map +1 -0
  235. package/dist/src/output/render/shared.d.ts +18 -0
  236. package/dist/src/output/render/shared.js +245 -0
  237. package/dist/src/output/render/shared.js.map +1 -0
  238. package/dist/src/output/render/style.d.ts +45 -0
  239. package/dist/src/output/render/style.js +155 -0
  240. package/dist/src/output/render/style.js.map +1 -0
  241. package/dist/src/output/render/views/commands-self.d.ts +6 -0
  242. package/dist/src/output/render/views/commands-self.js +210 -0
  243. package/dist/src/output/render/views/commands-self.js.map +1 -0
  244. package/dist/src/output/render/views/config.d.ts +2 -0
  245. package/dist/src/output/render/views/config.js +203 -0
  246. package/dist/src/output/render/views/config.js.map +1 -0
  247. package/dist/src/output/render/views/dev.d.ts +2 -0
  248. package/dist/src/output/render/views/dev.js +278 -0
  249. package/dist/src/output/render/views/dev.js.map +1 -0
  250. package/dist/src/output/render/views/fallback.d.ts +2 -0
  251. package/dist/src/output/render/views/fallback.js +6 -0
  252. package/dist/src/output/render/views/fallback.js.map +1 -0
  253. package/dist/src/output/render/views/index.d.ts +3 -0
  254. package/dist/src/output/render/views/index.js +79 -0
  255. package/dist/src/output/render/views/index.js.map +1 -0
  256. package/dist/src/output/render/views/lifecycle.d.ts +5 -0
  257. package/dist/src/output/render/views/lifecycle.js +170 -0
  258. package/dist/src/output/render/views/lifecycle.js.map +1 -0
  259. package/dist/src/output/render/views/sources-cache.d.ts +3 -0
  260. package/dist/src/output/render/views/sources-cache.js +322 -0
  261. package/dist/src/output/render/views/sources-cache.js.map +1 -0
  262. package/dist/src/output/render/views/targets.d.ts +2 -0
  263. package/dist/src/output/render/views/targets.js +82 -0
  264. package/dist/src/output/render/views/targets.js.map +1 -0
  265. package/dist/src/output/skill-invocation-notices.d.ts +18 -0
  266. package/dist/src/output/skill-invocation-notices.js +84 -0
  267. package/dist/src/output/skill-invocation-notices.js.map +1 -0
  268. package/dist/src/platforms/antigravity-permissions.d.ts +50 -0
  269. package/dist/src/platforms/antigravity-permissions.js +388 -0
  270. package/dist/src/platforms/antigravity-permissions.js.map +1 -0
  271. package/dist/src/platforms/capabilities.d.ts +9 -0
  272. package/dist/src/platforms/capabilities.js +125 -0
  273. package/dist/src/platforms/capabilities.js.map +1 -0
  274. package/dist/src/platforms/contracts.d.ts +394 -0
  275. package/dist/src/platforms/contracts.js +2 -0
  276. package/dist/src/platforms/contracts.js.map +1 -0
  277. package/dist/src/platforms/cursor-workspace-hook.d.ts +28 -0
  278. package/dist/src/platforms/cursor-workspace-hook.js +198 -0
  279. package/dist/src/platforms/cursor-workspace-hook.js.map +1 -0
  280. package/dist/src/platforms/discovery.d.ts +100 -0
  281. package/dist/src/platforms/discovery.js +796 -0
  282. package/dist/src/platforms/discovery.js.map +1 -0
  283. package/dist/src/platforms/grok-permission-config.d.ts +23 -0
  284. package/dist/src/platforms/grok-permission-config.js +184 -0
  285. package/dist/src/platforms/grok-permission-config.js.map +1 -0
  286. package/dist/src/platforms/grok-permission-document.d.ts +4 -0
  287. package/dist/src/platforms/grok-permission-document.js +145 -0
  288. package/dist/src/platforms/grok-permission-document.js.map +1 -0
  289. package/dist/src/platforms/grok-permissions.d.ts +17 -0
  290. package/dist/src/platforms/grok-permissions.js +311 -0
  291. package/dist/src/platforms/grok-permissions.js.map +1 -0
  292. package/dist/src/platforms/host-permission-policy.d.ts +38 -0
  293. package/dist/src/platforms/host-permission-policy.js +86 -0
  294. package/dist/src/platforms/host-permission-policy.js.map +1 -0
  295. package/dist/src/platforms/identity.d.ts +4 -0
  296. package/dist/src/platforms/identity.js +22 -0
  297. package/dist/src/platforms/identity.js.map +1 -0
  298. package/dist/src/platforms/inspection-grok.d.ts +4 -0
  299. package/dist/src/platforms/inspection-grok.js +380 -0
  300. package/dist/src/platforms/inspection-grok.js.map +1 -0
  301. package/dist/src/platforms/inspection-native.d.ts +8 -0
  302. package/dist/src/platforms/inspection-native.js +584 -0
  303. package/dist/src/platforms/inspection-native.js.map +1 -0
  304. package/dist/src/platforms/inspection-opencode.d.ts +4 -0
  305. package/dist/src/platforms/inspection-opencode.js +98 -0
  306. package/dist/src/platforms/inspection-opencode.js.map +1 -0
  307. package/dist/src/platforms/inspection-pi.d.ts +9 -0
  308. package/dist/src/platforms/inspection-pi.js +490 -0
  309. package/dist/src/platforms/inspection-pi.js.map +1 -0
  310. package/dist/src/platforms/inspection-query.d.ts +26 -0
  311. package/dist/src/platforms/inspection-query.js +118 -0
  312. package/dist/src/platforms/inspection-query.js.map +1 -0
  313. package/dist/src/platforms/inspection.d.ts +20 -0
  314. package/dist/src/platforms/inspection.js +259 -0
  315. package/dist/src/platforms/inspection.js.map +1 -0
  316. package/dist/src/platforms/layout.d.ts +35 -0
  317. package/dist/src/platforms/layout.js +332 -0
  318. package/dist/src/platforms/layout.js.map +1 -0
  319. package/dist/src/platforms/lifecycle-native-services.d.ts +3 -0
  320. package/dist/src/platforms/lifecycle-native-services.js +213 -0
  321. package/dist/src/platforms/lifecycle-native-services.js.map +1 -0
  322. package/dist/src/platforms/lifecycle-native.d.ts +14 -0
  323. package/dist/src/platforms/lifecycle-native.js +234 -0
  324. package/dist/src/platforms/lifecycle-native.js.map +1 -0
  325. package/dist/src/platforms/lifecycle.d.ts +29 -0
  326. package/dist/src/platforms/lifecycle.js +688 -0
  327. package/dist/src/platforms/lifecycle.js.map +1 -0
  328. package/dist/src/platforms/opencode-permission-config.d.ts +13 -0
  329. package/dist/src/platforms/opencode-permission-config.js +253 -0
  330. package/dist/src/platforms/opencode-permission-config.js.map +1 -0
  331. package/dist/src/platforms/opencode-permissions.d.ts +39 -0
  332. package/dist/src/platforms/opencode-permissions.js +212 -0
  333. package/dist/src/platforms/opencode-permissions.js.map +1 -0
  334. package/dist/src/platforms/opencode-related-permissions.d.ts +40 -0
  335. package/dist/src/platforms/opencode-related-permissions.js +177 -0
  336. package/dist/src/platforms/opencode-related-permissions.js.map +1 -0
  337. package/dist/src/platforms/permission-ownership.d.ts +89 -0
  338. package/dist/src/platforms/permission-ownership.js +543 -0
  339. package/dist/src/platforms/permission-ownership.js.map +1 -0
  340. package/dist/src/platforms/permission-sidecar.d.ts +70 -0
  341. package/dist/src/platforms/permission-sidecar.js +215 -0
  342. package/dist/src/platforms/permission-sidecar.js.map +1 -0
  343. package/dist/src/platforms/projection-code-extension.d.ts +8 -0
  344. package/dist/src/platforms/projection-code-extension.js +126 -0
  345. package/dist/src/platforms/projection-code-extension.js.map +1 -0
  346. package/dist/src/platforms/projection-command-resources.d.ts +7 -0
  347. package/dist/src/platforms/projection-command-resources.js +74 -0
  348. package/dist/src/platforms/projection-command-resources.js.map +1 -0
  349. package/dist/src/platforms/projection-files.d.ts +28 -0
  350. package/dist/src/platforms/projection-files.js +113 -0
  351. package/dist/src/platforms/projection-files.js.map +1 -0
  352. package/dist/src/platforms/projection-marketplace.d.ts +19 -0
  353. package/dist/src/platforms/projection-marketplace.js +42 -0
  354. package/dist/src/platforms/projection-marketplace.js.map +1 -0
  355. package/dist/src/platforms/projection.d.ts +13 -0
  356. package/dist/src/platforms/projection.js +578 -0
  357. package/dist/src/platforms/projection.js.map +1 -0
  358. package/dist/src/platforms/read-only-retry-policy.d.ts +34 -0
  359. package/dist/src/platforms/read-only-retry-policy.js +70 -0
  360. package/dist/src/platforms/read-only-retry-policy.js.map +1 -0
  361. package/dist/src/platforms/registry.d.ts +4 -0
  362. package/dist/src/platforms/registry.js +30 -0
  363. package/dist/src/platforms/registry.js.map +1 -0
  364. package/dist/src/platforms/retirement-native.d.ts +6 -0
  365. package/dist/src/platforms/retirement-native.js +95 -0
  366. package/dist/src/platforms/retirement-native.js.map +1 -0
  367. package/dist/src/platforms/supplement-layout.d.ts +20 -0
  368. package/dist/src/platforms/supplement-layout.js +54 -0
  369. package/dist/src/platforms/supplement-layout.js.map +1 -0
  370. package/dist/src/platforms/supplement-state.d.ts +13 -0
  371. package/dist/src/platforms/supplement-state.js +93 -0
  372. package/dist/src/platforms/supplement-state.js.map +1 -0
  373. package/dist/src/portable/commands.d.ts +60 -11
  374. package/dist/src/portable/commands.js +88 -346
  375. package/dist/src/portable/commands.js.map +1 -1
  376. package/dist/src/portable/historical-materialization.d.ts +25 -0
  377. package/dist/src/portable/historical-materialization.js +148 -0
  378. package/dist/src/portable/historical-materialization.js.map +1 -0
  379. package/dist/src/portable/materializer.d.ts +46 -2
  380. package/dist/src/portable/materializer.js +262 -259
  381. package/dist/src/portable/materializer.js.map +1 -1
  382. package/dist/src/portable/recovery-layout.d.ts +17 -0
  383. package/dist/src/portable/recovery-layout.js +42 -0
  384. package/dist/src/portable/recovery-layout.js.map +1 -0
  385. package/dist/src/portable/recovery.d.ts +177 -0
  386. package/dist/src/portable/recovery.js +597 -0
  387. package/dist/src/portable/recovery.js.map +1 -0
  388. package/dist/src/portable/writer.d.ts +67 -0
  389. package/dist/src/portable/writer.js +321 -0
  390. package/dist/src/portable/writer.js.map +1 -0
  391. package/dist/src/recovery/coordinator.d.ts +175 -0
  392. package/dist/src/recovery/coordinator.js +1629 -0
  393. package/dist/src/recovery/coordinator.js.map +1 -0
  394. package/dist/src/recovery/demand.d.ts +53 -0
  395. package/dist/src/recovery/demand.js +189 -0
  396. package/dist/src/recovery/demand.js.map +1 -0
  397. package/dist/src/recovery/install-concurrency.d.ts +48 -0
  398. package/dist/src/recovery/install-concurrency.js +196 -0
  399. package/dist/src/recovery/install-concurrency.js.map +1 -0
  400. package/dist/src/recovery/interruption.d.ts +19 -0
  401. package/dist/src/recovery/interruption.js +43 -0
  402. package/dist/src/recovery/interruption.js.map +1 -0
  403. package/dist/src/recovery/joint-coordinator.d.ts +46 -0
  404. package/dist/src/recovery/joint-coordinator.js +1728 -0
  405. package/dist/src/recovery/joint-coordinator.js.map +1 -0
  406. package/dist/src/recovery/joint-demand.d.ts +72 -0
  407. package/dist/src/recovery/joint-demand.js +332 -0
  408. package/dist/src/recovery/joint-demand.js.map +1 -0
  409. package/dist/src/recovery/joint-install-execution.d.ts +19 -0
  410. package/dist/src/recovery/joint-install-execution.js +312 -0
  411. package/dist/src/recovery/joint-install-execution.js.map +1 -0
  412. package/dist/src/recovery/joint-install-native-rebase.d.ts +4 -0
  413. package/dist/src/recovery/joint-install-native-rebase.js +67 -0
  414. package/dist/src/recovery/joint-install-native-rebase.js.map +1 -0
  415. package/dist/src/recovery/performance.d.ts +4 -0
  416. package/dist/src/recovery/performance.js +26 -0
  417. package/dist/src/recovery/performance.js.map +1 -0
  418. package/dist/src/recovery/receipt.d.ts +131 -0
  419. package/dist/src/recovery/receipt.js +91 -0
  420. package/dist/src/recovery/receipt.js.map +1 -0
  421. package/dist/src/recovery/retirement.d.ts +47 -0
  422. package/dist/src/recovery/retirement.js +504 -0
  423. package/dist/src/recovery/retirement.js.map +1 -0
  424. package/dist/src/recovery/status.d.ts +143 -0
  425. package/dist/src/recovery/status.js +1528 -0
  426. package/dist/src/recovery/status.js.map +1 -0
  427. package/dist/src/recovery/types.d.ts +85 -0
  428. package/dist/src/recovery/types.js +2 -0
  429. package/dist/src/recovery/types.js.map +1 -0
  430. package/dist/src/review/eval-source-input.d.ts +44 -0
  431. package/dist/src/review/eval-source-input.js +213 -0
  432. package/dist/src/review/eval-source-input.js.map +1 -0
  433. package/dist/src/review/platform-profile.d.ts +5 -0
  434. package/dist/src/review/platform-profile.js +13 -0
  435. package/dist/src/review/platform-profile.js.map +1 -0
  436. package/dist/src/review/review-profile.d.ts +20 -0
  437. package/dist/src/review/review-profile.js +286 -0
  438. package/dist/src/review/review-profile.js.map +1 -0
  439. package/dist/src/review/review-selection.d.ts +20 -0
  440. package/dist/src/review/review-selection.js +502 -0
  441. package/dist/src/review/review-selection.js.map +1 -0
  442. package/dist/src/review/review-types.d.ts +71 -0
  443. package/dist/src/review/review-types.js +16 -0
  444. package/dist/src/review/review-types.js.map +1 -0
  445. package/dist/src/review/skill-materialization.d.ts +67 -0
  446. package/dist/src/review/skill-materialization.js +235 -0
  447. package/dist/src/review/skill-materialization.js.map +1 -0
  448. package/dist/src/review/source-binding.d.ts +203 -0
  449. package/dist/src/review/source-binding.js +791 -0
  450. package/dist/src/review/source-binding.js.map +1 -0
  451. package/dist/src/tui/agent-management.d.ts +23 -0
  452. package/dist/src/tui/agent-management.js +319 -0
  453. package/dist/src/tui/agent-management.js.map +1 -0
  454. package/dist/src/tui/agent-settings.d.ts +47 -0
  455. package/dist/src/tui/agent-settings.js +97 -0
  456. package/dist/src/tui/agent-settings.js.map +1 -0
  457. package/dist/src/tui/catalog-generation.d.ts +9 -0
  458. package/dist/src/tui/catalog-generation.js +96 -6
  459. package/dist/src/tui/catalog-generation.js.map +1 -1
  460. package/dist/src/tui/catalog-sources/projection.d.ts +2 -2
  461. package/dist/src/tui/catalog-sources/screens.js +19 -12
  462. package/dist/src/tui/catalog-sources/screens.js.map +1 -1
  463. package/dist/src/tui/catalog-sources/session.d.ts +11 -1
  464. package/dist/src/tui/catalog-sources/session.js +80 -5
  465. package/dist/src/tui/catalog-sources/session.js.map +1 -1
  466. package/dist/src/tui/catalog-sources/types.d.ts +15 -2
  467. package/dist/src/tui/catalog-store-task.d.ts +16 -0
  468. package/dist/src/tui/catalog-store-task.js +19 -0
  469. package/dist/src/tui/catalog-store-task.js.map +1 -0
  470. package/dist/src/tui/clipboard.d.ts +13 -0
  471. package/dist/src/tui/clipboard.js +95 -0
  472. package/dist/src/tui/clipboard.js.map +1 -0
  473. package/dist/src/tui/components.d.ts +113 -3
  474. package/dist/src/tui/components.js +201 -34
  475. package/dist/src/tui/components.js.map +1 -1
  476. package/dist/src/tui/config-array-draft.d.ts +30 -0
  477. package/dist/src/tui/config-array-draft.js +51 -0
  478. package/dist/src/tui/config-array-draft.js.map +1 -0
  479. package/dist/src/tui/config-leaf-editor.d.ts +44 -0
  480. package/dist/src/tui/config-leaf-editor.js +227 -0
  481. package/dist/src/tui/config-leaf-editor.js.map +1 -0
  482. package/dist/src/tui/config-object-suggestions.d.ts +15 -0
  483. package/dist/src/tui/config-object-suggestions.js +71 -0
  484. package/dist/src/tui/config-object-suggestions.js.map +1 -0
  485. package/dist/src/tui/config-references.d.ts +38 -0
  486. package/dist/src/tui/config-references.js +82 -0
  487. package/dist/src/tui/config-references.js.map +1 -0
  488. package/dist/src/tui/config-suggestions.d.ts +27 -0
  489. package/dist/src/tui/config-suggestions.js +62 -0
  490. package/dist/src/tui/config-suggestions.js.map +1 -0
  491. package/dist/src/tui/config-value-presentation.d.ts +23 -0
  492. package/dist/src/tui/config-value-presentation.js +151 -0
  493. package/dist/src/tui/config-value-presentation.js.map +1 -0
  494. package/dist/src/tui/console-app-v4.d.ts +14 -5
  495. package/dist/src/tui/console-app-v4.js +9779 -2488
  496. package/dist/src/tui/console-app-v4.js.map +1 -1
  497. package/dist/src/tui/content-item-card.d.ts +13 -0
  498. package/dist/src/tui/content-item-card.js +51 -0
  499. package/dist/src/tui/content-item-card.js.map +1 -0
  500. package/dist/src/tui/controller-runtime.d.ts +4 -3
  501. package/dist/src/tui/controller-runtime.js +1610 -590
  502. package/dist/src/tui/controller-runtime.js.map +1 -1
  503. package/dist/src/tui/controller.d.ts +583 -80
  504. package/dist/src/tui/controller.js +3362 -263
  505. package/dist/src/tui/controller.js.map +1 -1
  506. package/dist/src/tui/dependency-graph-view.d.ts +39 -0
  507. package/dist/src/tui/dependency-graph-view.js +121 -0
  508. package/dist/src/tui/dependency-graph-view.js.map +1 -0
  509. package/dist/src/tui/dependency-graph.d.ts +81 -0
  510. package/dist/src/tui/dependency-graph.js +452 -0
  511. package/dist/src/tui/dependency-graph.js.map +1 -0
  512. package/dist/src/tui/deployment-view.d.ts +14 -0
  513. package/dist/src/tui/deployment-view.js +175 -0
  514. package/dist/src/tui/deployment-view.js.map +1 -0
  515. package/dist/src/tui/diagnostic-projection.d.ts +31 -0
  516. package/dist/src/tui/diagnostic-projection.js +681 -0
  517. package/dist/src/tui/diagnostic-projection.js.map +1 -0
  518. package/dist/src/tui/diagnostics.d.ts +6 -2
  519. package/dist/src/tui/diagnostics.js +14 -2
  520. package/dist/src/tui/diagnostics.js.map +1 -1
  521. package/dist/src/tui/entity-cards.d.ts +56 -0
  522. package/dist/src/tui/entity-cards.js +327 -0
  523. package/dist/src/tui/entity-cards.js.map +1 -0
  524. package/dist/src/tui/glossary.d.ts +25 -0
  525. package/dist/src/tui/glossary.js +78 -0
  526. package/dist/src/tui/glossary.js.map +1 -0
  527. package/dist/src/tui/guided-setup.d.ts +25 -0
  528. package/dist/src/tui/guided-setup.js +101 -0
  529. package/dist/src/tui/guided-setup.js.map +1 -0
  530. package/dist/src/tui/index.d.ts +4 -1
  531. package/dist/src/tui/index.js +4 -1
  532. package/dist/src/tui/index.js.map +1 -1
  533. package/dist/src/tui/input-display.d.ts +1 -0
  534. package/dist/src/tui/input-display.js +23 -1
  535. package/dist/src/tui/input-display.js.map +1 -1
  536. package/dist/src/tui/keys.d.ts +44 -0
  537. package/dist/src/tui/keys.js +43 -15
  538. package/dist/src/tui/keys.js.map +1 -1
  539. package/dist/src/tui/lifecycle-action-view.d.ts +6 -0
  540. package/dist/src/tui/lifecycle-action-view.js +36 -0
  541. package/dist/src/tui/lifecycle-action-view.js.map +1 -0
  542. package/dist/src/tui/model.d.ts +141 -28
  543. package/dist/src/tui/model.js +968 -285
  544. package/dist/src/tui/model.js.map +1 -1
  545. package/dist/src/tui/operation-diagnostic-screens.d.ts +8 -0
  546. package/dist/src/tui/operation-diagnostic-screens.js +76 -0
  547. package/dist/src/tui/operation-diagnostic-screens.js.map +1 -0
  548. package/dist/src/tui/operation-history.d.ts +91 -0
  549. package/dist/src/tui/operation-history.js +167 -0
  550. package/dist/src/tui/operation-history.js.map +1 -0
  551. package/dist/src/tui/operation-review-planner.d.ts +7 -0
  552. package/dist/src/tui/operation-review-planner.js +980 -146
  553. package/dist/src/tui/operation-review-planner.js.map +1 -1
  554. package/dist/src/tui/plugin-content.d.ts +33 -0
  555. package/dist/src/tui/plugin-content.js +245 -0
  556. package/dist/src/tui/plugin-content.js.map +1 -0
  557. package/dist/src/tui/plugin-detail.d.ts +75 -0
  558. package/dist/src/tui/plugin-detail.js +267 -0
  559. package/dist/src/tui/plugin-detail.js.map +1 -0
  560. package/dist/src/tui/plugin-write-task.d.ts +69 -0
  561. package/dist/src/tui/plugin-write-task.js +286 -0
  562. package/dist/src/tui/plugin-write-task.js.map +1 -0
  563. package/dist/src/tui/query-header.d.ts +30 -0
  564. package/dist/src/tui/query-header.js +40 -0
  565. package/dist/src/tui/query-header.js.map +1 -0
  566. package/dist/src/tui/reader.d.ts +38 -0
  567. package/dist/src/tui/reader.js +49 -0
  568. package/dist/src/tui/reader.js.map +1 -0
  569. package/dist/src/tui/router.d.ts +170 -39
  570. package/dist/src/tui/router.js +338 -50
  571. package/dist/src/tui/router.js.map +1 -1
  572. package/dist/src/tui/scoped-flow.d.ts +49 -0
  573. package/dist/src/tui/scoped-flow.js +212 -0
  574. package/dist/src/tui/scoped-flow.js.map +1 -0
  575. package/dist/src/tui/scoped-inventory.d.ts +139 -0
  576. package/dist/src/tui/scoped-inventory.js +295 -0
  577. package/dist/src/tui/scoped-inventory.js.map +1 -0
  578. package/dist/src/tui/screen-registry.d.ts +696 -0
  579. package/dist/src/tui/screen-registry.js +226 -0
  580. package/dist/src/tui/screen-registry.js.map +1 -0
  581. package/dist/src/tui/session-console-app.d.ts +8 -0
  582. package/dist/src/tui/session-console-app.js +24 -0
  583. package/dist/src/tui/session-console-app.js.map +1 -0
  584. package/dist/src/tui/session-host.d.ts +45 -0
  585. package/dist/src/tui/session-host.js +219 -0
  586. package/dist/src/tui/session-host.js.map +1 -0
  587. package/dist/src/tui/source-detail-card.d.ts +29 -0
  588. package/dist/src/tui/source-detail-card.js +45 -0
  589. package/dist/src/tui/source-detail-card.js.map +1 -0
  590. package/dist/src/tui/theme.d.ts +12 -0
  591. package/dist/src/tui/theme.js +12 -0
  592. package/dist/src/tui/theme.js.map +1 -1
  593. package/dist/src/tui/viewport.d.ts +1 -0
  594. package/dist/src/tui/viewport.js +23 -0
  595. package/dist/src/tui/viewport.js.map +1 -1
  596. package/dist/src/tui/wizard.js +26 -4
  597. package/dist/src/tui/wizard.js.map +1 -1
  598. package/dist/src/types.d.ts +105 -83
  599. package/dist/src/types.js +1 -1
  600. package/dist/src/types.js.map +1 -1
  601. package/dist/src/utils/agent-version.d.ts +10 -4
  602. package/dist/src/utils/agent-version.js +6 -8
  603. package/dist/src/utils/agent-version.js.map +1 -1
  604. package/dist/src/utils/artifact-plan.d.ts +18 -25
  605. package/dist/src/utils/artifact-plan.js +59 -445
  606. package/dist/src/utils/artifact-plan.js.map +1 -1
  607. package/dist/src/utils/artifact-renderer.d.ts +64 -90
  608. package/dist/src/utils/artifact-renderer.js +202 -303
  609. package/dist/src/utils/artifact-renderer.js.map +1 -1
  610. package/dist/src/utils/artifact-request.d.ts +19 -14
  611. package/dist/src/utils/artifact-request.js +51 -36
  612. package/dist/src/utils/artifact-request.js.map +1 -1
  613. package/dist/src/utils/artifact-sources.d.ts +4 -8
  614. package/dist/src/utils/artifact-sources.js +15 -6
  615. package/dist/src/utils/artifact-sources.js.map +1 -1
  616. package/dist/src/utils/aw-home-mutation-lock.d.ts +1 -0
  617. package/dist/src/utils/aw-home-mutation-lock.js +28 -6
  618. package/dist/src/utils/aw-home-mutation-lock.js.map +1 -1
  619. package/dist/src/utils/bundle-layout.d.ts +2 -0
  620. package/dist/src/utils/bundle-layout.js +88 -158
  621. package/dist/src/utils/bundle-layout.js.map +1 -1
  622. package/dist/src/utils/catalog-capability-projection.d.ts +8 -0
  623. package/dist/src/utils/catalog-capability-projection.js +14 -0
  624. package/dist/src/utils/catalog-capability-projection.js.map +1 -0
  625. package/dist/src/utils/catalog-digests.d.ts +2 -12
  626. package/dist/src/utils/catalog-digests.js +7 -55
  627. package/dist/src/utils/catalog-digests.js.map +1 -1
  628. package/dist/src/utils/catalog-generation-resolver.d.ts +28 -4
  629. package/dist/src/utils/catalog-generation-resolver.js +146 -40
  630. package/dist/src/utils/catalog-generation-resolver.js.map +1 -1
  631. package/dist/src/utils/catalog-generation-service.d.ts +25 -2
  632. package/dist/src/utils/catalog-generation-service.js +99 -48
  633. package/dist/src/utils/catalog-generation-service.js.map +1 -1
  634. package/dist/src/utils/catalog-generation-state.js +1 -1
  635. package/dist/src/utils/catalog-generation-state.js.map +1 -1
  636. package/dist/src/utils/catalog-generation-store.d.ts +5 -0
  637. package/dist/src/utils/catalog-generation-store.js +69 -10
  638. package/dist/src/utils/catalog-generation-store.js.map +1 -1
  639. package/dist/src/utils/catalog-operation-context.d.ts +61 -4
  640. package/dist/src/utils/catalog-operation-context.js +225 -4
  641. package/dist/src/utils/catalog-operation-context.js.map +1 -1
  642. package/dist/src/utils/catalog-public-error.js +4 -0
  643. package/dist/src/utils/catalog-public-error.js.map +1 -1
  644. package/dist/src/utils/catalog-runtime-projection.d.ts +4 -3
  645. package/dist/src/utils/catalog-runtime-projection.js.map +1 -1
  646. package/dist/src/utils/catalog-snapshot.d.ts +3 -0
  647. package/dist/src/utils/catalog-snapshot.js +4 -1
  648. package/dist/src/utils/catalog-snapshot.js.map +1 -1
  649. package/dist/src/utils/catalog-source-impact.d.ts +3 -2
  650. package/dist/src/utils/catalog-source-impact.js +142 -20
  651. package/dist/src/utils/catalog-source-impact.js.map +1 -1
  652. package/dist/src/utils/catalog-source-references.d.ts +57 -1
  653. package/dist/src/utils/catalog-source-references.js +755 -162
  654. package/dist/src/utils/catalog-source-references.js.map +1 -1
  655. package/dist/src/utils/catalog-sources.d.ts +1 -1
  656. package/dist/src/utils/catalog-sources.js +21 -5
  657. package/dist/src/utils/catalog-sources.js.map +1 -1
  658. package/dist/src/utils/codex-config.d.ts +3 -0
  659. package/dist/src/utils/codex-config.js +7 -0
  660. package/dist/src/utils/codex-config.js.map +1 -1
  661. package/dist/src/utils/codex-executable-discovery.d.ts +28 -0
  662. package/dist/src/utils/codex-executable-discovery.js +431 -0
  663. package/dist/src/utils/codex-executable-discovery.js.map +1 -0
  664. package/dist/src/utils/codex-manager.d.ts +23 -42
  665. package/dist/src/utils/codex-manager.js +79 -767
  666. package/dist/src/utils/codex-manager.js.map +1 -1
  667. package/dist/src/utils/codex-native-observation.d.ts +40 -1
  668. package/dist/src/utils/codex-native-observation.js +172 -0
  669. package/dist/src/utils/codex-native-observation.js.map +1 -1
  670. package/dist/src/utils/codex-reconciler.d.ts +2 -7
  671. package/dist/src/utils/codex-reconciler.js +33 -5
  672. package/dist/src/utils/codex-reconciler.js.map +1 -1
  673. package/dist/src/utils/codex-shared-native.d.ts +8 -26
  674. package/dist/src/utils/codex-shared-native.js +63 -83
  675. package/dist/src/utils/codex-shared-native.js.map +1 -1
  676. package/dist/src/utils/codex-skill-staging.d.ts +4 -3
  677. package/dist/src/utils/codex-skill-staging.js.map +1 -1
  678. package/dist/src/utils/codex-skills-root.d.ts +4 -0
  679. package/dist/src/utils/codex-skills-root.js +29 -0
  680. package/dist/src/utils/codex-skills-root.js.map +1 -0
  681. package/dist/src/utils/codex-surface-analysis.d.ts +6 -2
  682. package/dist/src/utils/codex-surface-analysis.js +31 -56
  683. package/dist/src/utils/codex-surface-analysis.js.map +1 -1
  684. package/dist/src/utils/component-agent-binding.d.ts +17 -0
  685. package/dist/src/utils/component-agent-binding.js +119 -0
  686. package/dist/src/utils/component-agent-binding.js.map +1 -0
  687. package/dist/src/utils/component-command-preparation.d.ts +33 -0
  688. package/dist/src/utils/component-command-preparation.js +129 -0
  689. package/dist/src/utils/component-command-preparation.js.map +1 -0
  690. package/dist/src/utils/component-gap.d.ts +4 -0
  691. package/dist/src/utils/component-gap.js +16 -0
  692. package/dist/src/utils/component-gap.js.map +1 -0
  693. package/dist/src/utils/component-resources.d.ts +53 -0
  694. package/dist/src/utils/component-resources.js +340 -0
  695. package/dist/src/utils/component-resources.js.map +1 -0
  696. package/dist/src/utils/config-platforms.d.ts +21 -0
  697. package/dist/src/utils/config-platforms.js +51 -0
  698. package/dist/src/utils/config-platforms.js.map +1 -0
  699. package/dist/src/utils/dynamic-skill-tree.d.ts +18 -6
  700. package/dist/src/utils/dynamic-skill-tree.js +33 -40
  701. package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
  702. package/dist/src/utils/git-catalog-provider.d.ts +3 -0
  703. package/dist/src/utils/git-catalog-provider.js +49 -3
  704. package/dist/src/utils/git-catalog-provider.js.map +1 -1
  705. package/dist/src/utils/inventory-recovery-diagnostic.d.ts +4 -0
  706. package/dist/src/utils/inventory-recovery-diagnostic.js +15 -0
  707. package/dist/src/utils/inventory-recovery-diagnostic.js.map +1 -0
  708. package/dist/src/utils/local-marketplace.d.ts +19 -12
  709. package/dist/src/utils/local-marketplace.js +97 -194
  710. package/dist/src/utils/local-marketplace.js.map +1 -1
  711. package/dist/src/utils/managed-command-cli-review.d.ts +53 -0
  712. package/dist/src/utils/managed-command-cli-review.js +431 -0
  713. package/dist/src/utils/managed-command-cli-review.js.map +1 -0
  714. package/dist/src/utils/managed-command-closure.d.ts +14 -0
  715. package/dist/src/utils/managed-command-closure.js +156 -0
  716. package/dist/src/utils/managed-command-closure.js.map +1 -0
  717. package/dist/src/utils/managed-command-errors.d.ts +5 -0
  718. package/dist/src/utils/managed-command-errors.js +10 -0
  719. package/dist/src/utils/managed-command-errors.js.map +1 -0
  720. package/dist/src/utils/managed-command-materialization.d.ts +90 -0
  721. package/dist/src/utils/managed-command-materialization.js +375 -0
  722. package/dist/src/utils/managed-command-materialization.js.map +1 -0
  723. package/dist/src/utils/managed-command-preparation.d.ts +30 -0
  724. package/dist/src/utils/managed-command-preparation.js +39 -0
  725. package/dist/src/utils/managed-command-preparation.js.map +1 -0
  726. package/dist/src/utils/managed-command-review.d.ts +33 -0
  727. package/dist/src/utils/managed-command-review.js +80 -0
  728. package/dist/src/utils/managed-command-review.js.map +1 -0
  729. package/dist/src/utils/managed-command-runtime.d.ts +36 -0
  730. package/dist/src/utils/managed-command-runtime.js +126 -0
  731. package/dist/src/utils/managed-command-runtime.js.map +1 -0
  732. package/dist/src/utils/managed-command-snapshots.d.ts +24 -0
  733. package/dist/src/utils/managed-command-snapshots.js +89 -0
  734. package/dist/src/utils/managed-command-snapshots.js.map +1 -0
  735. package/dist/src/utils/managed-command-store.d.ts +141 -0
  736. package/dist/src/utils/managed-command-store.js +839 -0
  737. package/dist/src/utils/managed-command-store.js.map +1 -0
  738. package/dist/src/utils/multi-source-catalog.d.ts +6 -1
  739. package/dist/src/utils/multi-source-catalog.js +9 -4
  740. package/dist/src/utils/multi-source-catalog.js.map +1 -1
  741. package/dist/src/utils/native-cli-interruption.d.ts +11 -0
  742. package/dist/src/utils/native-cli-interruption.js +106 -0
  743. package/dist/src/utils/native-cli-interruption.js.map +1 -0
  744. package/dist/src/utils/native-cli.d.ts +37 -6
  745. package/dist/src/utils/native-cli.js +523 -60
  746. package/dist/src/utils/native-cli.js.map +1 -1
  747. package/dist/src/utils/native-demand.d.ts +29 -0
  748. package/dist/src/utils/native-demand.js +4 -0
  749. package/dist/src/utils/native-demand.js.map +1 -0
  750. package/dist/src/utils/native-tool-context.d.ts +17 -0
  751. package/dist/src/utils/native-tool-context.js +40 -0
  752. package/dist/src/utils/native-tool-context.js.map +1 -0
  753. package/dist/src/utils/native-tool-review.d.ts +8 -0
  754. package/dist/src/utils/native-tool-review.js +14 -0
  755. package/dist/src/utils/native-tool-review.js.map +1 -0
  756. package/dist/src/utils/ownership.d.ts +38 -3
  757. package/dist/src/utils/ownership.js +118 -11
  758. package/dist/src/utils/ownership.js.map +1 -1
  759. package/dist/src/utils/package-content.d.ts +7 -0
  760. package/dist/src/utils/package-content.js +70 -0
  761. package/dist/src/utils/package-content.js.map +1 -0
  762. package/dist/src/utils/path-catalog-provider.js +2 -0
  763. package/dist/src/utils/path-catalog-provider.js.map +1 -1
  764. package/dist/src/utils/paths.d.ts +1 -1
  765. package/dist/src/utils/paths.js +5 -2
  766. package/dist/src/utils/paths.js.map +1 -1
  767. package/dist/src/utils/platform-empty-state.d.ts +69 -0
  768. package/dist/src/utils/platform-empty-state.js +249 -0
  769. package/dist/src/utils/platform-empty-state.js.map +1 -0
  770. package/dist/src/utils/platform-support.d.ts +1 -1
  771. package/dist/src/utils/platform-support.js +1 -1
  772. package/dist/src/utils/platform-support.js.map +1 -1
  773. package/dist/src/utils/plugin-config-command-apply.d.ts +33 -0
  774. package/dist/src/utils/plugin-config-command-apply.js +142 -0
  775. package/dist/src/utils/plugin-config-command-apply.js.map +1 -0
  776. package/dist/src/utils/plugin-config-diagnostics.d.ts +16 -0
  777. package/dist/src/utils/plugin-config-diagnostics.js +44 -0
  778. package/dist/src/utils/plugin-config-diagnostics.js.map +1 -0
  779. package/dist/src/utils/plugin-config-impact.d.ts +76 -0
  780. package/dist/src/utils/plugin-config-impact.js +359 -0
  781. package/dist/src/utils/plugin-config-impact.js.map +1 -0
  782. package/dist/src/utils/plugin-config-references.d.ts +116 -0
  783. package/dist/src/utils/plugin-config-references.js +379 -0
  784. package/dist/src/utils/plugin-config-references.js.map +1 -0
  785. package/dist/src/utils/plugin-config-suggestion-runner.d.ts +83 -0
  786. package/dist/src/utils/plugin-config-suggestion-runner.js +308 -0
  787. package/dist/src/utils/plugin-config-suggestion-runner.js.map +1 -0
  788. package/dist/src/utils/plugin-config-suggestions.d.ts +50 -0
  789. package/dist/src/utils/plugin-config-suggestions.js +322 -0
  790. package/dist/src/utils/plugin-config-suggestions.js.map +1 -0
  791. package/dist/src/utils/plugin-config-write.d.ts +108 -19
  792. package/dist/src/utils/plugin-config-write.js +781 -568
  793. package/dist/src/utils/plugin-config-write.js.map +1 -1
  794. package/dist/src/utils/plugin-config.d.ts +122 -43
  795. package/dist/src/utils/plugin-config.js +574 -610
  796. package/dist/src/utils/plugin-config.js.map +1 -1
  797. package/dist/src/utils/plugin-dependencies.d.ts +1 -1
  798. package/dist/src/utils/plugin-dependencies.js.map +1 -1
  799. package/dist/src/utils/plugin-scripts.d.ts +41 -17
  800. package/dist/src/utils/plugin-scripts.js +586 -123
  801. package/dist/src/utils/plugin-scripts.js.map +1 -1
  802. package/dist/src/utils/process-lock.d.ts +1 -0
  803. package/dist/src/utils/process-lock.js +22 -5
  804. package/dist/src/utils/process-lock.js.map +1 -1
  805. package/dist/src/utils/process-tree.d.ts +2 -2
  806. package/dist/src/utils/process-tree.js +1 -1
  807. package/dist/src/utils/process-tree.js.map +1 -1
  808. package/dist/src/utils/project-boundary.d.ts +11 -1
  809. package/dist/src/utils/project-boundary.js +33 -11
  810. package/dist/src/utils/project-boundary.js.map +1 -1
  811. package/dist/src/utils/rendered-contract.js +24 -1
  812. package/dist/src/utils/rendered-contract.js.map +1 -1
  813. package/dist/src/utils/runtime-config.d.ts +18 -0
  814. package/dist/src/utils/runtime-config.js +64 -0
  815. package/dist/src/utils/runtime-config.js.map +1 -0
  816. package/dist/src/utils/runtime-skill-closure.d.ts +2 -2
  817. package/dist/src/utils/runtime-skill-closure.js +50 -7
  818. package/dist/src/utils/runtime-skill-closure.js.map +1 -1
  819. package/dist/src/utils/safe-operation-diagnostic.d.ts +15 -0
  820. package/dist/src/utils/safe-operation-diagnostic.js +33 -0
  821. package/dist/src/utils/safe-operation-diagnostic.js.map +1 -0
  822. package/dist/src/utils/sensitive-content.d.ts +4 -0
  823. package/dist/src/utils/sensitive-content.js +36 -0
  824. package/dist/src/utils/sensitive-content.js.map +1 -0
  825. package/dist/src/utils/skill-invocation-warning.d.ts +19 -0
  826. package/dist/src/utils/skill-invocation-warning.js +43 -0
  827. package/dist/src/utils/skill-invocation-warning.js.map +1 -0
  828. package/dist/src/utils/skill-validation.js +0 -5
  829. package/dist/src/utils/skill-validation.js.map +1 -1
  830. package/dist/src/utils/state-paths.d.ts +8 -3
  831. package/dist/src/utils/state-paths.js +53 -16
  832. package/dist/src/utils/state-paths.js.map +1 -1
  833. package/dist/src/utils/target-eligibility.d.ts +2 -2
  834. package/dist/src/utils/target-eligibility.js.map +1 -1
  835. package/dist/src/utils/windows-claude-shim.d.ts +7 -0
  836. package/dist/src/utils/windows-claude-shim.js +10 -0
  837. package/dist/src/utils/windows-claude-shim.js.map +1 -0
  838. package/dist/src/utils/windows-npm-shim.d.ts +16 -0
  839. package/dist/src/utils/windows-npm-shim.js +155 -0
  840. package/dist/src/utils/windows-npm-shim.js.map +1 -0
  841. package/dist/vitest.config.js +109 -9
  842. package/dist/vitest.config.js.map +1 -1
  843. package/package.json +20 -12
  844. package/dist/authoring/templates/aw-config-runtime.d.mts +0 -2
  845. package/dist/authoring/templates/aw-config-runtime.mjs +0 -407
  846. package/dist/authoring/templates/aw-config-runtime.mjs.map +0 -1
  847. package/dist/src/commands/review-publication.d.ts +0 -99
  848. package/dist/src/commands/review-publication.js +0 -904
  849. package/dist/src/commands/review-publication.js.map +0 -1
  850. package/dist/src/commands/sync-command.d.ts +0 -23
  851. package/dist/src/commands/sync-command.js +0 -242
  852. package/dist/src/commands/sync-command.js.map +0 -1
  853. package/dist/src/portable/skills-cli.d.ts +0 -43
  854. package/dist/src/portable/skills-cli.js +0 -148
  855. package/dist/src/portable/skills-cli.js.map +0 -1
  856. package/dist/src/utils/codex-native-render-receipt.d.ts +0 -40
  857. package/dist/src/utils/codex-native-render-receipt.js +0 -205
  858. package/dist/src/utils/codex-native-render-receipt.js.map +0 -1
  859. package/dist/src/utils/plugin-intent-state.d.ts +0 -34
  860. package/dist/src/utils/plugin-intent-state.js +0 -289
  861. package/dist/src/utils/plugin-intent-state.js.map +0 -1
  862. package/dist/src/utils/slash-commands.d.ts +0 -1
  863. package/dist/src/utils/slash-commands.js +0 -2
  864. package/dist/src/utils/slash-commands.js.map +0 -1
@@ -1,28 +1,71 @@
1
+ import { isCanonicalCodexMarketplaceRegistration } from '../utils/codex-shared-native.js';
2
+ import { selectAgents } from '../intent/deployment-preferences.js';
3
+ import { resolveActiveConfigPlatforms } from '../utils/config-platforms.js';
4
+ import { configStatusDiagnostics } from '../utils/plugin-config-diagnostics.js';
5
+ import { createScopeContext } from '../intent/scope-context.js';
6
+ import { inspectPortableExtraInstalled } from '../portable/recovery.js';
7
+ import { readDemand, demandNativeProjection } from '../recovery/demand.js';
8
+ import { deriveJointDemand } from '../recovery/joint-demand.js';
1
9
  import fs from 'node:fs';
2
10
  import path from 'node:path';
3
11
  import { analyzeCodexSurface } from '../utils/codex-surface-analysis.js';
4
12
  import { catalogSourceErrorCode, sanitizeCatalogSourceError, } from '../utils/catalog-public-error.js';
5
13
  import { calculateCatalogSourceIdentity } from '../utils/catalog-source-identity.js';
6
- import { canonicalMarketplaceRegistrationNames, inventoryCatalogSourceReferences, inventoryLegacyOwnerReferences, } from '../utils/catalog-source-references.js';
14
+ import { legacyCanonicalMarketplaceRegistrationNames, inventoryCatalogSourceReferences, inventoryLegacyOwnerReferences, } from '../utils/catalog-source-references.js';
15
+ import { readStrictNamespacedMarketplaceRoot } from '../utils/local-marketplace.js';
7
16
  import { readCatalogSourcesConfigSnapshot, resolveCatalogSourceRef } from '../utils/catalog-sources.js';
8
17
  import { formatPluginId, parsePluginId, planPluginSelectorSourceIds, withResolvedMultiSourceCatalog, } from '../utils/multi-source-catalog.js';
9
18
  import { assertStrictSemVer, checkAwCapabilitySupport, compareStrictSemVer, readPluginManifest, tryParseStrictSemVer, } from '../utils/manifest.js';
10
19
  import { resolveCliPackageRoot, resolveCodexPaths } from '../utils/paths.js';
11
- import { supportsPlatform } from '../utils/platform-support.js';
20
+ import { resolveSupportedPlatforms, supportsPlatform } from '../utils/platform-support.js';
12
21
  import { parsePlatformValue, parseScopeValue } from './options.js';
13
22
  import { inspectCodexPluginRegistrationLive, inspectCodexSharedNativeLive, inspectRebuildTarget, } from './rebuild-integration.js';
14
23
  import { createNoopReporter } from '../output/reporter.js';
15
24
  import { createNoopDebugLogger } from '../output/debug-log.js';
16
- import { getDefaultNativeCliRunner } from '../utils/native-cli.js';
25
+ import { bindNativeCliRunnerSignal, getDefaultNativeCliRunner } from '../utils/native-cli.js';
26
+ import { createCodexNativeObservationSession, } from '../utils/codex-native-observation.js';
17
27
  import { resolveAwHome } from '../utils/paths.js';
18
- import { codexProjectConfigAliasesUserHome, createProjectLocationKey, getClaudeHome, getCodexHome, resolveCanonicalRepoProjectKey, } from '../utils/state-paths.js';
28
+ import { codexProjectConfigAliasesUserHome, createProjectLocationKey, getClaudeHome, getCodexHome, resolveAwHomeCanonical, resolveRequiredCanonicalRepoRoot, } from '../utils/state-paths.js';
19
29
  import { resolveEffectivePluginConfig, resolveProjectArtifactRenderConfig, } from '../utils/plugin-config.js';
20
30
  import { readCodexConfigFile } from '../utils/codex-config.js';
21
- import { readPluginIntentState, } from '../utils/plugin-intent-state.js';
31
+ import { createEmptyNativeDemandView } from '../utils/native-demand.js';
22
32
  import { IMPLEMENTED_AW_CAPABILITIES } from './aw-capabilities.js';
23
33
  import { createDependencyPlacementPlan } from './dependency-operation-plan.js';
24
34
  import { getCodexOperationRequirement } from '../utils/agent-version.js';
25
- import { inspectSystemCodexFilesystem, } from '../utils/codex-manager.js';
35
+ import { inspectSystemCodex, } from '../utils/codex-manager.js';
36
+ export function statusTargetPlacements(target) {
37
+ if (target.platform === 'claude')
38
+ return [target];
39
+ return target.placements.map((placement) => ({
40
+ pluginName: target.pluginName,
41
+ sourceId: target.sourceId,
42
+ sourceIdentity: target.sourceIdentity,
43
+ pluginId: target.pluginId,
44
+ ...(target.version ? { version: target.version } : {}),
45
+ platform: target.platform,
46
+ cwd: target.cwd,
47
+ ...placement,
48
+ sharedComponents: target.components.filter((component) => component.kind !== 'systemConsumer' || component.key === `codex:${placement.scope}`),
49
+ sharedReasons: target.reasons.filter((reason) => reason.code.startsWith('codexSharedNative') || reason.code === 'staleCacheObserved'
50
+ || reason.code === 'codexCandidateExcluded'),
51
+ }));
52
+ }
53
+ export function flattenStatusTargets(targets) {
54
+ return targets.flatMap(statusTargetPlacements);
55
+ }
56
+ /** Existing output evidence is required before config apply can refresh a target. */
57
+ export function statusTargetHasLiveConfigConsumer(target) {
58
+ return target.components.some((component) => component.kind === 'ownership'
59
+ && component.key !== 'native'
60
+ && component.key !== target.pluginName
61
+ && !component.key.startsWith('activation-') && !component.key.startsWith('marketplace-')
62
+ && ['present', 'partial'].includes(component.state))
63
+ || (target.platform === 'claude' && target.components.some((component) => component.kind === 'activation'
64
+ && component.key === target.scope && component.state === 'enabled'))
65
+ || (target.sharedComponents?.some((component) => component.kind === 'sharedNative' && ['usable', 'replaceable'].includes(component.state)) === true
66
+ && target.components.some((component) => component.kind === 'activation'
67
+ && component.key === target.scope && component.state === 'enabled'));
68
+ }
26
69
  export function projectStatusSharedNativeReasons(sharedNative, existingReasonCodes = [], desiredEnabled = false) {
27
70
  if (!sharedNative)
28
71
  return [];
@@ -46,13 +89,13 @@ export function projectStatusSharedNativeReasons(sharedNative, existingReasonCod
46
89
  ? [blocking('codexSharedNativeCorrupt', `${sharedNative.pluginId} is unreadable.`)]
47
90
  : []),
48
91
  ...(sharedNative.state === 'replaceable' && sharedNative.reason === 'damaged'
49
- ? [warning('codexSharedNativeCorrupt', `${sharedNative.pluginId} is damaged and can be replaced.`)]
92
+ ? [warning('codexSharedNativeCorrupt', `${sharedNative.pluginId} shared generated content is missing or damaged and can be replaced.`)]
50
93
  : []),
51
94
  ...(sharedNative.state === 'replaceable' && sharedNative.reason === 'outdated'
52
95
  ? [warning('codexSharedNativeUpdateRequired', `${sharedNative.pluginId} requires a shared update.`)]
53
96
  : []),
54
97
  ...(sharedNative.state === 'replaceable' && sharedNative.reason === 'renderDrift'
55
- ? [warning('codexSharedNativeRenderDrift', `${sharedNative.pluginId} render inputs changed and the shared native projection can be replaced.`)]
98
+ ? [warning('codexSharedNativeRenderDrift', `${sharedNative.pluginId} shared generated content does not match the current render inputs and can be replaced.`)]
56
99
  : []),
57
100
  ...(sharedNative.staleCacheObserved
58
101
  ? [warning('staleCacheObserved', `${sharedNative.pluginId} has non-blocking stale Codex cache residue.`)]
@@ -63,7 +106,7 @@ export function projectStatusSharedNativeReasons(sharedNative, existingReasonCod
63
106
  ];
64
107
  }
65
108
  function statusComponent(target, kind, key) {
66
- return target.components.find((component) => component.kind === kind && (key === undefined || component.key === key));
109
+ return [...target.components, ...(target.sharedComponents ?? [])].find((component) => component.kind === kind && (key === undefined || component.key === key));
67
110
  }
68
111
  export function statusTargetIntent(target) {
69
112
  const metadata = statusComponent(target, 'intent', 'desired')?.metadata;
@@ -120,7 +163,7 @@ export function statusTargetSharedNative(target) {
120
163
  export function statusTargetActivation(target) {
121
164
  const user = statusComponent(target, 'activation', 'user');
122
165
  const project = statusComponent(target, 'activation', 'project');
123
- const consumer = statusComponent(target, 'systemConsumer', 'codex');
166
+ const consumer = statusComponent(target, 'systemConsumer');
124
167
  if (!user && !project && !consumer)
125
168
  return undefined;
126
169
  const activation = user ?? project ?? consumer;
@@ -136,15 +179,19 @@ export function statusTargetActivation(target) {
136
179
  : consumer.state === 'compatible' && typeof detectedVersion === 'string'
137
180
  ? { state: 'compatible', detectedVersion, requiredMinVersion }
138
181
  : consumer.state === 'incompatible'
139
- && (code === 'codexProjectPluginVersionTooLow' || code === 'codexSystemCliUnsupported')
182
+ && code === 'codexSystemCliUnsupported'
140
183
  && typeof detectedVersion === 'string'
141
184
  && typeof diagnostic === 'string'
142
185
  ? { state: 'incompatible', code, detectedVersion, diagnostic, requiredMinVersion }
143
186
  : consumer.state === 'unresolved'
144
- && (code === 'codexProjectPluginUnsupported' || code === 'codexSystemCliUnsupported')
187
+ && code === 'codexSystemCliUnsupported'
145
188
  && typeof diagnostic === 'string'
146
189
  ? { state: 'unresolved', code, diagnostic, requiredMinVersion }
147
190
  : undefined;
191
+ const diagnostics = consumer.metadata?.diagnostics;
192
+ if (systemConsumer && Array.isArray(diagnostics) && diagnostics.length > 0) {
193
+ systemConsumer = { ...systemConsumer, diagnostics: diagnostics.filter((value) => typeof value === 'string') };
194
+ }
148
195
  }
149
196
  return {
150
197
  ...(user ? { user: user.state === 'enabled' } : {}),
@@ -172,12 +219,15 @@ export function statusTargetExtensions(target) {
172
219
  : [];
173
220
  return { state: component.state, kinds };
174
221
  }
222
+ function resolveCatalogEntrySupportedPlatforms(policy) {
223
+ return resolveSupportedPlatforms({ marketplace: { policy } });
224
+ }
175
225
  let dependencyInspectionHookForTests;
176
226
  export function setStatusDependencyInspectionHookForTests(hook) {
177
227
  dependencyInspectionHookForTests = hook;
178
228
  }
179
229
  export async function loadConsoleItemsResult(options = {}, runtime = {}) {
180
- const result = await statusCommandV7({
230
+ const result = await statusCommandV8({
181
231
  cwd: options.cwd ?? process.cwd(),
182
232
  env: runtime.env,
183
233
  platform: options.platform,
@@ -199,7 +249,7 @@ export async function loadConsoleItemsResult(options = {}, runtime = {}) {
199
249
  ...(pluginSummary ? { pluginSummary } : {}),
200
250
  targets: [],
201
251
  };
202
- current.targets.push(target);
252
+ current.targets.push(...statusTargetPlacements(target));
203
253
  groups.set(target.pluginId, current);
204
254
  }
205
255
  const allSourcesFailed = result.payload.catalog.sources.length > 0
@@ -228,7 +278,8 @@ function inventoryErrorMatchesSelection(options) {
228
278
  if (relevance.global)
229
279
  return true;
230
280
  if (relevance.projectLocationKey
231
- && relevance.projectLocationKey !== options.currentProjectLocationKey)
281
+ && (!options.currentProjectLocationKey
282
+ || relevance.projectLocationKey !== options.currentProjectLocationKey))
232
283
  return false;
233
284
  if (options.platformExplicit && relevance.platform
234
285
  && !options.platforms.includes(relevance.platform))
@@ -247,6 +298,7 @@ function finalizeTargetError(error, targetState) {
247
298
  return {
248
299
  ...error,
249
300
  severity: error.code === 'artifactCollision'
301
+ || error.code === 'dependencyGraphInvalid'
250
302
  || (targetState === 'error'
251
303
  && error.dependencyPluginId === undefined)
252
304
  ? 'blocking'
@@ -266,19 +318,16 @@ function sourceRequestedRef(source, cliVersion) {
266
318
  }
267
319
  function selectedPlatforms(value) {
268
320
  const selection = value === undefined ? 'both' : parsePlatformValue(value);
269
- return selection === 'both' ? ['codex', 'claude'] : [selection];
321
+ if (selection === 'both')
322
+ return ['codex', 'claude'];
323
+ if (selection === 'codex' || selection === 'claude')
324
+ return [selection];
325
+ throw new Error('statusPlatformAdapterRequired: use recovery status for this platform.');
270
326
  }
271
327
  function selectedScopes(value) {
272
328
  return value === undefined ? ['user', 'project'] : [parseScopeValue(value)];
273
329
  }
274
- function emptyIntent() {
275
- return {
276
- schemaVersion: 2,
277
- kind: 'aw-plugin-intents',
278
- roots: [],
279
- dependencyScopeOverrides: [],
280
- };
281
- }
330
+ const emptyIntent = createEmptyNativeDemandView;
282
331
  function desiredTargetKey(pluginId, platform) {
283
332
  return `${pluginId}\0${platform}`;
284
333
  }
@@ -370,7 +419,7 @@ function calculateDesiredTargetStates(options) {
370
419
  nodes,
371
420
  roots,
372
421
  dependencyEdges: edges,
373
- scopeOverrides: intent.dependencyScopeOverrides.filter((override) => nodeIds.has(override.pluginId)
422
+ scopeOverrides: (intent.dependencyScopeOverrides ?? []).filter((override) => nodeIds.has(override.pluginId)
374
423
  && (override.platform === undefined || override.platform === platform)),
375
424
  });
376
425
  for (const target of plan.targets) {
@@ -383,10 +432,46 @@ function calculateDesiredTargetStates(options) {
383
432
  relation: value.relation,
384
433
  }]));
385
434
  }
386
- function statusRecovery(options) {
387
- if (options.errorCodes?.some((code) => code === 'codexProjectPluginVersionTooLow'
388
- || code === 'codexProjectPluginUnsupported'
389
- || code === 'codexSystemCliUnsupported')) {
435
+ function projectDependencyClosureForTarget(options) {
436
+ const platform = options.platform;
437
+ if (platform !== 'codex' && platform !== 'claude')
438
+ return new Set();
439
+ const byId = new Map(options.available.map((entry) => [
440
+ formatPluginId({ sourceId: entry.source.id, pluginName: entry.name }),
441
+ entry,
442
+ ]));
443
+ const closure = new Set();
444
+ const visit = (pluginId) => {
445
+ const entry = byId.get(pluginId);
446
+ if (!entry)
447
+ return;
448
+ for (const dependency of entry.dependencies) {
449
+ const dependencyId = formatPluginId({
450
+ sourceId: entry.source.id,
451
+ pluginName: dependency,
452
+ });
453
+ const dependencyEntry = byId.get(dependencyId);
454
+ if (!dependencyEntry
455
+ || (!dependencyEntry.targets[platform].user
456
+ && !dependencyEntry.targets[platform].project)
457
+ || closure.has(dependencyId)) {
458
+ continue;
459
+ }
460
+ closure.add(dependencyId);
461
+ visit(dependencyId);
462
+ }
463
+ };
464
+ visit(options.pluginId);
465
+ return closure;
466
+ }
467
+ export function statusRecovery(options) {
468
+ if (options.errorCodes?.includes('removedPluginCleanupRequired')) {
469
+ return [{
470
+ command: 'cleanup',
471
+ description: '整体清理已删除插件在两个平台、用户与当前项目中的安装、设置和遗留记录。',
472
+ }];
473
+ }
474
+ if (options.errorCodes?.some((code) => code === 'codexProjectPluginUnsupported' || code === 'codexSystemCliUnsupported')) {
390
475
  return [{
391
476
  command: 'manual',
392
477
  description: '升级或修复官方 system Codex CLI 后重试原操作。',
@@ -398,8 +483,29 @@ function statusRecovery(options) {
398
483
  description: '升级 AW CLI 到支持插件所需 capability 的版本后重试。',
399
484
  }];
400
485
  }
486
+ if (options.errorCodes?.includes('dependencyGraphInvalid')) {
487
+ return [{
488
+ command: 'manual',
489
+ description: '修复 Catalog 中的插件依赖循环后重试。',
490
+ }];
491
+ }
401
492
  if (options.state === 'ready' || options.state === 'absent')
402
493
  return [];
494
+ if (options.desired.scopes.length === 0
495
+ && options.sharedNative?.state === 'replaceable'
496
+ && options.sharedNative.reason === 'damaged') {
497
+ return [
498
+ ...(options.actualEnabled ? [{
499
+ command: 'cleanup',
500
+ ...(options.scope ? { scope: options.scope } : {}),
501
+ description: `仅清理 ${options.scope ?? '当前'} scope 的激活;不会修复或删除损坏的共享内容。`,
502
+ }] : []),
503
+ {
504
+ command: 'manual',
505
+ description: `共享内容已损坏。先确认本机 Agent 选择,明确 user 或 project 使用范围,再运行 aw plugin install ${options.pluginId} --scope <user|project> 重建。`,
506
+ },
507
+ ];
508
+ }
403
509
  if (options.state === 'orphaned') {
404
510
  return [{ command: 'cleanup', description: '清理可证明属于 AW 的遗留输出。' }];
405
511
  }
@@ -422,7 +528,7 @@ function statusRecovery(options) {
422
528
  return (options.conflictRoots?.[scope] ?? []).map((rootPluginId) => ({
423
529
  command: 'uninstall',
424
530
  scope,
425
- description: `运行 aw uninstall ${rootPluginId} --platform ${options.platform} --scope ${scope},再运行 aw sync ${retainedRoot} --platform ${options.platform} --scope ${retainedScope}。`,
531
+ description: `运行 aw plugin remove ${rootPluginId} --only requirements --scope ${scope},再运行 aw plugin remove --only outputs ${rootPluginId} --target ${options.platform} --scope ${scope},最后运行 aw plugin sync ${retainedRoot} --target ${options.platform} --context ${retainedScope}。`,
426
532
  }));
427
533
  });
428
534
  }
@@ -432,10 +538,18 @@ function statusRecovery(options) {
432
538
  return [
433
539
  {
434
540
  command: 'sync',
435
- description: `先移除或重命名 ${collision},再运行 aw sync ${options.pluginId} --platform ${options.platform}。cleanup 会保留 foreign 内容,不会删除该冲突。`,
541
+ description: `先移除或重命名 ${collision},再运行 aw plugin sync ${options.pluginId} --target ${options.platform} --context ${options.scope ?? 'user'}。cleanup 会保留 foreign 内容,不会删除该冲突。`,
436
542
  },
437
543
  ];
438
544
  }
545
+ if (options.dependencyMoves?.length) {
546
+ const rootScope = options.desired.scopes[0] ?? 'project';
547
+ const removeDependencies = options.dependencyMoves.map((move) => `aw plugin remove --only outputs ${move.pluginId} --target ${options.platform} --scope ${move.fromScope}`);
548
+ return [{
549
+ command: 'manual',
550
+ description: `先按依赖保护提示依次移除 ${options.dependencyMoves.map((move) => move.pluginId).join('、')} 的所有直接和间接依赖者;若命令报告 dependencyStillRequired,继续处理提示的其他依赖者。再运行 ${removeDependencies.join(',再运行 ')} 移除依赖旧位置。最后确认本机 Agent 选择,逐个按原 scope 重新添加全部已移除 root,由联合需求重新确定提供位置;当前 root 的示例命令是 aw plugin install ${options.pluginId} --scope ${rootScope}。`,
551
+ }];
552
+ }
439
553
  return [{
440
554
  command: options.errorCodes?.some((code) => code === 'codexSharedNativeCorrupt'
441
555
  || code === 'codexActivationDrift'
@@ -514,25 +628,59 @@ export function projectTargetRevision(availableVersion, installedVersion) {
514
628
  return { state: 'upgradeAvailable', availableVersion, installedVersion };
515
629
  return { state: 'unknown', availableVersion, installedVersion };
516
630
  }
517
- function renderStatusV7(payload, verbose) {
631
+ function renderStatusV8(payload, verbose) {
518
632
  const lines = [`Catalog sources: ${payload.catalog.sources.length}`];
519
633
  for (const source of payload.catalog.sources) {
520
634
  lines.push(`${source.primary ? '*' : '-'} ${source.id}: ${source.error ?? source.freshness ?? 'unavailable'}`);
521
635
  }
522
636
  for (const target of payload.targets) {
523
637
  const reasons = target.reasons.length > 0
524
- ? ` [${target.reasons.map((reason) => `${reason.code}: ${reason.message}`).join('; ')}]`
638
+ ? ` [${target.reasons.map((reason) => reason.message.startsWith(`${reason.code}:`)
639
+ ? reason.message : `${reason.code}: ${reason.message}`).join('; ')}]`
525
640
  : '';
526
- lines.push(`${target.pluginId} ${target.platform}: ${target.state}${reasons}`);
641
+ if (target.platform === 'claude') {
642
+ lines.push(`${target.pluginId} ${target.platform} (${target.scope}): ${target.state}${reasons}`);
643
+ }
644
+ else {
645
+ lines.push(`${target.pluginId} ${target.platform}: ${target.state}${reasons}`);
646
+ const desiredScopes = target.placements.filter((placement) => placement.components.some((component) => component.kind === 'intent' && component.metadata?.enabled === true))
647
+ .map((placement) => placement.scope);
648
+ const actualScopes = target.placements.filter((placement) => placement.components.some((component) => component.kind === 'activation'
649
+ && component.key === placement.scope
650
+ && component.state === 'enabled'))
651
+ .map((placement) => placement.scope);
652
+ const usage = (scopes) => scopes.length === 0
653
+ ? 'disabled'
654
+ : scopes.length === 2 ? 'user+project' : scopes[0];
655
+ lines.push(` desired use: ${usage(desiredScopes)}`);
656
+ lines.push(` actual use: ${usage(actualScopes)}`);
657
+ const shared = target.components.find((component) => component.kind === 'sharedNative');
658
+ if (shared)
659
+ lines.push(` shared content: ${shared.state} (${shared.key})`);
660
+ for (const placement of target.placements) {
661
+ lines.push(` ${placement.scope}: ${placement.state}`);
662
+ }
663
+ }
527
664
  if (verbose) {
528
665
  for (const component of target.components) {
529
666
  lines.push(` component ${component.kind}/${component.key}: ${component.state}`);
530
667
  }
668
+ if (target.platform === 'codex') {
669
+ for (const placement of target.placements) {
670
+ lines.push(` placement ${placement.scope}: ${placement.state}`);
671
+ for (const component of placement.components) {
672
+ lines.push(` component ${component.kind}/${component.key}: ${component.state}`);
673
+ }
674
+ }
675
+ }
531
676
  for (const action of target.recoveryActions) {
532
677
  lines.push(` recovery ${action.command}: ${action.description}`);
533
678
  }
534
679
  }
535
680
  }
681
+ for (const issue of payload.configIssues ?? []) {
682
+ lines.push(`Warning: ${issue.pluginId} config ${issue.key} has an unsupported project override; user/default is effective. Unset the project value.`);
683
+ }
536
684
  for (const error of payload.errors)
537
685
  lines.push(`Error: ${error.message}`);
538
686
  return lines.join('\n');
@@ -555,29 +703,89 @@ function collisionRootIssueId(options) {
555
703
  options.collision.artifactKey,
556
704
  ].join(':');
557
705
  }
558
- export async function statusCommandV7(options) {
706
+ async function statusCommandV8InSession(options) {
707
+ const throwIfCancelled = (error) => {
708
+ if (error instanceof Error && error.name === 'AbortError')
709
+ throw error;
710
+ options.signal?.throwIfAborted();
711
+ };
712
+ throwIfCancelled();
559
713
  const env = options.env ?? process.env;
560
714
  const dependencyPluginCache = new Map();
561
715
  const dependencyInspectionCache = new Map();
562
716
  const cliVersion = options.cliVersion ?? assertStrictSemVer(JSON.parse(fs.readFileSync(path.join(resolveCliPackageRoot(), 'package.json'), 'utf8')).version, 'packages/cli/package.json version');
563
717
  const snapshot = await readCatalogSourcesConfigSnapshot(env);
564
- const intentErrors = [];
565
- const readIntent = async (scope) => {
718
+ throwIfCancelled();
719
+ const scope = options.scope === 'project' ? 'project' : 'user';
720
+ const demand = options.recoveryDemand ?? await readDemand({
721
+ scope, cwd: options.cwd, env, catalogOperationContext: options.catalogOperationContext, signal: options.signal,
722
+ });
723
+ throwIfCancelled();
724
+ const observedDemands = new Map([[scope, demand]]);
725
+ if (options.scope !== 'user') {
726
+ const otherScope = scope === 'user' ? 'project' : 'user';
566
727
  try {
567
- return await readPluginIntentState({ scope, cwd: options.cwd, env });
728
+ observedDemands.set(otherScope, await readDemand({ scope: otherScope, cwd: options.cwd,
729
+ env, catalogOperationContext: options.catalogOperationContext, signal: options.signal }));
730
+ }
731
+ catch (error) {
732
+ throwIfCancelled(error); /* The other scope remains unknown; current scope stays readable. */
733
+ }
734
+ }
735
+ const selectedPlatformsByScope = new Map();
736
+ for (const [demandScope, scopedDemand] of observedDemands) {
737
+ try {
738
+ selectedPlatformsByScope.set(demandScope, selectAgents({
739
+ preferences: scopedDemand.preferences,
740
+ ...(demandScope === scope ? options.recoverySelection : {}),
741
+ }).agents.flatMap((agent) => agent === 'codex' ? ['codex']
742
+ : agent === 'claude' ? ['claude'] : []));
568
743
  }
569
744
  catch {
745
+ selectedPlatformsByScope.set(demandScope, []);
746
+ }
747
+ }
748
+ const projectObservationPlatforms = selectedPlatformsByScope.get('project') ?? [];
749
+ const intentErrors = [];
750
+ const readIntent = async (scope) => {
751
+ let observation;
752
+ const scopedDemand = observedDemands.get(scope);
753
+ if (scopedDemand) {
754
+ try {
755
+ const protective = demandNativeProjection(scopedDemand);
756
+ // A protective execution view includes every supported Native platform. Status
757
+ // demand is limited to selected Agents; live residue is observed separately.
758
+ const value = { ...protective, roots: protective.roots.flatMap((root) => {
759
+ const platforms = root.platforms.filter((platform) => selectedPlatformsByScope.get(scope)?.includes(platform));
760
+ return platforms.length ? [{ ...root, platforms }] : [];
761
+ }) };
762
+ observation = scopedDemand.intent.state === 'absent' ? { state: 'absent' }
763
+ : { state: 'ready', value };
764
+ }
765
+ catch {
766
+ observation = { state: 'invalid', code: 'pluginIntentStateInvalid', message: '声明或偏好无效。' };
767
+ }
768
+ }
769
+ else
770
+ observation = options.scope === 'user' ? { state: 'absent' }
771
+ : { state: 'unavailable', code: 'pluginIntentStateUnavailable', message: '另一范围需求不可读。' };
772
+ if (observation.state === 'invalid') {
570
773
  intentErrors.push({
571
774
  code: 'pluginIntentStateInvalid',
572
775
  message: `pluginIntentStateInvalid: ${scope} plugin intent state is invalid.`,
573
776
  });
574
- return emptyIntent();
575
777
  }
778
+ return observation;
576
779
  };
577
- const [userIntent, projectIntent] = await Promise.all([
780
+ const [userIntentObservation, initialProjectIntentObservation] = await Promise.all([
578
781
  readIntent('user'),
579
782
  readIntent('project'),
580
783
  ]);
784
+ const userIntent = userIntentObservation.state === 'ready'
785
+ ? userIntentObservation.value : emptyIntent();
786
+ let projectIntentObservation = initialProjectIntentObservation;
787
+ let projectIntent = projectIntentObservation.state === 'ready'
788
+ ? projectIntentObservation.value : emptyIntent();
581
789
  const codexConfigErrors = [];
582
790
  const readActivationConfig = async (scope) => {
583
791
  try {
@@ -592,23 +800,48 @@ export async function statusCommandV7(options) {
592
800
  return undefined;
593
801
  }
594
802
  };
803
+ const codexScopePathsAlias = codexProjectConfigAliasesUserHome(options.cwd, env);
595
804
  const [userCodexConfig, projectCodexConfig] = await Promise.all([
596
805
  readActivationConfig('user'),
597
- readActivationConfig('project'),
806
+ options.scope === 'user' || codexScopePathsAlias ? undefined : readActivationConfig('project'),
598
807
  ]);
599
- const currentProjectKey = await resolveCanonicalRepoProjectKey(options.cwd);
600
- const currentProjectLocationKey = createProjectLocationKey(currentProjectKey);
601
- const codexScopePathsAlias = codexProjectConfigAliasesUserHome(options.cwd, env);
808
+ let projectRoot;
809
+ try {
810
+ projectRoot = await resolveRequiredCanonicalRepoRoot(options.cwd);
811
+ }
812
+ catch (error) {
813
+ if (error instanceof Error && error.name === 'AbortError')
814
+ throw error;
815
+ if (options.scope === 'project') {
816
+ projectIntentObservation = {
817
+ state: 'unavailable', code: 'pluginIntentStateUnavailable',
818
+ message: '无法确定当前项目位置,不能读取插件声明。',
819
+ };
820
+ projectIntent = emptyIntent();
821
+ if (!intentErrors.some((error) => error.message.includes('project plugin intent'))) {
822
+ intentErrors.push({ code: 'pluginIntentStateInvalid',
823
+ message: 'pluginIntentStateInvalid: project plugin intent state is unavailable.' });
824
+ }
825
+ }
826
+ }
827
+ const currentProjectKey = projectRoot;
828
+ const currentProjectLocationKey = currentProjectKey
829
+ ? createProjectLocationKey(currentProjectKey) : undefined;
602
830
  const inventoryErrors = [];
603
831
  const readInventory = options.inventoryCatalogSourceReferences
604
832
  ?? inventoryCatalogSourceReferences;
605
- const ownerInventory = await readInventory({ cwd: options.cwd, env }).catch(async (error) => {
833
+ const ownerInventory = await readInventory({ cwd: options.cwd, env,
834
+ ...(options.scope === 'user' ? { scope: 'user' } : { includeProjectAgentSkills: true }) }).catch(async (error) => {
835
+ throwIfCancelled(error);
606
836
  inventoryErrors.push(projectStateInventoryError(error, env, options.cwd));
607
- return inventoryLegacyOwnerReferences({ cwd: options.cwd, env }).catch((fallbackError) => {
837
+ return inventoryLegacyOwnerReferences({ cwd: options.cwd, env,
838
+ ...(options.scope === 'user' ? { scope: 'user' } : { includeProjectAgentSkills: true }) }).catch((fallbackError) => {
839
+ throwIfCancelled(fallbackError);
608
840
  inventoryErrors.push(projectStateInventoryError(fallbackError, env, options.cwd));
609
841
  return { inventorySchemaVersion: 1, references: [], errors: [] };
610
842
  });
611
843
  });
844
+ throwIfCancelled();
612
845
  for (const error of ownerInventory.errors ?? []) {
613
846
  const code = error.kind === 'nativeStateRead' ? 'nativeStateUnreadable' : 'stateInventoryFailed';
614
847
  inventoryErrors.push({
@@ -618,22 +851,32 @@ export async function statusCommandV7(options) {
618
851
  });
619
852
  }
620
853
  const nativeCliRunner = options.nativeCliRunner ?? getDefaultNativeCliRunner();
621
- const codexSystemConsumerInspections = new Map();
854
+ let codexSystemConsumerInspection;
622
855
  const inspectCodexSystemConsumer = (scope) => {
623
- let inspection = codexSystemConsumerInspections.get(scope);
856
+ throwIfCancelled();
857
+ let inspection = codexSystemConsumerInspection;
624
858
  if (!inspection) {
625
- inspection = inspectSystemCodexFilesystem({
859
+ inspection = inspectSystemCodex({
860
+ runner: nativeCliRunner,
626
861
  cwd: options.cwd,
627
862
  env,
863
+ signal: options.signal,
628
864
  operationRequirement: getCodexOperationRequirement(scope),
865
+ }).then((result) => {
866
+ throwIfCancelled();
867
+ if (result.state === 'compatible') {
868
+ options.codexObservationSession.setManager(result.manager);
869
+ }
870
+ return result;
629
871
  });
630
- codexSystemConsumerInspections.set(scope, inspection);
872
+ codexSystemConsumerInspection = inspection;
631
873
  }
632
874
  return inspection;
633
875
  };
634
876
  const codexRegistrationCache = new Map();
635
877
  const inspectCodexRegistration = async (pluginId, scope) => {
636
878
  const consumer = await inspectCodexSystemConsumer(scope);
879
+ throwIfCancelled();
637
880
  if (consumer.state !== 'compatible') {
638
881
  return {
639
882
  observation: { state: 'unobserved' },
@@ -648,6 +891,9 @@ export async function statusCommandV7(options) {
648
891
  cwd: options.cwd,
649
892
  env,
650
893
  nativeCliRunner,
894
+ manager: consumer.manager,
895
+ scope: options.scope === 'user' ? 'user' : 'both',
896
+ observationSession: options.codexObservationSession,
651
897
  });
652
898
  codexRegistrationCache.set(pluginId, inspection);
653
899
  }
@@ -680,7 +926,13 @@ export async function statusCommandV7(options) {
680
926
  }
681
927
  if (registration.observation.value === 'absent')
682
928
  return 'absent';
683
- return registration.activations[probe.scope] === true
929
+ if (!userCodexConfig || (probe.scope === 'project' && !projectCodexConfig)) {
930
+ return 'partial';
931
+ }
932
+ const configEnabled = (probe.scope === 'user'
933
+ ? userCodexConfig
934
+ : projectCodexConfig)?.snapshot.plugins[`${probe.pluginName}@${probe.marketplaceName}`]?.enabled === true;
935
+ return configEnabled
684
936
  ? 'present'
685
937
  : 'partial';
686
938
  })
@@ -706,7 +958,36 @@ export async function statusCommandV7(options) {
706
958
  const configured = new Map(snapshot.config.sources.map((source) => [source.id, source]));
707
959
  const requested = options.plugins ?? [];
708
960
  const platforms = selectedPlatforms(options.platform);
961
+ const coversPlatform = (value) => (value === 'codex' || value === 'claude') && platforms.includes(value);
709
962
  const scopes = selectedScopes(options.scope);
963
+ const installedPortableByScope = new Map();
964
+ for (const scope of scopes) {
965
+ const preferences = observedDemands.get(scope)?.preferences;
966
+ if (preferences?.state !== 'valid' || !preferences.value.targets.includes('generic'))
967
+ continue;
968
+ try {
969
+ const context = await createScopeContext({ scope, cwd: options.cwd, env, readOnly: true });
970
+ try {
971
+ const installed = await inspectPortableExtraInstalled({ scope, context, env: context.env, signal: options.signal });
972
+ installedPortableByScope.set(scope, installed.targets);
973
+ }
974
+ finally {
975
+ await context.dispose();
976
+ }
977
+ }
978
+ catch (error) {
979
+ throwIfCancelled(error);
980
+ }
981
+ }
982
+ const userDemand = observedDemands.get('user');
983
+ const projectDemand = observedDemands.get('project');
984
+ const configRequirementKey = (pluginId, scope, target) => `${pluginId}\0${scope}\0${target}`;
985
+ const requiredConfigTargets = new Set(userDemand ? deriveJointDemand({
986
+ context: { context: projectDemand ? 'project' : 'user', cwd: options.cwd,
987
+ scopes: projectDemand ? ['user', 'project'] : ['user'], ...(projectDemand && projectRoot ? { projectRoot } : {}) },
988
+ user: userDemand, project: projectDemand,
989
+ preferences: userDemand.preferences.state === 'valid' ? userDemand.preferences.value : null,
990
+ }).placements.flatMap((placement) => placement.contributions.map((contribution) => configRequirementKey(placement.pluginId, contribution.scope, placement.target))) : []);
710
991
  const selectorErrors = [];
711
992
  const parsedSelectors = [];
712
993
  const plannedSelectors = [];
@@ -728,7 +1009,7 @@ export async function statusCommandV7(options) {
728
1009
  const hasLiveReference = ownerInventory.references.some((reference) => (reference.kind === 'namespacedOwner' || reference.kind === 'namespacedMarketplace')
729
1010
  && reference.sourceId === parsed.sourceId
730
1011
  && reference.pluginName === parsed.pluginName
731
- && platforms.includes(reference.platform)
1012
+ && coversPlatform(reference.platform)
732
1013
  && scopes.includes(reference.scope)
733
1014
  && (reference.scope !== 'project' || reference.projectKey === currentProjectKey));
734
1015
  if (hasLiveReference) {
@@ -761,9 +1042,14 @@ export async function statusCommandV7(options) {
761
1042
  scopes,
762
1043
  currentProjectLocationKey,
763
1044
  }));
764
- const plannedSourceIds = requested.length === 0
1045
+ const selectorSourceIds = requested.length === 0
765
1046
  ? undefined
766
1047
  : planPluginSelectorSourceIds(plannedSelectors.map((selector) => selector.parsed));
1048
+ const plannedSourceIds = selectorSourceIds === undefined ? undefined : [...new Set([
1049
+ ...selectorSourceIds,
1050
+ ...(options.catalogOperationContext ? [] : [...observedDemands.values()].flatMap((entry) => entry.roots ?? []))
1051
+ .map((root) => root.sourceId).filter((id) => configured.has(id)),
1052
+ ])];
767
1053
  const selectedConfiguredSources = plannedSourceIds === undefined
768
1054
  ? snapshot.config.sources
769
1055
  : plannedSourceIds.map((sourceId) => configured.get(sourceId));
@@ -787,11 +1073,13 @@ export async function statusCommandV7(options) {
787
1073
  ? { operationContext: options.catalogOperationContext }
788
1074
  : {}),
789
1075
  env,
1076
+ signal: options.signal,
790
1077
  consume: async (resolution) => ({
791
1078
  primarySourceId: resolution.primarySourceId,
792
1079
  configDigest: resolution.configDigest,
793
1080
  compositeDigest: resolution.compositeDigest,
794
1081
  sources: await Promise.all(resolution.sources.map(async (item) => {
1082
+ throwIfCancelled();
795
1083
  const source = configured.get(item.sourceId);
796
1084
  const identity = identities.get(item.sourceId);
797
1085
  const base = {
@@ -810,17 +1098,50 @@ export async function statusCommandV7(options) {
810
1098
  };
811
1099
  }
812
1100
  try {
1101
+ const catalogEntriesByName = new Map(item.resolution.manifest.entries.map((entry) => [
1102
+ entry.name,
1103
+ entry,
1104
+ ]));
1105
+ const cyclicDependencyPluginNames = new Set();
1106
+ const dependencyVisitState = new Map();
1107
+ const dependencyVisitStack = [];
1108
+ const visitDependencyGraph = (pluginName) => {
1109
+ const state = dependencyVisitState.get(pluginName);
1110
+ if (state === 'visited')
1111
+ return;
1112
+ if (state === 'visiting') {
1113
+ const cycleStart = dependencyVisitStack.lastIndexOf(pluginName);
1114
+ for (const name of dependencyVisitStack.slice(cycleStart)) {
1115
+ cyclicDependencyPluginNames.add(name);
1116
+ }
1117
+ return;
1118
+ }
1119
+ dependencyVisitState.set(pluginName, 'visiting');
1120
+ dependencyVisitStack.push(pluginName);
1121
+ for (const dependencyName of catalogEntriesByName.get(pluginName)?.dependencies ?? []) {
1122
+ if (catalogEntriesByName.has(dependencyName))
1123
+ visitDependencyGraph(dependencyName);
1124
+ }
1125
+ dependencyVisitStack.pop();
1126
+ dependencyVisitState.set(pluginName, 'visited');
1127
+ };
1128
+ for (const pluginName of catalogEntriesByName.keys())
1129
+ visitDependencyGraph(pluginName);
813
1130
  const placementEntries = item.resolution.manifest.entries.map((entry) => {
814
- const products = entry.policy.products;
815
- const supports = (platform) => products === undefined
816
- || products.includes(platform === 'codex' ? 'CODEX' : 'CLAUDE');
1131
+ const supportedPlatforms = resolveCatalogEntrySupportedPlatforms(entry.policy);
817
1132
  return {
818
1133
  name: entry.name,
819
1134
  dependencies: entry.dependencies,
820
1135
  source: { id: item.resolution.sourceId },
821
1136
  targets: {
822
- codex: { user: supports('codex'), project: supports('codex') },
823
- claude: { user: supports('claude'), project: supports('claude') },
1137
+ codex: {
1138
+ user: supportedPlatforms.has('codex'),
1139
+ project: supportedPlatforms.has('codex'),
1140
+ },
1141
+ claude: {
1142
+ user: supportedPlatforms.has('claude'),
1143
+ project: supportedPlatforms.has('claude'),
1144
+ },
824
1145
  },
825
1146
  };
826
1147
  });
@@ -830,7 +1151,7 @@ export async function statusCommandV7(options) {
830
1151
  available: placementEntries,
831
1152
  codexProjectAllowed: !codexScopePathsAlias,
832
1153
  });
833
- const registeredNames = canonicalMarketplaceRegistrationNames(ownerInventory.references, item.resolution.sourceId);
1154
+ const registeredNames = legacyCanonicalMarketplaceRegistrationNames(ownerInventory.references, item.resolution.sourceId);
834
1155
  if (registeredNames.length > 1) {
835
1156
  throw new Error('marketplaceIdentityUnavailable: Multiple canonical native marketplace registrations match the source.');
836
1157
  }
@@ -843,20 +1164,21 @@ export async function statusCommandV7(options) {
843
1164
  sourceId: item.resolution.sourceId,
844
1165
  pluginName: entry.name,
845
1166
  });
846
- if (sourceDesired.get(desiredTargetKey(pluginId, 'codex'))?.scopes.includes('user')) {
1167
+ if (options.scope === 'project'
1168
+ ? userCodexConfig?.snapshot.plugins[`${entry.name}@${desiredMarketplaceName}`]?.enabled === true
1169
+ : sourceDesired.get(desiredTargetKey(pluginId, 'codex'))?.scopes.includes('user')) {
847
1170
  codexDesiredUserActivationIds.add(`${entry.name}@${desiredMarketplaceName}`);
848
1171
  }
849
1172
  }
850
1173
  const plugins = await Promise.all(item.resolution.manifest.entries.map(async (entry) => {
1174
+ throwIfCancelled();
851
1175
  const capabilitySupport = checkAwCapabilitySupport(entry.requires.aw.capabilities ?? [], IMPLEMENTED_AW_CAPABILITIES);
852
1176
  if (!capabilitySupport.supported) {
853
- const products = entry.policy.products;
854
- const supports = (platform) => products === undefined
855
- || products.includes(platform === 'codex' ? 'CODEX' : 'CLAUDE');
1177
+ const supportedPlatforms = resolveCatalogEntrySupportedPlatforms(entry.policy);
856
1178
  const states = {};
857
1179
  const message = `awCapabilityUnsupported: ${item.resolution.sourceId}/${entry.name} requires unsupported AW capabilities: ${capabilitySupport.missing.join(', ')}.`;
858
1180
  for (const platform of ['codex', 'claude']) {
859
- if (!supports(platform))
1181
+ if (!supportedPlatforms.has(platform))
860
1182
  continue;
861
1183
  states[platform] = {};
862
1184
  for (const scope of ['user', 'project']) {
@@ -874,8 +1196,14 @@ export async function statusCommandV7(options) {
874
1196
  shortDescription: entry.interface?.shortDescription ?? entry.description,
875
1197
  description: entry.description,
876
1198
  targets: {
877
- claude: { user: supports('claude'), project: supports('claude') },
878
- codex: { user: supports('codex'), project: supports('codex') },
1199
+ claude: {
1200
+ user: supportedPlatforms.has('claude'),
1201
+ project: supportedPlatforms.has('claude'),
1202
+ },
1203
+ codex: {
1204
+ user: supportedPlatforms.has('codex'),
1205
+ project: supportedPlatforms.has('codex'),
1206
+ },
879
1207
  },
880
1208
  states,
881
1209
  dependencies: entry.dependencies,
@@ -888,50 +1216,87 @@ export async function statusCommandV7(options) {
888
1216
  const codexSurface = analyzeCodexSurface(plugin.manifest);
889
1217
  plugin.sourceId = item.resolution.sourceId;
890
1218
  plugin.sourceIdentity = item.resolution.sourceIdentity;
1219
+ plugin.catalogLogicalIdentity = item.resolution.logicalIdentity;
891
1220
  plugin.pluginId = formatPluginId({ sourceId: item.resolution.sourceId, pluginName: entry.name });
892
1221
  let configIssues;
893
1222
  let configDiagnostic;
894
- if (plugin.manifest.config?.fields) {
1223
+ if (plugin.manifest.config) {
895
1224
  const issues = new Map();
896
1225
  for (const scope of scopes) {
897
- try {
898
- const resolved = scope === 'project'
899
- ? await resolveProjectArtifactRenderConfig({
900
- sourceId: plugin.sourceId,
901
- sourceIdentity: plugin.sourceIdentity,
902
- pluginName: plugin.manifest.name,
903
- manifest: plugin.manifest,
904
- cwd: options.cwd,
905
- env,
906
- })
907
- : await resolveEffectivePluginConfig({
908
- sourceId: plugin.sourceId,
909
- sourceIdentity: plugin.sourceIdentity,
910
- pluginName: plugin.manifest.name,
911
- manifest: plugin.manifest,
912
- targetScope: 'user',
913
- cwd: options.cwd,
914
- env,
915
- });
916
- for (const issue of resolved.issues) {
917
- const source = issue.source ?? 'missing';
918
- const configIssue = {
1226
+ const scopedDemand = observedDemands.get(scope);
1227
+ if (!scopedDemand)
1228
+ continue;
1229
+ // Strong preference errors are already reported through demand; never fall back to every platform.
1230
+ if (scopedDemand.preferences.state !== 'valid')
1231
+ continue;
1232
+ const active = resolveActiveConfigPlatforms(plugin.pluginId, plugin.manifest, scopedDemand.preferences);
1233
+ for (const platform of active) {
1234
+ const installed = platform === 'generic'
1235
+ ? installedPortableByScope.get(scope)?.some((target) => target.agent === platform && target.pluginId === plugin.pluginId
1236
+ && target.logicalIdentity === plugin.catalogLogicalIdentity)
1237
+ : ownerInventory.references.some((reference) => reference.platform === platform
1238
+ && reference.sourceId === plugin.sourceId && reference.pluginName === plugin.manifest.name
1239
+ && (reference.kind === 'namespacedOwner' || reference.kind === 'namespacedMarketplace')
1240
+ && (!reference.sourceIdentity || reference.sourceIdentity === plugin.sourceIdentity)
1241
+ && reference.scope === scope && (scope === 'user' || reference.projectKey === currentProjectKey));
1242
+ if (!installed && !requiredConfigTargets.has(configRequirementKey(plugin.pluginId, scope, platform)))
1243
+ continue;
1244
+ try {
1245
+ const resolved = scope === 'project'
1246
+ ? await resolveProjectArtifactRenderConfig({
1247
+ sourceId: plugin.sourceId,
1248
+ sourceIdentity: plugin.sourceIdentity,
1249
+ logicalIdentity: plugin.catalogLogicalIdentity,
1250
+ pluginName: plugin.manifest.name,
1251
+ manifest: plugin.manifest,
1252
+ platform,
1253
+ cwd: options.cwd,
1254
+ env,
1255
+ })
1256
+ : await resolveEffectivePluginConfig({
1257
+ sourceId: plugin.sourceId,
1258
+ sourceIdentity: plugin.sourceIdentity,
1259
+ logicalIdentity: plugin.catalogLogicalIdentity,
1260
+ pluginName: plugin.manifest.name,
1261
+ manifest: plugin.manifest,
1262
+ platform,
1263
+ targetScope: 'user',
1264
+ cwd: options.cwd,
1265
+ env,
1266
+ });
1267
+ for (const issue of resolved.issues) {
1268
+ const source = issue.source ?? 'missing';
1269
+ const configIssue = {
1270
+ scope,
1271
+ platform,
1272
+ type: issue.type,
1273
+ key: issue.key,
1274
+ title: resolved.schema[issue.key]?.title ?? issue.key,
1275
+ source,
1276
+ };
1277
+ issues.set(`${platform}\0${scope}\0${configIssue.type}\0${configIssue.key}\0${configIssue.source}`, configIssue);
1278
+ }
1279
+ for (const override of resolved.unsupportedLayerOverrides) {
1280
+ const configIssue = {
1281
+ scope,
1282
+ platform,
1283
+ type: override.type,
1284
+ key: override.key,
1285
+ title: resolved.schema[override.key]?.title ?? override.key,
1286
+ source: override.source,
1287
+ };
1288
+ issues.set(`${platform}\0${scope}\0${configIssue.type}\0${configIssue.key}\0${configIssue.source}`, configIssue);
1289
+ }
1290
+ }
1291
+ catch (error) {
1292
+ throwIfCancelled(error);
1293
+ configDiagnostic ??= {
919
1294
  scope,
920
- type: issue.type,
921
- key: issue.key,
922
- title: plugin.manifest.config.fields[issue.key]?.title ?? issue.key,
923
- source,
1295
+ code: 'configReadFailed',
1296
+ message: '插件设置当前不可读。未读取或显示设置值。',
924
1297
  };
925
- issues.set(`${scope}\0${configIssue.type}\0${configIssue.key}\0${configIssue.source}`, configIssue);
926
1298
  }
927
1299
  }
928
- catch {
929
- configDiagnostic ??= {
930
- scope,
931
- code: 'configReadFailed',
932
- message: '插件设置当前不可读。未读取或显示设置值。',
933
- };
934
- }
935
1300
  }
936
1301
  configIssues = [...issues.values()];
937
1302
  }
@@ -939,18 +1304,21 @@ export async function statusCommandV7(options) {
939
1304
  const defaultMarketplaceName = item.resolution.sourceId === resolution.primarySourceId
940
1305
  ? 'aw'
941
1306
  : `aw-${item.resolution.sourceId}`;
1307
+ const legacyMarketplaceRoot = path.join(await resolveAwHomeCanonical(env), 'marketplaces', item.resolution.sourceId);
942
1308
  const marketplaceNameFor = (pluginName, platform, scope) => {
943
1309
  const liveName = ownerInventory.references.find((reference) => (reference.kind === 'namespacedOwner' || reference.kind === 'namespacedMarketplace')
944
1310
  && reference.sourceId === item.resolution.sourceId
945
1311
  && reference.sourceIdentity === item.resolution.sourceIdentity
946
1312
  && reference.pluginName === pluginName
1313
+ && (reference.kind !== 'namespacedMarketplace' || !reference.marketplaceRoot
1314
+ || reference.marketplaceRoot === legacyMarketplaceRoot)
947
1315
  && reference.platform === platform
948
1316
  && reference.scope === scope
949
1317
  && (scope === 'user' || reference.projectKey === currentProjectKey)
950
1318
  && reference.marketplaceName)?.marketplaceName;
951
1319
  if (liveName)
952
1320
  return liveName;
953
- const registeredNames = canonicalMarketplaceRegistrationNames(ownerInventory.references, item.resolution.sourceId);
1321
+ const registeredNames = legacyCanonicalMarketplaceRegistrationNames(ownerInventory.references, item.resolution.sourceId);
954
1322
  if (registeredNames.length > 1) {
955
1323
  throw new Error('marketplaceIdentityUnavailable: Multiple canonical native marketplace registrations match the source.');
956
1324
  }
@@ -960,6 +1328,7 @@ export async function statusCommandV7(options) {
960
1328
  for (const platform of ['codex', 'claude']) {
961
1329
  states[platform] = {};
962
1330
  for (const scope of ['user', 'project']) {
1331
+ throwIfCancelled();
963
1332
  if (platform === 'codex'
964
1333
  && scope === 'project'
965
1334
  && codexScopePathsAlias
@@ -1010,6 +1379,7 @@ export async function statusCommandV7(options) {
1010
1379
  nativeCliRunner,
1011
1380
  reporter: createNoopReporter(),
1012
1381
  debugLogger: createNoopDebugLogger(),
1382
+ codexObservationSession: options.codexObservationSession,
1013
1383
  },
1014
1384
  userActivationDesired: codexDesiredUserActivationIds,
1015
1385
  nativeProbe: readOnlyNativeProbe({
@@ -1048,8 +1418,244 @@ export async function statusCommandV7(options) {
1048
1418
  const dependencyErrors = [];
1049
1419
  const dependencyReadiness = [];
1050
1420
  const directDependencies = plugin.manifest.dependencies ?? [];
1051
- if (directDependencies.length > 0
1052
- && (liveState === 'present' || liveState === 'partial')) {
1421
+ const desiredInScope = sourceDesired.get(desiredTargetKey(plugin.pluginId, platform))?.scopes.includes(scope) === true;
1422
+ const codexPluginId = `${entry.name}@${marketplaceName}`;
1423
+ const actualCodexActivation = platform === 'codex'
1424
+ && (scope === 'user' ? userCodexConfig : projectCodexConfig)
1425
+ ?.snapshot.plugins[codexPluginId]?.enabled === true;
1426
+ const hasScopedExtensionResidue = platform === 'codex'
1427
+ && inspected.inspection.components.some((component) => component.component.kind !== 'native-plugin'
1428
+ && !component.component.identity.artifactKey.startsWith('activation-')
1429
+ && !component.component.identity.artifactKey.startsWith('marketplace-')
1430
+ && (component.state !== 'absent' || component.collision !== undefined));
1431
+ const dependencyPriority = {
1432
+ ready: 5,
1433
+ blockedByCollision: 4,
1434
+ incomplete: 3,
1435
+ error: 2,
1436
+ absent: 1,
1437
+ };
1438
+ function dependencyPlacementsFor(dependencyId, consumerScope) {
1439
+ const dependencyOverride = (consumerScope === 'project'
1440
+ ? projectIntent
1441
+ : userIntent).dependencyScopeOverrides.find((override) => override.pluginId === dependencyId
1442
+ && (override.platform === undefined || override.platform === platform));
1443
+ return dependencyOverride
1444
+ ? [dependencyOverride.scope]
1445
+ : consumerScope === 'project' ? ['project', 'user'] : ['user'];
1446
+ }
1447
+ async function inspectDependencyAtScope(dependencyName, dependencyScope) {
1448
+ const dependencyId = formatPluginId({
1449
+ sourceId: item.resolution.sourceId,
1450
+ pluginName: dependencyName,
1451
+ });
1452
+ const inspectionCacheKey = [
1453
+ item.resolution.sourceIdentity,
1454
+ dependencyId,
1455
+ platform,
1456
+ dependencyScope,
1457
+ dependencyScope === 'project' ? currentProjectKey : '',
1458
+ ].join('\0');
1459
+ if (cyclicDependencyPluginNames.has(dependencyName)) {
1460
+ return {
1461
+ state: 'error',
1462
+ dependencyScope,
1463
+ rootIssueId: `dependencyGraphInvalid:${dependencyId}`,
1464
+ rootIssueCode: 'dependencyGraphInvalid',
1465
+ issuePluginId: dependencyId,
1466
+ issueScope: dependencyScope,
1467
+ };
1468
+ }
1469
+ const cached = dependencyInspectionCache.get(inspectionCacheKey);
1470
+ if (cached)
1471
+ return cached;
1472
+ const inspection = (async () => {
1473
+ const dependencyEntry = item.resolution.manifest.entries.find((candidate) => candidate.name === dependencyName);
1474
+ if (!dependencyEntry) {
1475
+ return {
1476
+ state: 'absent',
1477
+ dependencyScope,
1478
+ rootIssueId: `dependencyMissing:${dependencyId}:${platform}:${dependencyScope}`,
1479
+ rootIssueCode: 'dependencyMissing',
1480
+ issuePluginId: dependencyId,
1481
+ issueScope: dependencyScope,
1482
+ };
1483
+ }
1484
+ const dependencySupport = checkAwCapabilitySupport(dependencyEntry.requires.aw.capabilities ?? [], IMPLEMENTED_AW_CAPABILITIES);
1485
+ if (!dependencySupport.supported) {
1486
+ return {
1487
+ state: 'error',
1488
+ dependencyScope,
1489
+ rootIssueId: `awCapabilityUnsupported:${dependencyId}`,
1490
+ rootIssueCode: 'awCapabilityUnsupported',
1491
+ issuePluginId: dependencyId,
1492
+ issueScope: dependencyScope,
1493
+ missingCapabilities: dependencySupport.missing,
1494
+ };
1495
+ }
1496
+ const pluginCacheKey = [item.resolution.sourceIdentity, dependencyId].join('\0');
1497
+ let dependencyPluginPromise = dependencyPluginCache.get(pluginCacheKey);
1498
+ if (!dependencyPluginPromise) {
1499
+ dependencyPluginPromise = readPluginManifest(path.join(item.resolution.rootDir, 'plugins', dependencyName), { mode: 'bundle' }).then((dependencyPlugin) => {
1500
+ dependencyPlugin.sourceId = item.resolution.sourceId;
1501
+ dependencyPlugin.sourceIdentity = item.resolution.sourceIdentity;
1502
+ dependencyPlugin.catalogLogicalIdentity = item.resolution.logicalIdentity;
1503
+ dependencyPlugin.pluginId = dependencyId;
1504
+ return dependencyPlugin;
1505
+ });
1506
+ dependencyPluginCache.set(pluginCacheKey, dependencyPluginPromise);
1507
+ }
1508
+ const dependencyPlugin = await dependencyPluginPromise;
1509
+ dependencyInspectionHookForTests?.();
1510
+ const dependencyMarketplaceName = marketplaceNameFor(dependencyName, platform, dependencyScope);
1511
+ const dependencyInspected = await inspectRebuildTarget({
1512
+ sourceId: item.resolution.sourceId,
1513
+ sourceIdentity: item.resolution.sourceIdentity,
1514
+ pluginId: dependencyId,
1515
+ marketplaceName: dependencyMarketplaceName,
1516
+ marketplaceRoot,
1517
+ plugin: dependencyPlugin,
1518
+ platform,
1519
+ scope: dependencyScope,
1520
+ cwd: options.cwd,
1521
+ catalog: { rootDir: item.resolution.rootDir, source: 'local' },
1522
+ context: {
1523
+ env,
1524
+ nativeCliRunner,
1525
+ reporter: createNoopReporter(),
1526
+ debugLogger: createNoopDebugLogger(),
1527
+ codexObservationSession: options.codexObservationSession,
1528
+ },
1529
+ userActivationDesired: codexDesiredUserActivationIds,
1530
+ nativeProbe: readOnlyNativeProbe({
1531
+ pluginName: dependencyName,
1532
+ sourceId: item.resolution.sourceId,
1533
+ sourceIdentity: item.resolution.sourceIdentity,
1534
+ platform,
1535
+ scope: dependencyScope,
1536
+ marketplaceName: dependencyMarketplaceName,
1537
+ marketplaceRoot,
1538
+ desired: sourceDesired.get(desiredTargetKey(dependencyId, platform))
1539
+ ?.scopes.includes(dependencyScope) === true,
1540
+ }),
1541
+ shallow: true,
1542
+ });
1543
+ const dependencyLiveState = projectedLiveState({
1544
+ inspection: dependencyInspected.inspection,
1545
+ required: dependencyInspected.target.desiredOwnedComponents
1546
+ ?? dependencyInspected.target.ownedComponents,
1547
+ optional: dependencyInspected.target.optionalOwnedComponents ?? [],
1548
+ });
1549
+ const collision = dependencyInspected.inspection.components.find((component) => component.collision)?.collision;
1550
+ if (collision) {
1551
+ return {
1552
+ state: 'blockedByCollision',
1553
+ dependencyScope,
1554
+ rootIssueId: collisionRootIssueId({
1555
+ pluginId: dependencyId,
1556
+ platform,
1557
+ scope: dependencyScope,
1558
+ collision,
1559
+ }),
1560
+ rootIssueCode: 'artifactCollision',
1561
+ issuePluginId: dependencyId,
1562
+ issueScope: dependencyScope,
1563
+ };
1564
+ }
1565
+ const requiredDependencyComponents = dependencyInspected.target
1566
+ .desiredOwnedComponents ?? dependencyInspected.target.ownedComponents;
1567
+ const desiredDependency = sourceDesired.get(desiredTargetKey(dependencyId, platform));
1568
+ const projectMigrationPending = dependencyScope === 'project'
1569
+ && projectIntent.dependencyScopeOverrides.some((override) => override.pluginId === dependencyId
1570
+ && override.scope === 'project'
1571
+ && (override.platform === undefined || override.platform === platform))
1572
+ && desiredDependency?.scopes.includes('project') === true
1573
+ && desiredDependency.scopes.includes('user') === false
1574
+ && ownerInventory.references.some((reference) => reference.kind === 'namespacedOwner'
1575
+ && reference.sourceId === item.resolution.sourceId
1576
+ && reference.pluginName === dependencyName
1577
+ && reference.platform === platform
1578
+ && reference.scope === 'user');
1579
+ const migrationOnlyPartial = dependencyLiveState === 'partial'
1580
+ && projectMigrationPending
1581
+ && dependencyInspected.inspection.components.every((component) => component.state === 'present' || component.state === 'absent')
1582
+ && requiredDependencyComponents.every((required) => dependencyInspected.inspection.components.some((component) => component.component === required
1583
+ && (component.state === 'present'
1584
+ || component.state === 'absent'
1585
+ && component.component.kind !== 'native-plugin'
1586
+ && 'locator' in component.component
1587
+ && component.component.locator.kind === 'codex-activation'
1588
+ && component.component.locator.desired === false)));
1589
+ const effectiveDependencyLiveState = migrationOnlyPartial
1590
+ ? 'present'
1591
+ : dependencyLiveState;
1592
+ if (effectiveDependencyLiveState !== 'present') {
1593
+ const state = effectiveDependencyLiveState === 'absent' ? 'absent'
1594
+ : effectiveDependencyLiveState === 'partial' ? 'incomplete'
1595
+ : 'error';
1596
+ return {
1597
+ state,
1598
+ dependencyScope,
1599
+ rootIssueId: state === 'absent'
1600
+ ? `dependencyMissing:${dependencyId}:${platform}:${dependencyScope}`
1601
+ : state === 'incomplete'
1602
+ ? `incompleteInstallation:${dependencyId}:${platform}:${dependencyScope}`
1603
+ : `diagnostic:${dependencyId}:${platform}:${dependencyScope}`,
1604
+ rootIssueCode: state === 'absent' ? 'dependencyMissing'
1605
+ : state === 'incomplete' ? 'incompleteInstallation' : 'diagnostic',
1606
+ issuePluginId: dependencyId,
1607
+ issueScope: dependencyScope,
1608
+ };
1609
+ }
1610
+ for (const childName of dependencyPlugin.manifest.dependencies ?? []) {
1611
+ const childId = formatPluginId({
1612
+ sourceId: item.resolution.sourceId,
1613
+ pluginName: childName,
1614
+ });
1615
+ let childResult;
1616
+ for (const childScope of dependencyPlacementsFor(childId, dependencyScope)) {
1617
+ const candidate = await inspectDependencyAtScope(childName, childScope);
1618
+ if (candidate.state === 'ready') {
1619
+ childResult = candidate;
1620
+ break;
1621
+ }
1622
+ if (!childResult
1623
+ || dependencyPriority[candidate.state]
1624
+ > dependencyPriority[childResult.state]) {
1625
+ childResult = candidate;
1626
+ }
1627
+ }
1628
+ if (childResult?.state !== 'ready') {
1629
+ return {
1630
+ ...childResult,
1631
+ dependencyScope,
1632
+ };
1633
+ }
1634
+ }
1635
+ return { state: 'ready', dependencyScope };
1636
+ })().catch((error) => {
1637
+ throwIfCancelled(error);
1638
+ return {
1639
+ state: 'error',
1640
+ dependencyScope,
1641
+ rootIssueId: `diagnostic:${dependencyId}:${platform}:${dependencyScope}`,
1642
+ rootIssueCode: 'diagnostic',
1643
+ issuePluginId: dependencyId,
1644
+ issueScope: dependencyScope,
1645
+ };
1646
+ });
1647
+ dependencyInspectionCache.set(inspectionCacheKey, inspection);
1648
+ return inspection;
1649
+ }
1650
+ // Inspect dependencies for returned live placements and selected project Agents.
1651
+ const dependencyObservationRequested = platforms.includes(platform) && scopes.includes(scope)
1652
+ || scope === 'project' && projectObservationPlatforms.includes(platform);
1653
+ if (dependencyObservationRequested && directDependencies.length > 0
1654
+ && (desiredInScope
1655
+ || actualCodexActivation
1656
+ || hasScopedExtensionResidue
1657
+ || (platform !== 'codex'
1658
+ && (liveState === 'present' || liveState === 'partial')))) {
1053
1659
  for (const dependencyName of directDependencies) {
1054
1660
  const dependencyId = formatPluginId({
1055
1661
  sourceId: item.resolution.sourceId,
@@ -1103,118 +1709,12 @@ export async function statusCommandV7(options) {
1103
1709
  }, 'partial'));
1104
1710
  continue;
1105
1711
  }
1106
- const pluginCacheKey = [item.resolution.sourceIdentity, dependencyId].join('\0');
1107
- let dependencyPluginPromise = dependencyPluginCache.get(pluginCacheKey);
1108
- if (!dependencyPluginPromise) {
1109
- dependencyPluginPromise = readPluginManifest(path.join(item.resolution.rootDir, 'plugins', dependencyName), { mode: 'bundle' }).then((dependencyPlugin) => {
1110
- dependencyPlugin.sourceId = item.resolution.sourceId;
1111
- dependencyPlugin.sourceIdentity = item.resolution.sourceIdentity;
1112
- dependencyPlugin.pluginId = dependencyId;
1113
- return dependencyPlugin;
1114
- });
1115
- dependencyPluginCache.set(pluginCacheKey, dependencyPluginPromise);
1116
- }
1117
- const dependencyOverride = (scope === 'project'
1118
- ? projectIntent
1119
- : userIntent).dependencyScopeOverrides.find((override) => override.pluginId === dependencyId
1120
- && (override.platform === undefined || override.platform === platform));
1121
- const placements = dependencyOverride
1122
- ? [dependencyOverride.scope]
1123
- : scope === 'project' ? ['project', 'user'] : ['user'];
1712
+ const placements = dependencyPlacementsFor(dependencyId, scope);
1124
1713
  let dependencyResult = {
1125
1714
  state: 'absent',
1126
1715
  };
1127
1716
  for (const dependencyScope of placements) {
1128
- const inspectionCacheKey = [
1129
- item.resolution.sourceIdentity,
1130
- dependencyId,
1131
- platform,
1132
- dependencyScope,
1133
- dependencyScope === 'project' ? currentProjectKey : '',
1134
- ].join('\0');
1135
- let dependencyInspection = dependencyInspectionCache.get(inspectionCacheKey);
1136
- if (!dependencyInspection) {
1137
- dependencyInspection = dependencyPluginPromise.then(async (dependencyPlugin) => {
1138
- dependencyInspectionHookForTests?.();
1139
- const dependencyMarketplaceName = marketplaceNameFor(dependencyName, platform, dependencyScope);
1140
- const dependencyInspected = await inspectRebuildTarget({
1141
- sourceId: item.resolution.sourceId,
1142
- sourceIdentity: item.resolution.sourceIdentity,
1143
- pluginId: dependencyId,
1144
- marketplaceName: dependencyMarketplaceName,
1145
- marketplaceRoot,
1146
- plugin: dependencyPlugin,
1147
- platform,
1148
- scope: dependencyScope,
1149
- cwd: options.cwd,
1150
- catalog: { rootDir: item.resolution.rootDir, source: 'local' },
1151
- context: {
1152
- env,
1153
- nativeCliRunner,
1154
- reporter: createNoopReporter(),
1155
- debugLogger: createNoopDebugLogger(),
1156
- },
1157
- userActivationDesired: codexDesiredUserActivationIds,
1158
- nativeProbe: readOnlyNativeProbe({
1159
- pluginName: dependencyName,
1160
- sourceId: item.resolution.sourceId,
1161
- sourceIdentity: item.resolution.sourceIdentity,
1162
- platform,
1163
- scope: dependencyScope,
1164
- marketplaceName: dependencyMarketplaceName,
1165
- marketplaceRoot,
1166
- desired: sourceDesired.get(desiredTargetKey(dependencyId, platform))
1167
- ?.scopes.includes(dependencyScope) === true,
1168
- }),
1169
- shallow: true,
1170
- });
1171
- const dependencyLiveState = projectedLiveState({
1172
- inspection: dependencyInspected.inspection,
1173
- required: dependencyInspected.target.desiredOwnedComponents
1174
- ?? dependencyInspected.target.ownedComponents,
1175
- optional: dependencyInspected.target.optionalOwnedComponents ?? [],
1176
- });
1177
- const collision = dependencyInspected.inspection.components.find((component) => component.collision)?.collision;
1178
- if (collision) {
1179
- return {
1180
- state: 'blockedByCollision',
1181
- dependencyScope,
1182
- rootIssueId: collisionRootIssueId({
1183
- pluginId: dependencyId,
1184
- platform,
1185
- scope: dependencyScope,
1186
- collision,
1187
- }),
1188
- rootIssueCode: 'artifactCollision',
1189
- };
1190
- }
1191
- return {
1192
- state: dependencyLiveState === 'present' ? 'ready'
1193
- : dependencyLiveState === 'absent' ? 'absent'
1194
- : dependencyLiveState === 'partial' ? 'incomplete'
1195
- : 'error',
1196
- dependencyScope,
1197
- ...(dependencyLiveState === 'partial'
1198
- ? {
1199
- rootIssueId: `incompleteInstallation:${dependencyId}:${platform}:${dependencyScope}`,
1200
- rootIssueCode: 'incompleteInstallation',
1201
- }
1202
- : dependencyLiveState === 'error'
1203
- ? {
1204
- rootIssueId: `diagnostic:${dependencyId}:${platform}:${dependencyScope}`,
1205
- rootIssueCode: 'diagnostic',
1206
- }
1207
- : {}),
1208
- };
1209
- }).catch(() => ({
1210
- state: 'error',
1211
- dependencyScope,
1212
- rootIssueId: `diagnostic:${dependencyId}:${platform}:${dependencyScope}`,
1213
- rootIssueCode: 'diagnostic',
1214
- }));
1215
- dependencyInspectionCache.set(inspectionCacheKey, dependencyInspection);
1216
- }
1217
- const candidate = await dependencyInspection;
1717
+ const candidate = await inspectDependencyAtScope(dependencyName, dependencyScope);
1218
1718
  if (candidate.state === 'ready') {
1219
1719
  dependencyResult = candidate;
1220
1720
  break;
@@ -1230,7 +1730,7 @@ export async function statusCommandV7(options) {
1230
1730
  dependencyResult = candidate;
1231
1731
  }
1232
1732
  }
1233
- if (dependencyResult.state === 'absent') {
1733
+ if (dependencyResult.state === 'absent' && !dependencyResult.rootIssueId) {
1234
1734
  const dependencyScope = dependencyResult.dependencyScope ?? placements[0];
1235
1735
  dependencyResult = {
1236
1736
  state: 'absent',
@@ -1245,28 +1745,46 @@ export async function statusCommandV7(options) {
1245
1745
  dependencyPlatform: platform,
1246
1746
  dependencyScope,
1247
1747
  dependencyProject: dependencyScope === 'project' ? 'current' : null,
1248
- ...dependencyResult,
1748
+ state: dependencyResult.state,
1749
+ ...(dependencyResult.rootIssueId
1750
+ ? { rootIssueId: dependencyResult.rootIssueId }
1751
+ : {}),
1752
+ ...(dependencyResult.rootIssueCode
1753
+ ? { rootIssueCode: dependencyResult.rootIssueCode }
1754
+ : {}),
1249
1755
  });
1756
+ const issuePluginId = dependencyResult.issuePluginId ?? dependencyId;
1757
+ const issueScope = dependencyResult.issueScope ?? dependencyScope;
1250
1758
  if (dependencyResult.state === 'absent') {
1251
1759
  dependencyErrors.push(finalizeTargetError({
1252
1760
  code: 'dependencyMissing',
1253
- message: `dependencyMissing: ${dependencyId} is absent from its required live placement.`,
1254
- dependencyPluginId: dependencyId,
1761
+ message: `dependencyMissing: ${issuePluginId} is absent from its required live placement.`,
1762
+ dependencyPluginId: issuePluginId,
1255
1763
  dependencyPlatform: platform,
1256
- dependencyScope,
1257
- dependencyProject: dependencyScope === 'project' ? 'current' : null,
1764
+ dependencyScope: issueScope,
1765
+ dependencyProject: issueScope === 'project' ? 'current' : null,
1258
1766
  rootIssueId: dependencyResult.rootIssueId,
1259
1767
  rootIssueCode: dependencyResult.rootIssueCode,
1260
1768
  }, 'partial'));
1261
1769
  }
1262
1770
  else if (dependencyResult.state !== 'ready') {
1771
+ const code = dependencyResult.rootIssueCode === 'awCapabilityUnsupported'
1772
+ ? 'awCapabilityUnsupported'
1773
+ : dependencyResult.rootIssueCode === 'dependencyGraphInvalid'
1774
+ ? 'dependencyGraphInvalid'
1775
+ : 'dependencyNotReady';
1776
+ const message = code === 'awCapabilityUnsupported'
1777
+ ? `${code}: ${issuePluginId} requires unsupported AW capabilities: ${(dependencyResult.missingCapabilities ?? []).join(', ')}.`
1778
+ : code === 'dependencyGraphInvalid'
1779
+ ? `${code}: dependency cycle includes ${issuePluginId}.`
1780
+ : `${code}: ${issuePluginId} is not ready at its required live placement.`;
1263
1781
  dependencyErrors.push(finalizeTargetError({
1264
- code: 'dependencyNotReady',
1265
- message: `dependencyNotReady: ${dependencyId} is not ready at its required live placement.`,
1266
- dependencyPluginId: dependencyId,
1782
+ code,
1783
+ message,
1784
+ dependencyPluginId: issuePluginId,
1267
1785
  dependencyPlatform: platform,
1268
- dependencyScope,
1269
- dependencyProject: dependencyScope === 'project' ? 'current' : null,
1786
+ dependencyScope: issueScope,
1787
+ dependencyProject: issueScope === 'project' ? 'current' : null,
1270
1788
  ...(dependencyResult.rootIssueId
1271
1789
  ? { rootIssueId: dependencyResult.rootIssueId }
1272
1790
  : {}),
@@ -1279,10 +1797,10 @@ export async function statusCommandV7(options) {
1279
1797
  }
1280
1798
  states[platform][scope] = {
1281
1799
  state: liveState,
1282
- errors: [...inspected.inspection.errors.map((error) => finalizeTargetError({
1800
+ errors: [...inspected.inspection.errors.map((error) => projectTargetError({
1283
1801
  code: 'componentInspectionFailed',
1284
1802
  message: `${error.label}: ${error.message}`,
1285
- }, liveState)), ...collisionErrors, ...dependencyErrors],
1803
+ }, env, options.cwd, liveState)), ...collisionErrors, ...dependencyErrors],
1286
1804
  ...(dependencyReadiness.length > 0 ? { dependencyReadiness } : {}),
1287
1805
  components: inspected.inspection.components.map((component) => {
1288
1806
  const projectedError = component.collision
@@ -1309,6 +1827,7 @@ export async function statusCommandV7(options) {
1309
1827
  };
1310
1828
  }
1311
1829
  catch (error) {
1830
+ throwIfCancelled(error);
1312
1831
  const message = error instanceof Error ? error.message : String(error);
1313
1832
  const configErrorCode = platform === 'codex' && codexConfigErrors.length > 0
1314
1833
  ? codexSurface.nativeKinds.length > 0
@@ -1316,17 +1835,17 @@ export async function statusCommandV7(options) {
1316
1835
  : 'codexActivationDrift'
1317
1836
  : undefined;
1318
1837
  const code = configErrorCode
1319
- ?? message.split(':', 1)[0]
1838
+ ?? /^([A-Za-z][A-Za-z0-9]*):/u.exec(message)?.[1]
1320
1839
  ?? 'targetInspectionFailed';
1321
1840
  states[platform][scope] = {
1322
1841
  state: 'error',
1323
1842
  components: [],
1324
- errors: [finalizeTargetError({
1843
+ errors: [projectTargetError({
1325
1844
  code,
1326
1845
  message: configErrorCode
1327
1846
  ? `${configErrorCode}: Codex activation state is unreadable.`
1328
1847
  : message,
1329
- }, 'error')],
1848
+ }, env, options.cwd, 'error')],
1330
1849
  };
1331
1850
  }
1332
1851
  }
@@ -1349,9 +1868,7 @@ export async function statusCommandV7(options) {
1349
1868
  activations: {},
1350
1869
  };
1351
1870
  let residueFailed = false;
1352
- const hasNativeRenderTargets = (plugin.manifest.artifacts?.targets ?? []).some((target) => target.platform === 'codex'
1353
- && target.target === 'codex.skill'
1354
- && target.delivery?.mode === 'codex-native');
1871
+ const hasNativeRenderTargets = plugin.manifest.artifacts !== undefined;
1355
1872
  const sharedInspection = codexSurface.nativeKinds.length > 0
1356
1873
  ? await inspectCodexSharedNativeLive({
1357
1874
  pluginName: entry.name,
@@ -1365,7 +1882,8 @@ export async function statusCommandV7(options) {
1365
1882
  nativeCliRunner,
1366
1883
  pluginRegistration,
1367
1884
  ...(hasNativeRenderTargets ? { nativeRenderPlugin: plugin } : {}),
1368
- }).catch(() => {
1885
+ }).catch((error) => {
1886
+ throwIfCancelled(error);
1369
1887
  residueFailed = true;
1370
1888
  return undefined;
1371
1889
  })
@@ -1414,16 +1932,11 @@ export async function statusCommandV7(options) {
1414
1932
  ?.snapshot.plugins[codexPluginId]?.enabled;
1415
1933
  const configuredProjectActivation = projectCodexConfig
1416
1934
  ?.snapshot.plugins[codexPluginId]?.enabled;
1417
- const userActivation = sharedInspection?.activationObservations.user
1418
- ? sharedInspection.activations.user === true
1419
- : configuredUserActivation;
1420
- const projectActivation = sharedInspection?.activationObservations.project
1421
- && configuredProjectActivation !== undefined
1422
- ? configuredProjectActivation && sharedInspection.activations.project === true
1423
- : configuredProjectActivation;
1935
+ const userActivation = configuredUserActivation;
1936
+ const projectActivation = configuredProjectActivation;
1424
1937
  const activationObserved = registrationScope === 'project'
1425
- ? sharedInspection?.activationObservations.project === true
1426
- : sharedInspection?.activationObservations.user === true;
1938
+ ? userCodexConfig !== undefined && projectCodexConfig !== undefined
1939
+ : userCodexConfig !== undefined;
1427
1940
  codexStatus = {
1428
1941
  pluginId: codexPluginId,
1429
1942
  nativeKinds: codexSurface.nativeKinds,
@@ -1433,7 +1946,7 @@ export async function statusCommandV7(options) {
1433
1946
  ...(userActivation !== undefined ? { user: userActivation } : {}),
1434
1947
  ...(projectActivation !== undefined ? { project: projectActivation } : {}),
1435
1948
  ...((userActivation !== undefined || projectActivation !== undefined)
1436
- ? { effective: projectActivation === true || userActivation === true }
1949
+ ? { effective: (projectActivation ?? userActivation) === true }
1437
1950
  : {}),
1438
1951
  evidence: activationObserved ? 'observed' : 'assumed',
1439
1952
  },
@@ -1446,6 +1959,7 @@ export async function statusCommandV7(options) {
1446
1959
  shortDescription: plugin.manifest.interface?.shortDescription
1447
1960
  ?? plugin.manifest.description,
1448
1961
  description: plugin.manifest.description,
1962
+ platforms: [...resolveSupportedPlatforms(plugin.manifest)],
1449
1963
  ...(plugin.manifest.config?.fields
1450
1964
  ? { configSchema: plugin.manifest.config.fields }
1451
1965
  : {}),
@@ -1475,6 +1989,7 @@ export async function statusCommandV7(options) {
1475
1989
  };
1476
1990
  }
1477
1991
  catch (error) {
1992
+ throwIfCancelled(error);
1478
1993
  const sanitized = sanitizeCatalogSourceError(error, env);
1479
1994
  return {
1480
1995
  ...base,
@@ -1488,6 +2003,86 @@ export async function statusCommandV7(options) {
1488
2003
  const available = catalog.sources.flatMap((source) => 'plugins' in source
1489
2004
  ? source.plugins.map((plugin) => ({ ...plugin, source }))
1490
2005
  : []);
2006
+ const removedProjectionReferences = [];
2007
+ for (const source of catalog.sources) {
2008
+ throwIfCancelled();
2009
+ if (!('plugins' in source))
2010
+ continue;
2011
+ const marketplaceRoot = path.join(resolveAwHome(env), 'marketplaces', source.id);
2012
+ try {
2013
+ const root = await readStrictNamespacedMarketplaceRoot({
2014
+ rootDir: marketplaceRoot, sourceId: source.id, sourceIdentity: source.identity,
2015
+ });
2016
+ if (!root)
2017
+ continue;
2018
+ const currentNames = new Set(source.plugins.map((plugin) => plugin.name));
2019
+ const candidates = new Map();
2020
+ const add = (name, platform) => {
2021
+ if (typeof name !== 'string' || currentNames.has(name))
2022
+ return;
2023
+ try {
2024
+ if (parsePluginId(name).sourceId !== undefined)
2025
+ return;
2026
+ }
2027
+ catch {
2028
+ return;
2029
+ }
2030
+ const supported = candidates.get(name) ?? new Set();
2031
+ supported.add(platform);
2032
+ candidates.set(name, supported);
2033
+ };
2034
+ for (const [platform, manifest] of [
2035
+ ['codex', root.agentsManifest], ['claude', root.claudeManifest],
2036
+ ]) {
2037
+ if (!Array.isArray(manifest?.plugins))
2038
+ continue;
2039
+ for (const plugin of manifest.plugins) {
2040
+ if (plugin && typeof plugin === 'object')
2041
+ add(plugin.name, platform);
2042
+ }
2043
+ }
2044
+ const pluginsRoot = path.join(root.rootDir, 'plugins');
2045
+ const pluginsStats = await fs.promises.lstat(pluginsRoot).catch((error) => {
2046
+ if (error.code === 'ENOENT')
2047
+ return undefined;
2048
+ throw error;
2049
+ });
2050
+ if (pluginsStats && (!pluginsStats.isDirectory() || pluginsStats.isSymbolicLink())) {
2051
+ throw new Error('marketplaceRootInvalid: plugin projection directory is unsafe.');
2052
+ }
2053
+ if (pluginsStats) {
2054
+ for (const entry of await fs.promises.readdir(pluginsRoot, { withFileTypes: true })) {
2055
+ if (!candidates.has(entry.name))
2056
+ add(entry.name, 'codex');
2057
+ }
2058
+ }
2059
+ const registration = userCodexConfig?.snapshot.marketplaces[root.config.marketplaceName];
2060
+ if (platforms.includes('codex')
2061
+ && isCanonicalCodexMarketplaceRegistration(registration, root.rootDir)
2062
+ && (await inspectCodexSystemConsumer(options.scope === 'project' ? 'project' : 'user')).state === 'compatible') {
2063
+ const observed = await options.codexObservationSession.snapshot(root.config.marketplaceName, options.scope === 'user' ? 'user' : 'both');
2064
+ const suffix = `@${root.config.marketplaceName}`;
2065
+ for (const pluginId of [...(observed.exact?.keys() ?? []), ...(observed.neutral?.keys() ?? [])]) {
2066
+ if (pluginId.endsWith(suffix))
2067
+ add(pluginId.slice(0, -suffix.length), 'codex');
2068
+ }
2069
+ }
2070
+ for (const [pluginName, supported] of candidates) {
2071
+ for (const platform of supported)
2072
+ removedProjectionReferences.push({
2073
+ kind: 'namespacedMarketplace', location: path.join(root.rootDir, 'config.json'),
2074
+ sourceId: source.id, sourceIdentity: source.identity,
2075
+ marketplaceName: root.config.marketplaceName, pluginName, platform, scope: 'user',
2076
+ });
2077
+ }
2078
+ }
2079
+ catch (error) {
2080
+ throwIfCancelled(error);
2081
+ const projected = projectStateInventoryError(error, env, options.cwd);
2082
+ selectedInventoryErrors.push({ ...projected, relevance: { sourceId: source.id, global: false } });
2083
+ }
2084
+ }
2085
+ const statusReferences = [...ownerInventory.references, ...removedProjectionReferences];
1491
2086
  const desiredTargetStates = calculateDesiredTargetStates({
1492
2087
  userIntent,
1493
2088
  projectIntent,
@@ -1529,7 +2124,21 @@ export async function statusCommandV7(options) {
1529
2124
  scopes,
1530
2125
  currentProjectLocationKey,
1531
2126
  }));
1532
- if (!selectorHasInventoryError) {
2127
+ const selectorHasLiveOrIntent = statusReferences.some((reference) => (reference.kind === 'namespacedOwner' || reference.kind === 'namespacedMarketplace')
2128
+ && reference.pluginName === selector.parsed.pluginName
2129
+ && reference.sourceId !== undefined
2130
+ && (selector.parsed.sourceId === undefined || reference.sourceId === selector.parsed.sourceId)
2131
+ && platforms.some((platform) => platform === reference.platform)
2132
+ && scopes.some((scope) => scope === reference.scope)
2133
+ && (reference.scope !== 'project' || reference.projectKey === currentProjectKey))
2134
+ || [userIntent, projectIntent].some((intent, index) => scopes.includes(index === 0 ? 'user' : 'project')
2135
+ && intent.roots.some((root) => {
2136
+ const parsed = parsePluginId(root.pluginId);
2137
+ return parsed.pluginName === selector.parsed.pluginName
2138
+ && (selector.parsed.sourceId === undefined || parsed.sourceId === selector.parsed.sourceId)
2139
+ && root.platforms.some(coversPlatform);
2140
+ }));
2141
+ if (!selectorHasInventoryError && !selectorHasLiveOrIntent) {
1533
2142
  selectorErrors.push({
1534
2143
  code: 'pluginNotFound',
1535
2144
  message: `Plugin "${selector.raw}" was not found in the selected catalog source set.`,
@@ -1642,7 +2251,7 @@ export async function statusCommandV7(options) {
1642
2251
  const referenceSelected = (reference) => (reference.pluginName !== undefined
1643
2252
  && reference.platform !== undefined
1644
2253
  && reference.scope !== undefined
1645
- && platforms.includes(reference.platform)
2254
+ && coversPlatform(reference.platform)
1646
2255
  && scopes.includes(reference.scope)
1647
2256
  && (reference.scope !== 'project' || reference.projectKey === currentProjectKey)
1648
2257
  && (requested.length === 0 || referenceSelectors.some((selector) => selector.parsed.pluginName === reference.pluginName
@@ -1651,7 +2260,7 @@ export async function statusCommandV7(options) {
1651
2260
  && reference.pluginName !== undefined
1652
2261
  && reference.platform !== undefined
1653
2262
  && reference.scope !== undefined
1654
- && platforms.includes(reference.platform)
2263
+ && coversPlatform(reference.platform)
1655
2264
  && scopes.includes(reference.scope)
1656
2265
  && (requested.length === 0 || plannedSelectors.some((selector) => selector.parsed.pluginName === reference.pluginName)));
1657
2266
  const missingSourceOwners = ownerInventory.references.filter((reference) => (reference.kind === 'namespacedOwner' || reference.kind === 'namespacedMarketplace')
@@ -1713,7 +2322,7 @@ export async function statusCommandV7(options) {
1713
2322
  targets.push(...unavailableSourceTargets);
1714
2323
  const availablePluginIds = new Set(available.map((entry) => formatPluginId({ sourceId: entry.source.id, pluginName: entry.name })));
1715
2324
  const resolvedSourceIds = new Set(catalog.sources.flatMap((source) => 'plugins' in source ? [source.id] : []));
1716
- const unavailableBundleReferences = ownerInventory.references.filter((reference) => (reference.kind === 'namespacedOwner' || reference.kind === 'namespacedMarketplace')
2325
+ const unavailableBundleReferences = statusReferences.filter((reference) => (reference.kind === 'namespacedOwner' || reference.kind === 'namespacedMarketplace')
1717
2326
  && reference.sourceId
1718
2327
  && configured.has(reference.sourceId)
1719
2328
  && resolvedSourceIds.has(reference.sourceId)
@@ -1723,7 +2332,7 @@ export async function statusCommandV7(options) {
1723
2332
  sourceId: reference.sourceId,
1724
2333
  pluginName: reference.pluginName,
1725
2334
  })));
1726
- const unavailableBundleTargets = [...new Map(unavailableBundleReferences.flatMap((reference) => {
2335
+ const unavailableBundleTargets = [...new Map((await Promise.all(unavailableBundleReferences.map(async (reference) => {
1727
2336
  if (!reference.sourceId || !reference.pluginName
1728
2337
  || (reference.platform !== 'codex' && reference.platform !== 'claude')
1729
2338
  || (reference.scope !== 'user' && reference.scope !== 'project'))
@@ -1732,6 +2341,10 @@ export async function statusCommandV7(options) {
1732
2341
  if (requested.length > 0 && !plannedSelectors.some((selector) => selector.parsed.pluginName === reference.pluginName
1733
2342
  && (selector.parsed.sourceId === undefined || selector.parsed.sourceId === reference.sourceId)))
1734
2343
  return [];
2344
+ const registration = reference.platform === 'codex' && reference.marketplaceName
2345
+ ? await inspectCodexRegistration(`${reference.pluginName}@${reference.marketplaceName}`, reference.scope)
2346
+ : undefined;
2347
+ const nativeUnknown = registration && registration.observation.state !== 'observed';
1735
2348
  const target = {
1736
2349
  pluginName: reference.pluginName,
1737
2350
  sourceId: reference.sourceId,
@@ -1741,14 +2354,24 @@ export async function statusCommandV7(options) {
1741
2354
  scope: reference.scope,
1742
2355
  cwd: path.resolve(options.cwd),
1743
2356
  state: 'error',
1744
- components: [],
2357
+ components: registration ? [{
2358
+ key: 'native',
2359
+ state: registration.observation.state !== 'observed' ? 'error'
2360
+ : registration.observation.value === 'installed' ? 'present' : 'absent',
2361
+ }] : [],
1745
2362
  errors: [finalizeTargetError({
1746
2363
  code: 'bundleUnavailable',
1747
2364
  message: `bundleUnavailable: ${pluginId} has live state but is not present in the current source snapshot.`,
1748
- }, 'error')],
2365
+ }, 'error'), finalizeTargetError({
2366
+ code: 'removedPluginCleanupRequired',
2367
+ message: `removedPluginCleanupRequired: ${pluginId} was removed from the current Catalog and has remaining local state.`,
2368
+ }, 'error'), ...(nativeUnknown ? [finalizeTargetError({
2369
+ code: 'codexNativeObservationFailed',
2370
+ message: 'codexNativeObservationFailed: the remaining native installation could not be observed.',
2371
+ }, 'error')] : [])],
1749
2372
  };
1750
2373
  return [[`${pluginId}\0${reference.platform}\0${reference.scope}`, target]];
1751
- })).values()];
2374
+ }))).flat()).values()];
1752
2375
  targets.push(...unavailableBundleTargets);
1753
2376
  const targetKeys = new Set(targets.map((target) => `${target.pluginId}\0${target.platform}\0${target.scope}`));
1754
2377
  for (const [scope, intent] of [
@@ -1763,7 +2386,7 @@ export async function statusCommandV7(options) {
1763
2386
  && (selector.parsed.sourceId === undefined || selector.parsed.sourceId === parsed.sourceId))) {
1764
2387
  continue;
1765
2388
  }
1766
- for (const platform of root.platforms.filter((candidate) => platforms.includes(candidate))) {
2389
+ for (const platform of root.platforms.filter(coversPlatform)) {
1767
2390
  if (!scopes.includes(scope))
1768
2391
  continue;
1769
2392
  const key = `${root.pluginId}\0${platform}\0${scope}`;
@@ -1822,15 +2445,13 @@ export async function statusCommandV7(options) {
1822
2445
  });
1823
2446
  const decorateTarget = async (target, groupedScopes, groupedTargets) => {
1824
2447
  const entry = selectedByPluginId.get(target.pluginId);
1825
- const codex = entry?.codex;
2448
+ const codex = target.platform === 'codex' ? entry?.codex : undefined;
1826
2449
  const desiredAll = desiredTargetStates.get(desiredTargetKey(target.pluginId, target.platform))
1827
2450
  ?? { scopes: [], relation: 'none' };
1828
- const desired = target.platform === 'codex'
1829
- ? desiredAll
1830
- : {
1831
- scopes: desiredAll.scopes.includes(target.scope) ? [target.scope] : [],
1832
- relation: desiredAll.relation,
1833
- };
2451
+ const desired = {
2452
+ scopes: desiredAll.scopes.includes(target.scope) ? [target.scope] : [],
2453
+ relation: desiredAll.relation,
2454
+ };
1834
2455
  const sharedNative = codex?.sharedNative ?? target.sharedNative;
1835
2456
  const baseActivation = codex?.activation ?? target.activation;
1836
2457
  const consumerScope = desired.scopes.includes('project')
@@ -1847,15 +2468,13 @@ export async function statusCommandV7(options) {
1847
2468
  const activation = baseActivation && systemConsumer
1848
2469
  ? {
1849
2470
  ...baseActivation,
1850
- evidence: baseActivation.evidence === 'observed'
2471
+ evidence: systemConsumer.state === 'compatible'
1851
2472
  ? 'observed'
1852
2473
  : systemConsumer.state === 'missing' ? 'assumed' : 'unobserved',
1853
2474
  systemConsumer,
1854
2475
  }
1855
2476
  : baseActivation;
1856
- const observationScopes = explicitScope
1857
- ? [explicitScope]
1858
- : desired.scopes.length > 0 ? desired.scopes : groupedScopes;
2477
+ const observationScopes = [target.scope];
1859
2478
  const scopedTargets = groupedTargets.filter((candidate) => observationScopes.includes(candidate.scope));
1860
2479
  const observedTargets = scopedTargets.length > 0 ? scopedTargets : groupedTargets;
1861
2480
  const ownershipState = observedTargets.some((candidate) => candidate.state === 'error')
@@ -1867,6 +2486,8 @@ export async function statusCommandV7(options) {
1867
2486
  : sharedNative?.staleCacheObserved
1868
2487
  ? 'partial'
1869
2488
  : 'absent';
2489
+ const actualScopeEnabled = target.platform === 'codex'
2490
+ && baseActivation?.[target.scope] === true;
1870
2491
  const hasSourceError = observedTargets.some((candidate) => candidate.errors.some((error) => error.code === 'sourceMissing'
1871
2492
  || error.code === 'catalogSourceUnavailable'
1872
2493
  || error.code === 'bundleUnavailable'
@@ -1875,18 +2496,26 @@ export async function statusCommandV7(options) {
1875
2496
  && (codex?.extensionKinds.length ?? 0) > 0
1876
2497
  && desired.scopes.includes('user')
1877
2498
  && desired.scopes.includes('project');
1878
- const expectedUser = desired.scopes.includes('user');
1879
- const expectedProject = desired.scopes.includes('project');
2499
+ const expectedEnabled = desired.scopes.includes(target.scope);
2500
+ const inheritedUserActivation = target.platform === 'codex'
2501
+ && target.scope === 'project'
2502
+ && !expectedEnabled
2503
+ && desiredAll.scopes.includes('user')
2504
+ && activation?.user === true
2505
+ && (codex?.nativeKinds.length ?? 0) > 0;
2506
+ const projectDisablesUserActivation = inheritedUserActivation && activation?.project === false;
2507
+ const redundantProjectActivation = inheritedUserActivation && activation?.project === true
2508
+ && (codex?.extensionKinds.length ?? 0) === 0;
1880
2509
  const activationDrift = target.platform === 'codex'
1881
2510
  && (codexConfigErrors.some((error) => error.scope === 'user' || observationScopes.includes(error.scope))
1882
2511
  || ((codex?.nativeKinds.length ?? 0) > 0
1883
- && ((expectedUser && activation?.user !== true)
1884
- || (!expectedUser && activation?.user === true)
1885
- || (expectedProject && activation?.project !== true)
1886
- || (!expectedProject && activation?.project === true))));
2512
+ && (expectedEnabled && activation?.[target.scope] !== true
2513
+ || !expectedEnabled && activation?.[target.scope] === true && !redundantProjectActivation
2514
+ || projectDisablesUserActivation)));
1887
2515
  const extensionComponents = observedTargets.flatMap((candidate) => candidate.components).filter((component) => component.key !== 'native'
1888
2516
  && !component.key.startsWith('activation-')
1889
2517
  && !component.key.startsWith('marketplace-'));
2518
+ const hasScopedExtensionResidue = extensionComponents.some((component) => component.state !== 'absent' || component.error !== undefined);
1890
2519
  const extensions = target.platform !== 'codex'
1891
2520
  || (codex?.extensionKinds.length ?? 0) === 0
1892
2521
  ? undefined
@@ -1895,17 +2524,43 @@ export async function statusCommandV7(options) {
1895
2524
  ? 'conflict'
1896
2525
  : extensionComponents.some((component) => component.error?.code === 'artifactCollision')
1897
2526
  ? 'conflict'
1898
- : observedTargets.some((candidate) => candidate.state === 'partial' || candidate.state === 'error')
2527
+ : extensionComponents.some((component) => component.state === 'partial' || component.state === 'error')
1899
2528
  ? 'drifted'
1900
- : extensionComponents.some((component) => component.state === 'partial' || component.state === 'error')
1901
- ? 'drifted'
1902
- : desired.scopes.length > 0 && (extensionComponents.length === 0
1903
- || extensionComponents.every((component) => component.state === 'absent'))
1904
- ? 'missing'
1905
- : 'ready',
2529
+ : desired.scopes.length > 0 && (extensionComponents.length === 0
2530
+ || extensionComponents.every((component) => component.state === 'absent'))
2531
+ ? 'missing'
2532
+ : 'ready',
1906
2533
  kinds: codex.extensionKinds,
1907
2534
  };
1908
2535
  const desiredEnabled = desired.scopes.length > 0;
2536
+ const projectDependencyIds = projectIntent.roots.some((root) => root.pluginId === target.pluginId && root.platforms.includes(target.platform))
2537
+ ? projectDependencyClosureForTarget({
2538
+ pluginId: target.pluginId,
2539
+ platform: target.platform,
2540
+ available,
2541
+ })
2542
+ : new Set();
2543
+ const dependencyMoves = projectIntent.dependencyScopeOverrides.flatMap((override) => {
2544
+ if (override.scope !== 'project'
2545
+ || (override.platform !== undefined && override.platform !== target.platform)
2546
+ || !projectDependencyIds.has(override.pluginId)) {
2547
+ return [];
2548
+ }
2549
+ const dependencyDesired = desiredTargetStates.get(desiredTargetKey(override.pluginId, target.platform));
2550
+ if (!dependencyDesired?.scopes.includes('project')
2551
+ || dependencyDesired.scopes.includes('user')) {
2552
+ return [];
2553
+ }
2554
+ const parsed = parsePluginId(override.pluginId);
2555
+ const hasPreservedUserActual = ownerInventory.references.some((reference) => reference.kind === 'namespacedOwner'
2556
+ && reference.sourceId === parsed.sourceId
2557
+ && reference.pluginName === parsed.pluginName
2558
+ && reference.platform === target.platform
2559
+ && reference.scope === 'user');
2560
+ return hasPreservedUserActual
2561
+ ? [{ pluginId: override.pluginId, fromScope: 'user', toScope: 'project' }]
2562
+ : [];
2563
+ }).sort((left, right) => left.pluginId.localeCompare(right.pluginId, 'en'));
1909
2564
  const consumerIssue = activation?.systemConsumer?.state === 'incompatible'
1910
2565
  || activation?.systemConsumer?.state === 'unresolved'
1911
2566
  ? activation.systemConsumer
@@ -1914,6 +2569,7 @@ export async function statusCommandV7(options) {
1914
2569
  const baseTargetErrors = observedTargets.flatMap((candidate) => candidate.errors);
1915
2570
  const hasBlockingBaseReason = baseTargetErrors.some((reason) => reason.severity === 'blocking');
1916
2571
  const capabilityUnsupported = baseTargetErrors.some((reason) => reason.code === 'awCapabilityUnsupported');
2572
+ const dependencyNotReady = (target.dependencyReadiness ?? []).some((dependency) => dependency.state !== 'ready');
1917
2573
  const state = hasSourceError && desiredEnabled
1918
2574
  ? 'blocked'
1919
2575
  : consumerBlocking && desiredEnabled
@@ -1922,38 +2578,64 @@ export async function statusCommandV7(options) {
1922
2578
  ? 'blocked'
1923
2579
  : sharedNative?.state === 'blocked' || hasBlockingBaseReason || capabilityUnsupported
1924
2580
  ? 'blocked'
1925
- : !desiredEnabled
1926
- ? ownershipState !== 'absent' || desired.relation === 'managed'
1927
- ? 'orphaned'
1928
- : 'absent'
1929
- : sharedNative?.state === 'missing'
1930
- || sharedNative?.state === 'replaceable'
1931
- || sharedNative?.state === 'unobserved'
2581
+ : sharedNative?.state === 'replaceable' && sharedNative.reason === 'damaged'
2582
+ ? 'needsSync'
2583
+ : projectDisablesUserActivation
1932
2584
  ? 'needsSync'
1933
- : activationDrift || extensions?.state === 'drifted'
1934
- ? 'needsSync'
1935
- : extensions?.state === 'missing' || ownershipState === 'absent'
1936
- ? 'needsSync'
1937
- : ownershipState === 'partial' || ownershipState === 'error'
2585
+ : redundantProjectActivation && sharedNative?.state === 'usable' && !hasScopedExtensionResidue
2586
+ ? 'ready'
2587
+ : !desiredEnabled
2588
+ ? (target.platform === 'codex'
2589
+ ? actualScopeEnabled || hasScopedExtensionResidue
2590
+ : ownershipState !== 'absent')
2591
+ || desired.relation === 'managed'
2592
+ ? 'orphaned'
2593
+ : 'absent'
2594
+ : dependencyMoves.length > 0
1938
2595
  ? 'needsSync'
1939
- : 'ready';
2596
+ : dependencyNotReady
2597
+ ? 'needsSync'
2598
+ : sharedNative?.state === 'missing'
2599
+ || sharedNative?.state === 'replaceable'
2600
+ || sharedNative?.state === 'unobserved'
2601
+ ? 'needsSync'
2602
+ : activationDrift || extensions?.state === 'drifted'
2603
+ ? 'needsSync'
2604
+ : extensions?.state === 'missing'
2605
+ || (target.platform !== 'codex' && ownershipState === 'absent')
2606
+ ? 'needsSync'
2607
+ : ownershipState === 'partial' || ownershipState === 'error'
2608
+ ? 'needsSync'
2609
+ : 'ready';
1940
2610
  const stableErrors = [
1941
2611
  ...projectStatusSharedNativeReasons(sharedNative, baseTargetErrors.map((error) => error.code), desiredEnabled),
1942
2612
  ...(desiredOverlapConflict
1943
2613
  ? [blocking('codexExtensionScopeConflict', `${target.pluginId} has AW extensions desired at user and project scope.`)]
1944
2614
  : []),
1945
2615
  ...(activationDrift && sharedNative?.state !== 'missing' && sharedNative?.state !== 'unobserved'
1946
- ? [warning('codexActivationDrift', `${target.pluginId} activation differs from desired intent.`)]
2616
+ ? [warning('codexActivationDrift', projectDisablesUserActivation
2617
+ ? `${target.pluginId} is enabled for the user but disabled by the current project.`
2618
+ : `${target.pluginId} activation differs from desired intent: `
2619
+ + `${target.scope} expected=${expectedEnabled}, `
2620
+ + `actual=${activation?.[target.scope] ?? 'unset'}.`)]
1947
2621
  : []),
1948
2622
  ...(extensions?.state === 'drifted'
1949
2623
  ? [warning('codexExtensionDrift', `${target.pluginId} extension projection has drifted.`)]
1950
2624
  : []),
2625
+ ...dependencyMoves.map((move) => ({
2626
+ ...warning('dependencyScopeMigrationCleanupRequired', `${move.pluginId} has preserved user-scope output after moving to project scope.`),
2627
+ dependencyPluginId: move.pluginId,
2628
+ dependencyPlatform: target.platform,
2629
+ dependencyScope: move.toScope,
2630
+ dependencyProject: 'current',
2631
+ })),
1951
2632
  ...(target.platform === 'codex' && hasSourceError && desiredEnabled
1952
2633
  ? [warning('codexIntentSourceUnavailable', `${target.pluginId} desired intent cannot be resolved from the current Catalog.`)]
1953
2634
  : []),
1954
2635
  ...(target.platform === 'codex' && consumerBlocking && desiredEnabled
1955
2636
  ? [blocking(consumerIssue.code, consumerIssue.diagnostic)]
1956
2637
  : []),
2638
+ ...(activation?.systemConsumer?.diagnostics ?? []).map((diagnostic) => warning('codexCandidateExcluded', diagnostic)),
1957
2639
  ];
1958
2640
  const targetErrors = [...baseTargetErrors, ...stableErrors];
1959
2641
  const dedupedErrors = [...new Map(targetErrors.map((error) => [
@@ -1962,11 +2644,7 @@ export async function statusCommandV7(options) {
1962
2644
  ])).values()];
1963
2645
  const ownershipComponents = [...new Map(observedTargets.flatMap((candidate) => candidate.components)
1964
2646
  .map((component) => [component.key, component])).values()];
1965
- const representativeScope = explicitScope
1966
- ?? (desired.scopes.length === 1
1967
- ? desired.scopes[0]
1968
- : observedTargets.find((candidate) => candidate.state !== 'absent')?.scope
1969
- ?? (groupedScopes.includes('user') ? 'user' : groupedScopes[0] ?? target.scope));
2647
+ const representativeScope = target.scope;
1970
2648
  const representativeTarget = observedTargets.find((candidate) => candidate.scope === representativeScope) ?? target;
1971
2649
  const components = [
1972
2650
  {
@@ -2013,7 +2691,7 @@ export async function statusCommandV7(options) {
2013
2691
  }]),
2014
2692
  ...(activation?.systemConsumer ? [{
2015
2693
  kind: 'systemConsumer',
2016
- key: 'codex',
2694
+ key: `codex:${representativeScope}`,
2017
2695
  state: activation.systemConsumer.state,
2018
2696
  metadata: {
2019
2697
  evidence: activation.evidence,
@@ -2025,6 +2703,9 @@ export async function statusCommandV7(options) {
2025
2703
  ...('diagnostic' in activation.systemConsumer
2026
2704
  ? { diagnostic: activation.systemConsumer.diagnostic }
2027
2705
  : {}),
2706
+ ...(activation.systemConsumer.diagnostics?.length
2707
+ ? { diagnostics: activation.systemConsumer.diagnostics }
2708
+ : {}),
2028
2709
  },
2029
2710
  }] : []),
2030
2711
  ...(extensions ? [{
@@ -2053,12 +2734,18 @@ export async function statusCommandV7(options) {
2053
2734
  state,
2054
2735
  components,
2055
2736
  reasons: dedupedErrors,
2056
- recoveryActions: statusRecovery({
2737
+ recoveryActions: projectDisablesUserActivation && state === 'needsSync' ? [{
2738
+ command: 'sync', scope: 'user',
2739
+ description: '移除当前项目的关闭设置,恢复使用所有项目已启用的插件。',
2740
+ }] : statusRecovery({
2057
2741
  state,
2058
2742
  desired,
2059
2743
  platform: target.platform,
2060
2744
  pluginId: target.pluginId,
2745
+ ...(dependencyMoves.length > 0 ? { dependencyMoves } : {}),
2061
2746
  ...(sharedNative ? { sharedNative } : {}),
2747
+ scope: target.scope,
2748
+ actualEnabled: actualScopeEnabled,
2062
2749
  conflictRoots: rootIntentsForTarget({
2063
2750
  pluginId: target.pluginId,
2064
2751
  platform: target.platform,
@@ -2067,7 +2754,9 @@ export async function statusCommandV7(options) {
2067
2754
  available,
2068
2755
  }),
2069
2756
  errorCodes: dedupedErrors.map((error) => error.code),
2070
- }),
2757
+ }).map((action) => action.command === 'manual' || action.scope
2758
+ ? action
2759
+ : { ...action, scope: representativeScope }),
2071
2760
  };
2072
2761
  };
2073
2762
  const codexGroups = new Map();
@@ -2082,21 +2771,153 @@ export async function statusCommandV7(options) {
2082
2771
  codexGroups.set(target.pluginId, group);
2083
2772
  }
2084
2773
  for (const group of codexGroups.values()) {
2085
- const scopes = [...new Set(group.map((target) => target.scope))].sort();
2086
- projectedTargets.push(await decorateTarget(group[0], scopes, group));
2774
+ const decorated = await Promise.all(group.map((target) => decorateTarget(target, [target.scope], [target])));
2775
+ const first = decorated[0];
2776
+ const entry = selectedByPluginId.get(first.pluginId);
2777
+ const desired = desiredTargetStates.get(desiredTargetKey(first.pluginId, 'codex'))
2778
+ ?? { scopes: [], relation: 'none' };
2779
+ const returnedScopes = new Set(decorated.map((target) => target.scope));
2780
+ const desiredOverlapConflict = (entry?.codex?.extensionKinds.length ?? 0) > 0
2781
+ && desired.scopes.includes('user')
2782
+ && desired.scopes.includes('project')
2783
+ && returnedScopes.has('user')
2784
+ && returnedScopes.has('project');
2785
+ const sharedComponents = [...new Map(decorated.flatMap((target) => target.components)
2786
+ .filter((component) => component.kind === 'sharedNative' || component.kind === 'systemConsumer')
2787
+ .map((component) => [`${component.kind}\0${component.key}`, component])).values()];
2788
+ const sharedReason = (reason) => reason.code.startsWith('codexSharedNative') || reason.code === 'staleCacheObserved'
2789
+ || reason.code === 'codexCandidateExcluded';
2790
+ const sharedReasons = decorated.flatMap((target) => target.reasons.filter(sharedReason));
2791
+ const placements = decorated.map((target) => ({
2792
+ scope: target.scope,
2793
+ state: target.state,
2794
+ components: target.components.filter((component) => component.kind !== 'sharedNative' && component.kind !== 'systemConsumer'),
2795
+ reasons: target.reasons.filter((reason) => !sharedReason(reason)),
2796
+ recoveryActions: target.recoveryActions,
2797
+ })).sort((left, right) => left.scope.localeCompare(right.scope, 'en'));
2798
+ const reasons = [...new Map([
2799
+ ...placements.flatMap((placement) => placement.reasons),
2800
+ ...sharedReasons,
2801
+ ...(desiredOverlapConflict ? [blocking('codexExtensionScopeConflict', `${first.pluginId} has AW extensions desired at user and project scope.`)] : []),
2802
+ ]
2803
+ .map((reason) => [`${reason.code}\0${reason.message}`, reason])).values()];
2804
+ const conflictRecovery = desiredOverlapConflict ? statusRecovery({
2805
+ state: 'blocked',
2806
+ desired,
2807
+ platform: 'codex',
2808
+ pluginId: first.pluginId,
2809
+ conflictRoots: rootIntentsForTarget({
2810
+ pluginId: first.pluginId,
2811
+ platform: 'codex',
2812
+ userIntent,
2813
+ projectIntent,
2814
+ available,
2815
+ }),
2816
+ errorCodes: ['codexExtensionScopeConflict'],
2817
+ }) : [];
2818
+ const recoveryActions = [...new Map((desiredOverlapConflict
2819
+ ? conflictRecovery
2820
+ : placements.flatMap((placement) => placement.recoveryActions))
2821
+ .map((action) => [
2822
+ `${action.command}\0${action.scope ?? ''}\0${action.description}`,
2823
+ action,
2824
+ ])).values()];
2825
+ const state = desiredOverlapConflict ? 'blocked'
2826
+ : ['blocked', 'needsSync', 'orphaned', 'ready', 'absent']
2827
+ .find((candidate) => placements.some((placement) => placement.state === candidate));
2828
+ projectedTargets.push({
2829
+ pluginName: first.pluginName,
2830
+ sourceId: first.sourceId,
2831
+ sourceIdentity: first.sourceIdentity,
2832
+ pluginId: first.pluginId,
2833
+ ...(first.version ? { version: first.version } : {}),
2834
+ platform: 'codex',
2835
+ cwd: first.cwd,
2836
+ state,
2837
+ components: sharedComponents,
2838
+ reasons,
2839
+ recoveryActions,
2840
+ placements,
2841
+ });
2087
2842
  }
2088
- projectedTargets.sort((left, right) => `${left.pluginId}\0${left.platform}\0${left.scope}`.localeCompare(`${right.pluginId}\0${right.platform}\0${right.scope}`, 'en'));
2089
- const targetRevisions = projectedTargets.map((target) => {
2843
+ projectedTargets.sort((left, right) => `${left.pluginId}\0${left.platform}`.localeCompare(`${right.pluginId}\0${right.platform}`, 'en'));
2844
+ const targetRevisions = projectedTargets.flatMap((target) => {
2090
2845
  const entry = selectedByPluginId.get(target.pluginId);
2091
- return {
2846
+ const placements = target.platform === 'codex' ? target.placements : [target];
2847
+ return placements.map((placement) => ({
2092
2848
  pluginId: target.pluginId,
2093
2849
  platform: target.platform,
2094
- scope: target.scope,
2095
- revision: projectTargetRevision(entry?.version, entry?.states[target.platform]?.[target.scope]?.installedVersion),
2096
- };
2850
+ scope: placement.scope,
2851
+ revision: projectTargetRevision(entry?.version, entry?.states[target.platform]?.[placement.scope]?.installedVersion),
2852
+ }));
2097
2853
  });
2854
+ const publicConfigIssues = available.flatMap((entry) => (entry.configIssues ?? [])
2855
+ .filter((issue) => issue.type === 'configLayerUnsupported')
2856
+ .map((issue) => ({
2857
+ pluginId: formatPluginId({ sourceId: entry.source.id, pluginName: entry.name }),
2858
+ pluginName: entry.name,
2859
+ ...issue,
2860
+ })));
2861
+ const nativeObservations = available.flatMap((entry) => ['codex', 'claude'].map((platform) => {
2862
+ const observed = entry.states[platform]?.[scope];
2863
+ const blockers = (observed?.errors ?? []).map((error) => ({
2864
+ code: error.code, message: `${error.code}: 项目 Native 目标尚未满足。`,
2865
+ }));
2866
+ const nativeInventoryErrors = inventoryErrors.filter((error) => inventoryErrorMatchesSelection({
2867
+ error,
2868
+ selectors: [{ raw: `${entry.source.id}/${entry.name}`, parsed: {
2869
+ sourceId: entry.source.id, pluginName: entry.name,
2870
+ } }],
2871
+ platformExplicit: true, scopeExplicit: true, platforms: [platform], scopes: [scope],
2872
+ currentProjectLocationKey,
2873
+ }));
2874
+ blockers.push(...nativeInventoryErrors.map((error) => ({
2875
+ code: error.code, message: `${error.code}: 无法读取项目 Native 现场。`,
2876
+ })));
2877
+ if (platform === 'codex' && codexConfigErrors.some((error) => error.scope === scope
2878
+ || scope === 'project' && error.scope === 'user')) {
2879
+ blockers.push({ code: 'nativeStateUnreadable', message: '无法读取 Codex 激活配置。' });
2880
+ }
2881
+ const scopedPreferences = observedDemands.get(scope)?.preferences;
2882
+ if (entry.configDiagnostic?.scope === scope && scopedPreferences?.state === 'valid'
2883
+ && resolveActiveConfigPlatforms(`${entry.source.id}/${entry.name}`, { platforms: entry.platforms }, scopedPreferences).includes(platform)) {
2884
+ blockers.push({ code: 'configInvalid', message: 'Plugin configuration could not be read.', detail: { reasonCode: 'configReadFailed' } });
2885
+ }
2886
+ const configBlockers = configStatusDiagnostics((entry.configIssues ?? []).flatMap((issue) => issue.scope === scope && issue.platform === platform && (issue.type === 'missing-required' || issue.type === 'invalid-config')
2887
+ ? [{ type: issue.type, key: issue.key, message: '' }] : []));
2888
+ blockers.push(...configBlockers);
2889
+ if (observed?.state === 'error' && !blockers.some((error) => /Unsupported$|collision|conflict|foreign/iu.test(error.code))) {
2890
+ blockers.push({ code: 'nativeObservationFailed', message: '无法完成项目 Native 现场观察。' });
2891
+ }
2892
+ let content = !observed ? 'unknown'
2893
+ : observed.state === 'absent' ? 'absent'
2894
+ : observed.state === 'present' ? 'satisfied'
2895
+ : observed.state === 'partial' ? 'drifted' : 'unknown';
2896
+ if (blockers.some((blocker) => /collision|conflict|foreign/iu.test(blocker.code)))
2897
+ content = 'conflict';
2898
+ if (platform === 'codex' && entry.codex?.nativeKinds.length) {
2899
+ const shared = entry.codex.sharedNative;
2900
+ if (shared?.state === 'missing')
2901
+ content = 'absent';
2902
+ else if (shared?.state === 'replaceable')
2903
+ content = 'drifted';
2904
+ else if (shared?.state === 'blocked')
2905
+ content = shared.reason === 'foreign' ? 'conflict' : 'unknown';
2906
+ else if (!shared || shared.state === 'unobserved')
2907
+ content = 'unknown';
2908
+ if (content === 'satisfied' && entry.codex.activation.effective !== true)
2909
+ content = 'absent';
2910
+ }
2911
+ return {
2912
+ pluginId: `${entry.source.id}/${entry.name}`, platform, content, blockers,
2913
+ backend: flattenStatusTargets(projectedTargets).find((target) => target.pluginId === `${entry.source.id}/${entry.name}`
2914
+ && target.platform === platform && target.scope === scope),
2915
+ ...(platform === 'codex' && entry.codex?.activation.evidence === 'assumed'
2916
+ ? { assumedActivation: true } : {}),
2917
+ };
2918
+ }));
2098
2919
  const payload = {
2099
- schemaVersion: 7,
2920
+ schemaVersion: 8,
2100
2921
  catalog: {
2101
2922
  primarySourceId: catalog.primarySourceId,
2102
2923
  configDigest: catalog.configDigest,
@@ -2118,6 +2939,7 @@ export async function statusCommandV7(options) {
2118
2939
  cwd: path.resolve(options.cwd),
2119
2940
  },
2120
2941
  targets: projectedTargets,
2942
+ ...(publicConfigIssues.length > 0 ? { configIssues: publicConfigIssues } : {}),
2121
2943
  errors,
2122
2944
  };
2123
2945
  const hasErrors = payload.catalog.sources.some((source) => source.error !== undefined)
@@ -2125,9 +2947,20 @@ export async function statusCommandV7(options) {
2125
2947
  || payload.targets.some((target) => target.reasons.some((reason) => reason.severity === 'blocking'));
2126
2948
  return {
2127
2949
  payload,
2128
- output: options.json ? JSON.stringify(payload) : renderStatusV7(payload, options.verbose === true),
2950
+ output: options.json ? JSON.stringify(payload) : renderStatusV8(payload, options.verbose === true),
2129
2951
  hasErrors,
2130
2952
  targetRevisions,
2953
+ nativeObservations,
2954
+ nativeExtraObserved: ownerInventory.references.flatMap((reference) => {
2955
+ if (!reference.sourceId || !reference.pluginName || reference.scope !== scope
2956
+ || !['namespacedOwner', 'namespacedConfig', 'namespacedMarketplace'].includes(reference.kind))
2957
+ return [];
2958
+ return [{ pluginId: `${reference.sourceId}/${reference.pluginName}`,
2959
+ ...(reference.platform === 'codex' || reference.platform === 'claude'
2960
+ ? { platform: reference.platform } : {}), scope, reference }];
2961
+ }),
2962
+ ...(projectRoot ? { projectRoot } : {}),
2963
+ projectIntentObservation,
2131
2964
  pluginSummaries: available.map((entry) => {
2132
2965
  const sourceEntries = available.filter((candidate) => candidate.source.id === entry.source.id);
2133
2966
  const byName = new Map(sourceEntries.map((candidate) => [candidate.name, candidate]));
@@ -2158,6 +2991,7 @@ export async function statusCommandV7(options) {
2158
2991
  codex: ['user', 'project'].filter((scope) => entry.targets.codex[scope]),
2159
2992
  claude: ['user', 'project'].filter((scope) => entry.targets.claude[scope]),
2160
2993
  },
2994
+ ...(entry.platforms ? { platforms: entry.platforms } : {}),
2161
2995
  configFieldCount: Object.keys(entry.configSchema ?? {}).length,
2162
2996
  ...(entry.configSchema ? { configSchema: entry.configSchema } : {}),
2163
2997
  ...(entry.configIssues ? { configIssues: entry.configIssues } : {}),
@@ -2172,4 +3006,29 @@ export async function statusCommandV7(options) {
2172
3006
  }),
2173
3007
  };
2174
3008
  }
3009
+ export async function statusCommandV8(options) {
3010
+ options.signal?.throwIfAborted();
3011
+ options = { ...options, nativeCliRunner: bindNativeCliRunnerSignal(options.nativeCliRunner ?? getDefaultNativeCliRunner(), options.signal) };
3012
+ if (options.codexObservationSession) {
3013
+ return statusCommandV8InSession({
3014
+ ...options,
3015
+ codexObservationSession: options.codexObservationSession,
3016
+ });
3017
+ }
3018
+ const env = options.env ?? process.env;
3019
+ const session = await createCodexNativeObservationSession({
3020
+ exactCwd: options.cwd,
3021
+ env,
3022
+ runner: options.nativeCliRunner ?? getDefaultNativeCliRunner(),
3023
+ });
3024
+ try {
3025
+ options.signal?.throwIfAborted();
3026
+ const result = await statusCommandV8InSession({ ...options, codexObservationSession: session });
3027
+ options.signal?.throwIfAborted();
3028
+ return result;
3029
+ }
3030
+ finally {
3031
+ await session.dispose();
3032
+ }
3033
+ }
2175
3034
  //# sourceMappingURL=status-v6.js.map