@lesliechan721/aw 0.1.0-beta.73 → 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 (361) 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 +1 -0
  46. package/dist/src/commands/public-lifecycle.js +15 -2
  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 +40 -14
  84. package/dist/src/index.js.map +1 -1
  85. package/dist/src/output/command-receipt.d.ts +1 -1
  86. package/dist/src/output/command-receipt.js +3 -1
  87. package/dist/src/output/command-receipt.js.map +1 -1
  88. package/dist/src/output/native-consent.d.ts +2 -0
  89. package/dist/src/output/native-consent.js +5 -0
  90. package/dist/src/output/native-consent.js.map +1 -0
  91. package/dist/src/output/public-result.js +60 -0
  92. package/dist/src/output/public-result.js.map +1 -1
  93. package/dist/src/output/rebuild-progress.js +5 -5
  94. package/dist/src/output/rebuild-progress.js.map +1 -1
  95. package/dist/src/output/receipt-projection.js +19 -2
  96. package/dist/src/output/receipt-projection.js.map +1 -1
  97. package/dist/src/platforms/capabilities.d.ts +10 -0
  98. package/dist/src/platforms/capabilities.js +158 -0
  99. package/dist/src/platforms/capabilities.js.map +1 -0
  100. package/dist/src/platforms/contracts.d.ts +338 -0
  101. package/dist/src/platforms/contracts.js +2 -0
  102. package/dist/src/platforms/contracts.js.map +1 -0
  103. package/dist/src/platforms/cursor-workspace-hook.d.ts +22 -0
  104. package/dist/src/platforms/cursor-workspace-hook.js +185 -0
  105. package/dist/src/platforms/cursor-workspace-hook.js.map +1 -0
  106. package/dist/src/platforms/discovery.d.ts +74 -0
  107. package/dist/src/platforms/discovery.js +582 -0
  108. package/dist/src/platforms/discovery.js.map +1 -0
  109. package/dist/src/platforms/gemini-activation.d.ts +36 -0
  110. package/dist/src/platforms/gemini-activation.js +331 -0
  111. package/dist/src/platforms/gemini-activation.js.map +1 -0
  112. package/dist/src/platforms/gemini-consent.d.ts +8 -0
  113. package/dist/src/platforms/gemini-consent.js +79 -0
  114. package/dist/src/platforms/gemini-consent.js.map +1 -0
  115. package/dist/src/platforms/identity.d.ts +4 -0
  116. package/dist/src/platforms/identity.js +22 -0
  117. package/dist/src/platforms/identity.js.map +1 -0
  118. package/dist/src/platforms/inspection-grok.d.ts +4 -0
  119. package/dist/src/platforms/inspection-grok.js +173 -0
  120. package/dist/src/platforms/inspection-grok.js.map +1 -0
  121. package/dist/src/platforms/inspection-native.d.ts +6 -0
  122. package/dist/src/platforms/inspection-native.js +379 -0
  123. package/dist/src/platforms/inspection-native.js.map +1 -0
  124. package/dist/src/platforms/inspection-pi.d.ts +4 -0
  125. package/dist/src/platforms/inspection-pi.js +212 -0
  126. package/dist/src/platforms/inspection-pi.js.map +1 -0
  127. package/dist/src/platforms/inspection.d.ts +13 -0
  128. package/dist/src/platforms/inspection.js +189 -0
  129. package/dist/src/platforms/inspection.js.map +1 -0
  130. package/dist/src/platforms/layout.d.ts +21 -0
  131. package/dist/src/platforms/layout.js +239 -0
  132. package/dist/src/platforms/layout.js.map +1 -0
  133. package/dist/src/platforms/lifecycle-native-services.d.ts +3 -0
  134. package/dist/src/platforms/lifecycle-native-services.js +147 -0
  135. package/dist/src/platforms/lifecycle-native-services.js.map +1 -0
  136. package/dist/src/platforms/lifecycle-native.d.ts +9 -0
  137. package/dist/src/platforms/lifecycle-native.js +252 -0
  138. package/dist/src/platforms/lifecycle-native.js.map +1 -0
  139. package/dist/src/platforms/lifecycle.d.ts +25 -0
  140. package/dist/src/platforms/lifecycle.js +452 -0
  141. package/dist/src/platforms/lifecycle.js.map +1 -0
  142. package/dist/src/platforms/managed-command-placement.d.ts +8 -0
  143. package/dist/src/platforms/managed-command-placement.js +79 -0
  144. package/dist/src/platforms/managed-command-placement.js.map +1 -0
  145. package/dist/src/platforms/projection-code-extension.d.ts +8 -0
  146. package/dist/src/platforms/projection-code-extension.js +121 -0
  147. package/dist/src/platforms/projection-code-extension.js.map +1 -0
  148. package/dist/src/platforms/projection-command-resources.d.ts +7 -0
  149. package/dist/src/platforms/projection-command-resources.js +74 -0
  150. package/dist/src/platforms/projection-command-resources.js.map +1 -0
  151. package/dist/src/platforms/projection-files.d.ts +27 -0
  152. package/dist/src/platforms/projection-files.js +111 -0
  153. package/dist/src/platforms/projection-files.js.map +1 -0
  154. package/dist/src/platforms/projection-marketplace.d.ts +19 -0
  155. package/dist/src/platforms/projection-marketplace.js +42 -0
  156. package/dist/src/platforms/projection-marketplace.js.map +1 -0
  157. package/dist/src/platforms/projection.d.ts +10 -0
  158. package/dist/src/platforms/projection.js +446 -0
  159. package/dist/src/platforms/projection.js.map +1 -0
  160. package/dist/src/platforms/registry.d.ts +4 -0
  161. package/dist/src/platforms/registry.js +30 -0
  162. package/dist/src/platforms/registry.js.map +1 -0
  163. package/dist/src/platforms/supplement-layout.d.ts +16 -0
  164. package/dist/src/platforms/supplement-layout.js +31 -0
  165. package/dist/src/platforms/supplement-layout.js.map +1 -0
  166. package/dist/src/portable/commands.d.ts +7 -5
  167. package/dist/src/portable/commands.js +6 -1
  168. package/dist/src/portable/commands.js.map +1 -1
  169. package/dist/src/portable/materializer.d.ts +8 -6
  170. package/dist/src/portable/materializer.js +47 -245
  171. package/dist/src/portable/materializer.js.map +1 -1
  172. package/dist/src/portable/recovery-layout.js +2 -15
  173. package/dist/src/portable/recovery-layout.js.map +1 -1
  174. package/dist/src/portable/recovery.d.ts +10 -1
  175. package/dist/src/portable/recovery.js +34 -8
  176. package/dist/src/portable/recovery.js.map +1 -1
  177. package/dist/src/recovery/coordinator.d.ts +4 -7
  178. package/dist/src/recovery/coordinator.js +151 -119
  179. package/dist/src/recovery/coordinator.js.map +1 -1
  180. package/dist/src/recovery/demand.d.ts +1 -1
  181. package/dist/src/recovery/demand.js +10 -42
  182. package/dist/src/recovery/demand.js.map +1 -1
  183. package/dist/src/recovery/joint-coordinator.js +112 -52
  184. package/dist/src/recovery/joint-coordinator.js.map +1 -1
  185. package/dist/src/recovery/joint-demand.d.ts +4 -22
  186. package/dist/src/recovery/joint-demand.js +43 -40
  187. package/dist/src/recovery/joint-demand.js.map +1 -1
  188. package/dist/src/recovery/receipt.d.ts +23 -8
  189. package/dist/src/recovery/retirement.d.ts +1 -1
  190. package/dist/src/recovery/retirement.js +122 -29
  191. package/dist/src/recovery/retirement.js.map +1 -1
  192. package/dist/src/recovery/status.d.ts +13 -6
  193. package/dist/src/recovery/status.js +479 -79
  194. package/dist/src/recovery/status.js.map +1 -1
  195. package/dist/src/recovery/types.d.ts +3 -3
  196. package/dist/src/review/platform-profile.d.ts +3 -0
  197. package/dist/src/review/platform-profile.js +16 -0
  198. package/dist/src/review/platform-profile.js.map +1 -0
  199. package/dist/src/review/review-profile.d.ts +1 -0
  200. package/dist/src/review/review-profile.js +8 -2
  201. package/dist/src/review/review-profile.js.map +1 -1
  202. package/dist/src/review/review-selection.d.ts +2 -11
  203. package/dist/src/review/review-selection.js +97 -71
  204. package/dist/src/review/review-selection.js.map +1 -1
  205. package/dist/src/review/review-types.d.ts +3 -0
  206. package/dist/src/review/review-types.js.map +1 -1
  207. package/dist/src/review/skill-materialization.d.ts +44 -9
  208. package/dist/src/review/skill-materialization.js +112 -136
  209. package/dist/src/review/skill-materialization.js.map +1 -1
  210. package/dist/src/review/source-binding.d.ts +8 -5
  211. package/dist/src/review/source-binding.js +99 -41
  212. package/dist/src/review/source-binding.js.map +1 -1
  213. package/dist/src/tui/agent-management.js +112 -10
  214. package/dist/src/tui/agent-management.js.map +1 -1
  215. package/dist/src/tui/agent-settings.d.ts +3 -0
  216. package/dist/src/tui/agent-settings.js +10 -11
  217. package/dist/src/tui/agent-settings.js.map +1 -1
  218. package/dist/src/tui/console-app-v4.js +58 -20
  219. package/dist/src/tui/console-app-v4.js.map +1 -1
  220. package/dist/src/tui/content-item-card.js +2 -2
  221. package/dist/src/tui/content-item-card.js.map +1 -1
  222. package/dist/src/tui/controller-runtime.js +198 -152
  223. package/dist/src/tui/controller-runtime.js.map +1 -1
  224. package/dist/src/tui/controller.d.ts +5 -9
  225. package/dist/src/tui/controller.js +40 -18
  226. package/dist/src/tui/controller.js.map +1 -1
  227. package/dist/src/tui/deployment-view.d.ts +10 -0
  228. package/dist/src/tui/deployment-view.js +91 -0
  229. package/dist/src/tui/deployment-view.js.map +1 -0
  230. package/dist/src/tui/glossary.js +4 -4
  231. package/dist/src/tui/glossary.js.map +1 -1
  232. package/dist/src/tui/model.d.ts +5 -0
  233. package/dist/src/tui/model.js +73 -12
  234. package/dist/src/tui/model.js.map +1 -1
  235. package/dist/src/tui/operation-diagnostic-screens.js +2 -1
  236. package/dist/src/tui/operation-diagnostic-screens.js.map +1 -1
  237. package/dist/src/tui/operation-history.d.ts +5 -4
  238. package/dist/src/tui/operation-history.js.map +1 -1
  239. package/dist/src/tui/operation-review-planner.d.ts +7 -2
  240. package/dist/src/tui/operation-review-planner.js +97 -42
  241. package/dist/src/tui/operation-review-planner.js.map +1 -1
  242. package/dist/src/tui/plugin-content.d.ts +5 -3
  243. package/dist/src/tui/plugin-content.js +70 -508
  244. package/dist/src/tui/plugin-content.js.map +1 -1
  245. package/dist/src/tui/plugin-detail.d.ts +3 -2
  246. package/dist/src/tui/plugin-detail.js +33 -25
  247. package/dist/src/tui/plugin-detail.js.map +1 -1
  248. package/dist/src/tui/scoped-inventory.d.ts +10 -6
  249. package/dist/src/tui/scoped-inventory.js +34 -1
  250. package/dist/src/tui/scoped-inventory.js.map +1 -1
  251. package/dist/src/types.d.ts +4 -63
  252. package/dist/src/types.js.map +1 -1
  253. package/dist/src/utils/agent-version.d.ts +10 -4
  254. package/dist/src/utils/agent-version.js.map +1 -1
  255. package/dist/src/utils/artifact-plan.d.ts +26 -2
  256. package/dist/src/utils/artifact-plan.js +113 -489
  257. package/dist/src/utils/artifact-plan.js.map +1 -1
  258. package/dist/src/utils/artifact-renderer.d.ts +100 -93
  259. package/dist/src/utils/artifact-renderer.js +173 -346
  260. package/dist/src/utils/artifact-renderer.js.map +1 -1
  261. package/dist/src/utils/artifact-request.d.ts +21 -11
  262. package/dist/src/utils/artifact-request.js +56 -80
  263. package/dist/src/utils/artifact-request.js.map +1 -1
  264. package/dist/src/utils/bundle-layout.js +30 -146
  265. package/dist/src/utils/bundle-layout.js.map +1 -1
  266. package/dist/src/utils/catalog-digests.d.ts +2 -12
  267. package/dist/src/utils/catalog-digests.js +0 -39
  268. package/dist/src/utils/catalog-digests.js.map +1 -1
  269. package/dist/src/utils/catalog-source-references.d.ts +7 -0
  270. package/dist/src/utils/catalog-source-references.js +234 -19
  271. package/dist/src/utils/catalog-source-references.js.map +1 -1
  272. package/dist/src/utils/codex-config-observation.d.ts +19 -0
  273. package/dist/src/utils/codex-config-observation.js +145 -0
  274. package/dist/src/utils/codex-config-observation.js.map +1 -0
  275. package/dist/src/utils/codex-executable-discovery.d.ts +2 -0
  276. package/dist/src/utils/codex-executable-discovery.js +47 -13
  277. package/dist/src/utils/codex-executable-discovery.js.map +1 -1
  278. package/dist/src/utils/codex-manager.js +1 -1
  279. package/dist/src/utils/codex-manager.js.map +1 -1
  280. package/dist/src/utils/codex-native-observation.d.ts +3 -0
  281. package/dist/src/utils/codex-native-observation.js +53 -0
  282. package/dist/src/utils/codex-native-observation.js.map +1 -1
  283. package/dist/src/utils/codex-shared-native.d.ts +3 -1
  284. package/dist/src/utils/codex-shared-native.js +46 -5
  285. package/dist/src/utils/codex-shared-native.js.map +1 -1
  286. package/dist/src/utils/codex-skill-staging.d.ts +4 -3
  287. package/dist/src/utils/codex-skill-staging.js.map +1 -1
  288. package/dist/src/utils/codex-surface-analysis.d.ts +5 -2
  289. package/dist/src/utils/codex-surface-analysis.js +28 -57
  290. package/dist/src/utils/codex-surface-analysis.js.map +1 -1
  291. package/dist/src/utils/component-command-preparation.d.ts +34 -0
  292. package/dist/src/utils/component-command-preparation.js +228 -0
  293. package/dist/src/utils/component-command-preparation.js.map +1 -0
  294. package/dist/src/utils/component-resources.d.ts +43 -0
  295. package/dist/src/utils/component-resources.js +304 -0
  296. package/dist/src/utils/component-resources.js.map +1 -0
  297. package/dist/src/utils/dynamic-skill-tree.d.ts +17 -6
  298. package/dist/src/utils/dynamic-skill-tree.js +7 -3
  299. package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
  300. package/dist/src/utils/local-marketplace.d.ts +11 -44
  301. package/dist/src/utils/local-marketplace.js +11 -638
  302. package/dist/src/utils/local-marketplace.js.map +1 -1
  303. package/dist/src/utils/managed-command-evidence.d.ts +2 -2
  304. package/dist/src/utils/managed-command-evidence.js +5 -81
  305. package/dist/src/utils/managed-command-evidence.js.map +1 -1
  306. package/dist/src/utils/managed-command-materialization.d.ts +5 -2
  307. package/dist/src/utils/managed-command-materialization.js +35 -35
  308. package/dist/src/utils/managed-command-materialization.js.map +1 -1
  309. package/dist/src/utils/managed-command-preparation.d.ts +67 -0
  310. package/dist/src/utils/managed-command-preparation.js +146 -0
  311. package/dist/src/utils/managed-command-preparation.js.map +1 -0
  312. package/dist/src/utils/managed-command-review.d.ts +26 -0
  313. package/dist/src/utils/managed-command-review.js +68 -0
  314. package/dist/src/utils/managed-command-review.js.map +1 -0
  315. package/dist/src/utils/managed-command-store.js +26 -15
  316. package/dist/src/utils/managed-command-store.js.map +1 -1
  317. package/dist/src/utils/native-cli.d.ts +19 -0
  318. package/dist/src/utils/native-cli.js +45 -2
  319. package/dist/src/utils/native-cli.js.map +1 -1
  320. package/dist/src/utils/native-demand.d.ts +20 -1
  321. package/dist/src/utils/native-demand.js.map +1 -1
  322. package/dist/src/utils/native-tool-review.d.ts +3 -6
  323. package/dist/src/utils/native-tool-review.js +25 -11
  324. package/dist/src/utils/native-tool-review.js.map +1 -1
  325. package/dist/src/utils/ownership.d.ts +26 -3
  326. package/dist/src/utils/ownership.js +95 -9
  327. package/dist/src/utils/ownership.js.map +1 -1
  328. package/dist/src/utils/paths.d.ts +1 -1
  329. package/dist/src/utils/paths.js +2 -0
  330. package/dist/src/utils/paths.js.map +1 -1
  331. package/dist/src/utils/platform-empty-state.d.ts +46 -0
  332. package/dist/src/utils/platform-empty-state.js +123 -0
  333. package/dist/src/utils/platform-empty-state.js.map +1 -0
  334. package/dist/src/utils/plugin-config-impact.d.ts +17 -11
  335. package/dist/src/utils/plugin-config-impact.js +46 -62
  336. package/dist/src/utils/plugin-config-impact.js.map +1 -1
  337. package/dist/src/utils/plugin-config-write.js +52 -53
  338. package/dist/src/utils/plugin-config-write.js.map +1 -1
  339. package/dist/src/utils/plugin-config.d.ts +0 -2
  340. package/dist/src/utils/plugin-config.js +0 -6
  341. package/dist/src/utils/plugin-config.js.map +1 -1
  342. package/dist/src/utils/plugin-dependencies.d.ts +1 -1
  343. package/dist/src/utils/plugin-dependencies.js.map +1 -1
  344. package/dist/src/utils/runtime-config.d.ts +5 -7
  345. package/dist/src/utils/runtime-config.js +12 -25
  346. package/dist/src/utils/runtime-config.js.map +1 -1
  347. package/dist/src/utils/windows-npm-shim.js +19 -2
  348. package/dist/src/utils/windows-npm-shim.js.map +1 -1
  349. package/package.json +3 -3
  350. package/dist/src/utils/claude-native-render-receipt.d.ts +0 -14
  351. package/dist/src/utils/claude-native-render-receipt.js +0 -26
  352. package/dist/src/utils/claude-native-render-receipt.js.map +0 -1
  353. package/dist/src/utils/claude-skills-root.d.ts +0 -8
  354. package/dist/src/utils/claude-skills-root.js +0 -87
  355. package/dist/src/utils/claude-skills-root.js.map +0 -1
  356. package/dist/src/utils/codex-native-render-receipt.d.ts +0 -40
  357. package/dist/src/utils/codex-native-render-receipt.js +0 -205
  358. package/dist/src/utils/codex-native-render-receipt.js.map +0 -1
  359. package/dist/src/utils/slash-commands.d.ts +0 -1
  360. package/dist/src/utils/slash-commands.js +0 -2
  361. package/dist/src/utils/slash-commands.js.map +0 -1
@@ -1,9 +1,11 @@
1
1
  import { getCommandPackageId } from '@lesliechan721/aw-plugin-core/manifest';
2
+ import { finalizePreparedPlatformRebuildSession } from '../commands/rebuild-integration.js';
2
3
  import { addRequirements } from '../commands/intent-command.js';
3
4
  import { createEmptyIntent, calculateIntentDigest, removeIntentRoot } from '../intent/intent-codec.js';
4
5
  import { observeIntent, writeIntent, resolveIntentPath } from '../intent/intent-store.js';
5
6
  import { describeStrongStateProblem } from '../intent/diagnostics.js';
6
7
  import { observePreferences, normalizeAgents, writePreferences } from '../intent/deployment-preferences.js';
8
+ import { hasSharedUserPackage } from '../platforms/layout.js';
7
9
  import { createScopeContext } from '../intent/scope-context.js';
8
10
  import { withAwHomeMutationLock } from '../utils/aw-home-mutation-lock.js';
9
11
  import { readSafeOperationError } from '../utils/safe-operation-diagnostic.js';
@@ -14,12 +16,13 @@ import { validateCatalogSnapshotComplete } from '../utils/catalog-snapshot.js';
14
16
  import { readCatalogGenerationState } from '../utils/catalog-generation-state.js';
15
17
  import { parsePluginId } from '../utils/multi-source-catalog.js';
16
18
  import { readDemand } from './demand.js';
17
- import { readJointDemand, deriveJointDemand, findPlacementConflicts, targetsConflict } from './joint-demand.js';
18
- import { prepareScopedRecovery, executeScopedRecovery, executeRecoveryPreApply, describeRecoveryPlan } from './coordinator.js';
19
+ import { readJointDemand, deriveJointDemand, deriveSharedReferenceView } from './joint-demand.js';
20
+ import { prepareScopedRecovery, executeScopedRecovery, executeRecoveryPreApply, refreshRecoveryNativePreviews, describeRecoveryPlan } from './coordinator.js';
19
21
  import { readScopedRecoveryStatus, readRecoveryStatus } from './status.js';
20
22
  import { measureRecoveryPerformanceStage, recordRecoveryPerformanceStage } from './performance.js';
21
23
  import { resolvePluginMetaDependencyClosure } from '../utils/plugin-dependencies.js';
22
24
  const diagnostic = (code, message = code) => ({ code, message });
25
+ const canReuseProviderAcrossScopes = (target) => target === 'generic' || hasSharedUserPackage(target);
23
26
  function intentReceipt(observation) {
24
27
  return { state: observation.state,
25
28
  roots: observation.state === 'valid' ? observation.value.roots.map((root) => root.pluginId)
@@ -52,10 +55,20 @@ function mergeReceipts(plan, receipts) {
52
55
  }
53
56
  receipt.requestedTargets = receipt.targetResults.map(({ pluginId, agent, scope, delivery }) => ({ pluginId, agent, scope, delivery }));
54
57
  for (const target of receipt.targetResults) {
55
- const placement = plan.joint?.demand.placements.find((item) => item.pluginId === target.pluginId && item.target === target.agent);
58
+ const placements = plan.joint?.demand.placements ?? [];
59
+ const activationOnly = plan.joint?.children.some((child) => child.options.nativeActivationOnlyTargets?.some((item) => item.pluginId === target.pluginId && item.platform === target.agent && item.scope === target.scope));
60
+ const placement = placements.find((item) => item.pluginId === target.pluginId && item.target === target.agent && item.scope === target.scope)
61
+ ?? (target.scope === 'project' && activationOnly ? placements.find((item) => item.pluginId === target.pluginId && item.target === target.agent && item.scope === 'user'
62
+ && item.contributions.some((contribution) => contribution.scope === target.scope)) : undefined);
56
63
  if (placement) {
57
- target.requiredBy = [...new Set(placement.contributions.map((item) => item.root))];
64
+ const contributions = placement.scope === target.scope ? placement.contributions
65
+ : placement.contributions.filter((item) => item.scope === target.scope);
66
+ target.requiredBy = [...new Set(contributions.map((item) => item.root))];
58
67
  target.providerScope = placement.scope;
68
+ if (placement.scope !== target.scope) {
69
+ target.requirementScope = target.scope;
70
+ target.relation = contributions.some((item) => item.root === target.pluginId) ? 'root' : 'dependency';
71
+ }
59
72
  }
60
73
  }
61
74
  receipt.remainingTargets = receipts.flatMap((item) => item.remainingTargets);
@@ -262,21 +275,21 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
262
275
  errors.push(diagnostic('invalidExactTargets', '精确重试目标不属于当前请求,请重新检查并选择。'));
263
276
  }
264
277
  const selected = demand.placements.filter((placement) => targets.includes(placement.target)
265
- && !demand.conflicts.some((conflict) => [conflict.left, conflict.right].some((position) => position.target === placement.target && position.scope === placement.scope))
266
278
  && (!options.exactTargets || options.exactTargets.some((exact) => exact.agent === placement.target
267
279
  && (command === 'uninstall' ? previousDemand.placements.some((previous) => previous.pluginId === placement.pluginId
268
280
  && previous.target === placement.target && previous.contributions.some((item) => item.path.includes(exact.pluginId)
269
281
  && (!exact.scope || item.scope === exact.scope)))
270
282
  : (!exact.scope || placement.contributions.some((item) => item.scope === exact.scope))
271
283
  && (exact.pluginId === placement.pluginId || placement.contributions.some((item) => item.path.includes(exact.pluginId))))))
272
- && (command === 'uninstall' ? !(options.force && requested.includes(placement.pluginId))
284
+ && (command === 'uninstall' ? canReuseProviderAcrossScopes(placement.target)
285
+ && !(options.force && requested.includes(placement.pluginId))
273
286
  && previousDemand.placements.some((previous) => previous.pluginId === placement.pluginId && previous.target === placement.target
274
287
  && previous.scope !== placement.scope && previous.contributions.some((item) => item.scope === scope && requested.includes(item.root)))
275
288
  : placement.contributions.some((item) => requested.includes(item.root)
276
289
  || options.allowDependencySelectors && item.path.some((id) => requested.includes(id))) || options.existingOnly && requested.includes(placement.pluginId)));
277
290
  const activationOnlyTargets = [];
278
291
  if (snapshot.project && !errors.length) {
279
- const sharedNative = selected.filter((item) => item.scope === 'user' && (item.target === 'codex' || item.target === 'claude')
292
+ const sharedNative = selected.filter((item) => item.scope === 'user' && ['codex', 'claude', 'gemini', 'copilot'].includes(item.target)
280
293
  && item.contributions.some((entry) => entry.scope === 'project'));
281
294
  if (sharedNative.length) {
282
295
  const expanded = { ...snapshot.project, roots: [...new Map(sharedNative.map((item) => [item.pluginId, {
@@ -291,8 +304,7 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
291
304
  if (item.target === 'codex') {
292
305
  const surface = analyzeCodexSurface(item.plugin.manifest);
293
306
  const live = actual?.backend?.live;
294
- const explicitlyDisabled = live?.components?.some((component) => component.kind === 'activation'
295
- && component.key === 'project' && component.state === 'disabled');
307
+ const explicitlyDisabled = actual?.deploymentObservations?.some((observation) => observation.after.consumers.some((consumer) => consumer.activation === 'disabled'));
296
308
  const userProvidesComponents = surface.components.every((component) => !component.scopes.includes('project') || component.scopes.includes('user'));
297
309
  const retiringProjectComponents = live?.components?.some((component) => component.kind === 'ownership'
298
310
  && component.key !== 'native' && !component.key.startsWith('activation-') && !component.key.startsWith('marketplace-')
@@ -306,8 +318,8 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
306
318
  }
307
319
  }
308
320
  if (actual?.content !== 'satisfied') {
309
- if (item.target === 'claude')
310
- activationOnlyTargets.push({ pluginId: item.pluginId, platform: 'claude', scope: 'project' });
321
+ if (item.target !== 'generic')
322
+ activationOnlyTargets.push({ pluginId: item.pluginId, platform: item.target, scope: 'project' });
311
323
  selected.push({ ...item, scope: 'project' });
312
324
  }
313
325
  }
@@ -332,7 +344,7 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
332
344
  originalIntent: observationEvidence(original.intent), preferencesEvidence: observationEvidence(snapshot.user.preferences),
333
345
  plannedImpact: { declaration: Boolean(declaration), preferences: false, config: false, outputs: false },
334
346
  changes: declaration ? [`保存 ${scope} 插件需求。`] : [], warnings: [], nativeGroups: [],
335
- historicalNativeTargets: new Set(), deliverySwitchChecks: [], portableGroups: [], portableProtectionGroups: [],
347
+ portableGroups: [], portableProtectionGroups: [],
336
348
  portableResidues: [], sourceRefreshes: [], sourceRefreshFailures: [], runtime, blockExecution: errors.some((error) => ['syncPluginNotDesired', 'pluginIntentRootMissing', 'pluginIntentStateInvalid', 'catalogSnapshotInvalid', 'installTargetSelectionUnsupported', 'invalidExactTargets', 'dependencyStillRequired'].includes(error.code)
337
349
  || error.code === 'targetsNotConfigured' && !options.retireUnselectedTargets)
338
350
  || !snapshot.preferences || snapshot.user.roots === null || snapshot.project?.roots === null, joint };
@@ -343,16 +355,21 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
343
355
  try {
344
356
  const currentStatus = observedStatus ?? await readRecoveryStatus({ ...options, nativeCliRunner: runtime.nativeCliRunner,
345
357
  codexObservationSession: runtime.codexObservationSession, targets: undefined }, savedDemand);
358
+ const sharedReferenceView = deriveSharedReferenceView(snapshot, demand, currentStatus);
346
359
  const ownsOutput = (item) => currentStatus.ownedTargets?.some((owned) => owned.pluginId === item.pluginId
347
360
  && owned.agent === item.agent && owned.scope === item.scope) === true;
348
361
  const liveConsumers = currentStatus.existingTargets ?? [];
349
- const sameProvider = (consumer, provider) => consumer.agent === provider.agent && (provider.scope === 'user' || consumer.scope === provider.scope);
362
+ const sameProvider = (consumer, provider) => consumer.agent === provider.agent && (consumer.scope === provider.scope
363
+ || provider.scope === 'user' && canReuseProviderAcrossScopes(consumer.agent));
350
364
  const automaticRetirements = command === 'uninstall' && !options.keepDependencies && demand.complete
351
365
  ? previousDemand.placements.filter((placement) => placement.scope === scope && targets.includes(placement.target)
352
- && (placement.target === 'codex' || placement.target === 'claude' ? currentStatus.coverage.native : currentStatus.coverage.portable)
353
- && !requested.includes(placement.pluginId) && !rootIds.includes(placement.pluginId)
366
+ && (placement.target !== 'generic' ? currentStatus.coverage.native : currentStatus.coverage.portable)
367
+ && !requested.includes(placement.pluginId)
368
+ && !(canReuseProviderAcrossScopes(placement.target) ? rootIds.includes(placement.pluginId)
369
+ : snapshot[placement.scope]?.roots?.some((root) => root.pluginId === placement.pluginId))
354
370
  && placement.contributions.some((item) => explicitlyRemoves({ pluginId: item.root, agent: placement.target, scope: item.scope }))
355
- && !demand.placements.some((item) => item.pluginId === placement.pluginId && item.target === placement.target)
371
+ && !demand.placements.some((item) => item.pluginId === placement.pluginId && item.target === placement.target
372
+ && (item.scope === placement.scope || canReuseProviderAcrossScopes(placement.target)))
356
373
  && ownsOutput({ pluginId: placement.pluginId, agent: placement.target, scope: placement.scope })) : [];
357
374
  // A live consumer can outlast its Intent or its Active catalog entry.
358
375
  const retainedConsumerFor = (provider) => liveConsumers.find((consumer) => {
@@ -397,10 +414,9 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
397
414
  return plan;
398
415
  }
399
416
  plan.dependencyCleanupTargets = automaticRetirements.map((item) => ({ pluginId: item.pluginId, agent: item.target, scope: item.scope }));
400
- // Native platforms share one complete marketplace candidate per scope.
401
- const nativeTargets = targets.filter((target) => target === 'codex' || target === 'claude');
417
+ const nativeTargets = targets.filter((target) => target !== 'generic');
402
418
  const targetGroups = [...(nativeTargets.length ? [nativeTargets] : []),
403
- ...targets.filter((target) => target !== 'codex' && target !== 'claude').map((target) => [target])];
419
+ ...targets.filter((target) => target === 'generic').map((target) => [target])];
404
420
  for (const currentScope of snapshot.context.scopes) {
405
421
  for (const groupTargets of targetGroups) {
406
422
  const placements = selected.filter((item) => item.scope === currentScope && groupTargets.includes(item.target)
@@ -414,7 +430,8 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
414
430
  ...demand.placements.filter((item) => item.scope === currentScope && groupTargets.includes(item.target)),
415
431
  ...placements,
416
432
  ];
417
- const userProviders = demand.placements.filter((item) => item.scope === 'user' && groupTargets.includes(item.target));
433
+ const userProviders = demand.placements.filter((item) => item.scope === 'user' && groupTargets.includes(item.target)
434
+ && !childPlacements.some((project) => project.scope === 'project' && project.pluginId === item.pluginId && project.target === item.target));
418
435
  const childDemand = { ...sourceDemand,
419
436
  targetRequirements: childPlacements.map((item) => ({ pluginId: item.pluginId, target: item.target })),
420
437
  userProviders: Object.fromEntries(groupTargets.map((target) => [target, userProviders
@@ -422,6 +439,7 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
422
439
  roots: [...new Map(childPlacements.map((item) => [item.pluginId, { pluginId: item.pluginId, sourceId: item.plugin.sourceId,
423
440
  sourceState: 'ready', blockers: [], plugin: item.plugin }])).values()] };
424
441
  const child = await prepareScopedRecovery(command === 'reinstall' ? 'reinstall' : 'sync', [...new Set(placements.map((item) => item.pluginId))], { ...options, scope: currentScope, targets: groupTargets, all: false,
442
+ sharedReferenceView,
425
443
  cwd: snapshot.context.projectRoot ?? options.cwd, demandOverride: childDemand,
426
444
  exactTargets: placements.map((item) => ({ pluginId: item.pluginId, agent: item.target })),
427
445
  nativeActivationOnlyTargets: activationOnlyTargets.filter((item) => item.scope === currentScope
@@ -433,7 +451,7 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
433
451
  .map((item) => ({ pluginId: item.pluginId, platform: 'codex', scope: 'user' })) : [],
434
452
  excludedPluginIds: currentScope === 'project' ? userProviders.map((item) => item.pluginId) : [],
435
453
  dependencyScopeOverrides: currentScope === 'project'
436
- ? userProviders.filter((provider) => (provider.target === 'codex' || provider.target === 'claude')
454
+ ? userProviders.filter((provider) => provider.target !== 'generic'
437
455
  && !placements.some((item) => item.pluginId === provider.pluginId && item.target === provider.target))
438
456
  .map((item) => ({ pluginId: item.pluginId, platform: item.target, scope: 'user' })) : [],
439
457
  }, runtime);
@@ -459,6 +477,11 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
459
477
  if (left.child.options.scope === right.child.options.scope || left.target.agent !== right.target.agent
460
478
  || left.target.skill !== right.target.skill)
461
479
  continue;
480
+ if (left.target.providerPluginId === right.target.providerPluginId
481
+ && left.prepared.logicalIdentity !== '' && left.prepared.logicalIdentity === right.prepared.logicalIdentity
482
+ && left.target.physicalPath !== right.target.physicalPath
483
+ && [left, right].every((item) => item.target.observation === 'absent' || item.target.ownership === 'aw'))
484
+ continue;
462
485
  const conflict = diagnostic('crossScopeSkillCollision', `${left.target.providerPluginId}@${left.child.options.scope} (${left.target.physicalPath}) 与 ${right.target.providerPluginId}@${right.child.options.scope} (${right.target.physicalPath}) 占用同一 Agent Skill 名。`);
463
486
  for (const item of [left, right]) {
464
487
  item.child.receipt.targetResults.find((target) => target.pluginId === item.prepared.options.selector && target.agent === item.target.agent)?.blockers.push(conflict);
@@ -471,7 +494,7 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
471
494
  const scopedExtensions = (backend?.live?.components ?? backend?.components ?? []).some((component) => component.kind === 'ownership' && component.key !== 'native'
472
495
  && !component.key.startsWith('activation-') && !component.key.startsWith('marketplace-')
473
496
  && ['present', 'partial'].includes(component.state));
474
- if (item.scope !== 'project' || (item.agent !== 'codex' && item.agent !== 'claude'))
497
+ if (item.scope !== 'project' || !item.agent || !['codex', 'claude', 'gemini', 'copilot'].includes(item.agent))
475
498
  return false;
476
499
  return demand.placements.some((placement) => {
477
500
  if (placement.pluginId !== item.pluginId || placement.target !== item.agent)
@@ -499,10 +522,12 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
499
522
  const retire = currentStatus.extraObserved.filter((item) => item.agent !== null && !requiredNativeActivation(item) && (options.retireUnselectedTargets && (!snapshot.preferences.targets.includes(item.agent)
500
523
  || snapshot.preferences.exclusions.some((entry) => entry.plugin === item.pluginId && entry.target === item.agent))
501
524
  || command === 'uninstall' && explicitlyRemoves(item)
502
- || selected.some((placement) => placement.pluginId === item.pluginId && placement.target === item.agent && placement.scope !== item.scope
525
+ || selected.some((placement) => canReuseProviderAcrossScopes(placement.target)
526
+ && placement.pluginId === item.pluginId && placement.target === item.agent && placement.scope !== item.scope
503
527
  && (item.delivery?.kind !== 'agent-skills' || item.backend?.logicalIdentity === placement.plugin.catalogLogicalIdentity))));
504
528
  for (const item of currentStatus.observedTargets ?? []) {
505
- if (ownsOutput(item) && !requiredNativeActivation(item) && selected.some((placement) => placement.pluginId === item.pluginId
529
+ if (ownsOutput(item) && !requiredNativeActivation(item) && selected.some((placement) => canReuseProviderAcrossScopes(placement.target)
530
+ && placement.pluginId === item.pluginId
506
531
  && placement.target === item.agent && placement.scope !== item.scope)
507
532
  && !demand.placements.some((placement) => placement.pluginId === item.pluginId
508
533
  && placement.target === item.agent && placement.scope === item.scope))
@@ -523,28 +548,11 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
523
548
  continue;
524
549
  retire.push(item);
525
550
  }
526
- // Conflicting replacements are filtered before child preparation. Keep the
527
- // affected plugins' old outputs even when that leaves no deployment child.
528
- const blockedReplacementPlugins = new Set(demand.conflicts.flatMap((conflict) => [...conflict.left.plugins, ...conflict.right.plugins]));
529
- const safeRetirements = retire.filter((item) => !blockedReplacementPlugins.has(item.pluginId));
530
- const retiringKeys = new Set(safeRetirements.map((item) => `${item.pluginId}\0${item.agent}\0${item.scope}`));
531
- const remainingPositions = currentStatus.extraObserved.filter((item) => item.agent !== null
532
- && !retiringKeys.has(`${item.pluginId}\0${item.agent}\0${item.scope}`))
533
- .map((item) => ({ pluginId: item.pluginId, target: item.agent, scope: item.scope }));
534
- const remainingConflicts = findPlacementConflicts([...demand.placements, ...remainingPositions]);
535
- if (remainingConflicts.length) {
536
- plan.receipt.blockers.push(...remainingConflicts);
537
- for (const child of children)
538
- for (const target of child.receipt.targetResults) {
539
- if (remainingConflicts.some((conflict) => [conflict.left, conflict.right].some((position) => position.target === target.agent && position.scope === target.scope)))
540
- target.blockers.push(diagnostic('targetPlacementConflict'));
541
- }
542
- }
543
551
  const deploymentBlocked = children.some((child) => child.blockExecution
544
552
  || child.receipt.targetResults.some((item) => item.blockers.length));
545
553
  if (!plan.blockExecution && !deploymentBlocked) {
546
554
  const cleanups = [];
547
- const pendingRetirements = [...new Map(safeRetirements.map((entry) => [`${entry.pluginId}\0${entry.agent}\0${entry.scope}`, entry])).values()];
555
+ const pendingRetirements = [...new Map(retire.map((entry) => [`${entry.pluginId}\0${entry.agent}\0${entry.scope}`, entry])).values()];
548
556
  const orderedRetirements = [];
549
557
  while (pendingRetirements.length) {
550
558
  const ready = pendingRetirements.findIndex((candidate) => !pendingRetirements.some((consumer) => consumer !== candidate && consumer.agent === candidate.agent
@@ -562,6 +570,7 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
562
570
  demand.placements.filter((placement) => placement.scope === 'user' && placement.target === target)
563
571
  .map((placement) => placement.pluginId)])), } : snapshot.user;
564
572
  const cleanup = await prepareScopedRecovery('cleanup', [item.pluginId], { ...options,
573
+ sharedReferenceView,
565
574
  scope: item.scope, cwd: snapshot.context.projectRoot ?? options.cwd, targets: [item.agent], all: false,
566
575
  // Ordinary remove's force bypasses dependencies, never ownership checks.
567
576
  force: false, exactTargets: undefined, demandOverride: cleanupDemand }, runtime);
@@ -577,6 +586,49 @@ async function prepareJointRecoveryInSession(command, selectors, options, runtim
577
586
  }
578
587
  children.unshift(...cleanups);
579
588
  }
589
+ // The first preview already seals every target in its native group. A lone
590
+ // Gemini/Copilot ensure group has no later sibling contribution to refresh here.
591
+ const onlyChild = children.length === 1 ? children[0] : undefined;
592
+ const onlyGroup = onlyChild?.nativeGroups.length === 1 ? onlyChild.nativeGroups[0] : undefined;
593
+ const singleNativePreviewComplete = !plan.blockExecution && onlyChild !== undefined && !onlyChild.blockExecution
594
+ && onlyChild.command === 'sync' && (onlyGroup?.platform === 'gemini' || onlyGroup?.platform === 'copilot')
595
+ && onlyGroup.command === 'sync'
596
+ && onlyGroup.preview.operationPlan !== undefined
597
+ && (onlyGroup.preview.operationPlan.deploymentPlans?.length ?? 0) > 0
598
+ && onlyGroup.preview.operationPlan.deploymentPlans.every((deployment) => deployment.operation === 'ensure')
599
+ && onlyChild.receipt.targetResults.length > 0
600
+ && onlyChild.receipt.targetResults.every((target) => target.blockers.length === 0)
601
+ && onlyChild.portableGroups.length === 0 && onlyChild.portableProtectionGroups.length === 0
602
+ && onlyChild.portableResidues.length === 0;
603
+ // Other scopes and groups can change shared descriptors, preApply actions
604
+ // or retained packages. Refresh those previews before exposing Review.
605
+ if (!singleNativePreviewComplete)
606
+ for (const child of children)
607
+ await refreshRecoveryNativePreviews(child);
608
+ const preparedNativeTargets = children.flatMap((child) => child.receipt.targetResults)
609
+ .filter((target) => target.delivery?.kind === 'native');
610
+ const failedProviders = preparedNativeTargets.filter((target) => target.blockers.length > 0);
611
+ for (const target of preparedNativeTargets) {
612
+ const placement = demand.placements.find((item) => item.pluginId === target.pluginId
613
+ && item.target === target.agent && item.scope === target.scope);
614
+ if (!placement)
615
+ continue;
616
+ for (const provider of failedProviders) {
617
+ if (provider === target || provider.agent !== target.agent)
618
+ continue;
619
+ const dependency = demand.placements.find((item) => item.pluginId === provider.pluginId
620
+ && item.target === provider.agent && item.scope === provider.scope);
621
+ if (!dependency?.contributions.some((contribution) => placement.contributions.some((parent) => parent.root === contribution.root && parent.scope === contribution.scope
622
+ && parent.path.length < contribution.path.length
623
+ && parent.path.every((pluginId, index) => pluginId === contribution.path[index]))))
624
+ continue;
625
+ for (const blocker of provider.blockers)
626
+ if (!target.blockers.some((entry) => entry.code === blocker.code && entry.pluginId === provider.pluginId)) {
627
+ target.blockers.push({ ...blocker, pluginId: provider.pluginId });
628
+ }
629
+ }
630
+ }
631
+ finalizePreparedPlatformRebuildSession(runtime.preparedArtifactRenderResults);
580
632
  plan.sourceRefreshes = [...new Map(children.flatMap((child) => child.sourceRefreshes).map((item) => [item.sourceId, item])).values()];
581
633
  plan.sourceRefreshFailures = [...new Map(children.flatMap((child) => child.sourceRefreshFailures).map((item) => [item.sourceId, item])).values()];
582
634
  plan.changes.push(...children.flatMap((child) => child.changes));
@@ -678,7 +730,7 @@ export async function executeJointRecovery(plan, execution) {
678
730
  if (!joint.originalOptions.existingOnly)
679
731
  child.demand.intent = currentIntent;
680
732
  const fresh = await measureRecoveryPerformanceStage(runtime, 'recovery.child.plan', () => prepareScopedRecovery(child.command, typeof pluginIds === 'string' ? [pluginIds] : pluginIds, {
681
- ...child.options, targets: agent === 'codex' || agent === 'claude' ? child.options.targets : [agent], all: false,
733
+ ...child.options, targets: agent !== 'generic' ? child.options.targets : [agent], all: false,
682
734
  exactTargets: child.options.exactTargets?.filter((target) => (typeof pluginIds === 'string' ? [pluginIds] : pluginIds).includes(target.pluginId)),
683
735
  }, runtime));
684
736
  fresh.originalIntent = observationEvidence(currentIntent);
@@ -693,10 +745,12 @@ export async function executeJointRecovery(plan, execution) {
693
745
  target.blockers.push(...(reviewed?.blockers ?? []).filter((error) => reviewed?.execution === 'failed'
694
746
  || ['configApplyRequiresExistingOutput', 'crossScopeSkillCollision', 'targetPlacementConflict',
695
747
  'preApplyAuthorizationRequired', 'nativeToolAuthorizationRequired', 'providerSwitchPreApplyFailed', 'dependencyStillRequired'].includes(error.code)));
696
- if (reviewed?.execution === 'failed')
748
+ if (reviewed?.execution === 'failed') {
697
749
  target.execution = 'failed';
698
- if (child.command !== 'cleanup' && failedCleanups.some((failed) => targetsConflict({ target: failed.agent, scope: failed.scope }, { target: target.agent, scope: target.scope })
699
- || failed.agent === target.agent && (failed.pluginId === target.pluginId || joint.demand.roots.some((root) => root.pluginId === target.pluginId && root.target === target.agent && root.dependencies.includes(failed.pluginId))))) {
750
+ if (reviewed.backend)
751
+ target.backend = reviewed.backend;
752
+ }
753
+ if (child.command !== 'cleanup' && failedCleanups.some((failed) => failed.agent === target.agent && (failed.pluginId === target.pluginId || joint.demand.roots.some((root) => root.pluginId === target.pluginId && root.target === target.agent && root.dependencies.includes(failed.pluginId))))) {
700
754
  target.blockers.push(diagnostic('providerSwitchCleanupFailed'));
701
755
  }
702
756
  const dependencies = joint.demand.placements.filter((placement) => placement.target === target.agent
@@ -731,6 +785,10 @@ export async function executeJointRecovery(plan, execution) {
731
785
  const replacementFailures = new Set();
732
786
  for (const child of joint.children.filter((child) => child.command !== 'cleanup')) {
733
787
  for (const target of child.receipt.targetResults) {
788
+ if (replacementFailures.has(`${target.pluginId}\0${target.agent}`)) {
789
+ target.blockers.push(diagnostic('dependencyApplyFailed'));
790
+ continue;
791
+ }
734
792
  if (child.options.nativeActivationOnlyTargets?.some((item) => item.pluginId === target.pluginId
735
793
  && item.platform === target.agent && item.scope === target.scope))
736
794
  continue;
@@ -789,7 +847,7 @@ export async function executeJointRecovery(plan, execution) {
789
847
  for (const target of child.receipt.requestedTargets)
790
848
  nodeFor(target.pluginId, target.scope).targets.push({ child, agent: target.agent });
791
849
  }
792
- const hasNative = (node) => node.targets.some(({ agent }) => agent === 'codex' || agent === 'claude');
850
+ const hasNative = (node) => node.targets.some(({ agent }) => agent !== 'generic');
793
851
  for (const target of packages?.targets ?? []) {
794
852
  const sameScope = nodes.get(`${target.pluginId}\0${target.scope}`);
795
853
  const native = sameScope && hasNative(sameScope) ? sameScope
@@ -799,15 +857,17 @@ export async function executeJointRecovery(plan, execution) {
799
857
  }
800
858
  for (const node of nodes.values()) {
801
859
  for (const { agent } of node.targets) {
802
- const plugin = joint.demand.placements.find((item) => item.pluginId === node.pluginId && item.target === agent)?.plugin;
860
+ const plugin = joint.demand.placements.find((item) => item.pluginId === node.pluginId && item.target === agent && item.scope === node.scope)?.plugin;
803
861
  for (const name of plugin?.manifest.dependencies ?? []) {
804
862
  const pluginId = `${plugin.sourceId}/${name}`;
805
- const provider = joint.demand.placements.find((item) => item.pluginId === pluginId && item.target === agent);
863
+ const providers = joint.demand.placements.filter((item) => item.pluginId === pluginId && item.target === agent);
864
+ const provider = providers.find((item) => item.scope === node.scope) ?? providers.find((item) => item.scope === 'user');
806
865
  if (provider)
807
866
  node.dependencies.add(`${pluginId}\0${provider.scope}`);
808
867
  }
809
868
  }
810
- if (node.scope === 'project' && nodes.has(`${node.pluginId}\0user`))
869
+ if (node.scope === 'project' && node.targets.some(({ agent }) => ['codex', 'claude', 'gemini', 'copilot'].includes(agent))
870
+ && nodes.has(`${node.pluginId}\0user`))
811
871
  node.dependencies.add(`${node.pluginId}\0user`);
812
872
  for (const dependency of node.packages?.flatMap((item) => item.dependencies) ?? []) {
813
873
  for (const provider of nodes.values())
@@ -852,7 +912,7 @@ export async function executeJointRecovery(plan, execution) {
852
912
  };
853
913
  while (pending.length) {
854
914
  const index = pending.findIndex((node) => {
855
- const groups = node.targets.filter(({ child, agent }) => (agent === 'codex' || agent === 'claude') && !executedNativeChildren.has(child));
915
+ const groups = node.targets.filter(({ child, agent }) => agent !== 'generic' && !executedNativeChildren.has(child));
856
916
  const members = new Set([node, ...groups.flatMap(({ child }) => pending.filter((candidate) => candidate.targets.some((target) => target.child === child)))]);
857
917
  return [...members].every((member) => [...member.dependencies].every((key) => !pending.some((candidate) => !members.has(candidate) && `${candidate.pluginId}\0${candidate.scope}` === key)));
858
918
  });
@@ -891,7 +951,7 @@ export async function executeJointRecovery(plan, execution) {
891
951
  }
892
952
  }
893
953
  for (const { child, agent } of node.targets) {
894
- const native = agent === 'codex' || agent === 'claude';
954
+ const native = agent !== 'generic';
895
955
  if (native && executedNativeChildren.has(child))
896
956
  continue;
897
957
  if (native)