harnesstap 1.4.0 → 1.6.1

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 (211) hide show
  1. package/README.md +3 -1
  2. package/dist/apply-ZGEAY6YZ.js +50 -0
  3. package/dist/{approve-FBGYQGWN.js → approve-VPVMU2MM.js} +10 -13
  4. package/dist/{approve-FBGYQGWN.js.map → approve-VPVMU2MM.js.map} +1 -1
  5. package/dist/{audit-VI4QZ6X2.js → audit-AO7AGET3.js} +11 -15
  6. package/dist/{audit-VI4QZ6X2.js.map → audit-AO7AGET3.js.map} +1 -1
  7. package/dist/{auth-4CQCDS2W.js → auth-7YRIJNXU.js} +10 -12
  8. package/dist/{auth-4CQCDS2W.js.map → auth-7YRIJNXU.js.map} +1 -1
  9. package/dist/bin.js +13 -34
  10. package/dist/bin.js.map +1 -1
  11. package/dist/{chunk-OML4HXKT.js → chunk-262KZULH.js} +16 -22
  12. package/dist/chunk-262KZULH.js.map +1 -0
  13. package/dist/{chunk-ZUASVASP.js → chunk-26QGX47N.js} +26097 -16881
  14. package/dist/chunk-26QGX47N.js.map +1 -0
  15. package/dist/{chunk-3P6BWL5F.js → chunk-27IPOVKQ.js} +2 -2
  16. package/dist/{chunk-M4KLHJ6U.js → chunk-2BESDRYP.js} +8 -10
  17. package/dist/{chunk-M4KLHJ6U.js.map → chunk-2BESDRYP.js.map} +1 -1
  18. package/dist/{chunk-PCMON7Y2.js → chunk-2BWIEB2G.js} +8 -10
  19. package/dist/{chunk-PCMON7Y2.js.map → chunk-2BWIEB2G.js.map} +1 -1
  20. package/dist/{chunk-XTVGCVU4.js → chunk-2NMLWSUH.js} +41 -42
  21. package/dist/chunk-2NMLWSUH.js.map +1 -0
  22. package/dist/{chunk-TQ2NA4Z4.js → chunk-4E3G4H5B.js} +8 -2
  23. package/dist/chunk-4E3G4H5B.js.map +1 -0
  24. package/dist/chunk-4QCGTUTM.js +61 -0
  25. package/dist/chunk-4QCGTUTM.js.map +1 -0
  26. package/dist/{chunk-TPEJFLV7.js → chunk-6RKJZW2N.js} +4 -6
  27. package/dist/{chunk-TPEJFLV7.js.map → chunk-6RKJZW2N.js.map} +1 -1
  28. package/dist/{chunk-JQOKQKQT.js → chunk-7IBFH736.js} +2 -2
  29. package/dist/{chunk-P2C7JPLD.js → chunk-CKJIS2FM.js} +6 -6
  30. package/dist/{chunk-R7ZOYVN3.js → chunk-CUOEQQFI.js} +187 -59
  31. package/dist/chunk-CUOEQQFI.js.map +1 -0
  32. package/dist/{chunk-REHRUNBB.js → chunk-CWXCZBJR.js} +70 -5
  33. package/dist/chunk-CWXCZBJR.js.map +1 -0
  34. package/dist/{chunk-4ZQ2SCGY.js → chunk-FLYQEB6D.js} +509 -207
  35. package/dist/chunk-FLYQEB6D.js.map +1 -0
  36. package/dist/{chunk-U6DXASQP.js → chunk-HC7IZY75.js} +2 -2
  37. package/dist/{chunk-UVVZHWD2.js → chunk-I4DKV63E.js} +2 -2
  38. package/dist/{chunk-PNGF5EV2.js → chunk-JEC5PWNH.js} +2 -2
  39. package/dist/{chunk-MR7IOHSX.js → chunk-KFIRABC7.js} +16 -22
  40. package/dist/{chunk-MR7IOHSX.js.map → chunk-KFIRABC7.js.map} +1 -1
  41. package/dist/{chunk-6LTLYV5D.js → chunk-LGWFLVZQ.js} +1064 -265
  42. package/dist/chunk-LGWFLVZQ.js.map +1 -0
  43. package/dist/{chunk-RDG5DT7S.js → chunk-LX6PMOOC.js} +54 -40
  44. package/dist/chunk-LX6PMOOC.js.map +1 -0
  45. package/dist/{chunk-WGP4GUYZ.js → chunk-MILGCNBK.js} +9 -11
  46. package/dist/{chunk-WGP4GUYZ.js.map → chunk-MILGCNBK.js.map} +1 -1
  47. package/dist/chunk-MKLJBW5N.js +14 -0
  48. package/dist/{chunk-N3ZCH64F.js → chunk-MSKTWYHG.js} +86 -32
  49. package/dist/chunk-MSKTWYHG.js.map +1 -0
  50. package/dist/{chunk-WG5A6EAU.js → chunk-MTCCUYBZ.js} +821 -28
  51. package/dist/chunk-MTCCUYBZ.js.map +1 -0
  52. package/dist/{chunk-BPWFQKI5.js → chunk-NIFKCS7J.js} +2 -2
  53. package/dist/{chunk-43BDGVN3.js → chunk-NWOYPK2O.js} +56 -9
  54. package/dist/chunk-NWOYPK2O.js.map +1 -0
  55. package/dist/{chunk-3FS775NP.js → chunk-NXILQDJG.js} +85 -4
  56. package/dist/chunk-NXILQDJG.js.map +1 -0
  57. package/dist/chunk-QF73VLAW.js +31673 -0
  58. package/dist/chunk-QF73VLAW.js.map +1 -0
  59. package/dist/{chunk-RFQ3N7FB.js → chunk-QHCGA6LC.js} +11 -19
  60. package/dist/chunk-QHCGA6LC.js.map +1 -0
  61. package/dist/{chunk-L6YZE5MY.js → chunk-QPJZKWML.js} +5 -7
  62. package/dist/{chunk-L6YZE5MY.js.map → chunk-QPJZKWML.js.map} +1 -1
  63. package/dist/{chunk-ULCD6DJE.js → chunk-RM7VP6ID.js} +24 -61
  64. package/dist/chunk-RM7VP6ID.js.map +1 -0
  65. package/dist/{chunk-7HP6AAI3.js → chunk-SMLO5YPI.js} +2 -2
  66. package/dist/{chunk-73OJQTBW.js → chunk-T2JBSRGG.js} +2 -2
  67. package/dist/{chunk-IE7B6Q5K.js → chunk-U5Y6WKKT.js} +17 -18
  68. package/dist/chunk-U5Y6WKKT.js.map +1 -0
  69. package/dist/chunk-UEA4NCY2.js +106 -0
  70. package/dist/chunk-UEA4NCY2.js.map +1 -0
  71. package/dist/chunk-VAPCU2FX.js +70 -0
  72. package/dist/chunk-VAPCU2FX.js.map +1 -0
  73. package/dist/{chunk-RVEXPMM3.js → chunk-WEJVFNRO.js} +3 -5
  74. package/dist/{chunk-RVEXPMM3.js.map → chunk-WEJVFNRO.js.map} +1 -1
  75. package/dist/{chunk-IMROMZ2K.js → chunk-WWFVMCTR.js} +19 -14
  76. package/dist/chunk-WWFVMCTR.js.map +1 -0
  77. package/dist/chunk-XPONNOBR.js +102 -0
  78. package/dist/chunk-XPONNOBR.js.map +1 -0
  79. package/dist/{chunk-N3VGY3T3.js → chunk-Y3HJ2F2W.js} +7 -5
  80. package/dist/{chunk-N3VGY3T3.js.map → chunk-Y3HJ2F2W.js.map} +1 -1
  81. package/dist/{chunk-2A36HWDE.js → chunk-Y4I7ZCAE.js} +129 -136
  82. package/dist/chunk-Y4I7ZCAE.js.map +1 -0
  83. package/dist/{chunk-GRASK6M6.js → chunk-ZREU2UHM.js} +5 -5
  84. package/dist/{chunk-QA5U36JN.js → chunk-ZT7ANP3H.js} +774 -364
  85. package/dist/chunk-ZT7ANP3H.js.map +1 -0
  86. package/dist/{chunk-EOPFER6N.js → chunk-ZUXFPAVX.js} +19 -5
  87. package/dist/chunk-ZUXFPAVX.js.map +1 -0
  88. package/dist/{chunk-D432JAXV.js → chunk-ZWB6YXVQ.js} +153 -25
  89. package/dist/chunk-ZWB6YXVQ.js.map +1 -0
  90. package/dist/{chunk-23XSG7LI.js → chunk-ZZQDJGWX.js} +4 -4
  91. package/dist/{compile-GXADKGH5.js → compile-IMJHVXQO.js} +33 -37
  92. package/dist/{compile-GXADKGH5.js.map → compile-IMJHVXQO.js.map} +1 -1
  93. package/dist/{config-JMHNA2U5.js → config-FVVN3NWL.js} +16 -21
  94. package/dist/{config-JMHNA2U5.js.map → config-FVVN3NWL.js.map} +1 -1
  95. package/dist/cursor-local-install-JS5KSOES.js +94 -0
  96. package/dist/{cursor-local-install-46RWRBDT.js.map → cursor-local-install-JS5KSOES.js.map} +1 -1
  97. package/dist/{cursor-local-install-46RWRBDT.js → cursor-local-install-QU5R2FV5.js} +8 -12
  98. package/dist/cursor-local-install-QU5R2FV5.js.map +1 -0
  99. package/dist/{doctor-N7ZULPOL.js → doctor-A7VUJSCP.js} +14 -17
  100. package/dist/doctor-A7VUJSCP.js.map +1 -0
  101. package/dist/{environment-OBB3WU5B.js → environment-6INIUBNC.js} +42 -50
  102. package/dist/environment-6INIUBNC.js.map +1 -0
  103. package/dist/{github-PBYBGOLH.js → github-TFJT3P53.js} +9 -10
  104. package/dist/{github-PBYBGOLH.js.map → github-TFJT3P53.js.map} +1 -1
  105. package/dist/{harness-7KYATIV6.js → harness-WQNC5HPZ.js} +46 -84
  106. package/dist/harness-WQNC5HPZ.js.map +1 -0
  107. package/dist/{help-EE3AJQD4.js → help-NMS3EXJB.js} +15 -20
  108. package/dist/{help-EE3AJQD4.js.map → help-NMS3EXJB.js.map} +1 -1
  109. package/dist/{help-VXWKLQ6A.js → help-VW4RIICD.js} +57 -575
  110. package/dist/help-VW4RIICD.js.map +1 -0
  111. package/dist/host-plugin-view-kept-HYCHDB4D.js +139 -0
  112. package/dist/host-plugin-view-kept-HYCHDB4D.js.map +1 -0
  113. package/dist/index.js +12 -16
  114. package/dist/{init-LBTMPDVJ.js → init-RXYL5ZUE.js} +33 -41
  115. package/dist/{init-LBTMPDVJ.js.map → init-RXYL5ZUE.js.map} +1 -1
  116. package/dist/live-read-cache-BHU6L7MA.js +13 -0
  117. package/dist/live-read-cache-NQU7M2C7.js +12 -0
  118. package/dist/{lock-WLJRXRVK.js → lock-3H3Z65DS.js} +9 -12
  119. package/dist/{lock-WLJRXRVK.js.map → lock-3H3Z65DS.js.map} +1 -1
  120. package/dist/{marketplace-GXSV6QIY.js → marketplace-KW35PJCY.js} +26 -79
  121. package/dist/marketplace-KW35PJCY.js.map +1 -0
  122. package/dist/{mcp-XPDWWU75.js → mcp-2HUGVDJ5.js} +33 -37
  123. package/dist/{mcp-XPDWWU75.js.map → mcp-2HUGVDJ5.js.map} +1 -1
  124. package/dist/{migrate-SBUIWN3U.js → migrate-6VAPYNXI.js} +93 -34
  125. package/dist/migrate-6VAPYNXI.js.map +1 -0
  126. package/dist/notifications-Y7KQCN6K.js +154 -0
  127. package/dist/notifications-Y7KQCN6K.js.map +1 -0
  128. package/dist/open-FADABB2S.js +20 -0
  129. package/dist/{pack-A73LDVOX.js → pack-NTECD3BZ.js} +10 -14
  130. package/dist/{pack-A73LDVOX.js.map → pack-NTECD3BZ.js.map} +1 -1
  131. package/dist/plugin-T2YFCYIO.js +47 -0
  132. package/dist/plugin-from-project-FGX5AHW6.js +15 -0
  133. package/dist/{policy-6VY3CMSU.js → policy-3FOWB4GR.js} +9 -12
  134. package/dist/{policy-6VY3CMSU.js.map → policy-3FOWB4GR.js.map} +1 -1
  135. package/dist/{profile-YCKPMRRU.js → profile-HM3ROXXB.js} +108 -78
  136. package/dist/profile-HM3ROXXB.js.map +1 -0
  137. package/dist/{project-KHPPBKPN.js → project-3DTXKMI6.js} +512 -119
  138. package/dist/project-3DTXKMI6.js.map +1 -0
  139. package/dist/{resource-IJU3FAN5.js → resource-TZDZAVZ6.js} +55 -45
  140. package/dist/resource-TZDZAVZ6.js.map +1 -0
  141. package/dist/status-refresh-worker.js +1155 -0
  142. package/dist/status-refresh-worker.js.map +1 -0
  143. package/dist/{version-Z66FWWMQ.js → version-AMZJHJIB.js} +3 -3
  144. package/dist/version-AMZJHJIB.js.map +1 -0
  145. package/package.json +16 -11
  146. package/dist/apply-SUNDXRJ3.js +0 -54
  147. package/dist/chunk-2A36HWDE.js.map +0 -1
  148. package/dist/chunk-2H7UOFLK.js +0 -11
  149. package/dist/chunk-3FS775NP.js.map +0 -1
  150. package/dist/chunk-43BDGVN3.js.map +0 -1
  151. package/dist/chunk-4ZQ2SCGY.js.map +0 -1
  152. package/dist/chunk-6LTLYV5D.js.map +0 -1
  153. package/dist/chunk-D432JAXV.js.map +0 -1
  154. package/dist/chunk-DF4Z7LAD.js +0 -3463
  155. package/dist/chunk-DF4Z7LAD.js.map +0 -1
  156. package/dist/chunk-EOPFER6N.js.map +0 -1
  157. package/dist/chunk-G6WKY2W4.js +0 -389
  158. package/dist/chunk-G6WKY2W4.js.map +0 -1
  159. package/dist/chunk-IE7B6Q5K.js.map +0 -1
  160. package/dist/chunk-IMROMZ2K.js.map +0 -1
  161. package/dist/chunk-M2U3J7UX.js +0 -46
  162. package/dist/chunk-M2U3J7UX.js.map +0 -1
  163. package/dist/chunk-N3ZCH64F.js.map +0 -1
  164. package/dist/chunk-NAGAJ5UM.js +0 -145
  165. package/dist/chunk-NAGAJ5UM.js.map +0 -1
  166. package/dist/chunk-OML4HXKT.js.map +0 -1
  167. package/dist/chunk-QA5U36JN.js.map +0 -1
  168. package/dist/chunk-R7ZOYVN3.js.map +0 -1
  169. package/dist/chunk-RDG5DT7S.js.map +0 -1
  170. package/dist/chunk-REHRUNBB.js.map +0 -1
  171. package/dist/chunk-RFQ3N7FB.js.map +0 -1
  172. package/dist/chunk-TQ2NA4Z4.js.map +0 -1
  173. package/dist/chunk-ULCD6DJE.js.map +0 -1
  174. package/dist/chunk-WG5A6EAU.js.map +0 -1
  175. package/dist/chunk-XGTTOO4R.js +0 -84
  176. package/dist/chunk-XGTTOO4R.js.map +0 -1
  177. package/dist/chunk-XTVGCVU4.js.map +0 -1
  178. package/dist/chunk-XUJKZQZA.js +0 -235
  179. package/dist/chunk-XUJKZQZA.js.map +0 -1
  180. package/dist/chunk-ZUASVASP.js.map +0 -1
  181. package/dist/doctor-N7ZULPOL.js.map +0 -1
  182. package/dist/environment-OBB3WU5B.js.map +0 -1
  183. package/dist/harness-7KYATIV6.js.map +0 -1
  184. package/dist/help-VXWKLQ6A.js.map +0 -1
  185. package/dist/live-read-cache-TUSP7U3D.js +0 -10
  186. package/dist/marketplace-GXSV6QIY.js.map +0 -1
  187. package/dist/migrate-SBUIWN3U.js.map +0 -1
  188. package/dist/open-HDGLYYVU.js +0 -24
  189. package/dist/plugin-CEO6ZJM5.js +0 -51
  190. package/dist/plugin-from-project-UK7VJVUP.js +0 -18
  191. package/dist/profile-YCKPMRRU.js.map +0 -1
  192. package/dist/project-KHPPBKPN.js.map +0 -1
  193. package/dist/resource-IJU3FAN5.js.map +0 -1
  194. /package/dist/{apply-SUNDXRJ3.js.map → apply-ZGEAY6YZ.js.map} +0 -0
  195. /package/dist/{chunk-3P6BWL5F.js.map → chunk-27IPOVKQ.js.map} +0 -0
  196. /package/dist/{chunk-JQOKQKQT.js.map → chunk-7IBFH736.js.map} +0 -0
  197. /package/dist/{chunk-P2C7JPLD.js.map → chunk-CKJIS2FM.js.map} +0 -0
  198. /package/dist/{chunk-U6DXASQP.js.map → chunk-HC7IZY75.js.map} +0 -0
  199. /package/dist/{chunk-UVVZHWD2.js.map → chunk-I4DKV63E.js.map} +0 -0
  200. /package/dist/{chunk-PNGF5EV2.js.map → chunk-JEC5PWNH.js.map} +0 -0
  201. /package/dist/{chunk-2H7UOFLK.js.map → chunk-MKLJBW5N.js.map} +0 -0
  202. /package/dist/{chunk-BPWFQKI5.js.map → chunk-NIFKCS7J.js.map} +0 -0
  203. /package/dist/{chunk-7HP6AAI3.js.map → chunk-SMLO5YPI.js.map} +0 -0
  204. /package/dist/{chunk-73OJQTBW.js.map → chunk-T2JBSRGG.js.map} +0 -0
  205. /package/dist/{chunk-GRASK6M6.js.map → chunk-ZREU2UHM.js.map} +0 -0
  206. /package/dist/{chunk-23XSG7LI.js.map → chunk-ZZQDJGWX.js.map} +0 -0
  207. /package/dist/{live-read-cache-TUSP7U3D.js.map → live-read-cache-BHU6L7MA.js.map} +0 -0
  208. /package/dist/{open-HDGLYYVU.js.map → live-read-cache-NQU7M2C7.js.map} +0 -0
  209. /package/dist/{plugin-CEO6ZJM5.js.map → open-FADABB2S.js.map} +0 -0
  210. /package/dist/{plugin-from-project-UK7VJVUP.js.map → plugin-T2YFCYIO.js.map} +0 -0
  211. /package/dist/{version-Z66FWWMQ.js.map → plugin-from-project-FGX5AHW6.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/services/cli-help-registry.ts","../src/ui/format.ts","../src/ui/theme.ts","../src/ui/kv.ts","../src/ui/table.ts","../src/ui/panel.ts","../src/ui/diff.ts","../src/ui/progress.ts","../src/ui/status.ts","../src/ui/section.ts","../src/ui/index.ts","../src/cli/command-catalog.ts","../src/cli/shared.ts","../src/cli/help.ts"],"sourcesContent":["import type { Command } from \"commander\";\n\nexport interface CommandHelpEntry {\n description: string;\n /** Extra paragraphs shown under the short description on leaf-command help. */\n details?: string;\n examples?: string[];\n /** Optional args that error without a TTY; help shows them as required. */\n requiredOffTtyArgs?: string[];\n}\n\nexport type CommandHelpRegistry = Record<string, CommandHelpEntry>;\n\nexport const COMMAND_HELP_REGISTRY: CommandHelpRegistry = {\n \"help.scenario\": {\n description: \"Show a numbered scenario playbook from the docs\",\n examples: [\"help scenario 11\", \"help scenario 7 --format json\"],\n },\n doctor: {\n description: \"Check Node, native modules, paths, and harness detection\",\n examples: [\"doctor\", \"doctor --format json\"],\n },\n init: {\n description: \"Initialize local HarnessTap state\",\n examples: [\n \"init\",\n \"init --harnesses claude-code,cursor,codex\",\n \"init --format json\",\n ],\n },\n \"init.completion\": {\n description:\n \"Generate shell completion scripts for bash, zsh, or fish\",\n examples: [\n \"init completion bash >> ~/.bashrc\",\n \"init completion zsh >> ~/.zshrc\",\n \"init completion fish > ~/.config/fish/completions/ht.fish\",\n ],\n },\n add: {\n description:\n \"Install skills from a remote GitHub repo, Git URL, or local skill-package directory\",\n examples: [\n \"add mattpocock/skills\",\n \"add mattpocock/skills --list\",\n \"add mattpocock/skills --skill caveman,grill-me --global --yes\",\n ],\n },\n scan: {\n description:\n \"Import resources from a project tree (hash-aware upsert; prompts on content drift when interactive)\",\n examples: [\n \"scan\",\n \"scan ./my-project --dry-run\",\n \"scan --harness claude-code\",\n \"scan --format json\",\n ],\n },\n mirror: {\n description:\n \"Mirror the other harness outputs from the first registered harness on-disk configuration\",\n examples: [\n \"mirror\",\n \"mirror . --dry-run\",\n \"mirror --reference auto --format json\",\n ],\n },\n use: {\n description:\n \"Switch to a project-configured profile and environment from apm.yml\",\n examples: [\n \"use\",\n \"use --profile dev\",\n \"use --list\",\n \"use --profile dev --dry-run --format json\",\n ],\n },\n \"config.show\": {\n description: \"Show resolved project profile config\",\n examples: [\n \"config show\",\n \"config show --project . --format json\",\n ],\n },\n \"config.validate\": {\n description: \"Validate project profile config references\",\n examples: [\n \"config validate\",\n \"config validate --format json\",\n ],\n },\n \"config.init\": {\n description: \"Create a starter apm.yml from local profile plugins\",\n examples: [\n \"config init\",\n \"config init --profile work --profile personal --default work\",\n \"config init --force --format json\",\n ],\n },\n status: {\n description: \"Show current project status and drift summary\",\n examples: [\n \"status\",\n \"status --check\",\n \"status --format json\",\n ],\n },\n history: {\n description: \"List configuration snapshots for a project\",\n examples: [\n \"history\",\n \"history --format json\",\n \"history --show-id\",\n ],\n },\n revert: {\n description: \"Revert a project or global apply snapshot\",\n examples: [\n \"revert <snapshot-id>\",\n \"revert <snapshot-id> --dry-run\",\n ],\n },\n apply: {\n description:\n \"Resolve a plugin's dependency graph and materialize it into the project, or into machine home with --global\",\n examples: [\n \"apply base\",\n \"apply base --harness claude-code\",\n \"apply work --global\",\n \"apply ./build/my-pkg\",\n \"apply base --format json\",\n \"apply base --on-conflict replace\",\n ],\n },\n install: {\n description:\n \"Onboard a project from apm.yml (same as apply with no plugin selector)\",\n details:\n \"Reads repo-root apm.yml, resolves dependencies.apm (including transitive dependencies.apm on fetched packages) / dependencies.mcp (including MCP Registry v0.1 identities such as io.github...), compiles local .apm/ primitives, writes apm.lock.yaml, and materializes resolved target harness directories. Registry strings are fetched from registry.modelcontextprotocol.io and converted to the same native MCP files HT already emits. Self-defined registry: false entries keep command/url as authored. --mcp <id> appends the identity to apm.yml then runs install; a failed install rolls the manifest write back. Target resolution: --target/--all/--harness, then targets: in apm.yml, then project/global harness preference, then filesystem auto-detect. Declared targets: win over preference and folder detection. Fails closed when no target can be resolved. Commit the lockfile plus generated harness output. Same project-scope flags as apply. Does not take a plugin selector or --global.\",\n examples: [\n \"install\",\n \"install --project .\",\n \"install --mcp io.github.github/github-mcp-server --target cursor\",\n \"install --target cursor,claude\",\n \"install --harness claude-code,cursor\",\n \"install --dry-run\",\n \"install --update\",\n ],\n },\n \"mcp.search\": {\n description: \"Search the official MCP Registry (v0.1)\",\n details:\n \"GET /v0.1/servers?search= against registry.modelcontextprotocol.io. This is discovery only; install still goes through ht install / ht mcp install.\",\n examples: [\n \"mcp search github\",\n \"mcp search filesystem --format json\",\n ],\n },\n \"mcp.list\": {\n description: \"List servers from the official MCP Registry (v0.1)\",\n details:\n \"GET /v0.1/servers with cursor pagination. Does not install or mutate apm.yml.\",\n examples: [\n \"mcp list\",\n \"mcp list --limit 10 --format json\",\n ],\n },\n \"mcp.show\": {\n description: \"Show one MCP Registry server and the native config HT would emit\",\n details:\n \"Fetches GET /v0.1/servers/{id}/versions/latest (URL-encoded). Prefers a remote HTTP/SSE endpoint when the registry document has remotes; otherwise picks npm, then oci, then pypi, then nuget. Secret values stay ${VAR} placeholders: HT does not inject a GitHub PAT.\",\n examples: [\n \"mcp show io.github.github/github-mcp-server\",\n \"mcp show io.github.github/github-mcp-server --format json\",\n ],\n },\n \"mcp.install\": {\n description: \"Append an MCP Registry identity to apm.yml and run ht install\",\n details:\n \"Same as ht install --mcp <id>: writes the identity under dependencies.mcp, then runs the existing apply-from-manifest install (same --target/--all/--harness pipeline as ht compile, including transitive dependencies.apm). If install fails, the apm.yml write is rolled back.\",\n examples: [\n \"mcp install io.github.github/github-mcp-server --target cursor\",\n \"mcp install io.github.github/github-mcp-server --dry-run\",\n ],\n },\n compile: {\n description:\n \"Named apply-from-manifest entry: compile .apm/ primitives into resolved target harness directories\",\n details:\n \"Same overlay path as ht install / ht apply with no plugin selector: existing writers, apm.lock.yaml local_deployed_file_hashes, policy, and trust. Resolution order: --target / --all / --harness, then targets: in apm.yml, then project/global harness preference, then filesystem auto-detect. Declared targets: win over preference so install stays portable. Fails closed when no target resolves. Does not take a plugin selector or --global. compilation.strategy: distributed is noted and ignored; output stays single-file root context (AGENTS.md / CLAUDE.md).\",\n examples: [\n \"compile\",\n \"compile --target cursor\",\n \"compile -t claude,cursor --dry-run\",\n \"compile --all\",\n \"compile --project . --format json\",\n ],\n },\n targets: {\n description:\n \"Show which apply harness targets resolve for this project, and why\",\n details:\n \"Prints the canonical target table (or JSON) using the same resolution order as ht compile / ht install: CLI flags, then targets: in apm.yml, then project/global harness preference, then filesystem auto-detect. --all includes the agent-skills meta-target row. Use this to preview the set before pinning targets: for portable lockfile / harness ownership.\",\n examples: [\n \"targets\",\n \"targets --format json\",\n \"targets --all --format json\",\n \"targets --project .\",\n ],\n },\n \"lock.export\": {\n description:\n \"Export a CycloneDX or SPDX SBOM inventory from the existing lockfile\",\n details:\n \"Inventory export only: reads apm.lock.yaml and serializes it. Never re-resolves, re-hashes, or touches the network. Default format is CycloneDX 1.5; --format spdx writes SPDX 2.3. This is not a security attestation: the document is unsigned and does not claim SLSA. --timestamp pins the document time; otherwise SOURCE_DATE_EPOCH, then the lockfile generated_at. Diagnostics go to stderr so stdout stays pipe-clean.\",\n examples: [\n \"lock export\",\n \"lock export --format cyclonedx -o sbom.json\",\n \"lock export --format spdx --timestamp 2024-06-01T00:00:00+00:00\",\n \"lock export --project .\",\n ],\n },\n pack: {\n description:\n \"Pack an apm.yml project into an Agent Plugins 1.0 bundle (plugin.json + primitives + apm.lock.yaml)\",\n details:\n \"Writes build/<name>/ by default, or a .zip with --archive. Consumers install the artifact with ht apply <dir-or-zip>. Bundles are target-agnostic; plugin.json is metadata and is never deployed as a harness file.\",\n examples: [\n \"pack\",\n \"pack --archive -o ./dist\",\n \"pack --dry-run --verbose\",\n \"pack --format json\",\n ],\n },\n audit: {\n description:\n \"Scan a project for hidden Unicode, lockfile hashes, and apm-policy.yml\",\n details:\n \"Default scan covers lockfile-recorded deployed files plus local primitive dirs, and evaluates apm-policy.yml when present. --ci fails on critical Unicode, hash mismatch/extra/missing, blocking policy, or required-executable-untrusted. --require-policy with --ci fails if no policy file exists. --strip removes critical and warning characters (mutually exclusive with --ci). Use --file to scan any one file.\",\n examples: [\n \"audit\",\n \"audit --file .cursorrules\",\n \"audit --ci --require-policy --format json\",\n \"audit --strip --dry-run\",\n ],\n },\n approve: {\n description: \"Approve executable primitives from dependency packages\",\n details:\n \"Writes project apm.yml executables.allow by default. --user writes ~/.harnesstap/config.jsonc (can only narrow past org/project deny). --pending lists gated packages; --all approves them; --recommended accepts the org recommend set; --list shows the effective decision per locked package.\",\n examples: [\n \"approve owner/repo\",\n \"approve --user owner/repo\",\n \"approve --pending\",\n \"approve --all\",\n ],\n },\n deny: {\n description: \"Deny executable primitives from dependency packages\",\n details:\n \"Writes project apm.yml executables.deny by default. --user writes ~/.harnesstap/config.jsonc.\",\n examples: [\"deny owner/repo\", \"deny --user owner/repo\"],\n },\n \"policy.explain\": {\n description: \"Print the effective executable-trust decision for a package\",\n details:\n \"Shows allowed or blocked per executable type, the deciding policy layer, and shadowed lower-authority layers.\",\n examples: [\"policy explain owner/repo\", \"policy explain owner/repo --format json\"],\n },\n \"plugin.create\": {\n description: \"Create a new local plugin\",\n examples: [\n \"plugin create my-plugin\",\n \"plugin create my-plugin -d \\\"Team defaults\\\" --tags team\",\n \"plugin create skills --from mattpocock/skills --skill caveman\",\n ],\n },\n \"plugin.list\": {\n description:\n \"List local plugins. Pass --remote to include catalog results, or --remote-only for catalog only.\",\n examples: [\n \"plugin list\",\n \"plugin list --remote --search foundation\",\n \"plugin list --remote-only --tag profile\",\n ],\n },\n \"plugin.show\": {\n description: \"Show plugin details, resources, and plugin pins\",\n examples: [\n \"plugin show my-plugin\",\n \"plugin show my-plugin --format json\",\n ],\n requiredOffTtyArgs: [\"name\"],\n },\n \"plugin.edit\": {\n description:\n \"Edit plugin composition and default environment (interactive or scripting)\",\n examples: [\n \"plugin edit my-plugin\",\n \"plugin edit my-plugin --add skill:caveman\",\n \"plugin edit my-plugin --environment dev\",\n ],\n },\n \"plugin.editor\": {\n description: \"Open a plugin definition file in your system editor\",\n examples: [\"plugin editor my-plugin\"],\n },\n \"plugin.delete\": {\n description: \"Delete a local plugin\",\n examples: [\n \"plugin delete my-plugin\",\n \"plugin delete\",\n ],\n requiredOffTtyArgs: [\"name\"],\n },\n \"plugin.catalog.list\": {\n description: \"Show default and connected catalog sources\",\n examples: [\n \"plugin catalog list\",\n \"plugin catalog list --format json\",\n ],\n },\n \"plugin.catalog.connect\": {\n description:\n \"Connect an org or individual public plugin to the local catalog scope\",\n examples: [\n \"plugin catalog connect org acme\",\n \"plugin catalog connect plugin acme/default/foundation\",\n ],\n },\n \"plugin.catalog.disconnect\": {\n description:\n \"Disconnect a connected org or plugin from the local catalog scope\",\n examples: [\n \"plugin catalog disconnect org acme\",\n \"plugin catalog disconnect plugin acme/default/foundation\",\n ],\n },\n \"plugin.catalog.register\": {\n description: \"Register a publish catalog on this machine\",\n examples: [\n \"plugin catalog register acme/default\",\n \"plugin catalog register work@acme/releases\",\n ],\n },\n \"plugin.catalog.unregister\": {\n description: \"Remove a publish catalog from this machine\",\n examples: [\"plugin catalog unregister acme/default\"],\n },\n \"plugin.catalog.registered\": {\n description: \"List registered publish catalogs\",\n examples: [\n \"plugin catalog registered\",\n \"plugin catalog registered --format json\",\n ],\n },\n \"plugin.catalog.bindings\": {\n description: \"Configure which registered catalogs a plugin publishes to\",\n examples: [\n \"plugin catalog bindings my-plugin\",\n \"plugin catalog bindings my-plugin --add acme/default\",\n \"plugin catalog bindings my-plugin --clear\",\n ],\n },\n \"plugin.publish\": {\n description: \"Publish a local plugin to registered cloud catalogs\",\n examples: [\n \"plugin publish my-plugin\",\n \"plugin publish my-plugin acme/default\",\n \"plugin publish my-plugin --version 1.1.0\",\n \"plugin publish my-plugin --strict\",\n \"plugin publish my-plugin --vendor-extensions\",\n ],\n },\n \"plugin.pull\": {\n description: \"Pull a plugin from the remote catalog into the local DB\",\n examples: [\n \"plugin pull acme/foundation\",\n \"plugin pull foundation --org acme --as local-foundation\",\n ],\n },\n \"plugin.publish.plan\": {\n description: \"Dry-run publish targets for a local plugin\",\n examples: [\n \"plugin publish plan my-plugin\",\n \"plugin publish plan my-plugin --format json\",\n ],\n },\n \"plugin.diff\": {\n description: \"Diff two plugins or a plugin and a plugin export file\",\n examples: [\n \"plugin diff left right\",\n \"plugin diff my-plugin ./export.ap.json\",\n ],\n },\n \"plugin.validate\": {\n description: \"Load an Agent Plugins 1.0.0 package and report what would load\",\n details:\n \"Reads a plugin directory, zip, or .ap.json envelope. Unknown manifest fields are reported and ignored. \"\n + \"Invalid skills and MCP servers are skipped. A bad mcp.json disables MCP and keeps the skills. \"\n + \"Exit 1 only when the plugin itself is rejected.\",\n examples: [\n \"plugin validate ./my-plugin --spec 1.0.0\",\n \"plugin validate ./my-plugin --format json\",\n ],\n },\n \"plugin.doctor\": {\n description: \"Run doctor checks against a plugin\",\n examples: [\n \"plugin doctor my-plugin\",\n \"plugin doctor my-plugin --format json\",\n ],\n },\n \"plugin.check\": {\n description:\n \"Compare library working heads to marketplace, git, and catalog origins\",\n details:\n \"Omit a name to check every syncable working head. --refresh force-fetches origins. \"\n + \"Outdated is not a failure; exit 1 only when a check row is error.\",\n examples: [\n \"plugin check\",\n \"plugin check my-plugin --refresh\",\n \"plugin check --format json\",\n ],\n },\n \"plugin.update\": {\n description:\n \"Update library working heads from marketplace, git, and catalog origins\",\n details:\n \"Pass a plugin name or --all. --all confirms on TTY unless --yes; non-interactive \"\n + \"--all requires --yes. --force reapplies when fingerprints already match.\",\n examples: [\n \"plugin update my-plugin\",\n \"plugin update --all --yes\",\n \"plugin update --all --yes --format json\",\n ],\n },\n \"plugin.cut\": {\n description: \"Cut a new local version from the working head\",\n examples: [\n \"plugin cut my-plugin --version 1.3.0\",\n \"plugin cut my-plugin --version 1.3.0 --format json\",\n ],\n },\n \"plugin.versions\": {\n description: \"List local frozen versions and the working head\",\n examples: [\n \"plugin versions my-plugin\",\n \"plugin versions my-plugin --format json\",\n ],\n },\n \"plugin.rollback\": {\n description: \"Restore a frozen version onto the working head\",\n details:\n \"Copies the frozen snapshot onto the current semver and marks the head dirty. \" +\n \"Does not apply the plugin. Non-interactive use requires --yes.\",\n examples: [\n \"plugin rollback my-plugin --to 1.0.0 --yes\",\n \"plugin rollback my-plugin --to 1.0.0 --yes --format json\",\n ],\n },\n \"plugin.why\": {\n description:\n \"Explain why a version was selected, or which plugin won a resource\",\n details:\n \"Answers why a version was selected, or which plugin won a given resource, \" +\n \"against the lockfile in the current project.\",\n examples: [\n \"plugin why base\",\n \"plugin why skill:deploy\",\n \"plugin why base --format json\",\n ],\n },\n \"plugin.fork\": {\n description:\n \"Create an editable authored copy of an upstream or catalog plugin\",\n details:\n \"Upstream and catalog plugins cannot be edited in place. A fork is an \"\n + \"authored plugin that starts with the same resources and dependencies.\",\n examples: [\n \"plugin fork web-search\",\n \"plugin fork web-search --as my-search\",\n \"plugin fork web-search --format json\",\n ],\n },\n \"plugin.from-project\": {\n description: \"Scan current folder and create a plugin from its resources\",\n examples: [\n \"plugin from-project my-plugin --project .\",\n \"plugin from-project team-plugin -d \\\"From repo\\\"\",\n ],\n },\n \"profile.list\": {\n description:\n \"List local profile plugins. Pass --remote to include catalog profiles with tag=profile. Marks the active profile.\",\n examples: [\n \"profile list\",\n \"profile list --search work\",\n \"profile list --remote\",\n ],\n },\n \"profile.show\": {\n description:\n \"Show profile plugin details, resources, and dependencies\",\n examples: [\n \"profile show work\",\n \"profile show work --format json\",\n ],\n requiredOffTtyArgs: [\"name\"],\n },\n \"profile.status\": {\n description:\n \"Show the active profile and whether global harness files are in sync\",\n examples: [\n \"profile status\",\n \"profile status --check\",\n \"profile status --format json\",\n ],\n },\n \"profile.switch\": {\n description:\n \"Switch the active profile and restore the previous one on failure\",\n examples: [\n \"profile switch work\",\n \"profile switch work --harness claude-code\",\n \"profile switch work --format json\",\n ],\n },\n \"profile.use\": {\n description:\n \"Merge profile stack, apply globally, and set active pointer; delegates to project config when present\",\n examples: [\n \"profile use work\",\n \"profile use --profile dev\",\n \"profile use work --dry-run\",\n \"profile use work --harness claude-code\",\n ],\n },\n \"profile.stash.list\": {\n description: \"List stashed profiles\",\n examples: [\n \"profile stash list\",\n \"profile stash ls --format json\",\n ],\n },\n \"profile.stash.pop\": {\n description:\n \"Restore the most recent stashed profile and remove it from the stash\",\n examples: [\n \"profile stash pop\",\n \"profile stash pop --harness claude-code\",\n ],\n },\n \"profile.stash.apply\": {\n description:\n \"Restore the most recent stashed profile without removing it from the stash\",\n examples: [\n \"profile stash apply\",\n \"profile stash apply --dry-run\",\n ],\n },\n \"profile.create\": {\n description:\n \"Create a profile plugin, promote an existing plugin, or import from a skill package\",\n examples: [\n \"profile create work\",\n \"profile create work --from mattpocock/skills --use\",\n \"profile create work -d \\\"Work profile\\\"\",\n ],\n },\n \"profile.delete\": {\n description:\n \"Demote a profile plugin and optionally delete the underlying plugin\",\n examples: [\n \"profile delete work\",\n \"profile delete work --plugin -y\",\n ],\n },\n \"profile.pull\": {\n description: \"Pull a profile plugin from catalog\",\n examples: [\n \"profile pull acme/work-profile\",\n \"profile pull work-profile --org acme --as work\",\n ],\n },\n \"profile.publish\": {\n description: \"Publish a profile plugin with validation warnings\",\n examples: [\n \"profile publish work\",\n \"profile publish work --org acme --catalog default\",\n ],\n },\n \"environment.create\": {\n description:\n \"Create a named environment bundle (blank, from project, or from configured plugin requirements)\",\n examples: [\n \"environment create dev\",\n \"environment create dev --from-project .\",\n \"environment create dev --from-plugin my-plugin --bind\",\n ],\n },\n \"environment.edit\": {\n description:\n \"Edit environment values interactively or via scripting flags\",\n examples: [\n \"environment edit dev\",\n \"environment edit dev --var API_URL=https://api.example.com\",\n \"environment edit dev --model claude-sonnet-4-20250514\",\n ],\n },\n \"environment.list\": {\n description: \"List named environment bundles\",\n examples: [\n \"environment list\",\n \"environment list --format json\",\n ],\n },\n \"environment.show\": {\n description:\n \"Show environment values, secret refs, and reverse references\",\n examples: [\n \"environment show dev\",\n \"environment show dev --plugin my-plugin\",\n ],\n },\n \"environment.delete\": {\n description: \"Delete a named environment\",\n examples: [\n \"environment delete dev\",\n \"environment delete dev --force\",\n ],\n },\n \"environment.use\": {\n description:\n \"Set the global active environment; --local applies only to this terminal session\",\n examples: [\n \"environment use dev\",\n \"environment use dev --local\",\n ],\n },\n \"environment.status\": {\n description:\n \"Show the active environment and whether terminal env vars match expected values\",\n examples: [\n \"environment status\",\n \"environment status --check\",\n \"environment status --format json\",\n ],\n },\n \"migrate.export\": {\n description:\n \"Export workspace, plugin, or resource as an Agent Plugins package or workspace archive\",\n examples: [\n \"migrate export backup.tar.gz --workspace\",\n \"migrate export --plugin my-plugin -o ./my-plugin\",\n \"migrate export --plugin my-plugin --single-file -o my-plugin.ap.json\",\n \"migrate export --plugin my-plugin --archive -o my-plugin.zip\",\n \"migrate export --plugin my-plugin --vendor-extensions -o ./my-plugin\",\n \"migrate export --resource skill:caveman\",\n ],\n },\n \"migrate.import\": {\n description:\n \"Import a package directory, .ap.json envelope, or .tar.gz workspace archive\",\n examples: [\n \"migrate import backup.tar.gz\",\n \"migrate import ./my-plugin\",\n \"migrate import my-plugin.ap.json\",\n ],\n },\n \"migrate.resolve-order\": {\n description:\n \"Pin last-applied resource winners as overrides where current resolution would pick a different plugin\",\n examples: [\n \"migrate resolve-order\",\n \"migrate resolve-order --dry-run\",\n \"migrate resolve-order --format json\",\n ],\n },\n \"resource.list\": {\n description: \"List imported resources in the local library\",\n examples: [\n \"resource list\",\n \"resource list skill\",\n \"resource list --search caveman\",\n ],\n },\n \"resource.show\": {\n description:\n \"Show resource details (name, type:name, type:name@namespace, or ULID)\",\n examples: [\n \"resource show caveman\",\n \"resource show skill:caveman --format json\",\n \"resource show tiny-skill --full\",\n ],\n requiredOffTtyArgs: [\"resource\"],\n },\n \"resource.sync\": {\n description:\n \"Sync plugin resources and marketplace-linked definitions from install trees\",\n examples: [\n \"resource sync\",\n \"resource sync plugin:my-plugin --dry-run\",\n \"resource sync --on-conflict replace\",\n ],\n },\n \"resource.delete\": {\n description: \"Delete a resource from the local library\",\n examples: [\n \"resource delete caveman\",\n \"resource delete\",\n ],\n requiredOffTtyArgs: [\"resource\"],\n },\n \"harness.list\": {\n description: \"List supported harnesses\",\n examples: [\n \"harness list\",\n \"harness list --supported --format json\",\n ],\n },\n \"harness.set\": {\n description: \"Set global registered harnesses\",\n examples: [\n \"harness set --harnesses claude-code,cursor,codex\",\n ],\n },\n \"harness.status\": {\n description: \"Show global harness preferences\",\n examples: [\n \"harness status\",\n \"harness status --format json\",\n ],\n },\n \"harness.sync\": {\n description:\n \"Union resources from registered harnesses and materialize with last-write conflicts\",\n details:\n \"Scans every registered harness, unions portable types (skills, MCP, rules, host plugin install trees, and other serializer-supported resources), keeps the newest on-disk copy when the same identity differs (later registered harness on ties), and emits shared skill paths when multiple targets can read them. Claude and Cursor plugin trees are copied into each native root (they do not share a runtime plugin directory). Skills, agents, and commands inside those plugins are also materialized into `.agents` (and equivalent folders) for OpenCode and other harnesses that do not load Cursor/Claude plugin roots. Matching CLAUDE.md and AGENTS.md share one file: AGENTS.md is canonical and CLAUDE.md links to it unless copy mode is set. Configure with `harnessSync.pluginResources` in config.jsonc (`symlink`, `copy`, or `clone`) or `--plugin-resources`. Default scope is the home directory. This is not copy-from-one-harness mirror.\",\n examples: [\n \"harness sync\",\n \"harness sync --dry-run --format json\",\n \"harness sync --plugin-resources copy\",\n \"harness sync --project .\",\n ],\n },\n \"harness.project.set\": {\n description: \"Set project-scoped registered harnesses\",\n examples: [\n \"harness project set --harnesses claude-code,cursor\",\n \"harness project set --project . --harnesses cursor\",\n ],\n },\n \"harness.project.status\": {\n description: \"Show project-scoped harness preferences\",\n examples: [\n \"harness project status\",\n \"harness project status --format json\",\n ],\n },\n \"auth.login\": {\n description: \"Log into HarnessTap Cloud via device authentication\",\n examples: [\n \"auth login\",\n \"auth login work --base-url https://harnesstap.com\",\n ],\n },\n \"auth.status\": {\n description: \"Show authenticated user and account context\",\n examples: [\n \"auth status\",\n \"auth status --account work --format json\",\n ],\n },\n \"auth.orgs\": {\n description: \"List organizations and optionally switch\",\n examples: [\n \"auth orgs\",\n \"auth orgs --switch acme\",\n ],\n },\n \"auth.logout\": {\n description: \"Log out and remove local cloud account\",\n examples: [\n \"auth logout\",\n \"auth logout --account work\",\n ],\n },\n \"github.login\": {\n description: \"Log into GitHub via device authentication (GitHub App user-to-server)\",\n examples: [\n \"github login\",\n ],\n },\n \"github.status\": {\n description: \"Show GitHub authentication status\",\n examples: [\n \"github status\",\n \"github status --format json\",\n ],\n },\n \"github.logout\": {\n description: \"Remove the stored GitHub session\",\n examples: [\n \"github logout\",\n ],\n },\n \"marketplace.add\": {\n description: \"Register a plugin marketplace URL\",\n examples: [\n \"marketplace add https://github.com/example/demo.git --name demo\",\n \"marketplace add https://github.com/example/demo.git --platform claude-code --format json\",\n ],\n },\n \"marketplace.list\": {\n description: \"List configured plugin marketplaces\",\n examples: [\n \"marketplace list\",\n \"marketplace ls --format json\",\n ],\n },\n \"marketplace.remove\": {\n description: \"Remove a configured plugin marketplace\",\n examples: [\n \"marketplace remove demo\",\n \"marketplace rm demo --format json\",\n ],\n },\n \"marketplace.show\": {\n description: \"List or browse plugins from a marketplace catalog\",\n examples: [\n \"marketplace show demo\",\n \"marketplace show demo --refresh --format json\",\n ],\n },\n \"plugin.search\": {\n description: \"Search marketplace catalogs for plugins by name, tags, and nested skills/commands\",\n examples: [\n \"plugin search typescript\",\n \"plugin search --refresh --format json\",\n ],\n },\n \"plugin.add\": {\n description:\n \"Import a GitHub plugin.json package into the library, or add a dependency to a plugin with --to\",\n examples: [\n \"plugin add DietrichGebert/ponytail\",\n \"plugin add https://github.com/DietrichGebert/ponytail\",\n \"plugin add gh:DietrichGebert/ponytail\",\n \"plugin add base --to root\",\n \"plugin add fmt@demo --to team-stack\",\n ],\n },\n};\n\nfunction normalizeCommandName(name: string): string {\n const bracketIndex = name.indexOf(\" \");\n return bracketIndex === -1 ? name : name.slice(0, bracketIndex);\n}\n\nexport function resolveCommandHelpPath(cmd: Command): string {\n const segments: string[] = [];\n let current: Command | null = cmd;\n\n while (current?.parent) {\n segments.unshift(normalizeCommandName(current.name()));\n current = current.parent;\n }\n\n return segments.join(\".\");\n}\n\nexport function getCommandHelpEntry(cmd: Command): CommandHelpEntry | undefined {\n return COMMAND_HELP_REGISTRY[resolveCommandHelpPath(cmd)];\n}\n","import { formatCount } from \"../copy/plurals.js\";\n\nexport { formatCount } from \"../copy/plurals.js\";\n\nexport function truncate(value: string, width: number): string {\n if (value.length <= width) return value;\n if (width <= 3) return \".\".repeat(Math.max(1, width));\n return `${value.slice(0, width - 3)}...`;\n}\n\nexport function shortenId(value: string): string {\n if (value.length <= 10) return value;\n return `${value.slice(0, 4)}...${value.slice(-4)}`;\n}\n\nexport function formatAbsoluteTime(\n value: string | number | Date,\n options?: { includeTime?: boolean },\n): string {\n const date = value instanceof Date ? value : new Date(value);\n if (options?.includeTime) {\n return date.toISOString().slice(0, 19).replace(\"T\", \" \");\n }\n return date.toISOString().slice(0, 10);\n}\n\nexport function formatRelativeTime(value: string | number | Date): string {\n const date = value instanceof Date ? value : new Date(value);\n const diffMs = Date.now() - date.getTime();\n const minute = 60_000;\n const hour = 60 * minute;\n const day = 24 * hour;\n\n if (diffMs < minute) {\n return `${formatCount(Math.max(1, Math.floor(diffMs / 1000)), \"second\")} ago`;\n }\n if (diffMs < hour) {\n return `${formatCount(Math.floor(diffMs / minute), \"minute\")} ago`;\n }\n if (diffMs < day) {\n return `${formatCount(Math.floor(diffMs / hour), \"hour\")} ago`;\n }\n if (diffMs <= 30 * day) {\n return `${formatCount(Math.floor(diffMs / day), \"day\")} ago`;\n }\n return formatAbsoluteTime(date);\n}\n\nexport function formatRelativeTimeWithAbsolute(value: string | number | Date): string {\n const relative = formatRelativeTime(value);\n const absolute = formatAbsoluteTime(value, { includeTime: true });\n if (relative === absolute) return relative;\n return `${relative} (${absolute})`;\n}\n\n","import chalk from \"chalk\";\n\n// Hexes match the Flow Split brand mark (violet #8b5cf6, blue #3b82f6, teal #14b8a6).\n// Keep CLI and Desktop in sync.\n\nexport type ThemeFn = (value: string) => string;\n\nfunction colorEnabled(): boolean {\n return !process.env.NO_COLOR && chalk.level > 0;\n}\n\nfunction maybe(style: ThemeFn): ThemeFn {\n return (value) => (colorEnabled() ? style(value) : value);\n}\n\nexport const icons = {\n success: \"✓\",\n warn: \"⚠\",\n danger: \"✗\",\n hint: \"→\",\n bullet: \"·\",\n profile: \"◎\",\n added: \"+\",\n removed: \"−\",\n modified: \"~\",\n} as const;\n\nconst resourceTypeStyles: Record<string, ThemeFn> = {\n instruction: maybe((value) => chalk.hex(\"#60a5fa\")(value)),\n skill: maybe((value) => chalk.hex(\"#34d399\")(value)),\n rule: maybe((value) => chalk.hex(\"#fbbf24\")(value)),\n mcp_server: maybe((value) => chalk.hex(\"#a78bfa\")(value)),\n permission: maybe((value) => chalk.hex(\"#f87171\")(value)),\n hook: maybe((value) => chalk.hex(\"#fb923c\")(value)),\n agent: maybe((value) => chalk.hex(\"#c084fc\")(value)),\n command: maybe((value) => chalk.hex(\"#2dd4bf\")(value)),\n env_var: maybe((value) => chalk.hex(\"#94a3b8\")(value)),\n model_config: maybe((value) => chalk.hex(\"#e879f9\")(value)),\n};\n\nconst mutedStyle = maybe((value) => chalk.hex(\"#6b7280\")(value));\n\nexport function styleResourceType(value: string): string {\n const style = resourceTypeStyles[value];\n return style ? style(value) : mutedStyle(value);\n}\n\nexport const theme = {\n // Existing tokens for backward compatibility\n primary: maybe((value) => chalk.bold(value)),\n accent: maybe((value) => chalk.hex(\"#3b82f6\")(value)),\n muted: mutedStyle,\n success: maybe((value) => chalk.hex(\"#14b8a6\")(value)),\n warn: maybe((value) => chalk.hex(\"#e6b84d\")(value)),\n danger: maybe((value) => chalk.hex(\"#ef4444\")(value)),\n badge: maybe((value) => chalk.bgHex(\"#3b82f6\").white.bold(` ${value} `)),\n\n // Role-based tokens\n heading: maybe((value) => chalk.bold.hex(\"#3b82f6\")(value)),\n label: maybe((value) => chalk.hex(\"#6b7280\")(value)),\n command: maybe((value) => chalk.hex(\"#14b8a6\")(value)),\n flag: maybe((value) => chalk.hex(\"#3b82f6\")(value)),\n entity: maybe((value) => chalk.hex(\"#e6b84d\")(value)),\n path: maybe((value) => chalk.hex(\"#8b5cf6\")(value)),\n info: maybe((value) => chalk.hex(\"#6b7280\")(value)),\n border: maybe((value) => chalk.hex(\"#374151\")(value)),\n resourceType: styleResourceType,\n};\n\nexport function disableColor(): void {\n process.env.NO_COLOR = \"1\";\n chalk.level = 0;\n}\n\nexport function isTty(): boolean {\n return process.stdout.isTTY === true;\n}\n\nexport function terminalColumns(): number {\n return process.stdout.columns ?? 80;\n}\n\nexport function terminalRows(): number {\n return process.stdout.rows ?? 24;\n}\n\nexport function getTableChars() {\n return isTty() && !process.env.NO_COLOR\n ? {}\n : {\n top: \"-\",\n \"top-mid\": \"+\",\n \"top-left\": \"+\",\n \"top-right\": \"+\",\n bottom: \"-\",\n \"bottom-mid\": \"+\",\n \"bottom-left\": \"+\",\n \"bottom-right\": \"+\",\n left: \"|\",\n \"left-mid\": \"+\",\n mid: \"-\",\n \"mid-mid\": \"+\",\n right: \"|\",\n \"right-mid\": \"+\",\n middle: \"|\",\n };\n}\n","import { theme } from \"./theme.js\";\n\nexport function renderKv(key: string, value: string, keyWidth = 20, indent = 2): string {\n const spaces = \" \".repeat(indent);\n return `${spaces}${theme.muted(key.padEnd(keyWidth))} ${value}`;\n}\n","import Table from \"cli-table3\";\nimport { getTableChars, isTty, terminalColumns, theme } from \"./theme.js\";\n\n/** Off-TTY default so piped output does not expand to unbounded description columns. */\nexport const OFF_TTY_TABLE_WIDTH = 100;\n\nexport interface Column {\n key: string;\n header: string;\n width: number;\n /** Floor used when distributing `widthShare` under `maxWidth`. */\n minWidth?: number;\n /** Fraction of available width when maxWidth is set (0-1). */\n widthShare?: number;\n /** Size to header/content and do not shrink when distributing leftover width. */\n fitContent?: boolean;\n /** Truncate with \"...\" instead of wrapping when the cell exceeds the column width. */\n truncate?: boolean;\n /** When false, hyphenated tokens may break mid-token during word wrap. */\n wrapOnWordBoundary?: boolean;\n /** Transform the raw value before display (affects content and width measurement). */\n transform?: (value: string) => string;\n /** Apply styling (e.g. ANSI colour) to the displayed value without affecting width. */\n style?: (value: string) => string;\n}\n\nexport interface TableOptions {\n columns: Column[];\n // biome-ignore lint/suspicious/noExplicitAny: table rows accept any typed record\n rows: Record<string, any>[];\n summary?: string;\n /** Message to show when rows is empty (instead of an empty table). */\n empty?: string;\n /** Cap total table width (including borders) to this value. */\n maxWidth?: number;\n /** Enable cli-table3 word wrap for fixed-width columns. */\n wordWrap?: boolean;\n /** Default wrapOnWordBoundary for all columns (overridden per column). */\n wrapOnWordBoundary?: boolean;\n}\n\nexport function resolveTableMaxWidth(explicit?: number): number {\n if (explicit !== undefined) {\n return explicit;\n }\n if (isTty() && typeof process.stdout.columns === \"number\" && process.stdout.columns > 0) {\n return process.stdout.columns;\n }\n if (isTty()) {\n return terminalColumns();\n }\n return OFF_TTY_TABLE_WIDTH;\n}\n\nconst ESC = String.fromCharCode(0x1b);\nconst ANSI_SGR = new RegExp(`${ESC}\\\\[[0-9;]*m`, \"g\");\nconst ANSI_SGR_AT_START = new RegExp(`^${ESC}\\\\[[0-9;]*m`);\n\nfunction visibleLength(value: string): number {\n return value.replace(ANSI_SGR, \"\").length;\n}\n\n/** Truncate by visible characters so color codes do not eat the column. */\nexport function truncateTableCell(value: string, width: number): string {\n if (width <= 0) {\n return \"\";\n }\n if (visibleLength(value) <= width) {\n return value;\n }\n if (width <= 3) {\n let visible = 0;\n let index = 0;\n while (index < value.length && visible < width) {\n const match = value.slice(index).match(ANSI_SGR_AT_START);\n if (match) {\n index += match[0].length;\n continue;\n }\n visible += 1;\n index += 1;\n }\n return value.slice(0, index);\n }\n const budget = width - 3;\n let visible = 0;\n let index = 0;\n while (index < value.length && visible < budget) {\n const match = value.slice(index).match(ANSI_SGR_AT_START);\n if (match) {\n index += match[0].length;\n continue;\n }\n visible += 1;\n index += 1;\n }\n const sliced = value.slice(0, index);\n const reset = sliced.includes(ESC) ? `${ESC}[0m` : \"\";\n return `${sliced}...${reset}`;\n}\n\nfunction contentWidth(col: Column, rows: Record<string, unknown>[]): number {\n return Math.max(\n col.width,\n col.header.length,\n ...rows.map((row) => {\n const raw = String(row[col.key] ?? \"\");\n const transformed = col.transform ? col.transform(raw) : raw;\n return transformed.length;\n }),\n );\n}\n\nfunction tableBorderOverhead(columnCount: number): number {\n return columnCount + 1;\n}\n\nexport function computeColumnWidths(\n columns: Column[],\n // biome-ignore lint/suspicious/noExplicitAny: table rows accept any typed record\n rows: Record<string, any>[],\n maxWidth?: number,\n): number[] {\n const contentWidths = columns.map((col) => contentWidth(col, rows) + 2);\n\n if (maxWidth === undefined) {\n return contentWidths;\n }\n\n const overhead = tableBorderOverhead(columns.length);\n const available = Math.max(columns.length, maxWidth - overhead);\n const fitIndexes = columns\n .map((col, index) => (col.fitContent ? index : -1))\n .filter((index) => index >= 0);\n const flexibleIndexes = columns\n .map((col, index) => (col.fitContent ? -1 : index))\n .filter((index) => index >= 0);\n\n const widths = contentWidths.slice();\n if (fitIndexes.length > 0) {\n for (const index of fitIndexes) {\n widths[index] = contentWidths[index] ?? 0;\n }\n }\n\n const fitTotal = fitIndexes.reduce((sum, index) => sum + (widths[index] ?? 0), 0);\n const flexibleBudget = Math.max(flexibleIndexes.length, available - fitTotal);\n\n if (flexibleIndexes.length === 0) {\n return shrinkToAvailable(widths, columns, available);\n }\n\n const flexibleColumns = flexibleIndexes.map((index) => columns[index] as Column);\n const flexibleContent = flexibleIndexes.map((index) => contentWidths[index] ?? 0);\n const flexibleWidths = allocateFlexibleColumnWidths(\n flexibleColumns,\n flexibleContent,\n flexibleBudget,\n );\n flexibleIndexes.forEach((columnIndex, innerIndex) => {\n widths[columnIndex] = flexibleWidths[innerIndex] ?? widths[columnIndex] ?? 0;\n });\n return shrinkToAvailable(widths, columns, available);\n}\n\nfunction shrinkToAvailable(\n widths: number[],\n columns: Column[],\n available: number,\n): number[] {\n let allocated = widths.reduce((sum, width) => sum + width, 0);\n if (allocated <= available) {\n return widths;\n }\n let overflow = allocated - available;\n for (let index = widths.length - 1; index >= 0 && overflow > 0; index--) {\n if (columns[index]?.fitContent) {\n continue;\n }\n const floor = columns[index]?.minWidth ?? 1;\n const reducible = Math.max(0, (widths[index] ?? 0) - floor);\n if (reducible <= 0) {\n continue;\n }\n const take = Math.min(reducible, overflow);\n widths[index] = (widths[index] ?? 0) - take;\n overflow -= take;\n }\n for (let index = widths.length - 1; index >= 0 && overflow > 0; index--) {\n const floor = 1;\n const reducible = Math.max(0, (widths[index] ?? 0) - floor);\n if (reducible <= 0) {\n continue;\n }\n const take = Math.min(reducible, overflow);\n widths[index] = (widths[index] ?? 0) - take;\n overflow -= take;\n }\n return widths;\n}\n\nfunction allocateFlexibleColumnWidths(\n columns: Column[],\n contentWidths: number[],\n available: number,\n): number[] {\n if (columns.length === 0) {\n return [];\n }\n const hasWidthShare = columns.some((col) => col.widthShare !== undefined);\n\n if (hasWidthShare) {\n const floors = columns.map((col) => col.minWidth ?? 0);\n const shareSum = columns.reduce((sum, col) => sum + (col.widthShare ?? 0), 0);\n const widths = columns.map((col, index) => {\n const share = shareSum > 0 ? (col.widthShare ?? 0) / shareSum : 1 / columns.length;\n return Math.max(floors[index] ?? 0, Math.floor(available * share));\n });\n let allocated = widths.reduce((sum, width) => sum + width, 0);\n if (allocated > available) {\n let overflow = allocated - available;\n for (let index = widths.length - 1; index >= 0 && overflow > 0; index--) {\n const reducible = (widths[index] ?? 0) - (floors[index] ?? 0);\n if (reducible <= 0) {\n continue;\n }\n const take = Math.min(reducible, overflow);\n widths[index] = (widths[index] ?? 0) - take;\n overflow -= take;\n }\n allocated = widths.reduce((sum, width) => sum + width, 0);\n }\n if (widths.length > 0 && allocated < available) {\n widths[0] = (widths[0] ?? 0) + available - allocated;\n }\n return widths;\n }\n\n const total = contentWidths.reduce((sum, width) => sum + width, 0);\n if (total <= available) {\n return contentWidths;\n }\n\n const minWidths = columns.map((col, index) =>\n Math.min(col.width + 2, contentWidths[index] ?? col.width + 2),\n );\n const minTotal = minWidths.reduce((sum, width) => sum + width, 0);\n\n if (minTotal >= available) {\n let remaining = available;\n return minWidths.map((width, index) => {\n if (index === minWidths.length - 1) {\n return remaining;\n }\n const capped = Math.min(width, remaining);\n remaining -= capped;\n return capped;\n });\n }\n\n const extra = contentWidths.map((width, index) => width - (minWidths[index] ?? 0));\n const extraTotal = extra.reduce((sum, width) => sum + width, 0);\n const budget = available - minTotal;\n const widths = minWidths.map((min, index) => {\n if (extraTotal === 0) {\n return min;\n }\n return min + Math.floor((budget * (extra[index] ?? 0)) / extraTotal);\n });\n const allocated = widths.reduce((sum, width) => sum + width, 0);\n if (widths.length > 0) {\n widths[0] = (widths[0] ?? 0) + available - allocated;\n }\n return widths;\n}\n\nexport function renderTable({\n columns,\n rows,\n summary,\n empty,\n maxWidth,\n wordWrap,\n wrapOnWordBoundary,\n}: TableOptions): string {\n if (rows.length === 0 && empty) {\n return empty;\n }\n\n const resolvedMaxWidth = resolveTableMaxWidth(maxWidth);\n const colWidths = computeColumnWidths(columns, rows, resolvedMaxWidth);\n\n const t = new Table({\n head: columns.map((col) => theme.heading(col.header)),\n colWidths,\n chars: getTableChars(),\n truncate: \"...\",\n style: { head: [], border: [] },\n ...(wordWrap !== undefined ? { wordWrap } : {}),\n ...(wrapOnWordBoundary !== undefined ? { wrapOnWordBoundary } : {}),\n });\n\n for (const row of rows) {\n t.push(\n columns.map((col, index) => {\n const raw = String(row[col.key] ?? \"\");\n const transformed = col.transform ? col.transform(raw) : raw;\n const innerWidth = Math.max(0, (colWidths[index] ?? col.width) - 2);\n const clipOverflow = Boolean(col.truncate) || Boolean(col.fitContent) || !wordWrap;\n const clipped = clipOverflow\n ? truncateTableCell(transformed, innerWidth)\n : transformed;\n const content = col.style ? col.style(clipped) : clipped;\n\n if (col.wrapOnWordBoundary === false) {\n return { content, wrapOnWordBoundary: false };\n }\n\n return content;\n }),\n );\n }\n\n const lines = [t.toString()];\n\n if (summary) {\n lines.push(\"\");\n lines.push(theme.info(summary));\n }\n\n return lines.join(\"\\n\");\n}\n\nexport const table = {\n render: renderTable,\n print: (opts: TableOptions) => console.log(renderTable(opts)),\n};\n","import { renderKv } from \"./kv.js\";\nimport { theme } from \"./theme.js\";\n\nexport interface KvRow {\n key: string;\n value: string;\n}\n\nexport interface PanelOptions {\n /** Title parts: first element is the section header, optional second is a subtitle. */\n title: string[];\n rows: [string, string][];\n}\n\nfunction renderPanelTitle(parts: string[]): string {\n const [head, ...rest] = parts;\n return rest.length === 0\n ? theme.primary(head ?? \"\")\n : `${theme.primary(head ?? \"\")} ${rest.map((p) => theme.muted(p)).join(\" \")}`;\n}\n\nexport function renderPanel(opts: PanelOptions): string {\n const lines: string[] = [renderPanelTitle(opts.title)];\n for (const [key, value] of opts.rows) {\n lines.push(renderKv(key, value));\n }\n return lines.join(\"\\n\");\n}\n\nexport function panel(opts: PanelOptions): void {\n console.log(renderPanel(opts));\n}\n\nexport function kvBlock(rows: KvRow[], opts?: { indent?: number; keyWidth?: number }): void {\n for (const row of rows) {\n console.log(renderKv(row.key, row.value, opts?.keyWidth, opts?.indent));\n }\n}\n","import { icons, theme } from \"./theme.js\";\n\nexport interface DiffRow {\n key: string;\n before: string;\n after: string;\n}\n\nexport interface DiffTableOptions {\n rows: DiffRow[];\n title?: string;\n}\n\nexport function renderDiffTable({ rows, title }: DiffTableOptions): string {\n const lines: string[] = [];\n if (title) {\n lines.push(theme.primary(title));\n }\n for (const row of rows) {\n lines.push(` ${theme.muted(row.key)}`);\n lines.push(` ${theme.danger(`${icons.removed} ${row.before}`)}`);\n lines.push(` ${theme.success(`${icons.added} ${row.after}`)}`);\n }\n return lines.join(\"\\n\");\n}\n\nexport const diffTable = {\n render: renderDiffTable,\n print: (opts: DiffTableOptions) => console.log(renderDiffTable(opts)),\n};\n\nexport interface ChangeEntry {\n kind: \"added\" | \"removed\" | \"modified\";\n scope: string;\n key: string;\n detail: string;\n}\n\nexport function renderChangeList(changes: ChangeEntry[]): string {\n return changes\n .map((change) => {\n const glyph =\n change.kind === \"added\"\n ? icons.added\n : change.kind === \"removed\"\n ? icons.removed\n : icons.modified;\n const style =\n change.kind === \"added\"\n ? theme.success\n : change.kind === \"removed\"\n ? theme.danger\n : theme.warn;\n return ` ${style(glyph)} ${change.scope.padEnd(10)} ${change.key.padEnd(28)} ${change.detail}`;\n })\n .join(\"\\n\");\n}\n","import ora, { type Ora } from \"ora\";\nimport { icons, isTty, theme } from \"./theme.js\";\n\nexport interface ProgressHandle {\n succeed: (message: string) => void;\n fail: (message: string) => void;\n stop: () => void;\n update: (message: string) => void;\n}\n\n/**\n * Create a per-instance progress handle. When stdout is a TTY, shows a spinner\n * while the operation is running. In non-TTY/test environments the spinner is\n * suppressed entirely: only the resolved verdict line is emitted.\n */\nexport function createProgress(message: string): ProgressHandle {\n let spinner: Ora | null = null;\n if (isTty() && process.env.NODE_ENV !== \"test\") {\n spinner = ora(message).start();\n }\n\n return {\n succeed(verdict: string) {\n if (spinner) {\n spinner.succeed(verdict);\n spinner = null;\n } else {\n console.log(theme.success(`${icons.success} ${verdict}`));\n }\n },\n fail(verdict: string) {\n if (spinner) {\n spinner.fail(verdict);\n spinner = null;\n } else {\n console.error(theme.danger(`${icons.danger} ${verdict}`));\n }\n },\n stop() {\n spinner?.stop();\n spinner = null;\n },\n update(message: string) {\n if (spinner) {\n spinner.text = message;\n }\n },\n };\n}\n\n// Backward-compatible singleton kept for any external usages via ui.spinner.\nexport const progress = {\n start: (message: string): ProgressHandle => createProgress(message),\n stop: (): void => {},\n succeed: (message: string): void => {\n console.log(theme.success(`${icons.success} ${message}`));\n },\n fail: (message: string): void => {\n console.error(theme.danger(`${icons.danger} ${message}`));\n },\n};\n","import { icons, theme } from \"./theme.js\";\n\nfunction line(icon: string, message: string): string {\n return `${icon} ${message}`;\n}\n\nexport function renderSuccess(message: string, opts?: { hint?: string }): string {\n return opts?.hint\n ? `${theme.success(line(icons.success, message))}\\n ${theme.info(`${icons.hint} ${opts.hint}`)}`\n : theme.success(line(icons.success, message));\n}\n\nexport function renderWarn(message: string, opts?: { hint?: string }): string {\n return opts?.hint\n ? `${theme.warn(line(icons.warn, message))}\\n ${theme.info(`${icons.hint} ${opts.hint}`)}`\n : theme.warn(line(icons.warn, message));\n}\n\nexport function renderDanger(\n message: string,\n opts?: { hint?: string; hints?: string[] },\n): string {\n const hints = opts?.hints ?? (opts?.hint ? [opts.hint] : []);\n const base = theme.danger(line(icons.danger, message));\n if (hints.length === 0) {\n return base;\n }\n return `${base}\\n${hints.map((hint) => ` ${theme.info(`${icons.hint} ${hint}`)}`).join(\"\\n\")}`;\n}\n\nexport const status = {\n success: (message: string, opts?: { hint?: string }) => console.log(renderSuccess(message, opts)),\n warn: (message: string, opts?: { hint?: string }) => console.log(renderWarn(message, opts)),\n danger: (message: string, opts?: { hint?: string; hints?: string[] }) =>\n console.error(renderDanger(message, opts)),\n info: (message: string) => console.log(theme.info(message)),\n dim: (message: string) => console.log(theme.info(message)),\n hint: (message: string) => console.log(` ${theme.info(`${icons.hint} ${message}`)}`),\n};\n","import { terminalColumns, theme } from \"./theme.js\";\n\nexport function renderHeader(title: string): string {\n return theme.heading(title);\n}\n\nexport function renderSubheader(title: string): string {\n return theme.label(title);\n}\n\nexport function renderRule(): string {\n return theme.border(\"─\".repeat(terminalColumns()));\n}\n\nexport function header(title: string): void {\n console.log(renderHeader(title));\n}\n\nexport function subheader(title: string): void {\n console.log(renderSubheader(title));\n}\n\nexport function rule(): void {\n console.log(renderRule());\n}\n","import * as format from \"./format.js\";\nimport { renderKv } from \"./kv.js\";\nimport { renderTable, table } from \"./table.js\";\nimport { renderPanel, panel, kvBlock } from \"./panel.js\";\nimport { renderDiffTable, diffTable, renderChangeList } from \"./diff.js\";\nimport { progress, createProgress } from \"./progress.js\";\nimport { status } from \"./status.js\";\nimport { icons, theme, disableColor } from \"./theme.js\";\nimport { header, renderHeader, subheader, renderSubheader, rule, renderRule } from \"./section.js\";\n\nexport const ui = {\n format,\n icons,\n theme,\n header,\n renderHeader,\n subheader,\n renderSubheader,\n rule,\n renderRule,\n table,\n renderTable,\n panel,\n renderPanel,\n kvBlock,\n renderKv,\n diffTable,\n renderDiffTable,\n renderChangeList,\n spinner: progress,\n createProgress,\n ...status,\n disableColor,\n};\n","export type CommandCatalogKind = \"group\" | \"project\";\n\nexport type CommandLoaderId =\n | \"apply\"\n | \"approve\"\n | \"audit\"\n | \"auth\"\n | \"compile\"\n | \"config\"\n | \"doctor\"\n | \"environment\"\n | \"github\"\n | \"harness\"\n | \"help\"\n | \"init\"\n | \"lock\"\n | \"marketplace\"\n | \"mcp\"\n | \"migrate\"\n | \"open\"\n | \"pack\"\n | \"plugin\"\n | \"policy\"\n | \"profile\"\n | \"project\"\n | \"resource\";\n\nexport interface CommandCatalogEntry {\n name: string;\n aliases?: string[];\n description: string;\n kind: CommandCatalogKind;\n loader: CommandLoaderId;\n /** Commander-style args shown in top-level PROJECT help, e.g. `<source>`. */\n args?: string;\n hidden?: boolean;\n}\n\nexport const COMMAND_CATALOG: CommandCatalogEntry[] = [\n {\n name: \"auth\",\n aliases: [\"a\"],\n description: \"Authenticate with HarnessTap Cloud and manage cloud accounts\",\n kind: \"group\",\n loader: \"auth\",\n },\n {\n name: \"config\",\n description: \"Manage project profile config (apm.yml)\",\n kind: \"group\",\n loader: \"config\",\n },\n {\n name: \"environment\",\n aliases: [\"e\"],\n description: \"Manage reusable environments and plugin environment cascade\",\n kind: \"group\",\n loader: \"environment\",\n },\n {\n name: \"github\",\n description: \"Authenticate with GitHub for private marketplace and repo reads\",\n kind: \"group\",\n loader: \"github\",\n },\n {\n name: \"harness\",\n aliases: [\"h\"],\n description: \"Manage the registered harness set\",\n kind: \"group\",\n loader: \"harness\",\n },\n {\n name: \"help\",\n description: \"Core concepts and scenario playbooks\",\n kind: \"group\",\n loader: \"help\",\n },\n {\n name: \"lock\",\n description: \"Read apm.lock.yaml and export inventory artifacts\",\n kind: \"group\",\n loader: \"lock\",\n },\n {\n name: \"marketplace\",\n aliases: [\"mkt\"],\n description: \"Manage plugin marketplace sources\",\n kind: \"group\",\n loader: \"marketplace\",\n },\n {\n name: \"mcp\",\n description: \"Discover and install MCP Registry servers\",\n kind: \"group\",\n loader: \"mcp\",\n },\n {\n name: \"migrate\",\n aliases: [\"m\"],\n description: \"Export or import workspace, plugins, or resources for offline sharing\",\n kind: \"group\",\n loader: \"migrate\",\n },\n {\n name: \"plugin\",\n aliases: [\"l\"],\n description: \"Manage plugins (named bundles of resources that can be applied to a project)\",\n kind: \"group\",\n loader: \"plugin\",\n },\n {\n name: \"policy\",\n description: \"Inspect executable-trust and apm-policy.yml decisions\",\n kind: \"group\",\n loader: \"policy\",\n },\n {\n name: \"profile\",\n aliases: [\"p\"],\n description: \"Manage profile plugins and global profile switching\",\n kind: \"group\",\n loader: \"profile\",\n },\n {\n name: \"resource\",\n aliases: [\"r\"],\n description:\n \"Manage resources (individual pieces of AI configuration like agents, skills, or instructions)\",\n kind: \"group\",\n loader: \"resource\",\n },\n {\n name: \"add\",\n args: \"<source>\",\n description: \"Add skills from a remote or local source\",\n kind: \"project\",\n loader: \"init\",\n },\n {\n name: \"apply\",\n args: \"[plugins]\",\n description: \"Resolve a plugin's dependency graph and materialize it\",\n kind: \"project\",\n loader: \"apply\",\n },\n {\n name: \"approve\",\n args: \"[PACKAGE_REF]\",\n description: \"Approve executable primitives from dependency packages\",\n kind: \"project\",\n loader: \"approve\",\n },\n {\n name: \"audit\",\n description:\n \"Scan a project for hidden Unicode, lockfile hashes, apm-policy.yml, and executable trust\",\n kind: \"project\",\n loader: \"audit\",\n },\n {\n name: \"compile\",\n description: \"Compile local .apm/ primitives into resolved target harness directories\",\n kind: \"project\",\n loader: \"compile\",\n },\n {\n name: \"deny\",\n args: \"[PACKAGE_REF]\",\n description: \"Deny executable primitives from dependency packages\",\n kind: \"project\",\n loader: \"approve\",\n },\n {\n name: \"doctor\",\n description: \"Check Node, native modules, paths, and harness detection\",\n kind: \"project\",\n loader: \"doctor\",\n },\n {\n name: \"history\",\n args: \"[path]\",\n description: \"List configuration snapshots for a project\",\n kind: \"project\",\n loader: \"project\",\n },\n {\n name: \"init\",\n description: \"Initialize the harnesstap database and config directory\",\n kind: \"project\",\n loader: \"init\",\n },\n {\n name: \"install\",\n description: \"Onboard a project from apm.yml (same as apply with no plugin selector)\",\n kind: \"project\",\n loader: \"apply\",\n },\n {\n name: \"mirror\",\n args: \"[path]\",\n description:\n \"Rematerialize registered harness files from one on-disk harness (or plugin/AGENTS.md fallback)\",\n kind: \"project\",\n loader: \"project\",\n },\n {\n name: \"open\",\n args: \"[path]\",\n description: \"Open a file or directory in your system editor\",\n kind: \"project\",\n loader: \"open\",\n },\n {\n name: \"pack\",\n description:\n \"Pack an apm.yml project into an Agent Plugins 1.0 bundle (plugin.json + primitives + apm.lock.yaml)\",\n kind: \"project\",\n loader: \"pack\",\n },\n {\n name: \"revert\",\n args: \"[snapshot-id]\",\n description: \"Revert a project or global apply snapshot\",\n kind: \"project\",\n loader: \"project\",\n },\n {\n name: \"scan\",\n args: \"[path]\",\n description:\n \"Scan a project directory or plugin source and import configurations into the database\",\n kind: \"project\",\n loader: \"project\",\n },\n {\n name: \"status\",\n args: \"[path]\",\n description: \"Show current project status and drift summary\",\n kind: \"project\",\n loader: \"project\",\n },\n {\n name: \"targets\",\n description: \"Show which apply harness targets resolve for this project, and why\",\n kind: \"project\",\n loader: \"compile\",\n },\n {\n name: \"use\",\n description: \"Switch to a project-configured profile and environment\",\n kind: \"project\",\n loader: \"project\",\n },\n {\n name: \"layer\",\n description: \"\",\n kind: \"project\",\n loader: \"plugin\",\n hidden: true,\n },\n {\n name: \"__complete\",\n description: \"\",\n kind: \"project\",\n loader: \"help\",\n hidden: true,\n },\n];\n\nexport const COMMAND_LOADER_IDS: CommandLoaderId[] = [\n \"apply\",\n \"approve\",\n \"audit\",\n \"auth\",\n \"compile\",\n \"config\",\n \"doctor\",\n \"environment\",\n \"github\",\n \"harness\",\n \"help\",\n \"init\",\n \"lock\",\n \"marketplace\",\n \"mcp\",\n \"migrate\",\n \"open\",\n \"pack\",\n \"plugin\",\n \"policy\",\n \"profile\",\n \"project\",\n \"resource\",\n];\n\nexport function visibleCatalogEntries(kind: CommandCatalogKind): CommandCatalogEntry[] {\n return COMMAND_CATALOG\n .filter((entry) => !entry.hidden && entry.kind === kind)\n .sort((a, b) => a.name.localeCompare(b.name));\n}\n\nexport function findCatalogEntry(token: string): CommandCatalogEntry | undefined {\n return COMMAND_CATALOG.find(\n (entry) => entry.name === token || entry.aliases?.includes(token),\n );\n}\n\nexport function topLevelCommandTokens(): Set<string> {\n const tokens = new Set<string>();\n for (const entry of COMMAND_CATALOG) {\n tokens.add(entry.name);\n for (const alias of entry.aliases ?? []) {\n tokens.add(alias);\n }\n }\n return tokens;\n}\n\nexport function catalogCommandLabel(entry: CommandCatalogEntry): string {\n let label = entry.name;\n if (entry.aliases && entry.aliases.length > 0) {\n label += ` (${entry.aliases.join(\", \")})`;\n }\n if (entry.args) {\n label += ` ${entry.args}`;\n }\n return label;\n}\n","import { basename } from \"node:path\";\nimport { CliUsageError } from \"../services/cli-errors.js\";\nimport { ensureErrorPrefix } from \"./messages.js\";\nimport { isCommanderError, mapUserFacingError } from \"./user-errors.js\";\n\nexport const GUIDE_SCENARIOS_URL =\n \"https://github.com/harnesstap/harnesstap/blob/main/docs/scenarios/scenarios.md\";\n\nexport const GIT_ORIGIN_HINTS = [\n \"Add a remote: git remote add origin <url>\",\n \"Snapshots, drift, history, and revert require a git repository with origin configured.\",\n];\n\nexport function resolveInvocationName(): \"harnesstap\" | \"ht\" {\n return basename(process.argv[1] ?? \"\") === \"ht\" ? \"ht\" : \"harnesstap\";\n}\n\nexport function shellQuote(value: string): string {\n if (value.length === 0) {\n return '\"\"';\n }\n if (/^[A-Za-z0-9_./:@+=,-]+$/.test(value)) {\n return value;\n }\n return `\"${value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll(\"\\\"\", \"\\\\\\\"\")}\"`;\n}\n\n/** DS-6: hints always say `ht` and shell-quote each argument (W2-1, W3-3). */\nexport function formatCommand(pathOrArgs: string | readonly string[]): string {\n if (typeof pathOrArgs === \"string\") {\n const trimmed = pathOrArgs.trim();\n const stripped = trimmed.replace(/^(?:harnesstap|ht)\\s+/, \"\");\n return stripped.length > 0 ? `ht ${stripped}` : \"ht\";\n }\n return [\"ht\", ...pathOrArgs.map(shellQuote)].join(\" \");\n}\n\nexport function formatHintCommand(args: readonly string[]): string {\n return formatCommand(args);\n}\n\nexport function fail(\n message: string,\n opts?: { hint?: string; hints?: string[]; exitCode?: number },\n): void {\n process.exitCode = opts?.exitCode ?? 1;\n console.error(ensureErrorPrefix(message));\n const hints = opts?.hints ?? (opts?.hint ? [opts.hint] : []);\n for (const hint of hints) {\n if (hint.trim().length > 0) {\n console.error(hint);\n }\n }\n}\n\nfunction hintsFromError(error: unknown): string[] {\n if (!error || typeof error !== \"object\" || !(\"hints\" in error)) return [];\n const raw = (error as { hints?: unknown }).hints;\n if (!Array.isArray(raw)) return [];\n return raw.filter(\n (hint): hint is string => typeof hint === \"string\" && hint.trim().length > 0,\n );\n}\n\nexport function failCaught(error: unknown, opts?: { exitCode?: number }): void {\n if (error instanceof CliUsageError) {\n fail(error.message, {\n hint: error.hints[0],\n exitCode: opts?.exitCode ?? error.exitCode,\n });\n return;\n }\n const mapped = mapUserFacingError(error);\n const commanderHint = isCommanderError(error)\n ? undefined\n : mapped.hint;\n const ownHints = hintsFromError(error);\n const hints = commanderHint\n ? [commanderHint, ...ownHints.filter((hint) => hint !== commanderHint)]\n : ownHints;\n fail(mapped.message, {\n hints,\n exitCode: opts?.exitCode ?? mapped.exitCode,\n });\n}\n\n/** DS-6: packaged help and scenario playbooks always show `ht`. */\nexport function formatScenarioCommand(path: string): string {\n const trimmed = path.trim();\n const stripped = trimmed.replace(/^(?:harnesstap|ht)\\s+/, \"\");\n return stripped.length > 0 ? `ht ${stripped}` : \"ht\";\n}\n\nexport function collectRepeatedOption(value: string, previous: string[]): string[] {\n return [...previous, value];\n}\n\nexport function reportNoGitOrigin(_retryCommand?: string): void {\n fail(\"No git remote origin configured.\", {\n hint: GIT_ORIGIN_HINTS[0],\n });\n}\n\nexport function isVerboseMode(argv: string[] = process.argv): boolean {\n return argv.includes(\"-v\") || argv.includes(\"--verbose\");\n}\n\nexport function isGroupedCommandFallbackError(error: unknown): error is {\n code: string;\n exitCode: number;\n message: string;\n} {\n if (!error || typeof error !== \"object\") {\n return false;\n }\n\n const candidate = error as {\n code?: unknown;\n exitCode?: unknown;\n message?: unknown;\n };\n\n return candidate.code === \"commander.excessArguments\"\n && candidate.exitCode === 1\n && typeof candidate.message === \"string\"\n && /too many arguments for '(plugin|resource|plugin|auth|migrate|harness|environment|profile)'/i.test(candidate.message);\n}\n","import type { Command } from \"commander\";\nimport { getCommandHelpEntry } from \"../services/cli-help-registry.js\";\nimport { ui } from \"../ui/index.js\";\nimport { PACKAGE_VERSION } from \"../version.js\";\nimport {\n catalogCommandLabel,\n type CommandCatalogEntry,\n visibleCatalogEntries,\n} from \"./command-catalog.js\";\nimport { formatCommand, resolveInvocationName } from \"./shared.js\";\n\nconst PLUGIN_HELP_LOCAL_COMMANDS = new Set([\n \"create\",\n \"list\",\n \"show\",\n \"edit\",\n \"editor\",\n \"delete\",\n \"export\",\n \"import\",\n \"add\",\n \"cut\",\n \"versions\",\n \"rollback\",\n \"diff\",\n \"doctor\",\n \"validate\",\n \"check\",\n \"update\",\n \"why\",\n \"fork\",\n \"from-project\",\n]);\n\nconst PLUGIN_HELP_REMOTE_COMMANDS = new Set([\n \"search\",\n \"catalog\",\n \"pull\",\n \"publish\",\n]);\n\nfunction isCommanderHidden(command: Command): boolean {\n return (command as unknown as { _hidden?: boolean })._hidden === true;\n}\n\nexport function isHiddenHelpCommand(command: Command): boolean {\n return (\n command.name() === \"__complete\"\n || isCommanderHidden(command)\n || (command.description() as unknown) === false\n );\n}\n\nexport function resolveCommandDescription(command: Command): string {\n return command.description() || getCommandHelpEntry(command)?.description || \"\";\n}\n\n/** Commands that run a default action while also hosting subcommands. */\nexport function commandKeepsDefaultAction(command: Command): boolean {\n if (command.name() === \"init\") {\n return true;\n }\n return command.name() === \"publish\" && command.parent?.name() === \"plugin\";\n}\n\nfunction commandUsageLine(cmd: Command): string {\n const names: string[] = [];\n let current: Command | null = cmd;\n while (current?.parent) {\n names.unshift(current.name());\n current = current.parent;\n }\n const usage = cmd.usage().trim();\n return formatCommand(`${names.join(\" \")}${usage ? ` ${usage}` : \"\"}`);\n}\n\nfunction formatHelpArgName(name: string, required: boolean): string {\n return required ? `<${name}>` : `[${name}]`;\n}\n\nfunction visibleHelpOptions(cmd: Command): Command[\"options\"] {\n const opts = cmd.options.filter((opt) => !opt.hidden);\n const hasNoInteractive = opts.some((opt) => opt.long === \"--no-interactive\");\n if (!hasNoInteractive) {\n return opts;\n }\n return opts.filter((opt) => opt.long !== \"--interactive\");\n}\n\nfunction renderCatalogSection(title: string, entries: CommandCatalogEntry[]): string {\n if (entries.length === 0) {\n return \"\";\n }\n const commandStrs = entries.map((entry) => catalogCommandLabel(entry));\n const maxNameLength = Math.max(...commandStrs.map((entry) => entry.length));\n const lines = [ui.theme.heading(title)];\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n const nameStr = commandStrs[i];\n if (!entry || !nameStr) {\n continue;\n }\n const padding = \" \".repeat(Math.max(2, maxNameLength - nameStr.length + 2));\n lines.push(` ${ui.theme.command(nameStr)}${padding}${entry.description}`);\n }\n return lines.join(\"\\n\");\n}\n\nfunction renderTopLevelCommandHelp(): string {\n const sections = [\n renderCatalogSection(\"COMMAND GROUPS\", visibleCatalogEntries(\"group\")),\n renderCatalogSection(\"PROJECT\", visibleCatalogEntries(\"project\")),\n ].filter((section) => section.length > 0);\n\n return sections.join(\"\\n\\n\");\n}\n\nexport function renderRootHelpText(): string {\n const lines = [\n \"\",\n `${ui.theme.primary(resolveInvocationName())} ${ui.theme.muted(`v${PACKAGE_VERSION}`)}`,\n \"Agent harness configuration toolkit for Claude Code, Codex, Cursor, and other coding CLIs\",\n \"\",\n ui.theme.heading(\"USAGE\"),\n ` ${resolveInvocationName()} [options] [command]`,\n \"\",\n ui.theme.heading(\"OPTIONS\"),\n ` ${ui.theme.flag(\"-V, --version\")} output the version number`,\n ` ${ui.theme.flag(\"-v, --verbose\")} show verbose error output`,\n ` ${ui.theme.flag(\"--no-color\")} disable color output`,\n ` ${ui.theme.flag(\"--no-interactive\")} disable interactive prompts`,\n ` ${ui.theme.flag(\"-h, --help\")} display help for command`,\n \"\",\n renderTopLevelCommandHelp(),\n \"\",\n ];\n return lines.join(\"\\n\");\n}\n\nexport function printRootHelp(argv: string[] = process.argv): void {\n if (argv.includes(\"--no-color\")) {\n ui.disableColor();\n }\n process.stdout.write(renderRootHelpText());\n}\n\nfunction renderGroupedCommandHelp(cmd: Command): string {\n const commands = cmd.commands.filter((command) => !isHiddenHelpCommand(command));\n\n if (commands.length === 0) {\n return \"\";\n }\n\n const lines: string[] = [];\n\n const commandStrs = commands.map((c) => {\n const name = c.name();\n const aliases = c.aliases();\n const args = c.registeredArguments?.map((arg) => {\n if (arg.required) {\n return `<${arg.name()}>`;\n }\n return `[${arg.name()}]`;\n }).join(\" \") || \"\";\n\n let fullStr = name;\n if (aliases.length) {\n fullStr += ` (${aliases.join(\", \")})`;\n }\n if (args) {\n fullStr += ` ${args}`;\n }\n\n return fullStr;\n });\n\n const maxNameLength = commandStrs.length > 0 ? Math.max(...commandStrs.map((s) => s.length)) : 0;\n\n for (let i = 0; i < commands.length; i++) {\n const command = commands[i];\n const nameStr = commandStrs[i];\n if (!command || !nameStr) continue;\n const padding = \" \".repeat(Math.max(2, maxNameLength - nameStr.length + 2));\n const desc = resolveCommandDescription(command);\n lines.push(` ${ui.theme.command(nameStr)}${padding}${desc}`);\n }\n\n return lines.join(\"\\n\");\n}\n\nfunction renderCommandSection(title: string, commands: Command[]): string {\n if (commands.length === 0) {\n return \"\";\n }\n\n const commandStrs = commands.map((c) => {\n const name = c.name();\n const aliases = c.aliases();\n const args = c.registeredArguments?.map((arg) => {\n if (arg.required) {\n return `<${arg.name()}>`;\n }\n return `[${arg.name()}]`;\n }).join(\" \") || \"\";\n let fullStr = name;\n if (aliases.length) {\n fullStr += ` (${aliases.join(\", \")})`;\n }\n if (args) {\n fullStr += ` ${args}`;\n }\n return fullStr;\n });\n const maxNameLength = Math.max(...commandStrs.map((entry) => entry.length));\n const lines = [ui.theme.heading(title)];\n for (let i = 0; i < commands.length; i++) {\n const command = commands[i];\n const nameStr = commandStrs[i];\n if (!command || !nameStr) {\n continue;\n }\n const padding = \" \".repeat(Math.max(2, maxNameLength - nameStr.length + 2));\n lines.push(` ${ui.theme.command(nameStr)}${padding}${resolveCommandDescription(command)}`);\n }\n return lines.join(\"\\n\");\n}\n\nfunction renderPluginGroupedCommandHelp(cmd: Command): string {\n const local = cmd.commands.filter((command) =>\n PLUGIN_HELP_LOCAL_COMMANDS.has(command.name()),\n );\n const remote = cmd.commands.filter((command) =>\n PLUGIN_HELP_REMOTE_COMMANDS.has(command.name()),\n );\n return [\n renderCommandSection(\"LOCAL LIBRARY\", local),\n \"\",\n renderCommandSection(\"REMOTE CATALOG\", remote),\n ].join(\"\\n\");\n}\n\nexport function configureCommandGroup(cmd: Command): Command {\n cmd.helpCommand(false);\n cmd.action(() => {\n cmd.outputHelp();\n });\n return cmd;\n}\n\nexport function configureProgramHelp(program: Command): void {\n program\n .name(\"harnesstap\")\n .description(\n \"Agent harness configuration toolkit for Claude Code, Codex, Cursor, and other coding CLIs\",\n )\n // Root -V/--version is handled in runHarnesstapCli (top-level only) so\n // subcommands can keep their own --version options. Help still lists it.\n .option(\"-v, --verbose\", \"Show verbose error output\")\n .option(\"--no-color\", \"Disable color output\")\n .option(\"--no-interactive\", \"Disable interactive prompts\")\n .helpCommand(false)\n .configureOutput({\n outputError: () => {},\n })\n .hook(\"preAction\", (command) => {\n const opts = command.optsWithGlobals<{ color?: boolean }>();\n if (opts.color === false) {\n ui.disableColor();\n }\n })\n .configureHelp({\n formatHelp: (cmd) => {\n if (process.argv.includes(\"--no-color\")) {\n ui.disableColor();\n }\n\n const isTopLevel = cmd.parent === null;\n\n if (!isTopLevel) {\n const helpEntry = getCommandHelpEntry(cmd);\n const lines = [\n \"\",\n ui.theme.heading(\"USAGE\"),\n ` ${commandUsageLine(cmd)}`,\n \"\",\n ];\n\n const description = resolveCommandDescription(cmd);\n if (description) {\n lines.push(description, \"\");\n }\n\n if (helpEntry?.details?.trim()) {\n lines.push(helpEntry.details.trim(), \"\");\n }\n\n const args = cmd.registeredArguments?.filter((arg) => arg.description) ?? [];\n if (args.length > 0) {\n lines.push(ui.theme.heading(\"ARGUMENTS\"));\n const requiredOffTty = new Set(helpEntry?.requiredOffTtyArgs ?? []);\n const argNames = args.map((arg) =>\n formatHelpArgName(arg.name(), arg.required || requiredOffTty.has(arg.name())),\n );\n const maxArgLength = Math.max(...argNames.map((name) => name.length));\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n const name = argNames[i];\n if (!arg || !name) continue;\n const padding = \" \".repeat(Math.max(2, maxArgLength - name.length + 2));\n lines.push(` ${ui.theme.flag(name)}${padding}${arg.description}`);\n }\n lines.push(\"\");\n }\n\n if (helpEntry?.examples && helpEntry.examples.length > 0) {\n lines.push(ui.theme.heading(\"EXAMPLES\"));\n for (const example of helpEntry.examples) {\n lines.push(` ${formatCommand(example)}`);\n }\n lines.push(\"\");\n }\n\n const opts = visibleHelpOptions(cmd);\n if (opts.length > 0) {\n lines.push(ui.theme.heading(\"OPTIONS\"));\n const flagStrs = opts.map((opt) => opt.flags);\n const maxFlagLength = Math.max(...flagStrs.map((flags) => flags.length));\n for (let i = 0; i < opts.length; i++) {\n const opt = opts[i];\n const flags = flagStrs[i];\n if (!opt || !flags) continue;\n const padding = \" \".repeat(Math.max(2, maxFlagLength - flags.length + 2));\n lines.push(` ${ui.theme.flag(flags)}${padding}${opt.description || \"\"}`);\n }\n lines.push(\"\");\n }\n\n const subcommands = cmd.name() === \"plugin\"\n ? renderPluginGroupedCommandHelp(cmd)\n : renderGroupedCommandHelp(cmd);\n if (subcommands) {\n if (cmd.name() !== \"plugin\") {\n lines.push(ui.theme.heading(\"COMMANDS\"));\n }\n lines.push(subcommands);\n lines.push(\"\");\n }\n\n return lines.join(\"\\n\");\n }\n\n return renderRootHelpText();\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;AAaO,IAAM,wBAA6C;AAAA,EACxD,iBAAiB;AAAA,IACf,aAAa;AAAA,IACb,UAAU,CAAC,oBAAoB,+BAA+B;AAAA,EAChE;AAAA,EACA,QAAQ;AAAA,IACN,aAAa;AAAA,IACb,UAAU,CAAC,UAAU,sBAAsB;AAAA,EAC7C;AAAA,EACA,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,mBAAmB;AAAA,IACjB,aACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,aACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,aACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,QAAQ;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,aACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,eAAe;AAAA,IACb,aAAa;AAAA,IACb,UAAU;AAAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,mBAAmB;AAAA,IACjB,aAAa;AAAA,IACb,UAAU;AAAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,eAAe;AAAA,IACb,aAAa;AAAA,IACb,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAC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AAE;AAAA,UAC1C;AACA,gBAAM,KAAK,EAAE;AAAA,QACf;AAEA,cAAM,OAAO,mBAAmB,GAAG;AACnC,YAAI,KAAK,SAAS,GAAG;AACnB,gBAAM,KAAK,GAAG,MAAM,QAAQ,SAAS,CAAC;AACtC,gBAAM,WAAW,KAAK,IAAI,CAAC,QAAQ,IAAI,KAAK;AAC5C,gBAAM,gBAAgB,KAAK,IAAI,GAAG,SAAS,IAAI,CAAC,UAAU,MAAM,MAAM,CAAC;AACvE,mBAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,kBAAM,MAAM,KAAK,CAAC;AAClB,kBAAM,QAAQ,SAAS,CAAC;AACxB,gBAAI,CAAC,OAAO,CAAC,MAAO;AACpB,kBAAM,UAAU,IAAI,OAAO,KAAK,IAAI,GAAG,gBAAgB,MAAM,SAAS,CAAC,CAAC;AACxE,kBAAM,KAAK,KAAK,GAAG,MAAM,KAAK,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,eAAe,EAAE,EAAE;AAAA,UAC1E;AACA,gBAAM,KAAK,EAAE;AAAA,QACf;AAEA,cAAM,cAAc,IAAI,KAAK,MAAM,WAC/B,+BAA+B,GAAG,IAClC,yBAAyB,GAAG;AAChC,YAAI,aAAa;AACf,cAAI,IAAI,KAAK,MAAM,UAAU;AAC3B,kBAAM,KAAK,GAAG,MAAM,QAAQ,UAAU,CAAC;AAAA,UACzC;AACA,gBAAM,KAAK,WAAW;AACtB,gBAAM,KAAK,EAAE;AAAA,QACf;AAEA,eAAO,MAAM,KAAK,IAAI;AAAA,MACxB;AAEA,aAAO,mBAAmB;AAAA,IAC5B;AAAA,EACF,CAAC;AACL;","names":["visible","index","widths","allocated","message"]}
@@ -1,10 +0,0 @@
1
- import {
2
- clearLiveReadCaches
3
- } from "./chunk-DF4Z7LAD.js";
4
- import "./chunk-G6WKY2W4.js";
5
- import "./chunk-73OJQTBW.js";
6
- import "./chunk-WG5A6EAU.js";
7
- export {
8
- clearLiveReadCaches
9
- };
10
- //# sourceMappingURL=live-read-cache-TUSP7U3D.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/services/marketplace-validate.ts","../src/services/marketplace-type-detect.ts","../src/services/marketplace-reachability.ts","../src/services/marketplace-source-branches.ts","../src/cli/commands/marketplace.ts"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport {\n marketplaceAddFailedNothingSaved,\n marketplacePathMissing,\n marketplacePathNotMarketplace,\n marketplaceUnreachable,\n marketplaceUnreachableHint,\n} from \"../copy/cli.js\";\nimport { MARKETPLACE_TYPE_CANDIDATES } from \"./marketplace-type-detect.js\";\nimport {\n checkMarketplaceReachability,\n type CheckMarketplaceReachabilityOptions,\n} from \"./marketplace-reachability.js\";\nimport { normalizeMarketplaceUrl } from \"./marketplace-registry.js\";\n\nexport class MarketplaceSourceError extends Error {\n readonly hint?: string;\n\n constructor(message: string, hint?: string) {\n super(message);\n this.name = \"MarketplaceSourceError\";\n this.hint = hint;\n }\n}\n\nfunction isLocalFilesystemSource(value: string): boolean {\n if (value.startsWith(\"file:\")) return true;\n if (value.startsWith(\"/\") || value.startsWith(\"./\") || value.startsWith(\"../\")) {\n return true;\n }\n if (value.startsWith(\"~/\")) return true;\n if (/^[A-Za-z]:[\\\\/]/.test(value)) return true;\n return false;\n}\n\nexport function localMarketplaceHasManifest(root: string): boolean {\n return MARKETPLACE_TYPE_CANDIDATES.some((candidate) =>\n existsSync(join(root, candidate.path)),\n );\n}\n\nexport async function assertMarketplaceSourceReachable(\n source: string,\n options: CheckMarketplaceReachabilityOptions = {},\n): Promise<void> {\n const trimmed = source.trim();\n if (!trimmed) {\n throw new MarketplaceSourceError(\n marketplaceUnreachable(source),\n `${marketplaceUnreachableHint()}\\n${marketplaceAddFailedNothingSaved()}`,\n );\n }\n\n if (isLocalFilesystemSource(trimmed)) {\n const path = normalizeMarketplaceUrl(trimmed);\n if (!path || !existsSync(path)) {\n throw new MarketplaceSourceError(\n marketplacePathMissing(path || trimmed),\n marketplaceAddFailedNothingSaved(),\n );\n }\n if (!localMarketplaceHasManifest(path)) {\n throw new MarketplaceSourceError(\n marketplacePathNotMarketplace(path),\n marketplaceAddFailedNothingSaved(),\n );\n }\n return;\n }\n\n const reachability = await checkMarketplaceReachability(trimmed, options);\n if (reachability.status === \"healthy\") {\n return;\n }\n throw new MarketplaceSourceError(\n marketplaceUnreachable(normalizeMarketplaceUrl(trimmed) || trimmed),\n `${marketplaceUnreachableHint()}\\n${marketplaceAddFailedNothingSaved()}`,\n );\n}\n","import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { PluginMarketplacePlatform } from \"../config/settings.js\";\nimport { resolveCommandResult, type RunCommand } from \"../plugins/run-command.js\";\nimport { runCommandWithTimeout } from \"../utils/run-command-with-timeout.js\";\nimport { normalizeMarketplaceUrl } from \"./marketplace-registry.js\";\n\nexport const GH_DETECT_TIMEOUT_MS = 20_000;\n\nexport type MarketplaceTypeDetectStatus = \"inferred\" | \"ambiguous\" | \"error\";\n\nexport interface MarketplaceTypeDetectResult {\n status: MarketplaceTypeDetectStatus;\n platforms: PluginMarketplacePlatform[];\n manifests: string[];\n message: string;\n}\n\nexport interface GithubContentsProbe {\n status: number;\n}\n\nexport type FetchGithubContents = (\n owner: string,\n repo: string,\n path: string,\n) => Promise<GithubContentsProbe>;\n\nexport interface DetectMarketplaceTypeOptions {\n runCommand?: RunCommand;\n fetchGithub?: FetchGithubContents;\n}\n\ninterface ManifestCandidate {\n path: string;\n platform: PluginMarketplacePlatform | null;\n}\n\nexport const MARKETPLACE_TYPE_CANDIDATES: readonly ManifestCandidate[] = [\n { path: \".claude-plugin/marketplace.json\", platform: \"claude-code\" },\n { path: \".cursor-plugin/marketplace.json\", platform: \"cursor\" },\n { path: \".github/plugin/marketplace.json\", platform: \"copilot-cli\" },\n { path: \".agents/plugins/marketplace.json\", platform: null },\n { path: \".codex-plugin/marketplace.json\", platform: null },\n { path: \"marketplace.json\", platform: null },\n];\n\nconst OWNER_REPO_SEGMENT = /^[A-Za-z0-9_.-]+$/;\nconst GITHUB_SCP = /^(?:[^@/\\s]+@)?github\\.com:(.+)$/i;\n\nexport function parseGithubOwnerRepo(\n source: string,\n): { owner: string; repo: string } | null {\n const trimmed = source.trim();\n if (!trimmed) {\n return null;\n }\n\n const scp = GITHUB_SCP.exec(trimmed);\n if (scp?.[1]) {\n return ownerRepoFromPath(`/${scp[1]}`);\n }\n\n let parsed: URL;\n try {\n parsed = new URL(trimmed);\n } catch {\n return null;\n }\n\n const host = parsed.hostname.replace(/^www\\./i, \"\").toLowerCase();\n if (host !== \"github.com\") {\n return null;\n }\n return ownerRepoFromPath(parsed.pathname);\n}\n\nfunction ownerRepoFromPath(pathname: string): { owner: string; repo: string } | null {\n const parts = pathname.split(\"/\").filter(Boolean);\n if (parts.length < 2) {\n return null;\n }\n const owner = parts[0];\n const repo = (parts[1] ?? \"\").replace(/\\.git$/i, \"\");\n if (!owner || !repo || !OWNER_REPO_SEGMENT.test(owner) || !OWNER_REPO_SEGMENT.test(repo)) {\n return null;\n }\n return { owner, repo };\n}\n\nfunction looksLikeLocalPath(value: string): boolean {\n if (value.startsWith(\"file:\")) return true;\n if (value.startsWith(\"/\") || value.startsWith(\"./\") || value.startsWith(\"../\")) {\n return true;\n }\n if (value.startsWith(\"~/\")) return true;\n if (/^[A-Za-z]:[\\\\/]/.test(value)) return true;\n return false;\n}\n\nfunction platformLabel(platform: PluginMarketplacePlatform): string {\n switch (platform) {\n case \"claude-code\":\n return \"Claude Code\";\n case \"cursor\":\n return \"Cursor\";\n case \"goose\":\n return \"Goose\";\n case \"copilot-cli\":\n return \"Copilot CLI\";\n default: {\n const _exhaustive: never = platform;\n return _exhaustive;\n }\n }\n}\n\nexport function joinMarketplacePlatformLabels(\n platforms: readonly PluginMarketplacePlatform[],\n): string {\n const labels = platforms.map(platformLabel);\n if (labels.length === 0) {\n return \"\";\n }\n if (labels.length === 1) {\n return labels[0] ?? \"\";\n }\n if (labels.length === 2) {\n return `${labels[0]} and ${labels[1]}`;\n }\n return `${labels.slice(0, -1).join(\", \")}, and ${labels[labels.length - 1]}`;\n}\n\nfunction resultFromManifests(manifests: string[]): MarketplaceTypeDetectResult {\n const platforms: PluginMarketplacePlatform[] = [];\n const seen = new Set<PluginMarketplacePlatform>();\n for (const relative of manifests) {\n const candidate = MARKETPLACE_TYPE_CANDIDATES.find((item) => item.path === relative);\n if (!candidate?.platform || seen.has(candidate.platform)) {\n continue;\n }\n seen.add(candidate.platform);\n platforms.push(candidate.platform);\n }\n\n if (platforms.length > 0) {\n return {\n status: \"inferred\",\n platforms,\n manifests,\n message: `Inferred: ${joinMarketplacePlatformLabels(platforms)}`,\n };\n }\n\n if (manifests.length === 1 && manifests[0] === \"marketplace.json\") {\n return {\n status: \"ambiguous\",\n platforms: [],\n manifests,\n message: \"Could not tell marketplace type. Found marketplace.json at the repo root.\",\n };\n }\n\n if (manifests.length > 0) {\n return {\n status: \"ambiguous\",\n platforms: [],\n manifests,\n message: `Could not tell marketplace type. Found ${manifests.join(\", \")}.`,\n };\n }\n\n return {\n status: \"error\",\n platforms: [],\n manifests: [],\n message: \"No marketplace manifest found.\",\n };\n}\n\nfunction detectFromFilesystem(root: string): MarketplaceTypeDetectResult {\n const manifests = MARKETPLACE_TYPE_CANDIDATES\n .filter((candidate) => existsSync(join(root, candidate.path)))\n .map((candidate) => candidate.path);\n return resultFromManifests(manifests);\n}\n\nasync function runGh(\n runCommand: RunCommand,\n args: string[],\n): Promise<{ stdout: string; stderr: string; exitCode: number }> {\n return resolveCommandResult(\n runCommand(\"gh\", args, { timeoutMs: GH_DETECT_TIMEOUT_MS, unattended: true }),\n );\n}\n\nasync function ghAvailable(runCommand: RunCommand): Promise<boolean> {\n return (await runGh(runCommand, [\"--version\"])).exitCode === 0;\n}\n\ntype RemoteProbe = \"present\" | \"absent\" | \"auth\" | \"failed\";\n\nfunction classifyGithubFailure(stderr: string, stdout: string, status?: number): RemoteProbe {\n if (status === 401 || status === 403) {\n return \"auth\";\n }\n if (status === 404) {\n return \"absent\";\n }\n const text = `${stderr}\\n${stdout}`;\n if (/401|403|Bad credentials|Requires authentication|HTTP\\s*403|HTTP\\s*401/i.test(text)) {\n return \"auth\";\n }\n if (/404|Not Found/i.test(text)) {\n return \"absent\";\n }\n return \"failed\";\n}\n\nasync function probeGhPath(\n runCommand: RunCommand,\n owner: string,\n repo: string,\n path: string,\n): Promise<RemoteProbe> {\n const result = await runGh(runCommand, [\"api\", `repos/${owner}/${repo}/contents/${path}`]);\n if (result.exitCode === 0) {\n return \"present\";\n }\n return classifyGithubFailure(result.stderr, result.stdout);\n}\n\nasync function ghRepoReadable(runCommand: RunCommand, owner: string, repo: string): Promise<boolean> {\n return (await runGh(runCommand, [\"api\", `repos/${owner}/${repo}`])).exitCode === 0;\n}\n\nasync function defaultFetchGithub(\n owner: string,\n repo: string,\n path: string,\n): Promise<GithubContentsProbe> {\n const encoded = path.split(\"/\").map(encodeURIComponent).join(\"/\");\n const response = await fetch(\n `https://api.github.com/repos/${owner}/${repo}/contents/${encoded}`,\n {\n headers: {\n Accept: \"application/vnd.github+json\",\n \"User-Agent\": \"HarnessTap\",\n },\n },\n );\n return { status: response.status };\n}\n\nfunction classifyHttpStatus(status: number): RemoteProbe {\n if (status === 200) {\n return \"present\";\n }\n return classifyGithubFailure(\"\", \"\", status);\n}\n\nasync function probePublicPaths(\n fetchGithub: FetchGithubContents,\n owner: string,\n repo: string,\n): Promise<string[]> {\n const manifests: string[] = [];\n for (const candidate of MARKETPLACE_TYPE_CANDIDATES) {\n const probe = classifyHttpStatus(\n (await fetchGithub(owner, repo, candidate.path)).status,\n );\n if (probe === \"present\") {\n manifests.push(candidate.path);\n }\n }\n return manifests;\n}\n\nfunction privateRepoMessage(usedGh: boolean): MarketplaceTypeDetectResult {\n return {\n status: \"error\",\n platforms: [],\n manifests: [],\n message: usedGh\n ? \"Could not read this GitHub repo. For private repos, run gh auth login.\"\n : \"Could not read this GitHub repo. Install GitHub CLI (gh) and run gh auth login for private repos.\",\n };\n}\n\nasync function detectFromGithub(\n owner: string,\n repo: string,\n options: DetectMarketplaceTypeOptions,\n): Promise<MarketplaceTypeDetectResult> {\n const runCommand =\n options.runCommand\n ?? ((command, args, runOptions) =>\n runCommandWithTimeout(command, args, {\n ...runOptions,\n timeoutMs: GH_DETECT_TIMEOUT_MS,\n }));\n const fetchGithub = options.fetchGithub ?? defaultFetchGithub;\n const hasGh = await ghAvailable(runCommand);\n\n if (hasGh) {\n const manifests: string[] = [];\n const probes: RemoteProbe[] = [];\n for (const candidate of MARKETPLACE_TYPE_CANDIDATES) {\n const probe = await probeGhPath(runCommand, owner, repo, candidate.path);\n probes.push(probe);\n if (probe === \"present\") {\n manifests.push(candidate.path);\n }\n }\n if (manifests.length > 0) {\n return resultFromManifests(manifests);\n }\n if (await ghRepoReadable(runCommand, owner, repo)) {\n return resultFromManifests([]);\n }\n const publicManifests = await probePublicPaths(fetchGithub, owner, repo);\n if (publicManifests.length > 0) {\n return resultFromManifests(publicManifests);\n }\n return privateRepoMessage(true);\n }\n\n const publicManifests = await probePublicPaths(fetchGithub, owner, repo);\n if (publicManifests.length > 0) {\n return resultFromManifests(publicManifests);\n }\n return privateRepoMessage(false);\n}\n\nexport async function detectMarketplaceType(\n source: string,\n options: DetectMarketplaceTypeOptions = {},\n): Promise<MarketplaceTypeDetectResult> {\n const trimmed = source.trim();\n if (!trimmed) {\n return {\n status: \"error\",\n platforms: [],\n manifests: [],\n message: \"URL or path is required.\",\n };\n }\n\n const normalized = normalizeMarketplaceUrl(trimmed);\n if (existsSync(normalized)) {\n return detectFromFilesystem(normalized);\n }\n\n if (looksLikeLocalPath(trimmed) || looksLikeLocalPath(normalized)) {\n return {\n status: \"error\",\n platforms: [],\n manifests: [],\n message: \"Local path not found.\",\n };\n }\n\n const github = parseGithubOwnerRepo(trimmed) ?? parseGithubOwnerRepo(normalized);\n if (github) {\n return detectFromGithub(github.owner, github.repo, options);\n }\n\n return {\n status: \"error\",\n platforms: [],\n manifests: [],\n message: \"Detection supports a local folder or a GitHub URL.\",\n };\n}\n","import { spawn } from \"node:child_process\";\nimport { access, constants, stat } from \"node:fs/promises\";\nimport type { CommandResult, RunCommand } from \"../plugins/run-command.js\";\nimport {\n githubGitConfigArgs,\n githubHttpsRemoteForAuth,\n resolveGithubAccessToken,\n} from \"./github-credentials.js\";\nimport { normalizeMarketplaceUrl } from \"./marketplace-registry.js\";\nimport { GIT_LS_REMOTE_TIMEOUT_MS } from \"./marketplace-source-branches.js\";\n\nexport type MarketplaceReachability =\n | { status: \"healthy\" }\n | { status: \"error\"; reason: string };\n\nexport interface CheckMarketplaceReachabilityOptions {\n runCommand?: RunCommand;\n}\n\nfunction isLocalFilesystemSource(value: string): boolean {\n if (value.startsWith(\"file:\")) return true;\n if (value.startsWith(\"/\") || value.startsWith(\"./\") || value.startsWith(\"../\")) {\n return true;\n }\n if (value.startsWith(\"~/\")) return true;\n if (/^[A-Za-z]:[\\\\/]/.test(value)) return true;\n return false;\n}\n\nexport function shortRemoteReachabilityReason(stderr: string): string {\n const line =\n stderr\n .split(/\\r?\\n/)\n .map((part) => part.trim())\n .find((part) => part.length > 0 && !part.toLowerCase().startsWith(\"warning:\")) ?? \"\";\n const cleaned = line.replace(/^(fatal|error):\\s*/i, \"\");\n const lower = `${cleaned} ${stderr}`.toLowerCase();\n\n if (\n lower.includes(\"command not found\")\n || lower.includes(\"enoent\")\n || lower.includes(\"not recognized as an internal\")\n ) {\n return \"Git is not available\";\n }\n if (\n lower.includes(\"authentication failed\")\n || lower.includes(\"could not read username\")\n || lower.includes(\"access denied\")\n || lower.includes(\"permission denied\")\n || lower.includes(\"http basic\")\n || lower.includes(\"401\")\n || lower.includes(\"403\")\n ) {\n return \"Could not authenticate with the remote\";\n }\n if (\n lower.includes(\"repository not found\")\n || lower.includes(\"remote: not found\")\n || lower.includes(\"404\")\n ) {\n return \"Remote repository was not found\";\n }\n if (\n lower.includes(\"timed out\")\n || lower.includes(\"timeout\")\n || lower.includes(\"signal: sigterm\")\n ) {\n return \"Remote check timed out\";\n }\n if (\n lower.includes(\"could not resolve host\")\n || lower.includes(\"name or service not known\")\n || lower.includes(\"temporary failure in name resolution\")\n || lower.includes(\"nodename nor servname\")\n || lower.includes(\"network is unreachable\")\n || lower.includes(\"connection refused\")\n || lower.includes(\"failed to connect\")\n || lower.includes(\"unable to access\")\n || lower.includes(\"could not access\")\n ) {\n return \"Could not reach the remote host\";\n }\n return \"Could not reach the remote repository\";\n}\n\nfunction runGitAsync(\n args: string[],\n runCommand: RunCommand | undefined,\n timeoutMs: number,\n): Promise<CommandResult> {\n if (runCommand) {\n return Promise.resolve(runCommand(\"git\", args, { timeoutMs }));\n }\n\n return new Promise((resolve) => {\n const child = spawn(\"git\", args, {\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n env: { ...process.env, GIT_TERMINAL_PROMPT: \"0\" },\n });\n let stdout = \"\";\n let stderr = \"\";\n let settled = false;\n const finish = (result: CommandResult) => {\n if (settled) return;\n settled = true;\n clearTimeout(timer);\n resolve(result);\n };\n const timer = setTimeout(() => {\n child.kill(\"SIGTERM\");\n }, timeoutMs);\n child.stdout?.on(\"data\", (chunk) => {\n stdout += String(chunk);\n });\n child.stderr?.on(\"data\", (chunk) => {\n stderr += String(chunk);\n });\n child.on(\"error\", (error) => {\n const missing = \"code\" in error && error.code === \"ENOENT\";\n finish({\n stdout,\n stderr: missing ? \"git: command not found\" : error.message,\n exitCode: missing ? 127 : 1,\n });\n });\n child.on(\"close\", (code, signal) => {\n const timedOut = signal === \"SIGTERM\";\n finish({\n stdout,\n stderr: timedOut && !stderr.trim()\n ? `Command timed out after ${timeoutMs}ms`\n : stderr,\n exitCode: timedOut ? 124 : (code ?? 1),\n });\n });\n });\n}\n\nasync function checkLocalPath(path: string): Promise<MarketplaceReachability> {\n try {\n const info = await stat(path);\n if (!info.isDirectory()) {\n return { status: \"error\", reason: \"Local path is not a directory\" };\n }\n await access(path, constants.R_OK);\n return { status: \"healthy\" };\n } catch (error) {\n const code = error && typeof error === \"object\" && \"code\" in error\n ? String(error.code)\n : \"\";\n if (code === \"ENOENT\") {\n return { status: \"error\", reason: \"Local directory is missing\" };\n }\n return { status: \"error\", reason: \"Local directory is unreachable\" };\n }\n}\n\nasync function checkRemoteGit(\n url: string,\n runCommand: RunCommand | undefined,\n): Promise<MarketplaceReachability> {\n const token = resolveGithubAccessToken().token;\n const remote = githubHttpsRemoteForAuth(url, token);\n const listed = await runGitAsync(\n [...githubGitConfigArgs(token), \"ls-remote\", \"--heads\", \"--symref\", remote],\n runCommand,\n GIT_LS_REMOTE_TIMEOUT_MS,\n );\n if (listed.exitCode === 0) {\n return { status: \"healthy\" };\n }\n return {\n status: \"error\",\n reason: shortRemoteReachabilityReason(listed.stderr),\n };\n}\n\nexport async function checkMarketplaceReachability(\n source: string,\n options: CheckMarketplaceReachabilityOptions = {},\n): Promise<MarketplaceReachability> {\n const trimmed = source.trim();\n if (!trimmed) {\n return { status: \"error\", reason: \"Marketplace URL or path is required\" };\n }\n\n if (isLocalFilesystemSource(trimmed)) {\n const path = normalizeMarketplaceUrl(trimmed);\n if (!path) {\n return { status: \"error\", reason: \"Marketplace URL or path is required\" };\n }\n return checkLocalPath(path);\n }\n\n const url = normalizeMarketplaceUrl(trimmed);\n if (!url) {\n return { status: \"error\", reason: \"Marketplace URL or path is required\" };\n }\n return checkRemoteGit(url, options.runCommand);\n}\n\nexport async function checkMarketplacesReachability(\n entries: readonly { name: string; url: string }[],\n options: CheckMarketplaceReachabilityOptions = {},\n): Promise<Record<string, MarketplaceReachability>> {\n const rows = await Promise.all(\n entries.map(async (entry) => {\n const result = await checkMarketplaceReachability(entry.url, options);\n return [entry.name, result] as const;\n }),\n );\n return Object.fromEntries(rows);\n}\n","import { existsSync } from \"node:fs\";\nimport { resolveCommandResult, type RunCommand } from \"../plugins/run-command.js\";\nimport { runCommandWithTimeout } from \"../utils/run-command-with-timeout.js\";\nimport {\n githubGitConfigArgs,\n githubHttpsRemoteForAuth,\n resolveGithubAccessToken,\n} from \"./github-credentials.js\";\nimport { normalizeMarketplaceUrl } from \"./marketplace-registry.js\";\n\nexport const GIT_LS_REMOTE_TIMEOUT_MS = 20_000;\n\nexport interface MarketplaceSourceBranches {\n branches: string[];\n defaultBranch: string | null;\n}\n\nfunction gitConfigArgs(): string[] {\n return githubGitConfigArgs(resolveGithubAccessToken().token);\n}\n\nexport function parseGitHeadSymref(stdout: string): string | null {\n for (const line of stdout.split(/\\r?\\n/)) {\n const match = /^\\s*ref:\\s+refs\\/heads\\/(\\S+)/.exec(line);\n if (match?.[1]) {\n return match[1];\n }\n }\n return null;\n}\n\nexport function parseGitLsRemoteHeads(stdout: string): string[] {\n const seen = new Set<string>();\n const branches: string[] = [];\n for (const line of stdout.split(/\\r?\\n/)) {\n const match = /\\trefs\\/heads\\/(.+)$/.exec(line);\n const name = match?.[1];\n if (!name || seen.has(name)) continue;\n seen.add(name);\n branches.push(name);\n }\n return branches;\n}\n\nexport function parseGitForEachRefHeads(stdout: string): string[] {\n const seen = new Set<string>();\n const branches: string[] = [];\n for (const part of stdout.split(/\\r?\\n/)) {\n const name = part.trim();\n if (!name || seen.has(name)) continue;\n seen.add(name);\n branches.push(name);\n }\n return branches;\n}\n\nasync function runGit(\n runCommand: RunCommand | undefined,\n args: string[],\n): Promise<{ stdout: string; stderr: string; exitCode: number }> {\n const run =\n runCommand\n ?? ((command, commandArgs, options) =>\n runCommandWithTimeout(command, commandArgs, {\n ...options,\n timeoutMs: GIT_LS_REMOTE_TIMEOUT_MS,\n unattended: true,\n }));\n return resolveCommandResult(run(\"git\", args));\n}\n\nfunction gitFailed(stderr: string, fallback: string): never {\n throw new Error(stderr.trim() || fallback);\n}\n\nasync function listLocalBranches(\n dir: string,\n runCommand: RunCommand | undefined,\n): Promise<MarketplaceSourceBranches> {\n const listed = await runGit(runCommand, [\n ...gitConfigArgs(),\n \"-C\",\n dir,\n \"for-each-ref\",\n \"--format=%(refname:short)\",\n \"refs/heads\",\n ]);\n if (listed.exitCode !== 0) {\n gitFailed(listed.stderr, \"Could not list local git branches\");\n }\n const head = await runGit(runCommand, [\n ...gitConfigArgs(),\n \"-C\",\n dir,\n \"symbolic-ref\",\n \"--short\",\n \"HEAD\",\n ]);\n const name = head.stdout.trim();\n const defaultBranch =\n head.exitCode === 0 && name && name !== \"HEAD\" ? name : null;\n return {\n branches: parseGitForEachRefHeads(listed.stdout),\n defaultBranch,\n };\n}\n\nasync function listRemoteBranches(\n url: string,\n runCommand: RunCommand | undefined,\n): Promise<MarketplaceSourceBranches> {\n const listed = await runGit(runCommand, [\n ...gitConfigArgs(),\n \"ls-remote\",\n \"--heads\",\n \"--symref\",\n url,\n ]);\n if (listed.exitCode !== 0) {\n gitFailed(listed.stderr, \"Could not list remote git branches\");\n }\n return {\n branches: parseGitLsRemoteHeads(listed.stdout),\n defaultBranch: parseGitHeadSymref(listed.stdout),\n };\n}\n\nexport async function listMarketplaceSourceBranches(\n source: string,\n runCommand?: RunCommand,\n): Promise<MarketplaceSourceBranches> {\n const url = normalizeMarketplaceUrl(source);\n if (!url) {\n throw new Error(\"Marketplace URL or path is required\");\n }\n if (existsSync(url)) {\n return await listLocalBranches(url, runCommand);\n }\n const token = resolveGithubAccessToken().token;\n return await listRemoteBranches(githubHttpsRemoteForAuth(url, token), runCommand);\n}\n","import type { Command } from \"commander\";\nimport type { PluginMarketplacePlatform } from \"../../config/settings.js\";\nimport { getHarnesstapDir } from \"../../db/connection.js\";\nimport {\n alignImplicitMarketplacePlatforms,\n listCatalogPlugins,\n marketplaceCatalogWarnings,\n marketplaceRowFlavors,\n refreshMarketplaceCatalog,\n type RefreshMarketplaceCatalogResult,\n} from \"../../services/marketplace-catalog.js\";\nimport {\n addMarketplace,\n listMarketplaces,\n normalizeMarketplaceUrl,\n removeMarketplace,\n} from \"../../services/marketplace-registry.js\";\nimport {\n MarketplaceSourceError,\n assertMarketplaceSourceReachable,\n} from \"../../services/marketplace-validate.js\";\nimport {\n promptForSearchableChoice,\n shouldUseBrowsePicker,\n} from \"../../services/wizards/shared.js\";\nimport { ui } from \"../../ui/index.js\";\nimport { parseOutputFormat, printJson } from \"../../utils/output-format.js\";\nimport {\n marketplaceAddFailedNothingSaved,\n marketplaceUnreachable,\n} from \"../../copy/cli.js\";\nimport { formatCount } from \"../formatting.js\";\nimport { configureCommandGroup } from \"../help.js\";\nimport { collectRepeatedOption, fail } from \"../shared.js\";\n\nconst VALID_PLATFORMS = new Set<PluginMarketplacePlatform>([\n \"claude-code\",\n \"cursor\",\n \"goose\",\n \"copilot-cli\",\n]);\n\nfunction parsePlatforms(platforms: string[] | undefined): PluginMarketplacePlatform[] {\n const ids = platforms && platforms.length > 0 ? platforms : [\"claude-code\"];\n const parsed: PluginMarketplacePlatform[] = [];\n for (const id of ids) {\n if (!VALID_PLATFORMS.has(id as PluginMarketplacePlatform)) {\n throw new Error(\n `Invalid --platform value: ${id}. Use claude-code, cursor, goose, or copilot-cli.`,\n );\n }\n parsed.push(id as PluginMarketplacePlatform);\n }\n return parsed;\n}\n\nfunction deriveMarketplaceNameFromUrl(url: string): string {\n const normalized = normalizeMarketplaceUrl(url);\n try {\n const parsed = new URL(normalized);\n const segments = parsed.pathname.split(\"/\").filter(Boolean);\n const last = segments.at(-1);\n if (last) {\n return last.replace(/\\.git$/i, \"\");\n }\n } catch {\n // fall through to path split fallback\n }\n\n const last = normalized.split(\"/\").filter(Boolean).at(-1);\n if (!last) {\n throw new Error(\"Could not derive marketplace name from URL; pass --name.\");\n }\n return last.replace(/\\.git$/i, \"\");\n}\n\nfunction requireMarketplaceEntry(name: string) {\n const entry = listMarketplaces(getHarnesstapDir()).find((marketplace) => marketplace.name === name);\n if (!entry) {\n throw new Error(`Marketplace not found: ${name}`);\n }\n return entry;\n}\n\nasync function handleMarketplaceAddCommand(\n url: string,\n opts: {\n name?: string;\n platform?: string[];\n branch?: string[];\n format?: string;\n },\n): Promise<void> {\n const format = parseOutputFormat(opts.format);\n const harnesstapDir = getHarnesstapDir();\n const name = opts.name?.trim() || deriveMarketplaceNameFromUrl(url);\n const platformsExplicit = (opts.platform?.length ?? 0) > 0;\n const platforms = parsePlatforms(opts.platform);\n\n try {\n await assertMarketplaceSourceReachable(url);\n } catch (error) {\n if (error instanceof MarketplaceSourceError) {\n fail(error.message, error.hint ? { hint: error.hint } : undefined);\n return;\n }\n throw error;\n }\n\n const result = addMarketplace(harnesstapDir, {\n url,\n name,\n platforms,\n trackedBranches: opts.branch,\n });\n\n let refresh: RefreshMarketplaceCatalogResult | undefined;\n try {\n refresh = await refreshMarketplaceCatalog(harnesstapDir, {\n name: result.entry.name,\n force: true,\n unattended: false,\n });\n if (!refresh.ok && result.status === \"added\") {\n removeMarketplace(harnesstapDir, result.entry.name);\n fail(marketplaceUnreachable(result.entry.url), {\n hints: [refresh.message, marketplaceAddFailedNothingSaved()].filter(\n (line) => line.trim().length > 0,\n ),\n });\n return;\n }\n if (!refresh.ok) {\n fail(marketplaceUnreachable(result.entry.url), {\n hints: [refresh.message, marketplaceAddFailedNothingSaved()].filter(\n (line) => line.trim().length > 0,\n ),\n });\n return;\n }\n } catch (error) {\n if (result.status === \"added\") {\n removeMarketplace(harnesstapDir, result.entry.name);\n }\n fail(error instanceof Error ? error.message : String(error), {\n hint: marketplaceAddFailedNothingSaved(),\n });\n return;\n }\n\n if (!platformsExplicit) {\n alignImplicitMarketplacePlatforms(harnesstapDir, result.entry.name);\n }\n const entry =\n listMarketplaces(harnesstapDir).find(\n (marketplace) => marketplace.name === result.entry.name,\n ) ?? result.entry;\n\n if (format === \"json\") {\n printJson({\n status: result.status,\n entry,\n ...(refresh ? { refresh } : {}),\n });\n return;\n }\n\n for (const warning of refresh?.warnings ?? []) {\n ui.warn(warning);\n }\n\n if (result.status === \"already_configured\") {\n ui.info(`Marketplace already configured: ${entry.name}`);\n return;\n }\n\n ui.success(`Added marketplace: ${entry.name}`, {\n hint: entry.url,\n });\n}\n\nfunction handleMarketplaceListCommand(opts: { format?: string } = {}): void {\n const format = parseOutputFormat(opts.format);\n const marketplaces = listMarketplaces(getHarnesstapDir());\n\n if (format === \"json\") {\n const harnesstapDir = getHarnesstapDir();\n printJson({\n marketplaces: marketplaces.map((entry) => ({\n ...entry,\n flavors: marketplaceRowFlavors(harnesstapDir, entry),\n })),\n });\n return;\n }\n\n if (marketplaces.length === 0) {\n ui.dim(\"No marketplaces configured.\");\n return;\n }\n\n const harnesstapDir = getHarnesstapDir();\n ui.table.print({\n columns: [\n { key: \"name\", header: \"NAME\", width: 24 },\n { key: \"url\", header: \"URL\", width: 48 },\n { key: \"platforms\", header: \"PLATFORMS\", width: 24 },\n ],\n rows: marketplaces.map((entry) => ({\n name: entry.name,\n url: entry.url,\n platforms: marketplaceRowFlavors(harnesstapDir, entry).join(\", \"),\n })),\n summary: formatCount(marketplaces.length, \"marketplace\"),\n empty: \"No marketplaces configured.\",\n });\n}\n\nfunction handleMarketplaceRemoveCommand(name: string, opts: { format?: string } = {}): void {\n const format = parseOutputFormat(opts.format);\n const result = removeMarketplace(getHarnesstapDir(), name);\n if (result.status === \"not_found\") {\n throw new Error(`Marketplace not found: ${name}`);\n }\n\n if (format === \"json\") {\n printJson(result);\n return;\n }\n\n ui.success(`Removed marketplace: ${result.entry.name}`);\n}\n\nasync function handleMarketplaceShowCommand(\n name: string,\n opts: {\n refresh?: boolean;\n format?: string;\n noInteractive?: boolean;\n } = {},\n): Promise<void> {\n const format = parseOutputFormat(opts.format);\n const harnesstapDir = getHarnesstapDir();\n requireMarketplaceEntry(name);\n\n let refresh: RefreshMarketplaceCatalogResult | undefined;\n if (opts.refresh) {\n refresh = await refreshMarketplaceCatalog(harnesstapDir, {\n name,\n force: true,\n unattended: false,\n });\n if (!refresh.ok) {\n throw new Error(refresh.message);\n }\n }\n\n const plugins = listCatalogPlugins(harnesstapDir, { name });\n const warnings = marketplaceCatalogWarnings(harnesstapDir, name);\n const useBrowsePicker = shouldUseBrowsePicker({\n noInteractive: opts.noInteractive,\n format: opts.format,\n });\n\n if (useBrowsePicker) {\n if (plugins.length === 0) {\n throw new Error(\n `No plugins in catalog for \"${name}\". Try marketplace show ${name} --refresh.`,\n );\n }\n\n const selectedRef = await promptForSearchableChoice({\n message: `Select a plugin from ${name}`,\n choices: plugins.map((plugin) => ({\n name: plugin.description\n ? `${plugin.name}: ${plugin.description}`\n : plugin.name,\n value: plugin.ref,\n description: plugin.version ? `v${plugin.version}` : undefined,\n })),\n });\n\n if (format === \"json\") {\n printJson({\n name,\n ref: selectedRef,\n ...(refresh ? { refresh } : {}),\n });\n return;\n }\n\n console.log(selectedRef);\n return;\n }\n\n if (format === \"json\") {\n printJson({\n name,\n plugins,\n ...(warnings.length > 0 ? { warnings } : {}),\n ...(refresh ? { refresh } : {}),\n });\n return;\n }\n\n for (const warning of warnings) {\n ui.warn(warning);\n }\n\n if (plugins.length === 0) {\n ui.dim(`No plugins in catalog for \"${name}\". Try: marketplace show ${name} --refresh`);\n return;\n }\n\n ui.table.print({\n columns: [\n { key: \"name\", header: \"NAME\", width: 24 },\n { key: \"flavor\", header: \"FLAVOR\", width: 16 },\n { key: \"ref\", header: \"REF\", width: 32 },\n { key: \"version\", header: \"VERSION\", width: 12 },\n { key: \"description\", header: \"DESCRIPTION\", width: 40, truncate: true },\n ],\n rows: plugins.map((plugin) => ({\n name: plugin.name,\n flavor: plugin.flavor ?? \"\",\n ref: plugin.ref,\n version: plugin.version ?? \"\",\n description: plugin.description ?? \"\",\n })),\n summary: formatCount(plugins.length, \"plugin\"),\n empty: `No plugins in catalog for \"${name}\".`,\n });\n}\n\nexport function registerMarketplaceCommands(root: Command): void {\n const marketplaceCmd = configureCommandGroup(\n root\n .command(\"marketplace\")\n .alias(\"mkt\")\n .description(\"Manage plugin marketplace sources\"),\n );\n\n marketplaceCmd\n .command(\"add\")\n .argument(\"<url>\", \"Marketplace git URL, file:// URL, or local git path\")\n .option(\"--name <id>\", \"Marketplace registry name\")\n .option(\n \"--platform <id>\",\n \"Target platform (repeatable; default: claude-code)\",\n collectRepeatedOption,\n [],\n )\n .option(\n \"--branch <name>\",\n \"Extra git branch to catalog (repeatable; default: the repo default branch only)\",\n collectRepeatedOption,\n [],\n )\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .option(\"--no-interactive\", \"Disable interactive prompts\")\n .description(\"Register a plugin marketplace git URL or local path\")\n .action(handleMarketplaceAddCommand);\n\n marketplaceCmd\n .command(\"list\")\n .alias(\"ls\")\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .description(\"List configured plugin marketplaces\")\n .action(handleMarketplaceListCommand);\n\n marketplaceCmd\n .command(\"remove\")\n .alias(\"rm\")\n .argument(\"<name>\", \"Marketplace registry name to remove\")\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .description(\"Remove a configured plugin marketplace\")\n .action(handleMarketplaceRemoveCommand);\n\n marketplaceCmd\n .command(\"show\")\n .argument(\"<name>\", \"Marketplace registry name to browse\")\n .option(\"--refresh\", \"Refresh the marketplace catalog before listing\")\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .option(\"--no-interactive\", \"Disable interactive browse picker\")\n .description(\"List or browse plugins from a marketplace catalog\")\n .action(handleMarketplaceShowCommand);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,cAAAA,mBAAkB;AAC3B,SAAS,QAAAC,aAAY;;;ACDrB,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AAqCd,IAAM,8BAA4D;AAAA,EACvE,EAAE,MAAM,mCAAmC,UAAU,cAAc;AAAA,EACnE,EAAE,MAAM,mCAAmC,UAAU,SAAS;AAAA,EAC9D,EAAE,MAAM,mCAAmC,UAAU,cAAc;AAAA,EACnE,EAAE,MAAM,oCAAoC,UAAU,KAAK;AAAA,EAC3D,EAAE,MAAM,kCAAkC,UAAU,KAAK;AAAA,EACzD,EAAE,MAAM,oBAAoB,UAAU,KAAK;AAC7C;;;AC7CA,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B,gCAAgC,OAAO,EACjE,OAAO,oBAAoB,6BAA6B,EACxD,YAAY,qDAAqD,EACjE,OAAO,2BAA2B;AAErC,iBACG,QAAQ,MAAM,EACd,MAAM,IAAI,EACV,OAAO,mBAAmB,gCAAgC,OAAO,EACjE,YAAY,qCAAqC,EACjD,OAAO,4BAA4B;AAEtC,iBACG,QAAQ,QAAQ,EAChB,MAAM,IAAI,EACV,SAAS,UAAU,qCAAqC,EACxD,OAAO,mBAAmB,gCAAgC,OAAO,EACjE,YAAY,wCAAwC,EACpD,OAAO,8BAA8B;AAExC,iBACG,QAAQ,MAAM,EACd,SAAS,UAAU,qCAAqC,EACxD,OAAO,aAAa,gDAAgD,EACpE,OAAO,mBAAmB,gCAAgC,OAAO,EACjE,OAAO,oBAAoB,mCAAmC,EAC9D,YAAY,mDAAmD,EAC/D,OAAO,4BAA4B;AACxC;","names":["existsSync","join","existsSync","isLocalFilesystemSource","existsSync","join","last","harnesstapDir"]}