@lesliechan721/aw 0.1.0-beta.72 → 0.1.0-beta.74

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 (364) hide show
  1. package/dist/authoring/assets/aw-runtime-config.mjs +65 -43
  2. package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -1
  3. package/dist/authoring/scripts/add-skill.mjs +5 -14
  4. package/dist/authoring/scripts/add-skill.mjs.map +1 -1
  5. package/dist/authoring/scripts/init-plugin.mjs +4 -28
  6. package/dist/authoring/scripts/init-plugin.mjs.map +1 -1
  7. package/dist/authoring/scripts/lib/plugin-version-check.mjs +2 -2
  8. package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -1
  9. package/dist/authoring/scripts/lib/skill-scaffold.mjs +0 -1
  10. package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -1
  11. package/dist/authoring/scripts/validate-plugin.mjs +234 -1422
  12. package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
  13. package/dist/scripts/aw-skill-eval-materializer.d.ts +2 -0
  14. package/dist/scripts/aw-skill-eval-materializer.js +19 -80
  15. package/dist/scripts/aw-skill-eval-materializer.js.map +1 -1
  16. package/dist/scripts/bundle-plugins.js.map +1 -1
  17. package/dist/scripts/test-plugin-scripts.js +6 -8
  18. package/dist/scripts/test-plugin-scripts.js.map +1 -1
  19. package/dist/src/commands/aw-capabilities.d.ts +1 -1
  20. package/dist/src/commands/aw-capabilities.js +2 -2
  21. package/dist/src/commands/aw-capabilities.js.map +1 -1
  22. package/dist/src/commands/dependency-operation-plan.js +3 -3
  23. package/dist/src/commands/dependency-operation-plan.js.map +1 -1
  24. package/dist/src/commands/deployment-confirmation.d.ts +4 -0
  25. package/dist/src/commands/deployment-confirmation.js +20 -0
  26. package/dist/src/commands/deployment-confirmation.js.map +1 -0
  27. package/dist/src/commands/managed-commands.js +4 -2
  28. package/dist/src/commands/managed-commands.js.map +1 -1
  29. package/dist/src/commands/offline-cleanup-evidence.d.ts +3 -1
  30. package/dist/src/commands/offline-cleanup-evidence.js +9 -4
  31. package/dist/src/commands/offline-cleanup-evidence.js.map +1 -1
  32. package/dist/src/commands/operation-plan.d.ts +6 -0
  33. package/dist/src/commands/operation-plan.js +29 -2
  34. package/dist/src/commands/operation-plan.js.map +1 -1
  35. package/dist/src/commands/options.d.ts +6 -2
  36. package/dist/src/commands/options.js +5 -4
  37. package/dist/src/commands/options.js.map +1 -1
  38. package/dist/src/commands/plugin-capabilities.js +29 -41
  39. package/dist/src/commands/plugin-capabilities.js.map +1 -1
  40. package/dist/src/commands/public-config-confirmation.js +5 -5
  41. package/dist/src/commands/public-config-confirmation.js.map +1 -1
  42. package/dist/src/commands/public-lifecycle-result.d.ts +47 -0
  43. package/dist/src/commands/public-lifecycle-result.js +119 -4
  44. package/dist/src/commands/public-lifecycle-result.js.map +1 -1
  45. package/dist/src/commands/public-lifecycle.d.ts +2 -0
  46. package/dist/src/commands/public-lifecycle.js +29 -6
  47. package/dist/src/commands/public-lifecycle.js.map +1 -1
  48. package/dist/src/commands/public-plugin-query.d.ts +1 -0
  49. package/dist/src/commands/public-plugin-query.js +28 -8
  50. package/dist/src/commands/public-plugin-query.js.map +1 -1
  51. package/dist/src/commands/rebuild-command.d.ts +12 -11
  52. package/dist/src/commands/rebuild-command.js +529 -769
  53. package/dist/src/commands/rebuild-command.js.map +1 -1
  54. package/dist/src/commands/rebuild-integration.d.ts +21 -43
  55. package/dist/src/commands/rebuild-integration.js +306 -3600
  56. package/dist/src/commands/rebuild-integration.js.map +1 -1
  57. package/dist/src/commands/rebuild-operations.d.ts +13 -0
  58. package/dist/src/commands/rebuild-operations.js +60 -15
  59. package/dist/src/commands/rebuild-operations.js.map +1 -1
  60. package/dist/src/commands/rebuild-platform-integration.d.ts +59 -0
  61. package/dist/src/commands/rebuild-platform-integration.js +1200 -0
  62. package/dist/src/commands/rebuild-platform-integration.js.map +1 -0
  63. package/dist/src/commands/review-inspection.js +41 -4
  64. package/dist/src/commands/review-inspection.js.map +1 -1
  65. package/dist/src/commands/review-preparation.d.ts +2 -0
  66. package/dist/src/commands/review-preparation.js +23 -60
  67. package/dist/src/commands/review-preparation.js.map +1 -1
  68. package/dist/src/commands/skill-eval.js +1 -0
  69. package/dist/src/commands/skill-eval.js.map +1 -1
  70. package/dist/src/commands/status-v6.d.ts +3 -1
  71. package/dist/src/commands/status-v6.js +24 -15
  72. package/dist/src/commands/status-v6.js.map +1 -1
  73. package/dist/src/commands/targets-command.d.ts +9 -0
  74. package/dist/src/commands/targets-command.js +57 -6
  75. package/dist/src/commands/targets-command.js.map +1 -1
  76. package/dist/src/commands/write-commands.js +43 -28
  77. package/dist/src/commands/write-commands.js.map +1 -1
  78. package/dist/src/constants.d.ts +2 -2
  79. package/dist/src/constants.js +2 -2
  80. package/dist/src/constants.js.map +1 -1
  81. package/dist/src/generators/local-plugin.js +59 -248
  82. package/dist/src/generators/local-plugin.js.map +1 -1
  83. package/dist/src/index.js +45 -16
  84. package/dist/src/index.js.map +1 -1
  85. package/dist/src/intent/scope-context.js +23 -19
  86. package/dist/src/intent/scope-context.js.map +1 -1
  87. package/dist/src/output/command-receipt.d.ts +1 -1
  88. package/dist/src/output/command-receipt.js +3 -1
  89. package/dist/src/output/command-receipt.js.map +1 -1
  90. package/dist/src/output/native-consent.d.ts +2 -0
  91. package/dist/src/output/native-consent.js +5 -0
  92. package/dist/src/output/native-consent.js.map +1 -0
  93. package/dist/src/output/public-result.js +60 -0
  94. package/dist/src/output/public-result.js.map +1 -1
  95. package/dist/src/output/rebuild-progress.js +5 -5
  96. package/dist/src/output/rebuild-progress.js.map +1 -1
  97. package/dist/src/output/receipt-projection.js +19 -2
  98. package/dist/src/output/receipt-projection.js.map +1 -1
  99. package/dist/src/platforms/capabilities.d.ts +10 -0
  100. package/dist/src/platforms/capabilities.js +158 -0
  101. package/dist/src/platforms/capabilities.js.map +1 -0
  102. package/dist/src/platforms/contracts.d.ts +338 -0
  103. package/dist/src/platforms/contracts.js +2 -0
  104. package/dist/src/platforms/contracts.js.map +1 -0
  105. package/dist/src/platforms/cursor-workspace-hook.d.ts +22 -0
  106. package/dist/src/platforms/cursor-workspace-hook.js +185 -0
  107. package/dist/src/platforms/cursor-workspace-hook.js.map +1 -0
  108. package/dist/src/platforms/discovery.d.ts +74 -0
  109. package/dist/src/platforms/discovery.js +582 -0
  110. package/dist/src/platforms/discovery.js.map +1 -0
  111. package/dist/src/platforms/gemini-activation.d.ts +36 -0
  112. package/dist/src/platforms/gemini-activation.js +331 -0
  113. package/dist/src/platforms/gemini-activation.js.map +1 -0
  114. package/dist/src/platforms/gemini-consent.d.ts +8 -0
  115. package/dist/src/platforms/gemini-consent.js +79 -0
  116. package/dist/src/platforms/gemini-consent.js.map +1 -0
  117. package/dist/src/platforms/identity.d.ts +4 -0
  118. package/dist/src/platforms/identity.js +22 -0
  119. package/dist/src/platforms/identity.js.map +1 -0
  120. package/dist/src/platforms/inspection-grok.d.ts +4 -0
  121. package/dist/src/platforms/inspection-grok.js +173 -0
  122. package/dist/src/platforms/inspection-grok.js.map +1 -0
  123. package/dist/src/platforms/inspection-native.d.ts +6 -0
  124. package/dist/src/platforms/inspection-native.js +379 -0
  125. package/dist/src/platforms/inspection-native.js.map +1 -0
  126. package/dist/src/platforms/inspection-pi.d.ts +4 -0
  127. package/dist/src/platforms/inspection-pi.js +212 -0
  128. package/dist/src/platforms/inspection-pi.js.map +1 -0
  129. package/dist/src/platforms/inspection.d.ts +13 -0
  130. package/dist/src/platforms/inspection.js +189 -0
  131. package/dist/src/platforms/inspection.js.map +1 -0
  132. package/dist/src/platforms/layout.d.ts +21 -0
  133. package/dist/src/platforms/layout.js +239 -0
  134. package/dist/src/platforms/layout.js.map +1 -0
  135. package/dist/src/platforms/lifecycle-native-services.d.ts +3 -0
  136. package/dist/src/platforms/lifecycle-native-services.js +147 -0
  137. package/dist/src/platforms/lifecycle-native-services.js.map +1 -0
  138. package/dist/src/platforms/lifecycle-native.d.ts +9 -0
  139. package/dist/src/platforms/lifecycle-native.js +252 -0
  140. package/dist/src/platforms/lifecycle-native.js.map +1 -0
  141. package/dist/src/platforms/lifecycle.d.ts +25 -0
  142. package/dist/src/platforms/lifecycle.js +452 -0
  143. package/dist/src/platforms/lifecycle.js.map +1 -0
  144. package/dist/src/platforms/managed-command-placement.d.ts +8 -0
  145. package/dist/src/platforms/managed-command-placement.js +79 -0
  146. package/dist/src/platforms/managed-command-placement.js.map +1 -0
  147. package/dist/src/platforms/projection-code-extension.d.ts +8 -0
  148. package/dist/src/platforms/projection-code-extension.js +121 -0
  149. package/dist/src/platforms/projection-code-extension.js.map +1 -0
  150. package/dist/src/platforms/projection-command-resources.d.ts +7 -0
  151. package/dist/src/platforms/projection-command-resources.js +74 -0
  152. package/dist/src/platforms/projection-command-resources.js.map +1 -0
  153. package/dist/src/platforms/projection-files.d.ts +27 -0
  154. package/dist/src/platforms/projection-files.js +111 -0
  155. package/dist/src/platforms/projection-files.js.map +1 -0
  156. package/dist/src/platforms/projection-marketplace.d.ts +19 -0
  157. package/dist/src/platforms/projection-marketplace.js +42 -0
  158. package/dist/src/platforms/projection-marketplace.js.map +1 -0
  159. package/dist/src/platforms/projection.d.ts +10 -0
  160. package/dist/src/platforms/projection.js +446 -0
  161. package/dist/src/platforms/projection.js.map +1 -0
  162. package/dist/src/platforms/registry.d.ts +4 -0
  163. package/dist/src/platforms/registry.js +30 -0
  164. package/dist/src/platforms/registry.js.map +1 -0
  165. package/dist/src/platforms/supplement-layout.d.ts +16 -0
  166. package/dist/src/platforms/supplement-layout.js +31 -0
  167. package/dist/src/platforms/supplement-layout.js.map +1 -0
  168. package/dist/src/portable/commands.d.ts +7 -5
  169. package/dist/src/portable/commands.js +6 -1
  170. package/dist/src/portable/commands.js.map +1 -1
  171. package/dist/src/portable/materializer.d.ts +8 -6
  172. package/dist/src/portable/materializer.js +47 -245
  173. package/dist/src/portable/materializer.js.map +1 -1
  174. package/dist/src/portable/recovery-layout.js +2 -15
  175. package/dist/src/portable/recovery-layout.js.map +1 -1
  176. package/dist/src/portable/recovery.d.ts +10 -1
  177. package/dist/src/portable/recovery.js +34 -8
  178. package/dist/src/portable/recovery.js.map +1 -1
  179. package/dist/src/recovery/coordinator.d.ts +9 -8
  180. package/dist/src/recovery/coordinator.js +153 -120
  181. package/dist/src/recovery/coordinator.js.map +1 -1
  182. package/dist/src/recovery/demand.d.ts +1 -1
  183. package/dist/src/recovery/demand.js +10 -42
  184. package/dist/src/recovery/demand.js.map +1 -1
  185. package/dist/src/recovery/joint-coordinator.d.ts +1 -0
  186. package/dist/src/recovery/joint-coordinator.js +278 -84
  187. package/dist/src/recovery/joint-coordinator.js.map +1 -1
  188. package/dist/src/recovery/joint-demand.d.ts +4 -22
  189. package/dist/src/recovery/joint-demand.js +43 -40
  190. package/dist/src/recovery/joint-demand.js.map +1 -1
  191. package/dist/src/recovery/receipt.d.ts +23 -8
  192. package/dist/src/recovery/retirement.d.ts +1 -1
  193. package/dist/src/recovery/retirement.js +122 -29
  194. package/dist/src/recovery/retirement.js.map +1 -1
  195. package/dist/src/recovery/status.d.ts +15 -7
  196. package/dist/src/recovery/status.js +481 -81
  197. package/dist/src/recovery/status.js.map +1 -1
  198. package/dist/src/recovery/types.d.ts +3 -3
  199. package/dist/src/review/platform-profile.d.ts +3 -0
  200. package/dist/src/review/platform-profile.js +16 -0
  201. package/dist/src/review/platform-profile.js.map +1 -0
  202. package/dist/src/review/review-profile.d.ts +1 -0
  203. package/dist/src/review/review-profile.js +8 -2
  204. package/dist/src/review/review-profile.js.map +1 -1
  205. package/dist/src/review/review-selection.d.ts +2 -11
  206. package/dist/src/review/review-selection.js +97 -71
  207. package/dist/src/review/review-selection.js.map +1 -1
  208. package/dist/src/review/review-types.d.ts +3 -0
  209. package/dist/src/review/review-types.js.map +1 -1
  210. package/dist/src/review/skill-materialization.d.ts +44 -9
  211. package/dist/src/review/skill-materialization.js +112 -136
  212. package/dist/src/review/skill-materialization.js.map +1 -1
  213. package/dist/src/review/source-binding.d.ts +8 -5
  214. package/dist/src/review/source-binding.js +99 -41
  215. package/dist/src/review/source-binding.js.map +1 -1
  216. package/dist/src/tui/agent-management.js +112 -10
  217. package/dist/src/tui/agent-management.js.map +1 -1
  218. package/dist/src/tui/agent-settings.d.ts +3 -0
  219. package/dist/src/tui/agent-settings.js +10 -11
  220. package/dist/src/tui/agent-settings.js.map +1 -1
  221. package/dist/src/tui/console-app-v4.js +85 -20
  222. package/dist/src/tui/console-app-v4.js.map +1 -1
  223. package/dist/src/tui/content-item-card.js +2 -2
  224. package/dist/src/tui/content-item-card.js.map +1 -1
  225. package/dist/src/tui/controller-runtime.js +199 -152
  226. package/dist/src/tui/controller-runtime.js.map +1 -1
  227. package/dist/src/tui/controller.d.ts +6 -9
  228. package/dist/src/tui/controller.js +40 -18
  229. package/dist/src/tui/controller.js.map +1 -1
  230. package/dist/src/tui/deployment-view.d.ts +10 -0
  231. package/dist/src/tui/deployment-view.js +91 -0
  232. package/dist/src/tui/deployment-view.js.map +1 -0
  233. package/dist/src/tui/glossary.js +4 -4
  234. package/dist/src/tui/glossary.js.map +1 -1
  235. package/dist/src/tui/model.d.ts +5 -0
  236. package/dist/src/tui/model.js +73 -12
  237. package/dist/src/tui/model.js.map +1 -1
  238. package/dist/src/tui/operation-diagnostic-screens.js +2 -1
  239. package/dist/src/tui/operation-diagnostic-screens.js.map +1 -1
  240. package/dist/src/tui/operation-history.d.ts +5 -4
  241. package/dist/src/tui/operation-history.js.map +1 -1
  242. package/dist/src/tui/operation-review-planner.d.ts +7 -2
  243. package/dist/src/tui/operation-review-planner.js +97 -42
  244. package/dist/src/tui/operation-review-planner.js.map +1 -1
  245. package/dist/src/tui/plugin-content.d.ts +5 -3
  246. package/dist/src/tui/plugin-content.js +70 -508
  247. package/dist/src/tui/plugin-content.js.map +1 -1
  248. package/dist/src/tui/plugin-detail.d.ts +3 -2
  249. package/dist/src/tui/plugin-detail.js +33 -25
  250. package/dist/src/tui/plugin-detail.js.map +1 -1
  251. package/dist/src/tui/scoped-inventory.d.ts +10 -6
  252. package/dist/src/tui/scoped-inventory.js +34 -1
  253. package/dist/src/tui/scoped-inventory.js.map +1 -1
  254. package/dist/src/types.d.ts +4 -63
  255. package/dist/src/types.js.map +1 -1
  256. package/dist/src/utils/agent-version.d.ts +10 -4
  257. package/dist/src/utils/agent-version.js.map +1 -1
  258. package/dist/src/utils/artifact-plan.d.ts +26 -2
  259. package/dist/src/utils/artifact-plan.js +113 -489
  260. package/dist/src/utils/artifact-plan.js.map +1 -1
  261. package/dist/src/utils/artifact-renderer.d.ts +100 -93
  262. package/dist/src/utils/artifact-renderer.js +173 -346
  263. package/dist/src/utils/artifact-renderer.js.map +1 -1
  264. package/dist/src/utils/artifact-request.d.ts +21 -11
  265. package/dist/src/utils/artifact-request.js +56 -80
  266. package/dist/src/utils/artifact-request.js.map +1 -1
  267. package/dist/src/utils/bundle-layout.js +30 -146
  268. package/dist/src/utils/bundle-layout.js.map +1 -1
  269. package/dist/src/utils/catalog-digests.d.ts +2 -12
  270. package/dist/src/utils/catalog-digests.js +0 -39
  271. package/dist/src/utils/catalog-digests.js.map +1 -1
  272. package/dist/src/utils/catalog-source-references.d.ts +7 -0
  273. package/dist/src/utils/catalog-source-references.js +234 -19
  274. package/dist/src/utils/catalog-source-references.js.map +1 -1
  275. package/dist/src/utils/codex-config-observation.d.ts +19 -0
  276. package/dist/src/utils/codex-config-observation.js +145 -0
  277. package/dist/src/utils/codex-config-observation.js.map +1 -0
  278. package/dist/src/utils/codex-executable-discovery.d.ts +2 -0
  279. package/dist/src/utils/codex-executable-discovery.js +47 -13
  280. package/dist/src/utils/codex-executable-discovery.js.map +1 -1
  281. package/dist/src/utils/codex-manager.js +1 -1
  282. package/dist/src/utils/codex-manager.js.map +1 -1
  283. package/dist/src/utils/codex-native-observation.d.ts +3 -0
  284. package/dist/src/utils/codex-native-observation.js +53 -0
  285. package/dist/src/utils/codex-native-observation.js.map +1 -1
  286. package/dist/src/utils/codex-shared-native.d.ts +3 -1
  287. package/dist/src/utils/codex-shared-native.js +46 -5
  288. package/dist/src/utils/codex-shared-native.js.map +1 -1
  289. package/dist/src/utils/codex-skill-staging.d.ts +4 -3
  290. package/dist/src/utils/codex-skill-staging.js.map +1 -1
  291. package/dist/src/utils/codex-surface-analysis.d.ts +5 -2
  292. package/dist/src/utils/codex-surface-analysis.js +28 -57
  293. package/dist/src/utils/codex-surface-analysis.js.map +1 -1
  294. package/dist/src/utils/component-command-preparation.d.ts +34 -0
  295. package/dist/src/utils/component-command-preparation.js +228 -0
  296. package/dist/src/utils/component-command-preparation.js.map +1 -0
  297. package/dist/src/utils/component-resources.d.ts +43 -0
  298. package/dist/src/utils/component-resources.js +304 -0
  299. package/dist/src/utils/component-resources.js.map +1 -0
  300. package/dist/src/utils/dynamic-skill-tree.d.ts +17 -6
  301. package/dist/src/utils/dynamic-skill-tree.js +7 -3
  302. package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
  303. package/dist/src/utils/local-marketplace.d.ts +11 -44
  304. package/dist/src/utils/local-marketplace.js +11 -638
  305. package/dist/src/utils/local-marketplace.js.map +1 -1
  306. package/dist/src/utils/managed-command-evidence.d.ts +2 -2
  307. package/dist/src/utils/managed-command-evidence.js +5 -81
  308. package/dist/src/utils/managed-command-evidence.js.map +1 -1
  309. package/dist/src/utils/managed-command-materialization.d.ts +5 -2
  310. package/dist/src/utils/managed-command-materialization.js +35 -35
  311. package/dist/src/utils/managed-command-materialization.js.map +1 -1
  312. package/dist/src/utils/managed-command-preparation.d.ts +67 -0
  313. package/dist/src/utils/managed-command-preparation.js +146 -0
  314. package/dist/src/utils/managed-command-preparation.js.map +1 -0
  315. package/dist/src/utils/managed-command-review.d.ts +26 -0
  316. package/dist/src/utils/managed-command-review.js +68 -0
  317. package/dist/src/utils/managed-command-review.js.map +1 -0
  318. package/dist/src/utils/managed-command-store.js +26 -15
  319. package/dist/src/utils/managed-command-store.js.map +1 -1
  320. package/dist/src/utils/native-cli.d.ts +19 -0
  321. package/dist/src/utils/native-cli.js +45 -2
  322. package/dist/src/utils/native-cli.js.map +1 -1
  323. package/dist/src/utils/native-demand.d.ts +20 -1
  324. package/dist/src/utils/native-demand.js.map +1 -1
  325. package/dist/src/utils/native-tool-review.d.ts +3 -6
  326. package/dist/src/utils/native-tool-review.js +25 -11
  327. package/dist/src/utils/native-tool-review.js.map +1 -1
  328. package/dist/src/utils/ownership.d.ts +26 -3
  329. package/dist/src/utils/ownership.js +95 -9
  330. package/dist/src/utils/ownership.js.map +1 -1
  331. package/dist/src/utils/paths.d.ts +1 -1
  332. package/dist/src/utils/paths.js +2 -0
  333. package/dist/src/utils/paths.js.map +1 -1
  334. package/dist/src/utils/platform-empty-state.d.ts +46 -0
  335. package/dist/src/utils/platform-empty-state.js +123 -0
  336. package/dist/src/utils/platform-empty-state.js.map +1 -0
  337. package/dist/src/utils/plugin-config-impact.d.ts +17 -11
  338. package/dist/src/utils/plugin-config-impact.js +46 -62
  339. package/dist/src/utils/plugin-config-impact.js.map +1 -1
  340. package/dist/src/utils/plugin-config-write.js +52 -53
  341. package/dist/src/utils/plugin-config-write.js.map +1 -1
  342. package/dist/src/utils/plugin-config.d.ts +0 -2
  343. package/dist/src/utils/plugin-config.js +0 -6
  344. package/dist/src/utils/plugin-config.js.map +1 -1
  345. package/dist/src/utils/plugin-dependencies.d.ts +1 -1
  346. package/dist/src/utils/plugin-dependencies.js.map +1 -1
  347. package/dist/src/utils/runtime-config.d.ts +5 -7
  348. package/dist/src/utils/runtime-config.js +12 -25
  349. package/dist/src/utils/runtime-config.js.map +1 -1
  350. package/dist/src/utils/windows-npm-shim.js +19 -2
  351. package/dist/src/utils/windows-npm-shim.js.map +1 -1
  352. package/package.json +3 -3
  353. package/dist/src/utils/claude-native-render-receipt.d.ts +0 -14
  354. package/dist/src/utils/claude-native-render-receipt.js +0 -26
  355. package/dist/src/utils/claude-native-render-receipt.js.map +0 -1
  356. package/dist/src/utils/claude-skills-root.d.ts +0 -8
  357. package/dist/src/utils/claude-skills-root.js +0 -87
  358. package/dist/src/utils/claude-skills-root.js.map +0 -1
  359. package/dist/src/utils/codex-native-render-receipt.d.ts +0 -40
  360. package/dist/src/utils/codex-native-render-receipt.js +0 -205
  361. package/dist/src/utils/codex-native-render-receipt.js.map +0 -1
  362. package/dist/src/utils/slash-commands.d.ts +0 -1
  363. package/dist/src/utils/slash-commands.js +0 -2
  364. package/dist/src/utils/slash-commands.js.map +0 -1
@@ -1,15 +1,283 @@
1
+ import path from 'node:path';
2
+ import { isPlatformTarget, normalizeStaticPluginComponents } from '@lesliechan721/aw-plugin-core/manifest';
1
3
  import { selectAgents } from '../intent/deployment-preferences.js';
2
4
  import { createScopeContext } from '../intent/scope-context.js';
3
5
  import { parsePluginId } from '../utils/multi-source-catalog.js';
4
- import { statusCommandV8, flattenStatusTargets, statusTargetHasLiveConfigConsumer } from '../commands/status-v6.js';
5
6
  import { inspectPortableExtraInstalled, inspectPortableRecovery, portablePreparationDiagnostic } from '../portable/recovery.js';
6
- import { readJointDemand, deriveJointDemand, findPlacementConflicts } from './joint-demand.js';
7
+ import { readJointDemand, deriveJointDemand } from './joint-demand.js';
7
8
  import { readDemand, resolveDelivery } from './demand.js';
9
+ import { runNativeCli } from '../utils/native-cli.js';
10
+ import { rethrowFatalError } from '../utils/codex-executable-discovery.js';
11
+ import { createCodexNativeObservationSession } from '../utils/codex-native-observation.js';
8
12
  import { analyzeCodexSurface } from '../utils/codex-surface-analysis.js';
13
+ import { getAgentPluginAdapter } from '../platforms/registry.js';
14
+ import { getQualifiedPlatformProfile } from '../platforms/capabilities.js';
15
+ import { resolveArtifactRenderConfig } from '../utils/artifact-renderer.js';
16
+ import { createPlatformInputEvidence, matchesPlatformEmptyState, platformPackageInputDigest, readPlatformPackageContentDigest } from '../utils/platform-empty-state.js';
17
+ import { getDeploymentLayout } from '../platforms/layout.js';
18
+ import { deploymentPackageComponent, inspectStaticSupplements } from '../platforms/inspection.js';
19
+ import { readSkillOwnerMarker } from '../utils/ownership.js';
20
+ import { inventoryCatalogSourceReferences } from '../utils/catalog-source-references.js';
21
+ import { resolvePartialCatalogOperationContext } from '../utils/catalog-operation-context.js';
22
+ import { checkAwCapabilitySupport, readPluginManifest } from '../utils/manifest.js';
23
+ import { IMPLEMENTED_AW_CAPABILITIES } from '../commands/aw-capabilities.js';
24
+ import { resolvePluginMetaDependencyClosure } from '../utils/plugin-dependencies.js';
25
+ import { installationInvocation } from '../platforms/discovery.js';
26
+ import { DEFAULT_AGENT_VERSION_PROBE_TIMEOUT_MS } from '../constants.js';
9
27
  const NATIVE_READ_ERRORS = new Set(['nativeStateUnreadable', 'stateInventoryFailed', 'configReadFailed',
10
28
  'configInvalid', 'componentInspectionFailed', 'targetInspectionFailed', 'codexNativeObservationFailed',
11
29
  'nativeObservationFailed', 'nativeObservationUnavailable']);
12
30
  function diagnostic(code) { return { code, message: `目标尚未满足:${code}。` }; }
31
+ async function readAdapterObservations(options, context, demand) {
32
+ const observations = [];
33
+ const existing = [];
34
+ const owned = [];
35
+ let selected;
36
+ try {
37
+ selected = selectAgents({ preferences: demand.preferences, targets: options.targets }).agents
38
+ .filter((agent) => agent !== 'generic');
39
+ }
40
+ catch {
41
+ return { observations, existing, owned };
42
+ }
43
+ const ctx = { cwd: context.executionCwd, env: context.env, signal: options.signal, runner: options.nativeCliRunner,
44
+ codexObservationSession: options.codexObservationSession, observeNative: options.observeNative };
45
+ for (const platform of selected) {
46
+ options.signal?.throwIfAborted();
47
+ const roots = (demand.roots ?? []).filter((root) => root.plugin
48
+ && resolveDelivery(root.plugin.manifest, platform, demand.scope)?.kind === 'native'
49
+ && (!demand.targetRequirements || demand.targetRequirements.some((item) => item.pluginId === root.pluginId && item.target === platform)));
50
+ if (!roots.length)
51
+ continue;
52
+ const adapter = getAgentPluginAdapter(platform);
53
+ let ownedSession;
54
+ try {
55
+ const discovery = await adapter.discover(ctx);
56
+ if (platform === 'codex') {
57
+ const product = discovery.installations.find((item) => item.availability === 'available' && item.entry?.kind === 'cli');
58
+ if (product) {
59
+ const invocation = await installationInvocation(product, ctx, []);
60
+ const manager = { kind: product.product === 'app' ? 'app' : 'system', version: product.version ?? 'unknown',
61
+ command: invocation.command, argsPrefix: invocation.args };
62
+ if (ctx.codexObservationSession)
63
+ ctx.codexObservationSession.setManager(manager);
64
+ else {
65
+ ownedSession = await createCodexNativeObservationSession({ exactCwd: context.executionCwd, env: context.env, manager,
66
+ runner: async (request) => {
67
+ const result = await runNativeCli({ ...request, signal: options.signal, timeoutMs: DEFAULT_AGENT_VERSION_PROBE_TIMEOUT_MS }, options.nativeCliRunner);
68
+ if (Buffer.byteLength(result.stdout) + Buffer.byteLength(result.stderr) > 1024 * 1024)
69
+ throw new Error('nativeObservationOutputLimit');
70
+ return result;
71
+ } });
72
+ ctx.codexObservationSession = ownedSession;
73
+ }
74
+ }
75
+ }
76
+ for (const root of roots) {
77
+ options.signal?.throwIfAborted();
78
+ const observation = { pluginId: root.pluginId, expectedVersion: root.plugin?.manifest.version, platform, content: 'unknown', blockers: [], deploymentObservations: [] };
79
+ observations.push(observation);
80
+ try {
81
+ const plugin = root.plugin;
82
+ const resolution = await adapter.resolve(ctx, { plugin: {
83
+ sourceId: plugin.sourceId ?? root.sourceId, sourceIdentity: plugin.sourceIdentity,
84
+ pluginId: root.pluginId, version: plugin.manifest.version,
85
+ }, scope: demand.scope === 'project' ? { kind: 'project', projectRoot: context.projectRoot } : { kind: 'user' },
86
+ operation: 'ensure', discovery, recoveryCandidates: [] });
87
+ observation.deploymentExclusions = resolution.exclusions.flatMap((entry) => entry.productId ? [{
88
+ platform, pluginId: root.pluginId,
89
+ scope: demand.scope === 'project' ? { kind: 'project', projectRoot: context.projectRoot } : { kind: 'user' },
90
+ productId: entry.productId, product: discovery.installations.find((product) => product.id === entry.productId) ?? null,
91
+ reasonCode: entry.reasonCode, execution: 'not-run',
92
+ recoveryActions: ['aw target list', `aw plugin sync ${root.pluginId} --context ${demand.scope} --target ${platform}`],
93
+ }] : []);
94
+ observation.blockers.push(...resolution.exclusions.map((entry) => diagnostic(entry.reasonCode)), ...resolution.diagnostics.map((entry) => ({ code: entry.code, message: entry.message })));
95
+ if (!resolution.bindings.length) {
96
+ observation.blockers.push(...discovery.diagnostics.map((entry) => ({ code: entry.code, message: entry.message })));
97
+ if (!observation.blockers.length)
98
+ observation.blockers.push(diagnostic(discovery.availability === 'missing' ? 'client-missing' : 'nativeObservationUnavailable'));
99
+ continue;
100
+ }
101
+ const states = [];
102
+ const emptyMatches = [];
103
+ const currentMatches = [];
104
+ const versions = [];
105
+ for (const binding of resolution.bindings) {
106
+ const live = await adapter.inspect(ctx, binding);
107
+ versions.push(live.packageVersion);
108
+ options.signal?.throwIfAborted();
109
+ observation.deploymentObservations.push({ bindingId: binding.id, products: binding.consumers, after: live });
110
+ observation.blockers.push(...live.diagnostics.map((entry) => ({ code: entry.code, message: entry.message })));
111
+ const shared = ['codex-marketplace', 'claude-marketplace', 'gemini-extension', 'copilot-marketplace'].includes(binding.route);
112
+ const scopedNativeConsumer = shared ? live.registration === 'present'
113
+ && live.consumers.some((consumer) => consumer.activation === 'enabled')
114
+ : live.package === 'present' && live.ownership === 'aw';
115
+ if (scopedNativeConsumer && (live.ownership === 'aw' || live.ownership === 'shared')) {
116
+ owned.push({ pluginId: root.pluginId, agent: platform, scope: demand.scope });
117
+ existing.push({ pluginId: root.pluginId, agent: platform, scope: demand.scope });
118
+ }
119
+ const unmet = [];
120
+ const staticComponents = [];
121
+ const staticSupplements = [];
122
+ const inputUnits = [];
123
+ const profile = getQualifiedPlatformProfile(platform);
124
+ let expectedCount = 0;
125
+ let packageExpectedCount = 0;
126
+ for (const unit of resolution.renderUnits.filter((unit) => binding.renderUnitIds.includes(unit.id))) {
127
+ const capabilities = adapter.capabilities({ binding, renderUnit: unit, observation: live,
128
+ profile });
129
+ const expected = await normalizeStaticPluginComponents({ pluginRoot: plugin.rootDir,
130
+ manifest: plugin.manifest, platform, capabilities, allowedOutputKinds: unit.kinds });
131
+ expectedCount += expected.components.length;
132
+ staticComponents.push(...expected.components);
133
+ if (unit.output === 'supplement')
134
+ staticSupplements.push(...expected.components);
135
+ else
136
+ packageExpectedCount += expected.components.length;
137
+ unmet.push(...expected.unmet);
138
+ inputUnits.push({ renderUnit: unit, capabilities, prerequisites: live.prerequisites,
139
+ config: await resolveArtifactRenderConfig({ pluginName: plugin.manifest.name, sourceId: binding.plugin.sourceId,
140
+ sourceIdentity: binding.plugin.sourceIdentity, logicalIdentity: plugin.catalogLogicalIdentity,
141
+ manifest: plugin.manifest, platform, scope: unit.renderScope.kind,
142
+ cwd: unit.renderScope.kind === 'project' ? unit.renderScope.projectRoot : context.executionCwd,
143
+ env: context.env, referencePlugins: demand.plugins }) });
144
+ }
145
+ const supplements = await inspectStaticSupplements(ctx, binding, staticSupplements);
146
+ const supplementConflict = supplements.components.some((component) => component.reasonCodes.includes('supplementOwnershipConflict'));
147
+ const supplementDrift = supplements.components.some((component) => component.presence === 'absent'
148
+ || component.reasonCodes.includes('componentContentDrift'));
149
+ const supplementUnknown = supplements.components.some((component) => component.presence === 'unknown');
150
+ if (supplementConflict)
151
+ observation.blockers.push(diagnostic('supplementOwnershipConflict'));
152
+ else if (supplementDrift)
153
+ observation.blockers.push(diagnostic('platformContentDrift'));
154
+ else if (supplementUnknown)
155
+ observation.blockers.push(diagnostic('componentOutputUnconfirmed'));
156
+ if (supplements.owned && !existing.some((target) => target.pluginId === root.pluginId && target.agent === platform && target.scope === demand.scope)) {
157
+ owned.push({ pluginId: root.pluginId, agent: platform, scope: demand.scope });
158
+ existing.push({ pluginId: root.pluginId, agent: platform, scope: demand.scope });
159
+ }
160
+ const inputEvidence = await createPlatformInputEvidence({ plugin, binding, units: inputUnits });
161
+ const confirmedEmpty = Boolean(plugin.manifest.artifacts && expectedCount === 0 && unmet.length === 0
162
+ && await matchesPlatformEmptyState({ state: { ...inputEvidence, kind: 'aw-platform-empty-state', result: 'intentional-empty' }, env: context.env }));
163
+ const dynamicSupplementsUnconfirmed = Boolean(plugin.manifest.artifacts && !confirmedEmpty
164
+ && inputUnits.some(({ renderUnit }) => renderUnit.output === 'supplement'
165
+ && (!plugin.manifest.artifacts?.scopes || plugin.manifest.artifacts.scopes.includes(renderUnit.renderScope.kind))));
166
+ let inputDrift = false;
167
+ let currentProjection = false;
168
+ let projectionUnconfirmed = false;
169
+ let nativeContentDrift = false;
170
+ let nativeContentUnconfirmed = false;
171
+ if (live.package === 'present' && live.ownership === 'aw') {
172
+ const layout = await getDeploymentLayout(ctx, binding);
173
+ const marker = await readSkillOwnerMarker({ skillRoot: layout.packageRoot, allowedRoot: path.dirname(layout.packageRoot),
174
+ expectedIdentity: deploymentPackageComponent(binding, layout).identity });
175
+ const projection = marker?.nativeProjection;
176
+ const contentDigest = projection ? await readPlatformPackageContentDigest(layout.packageRoot) : undefined;
177
+ if (['grok-cli', 'gemini-extension', 'antigravity-cli'].includes(binding.route) && live.registration === 'present') {
178
+ nativeContentUnconfirmed = !contentDigest || !live.nativePackageContentDigest;
179
+ nativeContentDrift = Boolean(contentDigest && live.nativePackageContentDigest
180
+ && contentDigest !== live.nativePackageContentDigest);
181
+ if (nativeContentUnconfirmed)
182
+ observation.blockers.push(diagnostic('nativePackageContentUnconfirmed'));
183
+ else if (nativeContentDrift)
184
+ observation.blockers.push(diagnostic('nativePackageContentDrift'));
185
+ }
186
+ projectionUnconfirmed = !projection || projection.preparation !== 'complete';
187
+ const packageInputDigest = platformPackageInputDigest(inputEvidence);
188
+ inputDrift = Boolean(projection && (projection.inputDigest !== packageInputDigest
189
+ || projection.contentDigest !== contentDigest));
190
+ if (projectionUnconfirmed)
191
+ observation.blockers.push(diagnostic(projection?.preparation === 'partial'
192
+ ? 'platformPreparationPartial' : 'platformExpectationUnconfirmed'));
193
+ else if (inputDrift)
194
+ observation.blockers.push(diagnostic(projection.inputDigest !== packageInputDigest
195
+ ? 'platformInputDrift' : 'platformContentDrift'));
196
+ currentProjection = Boolean(projection && !inputDrift && projection.preparation === 'complete'
197
+ && projection.components.length > 0 && projection.components.every((component) => live.components.some((observed) => observed.id === component.id && observed.presence === 'present'))
198
+ && !supplementConflict && !supplementDrift && !supplementUnknown && !dynamicSupplementsUnconfirmed
199
+ && !nativeContentDrift && !nativeContentUnconfirmed);
200
+ if (currentProjection)
201
+ expectedCount = Math.max(expectedCount, projection.components.length);
202
+ }
203
+ // Codex CLI 0.167.0 loads user plugin Skills without the independent
204
+ // Hook/project trust gate. This is component applicability, not trust
205
+ // inferred from activation, and requires complete current evidence.
206
+ if (binding.route === 'codex-marketplace' && binding.scope.kind === 'user'
207
+ && !plugin.manifest.artifacts && staticComponents.length > 0
208
+ && staticComponents.every((component) => component.kind === 'skill')
209
+ && unmet.length === 0 && staticSupplements.length === 0 && currentProjection
210
+ && live.registration === 'present' && profile.kinds.skill.status === 'supported'
211
+ && binding.consumers.length > 0 && live.consumers.length === binding.consumers.length
212
+ && binding.consumers.every((product) => product.product === 'cli' && product.availability === 'available'
213
+ && product.version === '0.167.0' && profile.qualifiedConsumers?.skill?.some((qualified) => qualified.product === product.product && qualified.version === product.version)
214
+ && live.consumers.filter((consumer) => consumer.productId === product.id
215
+ && consumer.activation === 'enabled' && ['unknown', 'trusted', 'not-applicable'].includes(consumer.trust)).length === 1)) {
216
+ for (const consumer of live.consumers)
217
+ if (consumer.trust === 'unknown')
218
+ consumer.trust = 'not-applicable';
219
+ }
220
+ live.components.push(...supplements.components);
221
+ observation.inputDrift ||= inputDrift || supplementDrift || nativeContentDrift;
222
+ currentMatches.push(confirmedEmpty || currentProjection);
223
+ emptyMatches.push(confirmedEmpty);
224
+ observation.blockers.push(...unmet.map((entry) => diagnostic(entry.reasonCode)));
225
+ const requiresComponents = expectedCount > 0 || unmet.length > 0 || Boolean(plugin.manifest.artifacts);
226
+ if (!confirmedEmpty && requiresComponents && live.consumers.some((consumer) => consumer.trust === 'required' || consumer.trust === 'blocked')
227
+ && !observation.blockers.some((entry) => entry.code === 'nativeTrustRequired')) {
228
+ observation.blockers.push(diagnostic('nativeTrustRequired'));
229
+ }
230
+ const supplementOnly = !plugin.manifest.artifacts && staticSupplements.length > 0 && packageExpectedCount === 0;
231
+ const absent = !supplementOnly && live.package === 'absent' && ['absent', 'not-applicable'].includes(live.registration);
232
+ const unknown = !supplementOnly && (live.package === 'unknown' || live.registration === 'unknown'
233
+ || live.consumers.some((consumer) => consumer.activation === 'unknown' || consumer.trust === 'unknown'));
234
+ const inactive = !supplementOnly && (live.registration === 'absent' || live.consumers.some((consumer) => consumer.activation === 'disabled' || consumer.activation === 'blocked'
235
+ || consumer.trust === 'blocked' || consumer.trust === 'required'));
236
+ if (confirmedEmpty) {
237
+ const inactiveScope = live.consumers.every((consumer) => ['disabled', 'not-applicable'].includes(consumer.activation));
238
+ states.push(live.ownership === 'foreign' ? 'conflict' : live.package === 'unknown' || live.registration === 'unknown'
239
+ || live.diagnostics.length || !inactiveScope ? 'unknown'
240
+ : live.package === 'absent' || shared ? 'satisfied' : 'drifted');
241
+ }
242
+ else
243
+ states.push(live.ownership === 'foreign' || supplementConflict ? 'conflict' : projectionUnconfirmed || supplementUnknown || nativeContentUnconfirmed ? 'unknown' : inputDrift || supplementDrift || nativeContentDrift ? 'drifted' : unmet.length || dynamicSupplementsUnconfirmed ? 'unknown'
244
+ : !expectedCount ? absent ? 'satisfied' : unknown ? 'unknown' : 'drifted'
245
+ : absent ? 'absent' : unknown ? 'unknown' : inactive ? 'drifted' : supplementOnly || live.package === 'present' ? 'satisfied' : 'unknown');
246
+ }
247
+ observation.intentionalEmpty = emptyMatches.length === resolution.bindings.length && emptyMatches.every(Boolean);
248
+ observation.expectationConfirmed = currentMatches.length === resolution.bindings.length && currentMatches.every(Boolean);
249
+ if (versions.length && versions[0] && versions.every((version) => version === versions[0]))
250
+ observation.installedVersion = versions[0];
251
+ observation.content = ['conflict', 'drifted', 'absent', 'unknown']
252
+ .find((state) => states.includes(state)) ?? 'satisfied';
253
+ }
254
+ catch (error) {
255
+ rethrowFatalError(error);
256
+ options.signal?.throwIfAborted();
257
+ observation.content = 'unknown';
258
+ observation.blockers.push(diagnostic('nativeObservationFailed'));
259
+ }
260
+ }
261
+ }
262
+ catch (error) {
263
+ rethrowFatalError(error);
264
+ options.signal?.throwIfAborted();
265
+ for (const root of roots)
266
+ observations.push({ pluginId: root.pluginId, platform, content: 'unknown', blockers: [diagnostic('nativeObservationFailed')] });
267
+ }
268
+ finally {
269
+ if (ownedSession) {
270
+ try {
271
+ await ownedSession.dispose();
272
+ }
273
+ finally {
274
+ ctx.codexObservationSession = undefined;
275
+ }
276
+ }
277
+ }
278
+ }
279
+ return { observations, existing, owned };
280
+ }
13
281
  function safeNativePlacement(target) {
14
282
  const component = ({ kind, key, state, metadata }) => ({
15
283
  kind, key, state,
@@ -47,6 +315,21 @@ export async function statusFromObservations(options) {
47
315
  for (const root of demand.roots ?? []) {
48
316
  options.signal?.throwIfAborted();
49
317
  const blockers = root.blockers.map(diagnostic);
318
+ if (root.plugin) {
319
+ try {
320
+ const closure = root.plugin.manifest.dependencies?.length
321
+ ? resolvePluginMetaDependencyClosure(demand.plugins.filter((plugin) => plugin.sourceId === root.sourceId), [root.plugin.manifest.name])
322
+ : [root.plugin];
323
+ for (const plugin of closure) {
324
+ const support = checkAwCapabilitySupport(plugin.manifest.requires?.aw.capabilities ?? [], IMPLEMENTED_AW_CAPABILITIES);
325
+ if (!support.supported)
326
+ blockers.push({ ...diagnostic('awCapabilityUnsupported'), pluginId: plugin.pluginId });
327
+ }
328
+ }
329
+ catch {
330
+ blockers.push(diagnostic('dependencyContractInvalid'));
331
+ }
332
+ }
50
333
  if (!selection.agents.length)
51
334
  blockers.push(diagnostic('localTargetsRequired'));
52
335
  const targetResults = [];
@@ -57,7 +340,8 @@ export async function statusFromObservations(options) {
57
340
  const delivery = root.plugin ? resolveDelivery(root.plugin.manifest, agent, options.scope) ?? null : null;
58
341
  const target = { pluginId: root.pluginId, agent, scope: options.scope, delivery,
59
342
  execution: 'not-run', observation: 'unknown', content: 'unknown', blockers: [...blockers],
60
- requiredBy: [root.pluginId], relation: 'root' };
343
+ requiredBy: [root.pluginId], relation: 'root',
344
+ ...(root.plugin?.manifest.version ? { expectedVersion: root.plugin.manifest.version } : {}) };
61
345
  if (blockers.length) {
62
346
  targetResults.push(target);
63
347
  continue;
@@ -69,6 +353,12 @@ export async function statusFromObservations(options) {
69
353
  && entry.platform === delivery.platform);
70
354
  if (native) {
71
355
  target.content = native.content;
356
+ if (native.installedVersion)
357
+ target.installedVersion = native.installedVersion;
358
+ if (native.deploymentObservations)
359
+ target.deploymentObservations = native.deploymentObservations;
360
+ if (native.deploymentExclusions)
361
+ target.deploymentExclusions = native.deploymentExclusions;
72
362
  target.blockers.push(...native.blockers);
73
363
  errors.push(...native.blockers.filter((entry) => NATIVE_READ_ERRORS.has(entry.code))
74
364
  .map((entry) => ({ ...entry, pluginId: root.pluginId })));
@@ -88,16 +378,24 @@ export async function statusFromObservations(options) {
88
378
  excludedPluginIds: demand.userProviders?.[agent] });
89
379
  options.signal?.throwIfAborted();
90
380
  target.blockers.push(...portable.blockers.map((code) => portablePreparationDiagnostic(portable, diagnostic(code), agent)));
381
+ const gaps = (portable.unmet ?? []).filter((gap) => gap.agent === agent);
382
+ if (gaps.length) {
383
+ target.componentGaps = gaps;
384
+ if (!target.blockers.some((entry) => entry.code === 'portableComponentsUnmet'))
385
+ target.blockers.push(diagnostic('portableComponentsUnmet'));
386
+ }
91
387
  const observed = portable.targets.filter((entry) => entry.agent === agent);
92
388
  target.blockers.push(...observed.flatMap((entry) => entry.blocker ? [diagnostic(entry.blocker)] : []));
93
389
  target.content = ['conflict', 'drifted', 'absent', 'unknown']
94
390
  .find((state) => observed.some((entry) => entry.observation === state))
95
- ?? (observed.length && !portable.blockers.length ? 'satisfied' : 'unknown');
391
+ ?? (!portable.blockers.length && (observed.length || portable.intentionalEmpty && gaps.length === 0) ? 'satisfied' : 'unknown');
96
392
  if (observed.length === 0 && portable.blockers.includes('needs-preparation') && options.portableCoverage === true
97
393
  && options.portableInstalled && !options.portableInstalled.some((item) => item.pluginId === root.pluginId && item.agent === agent)) {
98
394
  target.content = 'absent';
99
395
  target.blockers = target.blockers.filter((item) => item.code !== 'needs-preparation');
100
396
  }
397
+ if (gaps.length && target.content !== 'conflict')
398
+ target.content = 'unknown';
101
399
  target.backend = observed.map((entry) => ({ skill: entry.skill, agent: entry.agent,
102
400
  ownership: entry.ownership, observation: entry.observation, associatedAgents: entry.associatedAgents }));
103
401
  if (target.blockers.some((entry) => /(?:VerificationFailed|ReadFailed|LockInvalid)/u.test(entry.code))) {
@@ -105,13 +403,19 @@ export async function statusFromObservations(options) {
105
403
  }
106
404
  }
107
405
  catch (error) {
406
+ rethrowFatalError(error);
108
407
  options.signal?.throwIfAborted();
109
- if (error instanceof Error && error.name === 'AbortError')
110
- throw error;
111
408
  target.blockers.push(diagnostic('portableObservationFailed'));
112
409
  errors.push({ ...diagnostic('portableObservationFailed'), pluginId: root.pluginId });
113
410
  }
114
411
  }
412
+ const confirmedEmpty = delivery?.kind === 'native' && options.nativeObservations.some((entry) => entry.pluginId === root.pluginId && entry.platform === delivery.platform && (entry.intentionalEmpty === true || entry.expectationConfirmed === true));
413
+ if (delivery?.kind === 'native' && root.plugin?.manifest.artifacts && !confirmedEmpty) {
414
+ const inputDrift = delivery?.kind === 'native' && options.nativeObservations.some((entry) => entry.pluginId === root.pluginId && entry.platform === delivery.platform && entry.inputDrift === true);
415
+ if (target.content !== 'conflict' && !inputDrift)
416
+ target.content = 'unknown';
417
+ target.blockers.push(diagnostic('dynamicExpectationUnconfirmed'));
418
+ }
115
419
  target.observation = target.content === 'satisfied' ? 'verified'
116
420
  : target.content === 'absent' ? 'missing' : 'unknown';
117
421
  targetResults.push(target);
@@ -147,6 +451,8 @@ export async function statusFromObservations(options) {
147
451
  || target.blockers.some((entry) => entry.code === 'deliveryUnsupported')) {
148
452
  definiteFailure = true;
149
453
  }
454
+ else if (target.blockers.some((entry) => entry.code === 'awCapabilityUnsupported'))
455
+ definiteFailure = true;
150
456
  else if (target.content === 'unknown' || target.observation === 'unknown' || target.blockers.length)
151
457
  uncertain = true;
152
458
  }
@@ -167,20 +473,57 @@ export async function readScopedRecoveryStatus(options) {
167
473
  const demand = options.demandOverride ?? await readDemand({ scope: options.scope, cwd: context.executionCwd, env: context.env,
168
474
  catalogOperationContext: options.catalogOperationContext, signal: options.signal });
169
475
  options.signal?.throwIfAborted();
170
- const nativePlugins = options.onDemand?.(demand);
171
- const native = options.nativeObservations ? undefined : await statusCommandV8({
172
- cwd: context.executionCwd, env: context.env, scope: options.scope,
173
- ...(nativePlugins ? { plugins: nativePlugins } : {}),
174
- recoveryDemand: demand, recoverySelection: { targets: options.targets }, cliVersion: options.cliVersion,
175
- catalogOperationContext: options.catalogOperationContext,
176
- nativeCliRunner: options.nativeCliRunner,
177
- codexObservationSession: options.codexObservationSession,
178
- signal: options.signal,
179
- });
476
+ options.onDemand?.(demand);
180
477
  options.signal?.throwIfAborted();
181
- if (native)
182
- await options.onNativeStatus?.(native, demand);
478
+ const ownerInventory = options.nativeObservations ? { references: [], errors: [] }
479
+ : await inventoryCatalogSourceReferences({ cwd: context.executionCwd, env: context.env, scope: options.scope });
183
480
  options.signal?.throwIfAborted();
481
+ const candidates = ownerInventory.references.filter((entry) => entry.scope === options.scope
482
+ && entry.sourceId && entry.pluginName && isPlatformTarget(entry.platform) && entry.platform !== 'generic');
483
+ const observedPlugins = new Map(demand.plugins.map((plugin) => [plugin.pluginId, plugin]));
484
+ let catalog = demand.catalogOperationContext ?? options.catalogOperationContext;
485
+ if (candidates.some((entry) => !observedPlugins.has(`${entry.sourceId}/${entry.pluginName}`))) {
486
+ try {
487
+ catalog ??= await resolvePartialCatalogOperationContext({ env: context.env, signal: options.signal });
488
+ }
489
+ catch (error) {
490
+ rethrowFatalError(error);
491
+ options.signal?.throwIfAborted();
492
+ }
493
+ for (const candidate of candidates) {
494
+ const pluginId = `${candidate.sourceId}/${candidate.pluginName}`;
495
+ if (observedPlugins.has(pluginId))
496
+ continue;
497
+ const source = catalog?.catalog.sources.find((entry) => entry.sourceId === candidate.sourceId)?.resolution;
498
+ if (!source?.manifest.entries.some((entry) => entry.name === candidate.pluginName))
499
+ continue;
500
+ try {
501
+ const plugin = await readPluginManifest(path.join(source.rootDir, 'plugins', candidate.pluginName), { mode: 'bundle' });
502
+ Object.assign(plugin, { pluginId, sourceId: candidate.sourceId, sourceIdentity: source.sourceIdentity,
503
+ catalogLogicalIdentity: source.logicalIdentity });
504
+ observedPlugins.set(pluginId, plugin);
505
+ }
506
+ catch (error) {
507
+ rethrowFatalError(error);
508
+ options.signal?.throwIfAborted();
509
+ }
510
+ }
511
+ }
512
+ let selectedAgents = [];
513
+ try {
514
+ selectedAgents = selectAgents({ preferences: demand.preferences, targets: options.targets }).agents;
515
+ }
516
+ catch { /* The status result reports invalid strong state without extending observations. */ }
517
+ const observationDemand = { ...demand, plugins: [...observedPlugins.values()],
518
+ roots: [...new Map([...(demand.roots ?? []), ...candidates.flatMap((candidate) => {
519
+ const pluginId = `${candidate.sourceId}/${candidate.pluginName}`;
520
+ const plugin = observedPlugins.get(pluginId);
521
+ return plugin ? [{ pluginId, sourceId: candidate.sourceId, plugin, sourceState: 'ready', blockers: [] }] : [];
522
+ })].map((root) => [root.pluginId, root])).values()],
523
+ targetRequirements: demand.targetRequirements ? [...demand.targetRequirements,
524
+ ...candidates.map((entry) => ({ pluginId: `${entry.sourceId}/${entry.pluginName}`, target: entry.platform }))] : undefined };
525
+ const adapters = options.nativeObservations ? { observations: [], existing: [], owned: [] }
526
+ : await readAdapterObservations({ ...options, targets: [...new Set([...selectedAgents, ...candidates.map((entry) => entry.platform)])] }, context, observationDemand);
184
527
  const roots = new Set(demand.roots?.map((root) => root.pluginId) ?? []);
185
528
  const queue = [...(demand.roots ?? []).map((root) => root.plugin).filter((plugin) => plugin !== undefined)];
186
529
  const byId = new Map(demand.plugins.map((plugin) => [plugin.pluginId, plugin]));
@@ -199,45 +542,43 @@ export async function readScopedRecoveryStatus(options) {
199
542
  const expected = (pluginId, agent) => demand.targetRequirements
200
543
  ? demand.targetRequirements.some((item) => item.pluginId === pluginId && item.target === agent)
201
544
  : roots.has(pluginId) && agent !== null && demand.preferences.state === 'valid' && demand.preferences.value.targets.includes(agent);
202
- // Native component lists can include a shared User activation marker. Only
203
- // a live scoped consumer or an actual scoped owner proves a cleanup target.
204
- const ownsScopedOutput = (target) => statusTargetHasLiveConfigConsumer(target)
205
- || target.reasons.some((reason) => reason.code === 'removedPluginCleanupRequired')
206
- || native?.nativeExtraObserved.some((entry) => entry.pluginId === target.pluginId
207
- && entry.platform === target.platform && entry.scope === target.scope
208
- && entry.reference.kind === 'namespacedOwner') === true;
209
- const placed = native ? flattenStatusTargets(native.payload.targets)
210
- .filter((target) => target.scope === options.scope && !expected(target.pluginId, target.platform)
211
- && ownsScopedOutput(target))
212
- .map((target) => ({ pluginId: target.pluginId, agent: target.platform === 'claude' ? 'claude' : 'codex',
213
- scope: options.scope, delivery: { kind: 'native', platform: target.platform },
214
- observation: target.state === 'ready' ? 'verified' : target.state === 'needsSync' ? 'missing' : 'unknown',
215
- content: target.state === 'ready' ? 'satisfied' : target.state === 'needsSync' ? 'drifted'
216
- : target.state === 'blocked' ? 'conflict' : 'unknown',
217
- backend: safeNativePlacement(target) })) : [];
218
- const owned = native ? native.nativeExtraObserved
219
- .filter((entry) => entry.reference.kind !== 'namespacedConfig'
220
- && placed.some((target) => target.pluginId === entry.pluginId && target.agent === entry.platform)
221
- && !expected(entry.pluginId, entry.platform ?? null))
222
- .map((entry) => ({ pluginId: entry.pluginId, agent: entry.platform === 'claude' ? 'claude'
223
- : entry.platform === 'codex' ? 'codex' : null, scope: options.scope,
224
- delivery: entry.platform ? { kind: 'native', platform: entry.platform } : null,
225
- observation: 'unknown', content: 'unknown', backend: {
226
- kind: entry.reference.kind, pluginName: entry.reference.pluginName,
227
- sourceId: entry.reference.sourceId, platform: entry.reference.platform,
228
- scope: entry.reference.scope, marketplaceName: entry.reference.marketplaceName,
229
- } })) : [];
230
- const key = (entry) => `${entry.pluginId}\0${entry.agent ?? ''}\0${entry.scope}`;
231
- const placedKeys = new Set(placed.map(key));
232
- const nativeExtraObserved = [
233
- ...owned.filter((entry) => !placedKeys.has(key(entry))),
234
- ...placed.map((entry) => {
235
- const references = owned.filter((candidate) => key(candidate) === key(entry))
236
- .map((candidate) => candidate.backend);
237
- return references.length ? { ...entry, backend: { ...entry.backend,
238
- ownerReferences: references } } : entry;
239
- }),
240
- ];
545
+ const nativeExtraObserved = adapters.owned
546
+ .filter((entry) => !expected(entry.pluginId, entry.agent))
547
+ .map((entry) => ({ ...entry,
548
+ expectedVersion: adapters.observations.find((item) => item.pluginId === entry.pluginId && item.platform === entry.agent)?.expectedVersion,
549
+ installedVersion: adapters.observations.find((item) => item.pluginId === entry.pluginId && item.platform === entry.agent)?.installedVersion,
550
+ delivery: { kind: 'native', platform: entry.agent },
551
+ observation: 'unknown', content: 'unknown', deploymentObservations: adapters.observations.find((observation) => observation.pluginId === entry.pluginId && observation.platform === entry.agent)?.deploymentObservations }));
552
+ const inventoryOwned = candidates.flatMap((entry) => {
553
+ // A verified Antigravity copy remains a native retirement candidate when
554
+ // its AW source is gone. Execution still verifies the live registration;
555
+ // the copy is not an owned filesystem output or AW source authority.
556
+ const nativeCopy = entry.platform === 'antigravity' && entry.scope === 'user'
557
+ && entry.kind === 'namespacedMarketplace' && entry.recoveryCandidate?.evidence === 'verified'
558
+ && entry.recoveryCandidate.binding.route === 'antigravity-cli';
559
+ return nativeCopy || entry.ownedComponent && !['codex', 'claude', 'gemini', 'copilot'].includes(entry.platform)
560
+ ? [{ pluginId: `${entry.sourceId}/${entry.pluginName}`, agent: entry.platform, scope: options.scope }] : [];
561
+ });
562
+ for (const entry of inventoryOwned) {
563
+ if (!expected(entry.pluginId, entry.agent) && !nativeExtraObserved.some((target) => target.pluginId === entry.pluginId && target.agent === entry.agent)) {
564
+ nativeExtraObserved.push({ ...entry, delivery: { kind: 'native', platform: entry.agent }, observation: 'unknown', content: 'unknown' });
565
+ }
566
+ }
567
+ for (const entry of candidates) {
568
+ const component = entry.ownedComponent;
569
+ if (component?.kind !== 'owned-directory' || !['codex', 'claude', 'gemini', 'copilot'].includes(entry.platform)
570
+ || component.identity.scope !== options.scope || entry.recoveryCandidate?.evidence !== 'verified'
571
+ || component.identity.sourceId !== entry.sourceId || component.identity.sourceIdentity !== entry.sourceIdentity
572
+ || component.identity.platform !== entry.platform || component.identity.pluginId !== `${entry.sourceId}/${entry.pluginName}`
573
+ || component.identity.physicalKey !== entry.recoveryCandidate.binding.physicalKey)
574
+ continue;
575
+ const pluginId = component.identity.pluginId;
576
+ if (observedPlugins.get(pluginId)?.sourceIdentity === component.identity.sourceIdentity)
577
+ continue;
578
+ nativeExtraObserved.push({ pluginId, agent: entry.platform, scope: component.identity.scope,
579
+ delivery: { kind: 'native', platform: entry.platform }, observation: 'unknown', content: 'unknown',
580
+ backend: { retainedPackage: true, ownedComponents: [{ ...component, state: 'present' }] } });
581
+ }
241
582
  const portableExtra = await inspectPortableExtraInstalled({
242
583
  scope: options.scope, context, env: context.env, signal: options.signal,
243
584
  });
@@ -245,25 +586,27 @@ export async function readScopedRecoveryStatus(options) {
245
586
  const portableObserved = portableExtra.targets
246
587
  .filter((entry) => !expected(entry.pluginId, entry.agent))
247
588
  .map((entry) => ({ pluginId: entry.pluginId, agent: entry.agent, scope: options.scope,
248
- delivery: { kind: 'agent-skills', provider: 'aw', agentId: entry.agent },
589
+ delivery: { kind: 'agent-skills', provider: 'aw', agentId: 'generic' },
249
590
  observation: entry.observation, content: entry.content,
250
591
  backend: { skill: entry.skill, logicalIdentity: entry.logicalIdentity } }));
251
592
  const extraObserved = [...nativeExtraObserved, ...portableObserved];
252
593
  const result = await statusFromObservations({ ...options, context, demand,
253
- nativeObservations: options.nativeObservations ?? native.nativeObservations, extraObserved,
594
+ nativeObservations: options.nativeObservations ?? adapters.observations, extraObserved,
254
595
  portableCoverage: portableExtra.complete, portableInstalled: portableExtra.targets,
255
- nativeReadErrors: native?.payload.errors.filter((error) => NATIVE_READ_ERRORS.has(error.code))
256
- .map((error) => diagnostic(error.code)) });
596
+ nativeReadErrors: [
597
+ ...ownerInventory.errors.map((error) => ({ code: error.kind === 'nativeStateRead' ? 'nativeStateUnreadable' : error.code })),
598
+ ...adapters.observations.flatMap((entry) => entry.blockers.filter((error) => NATIVE_READ_ERRORS.has(error.code))),
599
+ ].map((error) => diagnostic(error.code)) });
257
600
  result.existingTargets = [
258
- ...(native ? flattenStatusTargets(native.payload.targets).filter((target) => target.scope === options.scope && statusTargetHasLiveConfigConsumer(target))
259
- .map((target) => ({ pluginId: target.pluginId, agent: target.platform, scope: target.scope })) : []),
601
+ ...adapters.existing,
260
602
  ...portableExtra.targets.map((target) => ({ pluginId: target.pluginId, agent: target.agent, scope: options.scope })),
261
603
  ];
262
604
  result.ownedTargets = [
263
- ...(native ? flattenStatusTargets(native.payload.targets).filter((target) => target.scope === options.scope && ownsScopedOutput(target))
264
- .map((target) => ({ pluginId: target.pluginId, agent: target.platform, scope: target.scope })) : []),
605
+ ...adapters.owned, ...inventoryOwned,
265
606
  ...portableExtra.targets.map((target) => ({ pluginId: target.pluginId, agent: target.agent, scope: options.scope })),
266
607
  ];
608
+ await options.onNativeStatus?.(result, demand);
609
+ options.signal?.throwIfAborted();
267
610
  return result;
268
611
  }
269
612
  finally {
@@ -313,37 +656,80 @@ export function aggregateConvergence(allSatisfied, residue) {
313
656
  return allSatisfied === false || residue === 'present' ? false
314
657
  : allSatisfied === null || residue === 'unknown' ? null : true;
315
658
  }
316
- export async function readRecoveryStatus(options) {
317
- const snapshot = await readJointDemand(options);
659
+ export async function readRecoveryStatus(options, preparedDemand) {
660
+ const snapshot = preparedDemand ?? await readJointDemand(options);
661
+ if (options.codexObservationSession || options.nativeObservations) {
662
+ return readRecoveryStatusInSession(options, snapshot);
663
+ }
664
+ const context = await createScopeContext({ scope: snapshot.context.context,
665
+ cwd: snapshot.context.projectRoot ?? options.cwd, env: options.env, readOnly: true });
666
+ let session;
667
+ try {
668
+ options.signal?.throwIfAborted();
669
+ session = await createCodexNativeObservationSession({ exactCwd: context.executionCwd, env: context.env,
670
+ runner: async (request) => {
671
+ const result = await runNativeCli({ ...request, signal: options.signal,
672
+ timeoutMs: DEFAULT_AGENT_VERSION_PROBE_TIMEOUT_MS }, options.nativeCliRunner);
673
+ if (Buffer.byteLength(result.stdout) + Buffer.byteLength(result.stderr) > 1024 * 1024)
674
+ throw new Error('nativeObservationOutputLimit');
675
+ return result;
676
+ } });
677
+ // User reads use only this session's neutral cwd. Project reads add the
678
+ // exact project snapshot without repeating the same neutral observation.
679
+ return await readRecoveryStatusInSession({ ...options, codexObservationSession: session }, snapshot);
680
+ }
681
+ finally {
682
+ try {
683
+ await session?.dispose();
684
+ }
685
+ finally {
686
+ await context.dispose();
687
+ }
688
+ }
689
+ }
690
+ async function readRecoveryStatusInSession(options, snapshot) {
318
691
  const plan = deriveJointDemand(snapshot);
319
692
  const scopes = [snapshot.user, ...(snapshot.project ? [snapshot.project] : [])];
320
693
  const observed = [];
321
694
  for (const demand of scopes) {
322
695
  const nodes = plan.placements.filter((item) => item.scope === demand.scope
323
- || demand.scope === 'project' && (item.target === 'codex' || item.target === 'claude')
696
+ || demand.scope === 'project' && ['codex', 'claude', 'gemini', 'copilot'].includes(item.target)
324
697
  && item.contributions.some((contribution) => contribution.scope === 'project'));
325
698
  const expanded = { ...demand,
326
699
  userProviders: demand.scope === 'project' ? Object.fromEntries((snapshot.preferences?.targets ?? []).map((target) => [target,
327
- plan.placements.filter((item) => item.scope === 'user' && item.target === target).map((item) => item.pluginId)])) : {},
700
+ plan.placements.filter((item) => item.scope === 'user' && item.target === target
701
+ && !nodes.some((project) => project.scope === 'project' && project.pluginId === item.pluginId && project.target === item.target)).map((item) => item.pluginId)])) : {},
328
702
  targetRequirements: nodes.map((item) => ({ pluginId: item.pluginId, target: item.target })), roots: demand.roots === null ? null : [...new Map(nodes.map((item) => [item.pluginId, {
329
703
  pluginId: item.pluginId, sourceId: item.plugin.sourceId, sourceState: 'ready',
330
704
  blockers: [], plugin: item.plugin,
331
705
  }])).values()] };
332
- observed.push(await readScopedRecoveryStatus({ ...options, scope: demand.scope,
706
+ observed.push(await readScopedRecoveryStatus({ ...options, onNativeStatus: undefined, scope: demand.scope,
333
707
  cwd: snapshot.context.projectRoot ?? options.cwd, targets: undefined, demandOverride: expanded }));
334
708
  }
335
- const allTargets = observed.flatMap((status) => status.inventory?.flatMap((item) => item.targetResults) ?? []);
709
+ const allTargets = observed.flatMap((status) => status.inventory?.flatMap((item) => item.targetResults) ?? []).map((target) => {
710
+ const providers = plan.placements.filter((placement) => placement.pluginId === target.pluginId && placement.target === target.agent
711
+ && (placement.scope === target.scope || target.scope === 'project'
712
+ && ['codex', 'claude', 'gemini', 'copilot'].includes(target.agent) && placement.scope === 'user'
713
+ && placement.contributions.some((entry) => entry.scope === 'project')));
714
+ const contributions = providers.flatMap((provider) => provider.contributions
715
+ .filter((entry) => provider.scope === target.scope || entry.scope === target.scope));
716
+ return { ...target, contributions: contributions.map((entry) => ({ root: entry.root, scope: entry.scope, path: [...entry.path] })),
717
+ requiredBy: [...new Set(contributions.map((entry) => entry.root))], providerScope: providers[0]?.scope,
718
+ relation: contributions.some((entry) => entry.path.length === 1 && entry.scope === target.scope) ? 'root' : 'dependency' };
719
+ });
336
720
  const inventory = scopes.some((demand) => demand.roots !== null) ? [] : null;
337
721
  const visibleInventory = [];
338
722
  for (const demand of scopes)
339
723
  for (const root of demand.roots ?? []) {
340
724
  const targetResults = [];
341
725
  for (const requirement of plan.roots.filter((entry) => entry.scope === demand.scope && entry.pluginId === root.pluginId)) {
342
- const placement = plan.placements.find((item) => item.pluginId === root.pluginId && item.target === requirement.target);
726
+ const placement = plan.placements.find((item) => item.pluginId === root.pluginId && item.target === requirement.target
727
+ && item.contributions.some((contribution) => contribution.scope === demand.scope && contribution.root === root.pluginId));
343
728
  const target = { pluginId: root.pluginId, agent: requirement.target, scope: demand.scope,
344
729
  requirementScope: demand.scope, providerScope: placement?.scope,
345
730
  delivery: root.plugin ? resolveDelivery(root.plugin.manifest, requirement.target, demand.scope) ?? null : null,
346
- execution: 'not-run', observation: 'unknown', content: 'unknown', requiredBy: [root.pluginId], relation: 'root', blockers: [...requirement.blockers] };
731
+ execution: 'not-run', observation: 'unknown', content: 'unknown', requiredBy: [root.pluginId], relation: 'root',
732
+ ...(root.plugin?.manifest.version ? { expectedVersion: root.plugin.manifest.version } : {}), blockers: [...requirement.blockers] };
347
733
  if (requirement.state === 'excluded' || requirement.state === 'unsupported') {
348
734
  target.satisfaction = requirement.state;
349
735
  target.content = 'satisfied';
@@ -353,9 +739,10 @@ export async function readRecoveryStatus(options) {
353
739
  }
354
740
  else if (requirement.state === 'required') {
355
741
  const providers = requirement.dependencies.map((id) => {
356
- const provider = plan.placements.find((item) => item.pluginId === id && item.target === requirement.target);
742
+ const provider = plan.placements.find((item) => item.pluginId === id && item.target === requirement.target
743
+ && item.contributions.some((contribution) => contribution.scope === demand.scope && contribution.root === root.pluginId));
357
744
  const actual = allTargets.find((item) => item.pluginId === id && item.agent === requirement.target && item.scope === provider?.scope);
358
- if (demand.scope === 'project' && provider?.scope === 'user' && (requirement.target === 'codex' || requirement.target === 'claude')) {
745
+ if (demand.scope === 'project' && provider?.scope === 'user' && ['codex', 'claude', 'gemini', 'copilot'].includes(requirement.target)) {
359
746
  const activation = allTargets.find((item) => item.pluginId === id && item.agent === requirement.target && item.scope === 'project');
360
747
  if (actual?.content !== 'satisfied')
361
748
  return actual;
@@ -373,7 +760,19 @@ export async function readRecoveryStatus(options) {
373
760
  }
374
761
  return actual;
375
762
  });
763
+ const ownProvider = providers.find((provider) => provider?.pluginId === root.pluginId);
764
+ if (ownProvider?.installedVersion)
765
+ target.installedVersion = ownProvider.installedVersion;
376
766
  target.blockers.push(...providers.flatMap((item) => item?.blockers ?? []));
767
+ const componentGaps = providers.flatMap((item) => item?.componentGaps ?? []);
768
+ if (componentGaps.length)
769
+ target.componentGaps = [...new Map(componentGaps.map((gap) => [JSON.stringify([gap.providerPluginId, gap.agent, gap.renderScope, gap.id]), gap])).values()];
770
+ const exclusions = providers.flatMap((item) => item?.deploymentExclusions ?? []);
771
+ if (exclusions.length)
772
+ target.deploymentExclusions = [...new Map(exclusions.map((exclusion) => [JSON.stringify([exclusion.pluginId, exclusion.platform, exclusion.scope, exclusion.productId, exclusion.reasonCode]), exclusion])).values()];
773
+ const deployments = providers.flatMap((item) => item?.deploymentObservations ?? []);
774
+ if (deployments.length)
775
+ target.deploymentObservations = [...new Map(deployments.map((item) => [item.bindingId, item])).values()];
377
776
  target.content = ['conflict', 'drifted', 'absent', 'unknown'].find((state) => providers.some((item) => (item?.content ?? 'unknown') === state)) ?? 'satisfied';
378
777
  target.observation = target.content === 'satisfied' ? 'verified' : target.content === 'absent' ? 'missing' : 'unknown';
379
778
  target.satisfaction = target.content === 'satisfied' ? demand.scope === 'project' && placement?.scope === 'user' ? 'inherited-user' : 'installed'
@@ -388,18 +787,16 @@ export async function readRecoveryStatus(options) {
388
787
  const expected = new Set(plan.placements.map((item) => `${item.pluginId}\0${item.target}\0${item.scope}`));
389
788
  const extraObserved = observed.flatMap((status) => status.extraObserved)
390
789
  .filter((item) => !expected.has(`${item.pluginId}\0${item.agent}\0${item.scope}`));
391
- const conflicts = findPlacementConflicts([...plan.placements,
392
- ...extraObserved.filter((item) => item.agent !== null)
393
- .map((item) => ({ pluginId: item.pluginId, target: item.agent, scope: item.scope }))]);
394
790
  const targets = visibleInventory.flatMap((item) => item.targetResults);
395
791
  const knownFailure = plan.errors.some((error) => ['targetsNotConfigured', 'dependencyExcluded', 'dependencyContractInvalid', 'targetPlacementConflict'].includes(error.code))
396
- || conflicts.length > 0 || targets.some((target) => ['absent', 'drifted', 'conflict'].includes(target.content ?? 'unknown'));
792
+ || targets.some((target) => ['absent', 'drifted', 'conflict'].includes(target.content ?? 'unknown')
793
+ || target.blockers.some((entry) => entry.code === 'awCapabilityUnsupported'));
397
794
  const uncertain = !plan.complete || targets.some((target) => target.content === 'unknown' || target.blockers.length > 0);
398
795
  const allSatisfied = knownFailure ? false : uncertain ? null : true;
399
796
  const nativeCoverage = observed.every((status) => status.coverage.native);
400
797
  const portableCoverage = observed.every((status) => status.coverage.portable);
401
- const errors = [...plan.errors, ...conflicts, ...observed.flatMap((status) => status.errors)];
402
- return { schemaVersion: 1, kind: 'aw-recovery-status', scope: snapshot.context.context, ok: errors.length === 0,
798
+ const errors = [...plan.errors, ...observed.flatMap((status) => status.errors)];
799
+ const result = { schemaVersion: 1, kind: 'aw-recovery-status', scope: snapshot.context.context, ok: errors.length === 0,
403
800
  intent: { state: scopes.some((demand) => demand.intent.state === 'invalid') ? 'invalid'
404
801
  : scopes.some((demand) => demand.intent.state === 'unreadable') ? 'unreadable'
405
802
  : scopes.some((demand) => demand.intent.state === 'unsupported-version') ? 'unsupported-version'
@@ -414,5 +811,8 @@ export async function readRecoveryStatus(options) {
414
811
  unconfirmed: targets.filter((target) => target.content === 'unknown').length,
415
812
  ready: targets.filter((target) => target.content === 'satisfied').length },
416
813
  allSatisfied, inSync: aggregateConvergence(allSatisfied, extraObserved.length ? 'present' : nativeCoverage && portableCoverage ? 'absent' : 'unknown'), errors };
814
+ await options.onNativeStatus?.(result, snapshot.context.context === 'project' ? snapshot.project : snapshot.user);
815
+ options.signal?.throwIfAborted();
816
+ return result;
417
817
  }
418
818
  //# sourceMappingURL=status.js.map