@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
@@ -0,0 +1,338 @@
1
+ import type { ComponentKind, PluginComponent, PlatformId, PlatformCapabilitiesV1, ResolvedInvocationPolicy, ExpectedComponentSet, ComponentGap } from '@lesliechan721/aw-plugin-core/manifest';
2
+ import type { Diagnostic, ProductInstallation, DiscoveryResult, ReadContext } from './discovery.js';
3
+ import type { VerifiedResourceClosure } from '../utils/component-resources.js';
4
+ export type { PlatformId, ComponentKind, ExpectedComponentSet, ComponentGap, ResolvedInvocationPolicy } from '@lesliechan721/aw-plugin-core/manifest';
5
+ export type { Diagnostic, ProductInstallation, HostEntry, DiscoveryResult, ReadContext, Availability } from './discovery.js';
6
+ export type { VerifiedResourceClosure } from '../utils/component-resources.js';
7
+ export type ScopeRef = {
8
+ kind: 'user';
9
+ } | {
10
+ kind: 'project';
11
+ projectRoot: string;
12
+ };
13
+ export interface PluginIdentity {
14
+ sourceId: string;
15
+ sourceIdentity: string;
16
+ pluginId: string;
17
+ version: string;
18
+ }
19
+ export interface DeploymentBinding {
20
+ id: string;
21
+ plugin: PluginIdentity;
22
+ platform: PlatformId;
23
+ scope: ScopeRef;
24
+ route: InstallRoute;
25
+ consumers: ProductInstallation[];
26
+ physicalKey: string;
27
+ activationKey: string;
28
+ renderUnitIds: string[];
29
+ }
30
+ export interface RenderUnit {
31
+ id: string;
32
+ physicalKey: string;
33
+ renderScope: ScopeRef;
34
+ output: 'package' | 'supplement' | 'generic';
35
+ kinds: ComponentKind[];
36
+ consumers: ProductInstallation[];
37
+ }
38
+ export type InstallRoute = 'codex-marketplace' | 'claude-marketplace' | 'cursor-workspace-hook' | 'antigravity-cli' | 'antigravity-directory' | 'opencode-directory' | 'pi-package' | 'gemini-extension' | 'copilot-marketplace' | 'grok-cli' | 'grok-directory' | 'generic-skills';
39
+ export interface PhysicalIdentity {
40
+ sourceIdentity: string;
41
+ pluginId: string;
42
+ platform: PlatformId;
43
+ route: InstallRoute;
44
+ namespaceRoot: string;
45
+ resourceKey: string;
46
+ }
47
+ export interface AgentPluginAdapter<P> {
48
+ readonly platform: PlatformId;
49
+ discover(ctx: ReadContext): Promise<DiscoveryResult>;
50
+ resolve(ctx: ReadContext, request: ResolveRequest): Promise<Resolution>;
51
+ inspect(ctx: ReadContext, binding: DeploymentBinding): Promise<DeploymentObservation>;
52
+ capabilities(input: CapabilityInput): PlatformCapabilitiesV1;
53
+ project(ctx: StageContext, input: ProjectionInput): Promise<ProjectionResult>;
54
+ lifecycle: {
55
+ prepare(input: LifecyclePrepareInput): PrepareResult<P>;
56
+ execute(ctx: MutationContext, prepared: PreparedDeployment<P>): Promise<DeploymentReceipt>;
57
+ };
58
+ }
59
+ export interface ResolveRequest {
60
+ plugin: PluginIdentity;
61
+ scope: ScopeRef;
62
+ operation: LifecycleOperation;
63
+ discovery: DiscoveryResult;
64
+ recoveryCandidates: RecoveryCandidate[];
65
+ }
66
+ export interface Resolution {
67
+ bindings: DeploymentBinding[];
68
+ renderUnits: RenderUnit[];
69
+ exclusions: Array<{
70
+ productId: string | null;
71
+ reasonCode: string;
72
+ }>;
73
+ diagnostics: Diagnostic[];
74
+ }
75
+ /** Identified products excluded from this operation; missing products are not requirements. */
76
+ export interface DeploymentExclusion {
77
+ platform: PlatformId;
78
+ pluginId: string;
79
+ scope: ScopeRef;
80
+ productId: string;
81
+ product: ProductInstallation | null;
82
+ reasonCode: string;
83
+ execution: 'not-run';
84
+ recoveryActions: string[];
85
+ }
86
+ export type LifecycleOperation = 'ensure' | 'reinstall' | 'remove' | 'cleanup';
87
+ export interface CapabilityInput {
88
+ binding: DeploymentBinding;
89
+ renderUnit: RenderUnit;
90
+ observation: DeploymentObservation;
91
+ profile: QualifiedPlatformProfile;
92
+ }
93
+ export interface ProjectionInput {
94
+ binding: DeploymentBinding;
95
+ renderUnit: RenderUnit;
96
+ capabilities: PlatformCapabilitiesV1;
97
+ components: PluginComponent[];
98
+ policy: ResolvedInvocationPolicy;
99
+ resources: VerifiedResourceClosure;
100
+ }
101
+ export interface ProjectionResult {
102
+ renderUnitId: string;
103
+ bundle: {
104
+ stagingRoot: string;
105
+ contentDigest: string;
106
+ } | null;
107
+ supplements: HostContribution[];
108
+ components: Array<{
109
+ id: string;
110
+ nativeName: string;
111
+ relativeOutputs: string[];
112
+ }>;
113
+ diagnostics: Diagnostic[];
114
+ }
115
+ export interface HostContribution {
116
+ id: string;
117
+ componentIds: string[];
118
+ kind: 'owned-file' | 'owned-directory' | 'config-entry';
119
+ destination: string;
120
+ contentDigest: string;
121
+ stagingPath: string;
122
+ mergeKey?: string;
123
+ }
124
+ export interface LifecyclePrepareInput {
125
+ operation: LifecycleOperation;
126
+ binding: DeploymentBinding;
127
+ observation: DeploymentObservation;
128
+ projections: ProjectionResult[];
129
+ expected: ExpectedComponentSet;
130
+ evidence: PreparationEvidence;
131
+ }
132
+ export type PrepareResult<P> = {
133
+ status: 'ready';
134
+ prepared: PreparedDeployment<P>;
135
+ } | {
136
+ status: 'blocked';
137
+ diagnostics: Diagnostic[];
138
+ };
139
+ export interface PreparedDeployment<P> {
140
+ readonly plan: FrozenDeploymentPlan;
141
+ readonly driverState: P;
142
+ }
143
+ export interface FrozenDeploymentPlan {
144
+ binding: DeploymentBinding;
145
+ operation: LifecycleOperation;
146
+ expected: ExpectedComponentSet;
147
+ projections: ProjectionResult[];
148
+ effects: PlannedEffect[];
149
+ evidence: PreparationEvidence;
150
+ }
151
+ export interface PlannedEffect {
152
+ id: string;
153
+ kind: 'publish-package' | 'register' | 'refresh' | 'activate' | 'deactivate' | 'unregister' | 'write-supplement' | 'remove-owned';
154
+ physicalKey: string;
155
+ activationKey?: string;
156
+ componentIds: string[];
157
+ destination: string;
158
+ destructive: boolean;
159
+ }
160
+ export type Presence = 'present' | 'absent' | 'unknown' | 'not-applicable';
161
+ export type Activation = 'enabled' | 'disabled' | 'blocked' | 'unknown' | 'not-applicable';
162
+ export interface DeploymentObservation {
163
+ /** Version read from the verified owned package descriptor; absence means unknown. */
164
+ packageVersion?: string;
165
+ /** Observed native installation bytes; absence does not confirm the installed content. */
166
+ nativePackageContentDigest?: string;
167
+ physicalKey: string;
168
+ package: Presence;
169
+ registration: Presence;
170
+ ownership: 'aw' | 'foreign' | 'shared' | 'unknown' | 'absent';
171
+ consumers: Array<{
172
+ productId: string;
173
+ activationKey: string;
174
+ activation: Activation;
175
+ trust: 'trusted' | 'required' | 'blocked' | 'unknown' | 'not-applicable';
176
+ load: 'observed' | 'not-observed' | 'unknown' | 'not-applicable';
177
+ }>;
178
+ components: Array<{
179
+ id: string;
180
+ presence: Presence;
181
+ reasonCodes: string[];
182
+ }>;
183
+ nativeIdentity: NativeIdentity | null;
184
+ prerequisites: RuntimePrerequisites;
185
+ diagnostics: Diagnostic[];
186
+ }
187
+ export interface RuntimePrerequisites {
188
+ agentConsumers: {
189
+ observation: 'complete' | 'unknown';
190
+ candidates: AgentConsumerObservation[];
191
+ configurationEvidence?: string;
192
+ reasonCodes: string[];
193
+ };
194
+ nativeSources?: {
195
+ observation: 'complete' | 'unknown';
196
+ configurationEvidence: string;
197
+ sources: Array<{
198
+ name: string;
199
+ version: string | null;
200
+ path: string;
201
+ scope: string;
202
+ origin: 'native' | 'compatibility' | 'unknown';
203
+ enabled: boolean | null;
204
+ effectiveComponents: string[];
205
+ }>;
206
+ overlaps: string[];
207
+ };
208
+ }
209
+ export interface AgentConsumerObservation {
210
+ productId: string;
211
+ id: string;
212
+ version: string | null;
213
+ scope: ScopeRef;
214
+ enabled: 'yes' | 'no' | 'unknown';
215
+ trust: 'trusted' | 'required' | 'blocked' | 'unknown';
216
+ packageAccess: 'allowed' | 'denied' | 'unknown';
217
+ settings: {
218
+ promptMode: 'host-default' | 'append' | 'replace' | 'unknown';
219
+ loadExtensions: 'yes' | 'no' | 'host-default' | 'unknown';
220
+ };
221
+ configurationEvidence: string;
222
+ reasonCodes: string[];
223
+ }
224
+ export interface NativeIdentity {
225
+ route: InstallRoute;
226
+ packageId: string;
227
+ registrationId?: string;
228
+ sourceLocation: string;
229
+ }
230
+ export interface DeploymentReceipt {
231
+ bindingId: string;
232
+ effects: Array<{
233
+ id: string;
234
+ status: 'applied' | 'unchanged' | 'blocked' | 'failed' | 'unknown' | 'skipped';
235
+ mutation: 'none' | 'confirmed' | 'possible';
236
+ diagnostics: Diagnostic[];
237
+ }>;
238
+ after: DeploymentObservation;
239
+ unmet: ComponentGap[];
240
+ reload: 'none' | 'new-session' | 'workspace-reload' | 'host-restart' | 'unknown';
241
+ diagnostics: Diagnostic[];
242
+ }
243
+ export interface StageContext extends ReadContext {
244
+ stagingRoot: string;
245
+ commandResolver?: import('../generators/permissions.js').CommandReferenceResolver;
246
+ }
247
+ export interface RecoveryCandidate {
248
+ binding: DeploymentBinding;
249
+ physicalIdentity: PhysicalIdentity;
250
+ nativeIdentity: NativeIdentity | null;
251
+ evidence: 'verified' | 'unknown';
252
+ }
253
+ export interface QualifiedPlatformProfile {
254
+ id: string;
255
+ platform: PlatformId;
256
+ /** Qualification is explicit per capability; a version match alone grants none. */
257
+ kinds: PlatformCapabilitiesV1['kinds'];
258
+ features: PlatformCapabilitiesV1['features'];
259
+ qualifiedConsumers?: Partial<Record<ComponentKind, Array<{
260
+ product: ProductInstallation['product'];
261
+ version: string;
262
+ }>>>;
263
+ /** Recorded scope limits apply to both runtime and authoring kind views. */
264
+ qualificationEvidence?: Array<{
265
+ reference: string;
266
+ product: ProductInstallation['product'];
267
+ version: string;
268
+ platform: NodeJS.Platform;
269
+ arch: NodeJS.Architecture;
270
+ scopes: Array<ScopeRef['kind']>;
271
+ kinds: ComponentKind[];
272
+ features: string[];
273
+ limitations: string[];
274
+ }>;
275
+ agentConsumers: Array<{
276
+ id: string;
277
+ minimumVersion: string;
278
+ promptModes: Array<'host-default' | 'append' | 'replace'>;
279
+ qualified: boolean;
280
+ features: PlatformCapabilitiesV1['features'];
281
+ }>;
282
+ }
283
+ export interface DeploymentLayoutEvidence {
284
+ packageRoot: string;
285
+ activationPath: string;
286
+ supplementRoot: string | null;
287
+ marketplaceRoot: string | null;
288
+ marketplaceName: string | null;
289
+ }
290
+ export interface PreparationEvidence {
291
+ fingerprint: string;
292
+ managedCommandReview?: import('../utils/managed-command-review.js').ManagedCommandReviewEvidence;
293
+ marketplace?: {
294
+ files: Array<{
295
+ relativePath: string;
296
+ contentBase64: string;
297
+ contentDigest: string;
298
+ }>;
299
+ fingerprint: string;
300
+ };
301
+ layout: DeploymentLayoutEvidence;
302
+ renderUnits?: RenderUnit[];
303
+ ownership: Array<{
304
+ component: import('../utils/ownership.js').OwnedComponent;
305
+ state: 'present' | 'partial' | 'absent' | 'foreign' | 'error';
306
+ contentDigest?: string;
307
+ physicalKey?: string;
308
+ }>;
309
+ sharedReferences: 'none' | 'present' | 'unknown';
310
+ retainPackage?: boolean;
311
+ nativeIdentity: NativeIdentity | null;
312
+ contentMatches: boolean;
313
+ userActivationEnabled?: boolean | 'unknown';
314
+ }
315
+ export interface MutationOutcome {
316
+ mutation: 'none' | 'confirmed' | 'possible';
317
+ changed: boolean;
318
+ }
319
+ export interface MutationContext extends ReadContext {
320
+ /** One explicit CLI grant for this exact frozen Gemini plan; never persisted or inferred. */
321
+ geminiNativeConsent?: FrozenDeploymentPlan;
322
+ /** Operation-local receipts for native actions on a shared registration. */
323
+ nativeEffects?: Map<string, Promise<MutationOutcome>>;
324
+ /** Checked Gemini configuration baseline, rebased only after this operation's writes. */
325
+ geminiActivationSnapshot?: {
326
+ path: string;
327
+ contentDigest: string | null;
328
+ };
329
+ services: {
330
+ verifyEvidence(plan: FrozenDeploymentPlan): Promise<boolean>;
331
+ publishPackage(binding: DeploymentBinding, bundle: NonNullable<ProjectionResult['bundle']>, destination: string, component: import('../utils/ownership.js').OwnedComponent): Promise<MutationOutcome>;
332
+ writeContribution(binding: DeploymentBinding, contribution: HostContribution, component: import('../utils/ownership.js').OwnedComponent): Promise<MutationOutcome>;
333
+ removeOwned(binding: DeploymentBinding, component: import('../utils/ownership.js').OwnedComponent): Promise<MutationOutcome>;
334
+ setActivation(binding: DeploymentBinding, identity: NativeIdentity, enabled: boolean): Promise<MutationOutcome>;
335
+ registerMarketplace(binding: DeploymentBinding, identity: NativeIdentity): Promise<MutationOutcome>;
336
+ };
337
+ inspect?: (binding: DeploymentBinding) => Promise<DeploymentObservation>;
338
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/platforms/contracts.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import type { Scope } from '../types.js';
2
+ export interface CursorWorkspaceHookResult {
3
+ pluginPaths: string[];
4
+ }
5
+ export interface CursorWorkspaceHookOptions {
6
+ scope: Scope;
7
+ projectRoot?: string;
8
+ pluginId?: string;
9
+ cwd: string;
10
+ env?: NodeJS.ProcessEnv;
11
+ signal?: AbortSignal;
12
+ }
13
+ /** Host loader: reads current demand and exact package ownership, without probes, rendering, or writes. */
14
+ export declare function cursorWorkspaceOpen(input: unknown, options: CursorWorkspaceHookOptions): Promise<CursorWorkspaceHookResult>;
15
+ /** Internal host protocol deliberately emits the Cursor Hook object, without the AW result envelope. */
16
+ export declare function runCursorWorkspaceHookCli(args: readonly string[], options: {
17
+ cwd: string;
18
+ env?: NodeJS.ProcessEnv;
19
+ stdin: NodeJS.ReadableStream;
20
+ stdout(text: string): void;
21
+ stderr(text: string): void;
22
+ }): Promise<number>;
@@ -0,0 +1,185 @@
1
+ import path from 'node:path';
2
+ import fs from 'fs-extra';
3
+ import { readDemand } from '../recovery/demand.js';
4
+ import { canonicalPluginId } from '../intent/intent-codec.js';
5
+ import { resolvePluginMetaDependencyClosure } from '../utils/plugin-dependencies.js';
6
+ import { supportsPlatform } from '../utils/platform-support.js';
7
+ import { readSkillOwnerMarker, SKILL_OWNER_MARKER } from '../utils/ownership.js';
8
+ import { assertSafeFileMutationPath } from '../utils/safe-fs.js';
9
+ import { assertTestReadablePath } from '../utils/test-path-fence.js';
10
+ import { resolveUserHome } from '../utils/state-paths.js';
11
+ import { getDeploymentResourceKey, resolveCursorPackageRoot } from './layout.js';
12
+ import { canonicalNamespaceRoot, getPhysicalKey } from './identity.js';
13
+ import { resolvePlatformConfigRoot } from './discovery.js';
14
+ function requiredPlugins(demand) {
15
+ if (demand.preferences.state !== 'valid' || !demand.preferences.value.targets.includes('cursor'))
16
+ return [];
17
+ const excluded = new Set(demand.preferences.value.exclusions.filter((item) => item.target === 'cursor').map((item) => item.plugin));
18
+ const selected = new Map();
19
+ for (const root of demand.roots ?? []) {
20
+ if (!root.plugin || root.blockers.length || root.sourceState !== 'ready' || excluded.has(root.pluginId))
21
+ continue;
22
+ try {
23
+ const closure = resolvePluginMetaDependencyClosure(demand.plugins.filter((plugin) => plugin.sourceId === root.sourceId), [root.plugin.manifest.name]);
24
+ if (closure.some((plugin) => !supportsPlatform(plugin.manifest, 'cursor') || !plugin.pluginId || excluded.has(plugin.pluginId)))
25
+ continue;
26
+ for (const plugin of closure)
27
+ selected.set(plugin.pluginId, plugin);
28
+ }
29
+ catch { /* An unreadable dependency does not authorize loading a partial root. */ }
30
+ }
31
+ return [...selected.values()];
32
+ }
33
+ async function workspaceRoots(input) {
34
+ if (!input || typeof input !== 'object' || Array.isArray(input))
35
+ throw new Error('cursorHookInputInvalid');
36
+ const roots = input.workspace_roots;
37
+ if (roots === undefined)
38
+ return [];
39
+ if (!Array.isArray(roots) || roots.length > 64 || roots.some((root) => typeof root !== 'string' || !path.isAbsolute(root) || root.includes('\0'))) {
40
+ throw new Error('cursorHookInputInvalid');
41
+ }
42
+ const canonical = [];
43
+ for (const root of roots) {
44
+ assertTestReadablePath(root, 'Cursor Hook workspace', '使用隔离 workspace_roots。');
45
+ const stat = await fs.stat(root);
46
+ if (!stat.isDirectory())
47
+ throw new Error('cursorHookWorkspaceInvalid');
48
+ canonical.push(await fs.realpath(root));
49
+ }
50
+ return [...new Set(canonical)];
51
+ }
52
+ /** Host loader: reads current demand and exact package ownership, without probes, rendering, or writes. */
53
+ export async function cursorWorkspaceOpen(input, options) {
54
+ options.signal?.throwIfAborted();
55
+ const roots = await workspaceRoots(input);
56
+ if (!roots.length)
57
+ return { pluginPaths: [] };
58
+ let scope = { kind: 'user' };
59
+ let cwd = options.cwd;
60
+ if (options.scope === 'project') {
61
+ if (!options.projectRoot || !path.isAbsolute(options.projectRoot))
62
+ throw new Error('cursorHookProjectRootRequired');
63
+ const projectRoot = await fs.realpath(options.projectRoot);
64
+ if (!roots.includes(projectRoot))
65
+ return { pluginPaths: [] };
66
+ scope = { kind: 'project', projectRoot };
67
+ cwd = projectRoot;
68
+ }
69
+ else if (options.projectRoot !== undefined)
70
+ throw new Error('cursorHookArgumentsInvalid');
71
+ const demand = await readDemand({ scope: options.scope, cwd, env: options.env, signal: options.signal });
72
+ const ctx = { cwd, env: options.env, signal: options.signal };
73
+ const paths = new Set();
74
+ for (const plugin of requiredPlugins(demand)) {
75
+ options.signal?.throwIfAborted();
76
+ if (options.pluginId !== undefined && plugin.pluginId !== options.pluginId)
77
+ continue;
78
+ if (!plugin.pluginId || !plugin.sourceId || !plugin.sourceIdentity)
79
+ continue;
80
+ const identity = { pluginId: plugin.pluginId, sourceId: plugin.sourceId,
81
+ sourceIdentity: plugin.sourceIdentity, version: plugin.manifest.version };
82
+ const packageRoot = await resolveCursorPackageRoot(ctx, identity, scope);
83
+ const namespaceRoot = await canonicalNamespaceRoot(scope.kind === 'project' ? path.join(scope.projectRoot, '.cursor')
84
+ : resolvePlatformConfigRoot('cursor', ctx));
85
+ const physicalKey = getPhysicalKey({ sourceIdentity: identity.sourceIdentity, pluginId: identity.pluginId,
86
+ platform: 'cursor', route: 'cursor-workspace-hook', namespaceRoot, resourceKey: getDeploymentResourceKey(identity) });
87
+ const allowedRoot = scope.kind === 'project' ? scope.projectRoot : resolveUserHome(options.env ?? process.env);
88
+ try {
89
+ // Check the full scope path before reading a canonicalized package location.
90
+ const expectedPath = path.join(scope.kind === 'project' ? scope.projectRoot : allowedRoot, '.cursor', 'aw-plugins', getDeploymentResourceKey(identity));
91
+ if (packageRoot !== expectedPath)
92
+ continue;
93
+ await assertSafeFileMutationPath({ filePath: path.join(packageRoot, SKILL_OWNER_MARKER), allowedRoot, label: 'Cursor plugin owner' });
94
+ const marker = await readSkillOwnerMarker({ skillRoot: packageRoot, allowedRoot: path.dirname(packageRoot),
95
+ expectedIdentity: { owner: 'agent-workflows', sourceId: identity.sourceId, pluginId: identity.pluginId,
96
+ plugin: plugin.manifest.name, platform: 'cursor', scope: options.scope, artifactKey: path.basename(packageRoot),
97
+ sourceIdentity: identity.sourceIdentity, physicalKey } });
98
+ if (!marker || marker.sourceIdentity !== identity.sourceIdentity || marker.physicalKey !== physicalKey)
99
+ continue;
100
+ const manifestPath = path.join(packageRoot, '.cursor-plugin', 'plugin.json');
101
+ await assertSafeFileMutationPath({ filePath: manifestPath, allowedRoot: packageRoot, label: 'Cursor native manifest' });
102
+ const manifest = await fs.readJson(manifestPath);
103
+ if (manifest.name !== plugin.manifest.name)
104
+ continue;
105
+ paths.add(packageRoot);
106
+ }
107
+ catch { /* Missing, foreign, stale, and unknown packages remain unloaded. */ }
108
+ }
109
+ return { pluginPaths: [...paths].sort() };
110
+ }
111
+ async function readHookInput(stdin) {
112
+ return new Promise((resolve, reject) => {
113
+ const chunks = [];
114
+ let size = 0;
115
+ const finish = (error) => {
116
+ clearTimeout(timer);
117
+ stdin.removeListener('data', data);
118
+ stdin.removeListener('end', end);
119
+ stdin.removeListener('error', failed);
120
+ stdin.pause();
121
+ if (error)
122
+ reject(error);
123
+ else {
124
+ try {
125
+ resolve(JSON.parse(Buffer.concat(chunks).toString('utf8')));
126
+ }
127
+ catch {
128
+ reject(new Error('cursorHookInputInvalid'));
129
+ }
130
+ }
131
+ };
132
+ const data = (chunk) => {
133
+ const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
134
+ size += bytes.length;
135
+ if (size > 64 * 1024) {
136
+ finish(new Error('cursorHookInputTooLarge'));
137
+ return;
138
+ }
139
+ chunks.push(bytes);
140
+ };
141
+ const end = () => finish();
142
+ const failed = () => finish(new Error('cursorHookInputUnreadable'));
143
+ const timer = setTimeout(() => finish(new Error('cursorHookInputTimeout')), 5000);
144
+ stdin.on('data', data);
145
+ stdin.once('end', end);
146
+ stdin.once('error', failed);
147
+ });
148
+ }
149
+ /** Internal host protocol deliberately emits the Cursor Hook object, without the AW result envelope. */
150
+ export async function runCursorWorkspaceHookCli(args, options) {
151
+ let scope;
152
+ let projectRoot;
153
+ let pluginId;
154
+ try {
155
+ for (let index = 0; index < args.length; index += 2) {
156
+ const flag = args[index], value = args[index + 1];
157
+ if (flag === '--scope' && scope === undefined && (value === 'user' || value === 'project'))
158
+ scope = value;
159
+ else if (flag === '--project-root' && projectRoot === undefined && value && path.isAbsolute(value))
160
+ projectRoot = value;
161
+ else if (flag === '--plugin-id' && pluginId === undefined && value && canonicalPluginId(value) === value)
162
+ pluginId = value;
163
+ else
164
+ throw new Error('cursorHookArgumentsInvalid');
165
+ }
166
+ if (!scope || (scope === 'project') !== (projectRoot !== undefined))
167
+ throw new Error('cursorHookArgumentsInvalid');
168
+ }
169
+ catch {
170
+ options.stdout('{"pluginPaths":[]}\n');
171
+ options.stderr('cursorHookArgumentsInvalid: Use --scope user, or --scope project --project-root <absolute root>.\n');
172
+ return 2;
173
+ }
174
+ try {
175
+ const result = await cursorWorkspaceOpen(await readHookInput(options.stdin), { ...options, scope, projectRoot, pluginId });
176
+ options.stdout(`${JSON.stringify(result)}\n`);
177
+ return 0;
178
+ }
179
+ catch {
180
+ options.stdout('{"pluginPaths":[]}\n');
181
+ options.stderr('cursorHookUnavailable: The current workspace plugin paths could not be confirmed. Check AW requirements and package ownership.\n');
182
+ return 1;
183
+ }
184
+ }
185
+ //# sourceMappingURL=cursor-workspace-hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursor-workspace-hook.js","sourceRoot":"","sources":["../../../src/platforms/cursor-workspace-hook.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAuB,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,kCAAkC,EAAE,MAAM,iCAAiC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAoB,MAAM,gBAAgB,CAAC;AAa7E,SAAS,eAAe,CAAC,MAAsB;IAC7C,IAAI,MAAM,CAAC,WAAW,CAAC,KAAK,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,EAAE,CAAC;IAC5G,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,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AAC;IAC1D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;QAAC,OAAO,CAAC,MAAM,CAAC,kIAAkI,CAAC,CAAC;QAAC,OAAO,CAAC,CAAC;IACvM,CAAC;AACH,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { type PlatformTarget } from '@lesliechan721/aw-plugin-core';
2
+ import { type NativeCliInvocation, type NativeCliRunner } from '../utils/native-cli.js';
3
+ import type { Diagnostic } from '../output/public-result.js';
4
+ export type { Diagnostic } from '../output/public-result.js';
5
+ export type Availability = 'available' | 'missing' | 'unsupported' | 'unknown' | 'notApplicable';
6
+ export type HostEntry = {
7
+ kind: 'cli';
8
+ executable: string;
9
+ configRoot: string;
10
+ } | {
11
+ kind: 'directory';
12
+ configRoot: string;
13
+ } | {
14
+ kind: 'generic';
15
+ root: string;
16
+ };
17
+ export interface ProductInstallation {
18
+ id: string;
19
+ product: 'cli' | 'app' | 'generic';
20
+ version: string | null;
21
+ availability: Availability;
22
+ reasonCodes: string[];
23
+ entry: HostEntry | null;
24
+ }
25
+ export interface DiscoveryResult {
26
+ platform: PlatformTarget;
27
+ availability: Availability;
28
+ installations: ProductInstallation[];
29
+ diagnostics: Diagnostic[];
30
+ }
31
+ export interface ReadContext {
32
+ cwd: string;
33
+ env?: NodeJS.ProcessEnv;
34
+ platform?: NodeJS.Platform;
35
+ arch?: NodeJS.Architecture;
36
+ signal?: AbortSignal;
37
+ /** Replaces only external process probes, including OS identity queries. */
38
+ runner?: NativeCliRunner;
39
+ codexObservationSession?: import('../utils/codex-native-observation.js').CodexNativeObservationSession;
40
+ /** Explicit status observation may start the supported native app-server. */
41
+ observeNative?: boolean;
42
+ /** Isolated filesystem boundary for App discovery tests. */
43
+ macApplicationsDirectories?: readonly string[];
44
+ windowsApplicationsDirectories?: readonly string[];
45
+ linuxDesktopDirectories?: readonly string[];
46
+ }
47
+ export interface TargetAvailabilityView extends DiscoveryResult {
48
+ id: PlatformTarget;
49
+ displayName: string;
50
+ selected: boolean;
51
+ recovery: string[];
52
+ }
53
+ export declare const TARGET_DISPLAY_NAMES: {
54
+ readonly codex: "Codex";
55
+ readonly claude: "Claude Code";
56
+ readonly cursor: "Cursor";
57
+ readonly antigravity: "Antigravity";
58
+ readonly opencode: "OpenCode";
59
+ readonly pi: "Pi";
60
+ readonly gemini: "Gemini CLI";
61
+ readonly copilot: "GitHub Copilot CLI";
62
+ readonly grok: "Grok Build";
63
+ readonly generic: "Generic";
64
+ };
65
+ export declare function resolvePlatformConfigRoot(platform: PlatformTarget, ctx: ReadContext): string;
66
+ export declare function installationInvocation(product: ProductInstallation, ctx: ReadContext, args: string[]): Promise<NativeCliInvocation>;
67
+ export declare function discoverPlatform(platform: PlatformTarget, ctx: ReadContext): Promise<DiscoveryResult>;
68
+ export declare function discoverPlatforms(ctx: ReadContext): Promise<DiscoveryResult[]>;
69
+ export declare function targetAvailabilityViews(discovery: readonly DiscoveryResult[], selected: readonly PlatformTarget[]): TargetAvailabilityView[];
70
+ export declare function requiresTargetConfirmation(availability: Availability): boolean;
71
+ export declare class TargetSelectionConfirmationRequiredError extends Error {
72
+ readonly availability: TargetAvailabilityView[];
73
+ constructor(availability: TargetAvailabilityView[]);
74
+ }