harnesstap 1.6.0 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/README.md +18 -1
  2. package/dist/apply-REDAJFNT.js +50 -0
  3. package/dist/{approve-R6AWQB3I.js → approve-2VEAGEYX.js} +9 -9
  4. package/dist/{audit-2HNKFPSU.js → audit-2KSDWKR7.js} +9 -9
  5. package/dist/{auth-C54KRLNF.js → auth-VSOK5XXO.js} +7 -7
  6. package/dist/bin.js +2 -2
  7. package/dist/{chunk-A3TZT4WT.js → chunk-2AMFXAQB.js} +13 -4
  8. package/dist/chunk-2AMFXAQB.js.map +1 -0
  9. package/dist/{chunk-3277RVZT.js → chunk-32JTZAO7.js} +3 -3
  10. package/dist/{chunk-2XDYQXP2.js → chunk-3TIUWC2Z.js} +10 -10
  11. package/dist/{chunk-K4UDZUJ2.js → chunk-3YXS6AN5.js} +2 -2
  12. package/dist/{chunk-D7R577XZ.js → chunk-4MK2BRYB.js} +8 -8
  13. package/dist/{chunk-MHMFF6A5.js → chunk-4YHTVGRE.js} +2 -2
  14. package/dist/{chunk-5HACBPK2.js → chunk-66LQ4B65.js} +14 -14
  15. package/dist/{chunk-EPXAOEBB.js → chunk-6YIVNY56.js} +4 -4
  16. package/dist/{chunk-PCNHBMBU.js → chunk-AY55OHND.js} +2 -2
  17. package/dist/{chunk-ZKMSHLXP.js → chunk-B5LCF5J2.js} +2 -2
  18. package/dist/{chunk-HV3ENT2F.js → chunk-BRISZWFM.js} +2 -2
  19. package/dist/{chunk-R6VFJKZB.js → chunk-CO6YFR3D.js} +2 -2
  20. package/dist/{chunk-UZCAYOIQ.js → chunk-CPZM54UB.js} +7 -7
  21. package/dist/{chunk-OHZNDV4A.js → chunk-EA7EROYV.js} +4 -4
  22. package/dist/{chunk-OHZNDV4A.js.map → chunk-EA7EROYV.js.map} +1 -1
  23. package/dist/{chunk-MQCH3YZ5.js → chunk-FAL7MVPU.js} +5 -5
  24. package/dist/{chunk-42E2MPES.js → chunk-GVNXAIXG.js} +6 -6
  25. package/dist/{chunk-S2D5PWAO.js → chunk-HL2M67GG.js} +2 -2
  26. package/dist/{chunk-RQLVXJH2.js → chunk-I6KQT3PW.js} +2 -2
  27. package/dist/{chunk-MHLAIGIM.js → chunk-J7WZWGDH.js} +2 -2
  28. package/dist/{chunk-6FXJIKEG.js → chunk-JRHQSSD4.js} +4 -4
  29. package/dist/{chunk-WQ3F4O7U.js → chunk-LY7NVETO.js} +4 -4
  30. package/dist/{chunk-WQ3F4O7U.js.map → chunk-LY7NVETO.js.map} +1 -1
  31. package/dist/{chunk-WGVU3LA5.js → chunk-NAIB6MPR.js} +2 -12
  32. package/dist/chunk-NAIB6MPR.js.map +1 -0
  33. package/dist/{chunk-M7PHQ3UC.js → chunk-OQLNXYL5.js} +1630 -785
  34. package/dist/chunk-OQLNXYL5.js.map +1 -0
  35. package/dist/{chunk-R27VZIF6.js → chunk-Q4UO2MDZ.js} +2 -2
  36. package/dist/{chunk-BUA7WFI4.js → chunk-QKXPKKZO.js} +1761 -895
  37. package/dist/chunk-QKXPKKZO.js.map +1 -0
  38. package/dist/{chunk-XNS4I3W6.js → chunk-R4TM7KE5.js} +4 -4
  39. package/dist/{chunk-CBSDMRMY.js → chunk-RP4BBXDP.js} +2 -2
  40. package/dist/{chunk-GZU4LVFF.js → chunk-RV7Q6ZJZ.js} +6 -6
  41. package/dist/{chunk-TERYL7JH.js → chunk-S5L5KKUX.js} +20 -20
  42. package/dist/chunk-S5L5KKUX.js.map +1 -0
  43. package/dist/{chunk-QGTDQNVV.js → chunk-SBUP7UHE.js} +3 -3
  44. package/dist/{chunk-M6FEDSHY.js → chunk-THKF6P4Q.js} +6 -6
  45. package/dist/{chunk-3Q72LZPJ.js → chunk-THOVAUGF.js} +50 -53
  46. package/dist/chunk-THOVAUGF.js.map +1 -0
  47. package/dist/{chunk-V4UNYSZO.js → chunk-U3BFGU66.js} +2 -2
  48. package/dist/{chunk-MQCAPCAF.js → chunk-US54JBMX.js} +6 -6
  49. package/dist/{chunk-UC27MQ3T.js → chunk-VVU5ZFRV.js} +3 -3
  50. package/dist/{chunk-T4EKNX2Q.js → chunk-XIQACTMH.js} +3 -3
  51. package/dist/{chunk-UK2IV2ZQ.js → chunk-Y4RNG5OY.js} +2 -2
  52. package/dist/{chunk-R4NV3Q7G.js → chunk-YWKLUVCC.js} +2 -2
  53. package/dist/{chunk-L6BJCRBU.js → chunk-Z24TLVN5.js} +13 -25
  54. package/dist/chunk-Z24TLVN5.js.map +1 -0
  55. package/dist/{chunk-OWE3OSX6.js → chunk-ZEXB4ORV.js} +8 -8
  56. package/dist/{chunk-CR2TYMKC.js → chunk-ZQSL5DNH.js} +34 -34
  57. package/dist/{compile-B2QG6BAQ.js → compile-EQFNP5PS.js} +32 -32
  58. package/dist/{config-D3F6ICZ2.js → config-NALKAQZW.js} +11 -11
  59. package/dist/{cursor-local-install-4HDIBX22.js → cursor-local-install-6DRGQ6U7.js} +6 -6
  60. package/dist/{cursor-local-install-LL367GZY.js → cursor-local-install-KY3PVFZY.js} +3 -3
  61. package/dist/{doctor-QSGETVDE.js → doctor-PSFWURF6.js} +9 -9
  62. package/dist/{environment-2JS4RWQA.js → environment-IH6UHY5Q.js} +16 -16
  63. package/dist/{github-JXSTHLY2.js → github-42TN2FWA.js} +7 -7
  64. package/dist/{harness-GBI3AMLH.js → harness-464THUQE.js} +38 -70
  65. package/dist/harness-464THUQE.js.map +1 -0
  66. package/dist/{help-VIRMBOPJ.js → help-2WLAAUHJ.js} +2 -2
  67. package/dist/{help-VIRMBOPJ.js.map → help-2WLAAUHJ.js.map} +1 -1
  68. package/dist/{help-EC52ERIE.js → help-GITID5T7.js} +8 -8
  69. package/dist/{host-plugin-view-kept-XKHD6NGU.js → host-plugin-view-kept-USEF3O7L.js} +9 -9
  70. package/dist/index.d.ts +10 -0
  71. package/dist/index.js +9 -9
  72. package/dist/{init-OK3K6ILG.js → init-ZRBNVSSY.js} +17 -17
  73. package/dist/live-read-cache-EXERTB5C.js +12 -0
  74. package/dist/{live-read-cache-ESQQJBNS.js → live-read-cache-V7PNM5C7.js} +3 -3
  75. package/dist/{lock-AA2F4I3K.js → lock-FOGZUIAX.js} +8 -8
  76. package/dist/{marketplace-QUYCV23F.js → marketplace-HRBZHD72.js} +7 -7
  77. package/dist/{mcp-CIHSR4DD.js → mcp-QKKRROXZ.js} +32 -32
  78. package/dist/{migrate-TQPEZYS5.js → migrate-LTIWDOB4.js} +14 -14
  79. package/dist/{notifications-TAELTPDW.js → notifications-D7XCAXPE.js} +12 -12
  80. package/dist/open-DGLJYZVH.js +20 -0
  81. package/dist/{pack-VUO4UBWL.js → pack-K6XBNLDU.js} +8 -8
  82. package/dist/plugin-3V7YESUD.js +47 -0
  83. package/dist/plugin-from-project-QZQCQVMR.js +15 -0
  84. package/dist/{policy-Z5TL4N3V.js → policy-HSCKBNAV.js} +8 -8
  85. package/dist/{profile-QFI7SL3S.js → profile-BGYKPWC7.js} +27 -27
  86. package/dist/{project-3KR3EPYR.js → project-NGMOEYZY.js} +45 -78
  87. package/dist/project-NGMOEYZY.js.map +1 -0
  88. package/dist/{resource-45BPRQ7V.js → resource-C2L3SYQP.js} +23 -23
  89. package/dist/status-refresh-worker.js +2 -2
  90. package/dist/{version-QUJZGTZ5.js → version-XQS3VKYR.js} +2 -2
  91. package/package.json +1 -1
  92. package/dist/apply-FTAIL3X3.js +0 -50
  93. package/dist/chunk-3Q72LZPJ.js.map +0 -1
  94. package/dist/chunk-A3TZT4WT.js.map +0 -1
  95. package/dist/chunk-BUA7WFI4.js.map +0 -1
  96. package/dist/chunk-L6BJCRBU.js.map +0 -1
  97. package/dist/chunk-M7PHQ3UC.js.map +0 -1
  98. package/dist/chunk-TERYL7JH.js.map +0 -1
  99. package/dist/chunk-WGVU3LA5.js.map +0 -1
  100. package/dist/harness-GBI3AMLH.js.map +0 -1
  101. package/dist/live-read-cache-WPUFHVMZ.js +0 -12
  102. package/dist/open-D3GWGDSQ.js +0 -20
  103. package/dist/plugin-L3466DHK.js +0 -47
  104. package/dist/plugin-from-project-U5UGKTJH.js +0 -15
  105. package/dist/project-3KR3EPYR.js.map +0 -1
  106. /package/dist/{apply-FTAIL3X3.js.map → apply-REDAJFNT.js.map} +0 -0
  107. /package/dist/{approve-R6AWQB3I.js.map → approve-2VEAGEYX.js.map} +0 -0
  108. /package/dist/{audit-2HNKFPSU.js.map → audit-2KSDWKR7.js.map} +0 -0
  109. /package/dist/{auth-C54KRLNF.js.map → auth-VSOK5XXO.js.map} +0 -0
  110. /package/dist/{chunk-3277RVZT.js.map → chunk-32JTZAO7.js.map} +0 -0
  111. /package/dist/{chunk-2XDYQXP2.js.map → chunk-3TIUWC2Z.js.map} +0 -0
  112. /package/dist/{chunk-K4UDZUJ2.js.map → chunk-3YXS6AN5.js.map} +0 -0
  113. /package/dist/{chunk-D7R577XZ.js.map → chunk-4MK2BRYB.js.map} +0 -0
  114. /package/dist/{chunk-MHMFF6A5.js.map → chunk-4YHTVGRE.js.map} +0 -0
  115. /package/dist/{chunk-5HACBPK2.js.map → chunk-66LQ4B65.js.map} +0 -0
  116. /package/dist/{chunk-EPXAOEBB.js.map → chunk-6YIVNY56.js.map} +0 -0
  117. /package/dist/{chunk-PCNHBMBU.js.map → chunk-AY55OHND.js.map} +0 -0
  118. /package/dist/{chunk-ZKMSHLXP.js.map → chunk-B5LCF5J2.js.map} +0 -0
  119. /package/dist/{chunk-HV3ENT2F.js.map → chunk-BRISZWFM.js.map} +0 -0
  120. /package/dist/{chunk-R6VFJKZB.js.map → chunk-CO6YFR3D.js.map} +0 -0
  121. /package/dist/{chunk-UZCAYOIQ.js.map → chunk-CPZM54UB.js.map} +0 -0
  122. /package/dist/{chunk-MQCH3YZ5.js.map → chunk-FAL7MVPU.js.map} +0 -0
  123. /package/dist/{chunk-42E2MPES.js.map → chunk-GVNXAIXG.js.map} +0 -0
  124. /package/dist/{chunk-S2D5PWAO.js.map → chunk-HL2M67GG.js.map} +0 -0
  125. /package/dist/{chunk-RQLVXJH2.js.map → chunk-I6KQT3PW.js.map} +0 -0
  126. /package/dist/{chunk-MHLAIGIM.js.map → chunk-J7WZWGDH.js.map} +0 -0
  127. /package/dist/{chunk-6FXJIKEG.js.map → chunk-JRHQSSD4.js.map} +0 -0
  128. /package/dist/{chunk-R27VZIF6.js.map → chunk-Q4UO2MDZ.js.map} +0 -0
  129. /package/dist/{chunk-XNS4I3W6.js.map → chunk-R4TM7KE5.js.map} +0 -0
  130. /package/dist/{chunk-CBSDMRMY.js.map → chunk-RP4BBXDP.js.map} +0 -0
  131. /package/dist/{chunk-GZU4LVFF.js.map → chunk-RV7Q6ZJZ.js.map} +0 -0
  132. /package/dist/{chunk-QGTDQNVV.js.map → chunk-SBUP7UHE.js.map} +0 -0
  133. /package/dist/{chunk-M6FEDSHY.js.map → chunk-THKF6P4Q.js.map} +0 -0
  134. /package/dist/{chunk-V4UNYSZO.js.map → chunk-U3BFGU66.js.map} +0 -0
  135. /package/dist/{chunk-MQCAPCAF.js.map → chunk-US54JBMX.js.map} +0 -0
  136. /package/dist/{chunk-UC27MQ3T.js.map → chunk-VVU5ZFRV.js.map} +0 -0
  137. /package/dist/{chunk-T4EKNX2Q.js.map → chunk-XIQACTMH.js.map} +0 -0
  138. /package/dist/{chunk-UK2IV2ZQ.js.map → chunk-Y4RNG5OY.js.map} +0 -0
  139. /package/dist/{chunk-R4NV3Q7G.js.map → chunk-YWKLUVCC.js.map} +0 -0
  140. /package/dist/{chunk-OWE3OSX6.js.map → chunk-ZEXB4ORV.js.map} +0 -0
  141. /package/dist/{chunk-CR2TYMKC.js.map → chunk-ZQSL5DNH.js.map} +0 -0
  142. /package/dist/{compile-B2QG6BAQ.js.map → compile-EQFNP5PS.js.map} +0 -0
  143. /package/dist/{config-D3F6ICZ2.js.map → config-NALKAQZW.js.map} +0 -0
  144. /package/dist/{cursor-local-install-4HDIBX22.js.map → cursor-local-install-6DRGQ6U7.js.map} +0 -0
  145. /package/dist/{cursor-local-install-LL367GZY.js.map → cursor-local-install-KY3PVFZY.js.map} +0 -0
  146. /package/dist/{doctor-QSGETVDE.js.map → doctor-PSFWURF6.js.map} +0 -0
  147. /package/dist/{environment-2JS4RWQA.js.map → environment-IH6UHY5Q.js.map} +0 -0
  148. /package/dist/{github-JXSTHLY2.js.map → github-42TN2FWA.js.map} +0 -0
  149. /package/dist/{help-EC52ERIE.js.map → help-GITID5T7.js.map} +0 -0
  150. /package/dist/{host-plugin-view-kept-XKHD6NGU.js.map → host-plugin-view-kept-USEF3O7L.js.map} +0 -0
  151. /package/dist/{init-OK3K6ILG.js.map → init-ZRBNVSSY.js.map} +0 -0
  152. /package/dist/{live-read-cache-ESQQJBNS.js.map → live-read-cache-EXERTB5C.js.map} +0 -0
  153. /package/dist/{live-read-cache-WPUFHVMZ.js.map → live-read-cache-V7PNM5C7.js.map} +0 -0
  154. /package/dist/{lock-AA2F4I3K.js.map → lock-FOGZUIAX.js.map} +0 -0
  155. /package/dist/{marketplace-QUYCV23F.js.map → marketplace-HRBZHD72.js.map} +0 -0
  156. /package/dist/{mcp-CIHSR4DD.js.map → mcp-QKKRROXZ.js.map} +0 -0
  157. /package/dist/{migrate-TQPEZYS5.js.map → migrate-LTIWDOB4.js.map} +0 -0
  158. /package/dist/{notifications-TAELTPDW.js.map → notifications-D7XCAXPE.js.map} +0 -0
  159. /package/dist/{open-D3GWGDSQ.js.map → open-DGLJYZVH.js.map} +0 -0
  160. /package/dist/{pack-VUO4UBWL.js.map → pack-K6XBNLDU.js.map} +0 -0
  161. /package/dist/{plugin-L3466DHK.js.map → plugin-3V7YESUD.js.map} +0 -0
  162. /package/dist/{plugin-from-project-U5UGKTJH.js.map → plugin-from-project-QZQCQVMR.js.map} +0 -0
  163. /package/dist/{policy-Z5TL4N3V.js.map → policy-HSCKBNAV.js.map} +0 -0
  164. /package/dist/{profile-QFI7SL3S.js.map → profile-BGYKPWC7.js.map} +0 -0
  165. /package/dist/{resource-45BPRQ7V.js.map → resource-C2L3SYQP.js.map} +0 -0
  166. /package/dist/{version-QUJZGTZ5.js.map → version-XQS3VKYR.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/commands/harness.ts","../src/services/harness-union-sync.ts","../src/services/harness-sync-preview.ts","../src/services/instruction-file-links.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport { Option, type Command } from \"commander\";\nimport { loadSettings } from \"../../config/settings.js\";\nimport { getDb, getHarnesstapDir } from \"../../db/connection.js\";\nimport { initializeSchema } from \"../../db/schema.js\";\nimport {\n getHarnessPreference,\n getProjectHarnessConfig,\n setHarnessPreference,\n setProjectHarnessConfig,\n} from \"../../models/harness.js\";\nimport { getAllPlatforms } from \"../../platforms/registry.js\";\nimport { resolveHarnessSelection } from \"../../services/harness-config.js\";\nimport {\n syncConfiguredHarnesses,\n} from \"../../services/harness-union-sync.js\";\nimport { getDedicatedSerializerPlatformIds } from \"../../services/platform-serializers.js\";\nimport {\n DEFAULT_PLUGIN_RESOURCE_MODE,\n parsePluginResourceMode,\n} from \"../../services/plugin-resource-mode.js\";\nimport { detectPlatforms } from \"../../services/scanner.js\";\nimport { registeredHarnessesOf } from \"../../services/harness-targets.js\";\nimport { shouldUseWizard } from \"../../services/wizards/shared.js\";\nimport { ui } from \"../../ui/index.js\";\nimport { parseOutputFormat, printJson } from \"../../utils/output-format.js\";\nimport { formatCount } from \"../formatting.js\";\nimport { parseHarnessList } from \"../handlers/parse-flags.js\";\nimport { configureCommandGroup } from \"../help.js\";\nimport {\n fail,\n formatCommand,\n} from \"../shared.js\";\nimport { ensureProjectForRoot, findProjectForRoot } from \"../../services/project-identity.js\";\n\nconst NATIVE_HARNESS_IDS = new Set(getDedicatedSerializerPlatformIds());\n\nfunction handleHarnessListCommand(\n opts: { format?: string; supported?: boolean } = {},\n): void {\n const format = parseOutputFormat(opts.format);\n const platforms = getAllPlatforms().filter(\n (platform) => !opts.supported || NATIVE_HARNESS_IDS.has(platform.id),\n );\n if (format === \"json\") {\n printJson(\n platforms.map((platform) => ({\n id: platform.id,\n name: platform.name,\n supports: [...platform.supports].sort(),\n })),\n );\n return;\n }\n const rows = platforms.map((p) => ({\n id: p.id,\n name: p.name,\n supports: [...p.supports].join(\", \"),\n }));\n ui.table.print({\n columns: [\n { key: \"id\", header: \"ID\", width: 20 },\n { key: \"name\", header: \"NAME\", width: 20 },\n { key: \"supports\", header: \"SUPPORTS\", width: 40 },\n ],\n rows,\n summary: `${platforms.length} harnesses`,\n empty: \"No harnesses found.\",\n });\n}\n\nasync function handleHarnessSetCommand(opts: {\n harnesses?: string;\n main?: string;\n aliases?: string;\n interactive?: boolean;\n noInteractive?: boolean;\n}): Promise<void> {\n const db = getDb();\n initializeSchema(db);\n const useWizard = shouldUseWizard({\n interactive: opts.interactive,\n noInteractive: opts.noInteractive,\n missingRequiredArgs: !opts.harnesses && !opts.main && !opts.aliases,\n });\n const selection = await resolveHarnessSelection({\n harnesses: parseHarnessList(opts.harnesses),\n main: opts.main,\n aliases: parseHarnessList(opts.aliases),\n nonInteractive: !useWizard,\n current: getHarnessPreference(),\n });\n const saved = setHarnessPreference(selection);\n ui.success(\n `Set harness preference ${ui.icons.hint} ${ui.theme.accent(registeredHarnessesOf(saved).join(\", \"))}`,\n );\n}\n\nfunction handleHarnessStatusCommand(opts: { format?: string }): void {\n const db = getDb();\n initializeSchema(db);\n const format = parseOutputFormat(opts.format);\n const preference = getHarnessPreference();\n if (format === \"json\") {\n printJson(\n preference ?? {\n registered_harnesses: [],\n },\n );\n return;\n }\n if (!preference) {\n ui.dim(\"No harness preference configured.\");\n return;\n }\n ui.panel({\n title: [\"HARNESS\"],\n rows: [\n [\"Registered\", registeredHarnessesOf(preference).join(\", \") || \"(none)\"],\n [\n \"Plugin resources\",\n loadSettings(getHarnesstapDir()).harnessSync.pluginResources,\n ],\n ],\n });\n}\n\nasync function handleHarnessProjectSetCommand(opts: {\n project: string;\n harnesses?: string;\n main?: string;\n aliases?: string;\n materializationStrategy?: string;\n interactive?: boolean;\n noInteractive?: boolean;\n}): Promise<void> {\n const db = getDb();\n initializeSchema(db);\n const projectRoot = resolve(opts.project);\n const project = ensureProjectForRoot(projectRoot);\n\n const useWizard = shouldUseWizard({\n interactive: opts.interactive,\n noInteractive: opts.noInteractive,\n missingRequiredArgs: !opts.harnesses && !opts.main && !opts.aliases,\n });\n\n const selection = await resolveHarnessSelection({\n harnesses: parseHarnessList(opts.harnesses),\n main: opts.main,\n aliases: parseHarnessList(opts.aliases),\n nonInteractive: !useWizard,\n current: getProjectHarnessConfig(project.id),\n detected: detectPlatforms(projectRoot),\n });\n\n const saved = setProjectHarnessConfig({\n project_id: project.id,\n registered_harnesses: selection.registered_harnesses,\n ...(opts.materializationStrategy\n ? {\n materialization_strategy:\n opts.materializationStrategy === \"copy\" ? \"copy\" : \"symlink-preferred\",\n }\n : {}),\n });\n ui.success(\n `Set project harness preference ${ui.icons.hint} ${ui.theme.accent(registeredHarnessesOf(saved).join(\", \"))}`,\n );\n}\n\nasync function handleHarnessSyncCommand(opts: {\n project?: string;\n dryRun?: boolean;\n format?: string;\n pluginResources?: string;\n}): Promise<void> {\n const db = getDb();\n initializeSchema(db);\n const format = parseOutputFormat(opts.format);\n const scope = opts.project ? \"project\" : \"global\";\n const pluginResourceMode = opts.pluginResources\n ? parsePluginResourceMode(opts.pluginResources)\n : undefined;\n try {\n const result = await syncConfiguredHarnesses({\n scope,\n ...(opts.project ? { projectRoot: resolve(opts.project) } : {}),\n dryRun: opts.dryRun,\n ...(pluginResourceMode ? { pluginResourceMode } : {}),\n });\n if (format === \"json\") {\n printJson(result);\n return;\n }\n const verb = opts.dryRun ? \"Would sync\" : \"Synced\";\n ui.success(\n `${verb} ${result.platforms_synced.join(\", \")} ${ui.icons.hint} ${formatCount(result.files_written, \"file\")}`,\n );\n if (result.conflicts.length > 0) {\n ui.dim(\n `${formatCount(result.conflicts.length, \"conflict\")} resolved with last-write (newest on-disk copy)`,\n );\n }\n for (const warning of result.surface_warnings) {\n ui.warn(\n `${warning.harness} surface ${warning.path} is not rematerialized to ${warning.alias_harnesses.join(\", \")}: ${warning.message}`,\n );\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n process.exitCode = 1;\n fail(message, {\n hints: [formatCommand(\"harness set --harnesses <slugs>\")],\n });\n }\n}\n\nfunction handleHarnessProjectStatusCommand(opts: {\n project: string;\n format?: string;\n}): void {\n const db = getDb();\n initializeSchema(db);\n const format = parseOutputFormat(opts.format);\n const projectRoot = resolve(opts.project);\n const project = findProjectForRoot(projectRoot);\n const config = project ? getProjectHarnessConfig(project.id) : undefined;\n\n if (format === \"json\") {\n printJson(\n config ?? {\n registered_harnesses: [],\n materialization_strategy: \"symlink-preferred\",\n },\n );\n return;\n }\n\n if (!config) {\n ui.dim(\"No project harness preference configured.\");\n return;\n }\n\n ui.panel({\n title: [\"HARNESS\", \"project\"],\n rows: [\n [\"Registered\", registeredHarnessesOf(config).join(\", \") || \"(none)\"],\n [\"Materialization\", config.materialization_strategy],\n ],\n });\n}\n\nexport function registerHarnessCommands(root: Command): void {\n const harnessCmd = configureCommandGroup(\n root\n .command(\"harness\")\n .alias(\"h\")\n .description(\"Manage the registered harness set\"),\n );\n\n harnessCmd\n .command(\"list\")\n .alias(\"ls\")\n .option(\"--supported\", \"Only show natively serialized harnesses\")\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .description(\"List supported harnesses\")\n .action(handleHarnessListCommand);\n\n harnessCmd\n .command(\"set\")\n .option(\"--harnesses <slugs>\", \"Comma-separated registered harness slugs\")\n .addOption(new Option(\"--main <slug>\", \"Deprecated: prepended to the registered set\").hideHelp())\n .addOption(new Option(\"--aliases <slugs>\", \"Deprecated: appended to the registered set\").hideHelp())\n .option(\"--interactive\", \"Prompt instead of relying on explicit flags\")\n .description(\"Set global registered harnesses\")\n .action(handleHarnessSetCommand);\n\n harnessCmd\n .command(\"status\")\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .description(\"Show global harness preferences\")\n .action(handleHarnessStatusCommand);\n\n harnessCmd\n .command(\"sync\")\n .option(\"--project <path>\", \"Sync a git-backed project instead of home\")\n .option(\"--dry-run\", \"Show what would be written without writing files\")\n .option(\n \"--plugin-resources <mode>\",\n `How to materialize Cursor/Claude plugin files into .agents: symlink, copy, or clone (default ${DEFAULT_PLUGIN_RESOURCE_MODE}, or harnessSync.pluginResources in config.jsonc)`,\n )\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .description(\n \"Union resources from registered harnesses and materialize with last-write conflicts\",\n )\n .action(handleHarnessSyncCommand);\n\n const harnessProjectCmd = configureCommandGroup(\n harnessCmd\n .command(\"project\")\n .description(\"Manage harness preferences for a git-backed project\"),\n );\n\n harnessProjectCmd\n .command(\"set\")\n .option(\"--project <path>\", \"Project directory\", \".\")\n .option(\"--harnesses <slugs>\", \"Comma-separated registered harness slugs\")\n .addOption(new Option(\"--main <slug>\", \"Deprecated: prepended to the registered set\").hideHelp())\n .addOption(new Option(\"--aliases <slugs>\", \"Deprecated: appended to the registered set\").hideHelp())\n .option(\n \"--materialization-strategy <strategy>\",\n \"Materialization strategy: symlink-preferred or copy\",\n )\n .option(\"--interactive\", \"Prompt instead of relying on explicit flags\")\n .description(\"Set project-scoped registered harnesses\")\n .action(handleHarnessProjectSetCommand);\n\n harnessProjectCmd\n .command(\"status\")\n .option(\"--project <path>\", \"Project directory\", \".\")\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .description(\"Show project-scoped harness preferences\")\n .action(handleHarnessProjectStatusCommand);\n}\n","import { existsSync, statSync } from \"node:fs\";\nimport { isAbsolute, join, resolve } from \"node:path\";\nimport { loadSettings } from \"../config/settings.js\";\nimport { getHarnesstapDir } from \"../db/connection.js\";\nimport {\n getHarnessPreference,\n getProjectHarnessConfig,\n} from \"../models/harness.js\";\nimport { createSnapshot } from \"../models/snapshot.js\";\nimport { captureManagedSnapshotState } from \"./snapshot-capture.js\";\nimport type {\n CursorSkillMode,\n ResourceCreateInput,\n SerializerTarget,\n SurfaceWarning,\n} from \"../types.js\";\nimport { resolveHomeRoot } from \"../utils/home-root.js\";\nimport {\n type ApplyResult,\n generateFiles,\n materializeFiles,\n writeFiles,\n} from \"./applier.js\";\nimport {\n toPortableEmitResources,\n type UnionConflict,\n unionHarnessResources,\n} from \"./harness-resource-union.js\";\nimport {\n countHarnessSyncChanges,\n type HarnessSyncChangeCount,\n} from \"./harness-sync-preview.js\";\nimport { uniqueHarnessTargets } from \"./harness-targets.js\";\nimport {\n extractHostPluginMaterial,\n type ExtractHostPluginMaterialResult,\n materializeSkillHubPlan,\n planPluginSkillHub,\n portableHarnessesForPluginFanout,\n} from \"./host-plugin-material.js\";\nimport {\n applyInstructionLinks,\n pairInstructionFiles,\n} from \"./instruction-file-links.js\";\nimport { persistWrittenMaterializations } from \"./materialization-ownership.js\";\nimport { getPlatformSerializer } from \"./platform-serializers.js\";\nimport {\n DEFAULT_PLUGIN_RESOURCE_MODE,\n type PluginResourceMode,\n} from \"./plugin-resource-mode.js\";\nimport { resourceIdentity } from \"./reference-resources.js\";\nimport {\n dropPluginTranslatedResources,\n writeHarnessSyncPluginTranslationMarkers,\n} from \"./plugin-translation-marker.js\";\nimport {\n persistScanResults,\n scanPlatform,\n} from \"./scanner.js\";\nimport {\n collectManagedSkillPlacements,\n flattenUniqueFiles,\n pinSkillEmitsToExistingLivePaths,\n preferSharedSkillEmits,\n} from \"./shared-emit-paths.js\";\nimport { ensureProjectForRoot, findProjectForRoot } from \"./project-identity.js\";\n\nexport type HarnessUnionSyncCode =\n | \"no_registered_harnesses\"\n | \"need_two_harnesses\";\n\nexport class HarnessUnionSyncError extends Error {\n readonly code: HarnessUnionSyncCode;\n\n constructor(code: HarnessUnionSyncCode, message: string) {\n super(message);\n this.name = \"HarnessUnionSyncError\";\n this.code = code;\n }\n}\n\nexport interface SyncConfiguredHarnessesOptions {\n scope?: \"global\" | \"project\";\n projectRoot?: string;\n homeRoot?: string;\n dryRun?: boolean;\n pluginResourceMode?: PluginResourceMode;\n}\n\nexport interface SyncConfiguredHarnessesResult {\n registered_harnesses: string[];\n conflict_policy: \"last-write\";\n platforms_synced: string[];\n files_written: number;\n harness_changes: HarnessSyncChangeCount[];\n conflicts: UnionConflict[];\n files: string[];\n plugin_resource_mode: PluginResourceMode;\n surface_warnings: SurfaceWarning[];\n}\n\nfunction resolvePluginResourceMode(\n override?: PluginResourceMode,\n): PluginResourceMode {\n if (override) return override;\n try {\n return loadSettings(getHarnesstapDir()).harnessSync.pluginResources;\n } catch {\n return DEFAULT_PLUGIN_RESOURCE_MODE;\n }\n}\n\nfunction resolveConfiguredSelection(projectRoot?: string): {\n registered_harnesses: string[];\n cursor_skill_mode?: CursorSkillMode;\n} {\n const global = getHarnessPreference();\n const project = projectRoot ? findProjectForRoot(projectRoot) : undefined;\n if (project) {\n const projectConfig = getProjectHarnessConfig(project.id);\n const registered = uniqueHarnessTargets(\n projectConfig?.registered_harnesses ?? [],\n );\n if (registered.length > 0) {\n return {\n registered_harnesses: registered,\n ...(projectConfig?.cursor_skill_mode\n ? { cursor_skill_mode: projectConfig.cursor_skill_mode }\n : {}),\n };\n }\n }\n\n const registered = uniqueHarnessTargets(global?.registered_harnesses ?? []);\n if (registered.length === 0) {\n throw new HarnessUnionSyncError(\n \"no_registered_harnesses\",\n \"No harnesses configured. Run ht harness set --harnesses <slugs>.\",\n );\n }\n\n return { registered_harnesses: registered };\n}\n\nfunction resourceMtimeMs(rootPath: string, source: string): number | undefined {\n if (!source) return undefined;\n const full = isAbsolute(source) ? source : join(rootPath, source);\n try {\n if (!existsSync(full)) return undefined;\n return statSync(full).mtimeMs;\n } catch {\n return undefined;\n }\n}\n\nasync function scanConfiguredSlices(\n platformIds: readonly string[],\n target: SerializerTarget,\n rootPath: string,\n): Promise<Array<{\n platformId: string;\n resources: ResourceCreateInput[];\n mtimesMs: Map<string, number>;\n}>> {\n const slices = [];\n for (const platformId of platformIds) {\n let resources: ResourceCreateInput[];\n if (target === \"global\") {\n const serializer = getPlatformSerializer(platformId);\n const scanned = serializer.scanGlobal\n ? await serializer.scanGlobal(rootPath)\n : await serializer.scan(rootPath);\n resources = dropPluginTranslatedResources(rootPath, scanned);\n } else {\n const scan = await scanPlatform(platformId, rootPath);\n resources = scan.resources;\n }\n const mtimesMs = new Map<string, number>();\n for (const resource of resources) {\n const mtime = resourceMtimeMs(rootPath, resource.source);\n if (mtime !== undefined) {\n mtimesMs.set(resourceIdentity(resource), mtime);\n }\n }\n slices.push({ platformId, resources, mtimesMs });\n }\n return slices;\n}\n\n/**\n * Union resources from the registered harness set, resolve same-identity\n * conflicts with last-write, then materialize through existing serializers.\n */\nexport async function syncConfiguredHarnesses(\n options: SyncConfiguredHarnessesOptions = {},\n): Promise<SyncConfiguredHarnessesResult> {\n const scope = options.scope ?? \"global\";\n const target: SerializerTarget = scope === \"global\" ? \"global\" : \"project\";\n const projectRoot = options.projectRoot\n ? resolve(options.projectRoot)\n : undefined;\n const rootPath =\n target === \"global\"\n ? (options.homeRoot ?? resolveHomeRoot())\n : (projectRoot ?? resolve(\".\"));\n\n const selection = resolveConfiguredSelection(\n target === \"project\" ? rootPath : undefined,\n );\n const platforms = uniqueHarnessTargets(selection.registered_harnesses);\n if (platforms.length < 2) {\n throw new HarnessUnionSyncError(\n \"need_two_harnesses\",\n \"Add another harness to sync.\",\n );\n }\n\n const slices = await scanConfiguredSlices(platforms, target, rootPath);\n const unioned = unionHarnessResources(slices, \"last-write\");\n const emitResources = toPortableEmitResources(unioned.resources);\n const serializeOptions = selection.cursor_skill_mode\n ? { target, skillCursorMode: selection.cursor_skill_mode }\n : { target };\n const pluginResourceMode = resolvePluginResourceMode(options.pluginResourceMode);\n const portablePlatforms = portableHarnessesForPluginFanout(platforms);\n const homeRoot = options.homeRoot ?? resolveHomeRoot();\n\n const previousSkillPlacements = collectManagedSkillPlacements(rootPath);\n const skipSkillNames = new Set(previousSkillPlacements.keys());\n const pinFromPrevious = previousSkillPlacements.size > 0\n ? { previousManagedPlacements: previousSkillPlacements }\n : undefined;\n const generated = await generateFiles(\n emitResources,\n platforms,\n rootPath,\n pinFromPrevious\n ? { ...serializeOptions, ...pinFromPrevious }\n : serializeOptions,\n );\n const preferred = pinSkillEmitsToExistingLivePaths(\n rootPath,\n preferSharedSkillEmits(generated, platforms, target, { skipSkillNames }),\n platforms,\n target,\n pinFromPrevious,\n );\n\n const extraResults: ApplyResult[] = [];\n let skillHubPlans: ReturnType<typeof planPluginSkillHub> = [];\n let extracted: ExtractHostPluginMaterialResult = {\n skills: [],\n resources: [],\n resourcePlugins: new Map(),\n };\n if (target === \"global\" && portablePlatforms.length > 0) {\n const occupied = new Set(unioned.resources.map(resourceIdentity));\n extracted = await extractHostPluginMaterial(\n unioned.resources,\n homeRoot,\n occupied,\n );\n if (extracted.resources.length > 0) {\n const extraGenerated = await generateFiles(\n toPortableEmitResources(extracted.resources),\n portablePlatforms,\n rootPath,\n pinFromPrevious\n ? { ...serializeOptions, ...pinFromPrevious }\n : serializeOptions,\n );\n extraResults.push(\n ...pinSkillEmitsToExistingLivePaths(\n rootPath,\n preferSharedSkillEmits(extraGenerated, portablePlatforms, target, {\n skipSkillNames,\n }),\n portablePlatforms,\n target,\n pinFromPrevious,\n ),\n );\n }\n skillHubPlans = planPluginSkillHub(\n extracted.skills,\n portablePlatforms,\n target,\n );\n }\n\n const paired = pairInstructionFiles(\n flattenUniqueFiles([...preferred, ...extraResults]),\n pluginResourceMode,\n );\n const files = paired.files;\n const filePaths = [\n ...files.map((file) => file.path.replace(/\\\\/g, \"/\")),\n ...paired.links.map((link) => link.path),\n ...skillHubPlans.map((plan) => plan.skillMdPath),\n ].filter((path, index, all) => all.indexOf(path) === index);\n const harness_changes = countHarnessSyncChanges({\n platforms,\n slices,\n unionResources: unioned.resources,\n extracted,\n });\n\n const payload = {\n registered_harnesses: platforms,\n conflict_policy: \"last-write\" as const,\n platforms_synced: platforms,\n files_written: filePaths.length,\n harness_changes,\n conflicts: unioned.conflicts,\n files: filePaths,\n plugin_resource_mode: pluginResourceMode,\n surface_warnings: [...preferred, ...extraResults].flatMap(\n (result) => result.surface_warnings ?? [],\n ),\n };\n\n if (options.dryRun) {\n return payload;\n }\n\n let writtenByApply = new Set<string>();\n if (target === \"project\") {\n const project = ensureProjectForRoot(rootPath);\n createSnapshot({\n project_id: project.id,\n label: `Before harness sync (${platforms.join(\", \")})`,\n state: captureManagedSnapshotState({\n rootPath,\n resources: emitResources,\n generated: preferred,\n }),\n });\n writeFiles(files, rootPath);\n } else {\n const materialized = await materializeFiles(files, rootPath, {\n conflictPolicy: \"replace\",\n });\n writtenByApply = new Set(\n materialized.writtenFiles.map((path) => path.replace(/\\\\/g, \"/\")),\n );\n }\n applyInstructionLinks(rootPath, paired.links, pluginResourceMode);\n materializeSkillHubPlan(rootPath, skillHubPlans, pluginResourceMode);\n await writeHarnessSyncPluginTranslationMarkers({\n rootPath,\n scope: target === \"global\" ? \"global\" : \"project\",\n extracted,\n skillHubPlans,\n extraResults,\n portablePlatforms,\n target,\n serializeOptions,\n });\n\n persistWrittenMaterializations({\n scope: target === \"global\" ? \"global\" : \"project\",\n project_id: null,\n root_path: rootPath,\n platformResults: preferred.map((result: ApplyResult) => ({\n platformId: result.platformId,\n files: result.files,\n writtenPaths: result.files\n .map((file) => file.path.replace(/\\\\/g, \"/\"))\n .filter((path) =>\n target === \"project\"\n ? filePaths.includes(path)\n : writtenByApply.has(path),\n ),\n })),\n });\n\n const afterSlices = await scanConfiguredSlices(platforms, target, rootPath);\n persistScanResults(afterSlices, {\n conflictPolicy: \"overwrite\",\n originRef: rootPath,\n });\n\n return payload;\n}\n","import type { ResourceCreateInput } from \"../types.js\";\nimport { isClaudeLocalMcpResource } from \"./claude-local-mcp.js\";\nimport {\n type HarnessScanSlice,\n resourceFingerprint,\n} from \"./harness-resource-union.js\";\nimport {\n type ExtractHostPluginMaterialResult,\n isHostPluginTreePlatform,\n} from \"./host-plugin-material.js\";\nimport { isHostPluginPinResource } from \"./host-plugin-serialize.js\";\nimport { resourceIdentity } from \"./reference-resources.js\";\n\nexport interface HarnessSyncChangeCount {\n harness: string;\n changes: number;\n added: number;\n removed: number;\n modified: number;\n}\n\nexport interface CountHarnessSyncChangesInput {\n platforms: readonly string[];\n slices: readonly HarnessScanSlice[];\n unionResources: readonly ResourceCreateInput[];\n extracted: ExtractHostPluginMaterialResult;\n}\n\nfunction isHostPluginPin(resource: ResourceCreateInput): boolean {\n return isHostPluginPinResource({\n type: resource.type,\n metadata: resource.metadata,\n origin_ref: resource.origin_ref ?? \"\",\n });\n}\n\nfunction sliceByIdentity(\n slice: HarnessScanSlice | undefined,\n): Map<string, ResourceCreateInput> {\n const byIdentity = new Map<string, ResourceCreateInput>();\n if (!slice) return byIdentity;\n for (const resource of slice.resources) {\n byIdentity.set(resourceIdentity(resource), resource);\n }\n return byIdentity;\n}\n\nfunction sliceSkillNames(slice: HarnessScanSlice | undefined): Set<string> {\n const names = new Set<string>();\n if (!slice) return names;\n for (const resource of slice.resources) {\n if (resource.type === \"skill\") names.add(resource.name);\n }\n return names;\n}\n\nfunction skipPreviewResource(\n resource: ResourceCreateInput,\n portable: boolean,\n): boolean {\n if (isClaudeLocalMcpResource(resource)) return true;\n if (portable && isHostPluginPin(resource)) return true;\n return false;\n}\n\n/**\n * Count resources that would be added, removed, or updated on each harness.\n *\n * One `type:name:namespace` is one change, matching inventory rows. Host\n * plugin pins count as a single resource on Claude/Cursor; portable harnesses\n * get extracted plugin skills/resources instead of those pin trees.\n * `changes` is added + removed + modified.\n */\nexport function countHarnessSyncChanges(\n input: CountHarnessSyncChangesInput,\n): HarnessSyncChangeCount[] {\n const slices = new Map(\n input.slices.map((slice) => [slice.platformId, slice]),\n );\n\n return input.platforms.map((harness) => {\n const slice = slices.get(harness);\n const current = sliceByIdentity(slice);\n const skillNames = sliceSkillNames(slice);\n const portable = !isHostPluginTreePlatform(harness);\n const planned = new Set<string>();\n let added = 0;\n let modified = 0;\n let removed = 0;\n\n const consider = (resource: ResourceCreateInput): void => {\n if (skipPreviewResource(resource, portable)) return;\n const identity = resourceIdentity(resource);\n if (planned.has(identity)) return;\n planned.add(identity);\n const existing = current.get(identity);\n if (!existing) {\n added += 1;\n return;\n }\n if (resourceFingerprint(existing) !== resourceFingerprint(resource)) {\n modified += 1;\n }\n };\n\n for (const resource of input.unionResources) {\n consider(resource);\n }\n\n if (portable) {\n for (const resource of input.extracted.resources) {\n consider(resource);\n }\n for (const skill of input.extracted.skills) {\n const identity = `skill:${skill.name}:`;\n if (planned.has(identity)) continue;\n planned.add(identity);\n if (!skillNames.has(skill.name)) added += 1;\n }\n }\n\n for (const [identity, resource] of current) {\n if (skipPreviewResource(resource, portable)) continue;\n if (!planned.has(identity)) removed += 1;\n }\n\n return {\n harness,\n added,\n removed,\n modified,\n changes: added + removed + modified,\n };\n });\n}\n","import { mkdirSync } from \"node:fs\";\nimport { basename, dirname, join, relative } from \"node:path\";\nimport type { SerializedFile } from \"../types.js\";\nimport { materializeFromSource, replaceWithRelativeSymlink } from \"./link-materialize.js\";\nimport type { PluginResourceMode } from \"./plugin-resource-mode.js\";\n\nconst INSTRUCTION_BASENAMES = new Set([\"AGENTS.md\", \"CLAUDE.md\"]);\n\nexport interface InstructionLink {\n path: string;\n target: string;\n}\n\nexport interface PairedInstructionFiles {\n files: SerializedFile[];\n links: InstructionLink[];\n}\n\nfunction posixPath(path: string): string {\n return path.replace(/\\\\/g, \"/\");\n}\n\nfunction instructionBasename(path: string): string {\n return basename(posixPath(path));\n}\n\nfunction isInstructionFile(path: string): boolean {\n return INSTRUCTION_BASENAMES.has(instructionBasename(path));\n}\n\nfunction normalizeInstructionContent(content: string): string {\n return content.replace(/\\r\\n/g, \"\\n\").replace(/\\n+$/, \"\");\n}\n\nfunction pickCanonical(group: readonly SerializedFile[]): SerializedFile {\n const agents = group.find((file) => instructionBasename(file.path) === \"AGENTS.md\");\n if (agents) return agents;\n const first = group[0];\n if (!first) {\n throw new Error(\"instruction group is empty\");\n }\n return first;\n}\n\n/**\n * When CLAUDE.md and AGENTS.md would hold the same text, keep AGENTS.md as\n * the real file. Claude Code 2.1.277+ reads CLAUDE.md when that path exists\n * and ignores AGENTS.md by default, so a CLAUDE.md → AGENTS.md link gives\n * Claude the shared text without a second load. OpenCode reads AGENTS.md.\n *\n * `copy` keeps independent files. `symlink` links CLAUDE.md at AGENTS.md.\n * `clone` uses copy-on-write (falls back to copy).\n */\nexport function pairInstructionFiles(\n files: readonly SerializedFile[],\n mode: PluginResourceMode,\n): PairedInstructionFiles {\n if (mode === \"copy\") {\n return { files: [...files], links: [] };\n }\n\n const instruction = files.filter((file) => isInstructionFile(file.path));\n if (instruction.length < 2) {\n return { files: [...files], links: [] };\n }\n\n const rest = files.filter((file) => !isInstructionFile(file.path));\n const groups = new Map<string, SerializedFile[]>();\n for (const file of instruction) {\n const key = normalizeInstructionContent(file.content);\n const group = groups.get(key) ?? [];\n group.push(file);\n groups.set(key, group);\n }\n\n const filesOut: SerializedFile[] = [...rest];\n const links: InstructionLink[] = [];\n for (const group of groups.values()) {\n if (group.length === 1) {\n const only = group[0];\n if (only) filesOut.push(only);\n continue;\n }\n const canonical = pickCanonical(group);\n filesOut.push(canonical);\n for (const file of group) {\n if (posixPath(file.path) === posixPath(canonical.path)) continue;\n links.push({\n path: posixPath(file.path),\n target: posixPath(canonical.path),\n });\n }\n }\n\n return { files: filesOut, links };\n}\n\nexport function applyInstructionLinks(\n rootPath: string,\n links: readonly InstructionLink[],\n mode: PluginResourceMode,\n): void {\n if (mode === \"copy\" || links.length === 0) return;\n\n for (const link of links) {\n const dest = join(rootPath, link.path);\n const canonical = join(rootPath, link.target);\n mkdirSync(dirname(dest), { recursive: true });\n switch (mode) {\n case \"symlink\": {\n const relativeTarget = relative(dirname(dest), canonical) || basename(canonical);\n replaceWithRelativeSymlink(dest, relativeTarget);\n break;\n }\n case \"clone\":\n materializeFromSource(dest, canonical, \"clone\");\n break;\n default: {\n const exhaustive: never = mode;\n throw new Error(`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AmB,gCAAgC,OAAO,EACjE,YAAY,iCAAiC,EAC7C,OAAO,0BAA0B;AAEpC,aACG,QAAQ,MAAM,EACd,OAAO,oBAAoB,2CAA2C,EACtE,OAAO,aAAa,kDAAkD,EACtE;AAAA,IACC;AAAA,IACA,gGAAgG,4BAA4B;AAAA,EAC9H,EACC,OAAO,mBAAmB,gCAAgC,OAAO,EACjE;AAAA,IACC;AAAA,EACF,EACC,OAAO,wBAAwB;AAElC,QAAM,oBAAoB;AAAA,IACxB,WACG,QAAQ,SAAS,EACjB,YAAY,qDAAqD;AAAA,EACtE;AAEA,oBACG,QAAQ,KAAK,EACb,OAAO,oBAAoB,qBAAqB,GAAG,EACnD,OAAO,uBAAuB,0CAA0C,EACxE,UAAU,IAAI,OAAO,iBAAiB,6CAA6C,EAAE,SAAS,CAAC,EAC/F,UAAU,IAAI,OAAO,qBAAqB,4CAA4C,EAAE,SAAS,CAAC,EAClG;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,OAAO,iBAAiB,6CAA6C,EACrE,YAAY,yCAAyC,EACrD,OAAO,8BAA8B;AAExC,oBACG,QAAQ,QAAQ,EAChB,OAAO,oBAAoB,qBAAqB,GAAG,EACnD,OAAO,mBAAmB,gCAAgC,OAAO,EACjE,YAAY,yCAAyC,EACrD,OAAO,iCAAiC;AAC7C;","names":["resolve","join","registered","join","resolve"]}
@@ -5,7 +5,7 @@ import {
5
5
  import "./chunk-UEA4NCY2.js";
6
6
  import {
7
7
  PACKAGE_VERSION
8
- } from "./chunk-WQ3F4O7U.js";
8
+ } from "./chunk-LY7NVETO.js";
9
9
  import "./chunk-MKLJBW5N.js";
10
10
 
11
11
  // src/services/cli-help-registry.ts
@@ -1411,4 +1411,4 @@ export {
1411
1411
  renderRootHelpText,
1412
1412
  resolveCommandDescription
1413
1413
  };
1414
- //# sourceMappingURL=help-VIRMBOPJ.js.map
1414
+ //# sourceMappingURL=help-2WLAAUHJ.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/services/cli-help-registry.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 backend-qa --hide skill:review\",\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 details:\n \"For an imported plugin, skipped-files re-reads the installed package and fails for each file the import \"\n + \"skipped. The output lists imported of discovered resources per type. Exit 1 when the plugin is invalid.\",\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 + \"Also checks upstream links and pulled catalog packages for newer versions and stores \"\n + \"the answer for ht status and Desktop; a newer major shows as major and is never installed \"\n + \"automatically. 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 + \"Waits while the Desktop sidecar runs a scheduled check or install. After the first \"\n + \"successful --all in a terminal, asks once whether to keep plugins up to date.\",\n examples: [\n \"plugin update my-plugin\",\n \"plugin update --all --yes\",\n \"plugin update --all --yes --format json\",\n ],\n },\n \"notifications.list\": {\n description: \"List plugin update notifications (unread by default); same as ht notifications\",\n details:\n \"Notifications are written when a check finds a new version, when a parent plugin publishes, \"\n + \"when install mode updates a plugin, and when checks keep failing. The same version is never \"\n + \"notified twice. --all includes read ones. Nothing is deleted unless you run prune.\",\n examples: [\n \"notifications\",\n \"notifications list --all --format json\",\n ],\n },\n \"notifications.read\": {\n description: \"Mark a notification, or all of them, as read\",\n examples: [\"notifications read 01J9Z8K3M2\", \"notifications read --all\"],\n },\n \"notifications.prune\": {\n description: \"Delete read notifications older than an age, after confirmation\",\n details:\n \"Only read notifications are deleted; unread ones are kept. Asks before deleting in a terminal; \"\n + \"pass --yes otherwise.\",\n examples: [\"notifications prune --older-than 90d\", \"notifications prune --older-than 2w --yes\"],\n },\n \"plugin.auto-update\": {\n description: \"Show or change how plugin updates are checked and installed\",\n details:\n \"With no options, prints the current setting. --mode off stops background checks; notify \"\n + \"(the default) shows updates in ht status and Desktop; install also installs minor and \"\n + \"patch versions inside the range for pulled catalog plugins, never a major. --frequency \"\n + \"is hourly, daily (the default) or weekly. Stored under updates in ~/.harnesstap/config.jsonc.\",\n examples: [\n \"plugin auto-update\",\n \"plugin auto-update --mode install --frequency weekly\",\n \"plugin auto-update --mode off\",\n \"plugin auto-update --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.duplicate\": {\n description: \"Duplicate a profile, kept in sync with it or as a separate copy\",\n examples: [\n \"profile duplicate backend backend-qa\",\n \"profile duplicate backend backend-copy --copy\",\n ],\n },\n \"profile.detach\": {\n description: \"Stop keeping a profile in sync: its current items become its own (Library only)\",\n examples: [\"profile detach backend-qa\"],\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 details:\n \"A plugin import lists every file it skips (missing or invalid SKILL.md frontmatter, an invalid mcp.json server, \"\n + \"root rules/, instructions/ or mcp-servers/ directories) with its path and reason, and prints imported of \"\n + \"discovered resources per type. --strict refuses such a package and exits 1; it is the default when the \"\n + \"terminal is not interactive. --no-strict imports the rest anyway.\",\n examples: [\n \"migrate import backup.tar.gz\",\n \"migrate import ./my-plugin\",\n \"migrate import my-plugin.ap.json\",\n \"migrate import ./my-plugin --no-strict\",\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","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 | \"notifications\"\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: \"notifications\",\n description: \"List and mark plugin update notifications\",\n kind: \"group\",\n loader: \"notifications\",\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 \"notifications\",\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 const error = ensureErrorPrefix(message);\n console.error(error);\n const hints = opts?.hints ?? (opts?.hint ? [opts.hint] : []);\n // A hint that only repeats the error (for example a mapped git failure) is skipped.\n const printed = new Set([error]);\n for (const hint of hints) {\n if (hint.trim().length === 0) continue;\n const key = ensureErrorPrefix(hint);\n if (printed.has(key)) continue;\n printed.add(key);\n console.error(hint);\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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AAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,aAAa;AAAA,IACb,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,aAAa;AAAA,IACb,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,eAAe;AAAA,IACb,aAAa;AAAA,IACb,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,aACE;AAAA,IACF,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,aACE;AAAA,IACF,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,eAAe;AAAA,IACb,aACE;AAAA,IACF,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,aACE;AAAA,IACF,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,aACE;AAAA,IACF,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,aAAa;AAAA,IACb,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,SACE;AAAA,IACF,UAAU,C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ACxB;AAEA,aAAO,mBAAmB;AAAA,IAC5B;AAAA,EACF,CAAC;AACL;","names":[]}
1
+ {"version":3,"sources":["../src/services/cli-help-registry.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 backend-qa --hide skill:review\",\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 details:\n \"For an imported plugin, skipped-files re-reads the installed package and fails for each file the import \"\n + \"skipped. The output lists imported of discovered resources per type. Exit 1 when the plugin is invalid.\",\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 + \"Also checks upstream links and pulled catalog packages for newer versions and stores \"\n + \"the answer for ht status and Desktop; a newer major shows as major and is never installed \"\n + \"automatically. 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 + \"Waits while the Desktop sidecar runs a scheduled check or install. After the first \"\n + \"successful --all in a terminal, asks once whether to keep plugins up to date.\",\n examples: [\n \"plugin update my-plugin\",\n \"plugin update --all --yes\",\n \"plugin update --all --yes --format json\",\n ],\n },\n \"notifications.list\": {\n description: \"List plugin update notifications (unread by default); same as ht notifications\",\n details:\n \"Notifications are written when a check finds a new version, when a parent plugin publishes, \"\n + \"when install mode updates a plugin, and when checks keep failing. The same version is never \"\n + \"notified twice. --all includes read ones. Nothing is deleted unless you run prune.\",\n examples: [\n \"notifications\",\n \"notifications list --all --format json\",\n ],\n },\n \"notifications.read\": {\n description: \"Mark a notification, or all of them, as read\",\n examples: [\"notifications read 01J9Z8K3M2\", \"notifications read --all\"],\n },\n \"notifications.prune\": {\n description: \"Delete read notifications older than an age, after confirmation\",\n details:\n \"Only read notifications are deleted; unread ones are kept. Asks before deleting in a terminal; \"\n + \"pass --yes otherwise.\",\n examples: [\"notifications prune --older-than 90d\", \"notifications prune --older-than 2w --yes\"],\n },\n \"plugin.auto-update\": {\n description: \"Show or change how plugin updates are checked and installed\",\n details:\n \"With no options, prints the current setting. --mode off stops background checks; notify \"\n + \"(the default) shows updates in ht status and Desktop; install also installs minor and \"\n + \"patch versions inside the range for pulled catalog plugins, never a major. --frequency \"\n + \"is hourly, daily (the default) or weekly. Stored under updates in ~/.harnesstap/config.jsonc.\",\n examples: [\n \"plugin auto-update\",\n \"plugin auto-update --mode install --frequency weekly\",\n \"plugin auto-update --mode off\",\n \"plugin auto-update --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.duplicate\": {\n description: \"Duplicate a profile, kept in sync with it or as a separate copy\",\n examples: [\n \"profile duplicate backend backend-qa\",\n \"profile duplicate backend backend-copy --copy\",\n ],\n },\n \"profile.detach\": {\n description: \"Stop keeping a profile in sync: its current items become its own (Library only)\",\n examples: [\"profile detach backend-qa\"],\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 details:\n \"A plugin import lists every file it skips (missing or invalid SKILL.md frontmatter, an invalid mcp.json server, \"\n + \"root rules/, instructions/ or mcp-servers/ directories) with its path and reason, and prints imported of \"\n + \"discovered resources per type. --strict refuses such a package and exits 1; it is the default when the \"\n + \"terminal is not interactive. --no-strict imports the rest anyway.\",\n examples: [\n \"migrate import backup.tar.gz\",\n \"migrate import ./my-plugin\",\n \"migrate import my-plugin.ap.json\",\n \"migrate import ./my-plugin --no-strict\",\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","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 | \"notifications\"\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: \"notifications\",\n description: \"List and mark plugin update notifications\",\n kind: \"group\",\n loader: \"notifications\",\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 \"notifications\",\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 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 const error = ensureErrorPrefix(message);\n console.error(error);\n const hints = opts?.hints ?? (opts?.hint ? [opts.hint] : []);\n // A hint that only repeats the error (for example a mapped git failure) is skipped.\n const printed = new Set([error]);\n for (const hint of hints) {\n if (hint.trim().length === 0) continue;\n const key = ensureErrorPrefix(hint);\n if (printed.has(key)) continue;\n printed.add(key);\n console.error(hint);\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 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,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,UAAU;AAAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,aAAa;AAAA,IACb,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,eAAe;AAAA,IACb,aAAa;AAAA,IACb,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,aACE;AAAA,IACF,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,aACE;AAAA,IACF,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,eAAe;AAAA,IACb,aACE;AAAA,IACF,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,aACE;AAAA,IACF,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,aACE;AAAA,IACF,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,aAAa;AAAA,IACb,SACE;AAAA,IACF,UAAU;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,SACE;AAAA,IACF,UAAU,CAAC,mBAAmB,wBAAwB;AAAA,EACxD;AAAA,EACA,kBAAkB;AAAA,IAChB,aAAa;AAAA,IACb,SACE;AAAA,IACF,UAA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