@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,863 @@
1
+ import path from 'node:path';
2
+ import fs from 'fs-extra';
3
+ import { calculateFileDigest } from './bundle-integrity.js';
4
+ const CORE_RESOURCE_ROOT_PATTERN = /^(?:\.\/)?(?:references|assets|scripts|agents|evals|providers)(?:[\\/]|$)/u;
5
+ const ABSOLUTE_CORE_RESOURCE_PATTERN = /^\/(?:references|assets|scripts|agents|evals|providers)(?:\/|$)/u;
6
+ const WINDOWS_DRIVE_PATH_PATTERN = /^[A-Za-z]:/u;
7
+ const URI_SCHEME_PATTERN = /^[A-Za-z][A-Za-z0-9+.-]*:/u;
8
+ const ASCII_PUNCTUATION_PATTERN = /^[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]$/u;
9
+ const LINE_MARKER_PATTERN = /:\d+(?::\d+)?$/u;
10
+ function formatReference(skillKey, source, lexicalTarget, origin = 'SKILL.md') {
11
+ const sourceLabel = source === 'projection' ? 'projection' : source;
12
+ const originLabel = origin === 'SKILL.md' ? '' : ` from ${JSON.stringify(origin)}`;
13
+ return `skill ${JSON.stringify(skillKey)} ${sourceLabel} target ${JSON.stringify(lexicalTarget)}${originLabel}`;
14
+ }
15
+ function isEscaped(content, index) {
16
+ let backslashes = 0;
17
+ for (let cursor = index - 1; cursor >= 0 && content[cursor] === '\\'; cursor -= 1) {
18
+ backslashes += 1;
19
+ }
20
+ return backslashes % 2 === 1;
21
+ }
22
+ const COMMAND_FENCE_LANGUAGES = new Set([
23
+ '',
24
+ 'sh',
25
+ 'bash',
26
+ 'zsh',
27
+ 'shell',
28
+ 'powershell',
29
+ 'pwsh',
30
+ 'ps1',
31
+ 'cmd',
32
+ ]);
33
+ function parseFence(line) {
34
+ let cursor = 0;
35
+ while (cursor < line.length && cursor < 4 && line[cursor] === ' ')
36
+ cursor += 1;
37
+ if (cursor > 3)
38
+ return undefined;
39
+ const marker = line[cursor];
40
+ if (marker !== '`' && marker !== '~')
41
+ return undefined;
42
+ let end = cursor;
43
+ while (line[end] === marker)
44
+ end += 1;
45
+ if (end - cursor < 3)
46
+ return undefined;
47
+ if (marker === '`' && line.slice(end).includes('`'))
48
+ return undefined;
49
+ const info = line.slice(end).trim();
50
+ const language = info.split(/\s+/u, 1)[0]?.toLowerCase() ?? '';
51
+ return {
52
+ marker,
53
+ length: end - cursor,
54
+ capturesCommands: COMMAND_FENCE_LANGUAGES.has(language),
55
+ };
56
+ }
57
+ function isClosingFence(line, fence) {
58
+ let cursor = 0;
59
+ while (cursor < line.length && cursor < 4 && line[cursor] === ' ')
60
+ cursor += 1;
61
+ if (cursor > 3 || line[cursor] !== fence.marker)
62
+ return false;
63
+ let end = cursor;
64
+ while (line[end] === fence.marker)
65
+ end += 1;
66
+ return end - cursor >= fence.length && line.slice(end).trim() === '';
67
+ }
68
+ function splitMarkdownLines(content) {
69
+ const lines = [];
70
+ let cursor = 0;
71
+ while (cursor < content.length) {
72
+ const lineEnd = content.indexOf('\n', cursor);
73
+ const end = lineEnd < 0 ? content.length : lineEnd;
74
+ lines.push({
75
+ body: content.slice(cursor, end),
76
+ ending: lineEnd < 0 ? '' : '\n',
77
+ });
78
+ cursor = lineEnd < 0 ? content.length : lineEnd + 1;
79
+ }
80
+ return lines;
81
+ }
82
+ function maskMarkdownCode(content) {
83
+ return content.replace(/[^\n]/gu, ' ');
84
+ }
85
+ function isBlankMarkdownLine(line) {
86
+ return line.trim() === '';
87
+ }
88
+ function isIndentedCodeLine(line) {
89
+ return line.startsWith('\t') || line.startsWith(' ');
90
+ }
91
+ function stripIndentedCodePrefix(line) {
92
+ return line.startsWith('\t') ? line.slice(1) : line.slice(4);
93
+ }
94
+ function hasIndentedCodeContinuation(lines, start) {
95
+ let cursor = start;
96
+ while (cursor < lines.length && isBlankMarkdownLine(lines[cursor].body))
97
+ cursor += 1;
98
+ return cursor < lines.length && isIndentedCodeLine(lines[cursor].body);
99
+ }
100
+ function findClosingCodeSpan(content, start, markerLength) {
101
+ let cursor = start;
102
+ while (cursor < content.length) {
103
+ const opening = content.indexOf('`', cursor);
104
+ if (opening < 0)
105
+ return -1;
106
+ if (isEscaped(content, opening)) {
107
+ cursor = opening + 1;
108
+ continue;
109
+ }
110
+ let length = 1;
111
+ while (content[opening + length] === '`')
112
+ length += 1;
113
+ if (length === markerLength)
114
+ return opening;
115
+ cursor = opening + length;
116
+ }
117
+ return -1;
118
+ }
119
+ function partitionInlineCode(content, commandSnippets) {
120
+ let proseForLinks = '';
121
+ let cursor = 0;
122
+ while (cursor < content.length) {
123
+ let opening = content.indexOf('`', cursor);
124
+ while (opening >= 0 && isEscaped(content, opening)) {
125
+ opening = content.indexOf('`', opening + 1);
126
+ }
127
+ if (opening < 0) {
128
+ proseForLinks += content.slice(cursor);
129
+ break;
130
+ }
131
+ let markerLength = 1;
132
+ while (content[opening + markerLength] === '`')
133
+ markerLength += 1;
134
+ const closing = findClosingCodeSpan(content, opening + markerLength, markerLength);
135
+ if (closing < 0) {
136
+ proseForLinks += content.slice(cursor);
137
+ break;
138
+ }
139
+ proseForLinks += content.slice(cursor, opening);
140
+ const end = closing + markerLength;
141
+ commandSnippets.push(content.slice(opening + markerLength, closing));
142
+ proseForLinks += maskMarkdownCode(content.slice(opening, end));
143
+ cursor = end;
144
+ }
145
+ return proseForLinks;
146
+ }
147
+ function scanMarkdown(content) {
148
+ const lines = splitMarkdownLines(content);
149
+ const commandSnippets = [];
150
+ let proseWithoutInlineCode = '';
151
+ let lineIndex = 0;
152
+ while (lineIndex < lines.length) {
153
+ const line = lines[lineIndex];
154
+ const fence = parseFence(line.body);
155
+ if (fence) {
156
+ proseWithoutInlineCode += maskMarkdownCode(line.body) + line.ending;
157
+ lineIndex += 1;
158
+ let commandSnippet = '';
159
+ while (lineIndex < lines.length) {
160
+ const fencedLine = lines[lineIndex];
161
+ proseWithoutInlineCode += maskMarkdownCode(fencedLine.body) + fencedLine.ending;
162
+ lineIndex += 1;
163
+ if (isClosingFence(fencedLine.body, fence))
164
+ break;
165
+ if (fence.capturesCommands) {
166
+ commandSnippet += fencedLine.body + fencedLine.ending;
167
+ }
168
+ }
169
+ if (fence.capturesCommands && commandSnippet !== '') {
170
+ commandSnippets.push(commandSnippet);
171
+ }
172
+ continue;
173
+ }
174
+ if (!isBlankMarkdownLine(line.body) && isIndentedCodeLine(line.body)) {
175
+ let commandSnippet = '';
176
+ while (lineIndex < lines.length) {
177
+ const indentedLine = lines[lineIndex];
178
+ if (isBlankMarkdownLine(indentedLine.body)) {
179
+ if (!hasIndentedCodeContinuation(lines, lineIndex + 1))
180
+ break;
181
+ proseWithoutInlineCode += maskMarkdownCode(indentedLine.body) + indentedLine.ending;
182
+ commandSnippet += indentedLine.ending;
183
+ lineIndex += 1;
184
+ continue;
185
+ }
186
+ if (!isIndentedCodeLine(indentedLine.body))
187
+ break;
188
+ proseWithoutInlineCode += maskMarkdownCode(indentedLine.body) + indentedLine.ending;
189
+ commandSnippet += stripIndentedCodePrefix(indentedLine.body) + indentedLine.ending;
190
+ lineIndex += 1;
191
+ }
192
+ if (commandSnippet !== '')
193
+ commandSnippets.push(commandSnippet);
194
+ continue;
195
+ }
196
+ proseWithoutInlineCode += line.body + line.ending;
197
+ lineIndex += 1;
198
+ }
199
+ return {
200
+ proseForLinks: partitionInlineCode(proseWithoutInlineCode, commandSnippets),
201
+ commandSnippets,
202
+ };
203
+ }
204
+ function findClosingBracket(content, opening) {
205
+ let depth = 0;
206
+ for (let cursor = opening + 1; cursor < content.length; cursor += 1) {
207
+ const character = content[cursor];
208
+ if (character === '\n')
209
+ return -1;
210
+ if (character === '\\') {
211
+ cursor += 1;
212
+ continue;
213
+ }
214
+ if (character === '[')
215
+ depth += 1;
216
+ if (character === ']' && depth === 0)
217
+ return cursor;
218
+ if (character === ']')
219
+ depth -= 1;
220
+ }
221
+ return -1;
222
+ }
223
+ function skipMarkdownWhitespace(content, start) {
224
+ let cursor = start;
225
+ while (content[cursor] === ' ' || content[cursor] === '\t')
226
+ cursor += 1;
227
+ return cursor;
228
+ }
229
+ function findDefinitionDestinationStart(content, start) {
230
+ let cursor = skipMarkdownWhitespace(content, start);
231
+ if (content[cursor] === '\r' && content[cursor + 1] === '\n')
232
+ cursor += 1;
233
+ if (content[cursor] !== '\n')
234
+ return cursor;
235
+ cursor += 1;
236
+ let indentation = 0;
237
+ while (content[cursor] === ' ' && indentation < 4) {
238
+ cursor += 1;
239
+ indentation += 1;
240
+ }
241
+ if (indentation > 3 || content[cursor] === '\t')
242
+ return undefined;
243
+ return cursor;
244
+ }
245
+ function findInlineDestinationEnd(content, start) {
246
+ let cursor = skipMarkdownWhitespace(content, start);
247
+ if (content[cursor] === ')')
248
+ return cursor + 1;
249
+ const opening = content[cursor];
250
+ const closing = opening === '(' ? ')' : opening;
251
+ if (opening !== '"' && opening !== "'" && opening !== '(')
252
+ return -1;
253
+ cursor += 1;
254
+ let depth = 0;
255
+ for (; cursor < content.length && content[cursor] !== '\n'; cursor += 1) {
256
+ if (content[cursor] === '\\') {
257
+ cursor += 1;
258
+ continue;
259
+ }
260
+ if (opening === '(' && content[cursor] === '(')
261
+ depth += 1;
262
+ if (content[cursor] === closing) {
263
+ if (opening === '(' && depth > 0) {
264
+ depth -= 1;
265
+ continue;
266
+ }
267
+ cursor = skipMarkdownWhitespace(content, cursor + 1);
268
+ return content[cursor] === ')' ? cursor + 1 : -1;
269
+ }
270
+ }
271
+ return -1;
272
+ }
273
+ function parseMarkdownDestination(content, start, mode) {
274
+ let cursor = skipMarkdownWhitespace(content, start);
275
+ if (content[cursor] === '<') {
276
+ const destinationStart = cursor + 1;
277
+ cursor += 1;
278
+ while (cursor < content.length && content[cursor] !== '\n') {
279
+ if (content[cursor] === '\\') {
280
+ cursor += 2;
281
+ continue;
282
+ }
283
+ if (content[cursor] === '>') {
284
+ const lexicalTarget = content.slice(destinationStart, cursor);
285
+ if (mode === 'definition')
286
+ return { lexicalTarget, end: cursor + 1 };
287
+ const end = findInlineDestinationEnd(content, cursor + 1);
288
+ return end < 0 ? undefined : { lexicalTarget, end };
289
+ }
290
+ cursor += 1;
291
+ }
292
+ return undefined;
293
+ }
294
+ const destinationStart = cursor;
295
+ let depth = 0;
296
+ while (cursor < content.length && content[cursor] !== '\n') {
297
+ const character = content[cursor];
298
+ if (character === '\\') {
299
+ cursor += 2;
300
+ continue;
301
+ }
302
+ if (character === '(') {
303
+ depth += 1;
304
+ cursor += 1;
305
+ continue;
306
+ }
307
+ if (character === ')') {
308
+ if (depth > 0) {
309
+ depth -= 1;
310
+ cursor += 1;
311
+ continue;
312
+ }
313
+ if (mode === 'inline') {
314
+ return {
315
+ lexicalTarget: content.slice(destinationStart, cursor),
316
+ end: cursor + 1,
317
+ };
318
+ }
319
+ break;
320
+ }
321
+ if (character === ' ' || character === '\t')
322
+ break;
323
+ cursor += 1;
324
+ }
325
+ if (cursor === destinationStart || depth !== 0)
326
+ return undefined;
327
+ const lexicalTarget = content.slice(destinationStart, cursor);
328
+ if (mode === 'definition')
329
+ return { lexicalTarget, end: cursor };
330
+ const end = findInlineDestinationEnd(content, cursor);
331
+ return end < 0 ? undefined : { lexicalTarget, end };
332
+ }
333
+ function extractDefinitionReferences(content) {
334
+ const references = [];
335
+ let lineStart = 0;
336
+ while (lineStart < content.length) {
337
+ const lineEnd = content.indexOf('\n', lineStart);
338
+ const end = lineEnd < 0 ? content.length : lineEnd;
339
+ let cursor = lineStart;
340
+ while (cursor < end && cursor - lineStart < 4 && content[cursor] === ' ')
341
+ cursor += 1;
342
+ if (cursor - lineStart <= 3 && content[cursor] === '[' && !isEscaped(content, cursor)) {
343
+ const closingBracket = findClosingBracket(content, cursor);
344
+ if (closingBracket >= 0 && content[closingBracket + 1] === ':') {
345
+ const destinationStart = findDefinitionDestinationStart(content, closingBracket + 2);
346
+ const destination = destinationStart === undefined
347
+ ? undefined
348
+ : parseMarkdownDestination(content, destinationStart, 'definition');
349
+ if (destination) {
350
+ references.push({
351
+ lexicalTarget: destination.lexicalTarget,
352
+ source: 'markdown-link',
353
+ });
354
+ }
355
+ }
356
+ }
357
+ if (lineEnd < 0)
358
+ break;
359
+ lineStart = lineEnd + 1;
360
+ }
361
+ return references;
362
+ }
363
+ function extractMarkdownReferences(content) {
364
+ const references = extractDefinitionReferences(content);
365
+ let cursor = 0;
366
+ while (cursor < content.length) {
367
+ if (content[cursor] !== '[' || isEscaped(content, cursor)) {
368
+ cursor += 1;
369
+ continue;
370
+ }
371
+ const closingBracket = findClosingBracket(content, cursor);
372
+ if (closingBracket < 0 || content[closingBracket + 1] !== '(') {
373
+ cursor += 1;
374
+ continue;
375
+ }
376
+ const destination = parseMarkdownDestination(content, closingBracket + 2, 'inline');
377
+ if (!destination) {
378
+ cursor = closingBracket + 1;
379
+ continue;
380
+ }
381
+ references.push({
382
+ lexicalTarget: destination.lexicalTarget,
383
+ source: 'markdown-link',
384
+ });
385
+ cursor = destination.end;
386
+ }
387
+ return references;
388
+ }
389
+ function stripCommandTokenPunctuation(token) {
390
+ return token
391
+ .replace(/^[('"[{,;]+/u, '')
392
+ .replace(/[)'"\]},;]+$/u, '');
393
+ }
394
+ function stripShellRedirectionPrefix(token) {
395
+ return token.replace(/^\d*(?:<<<|<<|<>|>>|>&|<&|>|<)/u, '');
396
+ }
397
+ function extractCommandTokenCandidates(content) {
398
+ const candidates = [];
399
+ for (const rawToken of content.split(/\s+/u)) {
400
+ if (!rawToken)
401
+ continue;
402
+ const token = stripCommandTokenPunctuation(rawToken);
403
+ if (token)
404
+ candidates.push({
405
+ lexicalTarget: token,
406
+ pathTarget: stripShellRedirectionPrefix(token),
407
+ });
408
+ const assignmentIndex = token.indexOf('=');
409
+ if (assignmentIndex >= 0 && assignmentIndex < token.length - 1) {
410
+ const assignmentTarget = stripCommandTokenPunctuation(token.slice(assignmentIndex + 1));
411
+ candidates.push({
412
+ lexicalTarget: assignmentTarget,
413
+ pathTarget: stripShellRedirectionPrefix(assignmentTarget),
414
+ });
415
+ }
416
+ }
417
+ return candidates;
418
+ }
419
+ const LOCAL_EXECUTION_INTERPRETERS = new Set([
420
+ 'node',
421
+ 'python',
422
+ 'python3',
423
+ 'sh',
424
+ 'bash',
425
+ 'deno',
426
+ 'bun',
427
+ 'powershell',
428
+ 'pwsh',
429
+ 'cmd',
430
+ ]);
431
+ const WINDOWS_DRIVE_RELATIVE_PATH_PATTERN = /^[A-Za-z]:[^\\/]/u;
432
+ function normalizedWindowsLocalExecutionTarget(target) {
433
+ if (!target.startsWith('.\\'))
434
+ return undefined;
435
+ return `./${target.slice(2).replaceAll('\\', '/')}`;
436
+ }
437
+ function explicitLocalExecutionTargets(commandSnippet) {
438
+ const targets = new Map();
439
+ for (const segment of commandSnippet.split(/(?:\r?\n|&&|\|\||[;|])/u)) {
440
+ const normalizedSegment = segment.replace(/^\s*\$\s+/u, '');
441
+ const candidates = extractCommandTokenCandidates(normalizedSegment);
442
+ const executionTokens = normalizedSegment
443
+ .split(/\s+/u)
444
+ .map(stripCommandTokenPunctuation)
445
+ .filter(Boolean);
446
+ let executableIndex = 0;
447
+ while (executableIndex < executionTokens.length
448
+ && /^[A-Za-z_][A-Za-z0-9_]*=/u.test(executionTokens[executableIndex])) {
449
+ executableIndex += 1;
450
+ }
451
+ const executableToken = executionTokens[executableIndex];
452
+ const executable = executableToken === undefined
453
+ ? undefined
454
+ : stripShellRedirectionPrefix(executableToken);
455
+ if (!executable)
456
+ continue;
457
+ if (LOCAL_EXECUTION_INTERPRETERS.has(executable)) {
458
+ for (const candidate of candidates) {
459
+ if (candidate.pathTarget.startsWith('./')) {
460
+ targets.set(candidate.lexicalTarget, { pathTarget: candidate.pathTarget, direct: false });
461
+ }
462
+ }
463
+ for (const argument of executionTokens.slice(executableIndex + 1)) {
464
+ if (WINDOWS_DRIVE_RELATIVE_PATH_PATTERN.test(argument)) {
465
+ targets.set(argument, { pathTarget: argument, direct: false });
466
+ }
467
+ }
468
+ if (executable === 'powershell' || executable === 'pwsh') {
469
+ for (const argument of executionTokens.slice(executableIndex + 1)) {
470
+ const normalized = normalizedWindowsLocalExecutionTarget(argument);
471
+ if (normalized)
472
+ targets.set(argument, { pathTarget: normalized, direct: false });
473
+ }
474
+ }
475
+ if (executable === 'cmd') {
476
+ const commandSwitchIndex = executionTokens.findIndex((token, index) => index > executableIndex && token.toLowerCase() === '/c');
477
+ const commandTarget = commandSwitchIndex < 0
478
+ ? undefined
479
+ : executionTokens[commandSwitchIndex + 1];
480
+ if (commandTarget) {
481
+ const normalized = normalizedWindowsLocalExecutionTarget(commandTarget);
482
+ if (normalized) {
483
+ targets.set(commandTarget, { pathTarget: normalized, direct: false });
484
+ }
485
+ }
486
+ }
487
+ continue;
488
+ }
489
+ if (executable.startsWith('./')
490
+ && executable !== './'
491
+ && (executionTokens.length > executableIndex + 1
492
+ || commandSnippet.includes('\n')
493
+ || !executable.endsWith('.json'))) {
494
+ targets.set(executableToken, { pathTarget: executable, direct: true });
495
+ }
496
+ }
497
+ return targets;
498
+ }
499
+ function commandSnippetHasExecutionSignal(commandSnippet) {
500
+ for (const segment of commandSnippet.split(/(?:\r?\n|&&|\|\||[;|])/u)) {
501
+ const tokens = segment
502
+ .replace(/^\s*\$\s+/u, '')
503
+ .split(/\s+/u)
504
+ .map(stripCommandTokenPunctuation)
505
+ .filter(Boolean);
506
+ let executableIndex = 0;
507
+ while (executableIndex < tokens.length
508
+ && /^[A-Za-z_][A-Za-z0-9_]*=/u.test(tokens[executableIndex])) {
509
+ executableIndex += 1;
510
+ }
511
+ const executable = stripShellRedirectionPrefix(tokens[executableIndex] ?? '');
512
+ if (LOCAL_EXECUTION_INTERPRETERS.has(executable)
513
+ || executable.startsWith('./')
514
+ || tokens.length > executableIndex + 1) {
515
+ return true;
516
+ }
517
+ }
518
+ return false;
519
+ }
520
+ function extractCommandReferences(commandSnippets, requireExecutionSignal = false) {
521
+ const references = [];
522
+ for (const commandSnippet of commandSnippets) {
523
+ if (requireExecutionSignal && !commandSnippetHasExecutionSignal(commandSnippet))
524
+ continue;
525
+ const executionTargets = explicitLocalExecutionTargets(commandSnippet);
526
+ for (const candidate of extractCommandTokenCandidates(commandSnippet)) {
527
+ const explicitExecutionTarget = executionTargets.get(candidate.lexicalTarget);
528
+ references.push({
529
+ lexicalTarget: candidate.lexicalTarget,
530
+ source: 'inline-command',
531
+ commandPathTarget: explicitExecutionTarget?.pathTarget ?? candidate.pathTarget,
532
+ explicitLocalExecution: explicitExecutionTarget !== undefined,
533
+ directLocalExecution: explicitExecutionTarget?.direct,
534
+ });
535
+ }
536
+ }
537
+ return references;
538
+ }
539
+ const PLAIN_CORE_RESOURCE_PATTERN = /(?:^|[\s'"`])((?:references|assets|scripts|agents|evals|providers)\/[A-Za-z0-9._()\-/]+)/gmu;
540
+ function plainTextScanContent(content) {
541
+ return content
542
+ .replace(/\\`[^\n]*\\`/gu, (value) => maskMarkdownCode(value))
543
+ .replace(/\\?\[[^\]\n]*\]\((?:\\.|[^)\n]|\([^\n)]*\))*\)/gu, (value) => maskMarkdownCode(value))
544
+ .replace(/^ {0,3}\[[^\]\n]+\]:[^\n]*(?:\n {1,3}\S[^\n]*)?/gmu, (value) => maskMarkdownCode(value));
545
+ }
546
+ function extractPlainTextReferences(content) {
547
+ return [...plainTextScanContent(content).matchAll(PLAIN_CORE_RESOURCE_PATTERN)]
548
+ .map((match) => match[1].replace(/[),.;:'"\]}]+$/gu, ''))
549
+ .filter((target) => !target.endsWith('/'))
550
+ .map((lexicalTarget) => ({ lexicalTarget, source: 'plain-text' }));
551
+ }
552
+ function isExcludedReference(reference) {
553
+ const target = reference.commandPathTarget ?? reference.lexicalTarget;
554
+ return (target === ''
555
+ || target === '.'
556
+ || target === '..'
557
+ || target === './'
558
+ || target === '../'
559
+ || target.startsWith('#')
560
+ || target.includes('$')
561
+ || (reference.source === 'inline-command'
562
+ && /^%[^%\s]+%(?:[\\/][^\s]*)?$/u.test(target))
563
+ || target.includes('{')
564
+ || target.includes('}')
565
+ || target.includes('<')
566
+ || target.includes('>')
567
+ || target.includes('*')
568
+ || target.includes('[')
569
+ || target.includes(']'));
570
+ }
571
+ function stripReferenceSuffix(target) {
572
+ const fragmentIndex = target.indexOf('#');
573
+ let pathTarget = fragmentIndex >= 0 ? target.slice(0, fragmentIndex) : target;
574
+ const queryIndex = pathTarget.indexOf('?');
575
+ if (queryIndex >= 0) {
576
+ const query = pathTarget.slice(queryIndex + 1);
577
+ const targetBeforeQuery = pathTarget.slice(0, queryIndex);
578
+ const basenameBeforeQuery = path.posix.basename(targetBeforeQuery);
579
+ if (!query.includes('=')
580
+ && !query.includes('&')
581
+ && !basenameBeforeQuery.includes('.')) {
582
+ return { pathTarget, hasQuestionGlob: true };
583
+ }
584
+ pathTarget = targetBeforeQuery;
585
+ }
586
+ return {
587
+ pathTarget,
588
+ hasQuestionGlob: false,
589
+ };
590
+ }
591
+ function normalizeMarkdownDestination(skillKey, reference) {
592
+ const referenceLabel = formatReference(skillKey, reference.source, reference.lexicalTarget);
593
+ let normalized = '';
594
+ for (let cursor = 0; cursor < reference.lexicalTarget.length; cursor += 1) {
595
+ const character = reference.lexicalTarget[cursor];
596
+ if (character !== '\\') {
597
+ normalized += character;
598
+ continue;
599
+ }
600
+ const escaped = reference.lexicalTarget[cursor + 1];
601
+ if (!escaped || !ASCII_PUNCTUATION_PATTERN.test(escaped)) {
602
+ throw new Error(`Invalid runtime Skill closure: ${referenceLabel} contains an invalid Markdown escape.`);
603
+ }
604
+ if (escaped === '?' || escaped === '#' || escaped === '%') {
605
+ normalized += `%${escaped.charCodeAt(0).toString(16).toUpperCase()}`;
606
+ }
607
+ else {
608
+ normalized += escaped;
609
+ }
610
+ cursor += 1;
611
+ }
612
+ return normalized;
613
+ }
614
+ function decodeMarkdownPath(skillKey, reference, pathTarget) {
615
+ const referenceLabel = formatReference(skillKey, reference.source, reference.lexicalTarget);
616
+ for (let cursor = 0; cursor < pathTarget.length; cursor += 1) {
617
+ if (pathTarget[cursor] !== '%')
618
+ continue;
619
+ if (!/^[0-9A-Fa-f]{2}$/u.test(pathTarget.slice(cursor + 1, cursor + 3))) {
620
+ throw new Error(`Invalid runtime Skill closure: ${referenceLabel} contains an invalid percent escape.`);
621
+ }
622
+ cursor += 2;
623
+ }
624
+ try {
625
+ return decodeURIComponent(pathTarget);
626
+ }
627
+ catch {
628
+ throw new Error(`Invalid runtime Skill closure: ${referenceLabel} contains an invalid percent escape.`);
629
+ }
630
+ }
631
+ function hasParentTraversal(target) {
632
+ return target.replaceAll('\\', '/').split('/').includes('..');
633
+ }
634
+ function isExternalMarkdownTarget(target) {
635
+ return target.startsWith('//') || (!WINDOWS_DRIVE_PATH_PATTERN.test(target)
636
+ && URI_SCHEME_PATTERN.test(target));
637
+ }
638
+ function isLexicallyLocalReference(reference, pathTarget) {
639
+ if (reference.source === 'markdown-link' || reference.source === 'plain-text') {
640
+ return true;
641
+ }
642
+ return (pathTarget.startsWith('../')
643
+ || pathTarget.startsWith('..\\')
644
+ || hasParentTraversal(pathTarget)
645
+ || ABSOLUTE_CORE_RESOURCE_PATTERN.test(pathTarget)
646
+ || (CORE_RESOURCE_ROOT_PATTERN.test(pathTarget)
647
+ && /[\\/]/u.test(pathTarget)
648
+ && !pathTarget.endsWith('/')));
649
+ }
650
+ function normalizeLocalTarget(skillKey, source, lexicalTarget, pathTarget, origin = 'SKILL.md') {
651
+ const referenceLabel = formatReference(skillKey, source, lexicalTarget, origin);
652
+ if (pathTarget.includes('\\')) {
653
+ throw new Error(`Invalid runtime Skill closure: ${referenceLabel} must use POSIX separators.`);
654
+ }
655
+ if (path.posix.isAbsolute(pathTarget) || WINDOWS_DRIVE_PATH_PATTERN.test(pathTarget)) {
656
+ throw new Error(`Invalid runtime Skill closure: ${referenceLabel} must be relative.`);
657
+ }
658
+ const relativeTarget = pathTarget.startsWith('./') ? pathTarget.slice(2) : pathTarget;
659
+ if (relativeTarget === ''
660
+ || relativeTarget === '..'
661
+ || relativeTarget.startsWith('../')
662
+ || relativeTarget.split('/').includes('..')
663
+ || path.posix.normalize(relativeTarget) !== relativeTarget) {
664
+ throw new Error(`Invalid runtime Skill closure: ${referenceLabel} is not a normalized Skill-local path.`);
665
+ }
666
+ return relativeTarget;
667
+ }
668
+ async function pathExistsWithoutFollowingSymlinks(skillRoot, relativeTarget) {
669
+ let current = skillRoot;
670
+ for (const segment of relativeTarget.split('/')) {
671
+ current = path.join(current, segment);
672
+ let stats;
673
+ try {
674
+ stats = await fs.lstat(current);
675
+ }
676
+ catch (error) {
677
+ if (error.code === 'ENOENT')
678
+ return false;
679
+ throw error;
680
+ }
681
+ if (stats.isSymbolicLink())
682
+ return true;
683
+ }
684
+ return true;
685
+ }
686
+ async function shouldValidateReference(skillRoot, reference, pathTarget) {
687
+ if (isLexicallyLocalReference(reference, pathTarget))
688
+ return true;
689
+ if (reference.source !== 'inline-command')
690
+ return false;
691
+ if (pathTarget === './eval-runtime-capabilities.json')
692
+ return false;
693
+ if (reference.explicitLocalExecution)
694
+ return true;
695
+ if (pathTarget === './')
696
+ return false;
697
+ if (!pathTarget.startsWith('./'))
698
+ return false;
699
+ if (pathTarget.includes('\\'))
700
+ return true;
701
+ const relativeTarget = pathTarget.slice(2);
702
+ if (relativeTarget === '' || relativeTarget.split('/').includes('..'))
703
+ return true;
704
+ return pathExistsWithoutFollowingSymlinks(skillRoot, relativeTarget);
705
+ }
706
+ async function assertRegularSkillLocalFile(options) {
707
+ const referenceLabel = formatReference(options.skillKey, options.source, options.lexicalTarget, options.origin);
708
+ let current = options.skillRoot;
709
+ const segments = options.relativeTarget.split('/');
710
+ for (const [index, segment] of segments.entries()) {
711
+ current = path.join(current, segment);
712
+ let stats;
713
+ try {
714
+ stats = await fs.lstat(current);
715
+ }
716
+ catch (error) {
717
+ if (['ENOENT', 'ENOTDIR'].includes(error.code ?? '')) {
718
+ if (options.declaredGeneratedFiles?.has(options.relativeTarget))
719
+ return;
720
+ throw new Error(`Invalid runtime Skill closure: ${referenceLabel} is missing.`);
721
+ }
722
+ throw error;
723
+ }
724
+ if (stats.isSymbolicLink()) {
725
+ throw new Error(`Invalid runtime Skill closure: ${referenceLabel} contains a symbolic link.`);
726
+ }
727
+ if (index < segments.length - 1 && !stats.isDirectory()) {
728
+ throw new Error(`Invalid runtime Skill closure: ${referenceLabel} has a non-directory parent.`);
729
+ }
730
+ if (index === segments.length - 1 && !stats.isFile()) {
731
+ throw new Error(`Invalid runtime Skill closure: ${referenceLabel} is not a regular file.`);
732
+ }
733
+ }
734
+ const [realSkillRoot, realTarget] = await Promise.all([
735
+ fs.realpath(options.skillRoot),
736
+ fs.realpath(current),
737
+ ]);
738
+ const relativeToRoot = path.relative(realSkillRoot, realTarget);
739
+ if (relativeToRoot === '..'
740
+ || relativeToRoot.startsWith(`..${path.sep}`)
741
+ || path.isAbsolute(relativeToRoot)) {
742
+ throw new Error(`Invalid runtime Skill closure: ${referenceLabel} resolves outside the Skill root.`);
743
+ }
744
+ }
745
+ function resolveMarkdownTargetFromOrigin(origin, pathTarget) {
746
+ if (origin === 'SKILL.md'
747
+ || CORE_RESOURCE_ROOT_PATTERN.test(pathTarget)
748
+ || pathTarget.includes('\\')
749
+ || path.posix.isAbsolute(pathTarget)
750
+ || WINDOWS_DRIVE_PATH_PATTERN.test(pathTarget)) {
751
+ return pathTarget;
752
+ }
753
+ return path.posix.normalize(path.posix.join(path.posix.dirname(origin), pathTarget));
754
+ }
755
+ function isAgentFacingTextResource(relativeTarget) {
756
+ return ['.md', '.markdown', '.txt'].includes(path.posix.extname(relativeTarget).toLowerCase());
757
+ }
758
+ export async function validateRuntimeSkillClosure(skillRoot, options = {}) {
759
+ const skillRootStats = await fs.lstat(skillRoot).catch(() => undefined);
760
+ if (!skillRootStats?.isDirectory() || skillRootStats.isSymbolicLink()) {
761
+ throw new Error(`Invalid runtime Skill closure: skill ${JSON.stringify(path.basename(skillRoot))} root must be a regular directory.`);
762
+ }
763
+ const skillKey = path.basename(skillRoot);
764
+ const skillMarkdownPath = path.join(skillRoot, 'SKILL.md');
765
+ const skillMarkdownStats = await fs.lstat(skillMarkdownPath).catch(() => undefined);
766
+ if (!skillMarkdownStats?.isFile() || skillMarkdownStats.isSymbolicLink()) {
767
+ throw new Error(`Invalid runtime Skill closure: skill ${JSON.stringify(skillKey)} is missing a regular SKILL.md.`);
768
+ }
769
+ const pending = ['SKILL.md'];
770
+ const visited = new Set();
771
+ while (pending.length > 0) {
772
+ const origin = pending.shift();
773
+ if (visited.has(origin))
774
+ continue;
775
+ visited.add(origin);
776
+ const content = await fs.readFile(path.join(skillRoot, ...origin.split('/')), 'utf8');
777
+ const scan = scanMarkdown(content);
778
+ const references = [
779
+ ...extractMarkdownReferences(scan.proseForLinks),
780
+ ...extractCommandReferences(scan.commandSnippets, origin !== 'SKILL.md'),
781
+ ...extractPlainTextReferences(scan.proseForLinks),
782
+ ];
783
+ const seen = new Set();
784
+ for (const reference of references) {
785
+ const dedupeKey = `${reference.source}\0${reference.lexicalTarget}\0${reference.explicitLocalExecution === true}`;
786
+ if (seen.has(dedupeKey))
787
+ continue;
788
+ seen.add(dedupeKey);
789
+ if (isExcludedReference(reference))
790
+ continue;
791
+ if (origin !== 'SKILL.md' && reference.directLocalExecution === true)
792
+ continue;
793
+ const normalizedTarget = reference.source === 'markdown-link'
794
+ ? normalizeMarkdownDestination(skillKey, reference)
795
+ : reference.commandPathTarget ?? reference.lexicalTarget;
796
+ let { pathTarget, hasQuestionGlob } = stripReferenceSuffix(normalizedTarget);
797
+ if (hasQuestionGlob)
798
+ continue;
799
+ if (reference.source === 'markdown-link') {
800
+ pathTarget = decodeMarkdownPath(skillKey, reference, pathTarget);
801
+ if (isExternalMarkdownTarget(pathTarget))
802
+ continue;
803
+ pathTarget = resolveMarkdownTargetFromOrigin(origin, pathTarget);
804
+ }
805
+ if (!WINDOWS_DRIVE_PATH_PATTERN.test(pathTarget)) {
806
+ pathTarget = pathTarget.replace(LINE_MARKER_PATTERN, '');
807
+ }
808
+ if (!(await shouldValidateReference(skillRoot, reference, pathTarget)))
809
+ continue;
810
+ const relativeTarget = normalizeLocalTarget(skillKey, reference.source, reference.lexicalTarget, pathTarget, origin);
811
+ await assertRegularSkillLocalFile({
812
+ skillRoot,
813
+ skillKey,
814
+ source: reference.source,
815
+ lexicalTarget: reference.lexicalTarget,
816
+ relativeTarget,
817
+ origin,
818
+ declaredGeneratedFiles: options.declaredGeneratedFiles,
819
+ });
820
+ if (!options.declaredGeneratedFiles?.has(relativeTarget)
821
+ && isAgentFacingTextResource(relativeTarget)
822
+ && !visited.has(relativeTarget)) {
823
+ pending.push(relativeTarget);
824
+ }
825
+ }
826
+ }
827
+ }
828
+ export async function validateRuntimeSkillClosuresRoot(skillsRoot) {
829
+ const rootStats = await fs.lstat(skillsRoot).catch(() => undefined);
830
+ if (!rootStats?.isDirectory() || rootStats.isSymbolicLink()) {
831
+ throw new Error('Invalid runtime Skill closure: skills root must be a regular directory.');
832
+ }
833
+ const entries = await fs.readdir(skillsRoot, { withFileTypes: true });
834
+ for (const entry of entries.sort((left, right) => left.name.localeCompare(right.name))) {
835
+ if (entry.isSymbolicLink()) {
836
+ throw new Error(`Invalid runtime Skill closure: skill ${JSON.stringify(entry.name)} root contains a symbolic link.`);
837
+ }
838
+ if (!entry.isDirectory())
839
+ continue;
840
+ await validateRuntimeSkillClosure(path.join(skillsRoot, entry.name));
841
+ }
842
+ }
843
+ export async function validateSkillRuntimeProjectionFreshness(outputRoot, provenance) {
844
+ for (const entry of provenance) {
845
+ const skillRoot = path.join(outputRoot, entry.platform, 'skills', entry.skill);
846
+ const relativeTarget = normalizeLocalTarget(entry.skill, 'projection', entry.target, entry.target);
847
+ await assertRegularSkillLocalFile({
848
+ skillRoot,
849
+ skillKey: entry.skill,
850
+ source: 'projection',
851
+ lexicalTarget: entry.target,
852
+ relativeTarget,
853
+ });
854
+ if (entry.sourceDigest !== entry.targetDigest) {
855
+ throw new Error(`Invalid runtime Skill closure: ${formatReference(entry.skill, 'projection', entry.target)} has inconsistent recorded digests.`);
856
+ }
857
+ const finalDigest = await calculateFileDigest(path.join(skillRoot, ...relativeTarget.split('/')));
858
+ if (finalDigest !== entry.targetDigest) {
859
+ throw new Error(`Invalid runtime Skill closure: ${formatReference(entry.skill, 'projection', entry.target)} changed after projection.`);
860
+ }
861
+ }
862
+ }
863
+ //# sourceMappingURL=runtime-skill-closure.js.map