@lesliechan721/aw 0.1.0-beta.10

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 (508) hide show
  1. package/dist/authoring/assets/aw-config.d.mts +51 -0
  2. package/dist/authoring/assets/aw-config.mjs +1025 -0
  3. package/dist/authoring/assets/aw-config.mjs.map +1 -0
  4. package/dist/authoring/scripts/add-skill.d.mts +2 -0
  5. package/dist/authoring/scripts/add-skill.mjs +355 -0
  6. package/dist/authoring/scripts/add-skill.mjs.map +1 -0
  7. package/dist/authoring/scripts/init-plugin.d.mts +2 -0
  8. package/dist/authoring/scripts/init-plugin.mjs +487 -0
  9. package/dist/authoring/scripts/init-plugin.mjs.map +1 -0
  10. package/dist/authoring/scripts/lib/javascript-import-scanner.d.mts +4 -0
  11. package/dist/authoring/scripts/lib/javascript-import-scanner.mjs +261 -0
  12. package/dist/authoring/scripts/lib/javascript-import-scanner.mjs.map +1 -0
  13. package/dist/authoring/scripts/lib/plugin-root.d.mts +26 -0
  14. package/dist/authoring/scripts/lib/plugin-root.mjs +125 -0
  15. package/dist/authoring/scripts/lib/plugin-root.mjs.map +1 -0
  16. package/dist/authoring/scripts/lib/plugin-version-check.d.mts +69 -0
  17. package/dist/authoring/scripts/lib/plugin-version-check.mjs +563 -0
  18. package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -0
  19. package/dist/authoring/scripts/lib/semver.d.mts +9 -0
  20. package/dist/authoring/scripts/lib/semver.mjs +63 -0
  21. package/dist/authoring/scripts/lib/semver.mjs.map +1 -0
  22. package/dist/authoring/scripts/lib/skill-scaffold.d.mts +111 -0
  23. package/dist/authoring/scripts/lib/skill-scaffold.mjs +353 -0
  24. package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -0
  25. package/dist/authoring/scripts/plugin-status.d.mts +2 -0
  26. package/dist/authoring/scripts/plugin-status.mjs +93 -0
  27. package/dist/authoring/scripts/plugin-status.mjs.map +1 -0
  28. package/dist/authoring/scripts/remove-plugin.d.mts +2 -0
  29. package/dist/authoring/scripts/remove-plugin.mjs +367 -0
  30. package/dist/authoring/scripts/remove-plugin.mjs.map +1 -0
  31. package/dist/authoring/scripts/validate-plugin.d.mts +2 -0
  32. package/dist/authoring/scripts/validate-plugin.mjs +3465 -0
  33. package/dist/authoring/scripts/validate-plugin.mjs.map +1 -0
  34. package/dist/authoring/scripts/validate-skill.d.mts +2 -0
  35. package/dist/authoring/scripts/validate-skill.mjs +126 -0
  36. package/dist/authoring/scripts/validate-skill.mjs.map +1 -0
  37. package/dist/authoring/templates/aw-config-runtime.d.mts +2 -0
  38. package/dist/authoring/templates/aw-config-runtime.mjs +407 -0
  39. package/dist/authoring/templates/aw-config-runtime.mjs.map +1 -0
  40. package/dist/index.d.ts +2 -0
  41. package/dist/index.js +8 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/scripts/aw-skill-eval-materializer.d.ts +24 -0
  44. package/dist/scripts/aw-skill-eval-materializer.js +309 -0
  45. package/dist/scripts/aw-skill-eval-materializer.js.map +1 -0
  46. package/dist/scripts/bundle-plugins.d.ts +17 -0
  47. package/dist/scripts/bundle-plugins.js +126 -0
  48. package/dist/scripts/bundle-plugins.js.map +1 -0
  49. package/dist/scripts/plugin-staging.d.ts +26 -0
  50. package/dist/scripts/plugin-staging.js +76 -0
  51. package/dist/scripts/plugin-staging.js.map +1 -0
  52. package/dist/scripts/test-plugin-scripts.d.ts +7 -0
  53. package/dist/scripts/test-plugin-scripts.js +610 -0
  54. package/dist/scripts/test-plugin-scripts.js.map +1 -0
  55. package/dist/src/adapters/helpers.d.ts +44 -0
  56. package/dist/src/adapters/helpers.js +95 -0
  57. package/dist/src/adapters/helpers.js.map +1 -0
  58. package/dist/src/authoring/workspace-commands.d.ts +70 -0
  59. package/dist/src/authoring/workspace-commands.js +158 -0
  60. package/dist/src/authoring/workspace-commands.js.map +1 -0
  61. package/dist/src/commands/aw-capabilities.d.ts +78 -0
  62. package/dist/src/commands/aw-capabilities.js +254 -0
  63. package/dist/src/commands/aw-capabilities.js.map +1 -0
  64. package/dist/src/commands/catalog-dev-source.d.ts +120 -0
  65. package/dist/src/commands/catalog-dev-source.js +434 -0
  66. package/dist/src/commands/catalog-dev-source.js.map +1 -0
  67. package/dist/src/commands/catalog-generation.d.ts +16 -0
  68. package/dist/src/commands/catalog-generation.js +9 -0
  69. package/dist/src/commands/catalog-generation.js.map +1 -0
  70. package/dist/src/commands/catalog-publication-inspection.d.ts +138 -0
  71. package/dist/src/commands/catalog-publication-inspection.js +711 -0
  72. package/dist/src/commands/catalog-publication-inspection.js.map +1 -0
  73. package/dist/src/commands/catalog-publication-journal.d.ts +56 -0
  74. package/dist/src/commands/catalog-publication-journal.js +215 -0
  75. package/dist/src/commands/catalog-publication-journal.js.map +1 -0
  76. package/dist/src/commands/catalog-publication-target.d.ts +18 -0
  77. package/dist/src/commands/catalog-publication-target.js +95 -0
  78. package/dist/src/commands/catalog-publication-target.js.map +1 -0
  79. package/dist/src/commands/catalog-publish.d.ts +103 -0
  80. package/dist/src/commands/catalog-publish.js +804 -0
  81. package/dist/src/commands/catalog-publish.js.map +1 -0
  82. package/dist/src/commands/catalog-source.d.ts +134 -0
  83. package/dist/src/commands/catalog-source.js +377 -0
  84. package/dist/src/commands/catalog-source.js.map +1 -0
  85. package/dist/src/commands/catalog-status.d.ts +56 -0
  86. package/dist/src/commands/catalog-status.js +217 -0
  87. package/dist/src/commands/catalog-status.js.map +1 -0
  88. package/dist/src/commands/catalog-store.d.ts +80 -0
  89. package/dist/src/commands/catalog-store.js +348 -0
  90. package/dist/src/commands/catalog-store.js.map +1 -0
  91. package/dist/src/commands/catalog-workspace-resolution.d.ts +13 -0
  92. package/dist/src/commands/catalog-workspace-resolution.js +42 -0
  93. package/dist/src/commands/catalog-workspace-resolution.js.map +1 -0
  94. package/dist/src/commands/console.d.ts +3 -0
  95. package/dist/src/commands/console.js +44 -0
  96. package/dist/src/commands/console.js.map +1 -0
  97. package/dist/src/commands/dependency-operation-plan.d.ts +58 -0
  98. package/dist/src/commands/dependency-operation-plan.js +261 -0
  99. package/dist/src/commands/dependency-operation-plan.js.map +1 -0
  100. package/dist/src/commands/init.d.ts +25 -0
  101. package/dist/src/commands/init.js +42 -0
  102. package/dist/src/commands/init.js.map +1 -0
  103. package/dist/src/commands/offline-cleanup-evidence.d.ts +59 -0
  104. package/dist/src/commands/offline-cleanup-evidence.js +163 -0
  105. package/dist/src/commands/offline-cleanup-evidence.js.map +1 -0
  106. package/dist/src/commands/operation-plan.d.ts +126 -0
  107. package/dist/src/commands/operation-plan.js +47 -0
  108. package/dist/src/commands/operation-plan.js.map +1 -0
  109. package/dist/src/commands/operation-planner.d.ts +46 -0
  110. package/dist/src/commands/operation-planner.js +139 -0
  111. package/dist/src/commands/operation-planner.js.map +1 -0
  112. package/dist/src/commands/options.d.ts +70 -0
  113. package/dist/src/commands/options.js +194 -0
  114. package/dist/src/commands/options.js.map +1 -0
  115. package/dist/src/commands/plugin-capabilities.d.ts +22 -0
  116. package/dist/src/commands/plugin-capabilities.js +159 -0
  117. package/dist/src/commands/plugin-capabilities.js.map +1 -0
  118. package/dist/src/commands/rebuild-command.d.ts +88 -0
  119. package/dist/src/commands/rebuild-command.js +3626 -0
  120. package/dist/src/commands/rebuild-command.js.map +1 -0
  121. package/dist/src/commands/rebuild-integration.d.ts +190 -0
  122. package/dist/src/commands/rebuild-integration.js +4439 -0
  123. package/dist/src/commands/rebuild-integration.js.map +1 -0
  124. package/dist/src/commands/rebuild-operations.d.ts +100 -0
  125. package/dist/src/commands/rebuild-operations.js +625 -0
  126. package/dist/src/commands/rebuild-operations.js.map +1 -0
  127. package/dist/src/commands/reconcile-operation-plan.d.ts +26 -0
  128. package/dist/src/commands/reconcile-operation-plan.js +28 -0
  129. package/dist/src/commands/reconcile-operation-plan.js.map +1 -0
  130. package/dist/src/commands/review-publication.d.ts +99 -0
  131. package/dist/src/commands/review-publication.js +904 -0
  132. package/dist/src/commands/review-publication.js.map +1 -0
  133. package/dist/src/commands/runtime.d.ts +172 -0
  134. package/dist/src/commands/runtime.js +720 -0
  135. package/dist/src/commands/runtime.js.map +1 -0
  136. package/dist/src/commands/skill-eval.d.ts +33 -0
  137. package/dist/src/commands/skill-eval.js +363 -0
  138. package/dist/src/commands/skill-eval.js.map +1 -0
  139. package/dist/src/commands/status-v6.d.ts +206 -0
  140. package/dist/src/commands/status-v6.js +2175 -0
  141. package/dist/src/commands/status-v6.js.map +1 -0
  142. package/dist/src/commands/sync-command.d.ts +23 -0
  143. package/dist/src/commands/sync-command.js +242 -0
  144. package/dist/src/commands/sync-command.js.map +1 -0
  145. package/dist/src/commands/wizard.d.ts +56 -0
  146. package/dist/src/commands/wizard.js +58 -0
  147. package/dist/src/commands/wizard.js.map +1 -0
  148. package/dist/src/commands/write-commands.d.ts +7 -0
  149. package/dist/src/commands/write-commands.js +190 -0
  150. package/dist/src/commands/write-commands.js.map +1 -0
  151. package/dist/src/constants.d.ts +31 -0
  152. package/dist/src/constants.js +32 -0
  153. package/dist/src/constants.js.map +1 -0
  154. package/dist/src/eval/manifest-v1.d.ts +67 -0
  155. package/dist/src/eval/manifest-v1.js +347 -0
  156. package/dist/src/eval/manifest-v1.js.map +1 -0
  157. package/dist/src/generators/agents.d.ts +3 -0
  158. package/dist/src/generators/agents.js +46 -0
  159. package/dist/src/generators/agents.js.map +1 -0
  160. package/dist/src/generators/hooks.d.ts +15 -0
  161. package/dist/src/generators/hooks.js +76 -0
  162. package/dist/src/generators/hooks.js.map +1 -0
  163. package/dist/src/generators/instructions.d.ts +13 -0
  164. package/dist/src/generators/instructions.js +66 -0
  165. package/dist/src/generators/instructions.js.map +1 -0
  166. package/dist/src/generators/local-plugin.d.ts +56 -0
  167. package/dist/src/generators/local-plugin.js +1373 -0
  168. package/dist/src/generators/local-plugin.js.map +1 -0
  169. package/dist/src/generators/permissions.d.ts +10 -0
  170. package/dist/src/generators/permissions.js +37 -0
  171. package/dist/src/generators/permissions.js.map +1 -0
  172. package/dist/src/generators/shared.d.ts +2 -0
  173. package/dist/src/generators/shared.js +15 -0
  174. package/dist/src/generators/shared.js.map +1 -0
  175. package/dist/src/index.d.ts +41 -0
  176. package/dist/src/index.js +3327 -0
  177. package/dist/src/index.js.map +1 -0
  178. package/dist/src/output/command-receipt.d.ts +87 -0
  179. package/dist/src/output/command-receipt.js +302 -0
  180. package/dist/src/output/command-receipt.js.map +1 -0
  181. package/dist/src/output/debug-log.d.ts +4 -0
  182. package/dist/src/output/debug-log.js +97 -0
  183. package/dist/src/output/debug-log.js.map +1 -0
  184. package/dist/src/output/equivalent-command.d.ts +9 -0
  185. package/dist/src/output/equivalent-command.js +39 -0
  186. package/dist/src/output/equivalent-command.js.map +1 -0
  187. package/dist/src/output/model.d.ts +76 -0
  188. package/dist/src/output/model.js +2 -0
  189. package/dist/src/output/model.js.map +1 -0
  190. package/dist/src/output/rebuild-progress.d.ts +21 -0
  191. package/dist/src/output/rebuild-progress.js +128 -0
  192. package/dist/src/output/rebuild-progress.js.map +1 -0
  193. package/dist/src/output/redact.d.ts +3 -0
  194. package/dist/src/output/redact.js +39 -0
  195. package/dist/src/output/redact.js.map +1 -0
  196. package/dist/src/output/reporter.d.ts +9 -0
  197. package/dist/src/output/reporter.js +133 -0
  198. package/dist/src/output/reporter.js.map +1 -0
  199. package/dist/src/portable/commands.d.ts +124 -0
  200. package/dist/src/portable/commands.js +557 -0
  201. package/dist/src/portable/commands.js.map +1 -0
  202. package/dist/src/portable/materializer.d.ts +50 -0
  203. package/dist/src/portable/materializer.js +462 -0
  204. package/dist/src/portable/materializer.js.map +1 -0
  205. package/dist/src/portable/skills-cli.d.ts +43 -0
  206. package/dist/src/portable/skills-cli.js +148 -0
  207. package/dist/src/portable/skills-cli.js.map +1 -0
  208. package/dist/src/tui/catalog-freshness.d.ts +1 -0
  209. package/dist/src/tui/catalog-freshness.js +2 -0
  210. package/dist/src/tui/catalog-freshness.js.map +1 -0
  211. package/dist/src/tui/catalog-generation.d.ts +21 -0
  212. package/dist/src/tui/catalog-generation.js +116 -0
  213. package/dist/src/tui/catalog-generation.js.map +1 -0
  214. package/dist/src/tui/catalog-sources/projection.d.ts +4 -0
  215. package/dist/src/tui/catalog-sources/projection.js +17 -0
  216. package/dist/src/tui/catalog-sources/projection.js.map +1 -0
  217. package/dist/src/tui/catalog-sources/review.d.ts +3 -0
  218. package/dist/src/tui/catalog-sources/review.js +13 -0
  219. package/dist/src/tui/catalog-sources/review.js.map +1 -0
  220. package/dist/src/tui/catalog-sources/screens.d.ts +12 -0
  221. package/dist/src/tui/catalog-sources/screens.js +33 -0
  222. package/dist/src/tui/catalog-sources/screens.js.map +1 -0
  223. package/dist/src/tui/catalog-sources/session.d.ts +22 -0
  224. package/dist/src/tui/catalog-sources/session.js +225 -0
  225. package/dist/src/tui/catalog-sources/session.js.map +1 -0
  226. package/dist/src/tui/catalog-sources/types.d.ts +41 -0
  227. package/dist/src/tui/catalog-sources/types.js +2 -0
  228. package/dist/src/tui/catalog-sources/types.js.map +1 -0
  229. package/dist/src/tui/components.d.ts +102 -0
  230. package/dist/src/tui/components.js +184 -0
  231. package/dist/src/tui/components.js.map +1 -0
  232. package/dist/src/tui/console-app-v4.d.ts +20 -0
  233. package/dist/src/tui/console-app-v4.js +5066 -0
  234. package/dist/src/tui/console-app-v4.js.map +1 -0
  235. package/dist/src/tui/controller-runtime.d.ts +23 -0
  236. package/dist/src/tui/controller-runtime.js +2011 -0
  237. package/dist/src/tui/controller-runtime.js.map +1 -0
  238. package/dist/src/tui/controller.d.ts +557 -0
  239. package/dist/src/tui/controller.js +2120 -0
  240. package/dist/src/tui/controller.js.map +1 -0
  241. package/dist/src/tui/diagnostics.d.ts +30 -0
  242. package/dist/src/tui/diagnostics.js +71 -0
  243. package/dist/src/tui/diagnostics.js.map +1 -0
  244. package/dist/src/tui/index.d.ts +17 -0
  245. package/dist/src/tui/index.js +17 -0
  246. package/dist/src/tui/index.js.map +1 -0
  247. package/dist/src/tui/input-display.d.ts +8 -0
  248. package/dist/src/tui/input-display.js +36 -0
  249. package/dist/src/tui/input-display.js.map +1 -0
  250. package/dist/src/tui/keys.d.ts +12 -0
  251. package/dist/src/tui/keys.js +22 -0
  252. package/dist/src/tui/keys.js.map +1 -0
  253. package/dist/src/tui/layout.d.ts +12 -0
  254. package/dist/src/tui/layout.js +19 -0
  255. package/dist/src/tui/layout.js.map +1 -0
  256. package/dist/src/tui/model.d.ts +424 -0
  257. package/dist/src/tui/model.js +1493 -0
  258. package/dist/src/tui/model.js.map +1 -0
  259. package/dist/src/tui/operation-review-planner.d.ts +21 -0
  260. package/dist/src/tui/operation-review-planner.js +622 -0
  261. package/dist/src/tui/operation-review-planner.js.map +1 -0
  262. package/dist/src/tui/prompt.d.ts +8 -0
  263. package/dist/src/tui/prompt.js +231 -0
  264. package/dist/src/tui/prompt.js.map +1 -0
  265. package/dist/src/tui/router.d.ts +206 -0
  266. package/dist/src/tui/router.js +137 -0
  267. package/dist/src/tui/router.js.map +1 -0
  268. package/dist/src/tui/runner.d.ts +11 -0
  269. package/dist/src/tui/runner.js +71 -0
  270. package/dist/src/tui/runner.js.map +1 -0
  271. package/dist/src/tui/source-ref-presets.d.ts +3 -0
  272. package/dist/src/tui/source-ref-presets.js +11 -0
  273. package/dist/src/tui/source-ref-presets.js.map +1 -0
  274. package/dist/src/tui/theme.d.ts +26 -0
  275. package/dist/src/tui/theme.js +28 -0
  276. package/dist/src/tui/theme.js.map +1 -0
  277. package/dist/src/tui/viewport.d.ts +20 -0
  278. package/dist/src/tui/viewport.js +29 -0
  279. package/dist/src/tui/viewport.js.map +1 -0
  280. package/dist/src/tui/views.d.ts +57 -0
  281. package/dist/src/tui/views.js +201 -0
  282. package/dist/src/tui/views.js.map +1 -0
  283. package/dist/src/tui/wizard.d.ts +11 -0
  284. package/dist/src/tui/wizard.js +323 -0
  285. package/dist/src/tui/wizard.js.map +1 -0
  286. package/dist/src/types.d.ts +474 -0
  287. package/dist/src/types.js +34 -0
  288. package/dist/src/types.js.map +1 -0
  289. package/dist/src/utils/agent-version.d.ts +19 -0
  290. package/dist/src/utils/agent-version.js +205 -0
  291. package/dist/src/utils/agent-version.js.map +1 -0
  292. package/dist/src/utils/artifact-plan.d.ts +27 -0
  293. package/dist/src/utils/artifact-plan.js +453 -0
  294. package/dist/src/utils/artifact-plan.js.map +1 -0
  295. package/dist/src/utils/artifact-renderer.d.ts +129 -0
  296. package/dist/src/utils/artifact-renderer.js +400 -0
  297. package/dist/src/utils/artifact-renderer.js.map +1 -0
  298. package/dist/src/utils/artifact-request.d.ts +16 -0
  299. package/dist/src/utils/artifact-request.js +42 -0
  300. package/dist/src/utils/artifact-request.js.map +1 -0
  301. package/dist/src/utils/artifact-sources.d.ts +8 -0
  302. package/dist/src/utils/artifact-sources.js +10 -0
  303. package/dist/src/utils/artifact-sources.js.map +1 -0
  304. package/dist/src/utils/aw-home-mutation-lock.d.ts +11 -0
  305. package/dist/src/utils/aw-home-mutation-lock.js +83 -0
  306. package/dist/src/utils/aw-home-mutation-lock.js.map +1 -0
  307. package/dist/src/utils/bundle-integrity.d.ts +2 -0
  308. package/dist/src/utils/bundle-integrity.js +63 -0
  309. package/dist/src/utils/bundle-integrity.js.map +1 -0
  310. package/dist/src/utils/bundle-layout.d.ts +4 -0
  311. package/dist/src/utils/bundle-layout.js +531 -0
  312. package/dist/src/utils/bundle-layout.js.map +1 -0
  313. package/dist/src/utils/catalog-digests.d.ts +18 -0
  314. package/dist/src/utils/catalog-digests.js +156 -0
  315. package/dist/src/utils/catalog-digests.js.map +1 -0
  316. package/dist/src/utils/catalog-generation-control-snapshot.d.ts +11 -0
  317. package/dist/src/utils/catalog-generation-control-snapshot.js +45 -0
  318. package/dist/src/utils/catalog-generation-control-snapshot.js.map +1 -0
  319. package/dist/src/utils/catalog-generation-error.d.ts +16 -0
  320. package/dist/src/utils/catalog-generation-error.js +30 -0
  321. package/dist/src/utils/catalog-generation-error.js.map +1 -0
  322. package/dist/src/utils/catalog-generation-resolver.d.ts +32 -0
  323. package/dist/src/utils/catalog-generation-resolver.js +251 -0
  324. package/dist/src/utils/catalog-generation-resolver.js.map +1 -0
  325. package/dist/src/utils/catalog-generation-service.d.ts +161 -0
  326. package/dist/src/utils/catalog-generation-service.js +1237 -0
  327. package/dist/src/utils/catalog-generation-service.js.map +1 -0
  328. package/dist/src/utils/catalog-generation-state.d.ts +22 -0
  329. package/dist/src/utils/catalog-generation-state.js +192 -0
  330. package/dist/src/utils/catalog-generation-state.js.map +1 -0
  331. package/dist/src/utils/catalog-generation-store.d.ts +57 -0
  332. package/dist/src/utils/catalog-generation-store.js +397 -0
  333. package/dist/src/utils/catalog-generation-store.js.map +1 -0
  334. package/dist/src/utils/catalog-manifest-v7.d.ts +5 -0
  335. package/dist/src/utils/catalog-manifest-v7.js +98 -0
  336. package/dist/src/utils/catalog-manifest-v7.js.map +1 -0
  337. package/dist/src/utils/catalog-operation-context.d.ts +20 -0
  338. package/dist/src/utils/catalog-operation-context.js +141 -0
  339. package/dist/src/utils/catalog-operation-context.js.map +1 -0
  340. package/dist/src/utils/catalog-public-error.d.ts +19 -0
  341. package/dist/src/utils/catalog-public-error.js +100 -0
  342. package/dist/src/utils/catalog-public-error.js.map +1 -0
  343. package/dist/src/utils/catalog-runtime-projection.d.ts +33 -0
  344. package/dist/src/utils/catalog-runtime-projection.js +77 -0
  345. package/dist/src/utils/catalog-runtime-projection.js.map +1 -0
  346. package/dist/src/utils/catalog-snapshot.d.ts +10 -0
  347. package/dist/src/utils/catalog-snapshot.js +20 -0
  348. package/dist/src/utils/catalog-snapshot.js.map +1 -0
  349. package/dist/src/utils/catalog-source-identity.d.ts +5 -0
  350. package/dist/src/utils/catalog-source-identity.js +137 -0
  351. package/dist/src/utils/catalog-source-identity.js.map +1 -0
  352. package/dist/src/utils/catalog-source-impact.d.ts +20 -0
  353. package/dist/src/utils/catalog-source-impact.js +222 -0
  354. package/dist/src/utils/catalog-source-impact.js.map +1 -0
  355. package/dist/src/utils/catalog-source-presentation.d.ts +1 -0
  356. package/dist/src/utils/catalog-source-presentation.js +32 -0
  357. package/dist/src/utils/catalog-source-presentation.js.map +1 -0
  358. package/dist/src/utils/catalog-source-references.d.ts +66 -0
  359. package/dist/src/utils/catalog-source-references.js +1180 -0
  360. package/dist/src/utils/catalog-source-references.js.map +1 -0
  361. package/dist/src/utils/catalog-sources.d.ts +53 -0
  362. package/dist/src/utils/catalog-sources.js +456 -0
  363. package/dist/src/utils/catalog-sources.js.map +1 -0
  364. package/dist/src/utils/codex-config.d.ts +126 -0
  365. package/dist/src/utils/codex-config.js +1032 -0
  366. package/dist/src/utils/codex-config.js.map +1 -0
  367. package/dist/src/utils/codex-manager.d.ts +81 -0
  368. package/dist/src/utils/codex-manager.js +810 -0
  369. package/dist/src/utils/codex-manager.js.map +1 -0
  370. package/dist/src/utils/codex-marketplace-path.d.ts +5 -0
  371. package/dist/src/utils/codex-marketplace-path.js +45 -0
  372. package/dist/src/utils/codex-marketplace-path.js.map +1 -0
  373. package/dist/src/utils/codex-native-observation.d.ts +16 -0
  374. package/dist/src/utils/codex-native-observation.js +22 -0
  375. package/dist/src/utils/codex-native-observation.js.map +1 -0
  376. package/dist/src/utils/codex-native-render-receipt.d.ts +40 -0
  377. package/dist/src/utils/codex-native-render-receipt.js +205 -0
  378. package/dist/src/utils/codex-native-render-receipt.js.map +1 -0
  379. package/dist/src/utils/codex-reconciler.d.ts +128 -0
  380. package/dist/src/utils/codex-reconciler.js +294 -0
  381. package/dist/src/utils/codex-reconciler.js.map +1 -0
  382. package/dist/src/utils/codex-roles.d.ts +71 -0
  383. package/dist/src/utils/codex-roles.js +257 -0
  384. package/dist/src/utils/codex-roles.js.map +1 -0
  385. package/dist/src/utils/codex-shared-native.d.ts +63 -0
  386. package/dist/src/utils/codex-shared-native.js +142 -0
  387. package/dist/src/utils/codex-shared-native.js.map +1 -0
  388. package/dist/src/utils/codex-skill-staging.d.ts +11 -0
  389. package/dist/src/utils/codex-skill-staging.js +8 -0
  390. package/dist/src/utils/codex-skill-staging.js.map +1 -0
  391. package/dist/src/utils/codex-surface-analysis.d.ts +45 -0
  392. package/dist/src/utils/codex-surface-analysis.js +245 -0
  393. package/dist/src/utils/codex-surface-analysis.js.map +1 -0
  394. package/dist/src/utils/config-value.d.ts +3 -0
  395. package/dist/src/utils/config-value.js +23 -0
  396. package/dist/src/utils/config-value.js.map +1 -0
  397. package/dist/src/utils/dynamic-skill-tree.d.ts +36 -0
  398. package/dist/src/utils/dynamic-skill-tree.js +466 -0
  399. package/dist/src/utils/dynamic-skill-tree.js.map +1 -0
  400. package/dist/src/utils/file-rules.d.ts +1 -0
  401. package/dist/src/utils/file-rules.js +2 -0
  402. package/dist/src/utils/file-rules.js.map +1 -0
  403. package/dist/src/utils/git-catalog-provider.d.ts +22 -0
  404. package/dist/src/utils/git-catalog-provider.js +497 -0
  405. package/dist/src/utils/git-catalog-provider.js.map +1 -0
  406. package/dist/src/utils/hooks-contract.d.ts +1 -0
  407. package/dist/src/utils/hooks-contract.js +2 -0
  408. package/dist/src/utils/hooks-contract.js.map +1 -0
  409. package/dist/src/utils/json.d.ts +4 -0
  410. package/dist/src/utils/json.js +29 -0
  411. package/dist/src/utils/json.js.map +1 -0
  412. package/dist/src/utils/local-marketplace.d.ts +41 -0
  413. package/dist/src/utils/local-marketplace.js +316 -0
  414. package/dist/src/utils/local-marketplace.js.map +1 -0
  415. package/dist/src/utils/manifest.d.ts +11 -0
  416. package/dist/src/utils/manifest.js +33 -0
  417. package/dist/src/utils/manifest.js.map +1 -0
  418. package/dist/src/utils/marketplace.d.ts +3 -0
  419. package/dist/src/utils/marketplace.js +76 -0
  420. package/dist/src/utils/marketplace.js.map +1 -0
  421. package/dist/src/utils/multi-source-catalog.d.ts +66 -0
  422. package/dist/src/utils/multi-source-catalog.js +345 -0
  423. package/dist/src/utils/multi-source-catalog.js.map +1 -0
  424. package/dist/src/utils/native-cli.d.ts +118 -0
  425. package/dist/src/utils/native-cli.js +518 -0
  426. package/dist/src/utils/native-cli.js.map +1 -0
  427. package/dist/src/utils/orphan-marketplace-cleanup.d.ts +18 -0
  428. package/dist/src/utils/orphan-marketplace-cleanup.js +198 -0
  429. package/dist/src/utils/orphan-marketplace-cleanup.js.map +1 -0
  430. package/dist/src/utils/ownership.d.ts +194 -0
  431. package/dist/src/utils/ownership.js +723 -0
  432. package/dist/src/utils/ownership.js.map +1 -0
  433. package/dist/src/utils/path-catalog-provider.d.ts +7 -0
  434. package/dist/src/utils/path-catalog-provider.js +74 -0
  435. package/dist/src/utils/path-catalog-provider.js.map +1 -0
  436. package/dist/src/utils/paths.d.ts +40 -0
  437. package/dist/src/utils/paths.js +137 -0
  438. package/dist/src/utils/paths.js.map +1 -0
  439. package/dist/src/utils/platform-entries.d.ts +1 -0
  440. package/dist/src/utils/platform-entries.js +2 -0
  441. package/dist/src/utils/platform-entries.js.map +1 -0
  442. package/dist/src/utils/platform-support.d.ts +1 -0
  443. package/dist/src/utils/platform-support.js +2 -0
  444. package/dist/src/utils/platform-support.js.map +1 -0
  445. package/dist/src/utils/plugin-config-write.d.ts +110 -0
  446. package/dist/src/utils/plugin-config-write.js +773 -0
  447. package/dist/src/utils/plugin-config-write.js.map +1 -0
  448. package/dist/src/utils/plugin-config.d.ts +389 -0
  449. package/dist/src/utils/plugin-config.js +1642 -0
  450. package/dist/src/utils/plugin-config.js.map +1 -0
  451. package/dist/src/utils/plugin-dependencies.d.ts +12 -0
  452. package/dist/src/utils/plugin-dependencies.js +162 -0
  453. package/dist/src/utils/plugin-dependencies.js.map +1 -0
  454. package/dist/src/utils/plugin-intent-state.d.ts +34 -0
  455. package/dist/src/utils/plugin-intent-state.js +289 -0
  456. package/dist/src/utils/plugin-intent-state.js.map +1 -0
  457. package/dist/src/utils/plugin-script-contract.d.ts +1 -0
  458. package/dist/src/utils/plugin-script-contract.js +2 -0
  459. package/dist/src/utils/plugin-script-contract.js.map +1 -0
  460. package/dist/src/utils/plugin-scripts.d.ts +101 -0
  461. package/dist/src/utils/plugin-scripts.js +253 -0
  462. package/dist/src/utils/plugin-scripts.js.map +1 -0
  463. package/dist/src/utils/process-lock.d.ts +47 -0
  464. package/dist/src/utils/process-lock.js +532 -0
  465. package/dist/src/utils/process-lock.js.map +1 -0
  466. package/dist/src/utils/process-tree.d.ts +2 -0
  467. package/dist/src/utils/process-tree.js +2 -0
  468. package/dist/src/utils/process-tree.js.map +1 -0
  469. package/dist/src/utils/project-boundary.d.ts +9 -0
  470. package/dist/src/utils/project-boundary.js +67 -0
  471. package/dist/src/utils/project-boundary.js.map +1 -0
  472. package/dist/src/utils/rendered-contract.d.ts +8 -0
  473. package/dist/src/utils/rendered-contract.js +134 -0
  474. package/dist/src/utils/rendered-contract.js.map +1 -0
  475. package/dist/src/utils/runtime-skill-closure.d.ts +13 -0
  476. package/dist/src/utils/runtime-skill-closure.js +863 -0
  477. package/dist/src/utils/runtime-skill-closure.js.map +1 -0
  478. package/dist/src/utils/safe-fs.d.ts +21 -0
  479. package/dist/src/utils/safe-fs.js +111 -0
  480. package/dist/src/utils/safe-fs.js.map +1 -0
  481. package/dist/src/utils/skill-authoring.d.ts +1 -0
  482. package/dist/src/utils/skill-authoring.js +2 -0
  483. package/dist/src/utils/skill-authoring.js.map +1 -0
  484. package/dist/src/utils/skill-validation.d.ts +37 -0
  485. package/dist/src/utils/skill-validation.js +326 -0
  486. package/dist/src/utils/skill-validation.js.map +1 -0
  487. package/dist/src/utils/slash-commands.d.ts +1 -0
  488. package/dist/src/utils/slash-commands.js +2 -0
  489. package/dist/src/utils/slash-commands.js.map +1 -0
  490. package/dist/src/utils/state-paths.d.ts +14 -0
  491. package/dist/src/utils/state-paths.js +139 -0
  492. package/dist/src/utils/state-paths.js.map +1 -0
  493. package/dist/src/utils/target-eligibility.d.ts +13 -0
  494. package/dist/src/utils/target-eligibility.js +35 -0
  495. package/dist/src/utils/target-eligibility.js.map +1 -0
  496. package/dist/src/utils/target-order.d.ts +7 -0
  497. package/dist/src/utils/target-order.js +10 -0
  498. package/dist/src/utils/target-order.js.map +1 -0
  499. package/dist/src/utils/template-engine.d.ts +1 -0
  500. package/dist/src/utils/template-engine.js +2 -0
  501. package/dist/src/utils/template-engine.js.map +1 -0
  502. package/dist/src/utils/test-path-fence.d.ts +12 -0
  503. package/dist/src/utils/test-path-fence.js +31 -0
  504. package/dist/src/utils/test-path-fence.js.map +1 -0
  505. package/dist/vitest.config.d.ts +2 -0
  506. package/dist/vitest.config.js +16 -0
  507. package/dist/vitest.config.js.map +1 -0
  508. package/package.json +64 -0
@@ -0,0 +1,261 @@
1
+ function isJavaScriptIdentifierStart(value) {
2
+ return value !== undefined && /[A-Za-z_$]/u.test(value);
3
+ }
4
+ function isJavaScriptIdentifierPart(value) {
5
+ return value !== undefined && /[A-Za-z0-9_$]/u.test(value);
6
+ }
7
+ function decodeJavaScriptEscape(source, index) {
8
+ const escaped = source[index];
9
+ const simple = {
10
+ b: '\b',
11
+ f: '\f',
12
+ n: '\n',
13
+ r: '\r',
14
+ t: '\t',
15
+ v: '\v',
16
+ '0': '\0',
17
+ };
18
+ if (escaped === '\n')
19
+ return { value: '', next: index + 1 };
20
+ if (escaped === '\r') {
21
+ return { value: '', next: source[index + 1] === '\n' ? index + 2 : index + 1 };
22
+ }
23
+ if (escaped && Object.prototype.hasOwnProperty.call(simple, escaped)) {
24
+ return { value: simple[escaped], next: index + 1 };
25
+ }
26
+ if (escaped === 'x') {
27
+ const hex = source.slice(index + 1, index + 3);
28
+ if (/^[0-9A-Fa-f]{2}$/u.test(hex)) {
29
+ return { value: String.fromCodePoint(Number.parseInt(hex, 16)), next: index + 3 };
30
+ }
31
+ }
32
+ if (escaped === 'u') {
33
+ if (source[index + 1] === '{') {
34
+ const close = source.indexOf('}', index + 2);
35
+ const hex = close === -1 ? '' : source.slice(index + 2, close);
36
+ if (/^[0-9A-Fa-f]{1,6}$/u.test(hex)) {
37
+ return { value: String.fromCodePoint(Number.parseInt(hex, 16)), next: close + 1 };
38
+ }
39
+ }
40
+ else {
41
+ const hex = source.slice(index + 1, index + 5);
42
+ if (/^[0-9A-Fa-f]{4}$/u.test(hex)) {
43
+ return { value: String.fromCodePoint(Number.parseInt(hex, 16)), next: index + 5 };
44
+ }
45
+ }
46
+ }
47
+ return { value: escaped ?? '', next: Math.min(index + 1, source.length) };
48
+ }
49
+ function tokenizeJavaScriptImports(source) {
50
+ const tokens = [];
51
+ let index = 0;
52
+ let previousToken;
53
+ const push = (token) => {
54
+ tokens.push(token);
55
+ previousToken = token;
56
+ };
57
+ const skipQuotedString = (quote) => {
58
+ index += 1;
59
+ let value = '';
60
+ while (index < source.length) {
61
+ const current = source[index];
62
+ if (current === quote) {
63
+ index += 1;
64
+ push({ kind: 'string', value });
65
+ return;
66
+ }
67
+ if (current === '\\') {
68
+ const decoded = decodeJavaScriptEscape(source, index + 1);
69
+ value += decoded.value;
70
+ index = decoded.next;
71
+ continue;
72
+ }
73
+ value += current;
74
+ index += 1;
75
+ }
76
+ };
77
+ const canStartRegexLiteral = () => {
78
+ if (!previousToken)
79
+ return true;
80
+ if (previousToken.kind === 'identifier') {
81
+ return new Set([
82
+ 'await', 'case', 'delete', 'do', 'else', 'in', 'instanceof', 'new',
83
+ 'return', 'throw', 'typeof', 'void', 'yield',
84
+ ]).has(previousToken.value);
85
+ }
86
+ return previousToken.kind === 'punctuation'
87
+ && ['(', '[', '{', '=', ':', ',', ';', '!', '&', '|', '?', '~', '+', '-', '*', '%', '^', '<', '>']
88
+ .includes(previousToken.value);
89
+ };
90
+ const skipRegexLiteral = () => {
91
+ index += 1;
92
+ let inCharacterClass = false;
93
+ while (index < source.length) {
94
+ const current = source[index];
95
+ if (current === '\\') {
96
+ index = Math.min(index + 2, source.length);
97
+ continue;
98
+ }
99
+ if (current === '[')
100
+ inCharacterClass = true;
101
+ if (current === ']')
102
+ inCharacterClass = false;
103
+ index += 1;
104
+ if (current === '/' && !inCharacterClass) {
105
+ while (/[A-Za-z]/u.test(source[index] ?? ''))
106
+ index += 1;
107
+ push({ kind: 'literal', value: 'regex' });
108
+ return;
109
+ }
110
+ if (current === '\n' || current === '\r')
111
+ return;
112
+ }
113
+ };
114
+ const scanCode = (stopAtTemplateExpressionEnd) => {
115
+ let braceDepth = 0;
116
+ while (index < source.length) {
117
+ const current = source[index];
118
+ const next = source[index + 1];
119
+ if (/\s/u.test(current)) {
120
+ index += 1;
121
+ continue;
122
+ }
123
+ if (current === '/' && next === '/') {
124
+ index += 2;
125
+ while (index < source.length && source[index] !== '\n' && source[index] !== '\r')
126
+ index += 1;
127
+ continue;
128
+ }
129
+ if (current === '/' && next === '*') {
130
+ index += 2;
131
+ while (index < source.length && !(source[index] === '*' && source[index + 1] === '/'))
132
+ index += 1;
133
+ index = Math.min(index + 2, source.length);
134
+ continue;
135
+ }
136
+ if (current === '\'' || current === '"') {
137
+ skipQuotedString(current);
138
+ continue;
139
+ }
140
+ if (current === '`') {
141
+ index += 1;
142
+ while (index < source.length) {
143
+ if (source[index] === '\\') {
144
+ index = Math.min(index + 2, source.length);
145
+ }
146
+ else if (source[index] === '`') {
147
+ index += 1;
148
+ break;
149
+ }
150
+ else if (source[index] === '$' && source[index + 1] === '{') {
151
+ index += 2;
152
+ const outerPrevious = previousToken;
153
+ previousToken = undefined;
154
+ scanCode(true);
155
+ previousToken = outerPrevious;
156
+ }
157
+ else {
158
+ index += 1;
159
+ }
160
+ }
161
+ push({ kind: 'literal', value: 'template' });
162
+ continue;
163
+ }
164
+ if (current === '/' && canStartRegexLiteral()) {
165
+ skipRegexLiteral();
166
+ continue;
167
+ }
168
+ if (isJavaScriptIdentifierStart(current)) {
169
+ const start = index;
170
+ index += 1;
171
+ while (isJavaScriptIdentifierPart(source[index]))
172
+ index += 1;
173
+ push({ kind: 'identifier', value: source.slice(start, index) });
174
+ continue;
175
+ }
176
+ if (/[0-9]/u.test(current)) {
177
+ index += 1;
178
+ while (/[A-Za-z0-9_.]/u.test(source[index] ?? ''))
179
+ index += 1;
180
+ push({ kind: 'literal', value: 'number' });
181
+ continue;
182
+ }
183
+ if (current === '{') {
184
+ braceDepth += 1;
185
+ index += 1;
186
+ push({ kind: 'punctuation', value: current });
187
+ continue;
188
+ }
189
+ if (current === '}') {
190
+ if (stopAtTemplateExpressionEnd && braceDepth === 0) {
191
+ index += 1;
192
+ return;
193
+ }
194
+ braceDepth = Math.max(0, braceDepth - 1);
195
+ index += 1;
196
+ push({ kind: 'punctuation', value: current });
197
+ continue;
198
+ }
199
+ index += 1;
200
+ push({ kind: 'punctuation', value: current });
201
+ }
202
+ };
203
+ scanCode(false);
204
+ return tokens;
205
+ }
206
+ export function scanJavaScriptImportSpecifiers(source) {
207
+ const references = [];
208
+ const tokens = tokenizeJavaScriptImports(source);
209
+ let pendingStatic;
210
+ for (let index = 0; index < tokens.length; index += 1) {
211
+ const token = tokens[index];
212
+ const previous = tokens[index - 1];
213
+ if (token.value === ';')
214
+ pendingStatic = undefined;
215
+ if (pendingStatic && token.kind === 'identifier' && token.value === 'from') {
216
+ const specifier = tokens[index + 1];
217
+ if (specifier?.kind === 'string') {
218
+ references.push({ specifier: specifier.value, kind: pendingStatic });
219
+ }
220
+ pendingStatic = undefined;
221
+ continue;
222
+ }
223
+ if (token.kind !== 'identifier' || previous?.value === '.')
224
+ continue;
225
+ if (token.value === 'require' && tokens[index + 1]?.value === '(') {
226
+ const specifier = tokens[index + 2];
227
+ if (specifier?.kind === 'string') {
228
+ references.push({ specifier: specifier.value, kind: 'require' });
229
+ }
230
+ continue;
231
+ }
232
+ if (token.value === 'require'
233
+ && tokens[index + 1]?.value === '.'
234
+ && tokens[index + 2]?.kind === 'identifier'
235
+ && tokens[index + 2]?.value === 'resolve'
236
+ && tokens[index + 3]?.value === '(') {
237
+ const specifier = tokens[index + 4];
238
+ if (specifier?.kind === 'string') {
239
+ references.push({ specifier: specifier.value, kind: 'require-resolve' });
240
+ }
241
+ continue;
242
+ }
243
+ if (token.value !== 'import' && token.value !== 'export')
244
+ continue;
245
+ pendingStatic = undefined;
246
+ if (token.value === 'import' && tokens[index + 1]?.value === '(') {
247
+ const specifier = tokens[index + 2];
248
+ if (specifier?.kind === 'string') {
249
+ references.push({ specifier: specifier.value, kind: 'dynamic-import' });
250
+ }
251
+ continue;
252
+ }
253
+ if (token.value === 'import' && tokens[index + 1]?.kind === 'string') {
254
+ references.push({ specifier: tokens[index + 1].value, kind: 'import' });
255
+ continue;
256
+ }
257
+ pendingStatic = token.value;
258
+ }
259
+ return references;
260
+ }
261
+ //# sourceMappingURL=javascript-import-scanner.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"javascript-import-scanner.mjs","sourceRoot":"","sources":["../../../../authoring/scripts/lib/javascript-import-scanner.mjs"],"names":[],"mappings":"AAAA,SAAS,2BAA2B,CAAC,KAAK;IACxC,OAAO,KAAK,KAAK,SAAS,IAAI,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,0BAA0B,CAAC,KAAK;IACvC,OAAO,KAAK,KAAK,SAAS,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,sBAAsB,CAAC,MAAM,EAAE,KAAK;IAC3C,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,MAAM,MAAM,GAAG;QACb,CAAC,EAAE,IAAI;QACP,CAAC,EAAE,IAAI;QACP,CAAC,EAAE,IAAI;QACP,CAAC,EAAE,IAAI;QACP,CAAC,EAAE,IAAI;QACP,CAAC,EAAE,IAAI;QACP,GAAG,EAAE,IAAI;KACV,CAAC;IACF,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;IAC5D,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CA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efined;
5
+ } | {
6
+ repoRoot: string | null;
7
+ pluginRoot: string;
8
+ manifestPath: string;
9
+ };
10
+ export function resolveAuthoringPluginRoot(options: any): {
11
+ explicit: boolean;
12
+ repoRoot: string;
13
+ pluginRoot: string;
14
+ relativePluginRoot: string;
15
+ };
16
+ export function assertCanonicalAuthoringPluginRoot(options: any): {
17
+ expectedPluginRoot: string;
18
+ repoRoot: string | null;
19
+ pluginRoot: string;
20
+ manifestPath?: undefined;
21
+ } | {
22
+ expectedPluginRoot: string;
23
+ repoRoot: string | null;
24
+ pluginRoot: string;
25
+ manifestPath: string;
26
+ };
@@ -0,0 +1,125 @@
1
+ import * as fs from 'node:fs';
2
+ import * as path from 'node:path';
3
+ function pathExistsWithLstat(filePath) {
4
+ try {
5
+ return fs.lstatSync(filePath);
6
+ }
7
+ catch (error) {
8
+ if (error?.code === 'ENOENT')
9
+ return null;
10
+ throw error;
11
+ }
12
+ }
13
+ function isInsideRoot(root, target) {
14
+ const relative = path.relative(root, target);
15
+ return relative === '' || (!relative.startsWith(`..${path.sep}`) && relative !== '..' && !path.isAbsolute(relative));
16
+ }
17
+ function assertDirectoryNode(filePath, label) {
18
+ const stat = pathExistsWithLstat(filePath);
19
+ if (!stat)
20
+ return false;
21
+ if (stat.isSymbolicLink()) {
22
+ throw new Error(`${label} must not be a symbolic link: ${filePath}`);
23
+ }
24
+ if (!stat.isDirectory()) {
25
+ throw new Error(`${label} is not a directory: ${filePath}`);
26
+ }
27
+ return true;
28
+ }
29
+ export function assertAuthoringPluginPathFence(options) {
30
+ const requestedRepoRoot = options.repoRoot === undefined
31
+ ? null
32
+ : path.resolve(options.repoRoot);
33
+ const requestedPluginRoot = path.resolve(options.pluginRoot);
34
+ if (requestedRepoRoot) {
35
+ if (!assertDirectoryNode(requestedRepoRoot, 'Workspace root')) {
36
+ throw new Error(`Workspace root is not a directory: ${requestedRepoRoot}`);
37
+ }
38
+ }
39
+ const repoRoot = requestedRepoRoot ? fs.realpathSync(requestedRepoRoot) : null;
40
+ if (requestedRepoRoot && !isInsideRoot(requestedRepoRoot, requestedPluginRoot)) {
41
+ throw new Error(`Plugin root must be inside the workspace root: ${requestedPluginRoot}`);
42
+ }
43
+ const pluginRoot = repoRoot
44
+ ? path.join(repoRoot, path.relative(requestedRepoRoot, requestedPluginRoot))
45
+ : requestedPluginRoot;
46
+ const boundary = repoRoot ?? path.dirname(pluginRoot);
47
+ const relativeSegments = path.relative(boundary, pluginRoot).split(path.sep).filter(Boolean);
48
+ let currentPath = boundary;
49
+ let pluginExists = true;
50
+ for (const segment of relativeSegments) {
51
+ currentPath = path.join(currentPath, segment);
52
+ const stat = pathExistsWithLstat(currentPath);
53
+ if (!stat) {
54
+ pluginExists = false;
55
+ break;
56
+ }
57
+ if (stat.isSymbolicLink()) {
58
+ throw new Error(`Plugin root path must not contain symbolic links: ${currentPath}`);
59
+ }
60
+ if (!stat.isDirectory()) {
61
+ throw new Error(`Plugin root path component is not a directory: ${currentPath}`);
62
+ }
63
+ }
64
+ if (options.requirePluginRoot && !pluginExists) {
65
+ throw new Error(`Plugin root is not a directory: ${pluginRoot}`);
66
+ }
67
+ if (!pluginExists || !options.requireManifest) {
68
+ return { repoRoot, pluginRoot };
69
+ }
70
+ const manifestDirectory = path.join(pluginRoot, '.agents-plugin');
71
+ const manifestDirectoryStat = pathExistsWithLstat(manifestDirectory);
72
+ if (!manifestDirectoryStat
73
+ || manifestDirectoryStat.isSymbolicLink()
74
+ || !manifestDirectoryStat.isDirectory()) {
75
+ throw new Error(`Plugin manifest directory must be a non-symbolic-link directory: ${manifestDirectory}`);
76
+ }
77
+ const manifestPath = path.join(manifestDirectory, 'plugin.json');
78
+ const manifestStat = pathExistsWithLstat(manifestPath);
79
+ if (!manifestStat || manifestStat.isSymbolicLink() || !manifestStat.isFile()) {
80
+ throw new Error(`Plugin manifest must be a regular non-symbolic-link file: ${manifestPath}`);
81
+ }
82
+ const canonicalManifest = fs.realpathSync(manifestPath);
83
+ if (!isInsideRoot(fs.realpathSync(pluginRoot), canonicalManifest)) {
84
+ throw new Error(`Plugin manifest must stay inside the plugin root: ${manifestPath}`);
85
+ }
86
+ return { repoRoot, pluginRoot, manifestPath };
87
+ }
88
+ export function resolveAuthoringPluginRoot(options) {
89
+ const requestedRepoRoot = path.resolve(options.repoRoot ?? '.');
90
+ if (!assertDirectoryNode(requestedRepoRoot, 'Workspace root')) {
91
+ throw new Error(`Workspace root is not a directory: ${requestedRepoRoot}`);
92
+ }
93
+ const repoRoot = fs.realpathSync(requestedRepoRoot);
94
+ const explicit = options.pluginRoot !== undefined;
95
+ const pluginRoot = explicit
96
+ ? path.resolve(repoRoot, options.pluginRoot)
97
+ : path.join(repoRoot, 'plugins', options.pluginName);
98
+ if (!isInsideRoot(repoRoot, pluginRoot)) {
99
+ throw new Error(`--plugin-root must be inside the workspace root: ${pluginRoot}`);
100
+ }
101
+ if (path.basename(pluginRoot) !== options.pluginName) {
102
+ throw new Error(`Plugin root directory ${JSON.stringify(path.basename(pluginRoot))} does not match plugin name ${JSON.stringify(options.pluginName)}.`);
103
+ }
104
+ assertAuthoringPluginPathFence({ repoRoot, pluginRoot });
105
+ return {
106
+ explicit,
107
+ repoRoot,
108
+ pluginRoot,
109
+ relativePluginRoot: path.relative(repoRoot, pluginRoot).split(path.sep).join('/'),
110
+ };
111
+ }
112
+ export function assertCanonicalAuthoringPluginRoot(options) {
113
+ const fenced = assertAuthoringPluginPathFence({
114
+ repoRoot: options.workspaceRoot,
115
+ pluginRoot: options.pluginRoot,
116
+ requirePluginRoot: options.requirePluginRoot ?? true,
117
+ requireManifest: options.requireManifest ?? false,
118
+ });
119
+ const expected = path.join(fenced.repoRoot, 'plugins', options.pluginName);
120
+ if (path.resolve(fenced.pluginRoot) !== path.resolve(expected)) {
121
+ throw new Error(`Plugin root must use the canonical workspace path: ${expected}`);
122
+ }
123
+ return { ...fenced, expectedPluginRoot: expected };
124
+ }
125
+ //# sourceMappingURL=plugin-root.mjs.map
@@ -0,0 +1 @@
1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E,kBAAkB,EAAE,QAAQ,EAAE,CAAC;AACrD,CAAC"}
@@ -0,0 +1,69 @@
1
+ export function parseStablePluginVersion(version: any, fieldName: any): {
2
+ raw: string;
3
+ major: number;
4
+ minor: number;
5
+ patch: number;
6
+ prerelease: string[];
7
+ build: string[];
8
+ };
9
+ export function runGit(repoRoot: any, args: any, options?: {}): Promise<string | NonSharedBuffer>;
10
+ export function resolveBaseCommit(repoRoot: any, base: any): Promise<any>;
11
+ export function readManifestDocument(pluginRoot: any): Promise<{
12
+ manifestPath: string;
13
+ manifest: any;
14
+ }>;
15
+ export function checkPluginVersions(options?: {}): Promise<{
16
+ schemaVersion: number;
17
+ policy: string;
18
+ ok: boolean;
19
+ base: null;
20
+ requestedBase: null;
21
+ baseCommit: null;
22
+ checkedPlugins: number;
23
+ checks: {
24
+ plugin: any;
25
+ ok: any;
26
+ status: any;
27
+ baseVersion: any;
28
+ currentVersion: any;
29
+ baseTarget: any;
30
+ currentTarget: any;
31
+ productionChanged: any;
32
+ baseDigest: any;
33
+ currentDigest: any;
34
+ changedPaths: any;
35
+ warnings: any;
36
+ errors: any;
37
+ }[];
38
+ } | {
39
+ schemaVersion: number;
40
+ policy: string;
41
+ ok: boolean;
42
+ base: {
43
+ requested: any;
44
+ commit: any;
45
+ };
46
+ requestedBase: any;
47
+ baseCommit: any;
48
+ checkedPlugins: number;
49
+ checks: {
50
+ plugin: any;
51
+ ok: any;
52
+ status: any;
53
+ baseVersion: any;
54
+ currentVersion: any;
55
+ baseTarget: any;
56
+ currentTarget: any;
57
+ productionChanged: any;
58
+ baseDigest: any;
59
+ currentDigest: any;
60
+ changedPaths: any;
61
+ warnings: any;
62
+ errors: any;
63
+ }[];
64
+ }>;
65
+ export function formatPluginVersionCheck(result: any): string;
66
+ export class PluginVersionCheckError extends Error {
67
+ constructor(code: any, message: any);
68
+ code: any;
69
+ }