@cairn-tool/cairn 2.0.0

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 (526) hide show
  1. package/.markdownlintrc +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1431 -0
  4. package/dist/agent/audit/baseline.d.ts +69 -0
  5. package/dist/agent/audit/baseline.js +128 -0
  6. package/dist/agent/audit/baseline.js.map +1 -0
  7. package/dist/agent/audit/index.d.ts +126 -0
  8. package/dist/agent/audit/index.js +625 -0
  9. package/dist/agent/audit/index.js.map +1 -0
  10. package/dist/agent/import/detect.d.ts +49 -0
  11. package/dist/agent/import/detect.js +159 -0
  12. package/dist/agent/import/detect.js.map +1 -0
  13. package/dist/agent/import/normalize.d.ts +72 -0
  14. package/dist/agent/import/normalize.js +475 -0
  15. package/dist/agent/import/normalize.js.map +1 -0
  16. package/dist/agent/install/index.d.ts +211 -0
  17. package/dist/agent/install/index.js +907 -0
  18. package/dist/agent/install/index.js.map +1 -0
  19. package/dist/agent/manifest.d.ts +75 -0
  20. package/dist/agent/manifest.js +210 -0
  21. package/dist/agent/manifest.js.map +1 -0
  22. package/dist/agent/marketplace/index.d.ts +69 -0
  23. package/dist/agent/marketplace/index.js +212 -0
  24. package/dist/agent/marketplace/index.js.map +1 -0
  25. package/dist/agent/marketplace/spec.d.ts +48 -0
  26. package/dist/agent/marketplace/spec.js +237 -0
  27. package/dist/agent/marketplace/spec.js.map +1 -0
  28. package/dist/agent/output.d.ts +36 -0
  29. package/dist/agent/output.js +56 -0
  30. package/dist/agent/output.js.map +1 -0
  31. package/dist/agent/overlays.d.ts +38 -0
  32. package/dist/agent/overlays.js +223 -0
  33. package/dist/agent/overlays.js.map +1 -0
  34. package/dist/agent/package/index.d.ts +105 -0
  35. package/dist/agent/package/index.js +339 -0
  36. package/dist/agent/package/index.js.map +1 -0
  37. package/dist/agent/package/tar.d.ts +36 -0
  38. package/dist/agent/package/tar.js +137 -0
  39. package/dist/agent/package/tar.js.map +1 -0
  40. package/dist/agent/parser.d.ts +13 -0
  41. package/dist/agent/parser.js +559 -0
  42. package/dist/agent/parser.js.map +1 -0
  43. package/dist/agent/render.d.ts +16 -0
  44. package/dist/agent/render.js +721 -0
  45. package/dist/agent/render.js.map +1 -0
  46. package/dist/agent/sarif.d.ts +18 -0
  47. package/dist/agent/sarif.js +56 -0
  48. package/dist/agent/sarif.js.map +1 -0
  49. package/dist/agent/scaffold.d.ts +86 -0
  50. package/dist/agent/scaffold.js +250 -0
  51. package/dist/agent/scaffold.js.map +1 -0
  52. package/dist/agent/targets/antigravity.d.ts +17 -0
  53. package/dist/agent/targets/antigravity.js +218 -0
  54. package/dist/agent/targets/antigravity.js.map +1 -0
  55. package/dist/agent/targets/claude-code.d.ts +2 -0
  56. package/dist/agent/targets/claude-code.js +220 -0
  57. package/dist/agent/targets/claude-code.js.map +1 -0
  58. package/dist/agent/targets/codex.d.ts +2 -0
  59. package/dist/agent/targets/codex.js +212 -0
  60. package/dist/agent/targets/codex.js.map +1 -0
  61. package/dist/agent/targets/cursor.d.ts +2 -0
  62. package/dist/agent/targets/cursor.js +210 -0
  63. package/dist/agent/targets/cursor.js.map +1 -0
  64. package/dist/agent/targets/index.d.ts +31 -0
  65. package/dist/agent/targets/index.js +64 -0
  66. package/dist/agent/targets/index.js.map +1 -0
  67. package/dist/agent/targets/opencode.d.ts +15 -0
  68. package/dist/agent/targets/opencode.js +215 -0
  69. package/dist/agent/targets/opencode.js.map +1 -0
  70. package/dist/agent/targets/schema.d.ts +315 -0
  71. package/dist/agent/targets/schema.js +179 -0
  72. package/dist/agent/targets/schema.js.map +1 -0
  73. package/dist/agent/test/assert.d.ts +46 -0
  74. package/dist/agent/test/assert.js +288 -0
  75. package/dist/agent/test/assert.js.map +1 -0
  76. package/dist/agent/test/index.d.ts +73 -0
  77. package/dist/agent/test/index.js +181 -0
  78. package/dist/agent/test/index.js.map +1 -0
  79. package/dist/agent/test/schema.d.ts +81 -0
  80. package/dist/agent/test/schema.js +235 -0
  81. package/dist/agent/test/schema.js.map +1 -0
  82. package/dist/agent/types.d.ts +204 -0
  83. package/dist/agent/types.js +11 -0
  84. package/dist/agent/types.js.map +1 -0
  85. package/dist/agent/upgrade.d.ts +29 -0
  86. package/dist/agent/upgrade.js +72 -0
  87. package/dist/agent/upgrade.js.map +1 -0
  88. package/dist/agent/writer.d.ts +30 -0
  89. package/dist/agent/writer.js +73 -0
  90. package/dist/agent/writer.js.map +1 -0
  91. package/dist/archive/db.d.ts +20 -0
  92. package/dist/archive/db.js +98 -0
  93. package/dist/archive/db.js.map +1 -0
  94. package/dist/archive/progress.d.ts +62 -0
  95. package/dist/archive/progress.js +151 -0
  96. package/dist/archive/progress.js.map +1 -0
  97. package/dist/archive/query.d.ts +86 -0
  98. package/dist/archive/query.js +241 -0
  99. package/dist/archive/query.js.map +1 -0
  100. package/dist/archive/run.d.ts +91 -0
  101. package/dist/archive/run.js +331 -0
  102. package/dist/archive/run.js.map +1 -0
  103. package/dist/archive/segments.d.ts +89 -0
  104. package/dist/archive/segments.js +144 -0
  105. package/dist/archive/segments.js.map +1 -0
  106. package/dist/archive/sets.d.ts +58 -0
  107. package/dist/archive/sets.js +344 -0
  108. package/dist/archive/sets.js.map +1 -0
  109. package/dist/archive/tar-read.d.ts +35 -0
  110. package/dist/archive/tar-read.js +90 -0
  111. package/dist/archive/tar-read.js.map +1 -0
  112. package/dist/audit-baseline.d.ts +66 -0
  113. package/dist/audit-baseline.js +124 -0
  114. package/dist/audit-baseline.js.map +1 -0
  115. package/dist/automation.d.ts +16 -0
  116. package/dist/automation.js +38 -0
  117. package/dist/automation.js.map +1 -0
  118. package/dist/backlinks.d.ts +15 -0
  119. package/dist/backlinks.js +30 -0
  120. package/dist/backlinks.js.map +1 -0
  121. package/dist/checkers/katex.d.ts +3 -0
  122. package/dist/checkers/katex.js +71 -0
  123. package/dist/checkers/katex.js.map +1 -0
  124. package/dist/checkers/markdown-lint.d.ts +28 -0
  125. package/dist/checkers/markdown-lint.js +53 -0
  126. package/dist/checkers/markdown-lint.js.map +1 -0
  127. package/dist/checkers/mermaid.d.ts +6 -0
  128. package/dist/checkers/mermaid.js +53 -0
  129. package/dist/checkers/mermaid.js.map +1 -0
  130. package/dist/checkers/references.d.ts +3 -0
  131. package/dist/checkers/references.js +55 -0
  132. package/dist/checkers/references.js.map +1 -0
  133. package/dist/cli.d.ts +2 -0
  134. package/dist/cli.js +1117 -0
  135. package/dist/cli.js.map +1 -0
  136. package/dist/command-result.d.ts +6 -0
  137. package/dist/command-result.js +13 -0
  138. package/dist/command-result.js.map +1 -0
  139. package/dist/commands/agent-audit.d.ts +21 -0
  140. package/dist/commands/agent-audit.js +119 -0
  141. package/dist/commands/agent-audit.js.map +1 -0
  142. package/dist/commands/agent-doctor.d.ts +25 -0
  143. package/dist/commands/agent-doctor.js +217 -0
  144. package/dist/commands/agent-doctor.js.map +1 -0
  145. package/dist/commands/agent-import.d.ts +21 -0
  146. package/dist/commands/agent-import.js +212 -0
  147. package/dist/commands/agent-import.js.map +1 -0
  148. package/dist/commands/agent-install.d.ts +18 -0
  149. package/dist/commands/agent-install.js +59 -0
  150. package/dist/commands/agent-install.js.map +1 -0
  151. package/dist/commands/agent-installed.d.ts +6 -0
  152. package/dist/commands/agent-installed.js +17 -0
  153. package/dist/commands/agent-installed.js.map +1 -0
  154. package/dist/commands/agent-marketplace.d.ts +11 -0
  155. package/dist/commands/agent-marketplace.js +178 -0
  156. package/dist/commands/agent-marketplace.js.map +1 -0
  157. package/dist/commands/agent-package.d.ts +16 -0
  158. package/dist/commands/agent-package.js +159 -0
  159. package/dist/commands/agent-package.js.map +1 -0
  160. package/dist/commands/agent-scaffold.d.ts +17 -0
  161. package/dist/commands/agent-scaffold.js +181 -0
  162. package/dist/commands/agent-scaffold.js.map +1 -0
  163. package/dist/commands/agent-specs.d.ts +7 -0
  164. package/dist/commands/agent-specs.js +20 -0
  165. package/dist/commands/agent-specs.js.map +1 -0
  166. package/dist/commands/agent-test.d.ts +21 -0
  167. package/dist/commands/agent-test.js +50 -0
  168. package/dist/commands/agent-test.js.map +1 -0
  169. package/dist/commands/agent-uninstall.d.ts +6 -0
  170. package/dist/commands/agent-uninstall.js +45 -0
  171. package/dist/commands/agent-uninstall.js.map +1 -0
  172. package/dist/commands/agent-upgrade.d.ts +5 -0
  173. package/dist/commands/agent-upgrade.js +105 -0
  174. package/dist/commands/agent-upgrade.js.map +1 -0
  175. package/dist/commands/agent.d.ts +27 -0
  176. package/dist/commands/agent.js +549 -0
  177. package/dist/commands/agent.js.map +1 -0
  178. package/dist/commands/archive.d.ts +47 -0
  179. package/dist/commands/archive.js +311 -0
  180. package/dist/commands/archive.js.map +1 -0
  181. package/dist/commands/audit.d.ts +25 -0
  182. package/dist/commands/audit.js +325 -0
  183. package/dist/commands/audit.js.map +1 -0
  184. package/dist/commands/check-snippets.d.ts +58 -0
  185. package/dist/commands/check-snippets.js +247 -0
  186. package/dist/commands/check-snippets.js.map +1 -0
  187. package/dist/commands/check-urls.d.ts +52 -0
  188. package/dist/commands/check-urls.js +205 -0
  189. package/dist/commands/check-urls.js.map +1 -0
  190. package/dist/commands/code-blocks.d.ts +8 -0
  191. package/dist/commands/code-blocks.js +66 -0
  192. package/dist/commands/code-blocks.js.map +1 -0
  193. package/dist/commands/completion.d.ts +15 -0
  194. package/dist/commands/completion.js +20 -0
  195. package/dist/commands/completion.js.map +1 -0
  196. package/dist/commands/context.d.ts +16 -0
  197. package/dist/commands/context.js +131 -0
  198. package/dist/commands/context.js.map +1 -0
  199. package/dist/commands/describe.d.ts +12 -0
  200. package/dist/commands/describe.js +62 -0
  201. package/dist/commands/describe.js.map +1 -0
  202. package/dist/commands/diff.d.ts +11 -0
  203. package/dist/commands/diff.js +185 -0
  204. package/dist/commands/diff.js.map +1 -0
  205. package/dist/commands/fix.d.ts +59 -0
  206. package/dist/commands/fix.js +173 -0
  207. package/dist/commands/fix.js.map +1 -0
  208. package/dist/commands/frontmatter.d.ts +7 -0
  209. package/dist/commands/frontmatter.js +84 -0
  210. package/dist/commands/frontmatter.js.map +1 -0
  211. package/dist/commands/graph.d.ts +12 -0
  212. package/dist/commands/graph.js +122 -0
  213. package/dist/commands/graph.js.map +1 -0
  214. package/dist/commands/headers.d.ts +7 -0
  215. package/dist/commands/headers.js +48 -0
  216. package/dist/commands/headers.js.map +1 -0
  217. package/dist/commands/index.d.ts +8 -0
  218. package/dist/commands/index.js +32 -0
  219. package/dist/commands/index.js.map +1 -0
  220. package/dist/commands/links.d.ts +9 -0
  221. package/dist/commands/links.js +123 -0
  222. package/dist/commands/links.js.map +1 -0
  223. package/dist/commands/lint-dir.d.ts +15 -0
  224. package/dist/commands/lint-dir.js +156 -0
  225. package/dist/commands/lint-dir.js.map +1 -0
  226. package/dist/commands/lint.d.ts +14 -0
  227. package/dist/commands/lint.js +45 -0
  228. package/dist/commands/lint.js.map +1 -0
  229. package/dist/commands/orphans.d.ts +10 -0
  230. package/dist/commands/orphans.js +74 -0
  231. package/dist/commands/orphans.js.map +1 -0
  232. package/dist/commands/outline.d.ts +7 -0
  233. package/dist/commands/outline.js +54 -0
  234. package/dist/commands/outline.js.map +1 -0
  235. package/dist/commands/query.d.ts +18 -0
  236. package/dist/commands/query.js +341 -0
  237. package/dist/commands/query.js.map +1 -0
  238. package/dist/commands/refs-to.d.ts +8 -0
  239. package/dist/commands/refs-to.js +65 -0
  240. package/dist/commands/refs-to.js.map +1 -0
  241. package/dist/commands/refs.d.ts +10 -0
  242. package/dist/commands/refs.js +103 -0
  243. package/dist/commands/refs.js.map +1 -0
  244. package/dist/commands/rename-file.d.ts +16 -0
  245. package/dist/commands/rename-file.js +215 -0
  246. package/dist/commands/rename-file.js.map +1 -0
  247. package/dist/commands/rename-heading.d.ts +10 -0
  248. package/dist/commands/rename-heading.js +182 -0
  249. package/dist/commands/rename-heading.js.map +1 -0
  250. package/dist/commands/schema.d.ts +10 -0
  251. package/dist/commands/schema.js +34 -0
  252. package/dist/commands/schema.js.map +1 -0
  253. package/dist/commands/scripts.d.ts +59 -0
  254. package/dist/commands/scripts.js +222 -0
  255. package/dist/commands/scripts.js.map +1 -0
  256. package/dist/commands/section.d.ts +9 -0
  257. package/dist/commands/section.js +49 -0
  258. package/dist/commands/section.js.map +1 -0
  259. package/dist/commands/serve.d.ts +6 -0
  260. package/dist/commands/serve.js +48 -0
  261. package/dist/commands/serve.js.map +1 -0
  262. package/dist/commands/stats.d.ts +6 -0
  263. package/dist/commands/stats.js +109 -0
  264. package/dist/commands/stats.js.map +1 -0
  265. package/dist/commands/structure.d.ts +6 -0
  266. package/dist/commands/structure.js +130 -0
  267. package/dist/commands/structure.js.map +1 -0
  268. package/dist/commands/tables.d.ts +8 -0
  269. package/dist/commands/tables.js +77 -0
  270. package/dist/commands/tables.js.map +1 -0
  271. package/dist/commands/tasks.d.ts +8 -0
  272. package/dist/commands/tasks.js +59 -0
  273. package/dist/commands/tasks.js.map +1 -0
  274. package/dist/commands/toc.d.ts +18 -0
  275. package/dist/commands/toc.js +105 -0
  276. package/dist/commands/toc.js.map +1 -0
  277. package/dist/commands/update-check.d.ts +36 -0
  278. package/dist/commands/update-check.js +119 -0
  279. package/dist/commands/update-check.js.map +1 -0
  280. package/dist/commands/usage.d.ts +56 -0
  281. package/dist/commands/usage.js +883 -0
  282. package/dist/commands/usage.js.map +1 -0
  283. package/dist/commands/validate-frontmatter.d.ts +13 -0
  284. package/dist/commands/validate-frontmatter.js +34 -0
  285. package/dist/commands/validate-frontmatter.js.map +1 -0
  286. package/dist/completion/model.d.ts +49 -0
  287. package/dist/completion/model.js +194 -0
  288. package/dist/completion/model.js.map +1 -0
  289. package/dist/completion/shells.d.ts +2 -0
  290. package/dist/completion/shells.js +280 -0
  291. package/dist/completion/shells.js.map +1 -0
  292. package/dist/config-schema.d.ts +15 -0
  293. package/dist/config-schema.js +44 -0
  294. package/dist/config-schema.js.map +1 -0
  295. package/dist/config.d.ts +102 -0
  296. package/dist/config.js +614 -0
  297. package/dist/config.js.map +1 -0
  298. package/dist/context.d.ts +106 -0
  299. package/dist/context.js +202 -0
  300. package/dist/context.js.map +1 -0
  301. package/dist/contract/describe.d.ts +84 -0
  302. package/dist/contract/describe.js +104 -0
  303. package/dist/contract/describe.js.map +1 -0
  304. package/dist/contract/registry.d.ts +2 -0
  305. package/dist/contract/registry.js +622 -0
  306. package/dist/contract/registry.js.map +1 -0
  307. package/dist/contract/schemas/agent.d.ts +2 -0
  308. package/dist/contract/schemas/agent.js +572 -0
  309. package/dist/contract/schemas/agent.js.map +1 -0
  310. package/dist/contract/schemas/archive.d.ts +3 -0
  311. package/dist/contract/schemas/archive.js +227 -0
  312. package/dist/contract/schemas/archive.js.map +1 -0
  313. package/dist/contract/schemas/index.d.ts +11 -0
  314. package/dist/contract/schemas/index.js +49 -0
  315. package/dist/contract/schemas/index.js.map +1 -0
  316. package/dist/contract/schemas/markdown.d.ts +15 -0
  317. package/dist/contract/schemas/markdown.js +1035 -0
  318. package/dist/contract/schemas/markdown.js.map +1 -0
  319. package/dist/contract/schemas/meta.d.ts +5 -0
  320. package/dist/contract/schemas/meta.js +233 -0
  321. package/dist/contract/schemas/meta.js.map +1 -0
  322. package/dist/contract/schemas/scripts.d.ts +4 -0
  323. package/dist/contract/schemas/scripts.js +183 -0
  324. package/dist/contract/schemas/scripts.js.map +1 -0
  325. package/dist/contract/schemas/shared.d.ts +11 -0
  326. package/dist/contract/schemas/shared.js +26 -0
  327. package/dist/contract/schemas/shared.js.map +1 -0
  328. package/dist/contract/schemas/usage.d.ts +6 -0
  329. package/dist/contract/schemas/usage.js +489 -0
  330. package/dist/contract/schemas/usage.js.map +1 -0
  331. package/dist/contract/types.d.ts +63 -0
  332. package/dist/contract/types.js +2 -0
  333. package/dist/contract/types.js.map +1 -0
  334. package/dist/contract/version.d.ts +20 -0
  335. package/dist/contract/version.js +21 -0
  336. package/dist/contract/version.js.map +1 -0
  337. package/dist/diff.d.ts +156 -0
  338. package/dist/diff.js +500 -0
  339. package/dist/diff.js.map +1 -0
  340. package/dist/edit-plan.d.ts +133 -0
  341. package/dist/edit-plan.js +245 -0
  342. package/dist/edit-plan.js.map +1 -0
  343. package/dist/fix/markdownlint-fixer.d.ts +34 -0
  344. package/dist/fix/markdownlint-fixer.js +125 -0
  345. package/dist/fix/markdownlint-fixer.js.map +1 -0
  346. package/dist/fix/registry.d.ts +48 -0
  347. package/dist/fix/registry.js +28 -0
  348. package/dist/fix/registry.js.map +1 -0
  349. package/dist/fix/relative-links-fixer.d.ts +21 -0
  350. package/dist/fix/relative-links-fixer.js +96 -0
  351. package/dist/fix/relative-links-fixer.js.map +1 -0
  352. package/dist/fix/snippets-fixer.d.ts +2 -0
  353. package/dist/fix/snippets-fixer.js +64 -0
  354. package/dist/fix/snippets-fixer.js.map +1 -0
  355. package/dist/fix/toc-fixer.d.ts +2 -0
  356. package/dist/fix/toc-fixer.js +94 -0
  357. package/dist/fix/toc-fixer.js.map +1 -0
  358. package/dist/formats.d.ts +22 -0
  359. package/dist/formats.js +34 -0
  360. package/dist/formats.js.map +1 -0
  361. package/dist/formatters.d.ts +11 -0
  362. package/dist/formatters.js +48 -0
  363. package/dist/formatters.js.map +1 -0
  364. package/dist/frontmatter-validation.d.ts +11 -0
  365. package/dist/frontmatter-validation.js +188 -0
  366. package/dist/frontmatter-validation.js.map +1 -0
  367. package/dist/git.d.ts +40 -0
  368. package/dist/git.js +124 -0
  369. package/dist/git.js.map +1 -0
  370. package/dist/graph.d.ts +50 -0
  371. package/dist/graph.js +200 -0
  372. package/dist/graph.js.map +1 -0
  373. package/dist/input-selection.d.ts +9 -0
  374. package/dist/input-selection.js +122 -0
  375. package/dist/input-selection.js.map +1 -0
  376. package/dist/input.d.ts +2 -0
  377. package/dist/input.js +32 -0
  378. package/dist/input.js.map +1 -0
  379. package/dist/link-target.d.ts +39 -0
  380. package/dist/link-target.js +68 -0
  381. package/dist/link-target.js.map +1 -0
  382. package/dist/lint.d.ts +13 -0
  383. package/dist/lint.js +27 -0
  384. package/dist/lint.js.map +1 -0
  385. package/dist/markdown-ast.d.ts +73 -0
  386. package/dist/markdown-ast.js +187 -0
  387. package/dist/markdown-ast.js.map +1 -0
  388. package/dist/object-path.d.ts +14 -0
  389. package/dist/object-path.js +14 -0
  390. package/dist/object-path.js.map +1 -0
  391. package/dist/option-utils.d.ts +13 -0
  392. package/dist/option-utils.js +25 -0
  393. package/dist/option-utils.js.map +1 -0
  394. package/dist/outline.d.ts +16 -0
  395. package/dist/outline.js +32 -0
  396. package/dist/outline.js.map +1 -0
  397. package/dist/query/entities.d.ts +60 -0
  398. package/dist/query/entities.js +219 -0
  399. package/dist/query/entities.js.map +1 -0
  400. package/dist/query/execute.d.ts +22 -0
  401. package/dist/query/execute.js +0 -0
  402. package/dist/query/execute.js.map +1 -0
  403. package/dist/query/plan.d.ts +76 -0
  404. package/dist/query/plan.js +183 -0
  405. package/dist/query/plan.js.map +1 -0
  406. package/dist/query/render.d.ts +3 -0
  407. package/dist/query/render.js +39 -0
  408. package/dist/query/render.js.map +1 -0
  409. package/dist/refs.d.ts +19 -0
  410. package/dist/refs.js +10 -0
  411. package/dist/refs.js.map +1 -0
  412. package/dist/result.d.ts +49 -0
  413. package/dist/result.js +47 -0
  414. package/dist/result.js.map +1 -0
  415. package/dist/runtime.d.ts +35 -0
  416. package/dist/runtime.js +77 -0
  417. package/dist/runtime.js.map +1 -0
  418. package/dist/sarif.d.ts +36 -0
  419. package/dist/sarif.js +30 -0
  420. package/dist/sarif.js.map +1 -0
  421. package/dist/scripts/execute.d.ts +65 -0
  422. package/dist/scripts/execute.js +235 -0
  423. package/dist/scripts/execute.js.map +1 -0
  424. package/dist/scripts/registry.d.ts +55 -0
  425. package/dist/scripts/registry.js +103 -0
  426. package/dist/scripts/registry.js.map +1 -0
  427. package/dist/scripts/resolve.d.ts +90 -0
  428. package/dist/scripts/resolve.js +288 -0
  429. package/dist/scripts/resolve.js.map +1 -0
  430. package/dist/sections.d.ts +53 -0
  431. package/dist/sections.js +100 -0
  432. package/dist/sections.js.map +1 -0
  433. package/dist/serve/errors.d.ts +25 -0
  434. package/dist/serve/errors.js +45 -0
  435. package/dist/serve/errors.js.map +1 -0
  436. package/dist/serve/paths.d.ts +32 -0
  437. package/dist/serve/paths.js +71 -0
  438. package/dist/serve/paths.js.map +1 -0
  439. package/dist/serve/server.d.ts +31 -0
  440. package/dist/serve/server.js +123 -0
  441. package/dist/serve/server.js.map +1 -0
  442. package/dist/serve/tools.d.ts +19 -0
  443. package/dist/serve/tools.js +597 -0
  444. package/dist/serve/tools.js.map +1 -0
  445. package/dist/snippets.d.ts +184 -0
  446. package/dist/snippets.js +454 -0
  447. package/dist/snippets.js.map +1 -0
  448. package/dist/sqlite-store.d.ts +62 -0
  449. package/dist/sqlite-store.js +104 -0
  450. package/dist/sqlite-store.js.map +1 -0
  451. package/dist/sqlite.d.ts +59 -0
  452. package/dist/sqlite.js +51 -0
  453. package/dist/sqlite.js.map +1 -0
  454. package/dist/toc.d.ts +58 -0
  455. package/dist/toc.js +83 -0
  456. package/dist/toc.js.map +1 -0
  457. package/dist/types.d.ts +7 -0
  458. package/dist/types.js +2 -0
  459. package/dist/types.js.map +1 -0
  460. package/dist/update-notifier.d.ts +95 -0
  461. package/dist/update-notifier.js +301 -0
  462. package/dist/update-notifier.js.map +1 -0
  463. package/dist/url-cache.d.ts +14 -0
  464. package/dist/url-cache.js +70 -0
  465. package/dist/url-cache.js.map +1 -0
  466. package/dist/usage/aggregate.d.ts +107 -0
  467. package/dist/usage/aggregate.js +435 -0
  468. package/dist/usage/aggregate.js.map +1 -0
  469. package/dist/usage/db/index.d.ts +49 -0
  470. package/dist/usage/db/index.js +118 -0
  471. package/dist/usage/db/index.js.map +1 -0
  472. package/dist/usage/db/migrations.d.ts +29 -0
  473. package/dist/usage/db/migrations.js +38 -0
  474. package/dist/usage/db/migrations.js.map +1 -0
  475. package/dist/usage/db/open.d.ts +33 -0
  476. package/dist/usage/db/open.js +37 -0
  477. package/dist/usage/db/open.js.map +1 -0
  478. package/dist/usage/db/schema.d.ts +18 -0
  479. package/dist/usage/db/schema.js +147 -0
  480. package/dist/usage/db/schema.js.map +1 -0
  481. package/dist/usage/db/store.d.ts +74 -0
  482. package/dist/usage/db/store.js +280 -0
  483. package/dist/usage/db/store.js.map +1 -0
  484. package/dist/usage/events.d.ts +202 -0
  485. package/dist/usage/events.js +243 -0
  486. package/dist/usage/events.js.map +1 -0
  487. package/dist/usage/filter.d.ts +43 -0
  488. package/dist/usage/filter.js +97 -0
  489. package/dist/usage/filter.js.map +1 -0
  490. package/dist/usage/providers/antigravity.d.ts +2 -0
  491. package/dist/usage/providers/antigravity.js +431 -0
  492. package/dist/usage/providers/antigravity.js.map +1 -0
  493. package/dist/usage/providers/claude-code.d.ts +2 -0
  494. package/dist/usage/providers/claude-code.js +400 -0
  495. package/dist/usage/providers/claude-code.js.map +1 -0
  496. package/dist/usage/providers/codex.d.ts +2 -0
  497. package/dist/usage/providers/codex.js +387 -0
  498. package/dist/usage/providers/codex.js.map +1 -0
  499. package/dist/usage/providers/gemini-cli.d.ts +2 -0
  500. package/dist/usage/providers/gemini-cli.js +466 -0
  501. package/dist/usage/providers/gemini-cli.js.map +1 -0
  502. package/dist/usage/providers/index.d.ts +23 -0
  503. package/dist/usage/providers/index.js +46 -0
  504. package/dist/usage/providers/index.js.map +1 -0
  505. package/dist/usage/providers/opencode.d.ts +2 -0
  506. package/dist/usage/providers/opencode.js +422 -0
  507. package/dist/usage/providers/opencode.js.map +1 -0
  508. package/dist/usage/providers/protobuf.d.ts +35 -0
  509. package/dist/usage/providers/protobuf.js +125 -0
  510. package/dist/usage/providers/protobuf.js.map +1 -0
  511. package/dist/usage/providers/types.d.ts +74 -0
  512. package/dist/usage/providers/types.js +2 -0
  513. package/dist/usage/providers/types.js.map +1 -0
  514. package/dist/usage/scan.d.ts +54 -0
  515. package/dist/usage/scan.js +216 -0
  516. package/dist/usage/scan.js.map +1 -0
  517. package/dist/version.d.ts +2 -0
  518. package/dist/version.js +8 -0
  519. package/dist/version.js.map +1 -0
  520. package/dist/workspace-index.d.ts +39 -0
  521. package/dist/workspace-index.js +265 -0
  522. package/dist/workspace-index.js.map +1 -0
  523. package/dist/workspace.d.ts +89 -0
  524. package/dist/workspace.js +219 -0
  525. package/dist/workspace.js.map +1 -0
  526. package/package.json +92 -0
@@ -0,0 +1,215 @@
1
+ import { PROFILE_SCHEMA_VERSION } from "./schema.js";
2
+ /**
3
+ * OpenCode.
4
+ *
5
+ * Written against the `customize-opencode` skill the 1.18.23 binary embeds,
6
+ * which is the host's own configuration reference and supersedes the
7
+ * `@opencode-ai/plugin` types installed beside it.
8
+ *
9
+ * The load-bearing negative fact is that **unknown top-level keys in
10
+ * `opencode.json` are rejected with `ConfigInvalidError` and the host refuses
11
+ * to start**. So Cairn never writes a bundle manifest there: the plugin
12
+ * manifest goes in `.opencode-plugin/`, a directory OpenCode does not read, the
13
+ * same convention `.codex-plugin/` and `.cursor-plugin/` already use.
14
+ */
15
+ export const opencodeProfile = {
16
+ schemaVersion: PROFILE_SCHEMA_VERSION,
17
+ id: "opencode",
18
+ host: {
19
+ displayName: "OpenCode",
20
+ documentationRevision: "2026-08-29",
21
+ minimumVersion: null,
22
+ // `opencode --version` against the installed binary this was written from.
23
+ verifiedThrough: "1.18.23",
24
+ versionCommand: ["opencode", "--version"],
25
+ nativeValidator: null,
26
+ },
27
+ profiles: ["plugin", "project"],
28
+ manifest: {
29
+ // Deliberately not `opencode.json`: an unknown key there stops the host.
30
+ directory: ".opencode-plugin",
31
+ file: "plugin.json",
32
+ fields: [
33
+ { name: "name", required: true, support: "exact" },
34
+ { name: "version", required: true, support: "exact" },
35
+ { name: "description", required: true, support: "exact" },
36
+ { name: "skills", required: false, support: "exact" },
37
+ { name: "agents", required: false, support: "exact" },
38
+ { name: "mcpServers", required: false, support: "exact" },
39
+ ],
40
+ // OpenCode has no hook system to declare.
41
+ impliedFields: ["hooks"],
42
+ },
43
+ paths: {
44
+ plugin: {
45
+ skills: "skills",
46
+ hooks: "hooks",
47
+ hooksFile: "hooks/hooks.json",
48
+ agents: "agent",
49
+ assets: "assets",
50
+ mcp: ".mcp.json",
51
+ },
52
+ project: {
53
+ // The host accepts both spellings; the plural is the one its own
54
+ // `skills.paths` example uses.
55
+ skills: ".opencode/skills",
56
+ // Singular, which is the spelling its documentation lists first.
57
+ agents: ".opencode/agent",
58
+ rules: "AGENTS.md",
59
+ // No policy is written; see the note below.
60
+ policies: null,
61
+ mcp: "opencode.json",
62
+ assets: "assets",
63
+ },
64
+ namespacePluginSkills: false,
65
+ },
66
+ placeholders: {
67
+ bundleRoot: { plugin: ".", project: "." },
68
+ // `$ARGUMENTS`, `$1` and `$2` are documented for *commands*; nothing states
69
+ // that a skill substitutes them. Advisory is correct under either reading.
70
+ arguments: "advisory",
71
+ rootVariables: [],
72
+ },
73
+ hooks: {
74
+ // OpenCode 1.18.23 has no lifecycle hook file at all: the plugin API is
75
+ // TypeScript callbacks in `.opencode/plugin/*.ts`, which a portable JSON
76
+ // hook declaration cannot express. Every event is inexpressible, so hook
77
+ // emission is skipped entirely rather than writing an inert document.
78
+ events: {
79
+ "session-start": null,
80
+ "pre-tool-use": null,
81
+ "post-tool-use": null,
82
+ stop: null,
83
+ },
84
+ envelope: "hooks",
85
+ handlerShape: "flat",
86
+ matcherEvents: [],
87
+ supportedProtocols: [],
88
+ },
89
+ models: {
90
+ // Every model id is `provider/model-id`, so mapping a semantic class would
91
+ // hardcode one vendor into a neutral profile.
92
+ support: "unsupported",
93
+ classes: { fast: null, balanced: null, capable: null, inherit: null },
94
+ },
95
+ tools: {
96
+ // An exact map is knowable, but OpenCode's `tools` frontmatter is a boolean
97
+ // map while the renderer produces an array. Declaring a mapping would emit
98
+ // a correctly-named key of the wrong shape, which is worse than declaring
99
+ // the restriction inexpressible.
100
+ support: "approximate",
101
+ capabilities: null,
102
+ },
103
+ rules: {
104
+ exactActivation: ["always"],
105
+ // `instructions` accepts globs, but not per-rule activation.
106
+ approximateActivation: ["files"],
107
+ form: "aggregated-agents-md",
108
+ },
109
+ /**
110
+ * OpenCode does have a native command policy -- `permission.bash` in
111
+ * `opencode.json` -- and it is deliberately not written yet.
112
+ *
113
+ * `paths.project.mcp` is already `opencode.json`, and both the MCP writer and
114
+ * `renderPolicies` serialize a whole document. Two writers to one path is a
115
+ * duplicate-path diagnostic and a clobber, and shipping a permission file
116
+ * that silently erases the user's MCP block is worse than shipping none.
117
+ * `PolicyForm` reserves `opencode-permission` so that adding it later, once
118
+ * the two share a merge-aware writer, is a data edit.
119
+ */
120
+ policies: { form: null },
121
+ // The skill frontmatter keys are enumerated -- name, description, license,
122
+ // compatibility, metadata -- and none controls implicit activation.
123
+ skills: { invocationPolicy: "advisory" },
124
+ outputs: {
125
+ plugin: [
126
+ { feature: "manifest", pattern: ".opencode-plugin/plugin.json" },
127
+ { feature: "skills", pattern: "skills/{name}/**" },
128
+ { feature: "agents", pattern: "agent/{name}.md" },
129
+ { feature: "mcp", pattern: ".mcp.json" },
130
+ { feature: "assets", pattern: "assets/**" },
131
+ ],
132
+ project: [
133
+ { feature: "skills", pattern: ".opencode/skills/{name}/**" },
134
+ { feature: "agents", pattern: ".opencode/agent/{name}.md" },
135
+ { feature: "rules", pattern: "AGENTS.md" },
136
+ { feature: "mcp", pattern: "opencode.json" },
137
+ { feature: "assets", pattern: "assets/**" },
138
+ ],
139
+ },
140
+ features: {
141
+ skills: {
142
+ support: "exact",
143
+ profiles: ["plugin", "project"],
144
+ summary: "exact",
145
+ surface: ".opencode/skills/<name>/SKILL.md",
146
+ diagnostics: ["AB310"],
147
+ },
148
+ agents: {
149
+ support: "approximate",
150
+ profiles: ["plugin", "project"],
151
+ summary: "markdown with frontmatter; tool restrictions are not expressible",
152
+ surface: ".opencode/agent/<name>.md",
153
+ diagnostics: ["AB330", "AB332"],
154
+ },
155
+ rules: {
156
+ support: "approximate",
157
+ profiles: ["project"],
158
+ summary: "AGENTS.md project layer",
159
+ surface: "AGENTS.md",
160
+ diagnostics: ["AB350", "AB351"],
161
+ },
162
+ hooks: {
163
+ support: "unsupported",
164
+ profiles: [],
165
+ summary: "no lifecycle hook file; plugins are TypeScript callbacks",
166
+ surface: null,
167
+ diagnostics: ["AB320"],
168
+ },
169
+ policies: {
170
+ support: "unsupported",
171
+ profiles: ["project"],
172
+ summary: "native permissions share opencode.json with MCP and are not written",
173
+ surface: null,
174
+ diagnostics: ["AB360", "AB361"],
175
+ },
176
+ mcp: {
177
+ support: "approximate",
178
+ profiles: ["plugin", "project"],
179
+ summary: "exact in plugins; a project document must already be opencode config shape",
180
+ surface: "opencode.json",
181
+ diagnostics: [],
182
+ },
183
+ assets: {
184
+ support: "exact",
185
+ profiles: ["plugin", "project"],
186
+ summary: "pass-through",
187
+ surface: "assets/",
188
+ diagnostics: [],
189
+ },
190
+ placeholders: {
191
+ support: "approximate",
192
+ profiles: ["plugin", "project"],
193
+ summary: "argument substitution is documented for commands, not skills",
194
+ surface: null,
195
+ diagnostics: [],
196
+ },
197
+ native: {
198
+ support: "native",
199
+ profiles: ["plugin", "project"],
200
+ summary: "overlay pass-through",
201
+ surface: "native/opencode/",
202
+ diagnostics: ["AB181", "AB182", "AB187"],
203
+ },
204
+ },
205
+ // No marketplace concept: `opencode plugin <module>` installs an npm package.
206
+ install: {
207
+ // Global scope drops the `.opencode/` prefix -- skills live at
208
+ // `~/.config/opencode/skills/`, not `~/.config/opencode/.opencode/skills/`.
209
+ // `InstallLocation` cannot rewrite a path, so declaring a merge here would
210
+ // install to a directory OpenCode never scans. Same reasoning as Codex.
211
+ user: null,
212
+ project: { root: ".", layout: "merge", profile: "project", activation: null },
213
+ },
214
+ };
215
+ //# sourceMappingURL=opencode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../../src/agent/targets/opencode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,eAAe,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QACP,+DAA+D;QAC/D,4EAA4E;QAC5E,2EAA2E;QAC3E,wEAAwE;QACxE,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE;KAC9E;CACF,CAAC"}
@@ -0,0 +1,315 @@
1
+ import type { AgentProfile, AgentTarget, BundleRule, MappingQuality } from "../types.js";
2
+ /**
3
+ * Version of the target-profile shape itself. Hand-owned; unrelated to the
4
+ * semantic-release-managed package version. Bump only when the profile
5
+ * structure changes in a way consumers must react to.
6
+ */
7
+ export declare const PROFILE_SCHEMA_VERSION = "2";
8
+ export declare const PORTABLE_HOOK_EVENTS: readonly ["session-start", "pre-tool-use", "post-tool-use", "stop"];
9
+ export type PortableHookEvent = (typeof PORTABLE_HOOK_EVENTS)[number];
10
+ export type ModelClass = "fast" | "balanced" | "capable" | "inherit";
11
+ export type ToolCapability = "read" | "write" | "shell" | "web";
12
+ export type RuleActivation = BundleRule["activation"];
13
+ /** MappingQuality plus the target-native pass-through case profiles need. */
14
+ export type FeatureSupport = MappingQuality | "native";
15
+ export declare const FEATURE_KEYS: readonly ["skills", "agents", "rules", "hooks", "policies", "mcp", "assets", "placeholders", "native"];
16
+ export type FeatureKey = (typeof FEATURE_KEYS)[number];
17
+ export interface FeatureProfile {
18
+ /**
19
+ * The best mapping quality this feature achieves on this target. Individual
20
+ * occurrences may be worse — a malformed input or an unsupported output
21
+ * profile is reported per-diagnostic — but never better, which is what the
22
+ * conformance suite asserts.
23
+ */
24
+ support: FeatureSupport;
25
+ /** Output profiles in which this feature is emitted at all. Read by the renderer. */
26
+ profiles: AgentProfile[];
27
+ /** One line; the machine-generated replacement for a free-text compatibility cell. */
28
+ summary: string;
29
+ /** Native surface, e.g. ".claude/rules/<name>.md". Documentation only. */
30
+ surface: string | null;
31
+ /** Diagnostic codes this target may emit for this feature. */
32
+ diagnostics: string[];
33
+ }
34
+ /**
35
+ * A POSIX path relative to `<output>/<target>/<profile>`.
36
+ *
37
+ * Grammar: `{name}` matches exactly one path segment, `*` matches part of one
38
+ * segment, and `**` matches any remaining suffix including nothing.
39
+ */
40
+ export interface OutputPattern {
41
+ feature: FeatureKey | "manifest";
42
+ pattern: string;
43
+ }
44
+ export interface NativeValidatorSpec {
45
+ /** `{dir}` is substituted with the generated `<target>/<profile>` directory. */
46
+ command: string[];
47
+ readOnly: true;
48
+ appliesTo: AgentProfile[];
49
+ }
50
+ export interface HostProfile {
51
+ displayName: string;
52
+ /** ISO date of the target documentation this profile was written against. */
53
+ documentationRevision: string;
54
+ /** Below this version the profile is known to be wrong. `null` when not recorded. */
55
+ minimumVersion: string | null;
56
+ /** Highest host version this profile was verified against. `null` when not recorded. */
57
+ verifiedThrough: string | null;
58
+ /** Declared for callers to run themselves. This CLI never executes it. */
59
+ versionCommand: string[] | null;
60
+ /** Declared for callers to run themselves. This CLI never executes it. */
61
+ nativeValidator: NativeValidatorSpec | null;
62
+ }
63
+ export interface ManifestFieldProfile {
64
+ name: string;
65
+ required: boolean;
66
+ support: FeatureSupport;
67
+ }
68
+ export interface ManifestProfile {
69
+ /** Plugin manifest directory, or `null` when the target has no plugin manifest. */
70
+ directory: string | null;
71
+ file: string;
72
+ fields: ManifestFieldProfile[];
73
+ /**
74
+ * Manifest keys the host derives from the plugin layout on its own, so the
75
+ * renderer must leave them out. Declaring one is not merely redundant, it is
76
+ * an error, and neither kind is caught by `claude plugin validate`:
77
+ *
78
+ * - `agents` accepts a list of files and rejects the component directory the
79
+ * renderer would name, which fails the whole manifest.
80
+ * - `hooks` is for *additional* hook files; naming the standard
81
+ * `hooks/hooks.json` that the host already loaded is a duplicate, and the
82
+ * plugin's hooks are dropped.
83
+ *
84
+ * Omitting them is what makes `agents/` and `hooks/hooks.json` load.
85
+ */
86
+ impliedFields?: string[];
87
+ }
88
+ export interface PluginRoots {
89
+ skills: string;
90
+ /** Directory for hook *scripts*. */
91
+ hooks: string;
92
+ /** The hook *declaration* document, relative to the plugin root. */
93
+ hooksFile: string;
94
+ agents: string | null;
95
+ assets: string;
96
+ mcp: string | null;
97
+ }
98
+ export interface ProjectRoots {
99
+ skills: string;
100
+ agents: string | null;
101
+ rules: string | null;
102
+ policies: string | null;
103
+ mcp: string | null;
104
+ assets: string;
105
+ }
106
+ export interface PathProfile {
107
+ plugin: PluginRoots;
108
+ project: ProjectRoots;
109
+ /** True when plugin skill directories are namespaced as `${bundle}-${skill}`. */
110
+ namespacePluginSkills: boolean;
111
+ }
112
+ export interface PlaceholderProfile {
113
+ /** `${BUNDLE_ROOT}` substitution per output profile. */
114
+ bundleRoot: Record<AgentProfile, string>;
115
+ /**
116
+ * How `$ARGUMENTS` survives: `native` means the host substitutes it,
117
+ * `advisory` appends a prose hint beside it, `prose` replaces it outright.
118
+ */
119
+ arguments: "native" | "advisory" | "prose";
120
+ /** Root variables the target understands, for documentation and `agent specs`. */
121
+ rootVariables: string[];
122
+ }
123
+ export interface HookProfile {
124
+ /** Portable event to native name; `null` means the target cannot express it. */
125
+ events: Record<PortableHookEvent, string | null>;
126
+ /**
127
+ * `versioned` wraps handlers in `{ version: 1, hooks }`, `hooks` emits
128
+ * `{ hooks }`, and `named` keys the whole document by the bundle's name.
129
+ */
130
+ envelope: "hooks" | "versioned" | "named";
131
+ /**
132
+ * `claude-nested` wraps handlers in `{ matcher, hooks: [...] }` and `flat`
133
+ * does not. `nested-for-matcher-events` wraps only the events listed in
134
+ * {@link matcherEvents}, which is a host that accepts a tool-name matcher on
135
+ * its tool events and nothing on the rest.
136
+ */
137
+ handlerShape: "claude-nested" | "flat" | "nested-for-matcher-events";
138
+ /** Events that take a matcher. Empty unless `handlerShape` names it. */
139
+ matcherEvents: PortableHookEvent[];
140
+ supportedProtocols: string[];
141
+ }
142
+ export interface ModelProfile {
143
+ support: FeatureSupport;
144
+ /** Semantic class to native model id; `null` means the target has no model field. */
145
+ classes: Record<ModelClass, string | null>;
146
+ }
147
+ export interface ToolProfile {
148
+ support: FeatureSupport;
149
+ /** `null` means capability restriction is not expressible natively. */
150
+ capabilities: Record<ToolCapability, string[]> | null;
151
+ }
152
+ export interface RuleProfile {
153
+ exactActivation: RuleActivation[];
154
+ /** Activations that render, but not faithfully. Everything else is unsupported. */
155
+ approximateActivation: RuleActivation[];
156
+ form: "mdc" | "markdown" | "aggregated-agents-md" | "trigger-frontmatter" | null;
157
+ }
158
+ /**
159
+ * How a target expresses a command policy.
160
+ *
161
+ * This exists because the renderer used to pick the form by target name, with
162
+ * an unguarded `else` that emitted Codex's `prefix_rule` DSL to a Codex path
163
+ * for every target that was not Claude Code or Cursor. Naming the form here
164
+ * makes a host with no policy surface declare `null` and get a diagnostic,
165
+ * rather than silently inheriting someone else's format.
166
+ */
167
+ export type PolicyForm = "claude-permissions" | "codex-prefix-rules" | "cursor-hooks"
168
+ /** Reserved: a `permission` block inside a config file the MCP writer also owns. */
169
+ | "opencode-permission";
170
+ export interface PolicyProfile {
171
+ /** `null` when the host has no native command-policy format. */
172
+ form: PolicyForm | null;
173
+ }
174
+ /**
175
+ * How a target expresses "do not invoke this skill implicitly".
176
+ *
177
+ * `frontmatter-flag` sets a key on the skill document, `openai-yaml` writes a
178
+ * sidecar policy file, and `advisory` can only say so in prose.
179
+ */
180
+ export type SkillInvocationForm = "frontmatter-flag" | "openai-yaml" | "advisory";
181
+ export interface SkillProfile {
182
+ /** `null` when the host offers no way to say it at all. */
183
+ invocationPolicy: SkillInvocationForm | null;
184
+ }
185
+ /** Where a catalog entry's value comes from. */
186
+ export type MarketplaceFieldSource = {
187
+ from: "manifest";
188
+ field: string;
189
+ } | {
190
+ from: "marketplace";
191
+ field: string;
192
+ } | {
193
+ from: "computed";
194
+ value: "source";
195
+ };
196
+ /**
197
+ * How a resolved value is reshaped before it lands in the catalog.
198
+ *
199
+ * Targets disagree on the shape of the same underlying datum — Claude Code
200
+ * wants `author` as an object and `category` as one string, Cursor wants
201
+ * `author` as a bare name and `categories` as the whole list. Naming the
202
+ * reshape here keeps that disagreement in the profile instead of as a
203
+ * field-name check inside the packager.
204
+ */
205
+ export type MarketplaceFieldTransform = "identity" | "name" | "first";
206
+ export interface MarketplaceEntryField {
207
+ name: string;
208
+ required: boolean;
209
+ source: MarketplaceFieldSource;
210
+ /** Defaults to `identity`. */
211
+ transform?: MarketplaceFieldTransform;
212
+ }
213
+ export interface MarketplaceAssetRule {
214
+ role: "icon" | "screenshot";
215
+ required: boolean;
216
+ extensions: string[];
217
+ maxBytes: number | null;
218
+ }
219
+ /**
220
+ * How a target's marketplace catalog is shaped.
221
+ *
222
+ * Catalog structure is tabular target behavior, so it belongs here rather than
223
+ * in the packager — the same rule that keeps paths and hook events out of the
224
+ * renderer. Optional on {@link TargetProfile} so adding it stays additive:
225
+ * every shipped profile defines it, but a consumer that has not been updated
226
+ * simply sees a new key rather than a changed shape.
227
+ */
228
+ export interface MarketplaceProfile {
229
+ /** Catalog location per distribution mode; `null` when the mode is unsupported. */
230
+ catalog: Record<"repo" | "local", {
231
+ directory: string;
232
+ file: string;
233
+ } | null>;
234
+ /** Top-level array key inside the catalog document. */
235
+ entriesKey: string;
236
+ /**
237
+ * Fields written at the catalog document's top level, beside `entriesKey` —
238
+ * the marketplace's own identity as opposed to a plugin entry's. Optional so
239
+ * the addition stays additive for a target that names none.
240
+ */
241
+ documentFields?: MarketplaceEntryField[];
242
+ entryFields: MarketplaceEntryField[];
243
+ assets: MarketplaceAssetRule[];
244
+ /** `{name}`, `{version}`, `{target}`, and `{profile}` are substituted. */
245
+ archiveName: string;
246
+ }
247
+ export interface TargetProfile {
248
+ schemaVersion: string;
249
+ id: AgentTarget;
250
+ host: HostProfile;
251
+ /** Output profiles this target supports at all. */
252
+ profiles: AgentProfile[];
253
+ manifest: ManifestProfile;
254
+ paths: PathProfile;
255
+ placeholders: PlaceholderProfile;
256
+ hooks: HookProfile;
257
+ models: ModelProfile;
258
+ tools: ToolProfile;
259
+ rules: RuleProfile;
260
+ policies: PolicyProfile;
261
+ skills: SkillProfile;
262
+ outputs: Record<AgentProfile, OutputPattern[]>;
263
+ features: Record<FeatureKey, FeatureProfile>;
264
+ /** Catalog shape for `agent package`. Optional so adding it stayed additive. */
265
+ marketplace?: MarketplaceProfile;
266
+ /**
267
+ * Where `agent install` places a rendered tree. Optional so adding it stays
268
+ * additive, the same way `marketplace` was: a consumer that has not been
269
+ * updated sees a new key rather than a changed shape.
270
+ */
271
+ install?: InstallProfile;
272
+ }
273
+ /** How a host discovers an installed tree. */
274
+ export type InstallLayout = "plugin-dir" | "merge" | "marketplace";
275
+ /**
276
+ * A host file that activates a marketplace install. `null` when the root is
277
+ * auto-scanned and needs no edit.
278
+ */
279
+ export type InstallActivation = {
280
+ file: string;
281
+ form: "claude-enabled-plugins";
282
+ } | null;
283
+ export interface InstallLocation {
284
+ /** `~`-prefixed for user scope; relative for project scope. */
285
+ root: string;
286
+ layout: InstallLayout;
287
+ profile: AgentProfile;
288
+ /** Host file that activates the install, or null when the root is auto-scanned. */
289
+ activation: InstallActivation;
290
+ }
291
+ export interface InstallProfile {
292
+ user: InstallLocation | null;
293
+ project: InstallLocation | null;
294
+ }
295
+ /**
296
+ * Compiles an {@link OutputPattern} into an anchored regular expression.
297
+ * `**` is only meaningful as a whole trailing segment.
298
+ */
299
+ export declare function outputPatternToRegExp(pattern: string): RegExp;
300
+ /** True when `candidate` is described by one of the target's declared output patterns. */
301
+ export declare function describesPath(profile: TargetProfile, outputProfile: AgentProfile, candidate: string): boolean;
302
+ export interface ParsedVersion {
303
+ major: number;
304
+ minor: number;
305
+ patch: number;
306
+ prerelease: string | null;
307
+ }
308
+ export declare function parseSemver(value: string): ParsedVersion | null;
309
+ /**
310
+ * Compares two plain versions. Deliberately not a range grammar — profiles
311
+ * record single bounds, so ordering is all that is needed.
312
+ */
313
+ export declare function compareSemver(a: string, b: string): -1 | 0 | 1;
314
+ /** Returns the reasons a profile is internally inconsistent; empty when valid. */
315
+ export declare function validateProfile(profile: TargetProfile): string[];