@agentxm/client-core 0.2.0 → 0.3.2

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 (362) hide show
  1. package/dist/src/unstable/commands/operations/disable.d.ts +2 -2
  2. package/dist/src/unstable/commands/operations/disable.d.ts.map +1 -1
  3. package/dist/src/unstable/commands/operations/enable.d.ts +2 -2
  4. package/dist/src/unstable/commands/operations/enable.d.ts.map +1 -1
  5. package/dist/src/unstable/commands/operations/install.d.ts +1 -1
  6. package/dist/src/unstable/commands/operations/install.d.ts.map +1 -1
  7. package/dist/src/unstable/commands/operations/new-command.d.ts +2 -2
  8. package/dist/src/unstable/commands/operations/new-command.d.ts.map +1 -1
  9. package/dist/src/unstable/commands/operations/publish.d.ts +1 -1
  10. package/dist/src/unstable/commands/operations/publish.d.ts.map +1 -1
  11. package/dist/src/unstable/commands/operations/uninstall.d.ts +1 -1
  12. package/dist/src/unstable/commands/operations/uninstall.d.ts.map +1 -1
  13. package/dist/src/unstable/extensions/operations.d.ts +1 -1
  14. package/dist/src/unstable/extensions/operations.d.ts.map +1 -1
  15. package/dist/src/unstable/lint/catalog/index.d.ts +39 -0
  16. package/dist/src/unstable/lint/catalog/index.d.ts.map +1 -0
  17. package/dist/src/unstable/lint/catalog/index.js +49 -0
  18. package/dist/src/unstable/lint/catalog/index.js.map +1 -0
  19. package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.d.ts +31 -0
  20. package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.d.ts.map +1 -0
  21. package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.js +41 -0
  22. package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.js.map +1 -0
  23. package/dist/src/unstable/lint/catalog/pack/manifest-present.d.ts +18 -0
  24. package/dist/src/unstable/lint/catalog/pack/manifest-present.d.ts.map +1 -0
  25. package/dist/src/unstable/lint/catalog/pack/manifest-present.js +41 -0
  26. package/dist/src/unstable/lint/catalog/pack/manifest-present.js.map +1 -0
  27. package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.d.ts +26 -0
  28. package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.d.ts.map +1 -0
  29. package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.js +34 -0
  30. package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.js.map +1 -0
  31. package/dist/src/unstable/lint/catalog/pack-accessor/contexts.d.ts +61 -0
  32. package/dist/src/unstable/lint/catalog/pack-accessor/contexts.d.ts.map +1 -0
  33. package/dist/src/unstable/lint/catalog/pack-accessor/contexts.js +46 -0
  34. package/dist/src/unstable/lint/catalog/pack-accessor/contexts.js.map +1 -0
  35. package/dist/src/unstable/lint/catalog/pack-accessor/platform.d.ts +53 -0
  36. package/dist/src/unstable/lint/catalog/pack-accessor/platform.d.ts.map +1 -0
  37. package/dist/src/unstable/lint/catalog/pack-accessor/platform.js +90 -0
  38. package/dist/src/unstable/lint/catalog/pack-accessor/platform.js.map +1 -0
  39. package/dist/src/unstable/lint/catalog/pack-accessor/vft.d.ts +60 -0
  40. package/dist/src/unstable/lint/catalog/pack-accessor/vft.d.ts.map +1 -0
  41. package/dist/src/unstable/lint/catalog/pack-accessor/vft.js +85 -0
  42. package/dist/src/unstable/lint/catalog/pack-accessor/vft.js.map +1 -0
  43. package/dist/src/unstable/lint/catalog/pack.d.ts +37 -0
  44. package/dist/src/unstable/lint/catalog/pack.d.ts.map +1 -0
  45. package/dist/src/unstable/lint/catalog/pack.js +47 -0
  46. package/dist/src/unstable/lint/catalog/pack.js.map +1 -0
  47. package/dist/src/unstable/lint/catalog/shared/schema-rule.d.ts +59 -0
  48. package/dist/src/unstable/lint/catalog/shared/schema-rule.d.ts.map +1 -0
  49. package/dist/src/unstable/lint/catalog/shared/schema-rule.js +99 -0
  50. package/dist/src/unstable/lint/catalog/shared/schema-rule.js.map +1 -0
  51. package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.d.ts +31 -0
  52. package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.d.ts.map +1 -0
  53. package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.js +151 -0
  54. package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.js.map +1 -0
  55. package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.d.ts +26 -0
  56. package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.d.ts.map +1 -0
  57. package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.js +41 -0
  58. package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.js.map +1 -0
  59. package/dist/src/unstable/lint/catalog/skill/manifest-present.d.ts +18 -0
  60. package/dist/src/unstable/lint/catalog/skill/manifest-present.d.ts.map +1 -0
  61. package/dist/src/unstable/lint/catalog/skill/manifest-present.js +46 -0
  62. package/dist/src/unstable/lint/catalog/skill/manifest-present.js.map +1 -0
  63. package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.d.ts +22 -0
  64. package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.d.ts.map +1 -0
  65. package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.js +37 -0
  66. package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.js.map +1 -0
  67. package/dist/src/unstable/lint/catalog/skill/skill-md-present.d.ts +17 -0
  68. package/dist/src/unstable/lint/catalog/skill/skill-md-present.d.ts.map +1 -0
  69. package/dist/src/unstable/lint/catalog/skill/skill-md-present.js +38 -0
  70. package/dist/src/unstable/lint/catalog/skill/skill-md-present.js.map +1 -0
  71. package/dist/src/unstable/lint/catalog/skill-accessor/contexts.d.ts +65 -0
  72. package/dist/src/unstable/lint/catalog/skill-accessor/contexts.d.ts.map +1 -0
  73. package/dist/src/unstable/lint/catalog/skill-accessor/contexts.js +50 -0
  74. package/dist/src/unstable/lint/catalog/skill-accessor/contexts.js.map +1 -0
  75. package/dist/src/unstable/lint/catalog/skill-accessor/platform.d.ts +52 -0
  76. package/dist/src/unstable/lint/catalog/skill-accessor/platform.d.ts.map +1 -0
  77. package/dist/src/unstable/lint/catalog/skill-accessor/platform.js +89 -0
  78. package/dist/src/unstable/lint/catalog/skill-accessor/platform.js.map +1 -0
  79. package/dist/src/unstable/lint/catalog/skill-accessor/vft.d.ts +58 -0
  80. package/dist/src/unstable/lint/catalog/skill-accessor/vft.d.ts.map +1 -0
  81. package/dist/src/unstable/lint/catalog/skill-accessor/vft.js +83 -0
  82. package/dist/src/unstable/lint/catalog/skill-accessor/vft.js.map +1 -0
  83. package/dist/src/unstable/lint/catalog/skill.d.ts +38 -0
  84. package/dist/src/unstable/lint/catalog/skill.d.ts.map +1 -0
  85. package/dist/src/unstable/lint/catalog/skill.js +52 -0
  86. package/dist/src/unstable/lint/catalog/skill.js.map +1 -0
  87. package/dist/src/unstable/lint/catalog/workspace/agents-detected-declared.d.ts +23 -0
  88. package/dist/src/unstable/lint/catalog/workspace/agents-detected-declared.d.ts.map +1 -0
  89. package/dist/src/unstable/lint/catalog/workspace/agents-detected-declared.js +75 -0
  90. package/dist/src/unstable/lint/catalog/workspace/agents-detected-declared.js.map +1 -0
  91. package/dist/src/unstable/lint/catalog/workspace/agents-recognized.d.ts +23 -0
  92. package/dist/src/unstable/lint/catalog/workspace/agents-recognized.d.ts.map +1 -0
  93. package/dist/src/unstable/lint/catalog/workspace/agents-recognized.js +76 -0
  94. package/dist/src/unstable/lint/catalog/workspace/agents-recognized.js.map +1 -0
  95. package/dist/src/unstable/lint/catalog/workspace/helpers/empty.d.ts +18 -0
  96. package/dist/src/unstable/lint/catalog/workspace/helpers/empty.d.ts.map +1 -0
  97. package/dist/src/unstable/lint/catalog/workspace/helpers/empty.js +16 -0
  98. package/dist/src/unstable/lint/catalog/workspace/helpers/empty.js.map +1 -0
  99. package/dist/src/unstable/lint/catalog/workspace/helpers/install-ops.d.ts +133 -0
  100. package/dist/src/unstable/lint/catalog/workspace/helpers/install-ops.d.ts.map +1 -0
  101. package/dist/src/unstable/lint/catalog/workspace/helpers/install-ops.js +149 -0
  102. package/dist/src/unstable/lint/catalog/workspace/helpers/install-ops.js.map +1 -0
  103. package/dist/src/unstable/lint/catalog/workspace/helpers/registry-source.d.ts +25 -0
  104. package/dist/src/unstable/lint/catalog/workspace/helpers/registry-source.d.ts.map +1 -0
  105. package/dist/src/unstable/lint/catalog/workspace/helpers/registry-source.js +30 -0
  106. package/dist/src/unstable/lint/catalog/workspace/helpers/registry-source.js.map +1 -0
  107. package/dist/src/unstable/lint/catalog/workspace/initialized.d.ts +22 -0
  108. package/dist/src/unstable/lint/catalog/workspace/initialized.d.ts.map +1 -0
  109. package/dist/src/unstable/lint/catalog/workspace/initialized.js +55 -0
  110. package/dist/src/unstable/lint/catalog/workspace/initialized.js.map +1 -0
  111. package/dist/src/unstable/lint/catalog/workspace/lockfile-valid.d.ts +33 -0
  112. package/dist/src/unstable/lint/catalog/workspace/lockfile-valid.d.ts.map +1 -0
  113. package/dist/src/unstable/lint/catalog/workspace/lockfile-valid.js +125 -0
  114. package/dist/src/unstable/lint/catalog/workspace/lockfile-valid.js.map +1 -0
  115. package/dist/src/unstable/lint/catalog/workspace/packs-declarations-valid.d.ts +19 -0
  116. package/dist/src/unstable/lint/catalog/workspace/packs-declarations-valid.d.ts.map +1 -0
  117. package/dist/src/unstable/lint/catalog/workspace/packs-declarations-valid.js +145 -0
  118. package/dist/src/unstable/lint/catalog/workspace/packs-declarations-valid.js.map +1 -0
  119. package/dist/src/unstable/lint/catalog/workspace/packs-dependencies-resolved.d.ts +17 -0
  120. package/dist/src/unstable/lint/catalog/workspace/packs-dependencies-resolved.d.ts.map +1 -0
  121. package/dist/src/unstable/lint/catalog/workspace/packs-dependencies-resolved.js +107 -0
  122. package/dist/src/unstable/lint/catalog/workspace/packs-dependencies-resolved.js.map +1 -0
  123. package/dist/src/unstable/lint/catalog/workspace/packs-members-retained.d.ts +22 -0
  124. package/dist/src/unstable/lint/catalog/workspace/packs-members-retained.d.ts.map +1 -0
  125. package/dist/src/unstable/lint/catalog/workspace/packs-members-retained.js +163 -0
  126. package/dist/src/unstable/lint/catalog/workspace/packs-members-retained.js.map +1 -0
  127. package/dist/src/unstable/lint/catalog/workspace/settings-schema-valid.d.ts +28 -0
  128. package/dist/src/unstable/lint/catalog/workspace/settings-schema-valid.d.ts.map +1 -0
  129. package/dist/src/unstable/lint/catalog/workspace/settings-schema-valid.js +67 -0
  130. package/dist/src/unstable/lint/catalog/workspace/settings-schema-valid.js.map +1 -0
  131. package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-clean.d.ts +30 -0
  132. package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-clean.d.ts.map +1 -0
  133. package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-clean.js +232 -0
  134. package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-clean.js.map +1 -0
  135. package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-correct.d.ts +26 -0
  136. package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-correct.d.ts.map +1 -0
  137. package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-correct.js +129 -0
  138. package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-correct.js.map +1 -0
  139. package/dist/src/unstable/lint/catalog/workspace/skills-declarations-valid.d.ts +26 -0
  140. package/dist/src/unstable/lint/catalog/workspace/skills-declarations-valid.d.ts.map +1 -0
  141. package/dist/src/unstable/lint/catalog/workspace/skills-declarations-valid.js +151 -0
  142. package/dist/src/unstable/lint/catalog/workspace/skills-declarations-valid.js.map +1 -0
  143. package/dist/src/unstable/lint/catalog/workspace/skills-integrity-valid.d.ts +29 -0
  144. package/dist/src/unstable/lint/catalog/workspace/skills-integrity-valid.d.ts.map +1 -0
  145. package/dist/src/unstable/lint/catalog/workspace/skills-integrity-valid.js +149 -0
  146. package/dist/src/unstable/lint/catalog/workspace/skills-integrity-valid.js.map +1 -0
  147. package/dist/src/unstable/lint/catalog/workspace/skills-lockfile-aligned.d.ts +29 -0
  148. package/dist/src/unstable/lint/catalog/workspace/skills-lockfile-aligned.d.ts.map +1 -0
  149. package/dist/src/unstable/lint/catalog/workspace/skills-lockfile-aligned.js +242 -0
  150. package/dist/src/unstable/lint/catalog/workspace/skills-lockfile-aligned.js.map +1 -0
  151. package/dist/src/unstable/lint/catalog/workspace-accessor/contexts.d.ts +141 -0
  152. package/dist/src/unstable/lint/catalog/workspace-accessor/contexts.d.ts.map +1 -0
  153. package/dist/src/unstable/lint/catalog/workspace-accessor/contexts.js +123 -0
  154. package/dist/src/unstable/lint/catalog/workspace-accessor/contexts.js.map +1 -0
  155. package/dist/src/unstable/lint/catalog/workspace-accessor/interpret-ops.d.ts +38 -0
  156. package/dist/src/unstable/lint/catalog/workspace-accessor/interpret-ops.d.ts.map +1 -0
  157. package/dist/src/unstable/lint/catalog/workspace-accessor/interpret-ops.js +311 -0
  158. package/dist/src/unstable/lint/catalog/workspace-accessor/interpret-ops.js.map +1 -0
  159. package/dist/src/unstable/lint/catalog/workspace-accessor/platform.d.ts +60 -0
  160. package/dist/src/unstable/lint/catalog/workspace-accessor/platform.d.ts.map +1 -0
  161. package/dist/src/unstable/lint/catalog/workspace-accessor/platform.js +201 -0
  162. package/dist/src/unstable/lint/catalog/workspace-accessor/platform.js.map +1 -0
  163. package/dist/src/unstable/lint/catalog/workspace-accessor/test-state.d.ts +65 -0
  164. package/dist/src/unstable/lint/catalog/workspace-accessor/test-state.d.ts.map +1 -0
  165. package/dist/src/unstable/lint/catalog/workspace-accessor/test-state.js +95 -0
  166. package/dist/src/unstable/lint/catalog/workspace-accessor/test-state.js.map +1 -0
  167. package/dist/src/unstable/lint/catalog/workspace.d.ts +47 -0
  168. package/dist/src/unstable/lint/catalog/workspace.d.ts.map +1 -0
  169. package/dist/src/unstable/lint/catalog/workspace.js +80 -0
  170. package/dist/src/unstable/lint/catalog/workspace.js.map +1 -0
  171. package/dist/src/unstable/lint/cli.d.ts +297 -0
  172. package/dist/src/unstable/lint/cli.d.ts.map +1 -0
  173. package/dist/src/unstable/lint/cli.js +388 -0
  174. package/dist/src/unstable/lint/cli.js.map +1 -0
  175. package/dist/src/unstable/lint/compose-path.d.ts +27 -0
  176. package/dist/src/unstable/lint/compose-path.d.ts.map +1 -0
  177. package/dist/src/unstable/lint/compose-path.js +61 -0
  178. package/dist/src/unstable/lint/compose-path.js.map +1 -0
  179. package/dist/src/unstable/lint/config.d.ts +103 -0
  180. package/dist/src/unstable/lint/config.d.ts.map +1 -0
  181. package/dist/src/unstable/lint/config.js +137 -0
  182. package/dist/src/unstable/lint/config.js.map +1 -0
  183. package/dist/src/unstable/lint/context.d.ts +265 -0
  184. package/dist/src/unstable/lint/context.d.ts.map +1 -0
  185. package/dist/src/unstable/lint/context.js +21 -0
  186. package/dist/src/unstable/lint/context.js.map +1 -0
  187. package/dist/src/unstable/lint/evaluate.d.ts +68 -0
  188. package/dist/src/unstable/lint/evaluate.d.ts.map +1 -0
  189. package/dist/src/unstable/lint/evaluate.js +147 -0
  190. package/dist/src/unstable/lint/evaluate.js.map +1 -0
  191. package/dist/src/unstable/lint/index.d.ts +28 -0
  192. package/dist/src/unstable/lint/index.d.ts.map +1 -0
  193. package/dist/src/unstable/lint/index.js +35 -0
  194. package/dist/src/unstable/lint/index.js.map +1 -0
  195. package/dist/src/unstable/lint/issues-to-findings.d.ts +35 -0
  196. package/dist/src/unstable/lint/issues-to-findings.d.ts.map +1 -0
  197. package/dist/src/unstable/lint/issues-to-findings.js +97 -0
  198. package/dist/src/unstable/lint/issues-to-findings.js.map +1 -0
  199. package/dist/src/unstable/lint/rule.d.ts +139 -0
  200. package/dist/src/unstable/lint/rule.d.ts.map +1 -0
  201. package/dist/src/unstable/lint/rule.js +25 -0
  202. package/dist/src/unstable/lint/rule.js.map +1 -0
  203. package/dist/src/unstable/mcp-servers/operations/install.d.ts +1 -1
  204. package/dist/src/unstable/mcp-servers/operations/install.d.ts.map +1 -1
  205. package/dist/src/unstable/mcp-servers/operations/publish.d.ts +1 -1
  206. package/dist/src/unstable/mcp-servers/operations/publish.d.ts.map +1 -1
  207. package/dist/src/unstable/mcp-servers/operations/uninstall.d.ts +1 -1
  208. package/dist/src/unstable/mcp-servers/operations/uninstall.d.ts.map +1 -1
  209. package/dist/src/unstable/packs/operations/add-to-pack.d.ts +2 -2
  210. package/dist/src/unstable/packs/operations/add-to-pack.d.ts.map +1 -1
  211. package/dist/src/unstable/packs/operations/install.d.ts +2 -2
  212. package/dist/src/unstable/packs/operations/install.d.ts.map +1 -1
  213. package/dist/src/unstable/packs/operations/new-pack.d.ts +2 -2
  214. package/dist/src/unstable/packs/operations/new-pack.d.ts.map +1 -1
  215. package/dist/src/unstable/packs/operations/publish.d.ts +2 -2
  216. package/dist/src/unstable/packs/operations/publish.d.ts.map +1 -1
  217. package/dist/src/unstable/packs/operations/remove-from-pack.d.ts +2 -2
  218. package/dist/src/unstable/packs/operations/remove-from-pack.d.ts.map +1 -1
  219. package/dist/src/unstable/packs/operations/uninstall.d.ts +2 -2
  220. package/dist/src/unstable/packs/operations/uninstall.d.ts.map +1 -1
  221. package/dist/src/unstable/packs/operations/unpack.d.ts +2 -2
  222. package/dist/src/unstable/packs/operations/unpack.d.ts.map +1 -1
  223. package/dist/src/unstable/{workspace → plan}/apply-plan.d.ts +9 -0
  224. package/dist/src/unstable/plan/apply-plan.d.ts.map +1 -0
  225. package/dist/src/unstable/{workspace → plan}/apply-plan.js +10 -1
  226. package/dist/src/unstable/plan/apply-plan.js.map +1 -0
  227. package/dist/src/unstable/plan/index.d.ts +24 -0
  228. package/dist/src/unstable/plan/index.d.ts.map +1 -0
  229. package/dist/src/unstable/plan/index.js +28 -0
  230. package/dist/src/unstable/plan/index.js.map +1 -0
  231. package/dist/src/unstable/{workspace → plan}/plan.d.ts +6 -0
  232. package/dist/src/unstable/plan/plan.d.ts.map +1 -0
  233. package/dist/src/unstable/{workspace → plan}/plan.js +6 -0
  234. package/dist/src/unstable/plan/plan.js.map +1 -0
  235. package/dist/src/unstable/{workspace → plan}/resolve-plan.d.ts +30 -2
  236. package/dist/src/unstable/plan/resolve-plan.d.ts.map +1 -0
  237. package/dist/src/unstable/{workspace → plan}/resolve-plan.js +37 -6
  238. package/dist/src/unstable/plan/resolve-plan.js.map +1 -0
  239. package/dist/src/unstable/publish/manifest-policy.d.ts +8 -8
  240. package/dist/src/unstable/settings/index.d.ts +2 -0
  241. package/dist/src/unstable/settings/index.d.ts.map +1 -1
  242. package/dist/src/unstable/settings/index.js +1 -0
  243. package/dist/src/unstable/settings/index.js.map +1 -1
  244. package/dist/src/unstable/settings/schema.d.ts +3 -0
  245. package/dist/src/unstable/settings/schema.d.ts.map +1 -1
  246. package/dist/src/unstable/settings/schema.js +3 -0
  247. package/dist/src/unstable/settings/schema.js.map +1 -1
  248. package/dist/src/unstable/settings/settings.d.ts +10 -0
  249. package/dist/src/unstable/settings/settings.d.ts.map +1 -1
  250. package/dist/src/unstable/skills/operations/copy.d.ts +2 -2
  251. package/dist/src/unstable/skills/operations/copy.d.ts.map +1 -1
  252. package/dist/src/unstable/skills/operations/disable.d.ts +2 -2
  253. package/dist/src/unstable/skills/operations/disable.d.ts.map +1 -1
  254. package/dist/src/unstable/skills/operations/enable.d.ts +2 -2
  255. package/dist/src/unstable/skills/operations/enable.d.ts.map +1 -1
  256. package/dist/src/unstable/skills/operations/install.d.ts +2 -2
  257. package/dist/src/unstable/skills/operations/install.d.ts.map +1 -1
  258. package/dist/src/unstable/skills/operations/new-skill.d.ts +2 -2
  259. package/dist/src/unstable/skills/operations/new-skill.d.ts.map +1 -1
  260. package/dist/src/unstable/skills/operations/publish.d.ts +2 -2
  261. package/dist/src/unstable/skills/operations/publish.d.ts.map +1 -1
  262. package/dist/src/unstable/skills/operations/rename.d.ts +2 -2
  263. package/dist/src/unstable/skills/operations/rename.d.ts.map +1 -1
  264. package/dist/src/unstable/skills/operations/uninstall.d.ts +2 -2
  265. package/dist/src/unstable/skills/operations/uninstall.d.ts.map +1 -1
  266. package/dist/src/unstable/subagents/operations/disable.d.ts +2 -2
  267. package/dist/src/unstable/subagents/operations/disable.d.ts.map +1 -1
  268. package/dist/src/unstable/subagents/operations/enable.d.ts +2 -2
  269. package/dist/src/unstable/subagents/operations/enable.d.ts.map +1 -1
  270. package/dist/src/unstable/subagents/operations/publish.d.ts +2 -2
  271. package/dist/src/unstable/subagents/operations/publish.d.ts.map +1 -1
  272. package/dist/src/unstable/workflows/install-command/workflow.d.ts +1 -1
  273. package/dist/src/unstable/workflows/install-command/workflow.d.ts.map +1 -1
  274. package/dist/src/unstable/workflows/install-command/workflow.js +1 -1
  275. package/dist/src/unstable/workflows/install-command/workflow.js.map +1 -1
  276. package/dist/src/unstable/workflows/uninstall-command/workflow.d.ts +1 -1
  277. package/dist/src/unstable/workflows/uninstall-command/workflow.d.ts.map +1 -1
  278. package/dist/src/unstable/workflows/uninstall-command/workflow.js +1 -1
  279. package/dist/src/unstable/workflows/uninstall-command/workflow.js.map +1 -1
  280. package/dist/src/unstable/workspace/augment-plan.d.ts +1 -1
  281. package/dist/src/unstable/workspace/augment-plan.d.ts.map +1 -1
  282. package/dist/src/unstable/workspace/display-plan.d.ts +1 -1
  283. package/dist/src/unstable/workspace/display-plan.d.ts.map +1 -1
  284. package/dist/src/unstable/workspace/display-plan.js.map +1 -1
  285. package/dist/src/unstable/workspace/index.d.ts +0 -5
  286. package/dist/src/unstable/workspace/index.d.ts.map +1 -1
  287. package/dist/src/unstable/workspace/index.js +3 -7
  288. package/dist/src/unstable/workspace/index.js.map +1 -1
  289. package/dist/src/unstable/workspace/initialization.d.ts +15 -0
  290. package/dist/src/unstable/workspace/initialization.d.ts.map +1 -1
  291. package/dist/src/unstable/workspace/paths.d.ts +0 -18
  292. package/dist/src/unstable/workspace/paths.d.ts.map +1 -1
  293. package/dist/src/unstable/workspace/paths.js +12 -2
  294. package/dist/src/unstable/workspace/paths.js.map +1 -1
  295. package/dist/src/unstable/workspace/reconciliation.d.ts +1 -1
  296. package/dist/src/unstable/workspace/reconciliation.d.ts.map +1 -1
  297. package/dist/src/unstable/workspace/scan-plan-readiness.d.ts +1 -1
  298. package/dist/src/unstable/workspace/scan-plan-readiness.d.ts.map +1 -1
  299. package/dist/src/unstable/workspace/settings-validation/types.d.ts +11 -1
  300. package/dist/src/unstable/workspace/settings-validation/types.d.ts.map +1 -1
  301. package/package.json +10 -2
  302. package/site-content/__generated__/schemas/axm-lock.schema.json +727 -1124
  303. package/site-content/__generated__/schemas/axm-package-meta.schema.json +3 -16
  304. package/site-content/__generated__/schemas/command.schema.json +29 -130
  305. package/site-content/__generated__/schemas/extension-pack.schema.json +36 -154
  306. package/site-content/__generated__/schemas/mcp-server.schema.json +21 -134
  307. package/site-content/__generated__/schemas/settings.schema.json +111 -291
  308. package/site-content/__generated__/schemas/skill.schema.json +23 -143
  309. package/dist/src/unstable/workspace/apply-plan.d.ts.map +0 -1
  310. package/dist/src/unstable/workspace/apply-plan.js.map +0 -1
  311. package/dist/src/unstable/workspace/doctor/check-def.d.ts +0 -29
  312. package/dist/src/unstable/workspace/doctor/check-def.d.ts.map +0 -1
  313. package/dist/src/unstable/workspace/doctor/check-def.js +0 -17
  314. package/dist/src/unstable/workspace/doctor/check-def.js.map +0 -1
  315. package/dist/src/unstable/workspace/doctor/checks/agents-configured.d.ts +0 -5
  316. package/dist/src/unstable/workspace/doctor/checks/agents-configured.d.ts.map +0 -1
  317. package/dist/src/unstable/workspace/doctor/checks/agents-configured.js +0 -170
  318. package/dist/src/unstable/workspace/doctor/checks/agents-configured.js.map +0 -1
  319. package/dist/src/unstable/workspace/doctor/checks/extensions-active.d.ts +0 -4
  320. package/dist/src/unstable/workspace/doctor/checks/extensions-active.d.ts.map +0 -1
  321. package/dist/src/unstable/workspace/doctor/checks/extensions-active.js +0 -238
  322. package/dist/src/unstable/workspace/doctor/checks/extensions-active.js.map +0 -1
  323. package/dist/src/unstable/workspace/doctor/checks/extensions-current.d.ts +0 -18
  324. package/dist/src/unstable/workspace/doctor/checks/extensions-current.d.ts.map +0 -1
  325. package/dist/src/unstable/workspace/doctor/checks/extensions-current.js +0 -92
  326. package/dist/src/unstable/workspace/doctor/checks/extensions-current.js.map +0 -1
  327. package/dist/src/unstable/workspace/doctor/checks/extensions-installed.d.ts +0 -5
  328. package/dist/src/unstable/workspace/doctor/checks/extensions-installed.d.ts.map +0 -1
  329. package/dist/src/unstable/workspace/doctor/checks/extensions-installed.js +0 -472
  330. package/dist/src/unstable/workspace/doctor/checks/extensions-installed.js.map +0 -1
  331. package/dist/src/unstable/workspace/doctor/checks/workspace-ready.d.ts +0 -5
  332. package/dist/src/unstable/workspace/doctor/checks/workspace-ready.d.ts.map +0 -1
  333. package/dist/src/unstable/workspace/doctor/checks/workspace-ready.js +0 -201
  334. package/dist/src/unstable/workspace/doctor/checks/workspace-ready.js.map +0 -1
  335. package/dist/src/unstable/workspace/doctor/diagnose.d.ts +0 -49
  336. package/dist/src/unstable/workspace/doctor/diagnose.d.ts.map +0 -1
  337. package/dist/src/unstable/workspace/doctor/diagnose.js +0 -78
  338. package/dist/src/unstable/workspace/doctor/diagnose.js.map +0 -1
  339. package/dist/src/unstable/workspace/doctor/index.d.ts +0 -8
  340. package/dist/src/unstable/workspace/doctor/index.d.ts.map +0 -1
  341. package/dist/src/unstable/workspace/doctor/index.js +0 -6
  342. package/dist/src/unstable/workspace/doctor/index.js.map +0 -1
  343. package/dist/src/unstable/workspace/doctor/rollup.d.ts +0 -4
  344. package/dist/src/unstable/workspace/doctor/rollup.d.ts.map +0 -1
  345. package/dist/src/unstable/workspace/doctor/rollup.js +0 -28
  346. package/dist/src/unstable/workspace/doctor/rollup.js.map +0 -1
  347. package/dist/src/unstable/workspace/doctor/runner.d.ts +0 -6
  348. package/dist/src/unstable/workspace/doctor/runner.d.ts.map +0 -1
  349. package/dist/src/unstable/workspace/doctor/runner.js +0 -179
  350. package/dist/src/unstable/workspace/doctor/runner.js.map +0 -1
  351. package/dist/src/unstable/workspace/doctor/types.d.ts +0 -127
  352. package/dist/src/unstable/workspace/doctor/types.d.ts.map +0 -1
  353. package/dist/src/unstable/workspace/doctor/types.js +0 -60
  354. package/dist/src/unstable/workspace/doctor/types.js.map +0 -1
  355. package/dist/src/unstable/workspace/plan.d.ts.map +0 -1
  356. package/dist/src/unstable/workspace/plan.js.map +0 -1
  357. package/dist/src/unstable/workspace/resolve-plan.d.ts.map +0 -1
  358. package/dist/src/unstable/workspace/resolve-plan.js.map +0 -1
  359. package/dist/src/unstable/workspace/sync.d.ts +0 -17
  360. package/dist/src/unstable/workspace/sync.d.ts.map +0 -1
  361. package/dist/src/unstable/workspace/sync.js +0 -142
  362. package/dist/src/unstable/workspace/sync.js.map +0 -1
@@ -0,0 +1,297 @@
1
+ /**
2
+ * Lint runner — the reusable core of `axm lint`.
3
+ *
4
+ * The `axm lint` CLI command file is a thin surface over flag parsing and
5
+ * rendering; the logic that evaluates rule catalogs, renders findings, detects
6
+ * publish-gate drift, and (under `--fix`) composes the autofix plan lives in
7
+ * this module.
8
+ *
9
+ * Phase 5 entry points (see `openspec/changes/add-lint-engine/tasks.md`):
10
+ *
11
+ * - {@link evaluateAllCatalogs} — concurrent evaluation of the three
12
+ * v1 rule catalogs against pre-built contexts.
13
+ * - {@link summarizeEvaluations} — group, count, and derive the exit
14
+ * category from raw `Evaluated<*>` lists.
15
+ * - {@link detectPublishGateDrift} — compute whether the configured
16
+ * `LintConfig` weakens any `skill/*` / `pack/*` platform-default-`error`
17
+ * rule (task 5.7).
18
+ * - {@link renderFindingsText} — finding-first human renderer (task
19
+ * 5.6).
20
+ * - {@link toLintJsonDocument} — `--json` document shape (task 5.6).
21
+ * - {@link resolveLintExitCategory} — exit-code contract evaluator (task
22
+ * 5.9).
23
+ *
24
+ * Lint-intent → canonical `Operation` adapter composition happens in the CLI
25
+ * handler (`packages/cli/src/root/lint/handler.ts`), which re-resolves each
26
+ * intent's `source` via the `resolveConfigured*` helpers and hands the
27
+ * resulting canonical Operation to the per-extension plan-step builder. The
28
+ * runner here stays accessor-free.
29
+ *
30
+ * @experimental This API is unstable and may change without notice.
31
+ * @packageDocumentation
32
+ */
33
+ import * as Effect from "effect/Effect";
34
+ import type { LintConfig } from "./config.js";
35
+ import { platformCanonicalLintConfig } from "./config.js";
36
+ import type { Evaluated } from "./evaluate.js";
37
+ import type { PackRuleContext, SkillRuleContext, WorkspaceRuleContext } from "./context.js";
38
+ import type { AutofixingRule, LintFinding, Severity } from "./rule.js";
39
+ /**
40
+ * A single finding annotated with the context that produced it.
41
+ *
42
+ * `displayRoot` carries the context's rendering root; `path` is the
43
+ * pre-composed display path for the finding so consumers (text / JSON /
44
+ * summary logs) don't re-derive it.
45
+ *
46
+ * @experimental This API is unstable and may change without notice.
47
+ */
48
+ export interface RenderedFinding {
49
+ readonly group: "skill" | "pack" | "workspace";
50
+ readonly displayRoot: string;
51
+ readonly path: string;
52
+ readonly finding: LintFinding;
53
+ }
54
+ /**
55
+ * Per-group evaluation result. The raw `Evaluated<*>` list is retained so
56
+ * downstream consumers (render, JSON emitter, `collectFixOperations`) can
57
+ * walk evaluations without re-running rules.
58
+ *
59
+ * @experimental This API is unstable and may change without notice.
60
+ */
61
+ export interface GroupEvaluations {
62
+ readonly skills: ReadonlyArray<Evaluated<SkillRuleContext>>;
63
+ readonly packs: ReadonlyArray<Evaluated<PackRuleContext>>;
64
+ readonly workspace: ReadonlyArray<Evaluated<WorkspaceRuleContext>>;
65
+ }
66
+ /**
67
+ * Aggregate counts across all emitted findings.
68
+ *
69
+ * `total` === `errors + warnings + infos` — info findings participate in
70
+ * rendering and in the JSON envelope, but never influence exit code.
71
+ *
72
+ * @experimental This API is unstable and may change without notice.
73
+ */
74
+ export interface FindingCounts {
75
+ readonly total: number;
76
+ readonly errors: number;
77
+ readonly warnings: number;
78
+ readonly infos: number;
79
+ }
80
+ /**
81
+ * Possible exit-code categories for `axm lint`.
82
+ *
83
+ * - `"clean"` — zero findings, or only info-severity findings; zero exit.
84
+ * - `"warnings"` — at least one warning, no errors; non-zero only when
85
+ * `--strict` is set (see {@link resolveLintExitCategory}).
86
+ * - `"errors"` — at least one error; non-zero exit regardless of flags.
87
+ *
88
+ * @experimental This API is unstable and may change without notice.
89
+ */
90
+ export type LintExitCategory = "clean" | "warnings" | "errors";
91
+ /**
92
+ * Build the three v1 evaluation groups concurrently.
93
+ *
94
+ * The evaluator is a pure `Effect.Effect<ReadonlyArray<Evaluated<C>>>`; this
95
+ * helper simply hands the three catalogs to `Effect.all` with unbounded
96
+ * concurrency so catalog evaluations run in parallel but findings stay in
97
+ * stable catalog order inside each group.
98
+ *
99
+ * @experimental This API is unstable and may change without notice.
100
+ */
101
+ export declare const evaluateAllCatalogs: (args: {
102
+ readonly skillContexts: ReadonlyArray<SkillRuleContext>;
103
+ readonly packContexts: ReadonlyArray<PackRuleContext>;
104
+ readonly workspaceContext: WorkspaceRuleContext;
105
+ readonly config: LintConfig;
106
+ }) => Effect.Effect<GroupEvaluations>;
107
+ /**
108
+ * Flatten a {@link GroupEvaluations} triple into a single `RenderedFinding[]`
109
+ * in stable group-then-catalog order.
110
+ *
111
+ * @experimental This API is unstable and may change without notice.
112
+ */
113
+ export declare const collectRenderedFindings: (evaluations: GroupEvaluations) => ReadonlyArray<RenderedFinding>;
114
+ /**
115
+ * Count findings by severity across every group.
116
+ *
117
+ * @experimental This API is unstable and may change without notice.
118
+ */
119
+ export declare const countFindings: (findings: ReadonlyArray<RenderedFinding>) => FindingCounts;
120
+ /**
121
+ * Aggregated summary — counts + derived exit category — computed from a
122
+ * {@link GroupEvaluations} triple.
123
+ *
124
+ * @experimental This API is unstable and may change without notice.
125
+ */
126
+ export interface LintSummary {
127
+ readonly findings: ReadonlyArray<RenderedFinding>;
128
+ readonly counts: FindingCounts;
129
+ readonly exitCategory: LintExitCategory;
130
+ readonly driftBanner: ReadonlyArray<string>;
131
+ }
132
+ /**
133
+ * Derive a full {@link LintSummary} (findings, counts, exit category, drift
134
+ * banner rule ids) from raw evaluations + the configured severity overrides.
135
+ *
136
+ * @experimental This API is unstable and may change without notice.
137
+ */
138
+ export declare const summarizeEvaluations: (evaluations: GroupEvaluations, config: LintConfig) => LintSummary;
139
+ /**
140
+ * Translate a {@link LintExitCategory} + `--strict` into the exit-code
141
+ * policy.
142
+ *
143
+ * | Category | --strict=false | --strict=true |
144
+ * | ------------ | -------------- | ------------- |
145
+ * | `"clean"` | `0` | `0` |
146
+ * | `"warnings"` | `0` | non-zero |
147
+ * | `"errors"` | non-zero | non-zero |
148
+ *
149
+ * The return value is a discriminated enum; the CLI handler maps the `"fail"`
150
+ * branch to its platform exit-code primitive.
151
+ *
152
+ * @experimental This API is unstable and may change without notice.
153
+ */
154
+ export declare const resolveLintExitCategory: (args: {
155
+ readonly category: LintExitCategory;
156
+ readonly strict: boolean;
157
+ }) => "success" | "fail";
158
+ /**
159
+ * Identify every configured `lint.rules` entry that weakens a platform-canonical
160
+ * `error`-severity `skill/*` or `pack/*` rule.
161
+ *
162
+ * The publish gate runs the `skill/*` and `pack/*` catalogs against
163
+ * {@link platformCanonicalLintConfig}; any workspace override that lowers a
164
+ * rule in those namespaces from `error` to `off | info | warn` creates a
165
+ * publish-gate divergence the user should know about (they'll see `error`
166
+ * findings from the registry that don't appear locally).
167
+ *
168
+ * Workspace-only rule weakenings (`workspace/*`) do NOT trigger the banner —
169
+ * those never reach publish.
170
+ *
171
+ * Returns the rule ids that trigger the banner, in catalog order, so the
172
+ * renderer can produce stable deterministic output.
173
+ *
174
+ * @experimental This API is unstable and may change without notice.
175
+ */
176
+ export declare const detectPublishGateDrift: (config: LintConfig) => ReadonlyArray<string>;
177
+ /**
178
+ * Input for the human text renderer.
179
+ *
180
+ * The `fixSummary` slot is reserved for the trailing `--fix` summary line
181
+ * (populated after `applyPlan` completes). When `undefined`, no summary is
182
+ * rendered — the read-only `axm lint` run.
183
+ *
184
+ * @experimental This API is unstable and may change without notice.
185
+ */
186
+ export interface RenderFindingsArgs {
187
+ readonly summary: LintSummary;
188
+ readonly fixSummary?: FixSummary;
189
+ }
190
+ /**
191
+ * Outcome of a `--fix` run; used by the renderer and the JSON emitter.
192
+ *
193
+ * @experimental This API is unstable and may change without notice.
194
+ */
195
+ export interface FixSummary {
196
+ readonly attempted: number;
197
+ readonly applied: number;
198
+ readonly failed: number;
199
+ readonly warnings: ReadonlyArray<string>;
200
+ }
201
+ /**
202
+ * Render a finding-first human text report.
203
+ *
204
+ * Output shape (one line per entry, grouped first by context type then by
205
+ * severity within each group):
206
+ *
207
+ * DRIFT: The registry will still block publish on these rules:
208
+ * - skill/manifest-schema-valid
209
+ *
210
+ * WORKSPACE
211
+ * [error] workspace/lockfile-valid axm-lock.yaml is missing. ./axm-lock.yaml
212
+ * [warning] workspace/... ...
213
+ *
214
+ * SKILLS
215
+ * [error] ...
216
+ *
217
+ * Summary: 2 errors, 1 warning.
218
+ * Applied 3 fixes; 1 warning surfaced from applyPlan.
219
+ *
220
+ * @experimental This API is unstable and may change without notice.
221
+ */
222
+ export declare const renderFindingsText: (args: RenderFindingsArgs) => ReadonlyArray<string>;
223
+ /**
224
+ * JSON-renderable finding entry used by the `--json` document.
225
+ *
226
+ * @experimental This API is unstable and may change without notice.
227
+ */
228
+ export interface LintJsonFinding {
229
+ readonly group: "skill" | "pack" | "workspace";
230
+ readonly kind: "autofixable" | "advisory";
231
+ readonly ruleId: string;
232
+ readonly severity: Severity;
233
+ readonly message: string;
234
+ readonly displayRoot: string;
235
+ readonly path: string;
236
+ readonly location?: {
237
+ readonly file: string;
238
+ readonly line?: number;
239
+ readonly column?: number;
240
+ };
241
+ readonly suggestions: ReadonlyArray<string>;
242
+ }
243
+ /**
244
+ * JSON envelope shape returned under `axm lint --json`.
245
+ *
246
+ * Mirrors the design doc §9 envelope for the CLI and matches the registry
247
+ * publish failure envelope structure (`findings[]`, `displayRoot` per entry,
248
+ * per-finding `path` pre-composed). `--fix` runs add a `fix` summary block.
249
+ *
250
+ * @experimental This API is unstable and may change without notice.
251
+ */
252
+ export interface LintJsonDocument {
253
+ readonly findings: ReadonlyArray<LintJsonFinding>;
254
+ readonly summary: {
255
+ readonly total: number;
256
+ readonly errors: number;
257
+ readonly warnings: number;
258
+ readonly infos: number;
259
+ readonly exitCategory: LintExitCategory;
260
+ };
261
+ readonly driftBanner: ReadonlyArray<string>;
262
+ readonly fix?: {
263
+ readonly attempted: number;
264
+ readonly applied: number;
265
+ readonly failed: number;
266
+ readonly warnings: ReadonlyArray<string>;
267
+ };
268
+ }
269
+ /**
270
+ * Build the `--json` document from a {@link LintSummary} (+ optional fix
271
+ * summary).
272
+ *
273
+ * @experimental This API is unstable and may change without notice.
274
+ */
275
+ export declare const toLintJsonDocument: (args: {
276
+ readonly summary: LintSummary;
277
+ readonly fixSummary?: FixSummary;
278
+ }) => LintJsonDocument;
279
+ /**
280
+ * Walk workspace evaluations (the only v1 namespace that ships
281
+ * `AutofixingRule`s) and return the set of `(rule, finding, context)` triples
282
+ * the CLI handler can dispatch on to produce canonical Operations.
283
+ *
284
+ * The returned triples point at the already-evaluated `AutofixableFinding`
285
+ * values so the renderer and the fix pipeline share a single source of truth.
286
+ *
287
+ * @experimental This API is unstable and may change without notice.
288
+ */
289
+ export declare const collectAutofixableEntries: (evaluations: GroupEvaluations) => ReadonlyArray<{
290
+ readonly rule: AutofixingRule<WorkspaceRuleContext>;
291
+ readonly context: WorkspaceRuleContext;
292
+ readonly finding: LintFinding & {
293
+ readonly kind: "autofixable";
294
+ };
295
+ }>;
296
+ export { platformCanonicalLintConfig };
297
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../src/unstable/lint/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CA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;QACvB,QAAQ,CAAC,YAAY,EAAE,gBAAgB,CAAC;KACzC,CAAC;IACF,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5C,QAAQ,CAAC,GAAG,CAAC,EAAE;QACb,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;KAC1C,CAAC;CACH;AA0BD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM;IACvC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;CAClC,KAAG,gBAyBH,CAAC;AAMF;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,GACpC,aAAa,gBAAgB,KAC5B,aAAa,CAAC;IACf,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,oBAAoB,CAAC,CAAC;IACpD,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAA;KAAE,CAAC;CAClE,CAiBA,CAAC;AAMF,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
@@ -0,0 +1,388 @@
1
+ /**
2
+ * Lint runner — the reusable core of `axm lint`.
3
+ *
4
+ * The `axm lint` CLI command file is a thin surface over flag parsing and
5
+ * rendering; the logic that evaluates rule catalogs, renders findings, detects
6
+ * publish-gate drift, and (under `--fix`) composes the autofix plan lives in
7
+ * this module.
8
+ *
9
+ * Phase 5 entry points (see `openspec/changes/add-lint-engine/tasks.md`):
10
+ *
11
+ * - {@link evaluateAllCatalogs} — concurrent evaluation of the three
12
+ * v1 rule catalogs against pre-built contexts.
13
+ * - {@link summarizeEvaluations} — group, count, and derive the exit
14
+ * category from raw `Evaluated<*>` lists.
15
+ * - {@link detectPublishGateDrift} — compute whether the configured
16
+ * `LintConfig` weakens any `skill/*` / `pack/*` platform-default-`error`
17
+ * rule (task 5.7).
18
+ * - {@link renderFindingsText} — finding-first human renderer (task
19
+ * 5.6).
20
+ * - {@link toLintJsonDocument} — `--json` document shape (task 5.6).
21
+ * - {@link resolveLintExitCategory} — exit-code contract evaluator (task
22
+ * 5.9).
23
+ *
24
+ * Lint-intent → canonical `Operation` adapter composition happens in the CLI
25
+ * handler (`packages/cli/src/root/lint/handler.ts`), which re-resolves each
26
+ * intent's `source` via the `resolveConfigured*` helpers and hands the
27
+ * resulting canonical Operation to the per-extension plan-step builder. The
28
+ * runner here stays accessor-free.
29
+ *
30
+ * @experimental This API is unstable and may change without notice.
31
+ * @packageDocumentation
32
+ */
33
+ import * as Effect from "effect/Effect";
34
+ import { composePath } from "./compose-path.js";
35
+ import { platformCanonicalLintConfig } from "./config.js";
36
+ import { evaluateContexts } from "./evaluate.js";
37
+ import { packRules, skillRules, workspaceRules } from "./catalog/index.js";
38
+ // -----------------------------------------------------------------------------
39
+ // Evaluation
40
+ // -----------------------------------------------------------------------------
41
+ /**
42
+ * Build the three v1 evaluation groups concurrently.
43
+ *
44
+ * The evaluator is a pure `Effect.Effect<ReadonlyArray<Evaluated<C>>>`; this
45
+ * helper simply hands the three catalogs to `Effect.all` with unbounded
46
+ * concurrency so catalog evaluations run in parallel but findings stay in
47
+ * stable catalog order inside each group.
48
+ *
49
+ * @experimental This API is unstable and may change without notice.
50
+ */
51
+ export const evaluateAllCatalogs = (args) => Effect.gen(function* () {
52
+ const [skills, packs, workspace] = yield* Effect.all([
53
+ evaluateContexts(skillRules, args.skillContexts, args.config),
54
+ evaluateContexts(packRules, args.packContexts, args.config),
55
+ evaluateContexts(workspaceRules, [args.workspaceContext], args.config),
56
+ ], { concurrency: "unbounded" });
57
+ return { skills, packs, workspace };
58
+ });
59
+ // -----------------------------------------------------------------------------
60
+ // Summary
61
+ // -----------------------------------------------------------------------------
62
+ const severityOrder = (s) => {
63
+ switch (s) {
64
+ case "error":
65
+ return 0;
66
+ case "warning":
67
+ return 1;
68
+ case "info":
69
+ return 2;
70
+ }
71
+ };
72
+ const flattenEvaluated = (group, evaluated, getDisplayRoot) => {
73
+ const out = [];
74
+ for (const entry of evaluated) {
75
+ const displayRoot = getDisplayRoot(entry.context);
76
+ for (const finding of entry.findings) {
77
+ out.push({
78
+ group,
79
+ displayRoot,
80
+ path: composePath(displayRoot, finding.location),
81
+ finding,
82
+ });
83
+ }
84
+ }
85
+ return out;
86
+ };
87
+ /**
88
+ * Flatten a {@link GroupEvaluations} triple into a single `RenderedFinding[]`
89
+ * in stable group-then-catalog order.
90
+ *
91
+ * @experimental This API is unstable and may change without notice.
92
+ */
93
+ export const collectRenderedFindings = (evaluations) => [
94
+ ...flattenEvaluated("skill", evaluations.skills, (c) => c.displayRoot),
95
+ ...flattenEvaluated("pack", evaluations.packs, (c) => c.displayRoot),
96
+ ...flattenEvaluated("workspace", evaluations.workspace, (c) => c.displayRoot),
97
+ ];
98
+ /**
99
+ * Count findings by severity across every group.
100
+ *
101
+ * @experimental This API is unstable and may change without notice.
102
+ */
103
+ export const countFindings = (findings) => {
104
+ let errors = 0;
105
+ let warnings = 0;
106
+ let infos = 0;
107
+ for (const f of findings) {
108
+ switch (f.finding.severity) {
109
+ case "error":
110
+ errors += 1;
111
+ break;
112
+ case "warning":
113
+ warnings += 1;
114
+ break;
115
+ case "info":
116
+ infos += 1;
117
+ break;
118
+ }
119
+ }
120
+ return { total: findings.length, errors, warnings, infos };
121
+ };
122
+ /**
123
+ * Derive a full {@link LintSummary} (findings, counts, exit category, drift
124
+ * banner rule ids) from raw evaluations + the configured severity overrides.
125
+ *
126
+ * @experimental This API is unstable and may change without notice.
127
+ */
128
+ export const summarizeEvaluations = (evaluations, config) => {
129
+ const findings = collectRenderedFindings(evaluations);
130
+ const counts = countFindings(findings);
131
+ return {
132
+ findings,
133
+ counts,
134
+ exitCategory: exitCategoryFromCounts(counts),
135
+ driftBanner: detectPublishGateDrift(config),
136
+ };
137
+ };
138
+ const exitCategoryFromCounts = (counts) => {
139
+ if (counts.errors > 0) {
140
+ return "errors";
141
+ }
142
+ if (counts.warnings > 0) {
143
+ return "warnings";
144
+ }
145
+ return "clean";
146
+ };
147
+ // -----------------------------------------------------------------------------
148
+ // Exit-code contract (task 5.9)
149
+ // -----------------------------------------------------------------------------
150
+ /**
151
+ * Translate a {@link LintExitCategory} + `--strict` into the exit-code
152
+ * policy.
153
+ *
154
+ * | Category | --strict=false | --strict=true |
155
+ * | ------------ | -------------- | ------------- |
156
+ * | `"clean"` | `0` | `0` |
157
+ * | `"warnings"` | `0` | non-zero |
158
+ * | `"errors"` | non-zero | non-zero |
159
+ *
160
+ * The return value is a discriminated enum; the CLI handler maps the `"fail"`
161
+ * branch to its platform exit-code primitive.
162
+ *
163
+ * @experimental This API is unstable and may change without notice.
164
+ */
165
+ export const resolveLintExitCategory = (args) => {
166
+ switch (args.category) {
167
+ case "errors":
168
+ return "fail";
169
+ case "warnings":
170
+ return args.strict ? "fail" : "success";
171
+ case "clean":
172
+ return "success";
173
+ }
174
+ };
175
+ // -----------------------------------------------------------------------------
176
+ // Drift banner (task 5.7)
177
+ // -----------------------------------------------------------------------------
178
+ /**
179
+ * Identify every configured `lint.rules` entry that weakens a platform-canonical
180
+ * `error`-severity `skill/*` or `pack/*` rule.
181
+ *
182
+ * The publish gate runs the `skill/*` and `pack/*` catalogs against
183
+ * {@link platformCanonicalLintConfig}; any workspace override that lowers a
184
+ * rule in those namespaces from `error` to `off | info | warn` creates a
185
+ * publish-gate divergence the user should know about (they'll see `error`
186
+ * findings from the registry that don't appear locally).
187
+ *
188
+ * Workspace-only rule weakenings (`workspace/*`) do NOT trigger the banner —
189
+ * those never reach publish.
190
+ *
191
+ * Returns the rule ids that trigger the banner, in catalog order, so the
192
+ * renderer can produce stable deterministic output.
193
+ *
194
+ * @experimental This API is unstable and may change without notice.
195
+ */
196
+ export const detectPublishGateDrift = (config) => {
197
+ const overrides = config.rules ?? {};
198
+ if (Object.keys(overrides).length === 0) {
199
+ return [];
200
+ }
201
+ // Only the `id` and `severity` fields of each rule matter for drift
202
+ // detection — rule-id snapshotting is public API, and severity is the
203
+ // platform canonical default the workspace override weakens. The helper
204
+ // is called against each catalog's concrete rule type so no assertion
205
+ // is needed to widen the generic parameter.
206
+ const weakened = [];
207
+ const visitCatalog = (rules) => {
208
+ for (const rule of rules) {
209
+ if (rule.severity !== "error") {
210
+ continue;
211
+ }
212
+ const override = overrides[rule.id];
213
+ if (override === undefined) {
214
+ continue;
215
+ }
216
+ if (override === "off" || override === "info" || override === "warn") {
217
+ weakened.push(rule.id);
218
+ }
219
+ }
220
+ };
221
+ visitCatalog(skillRules);
222
+ visitCatalog(packRules);
223
+ return weakened;
224
+ };
225
+ /**
226
+ * Render a finding-first human text report.
227
+ *
228
+ * Output shape (one line per entry, grouped first by context type then by
229
+ * severity within each group):
230
+ *
231
+ * DRIFT: The registry will still block publish on these rules:
232
+ * - skill/manifest-schema-valid
233
+ *
234
+ * WORKSPACE
235
+ * [error] workspace/lockfile-valid axm-lock.yaml is missing. ./axm-lock.yaml
236
+ * [warning] workspace/... ...
237
+ *
238
+ * SKILLS
239
+ * [error] ...
240
+ *
241
+ * Summary: 2 errors, 1 warning.
242
+ * Applied 3 fixes; 1 warning surfaced from applyPlan.
243
+ *
244
+ * @experimental This API is unstable and may change without notice.
245
+ */
246
+ export const renderFindingsText = (args) => {
247
+ const lines = [];
248
+ const { summary, fixSummary } = args;
249
+ if (summary.driftBanner.length > 0) {
250
+ lines.push("DRIFT: The registry will still block publish on these rules:");
251
+ for (const id of summary.driftBanner) {
252
+ lines.push(` - ${id}`);
253
+ }
254
+ lines.push("");
255
+ }
256
+ const groups = [
257
+ { key: "workspace", label: "WORKSPACE" },
258
+ { key: "skill", label: "SKILLS" },
259
+ { key: "pack", label: "PACKS" },
260
+ ];
261
+ for (const group of groups) {
262
+ const inGroup = summary.findings.filter((f) => f.group === group.key);
263
+ if (inGroup.length === 0) {
264
+ continue;
265
+ }
266
+ const sorted = [...inGroup].sort((a, b) => severityOrder(a.finding.severity) - severityOrder(b.finding.severity));
267
+ lines.push(group.label);
268
+ for (const entry of sorted) {
269
+ lines.push(` [${entry.finding.severity}] ${entry.finding.ruleId} ${entry.finding.message} ${entry.path}`);
270
+ }
271
+ lines.push("");
272
+ }
273
+ if (summary.findings.length === 0 && summary.driftBanner.length === 0) {
274
+ lines.push("No findings.");
275
+ }
276
+ else {
277
+ lines.push(formatCountsSentence(summary.counts));
278
+ }
279
+ if (fixSummary !== undefined) {
280
+ lines.push(formatFixSummary(fixSummary));
281
+ for (const warning of fixSummary.warnings) {
282
+ lines.push(` warning: ${warning}`);
283
+ }
284
+ }
285
+ return lines;
286
+ };
287
+ const formatCountsSentence = (counts) => {
288
+ const parts = [];
289
+ parts.push(`${counts.errors} ${pluralize(counts.errors, "error", "errors")}`);
290
+ parts.push(`${counts.warnings} ${pluralize(counts.warnings, "warning", "warnings")}`);
291
+ if (counts.infos > 0) {
292
+ parts.push(`${counts.infos} ${pluralize(counts.infos, "info", "infos")}`);
293
+ }
294
+ return `Summary: ${parts.join(", ")}.`;
295
+ };
296
+ const formatFixSummary = (fix) => {
297
+ const appliedLabel = pluralize(fix.applied, "fix", "fixes");
298
+ const warningsLabel = pluralize(fix.warnings.length, "warning", "warnings");
299
+ return `Applied ${fix.applied} ${appliedLabel}; ${fix.warnings.length} ${warningsLabel}, ${fix.failed} failed.`;
300
+ };
301
+ const pluralize = (n, singular, plural) => n === 1 ? singular : plural;
302
+ const toJsonFinding = (entry) => {
303
+ const base = {
304
+ group: entry.group,
305
+ kind: entry.finding.kind,
306
+ ruleId: entry.finding.ruleId,
307
+ severity: entry.finding.severity,
308
+ message: entry.finding.message,
309
+ displayRoot: entry.displayRoot,
310
+ path: entry.path,
311
+ suggestions: [...entry.finding.suggestions],
312
+ };
313
+ if (entry.finding.location === undefined) {
314
+ return base;
315
+ }
316
+ const loc = {
317
+ file: entry.finding.location.file,
318
+ ...(entry.finding.location.line !== undefined ? { line: entry.finding.location.line } : {}),
319
+ ...(entry.finding.location.column !== undefined
320
+ ? { column: entry.finding.location.column }
321
+ : {}),
322
+ };
323
+ return { ...base, location: loc };
324
+ };
325
+ /**
326
+ * Build the `--json` document from a {@link LintSummary} (+ optional fix
327
+ * summary).
328
+ *
329
+ * @experimental This API is unstable and may change without notice.
330
+ */
331
+ export const toLintJsonDocument = (args) => {
332
+ const { summary, fixSummary } = args;
333
+ const base = {
334
+ findings: summary.findings.map(toJsonFinding),
335
+ summary: {
336
+ total: summary.counts.total,
337
+ errors: summary.counts.errors,
338
+ warnings: summary.counts.warnings,
339
+ infos: summary.counts.infos,
340
+ exitCategory: summary.exitCategory,
341
+ },
342
+ driftBanner: summary.driftBanner,
343
+ };
344
+ if (fixSummary === undefined) {
345
+ return base;
346
+ }
347
+ return {
348
+ ...base,
349
+ fix: {
350
+ attempted: fixSummary.attempted,
351
+ applied: fixSummary.applied,
352
+ failed: fixSummary.failed,
353
+ warnings: fixSummary.warnings,
354
+ },
355
+ };
356
+ };
357
+ // -----------------------------------------------------------------------------
358
+ // Autofix rule surface (helper for the CLI handler)
359
+ // -----------------------------------------------------------------------------
360
+ /**
361
+ * Walk workspace evaluations (the only v1 namespace that ships
362
+ * `AutofixingRule`s) and return the set of `(rule, finding, context)` triples
363
+ * the CLI handler can dispatch on to produce canonical Operations.
364
+ *
365
+ * The returned triples point at the already-evaluated `AutofixableFinding`
366
+ * values so the renderer and the fix pipeline share a single source of truth.
367
+ *
368
+ * @experimental This API is unstable and may change without notice.
369
+ */
370
+ export const collectAutofixableEntries = (evaluations) => {
371
+ const out = [];
372
+ for (const entry of evaluations.workspace) {
373
+ if (entry.rule.kind !== "autofixing") {
374
+ continue;
375
+ }
376
+ for (const finding of entry.findings) {
377
+ if (finding.kind === "autofixable") {
378
+ out.push({ rule: entry.rule, context: entry.context, finding });
379
+ }
380
+ }
381
+ }
382
+ return out;
383
+ };
384
+ // -----------------------------------------------------------------------------
385
+ // Re-exports that CLI callers use alongside the runner
386
+ // -----------------------------------------------------------------------------
387
+ export { platformCanonicalLintConfig };
388
+ //# sourceMappingURL=cli.js.map