agents-inc 0.156.0 → 0.158.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/{chunk-4A4L3YIW.js → chunk-2PN4QXON.js} +6 -7
  3. package/dist/chunk-2PN4QXON.js.map +1 -0
  4. package/dist/{chunk-QWVXOCXO.js → chunk-3NBXQSW2.js} +7 -9
  5. package/dist/{chunk-QWVXOCXO.js.map → chunk-3NBXQSW2.js.map} +1 -1
  6. package/dist/{chunk-WCAUUBHO.js → chunk-3PJLLBUS.js} +14597 -14536
  7. package/dist/chunk-3PJLLBUS.js.map +1 -0
  8. package/dist/{chunk-6RLV45HN.js → chunk-3Q2N7CSY.js} +6 -6
  9. package/dist/chunk-3Q2N7CSY.js.map +1 -0
  10. package/dist/{chunk-LJCNUP6M.js → chunk-4ABNXKAR.js} +2 -2
  11. package/dist/{chunk-D2CAV7MG.js → chunk-4DMFK67G.js} +2 -2
  12. package/dist/{chunk-MO5FGLVS.js → chunk-54QLV3OH.js} +11 -12
  13. package/dist/chunk-54QLV3OH.js.map +1 -0
  14. package/dist/{chunk-5F2YR5XV.js → chunk-6DBE562W.js} +15 -5
  15. package/dist/chunk-6DBE562W.js.map +1 -0
  16. package/dist/{chunk-RWOYPOMR.js → chunk-7Z4N4JWQ.js} +19 -245
  17. package/dist/chunk-7Z4N4JWQ.js.map +1 -0
  18. package/dist/{chunk-H6UTKTLK.js → chunk-DAUY2SB3.js} +98 -34
  19. package/dist/chunk-DAUY2SB3.js.map +1 -0
  20. package/dist/{chunk-2H7UWE2G.js → chunk-DP6YQFVO.js} +13 -12
  21. package/dist/chunk-DP6YQFVO.js.map +1 -0
  22. package/dist/{chunk-ILUVL7WM.js → chunk-DZD25NHW.js} +2 -2
  23. package/dist/{chunk-PCC4LBKB.js → chunk-EEAX7E2X.js} +2 -2
  24. package/dist/{chunk-IO5YBKHV.js → chunk-G6G2FT2G.js} +10 -8
  25. package/dist/chunk-G6G2FT2G.js.map +1 -0
  26. package/dist/{chunk-5QZAK6J7.js → chunk-H25VRR2T.js} +50 -18
  27. package/dist/chunk-H25VRR2T.js.map +1 -0
  28. package/dist/chunk-H2DHTJKW.js +1352 -0
  29. package/dist/chunk-H2DHTJKW.js.map +1 -0
  30. package/dist/{chunk-MHRC3KRX.js → chunk-H4CL23HG.js} +3 -3
  31. package/dist/chunk-H4CL23HG.js.map +1 -0
  32. package/dist/{chunk-F5T6TV4Z.js → chunk-IK6YOXZH.js} +40 -14
  33. package/dist/chunk-IK6YOXZH.js.map +1 -0
  34. package/dist/{chunk-HG4JPXJT.js → chunk-JG3B47P3.js} +23 -10
  35. package/dist/chunk-JG3B47P3.js.map +1 -0
  36. package/dist/{chunk-SY4X2LND.js → chunk-KUZBMEWR.js} +3 -3
  37. package/dist/{chunk-5OKLCVM4.js → chunk-KVVXINCJ.js} +3 -3
  38. package/dist/{chunk-PNMM5HNX.js → chunk-L4FHSOL5.js} +9 -10
  39. package/dist/chunk-L4FHSOL5.js.map +1 -0
  40. package/dist/{chunk-PMUABBPG.js → chunk-LKI3ENGQ.js} +9 -13
  41. package/dist/chunk-LKI3ENGQ.js.map +1 -0
  42. package/dist/{chunk-CLFHC2DK.js → chunk-OQB2CKBT.js} +17 -18
  43. package/dist/chunk-OQB2CKBT.js.map +1 -0
  44. package/dist/{chunk-HXKOIWLU.js → chunk-P6OKOH62.js} +2 -6
  45. package/dist/chunk-P6OKOH62.js.map +1 -0
  46. package/dist/{chunk-TNGMF4UX.js → chunk-PNRLBPGS.js} +12 -12
  47. package/dist/chunk-PNRLBPGS.js.map +1 -0
  48. package/dist/{chunk-Y5Y7XHVU.js → chunk-PZNXBORZ.js} +4 -4
  49. package/dist/{chunk-HTYH7CKN.js → chunk-Q7CAE5NN.js} +3 -3
  50. package/dist/{chunk-G47TDUK3.js → chunk-QNAMXQKF.js} +2 -2
  51. package/dist/{chunk-GS2NZ3GD.js → chunk-SJ4T5YLG.js} +5 -5
  52. package/dist/chunk-SJ4T5YLG.js.map +1 -0
  53. package/dist/{chunk-UMH2YZKG.js → chunk-TPQ5M3BW.js} +4 -6
  54. package/dist/{chunk-UMH2YZKG.js.map → chunk-TPQ5M3BW.js.map} +1 -1
  55. package/dist/{chunk-4G2YHZIM.js → chunk-TUXXBEBB.js} +4 -6
  56. package/dist/{chunk-4G2YHZIM.js.map → chunk-TUXXBEBB.js.map} +1 -1
  57. package/dist/{chunk-WFRTHH3A.js → chunk-TZRXWFF5.js} +3 -3
  58. package/dist/{chunk-TBOVYLQJ.js → chunk-VTIDLRNA.js} +2 -2
  59. package/dist/{chunk-OKH64JZE.js → chunk-WCZNQECQ.js} +2 -2
  60. package/dist/{chunk-ZUAZHDKP.js → chunk-WMVOJY6V.js} +277 -40
  61. package/dist/chunk-WMVOJY6V.js.map +1 -0
  62. package/dist/{chunk-YO2LTXB4.js → chunk-X52QUV4U.js} +115 -10
  63. package/dist/chunk-X52QUV4U.js.map +1 -0
  64. package/dist/{chunk-IXRZAHZF.js → chunk-XNYHMRVJ.js} +4 -4
  65. package/dist/{chunk-VPASBA7P.js → chunk-YXI3BTQQ.js} +2 -2
  66. package/dist/commands/build/marketplace.js +9 -12
  67. package/dist/commands/build/marketplace.js.map +1 -1
  68. package/dist/commands/build/plugins.js +9 -12
  69. package/dist/commands/build/plugins.js.map +1 -1
  70. package/dist/commands/compile.js +15 -19
  71. package/dist/commands/compile.js.map +1 -1
  72. package/dist/commands/doctor.js +75 -54
  73. package/dist/commands/doctor.js.map +1 -1
  74. package/dist/commands/edit.js +154 -109
  75. package/dist/commands/edit.js.map +1 -1
  76. package/dist/commands/eject.js +68 -38
  77. package/dist/commands/eject.js.map +1 -1
  78. package/dist/commands/init.js +36 -39
  79. package/dist/commands/list.js +8 -10
  80. package/dist/commands/list.js.map +1 -1
  81. package/dist/commands/new/marketplace.js +8 -11
  82. package/dist/commands/new/marketplace.js.map +1 -1
  83. package/dist/commands/search.js +10 -13
  84. package/dist/commands/search.js.map +1 -1
  85. package/dist/commands/share.js +8 -10
  86. package/dist/commands/share.js.map +1 -1
  87. package/dist/commands/uninstall.js +39 -28
  88. package/dist/commands/uninstall.js.map +1 -1
  89. package/dist/commands/update.js +7 -10
  90. package/dist/commands/update.js.map +1 -1
  91. package/dist/components/common/removal-plan-confirm.js +2 -2
  92. package/dist/components/common/select-list.js +2 -2
  93. package/dist/components/wizard/category-grid.js +4 -5
  94. package/dist/components/wizard/checkbox-grid.js +4 -4
  95. package/dist/components/wizard/domain-selection.js +9 -11
  96. package/dist/components/wizard/run-wizard-session.js +26 -28
  97. package/dist/components/wizard/scroll-affordance.js +2 -2
  98. package/dist/components/wizard/skill-agent-summary.js +5 -7
  99. package/dist/components/wizard/source-grid.js +5 -6
  100. package/dist/components/wizard/stack-selection.js +7 -9
  101. package/dist/components/wizard/step-agents.js +8 -10
  102. package/dist/components/wizard/step-build.js +7 -9
  103. package/dist/components/wizard/step-confirm.js +9 -11
  104. package/dist/components/wizard/step-sources.js +8 -10
  105. package/dist/components/wizard/step-stack.js +8 -10
  106. package/dist/components/wizard/summary-panel.js +8 -10
  107. package/dist/components/wizard/toast.js +2 -2
  108. package/dist/components/wizard/wizard-layout.js +12 -14
  109. package/dist/components/wizard/wizard-tabs.js +2 -4
  110. package/dist/components/wizard/wizard.js +25 -27
  111. package/dist/hooks/init.js +36 -39
  112. package/dist/hooks/init.js.map +1 -1
  113. package/dist/load-agent-defs-2VYAV5GL.js +13 -0
  114. package/dist/recompile-project-agents-NG5DCPHJ.js +17 -0
  115. package/dist/{source-loader-3DL3NYUX.js → source-loader-CO2FZ3OO.js} +4 -8
  116. package/dist/src/agents/_templates/agent.liquid +2 -2
  117. package/dist/stores/wizard-store.js +6 -6
  118. package/package.json +2 -4
  119. package/src/agents/_templates/agent.liquid +2 -2
  120. package/src/schemas/custom-metadata.schema.json +1 -1
  121. package/src/schemas/marketplace.schema.json +2 -1
  122. package/dist/chunk-2H7UWE2G.js.map +0 -1
  123. package/dist/chunk-4A4L3YIW.js.map +0 -1
  124. package/dist/chunk-5F2YR5XV.js.map +0 -1
  125. package/dist/chunk-5QZAK6J7.js.map +0 -1
  126. package/dist/chunk-6RLV45HN.js.map +0 -1
  127. package/dist/chunk-CLFHC2DK.js.map +0 -1
  128. package/dist/chunk-F2AMBBIA.js +0 -64
  129. package/dist/chunk-F2AMBBIA.js.map +0 -1
  130. package/dist/chunk-F5T6TV4Z.js.map +0 -1
  131. package/dist/chunk-GS2NZ3GD.js.map +0 -1
  132. package/dist/chunk-H6UTKTLK.js.map +0 -1
  133. package/dist/chunk-HG4JPXJT.js.map +0 -1
  134. package/dist/chunk-HXKOIWLU.js.map +0 -1
  135. package/dist/chunk-IO5YBKHV.js.map +0 -1
  136. package/dist/chunk-MHRC3KRX.js.map +0 -1
  137. package/dist/chunk-MO5FGLVS.js.map +0 -1
  138. package/dist/chunk-PMUABBPG.js.map +0 -1
  139. package/dist/chunk-PNMM5HNX.js.map +0 -1
  140. package/dist/chunk-RWOYPOMR.js.map +0 -1
  141. package/dist/chunk-TNGMF4UX.js.map +0 -1
  142. package/dist/chunk-VASLW636.js +0 -23
  143. package/dist/chunk-VASLW636.js.map +0 -1
  144. package/dist/chunk-WCAUUBHO.js.map +0 -1
  145. package/dist/chunk-WUQ3MTPF.js +0 -173
  146. package/dist/chunk-WUQ3MTPF.js.map +0 -1
  147. package/dist/chunk-XAXJWXI4.js +0 -1667
  148. package/dist/chunk-XAXJWXI4.js.map +0 -1
  149. package/dist/chunk-YO2LTXB4.js.map +0 -1
  150. package/dist/chunk-ZUAZHDKP.js.map +0 -1
  151. package/dist/copy-local-skills-NSUTBVLJ.js +0 -14
  152. package/dist/load-agent-defs-X4E57I2U.js +0 -15
  153. package/dist/loader-G6BFG2VA.js +0 -24
  154. package/dist/recompile-project-agents-JE4MM72I.js +0 -20
  155. package/dist/recompile-project-agents-JE4MM72I.js.map +0 -1
  156. package/dist/source-loader-3DL3NYUX.js.map +0 -1
  157. /package/dist/{chunk-LJCNUP6M.js.map → chunk-4ABNXKAR.js.map} +0 -0
  158. /package/dist/{chunk-D2CAV7MG.js.map → chunk-4DMFK67G.js.map} +0 -0
  159. /package/dist/{chunk-ILUVL7WM.js.map → chunk-DZD25NHW.js.map} +0 -0
  160. /package/dist/{chunk-PCC4LBKB.js.map → chunk-EEAX7E2X.js.map} +0 -0
  161. /package/dist/{chunk-SY4X2LND.js.map → chunk-KUZBMEWR.js.map} +0 -0
  162. /package/dist/{chunk-5OKLCVM4.js.map → chunk-KVVXINCJ.js.map} +0 -0
  163. /package/dist/{chunk-Y5Y7XHVU.js.map → chunk-PZNXBORZ.js.map} +0 -0
  164. /package/dist/{chunk-HTYH7CKN.js.map → chunk-Q7CAE5NN.js.map} +0 -0
  165. /package/dist/{chunk-G47TDUK3.js.map → chunk-QNAMXQKF.js.map} +0 -0
  166. /package/dist/{chunk-WFRTHH3A.js.map → chunk-TZRXWFF5.js.map} +0 -0
  167. /package/dist/{chunk-TBOVYLQJ.js.map → chunk-VTIDLRNA.js.map} +0 -0
  168. /package/dist/{chunk-OKH64JZE.js.map → chunk-WCZNQECQ.js.map} +0 -0
  169. /package/dist/{chunk-IXRZAHZF.js.map → chunk-XNYHMRVJ.js.map} +0 -0
  170. /package/dist/{chunk-VPASBA7P.js.map → chunk-YXI3BTQQ.js.map} +0 -0
  171. /package/dist/{copy-local-skills-NSUTBVLJ.js.map → load-agent-defs-2VYAV5GL.js.map} +0 -0
  172. /package/dist/{load-agent-defs-X4E57I2U.js.map → recompile-project-agents-NG5DCPHJ.js.map} +0 -0
  173. /package/dist/{loader-G6BFG2VA.js.map → source-loader-CO2FZ3OO.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/consts.ts"],"sourcesContent":["import os from \"os\";\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\nimport type { Domain, InstallMode } from \"./types/index.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\n// After tsup build, dist/ is flat, so we go up one level from dist/ to get CLI root\n// In development (src/cli/consts.ts), we go up two levels\nconst isInDist = __dirname.includes(\"/dist\");\nconst CLI_ROOT = isInDist ? path.resolve(__dirname, \"..\") : path.resolve(__dirname, \"../..\");\nexport const PROJECT_ROOT = CLI_ROOT;\n\nexport const CLAUDE_DIR = \".claude\";\nexport const CLAUDE_SRC_DIR = \".claude-src\";\nexport const PLUGINS_SUBDIR = \"plugins\";\nexport const PLUGIN_MANIFEST_DIR = \".claude-plugin\";\nexport const PLUGIN_MANIFEST_FILE = \"plugin.json\";\nexport const MARKETPLACE_JSON = \"marketplace.json\";\n\n/**\n * The catalogue a marketplace publishes beside its manifest — its whole matrix\n * as JSON, in the shape `@workspace/matrix`'s `matrixSchema` describes.\n *\n * `marketplace.json` lists what a marketplace installs; this lists what it\n * OFFERS — every skill, category and stack, with the relationships resolved. The\n * editor fetches it directly and parses it with that schema, so nothing between\n * the two transforms it.\n */\nexport const CATALOG_JSON = \"catalog.json\";\n\n/**\n * What `generatedAt` says on a matrix that was WRITTEN to disk rather than built\n * in memory — a fixed word where the live matrix carries an ISO timestamp.\n *\n * A moment recorded in a committed artefact makes every regeneration a diff even\n * when nothing about the matrix moved, which costs the vendored\n * `types/generated/matrix.ts` a pull request of pure noise and costs\n * {@link CATALOG_JSON} its cache: the editor fetches the catalogue directly, and\n * a file whose bytes always change can never answer a conditional request.\n * Nothing reads the field back, so there is nothing a real timestamp would buy.\n *\n * Both emitters — `scripts/generate-source-types.ts` and `build marketplace` —\n * stamp this, and they are the only two places a matrix becomes a file.\n */\nexport const GENERATED_AT_BUILD = \"build\";\n\n/** Compiled plugin output directory, relative to a marketplace root */\nexport const PLUGINS_DIST_PATH = \"dist/plugins\";\n\n/** Path to the marketplace manifest inside a marketplace/source root. */\nexport function marketplaceManifestPath(dir: string): string {\n return path.join(dir, PLUGIN_MANIFEST_DIR, MARKETPLACE_JSON);\n}\nexport const DEFAULT_PLUGIN_NAME = \"agents-inc\";\n\n/**\n * Home directory used as the root for global installations, read when it is asked for.\n *\n * A `const` here froze whichever home was in force when this module was first imported, and the\n * damage was invisible: `runCliCommand` drives oclif through `dist/`, a SECOND module graph first\n * imported by whichever spec runs a command first, so the value settled on that spec's fake home\n * and every later spec in the file wrote under a directory its own `afterEach` had removed — the\n * writes succeeding, into the wrong tree. In the `src` graph it was worse still: `consts.ts` is\n * imported while vitest collects, before any hook has redirected the home, so the constant held\n * the DEVELOPER'S own home in every unit test that read it.\n *\n * Every other home-dir reader in the codebase already calls `os.homedir()` at call time —\n * `installBaseDir`, `isHomeDirectory`, `globalPairPaths` — each with its own note saying why.\n * This is that rule arriving at the constants file, and `home-dir-read-at-call-time.test.ts`\n * refuses the frozen shape from coming back.\n */\nexport function globalInstallRoot(): string {\n return os.homedir();\n}\n\n/** Root of the CLI's own cache, read at call time for the reason {@link globalInstallRoot} carries. */\nexport function cacheRoot(): string {\n return path.join(os.homedir(), \".cache\", DEFAULT_PLUGIN_NAME);\n}\n\n/**\n * Promoted invocation prefix shown in user-facing messages (e.g. \"Run '<CLI_INVOKE_COMMAND> init'\").\n *\n * `bin` in package.json registers BOTH names — `agents-inc` (primary, matching this constant and\n * the package name) and `agentsinc` (kept so existing global installs keep working). A global\n * install therefore answers to either spelling.\n *\n * `agents-inc` rather than `agentsinc` because it is the published package name, so `npx\n * agents-inc` resolves with nothing installed, and it is what agentsinc.sh hands people when they\n * copy an install command.\n *\n * CONVENTION: every user-facing instruction in this repo — messages, docs, code comments, agent\n * playbooks — writes commands in this `npx agents-inc <cmd>` form. Prose that merely names a\n * command (\"the `agents-inc list` table\") does not.\n */\nexport const CLI_INVOKE_COMMAND = \"npx agents-inc\";\n\n/**\n * The editor — the web half of the product, where a configuration is built without the wizard\n * and handed to `init --from <id>`. `agentsinc.sh` is the editor Worker's custom domain\n * (`apps/editor/wrangler.jsonc`); the config store it posts to is the sibling\n * `api.agentsinc.sh`, spelled once in `lib/seed/fetch-seed.ts` because that one is\n * overridable for tests and this one is not.\n */\nexport const EDITOR_URL = \"https://agentsinc.sh\";\n\n/**\n * Where a shared configuration opens in the editor — the form the editor's own Share button\n * copies, so a link the CLI prints and one the web app hands out are the same link.\n *\n * Exported before it had a second caller, and now it has two: `share` prints it, and\n * `edit --ui` hands it to a browser. Two surfaces each building their own query string is\n * exactly how one of them ends up pointing at a page the other never opens.\n */\nexport function editorConfigUrl(id: string): string {\n return `${EDITOR_URL}/?fromId=${encodeURIComponent(id)}`;\n}\n\n/**\n * Internal `edit` flag marking the invocation as the project-setup half of a `cc init`\n * that routed through the dashboard. Not part of the documented CLI surface (declared\n * `hidden`): `init` is the only caller, and it passes the flag so `edit` can tell\n * \"set this project up\" apart from a bare inspection.\n */\nexport const EDIT_PROJECT_SETUP_FLAG = \"project-setup\";\n\nexport const SKILL_CATEGORIES_PATH = \"config/skill-categories.ts\";\nexport const SKILL_RULES_PATH = \"config/skill-rules.ts\";\nexport const STACKS_FILE_PATH = \"config/stacks.ts\";\n/** Source root directory inside a marketplace/source repo (holds skills/, agents/, etc.). */\nexport const SOURCE_SRC_DIR = \"src\";\nexport const SKILLS_DIR_PATH = `${SOURCE_SRC_DIR}/skills`;\nexport const LOCAL_SKILLS_PATH = \".claude/skills\";\n\n/** Synthetic source name for skills copied into the project (ejected) rather than installed as plugins. */\nexport const EJECT_SOURCE = \"eject\";\n\n/** Pseudo-category assigned to local skills — not a `Category` union member; category traversals skip it. */\nexport const LOCAL_PSEUDO_CATEGORY = \"local\";\n\nexport const DIRS = {\n agents: \"src/agents\",\n skills: SKILLS_DIR_PATH,\n stacks: \"src/stacks\",\n templates: \"src/agents/_templates\",\n} as const;\n\n/** Single source for the metadata file name shared by skill and agent metadata. */\nconst METADATA_YAML_FILE = \"metadata.yaml\";\n\nexport const STANDARD_FILES = {\n SKILL_MD: \"SKILL.md\",\n METADATA_YAML: METADATA_YAML_FILE,\n METADATA_JSON: \"metadata.json\",\n CONFIG_YAML: \"config.yaml\",\n SKILL_CATEGORIES_TS: \"skill-categories.ts\",\n SKILL_RULES_TS: \"skill-rules.ts\",\n AGENT_METADATA_YAML: METADATA_YAML_FILE,\n PLUGIN_JSON: PLUGIN_MANIFEST_FILE,\n CONFIG_TS: \"config.ts\",\n CONFIG_TYPES_TS: \"config-types.ts\",\n CLAUDE_MD: \"CLAUDE.md\",\n README_MD: \"README.md\",\n REFERENCE_MD: \"reference.md\",\n IDENTITY_MD: \"identity.md\",\n PLAYBOOK_MD: \"playbook.md\",\n OUTPUT_MD: \"output.md\",\n CRITICAL_REQUIREMENTS_MD: \"critical-requirements.md\",\n CRITICAL_REMINDERS_MD: \"critical-reminders.md\",\n SETTINGS_JSON: \"settings.json\",\n SETTINGS_LOCAL_JSON: \"settings.local.json\",\n PACKAGE_JSON: \"package.json\",\n} as const;\n\nexport const STANDARD_DIRS = {\n EXAMPLES: \"examples\",\n SCRIPTS: \"scripts\",\n SKILLS: \"skills\",\n AGENTS: \"agents\",\n /** Legacy per-project template override directory (`.claude/templates`). */\n TEMPLATES: \"templates\",\n} as const;\n\nexport const DEFAULT_VERSION = \"1.0.0\";\n\n// \"0.0.0\" indicates no version was explicitly set\nexport const DEFAULT_DISPLAY_VERSION = \"0.0.0\";\n\n// JSON Schema URLs for yaml-language-server $schema comments.\n// Uses raw.githubusercontent.com so schemas resolve without requiring the CLI as a dependency.\n// The prefix encodes two things that have each moved once: the repository name (renamed to\n// agents-inc/agents-inc on 2026-08-04, when it stopped being only the CLI) and this package's\n// location inside it (packages/cli, since the monorepo merge). If either moves again this must\n// move with it, or every generated $schema comment 404s. GitHub redirects the old forms — files\n// written before each move still resolve, verified two renames deep — but a redirect is a\n// courtesy, so what we emit should be the current address rather than rely on one.\nconst SCHEMA_PKG_PREFIX =\n \"https://raw.githubusercontent.com/agents-inc/agents-inc/main/packages/cli/src/schemas\";\n\nexport const SCHEMA_PATHS = {\n agent: `${SCHEMA_PKG_PREFIX}/agent.schema.json`,\n metadata: `${SCHEMA_PKG_PREFIX}/metadata.schema.json`,\n customMetadata: `${SCHEMA_PKG_PREFIX}/custom-metadata.schema.json`,\n marketplace: `${SCHEMA_PKG_PREFIX}/marketplace.schema.json`,\n projectConfig: `${SCHEMA_PKG_PREFIX}/project-config.schema.json`,\n projectSourceConfig: `${SCHEMA_PKG_PREFIX}/project-source-config.schema.json`,\n stacks: `${SCHEMA_PKG_PREFIX}/stacks.schema.json`,\n} as const;\n\nexport const YAML_FORMATTING = {\n INDENT: 2,\n LINE_WIDTH: 120,\n /** lineWidth: 0 disables wrapping — used for metadata files */\n LINE_WIDTH_NONE: 0,\n} as const;\n\n// Shared glyphs: SELECTED/CHECK render the same checkmark; SKIPPED/DISABLED the\n// same en-dash. Both keys are kept so call sites express intent, but the value\n// has a single source.\nconst CHECK_GLYPH = \"\\u2713\";\nconst EN_DASH_GLYPH = \"\\u2013\";\n\nexport const UI_SYMBOLS = {\n CHECKBOX_CHECKED: \"[x]\",\n CHECKBOX_UNCHECKED: \"[ ]\",\n CHEVRON: \"\\u276F\",\n CHEVRON_SPACER: \" \",\n SELECTED: CHECK_GLYPH,\n UNSELECTED: \"\\u25CB\",\n CURRENT: \"\\u25CF\",\n SKIPPED: EN_DASH_GLYPH,\n DISCOURAGED: \"!\",\n DISABLED: EN_DASH_GLYPH,\n LOCK: \"\\uD83D\\uDD12\",\n EJECT: \"\\u23CF\",\n BULLET: \"\\u2022\",\n SCROLL_UP: \"\\u25B2\",\n SCROLL_DOWN: \"\\u25BC\",\n CHECK: CHECK_GLYPH,\n CROSS: \"\\u2717\",\n /** Removed/pending-removal diff marker (ASCII hyphen). Info panel + Sources tab share it. */\n REMOVED: \"-\",\n /** Added/newly-selected diff marker (ASCII plus). Info panel + Sources tab share it. */\n ADDED: \"+\",\n} as const;\n\nexport const GITHUB_SOURCE = {\n HTTPS_PREFIX: \"https://github.com/\",\n GITHUB_PREFIX: \"github:\",\n GH_PREFIX: \"gh:\",\n} as const;\n\n/** Name written into a global-scope config's `name` field (`~/.claude-src/config.ts`). */\nexport const GLOBAL_CONFIG_NAME = \"global\";\n\n/** Strict kebab-case: starts with letter, segments separated by single hyphens, no trailing hyphens */\nexport const KEBAB_CASE_PATTERN = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;\n\n/** Author handle format: `@` followed by a lowercase-led alphanumeric-hyphen slug. */\nexport const AUTHOR_HANDLE_PATTERN = /^@[a-z][a-z0-9-]*$/;\n\nexport const HASH_PREFIX_LENGTH = 7;\n\n/** Hex chars from SHA-256 hash used in cache directory names (64 bits of collision resistance) */\nexport const CACHE_HASH_LENGTH = 16;\n\n/** Max chars of human-readable prefix in cache directory names (for debugging) */\nexport const CACHE_READABLE_PREFIX_LENGTH = 32;\n\n// File size limits for parsing boundaries (DoS prevention)\nconst ONE_MB = 1024 * 1024;\nexport const MAX_MARKETPLACE_FILE_SIZE = 10 * ONE_MB;\nexport const MAX_PLUGIN_FILE_SIZE = ONE_MB;\nexport const MAX_CONFIG_FILE_SIZE = ONE_MB;\n\nexport const MAX_JSON_NESTING_DEPTH = 10;\nexport const MAX_MARKETPLACE_PLUGINS = 10_000;\n\nexport const SCROLL_VIEWPORT = {\n /** Height of the \"N more above\" scroll indicator */\n SCROLL_INDICATOR_HEIGHT: 1,\n /** Estimated lines per category name row (including top margin) */\n CATEGORY_NAME_LINES: 2,\n /** Margin between category sections (marginTop on CategorySection) */\n CATEGORY_MARGIN_LINES: 1,\n /** Minimum rows to show at least 1 category before enabling scroll */\n MIN_VIEWPORT_ROWS: 5,\n} as const;\n\n/**\n * The terminal geometry every command refuses to run below. This is the only\n * minimum-size gate there is: `BaseCommand.ensureTerminalSize` reads it and\n * blocks until the terminal is at least this big, so raising `ROWS` raises the\n * bar for the whole CLI, tests included.\n *\n * `ROWS: 20` is measured, not guessed. Driving the real binary to the build\n * step — the binding constraint, since it is the tallest step — gives:\n * 15/16/17 corrupt (overlapping card borders, unreadable); 18 the first clean\n * render (one complete category card, correctly clipped); 20 clean with one\n * full card plus the next category heading; 24 comfortable. 18 is the hard\n * correctness floor because it is where {@link SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS}\n * starts being satisfied — below it the shared scroll gate stops clipping and\n * the grid bleeds over its borders. 20 buys two rows of margin above that floor\n * while staying under the 24-row default of common terminals.\n */\nexport const MIN_TERMINAL_SIZE = {\n COLS: 80,\n ROWS: 20,\n} as const;\n\n/**\n * The terminal height at or above which the stack step paints the six-row ASCII\n * logo. Below it the logo is dropped — it is decoration, and the stack list is\n * the content.\n *\n * This is NOT a second size gate. {@link MIN_TERMINAL_SIZE} decides whether a\n * command runs at all; this decides only whether one decorative element renders\n * inside a terminal that already cleared that gate. Conflating them would be a\n * regression in both directions: raising `MIN_TERMINAL_SIZE.ROWS` to 26 would\n * refuse to run in the 24-row terminal that is still a common default, and\n * lowering this to 20 brings back the bleed below.\n *\n * 26 is measured against the real binary at 100 columns, on the stack step:\n *\n * | rows | stack step with the logo rendered |\n * | ---- | ----------------------------------------------------------------- |\n * | 20 | bleeds — stack rows paint over the \"Start from scratch\" row |\n * | 24 | bleeds — stack rows paint through the hotkey row and the footer |\n * | 26 | clean |\n * | 27 | clean |\n * | 28 | clean |\n *\n * The mechanism: the logo eats six rows of the stack step's list viewport,\n * starving it below {@link SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS}, at which point\n * the shared scroll hooks stop clipping and the rows bleed. Hiding the logo\n * returns those rows to the viewport; the bail-instead-of-clip behaviour itself\n * is untouched and remains the open underlying defect.\n */\nexport const LOGO_MIN_TERMINAL_ROWS = 26;\n\nexport const DEFAULT_BRANDING = {\n NAME: \"Agents Inc.\",\n TAGLINE: \"AI-powered development tools\",\n} as const;\n\n/**\n * Fallback name for the default public marketplace when marketplace.json is\n * unavailable. Same value as `DEFAULT_PLUGIN_NAME` but a distinct concept: this\n * is the resolved source/marketplace name, that is the plugin bundle name.\n */\nexport const DEFAULT_PUBLIC_SOURCE_NAME = DEFAULT_PLUGIN_NAME;\n\n/**\n * The npm package the public catalogue publishes from, and the one thing that\n * tells the catalogue apart from a marketplace merely calling itself\n * {@link DEFAULT_PUBLIC_SOURCE_NAME}.\n *\n * Nothing a marketplace ships is unforgeable — every signal is a string in a file\n * its author controls, this one included. What it does is make the reserved\n * namespace unreachable by ACCIDENT: taking it requires renaming your own package\n * to the catalogue's published, npm-scope-governed name, which is impersonation\n * rather than drift.\n *\n * Two guards read it and must agree, which is why it lives here rather than in\n * either: `validateMarketplaceName` (`lib/marketplace-generator.ts`) exempts the\n * catalogue from the reserved-name refusal at BUILD time, and the collision guard\n * in `lib/loading/source-loader.ts` exempts it from the catalogue-id refusal at\n * LOAD time. Two definitions of who the catalogue is would let a source be the\n * catalogue to one guard and not to the other.\n */\nexport const PUBLIC_CATALOGUE_PACKAGE = \"@agents-inc/skills\";\n\n/** Human-readable labels for skill source types shown in the wizard and edit command */\nexport const SOURCE_DISPLAY_NAMES: Record<string, string> = {\n public: \"Public\",\n eject: \"Eject\",\n \"agents-inc\": \"Agents Inc\",\n};\n\n/** The two install modes a Sources row offers, in the order the grid renders them. */\nexport const INSTALL_MODES = [\"eject\", \"plugin\"] as const satisfies readonly Exclude<\n InstallMode,\n \"mixed\"\n>[];\n\n/**\n * How the Sources grid captions each of its two cells.\n *\n * Deliberately not `INSTALL_MODE_LABELS` (`Eject`/`Plugin`), which names a mode by what it does\n * to the files, nor `SOURCE_DISPLAY_NAMES`, which labels a `SkillConfig.origin` VALUE on the\n * summary surfaces. The grid asks where the skill should LIVE, and the two answers are the\n * project's own copy or the marketplace plugin — so the cells read `Local` and `Plugin`, which\n * is also the two-state badge the editor settled on (`.claude-design/DECISIONS.md`).\n */\nexport const INSTALL_MODE_CELL_LABELS = {\n eject: \"Local\",\n plugin: \"Plugin\",\n} as const satisfies Record<Exclude<InstallMode, \"mixed\">, string>;\n\n/** Resolves a source name to its human-readable display label. */\nexport function formatSourceDisplayName(source: string): string {\n return SOURCE_DISPLAY_NAMES[source] ?? source;\n}\n\n/**\n * Marketplace-row value when skills are selected but every one of them is `EJECT_SOURCE`. \"eject\"\n * names no marketplace, so there is nothing to list — but the selection is not empty either, and\n * naming the default public marketplace would claim an origin none of those skills has.\n */\nexport const ALL_SKILLS_EJECTED_LABEL = \"All skills ejected\";\n\n// TODO: update naming convention to GRAY_1,2, etc\nexport const CLI_COLORS = {\n PRIMARY: \"#99FFFF\",\n SUCCESS: \"#90EE90\",\n ERROR: \"#DC343B\",\n WARNING: \"#E6A817\",\n INFO: \"#3B82F6\",\n NEUTRAL: \"#888888\",\n FOCUS: \"#87CEFA\",\n UNFOCUSED: \"#FFFFFF\",\n WHITE: \"#FFFFFF\",\n BLACK: \"#000000\",\n DIM: \"#666666\",\n GRAY_1: \"#ddd\",\n LABEL_BG: \"#383838\",\n TOAST_BG: \"#EEEEEE\",\n TOAST_FG: \"#000000\",\n HOVER_BG: \"#333333\",\n} as const;\n\n/** Default domains pre-selected when \"Start from scratch\" is chosen (all except CLI) */\nexport const DEFAULT_SCRATCH_DOMAINS: readonly Domain[] = [\"web\", \"api\", \"mobile\"];\n\n/** Domain used when no active domain can be resolved from wizard state. */\nexport const FALLBACK_DOMAIN: Domain = \"web\";\n\nexport const ASCII_LOGO = ` █████╗ ██████╗ ███████╗███╗ ██╗████████╗███████╗ ██╗███╗ ██╗ ██████╗\n██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝██╔════╝ ██║████╗ ██║██╔════╝\n███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║ ███████╗ ██║██╔██╗ ██║██║\n██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ ╚════██║ ██║██║╚██╗██║██║\n██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ███████║ ██║██║ ╚████║╚██████╗\n╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝`;\n"],"mappings":";;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAG9B,IAAM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E,IAAM,kBAA0B;AAEhC,IAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;","names":[]}
@@ -1,36 +1,36 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  loadAgentDefs
4
- } from "./chunk-MHRC3KRX.js";
4
+ } from "./chunk-H4CL23HG.js";
5
5
  import {
6
6
  pruneStaleCompiledAgents,
7
7
  recompileAgents
8
- } from "./chunk-ZUAZHDKP.js";
8
+ } from "./chunk-WMVOJY6V.js";
9
9
  import {
10
10
  buildAgentScopeMap,
11
11
  buildMarketplacePluginRef,
12
12
  claudePluginUninstall,
13
+ copySkillsToLocalFlattened,
13
14
  discoverAllPluginSkills,
15
+ ensureDir,
16
+ getErrorMessage,
14
17
  isHomeDirectory,
15
18
  loadProjectConfigFromDir,
16
- resolveInstallPaths,
17
- toClaudePluginScope
18
- } from "./chunk-WCAUUBHO.js";
19
- import {
20
- getErrorMessage,
21
19
  loadSkillsFromDir,
22
20
  remove,
23
21
  removeDirIfEmpty,
22
+ resolveInstallPaths,
23
+ toClaudePluginScope,
24
24
  verbose
25
- } from "./chunk-XAXJWXI4.js";
25
+ } from "./chunk-3PJLLBUS.js";
26
26
  import {
27
27
  typedEntries,
28
28
  typedKeys
29
- } from "./chunk-VASLW636.js";
29
+ } from "./chunk-7Z4N4JWQ.js";
30
30
  import {
31
- GLOBAL_INSTALL_ROOT,
32
- LOCAL_SKILLS_PATH
33
- } from "./chunk-IO5YBKHV.js";
31
+ LOCAL_SKILLS_PATH,
32
+ globalInstallRoot
33
+ } from "./chunk-G6G2FT2G.js";
34
34
 
35
35
  // src/cli/lib/operations/project/remove-compiled-agents.ts
36
36
  import path from "path";
@@ -107,7 +107,6 @@ async function pruneStaleAgentsForPass(options, recompileResult) {
107
107
  }
108
108
 
109
109
  // src/cli/lib/operations/skills/discover-skills.ts
110
- import os from "os";
111
110
  import path2 from "path";
112
111
  var NO_LOCAL_SKILLS = { skills: {}, unusableMetadata: [] };
113
112
  async function discoverLocalProjectSkills(rootDir) {
@@ -130,12 +129,12 @@ function mergeSkills(...skillSources) {
130
129
  }
131
130
  async function discoverInstalledSkills(projectDir) {
132
131
  const isGlobalProject = isHomeDirectory(projectDir);
133
- const globalPluginSkills = isGlobalProject ? {} : await discoverAllPluginSkills(os.homedir());
132
+ const globalPluginSkills = isGlobalProject ? {} : await discoverAllPluginSkills(globalInstallRoot());
134
133
  const globalPluginSkillCount = typedKeys(globalPluginSkills).length;
135
134
  if (globalPluginSkillCount > 0) {
136
135
  verbose(` Found ${globalPluginSkillCount} skills from global plugins`);
137
136
  }
138
- const globalLocal = isGlobalProject ? NO_LOCAL_SKILLS : await discoverLocalProjectSkills(GLOBAL_INSTALL_ROOT);
137
+ const globalLocal = isGlobalProject ? NO_LOCAL_SKILLS : await discoverLocalProjectSkills(globalInstallRoot());
139
138
  const globalLocalSkillCount = typedKeys(globalLocal.skills).length;
140
139
  if (globalLocalSkillCount > 0) {
141
140
  verbose(` Found ${globalLocalSkillCount} global local skills from ~/.claude/skills/`);
@@ -159,6 +158,38 @@ async function discoverInstalledSkills(projectDir) {
159
158
  };
160
159
  }
161
160
 
161
+ // src/cli/lib/operations/skills/copy-local-skills.ts
162
+ async function copyScopedLocalSkills(scopeSkills, skillsDir, sourceResult) {
163
+ if (scopeSkills.length === 0) return [];
164
+ await ensureDir(skillsDir);
165
+ return copySkillsToLocalFlattened(
166
+ scopeSkills.map((s) => s.id),
167
+ skillsDir,
168
+ sourceResult
169
+ );
170
+ }
171
+ async function copyLocalSkills(skills, projectDir, sourceResult) {
172
+ const projectLocalSkills = skills.filter((s) => s.scope !== "global");
173
+ const globalLocalSkills = skills.filter((s) => s.scope === "global");
174
+ const projectPaths = resolveInstallPaths(projectDir, "project");
175
+ const globalPaths = resolveInstallPaths(projectDir, "global");
176
+ const projectCopied = await copyScopedLocalSkills(
177
+ projectLocalSkills,
178
+ projectPaths.skillsDir,
179
+ sourceResult
180
+ );
181
+ const globalCopied = await copyScopedLocalSkills(
182
+ globalLocalSkills,
183
+ globalPaths.skillsDir,
184
+ sourceResult
185
+ );
186
+ return {
187
+ projectCopied,
188
+ globalCopied,
189
+ totalCopied: projectCopied.length + globalCopied.length
190
+ };
191
+ }
192
+
162
193
  // src/cli/lib/operations/skills/uninstall-plugin-skills.ts
163
194
  async function uninstallPluginSkills(skillIds, oldSkills, marketplace, projectDir) {
164
195
  const uninstalled = [];
@@ -213,11 +244,12 @@ async function recompilePropagatedProjectAgents(projectDirs) {
213
244
  }
214
245
 
215
246
  export {
216
- removeCompiledAgents,
217
- compileAgents,
218
247
  discoverInstalledSkills,
248
+ copyLocalSkills,
219
249
  uninstallPluginSkills,
250
+ removeCompiledAgents,
251
+ compileAgents,
220
252
  recompileRegisteredProjectAgents,
221
253
  recompilePropagatedProjectAgents
222
254
  };
223
- //# sourceMappingURL=chunk-5QZAK6J7.js.map
255
+ //# sourceMappingURL=chunk-H25VRR2T.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/lib/operations/project/remove-compiled-agents.ts","../src/cli/lib/operations/project/compile-agents.ts","../src/cli/lib/operations/skills/discover-skills.ts","../src/cli/lib/operations/skills/copy-local-skills.ts","../src/cli/lib/operations/skills/uninstall-plugin-skills.ts","../src/cli/lib/operations/project/recompile-project-agents.ts"],"sourcesContent":["import path from \"path\";\nimport { pruneStaleCompiledAgents } from \"../../agents/list-compiled-agents.js\";\nimport { getErrorMessage } from \"../../../utils/errors.js\";\nimport { remove, removeDirIfEmpty } from \"../../../utils/fs.js\";\nimport type { AgentName } from \"../../../types/index.js\";\n\nconst AGENT_FILE_EXTENSION = \".md\";\n\nexport type RemoveCompiledAgentsOptions = {\n /** The scope's `.claude/agents/` directory holding the compiled files. */\n agentsDir: string;\n agents: readonly AgentName[];\n};\n\nexport type PruneCompiledAgentsOptions = {\n agentsDir: string;\n /**\n * The COMPLETE set of agents that belong in `agentsDir` — every other\n * CLI-compiled agent there is stale. Only an authoritative pass can say this.\n */\n keep: ReadonlySet<AgentName>;\n};\n\nexport type RemoveCompiledAgentsResult = {\n /** Agents whose compiled file this call disposed of; an absent file counts. */\n removed: AgentName[];\n /** Agents whose file survived an error, for the caller to report. */\n failed: Array<{ name: AgentName; error: string }>;\n};\n\ntype RemovalOutcome = { name: AgentName; ok: true } | { name: AgentName; ok: false; error: string };\n\n/**\n * Deletes the named agents' compiled `.md` files from `agentsDir`, then takes the\n * directory itself when nothing at all is left in it — the shape `deleteLocalSkill`\n * models for skills.\n *\n * A scope's `.claude/agents/` is an artefact of what it holds, so the removal that\n * empties it owns the tidy and no caller has to remember. An agent with no file on\n * disk is nothing to do rather than an error.\n */\nexport async function removeCompiledAgents(\n options: RemoveCompiledAgentsOptions,\n): Promise<RemoveCompiledAgentsResult> {\n const outcomes = await Promise.all(\n options.agents.map((name) => removeCompiledAgentFile(options.agentsDir, name)),\n );\n await tidyEmptiedAgentsDir(options.agentsDir);\n\n return {\n removed: outcomes.flatMap((outcome) => (outcome.ok ? [outcome.name] : [])),\n failed: outcomes.flatMap((outcome) =>\n outcome.ok ? [] : [{ name: outcome.name, error: outcome.error }],\n ),\n };\n}\n\n/**\n * Deletes every CLI-compiled agent in `agentsDir` outside `keep`, then takes the\n * directory on the same terms as `removeCompiledAgents`.\n *\n * Hand-authored agents are preserved by `pruneStaleCompiledAgents`'s `isAgentName`\n * predicate, so a directory this leaves empty is one nothing at all remains in.\n */\nexport async function pruneCompiledAgents(options: PruneCompiledAgentsOptions): Promise<void> {\n await pruneStaleCompiledAgents(options.agentsDir, options.keep);\n await tidyEmptiedAgentsDir(options.agentsDir);\n}\n\nasync function removeCompiledAgentFile(\n agentsDir: string,\n name: AgentName,\n): Promise<RemovalOutcome> {\n try {\n await remove(path.join(agentsDir, `${name}${AGENT_FILE_EXTENSION}`));\n return { name, ok: true };\n } catch (error) {\n return { name, ok: false, error: getErrorMessage(error) };\n }\n}\n\n/**\n * Emptiness is FILESYSTEM emptiness, never roster emptiness: a hand-authored agent\n * or any user-owned file keeps the directory alive whatever a config says. The\n * agents directory only — `.claude/` above it is uninstall's decision, not a\n * removal path's.\n */\nasync function tidyEmptiedAgentsDir(agentsDir: string): Promise<void> {\n await removeDirIfEmpty(agentsDir);\n}\n","import { pruneCompiledAgents } from \"./remove-compiled-agents.js\";\nimport { recompileAgents } from \"../../agents/index.js\";\nimport { loadProjectConfigFromDir } from \"../../configuration/index.js\";\nimport { buildAgentScopeMap } from \"../../installation/index.js\";\nimport type { AgentName, SkillDefinitionMap, SkillScope } from \"../../../types/index.js\";\n\nexport type CompileAgentsOptions = {\n projectDir: string;\n sourcePath: string;\n pluginDir?: string;\n skills?: SkillDefinitionMap;\n agentScopeMap?: Map<AgentName, SkillScope>;\n agents?: AgentName[];\n /** When set, loads config and filters agents to only those matching this scope. */\n scopeFilter?: SkillScope;\n outputDir?: string;\n};\n\nexport type CompilationResult = {\n compiled: AgentName[];\n /**\n * The subset of `compiled` whose file this pass actually wrote. A pass whose\n * `rewritten` is empty changed nothing on disk, which is exactly what the\n * recompile summary reports and what the count it replaced could not say.\n */\n rewritten: AgentName[];\n failed: AgentName[];\n warnings: string[];\n};\n\n/**\n * Compiles agent markdown files from templates + skill content.\n *\n * Thin wrapper around recompileAgents() that standardizes options.\n * The caller invokes this once (edit, update) or twice with scopeFilter (compile).\n */\nexport async function compileAgents(options: CompileAgentsOptions): Promise<CompilationResult> {\n let resolvedAgents = options.agents;\n let resolvedAgentScopeMap = options.agentScopeMap;\n\n if (options.scopeFilter) {\n const loadedConfig = await loadProjectConfigFromDir(options.projectDir);\n\n // Auto-build agentScopeMap from config if not provided\n if (!resolvedAgentScopeMap && loadedConfig?.config) {\n resolvedAgentScopeMap = buildAgentScopeMap(loadedConfig.config);\n }\n\n const filteredAgents = loadedConfig?.config.agents\n .filter((a) => !a.excluded && a.scope === options.scopeFilter)\n .map((a) => a.name);\n\n if (resolvedAgents && filteredAgents) {\n const filterSet = new Set(filteredAgents);\n resolvedAgents = resolvedAgents.filter((a) => filterSet.has(a));\n } else if (filteredAgents) {\n resolvedAgents = filteredAgents;\n }\n }\n\n const recompileResult = await recompileAgents({\n pluginDir: options.pluginDir ?? options.projectDir,\n sourcePath: options.sourcePath,\n ...(resolvedAgents !== undefined && { agents: resolvedAgents }),\n ...(options.skills !== undefined && { skills: options.skills }),\n projectDir: options.projectDir,\n ...(options.outputDir !== undefined && { outputDir: options.outputDir }),\n ...(resolvedAgentScopeMap !== undefined && { agentScopeMap: resolvedAgentScopeMap }),\n });\n\n await pruneStaleAgentsForPass(options, recompileResult);\n\n return {\n compiled: recompileResult.compiled,\n rewritten: recompileResult.rewritten,\n failed: recompileResult.failed,\n warnings: recompileResult.warnings,\n };\n}\n\n/**\n * Compiled-agent writes are additive, so a deselected or stale agent's `.md`\n * lingers after recompile. An authoritative, scope-UNfiltered pass owns its\n * entire `outputDir` (its resolved roster is the full set for that directory),\n * so it prunes built-in agents no longer compiled there. A scope-FILTERED pass\n * (the hasBoth two-pass compile, or the registered-project recompile)\n * sees only one scope's agents and must never delete another scope's files, so\n * it skips pruning. Removing the stale files and tidying the directory they\n * emptied is one operation's job, not this pass's.\n */\nasync function pruneStaleAgentsForPass(\n options: CompileAgentsOptions,\n recompileResult: CompilationResult,\n): Promise<void> {\n if (options.scopeFilter || !options.outputDir) return;\n\n const compiledForDir = new Set<AgentName>([\n ...recompileResult.compiled,\n ...recompileResult.failed,\n ]);\n await pruneCompiledAgents({ agentsDir: options.outputDir, keep: compiledForDir });\n}\n","import path from \"path\";\nimport { discoverAllPluginSkills } from \"../../plugins/index.js\";\nimport { isHomeDirectory } from \"../../installation/is-home-directory.js\";\n// loadSkillsFromDir lives in loading/ (a leaf) so both this module and\n// plugins/plugin-discovery can share it without an operations↔plugins cycle.\nimport { loadSkillsFromDir, type LoadedSkills } from \"../../loading/index.js\";\nimport { verbose } from \"../../../utils/logger.js\";\nimport { globalInstallRoot, LOCAL_SKILLS_PATH } from \"../../../consts.js\";\nimport { typedEntries, typedKeys } from \"../../../utils/typed-object.js\";\nimport type { UnusableSkillMetadata } from \"../../loading/index.js\";\nimport type { SkillDefinition, SkillDefinitionMap, SkillId } from \"../../../types/index.js\";\n\nexport type DiscoveredSkills = {\n allSkills: SkillDefinitionMap;\n totalSkillCount: number;\n pluginSkillCount: number;\n localSkillCount: number;\n globalPluginSkillCount: number;\n globalLocalSkillCount: number;\n /**\n * Installed skills whose metadata.yaml exists but describes no skill, from either\n * scope. Nothing was loaded for them; `compile` refuses the run over any entry\n * here rather than compile agents around a skill its metadata does not describe.\n */\n unusableMetadata: UnusableSkillMetadata[];\n};\n\n/** The result of a local-skill scan that was not performed. */\nconst NO_LOCAL_SKILLS: LoadedSkills = { skills: {}, unusableMetadata: [] };\n\n/**\n * Discovers local (non-plugin) skills from `<rootDir>/.claude/skills/`. Used for\n * both the project root and the global install root.\n */\nexport async function discoverLocalProjectSkills(rootDir: string): Promise<LoadedSkills> {\n const localSkillsDir = path.join(rootDir, LOCAL_SKILLS_PATH);\n return loadSkillsFromDir(localSkillsDir, {\n pathPrefix: LOCAL_SKILLS_PATH,\n requireMetadata: true,\n });\n}\n\n/** Merges skill maps — later sources take precedence over earlier ones. */\nexport function mergeSkills(...skillSources: SkillDefinitionMap[]): SkillDefinitionMap {\n const merged: SkillDefinitionMap = {};\n\n for (const source of skillSources) {\n for (const [id, skill] of typedEntries<SkillId, SkillDefinition | undefined>(source)) {\n if (skill) {\n merged[id] = skill;\n }\n }\n }\n\n return merged;\n}\n\n/**\n * Discovers all installed skills for a project directory using 4-way merge:\n * 1. Global plugins (from ~/.claude/plugins/)\n * 2. Global local (from ~/.claude/skills/)\n * 3. Project plugins (from <projectDir>/.claude/plugins/)\n * 4. Project local (from <projectDir>/.claude/skills/)\n *\n * Pure function — no user-facing logging. Callers add their own log messages.\n * Uses verbose() for diagnostic output only.\n */\nexport async function discoverInstalledSkills(projectDir: string): Promise<DiscoveredSkills> {\n const isGlobalProject = isHomeDirectory(projectDir);\n\n // 1. Global plugins\n const globalPluginSkills = isGlobalProject\n ? {}\n : await discoverAllPluginSkills(globalInstallRoot());\n const globalPluginSkillCount = typedKeys<SkillId>(globalPluginSkills).length;\n if (globalPluginSkillCount > 0) {\n verbose(` Found ${globalPluginSkillCount} skills from global plugins`);\n }\n\n // 2. Global local skills\n const globalLocal = isGlobalProject\n ? NO_LOCAL_SKILLS\n : await discoverLocalProjectSkills(globalInstallRoot());\n const globalLocalSkillCount = typedKeys<SkillId>(globalLocal.skills).length;\n if (globalLocalSkillCount > 0) {\n verbose(` Found ${globalLocalSkillCount} global local skills from ~/.claude/skills/`);\n }\n\n // 3. Project plugins\n const pluginSkills = await discoverAllPluginSkills(projectDir);\n const pluginSkillCount = typedKeys<SkillId>(pluginSkills).length;\n verbose(` Found ${pluginSkillCount} skills from installed plugins`);\n\n // 4. Project local skills\n const local = await discoverLocalProjectSkills(projectDir);\n const localSkillCount = typedKeys<SkillId>(local.skills).length;\n verbose(` Found ${localSkillCount} local skills from .claude/skills/`);\n\n // Merge: global first, project second — project wins on conflict\n const allSkills = mergeSkills(globalPluginSkills, globalLocal.skills, pluginSkills, local.skills);\n const totalSkillCount = typedKeys<SkillId>(allSkills).length;\n\n return {\n allSkills,\n totalSkillCount,\n pluginSkillCount: globalPluginSkillCount + pluginSkillCount,\n localSkillCount: globalLocalSkillCount + localSkillCount,\n globalPluginSkillCount,\n globalLocalSkillCount,\n unusableMetadata: [...globalLocal.unusableMetadata, ...local.unusableMetadata],\n };\n}\n","import { resolveInstallPaths } from \"../../installation/index.js\";\nimport { copySkillsToLocalFlattened, type CopiedSkill } from \"../../skills/index.js\";\nimport { ensureDir } from \"../../../utils/fs.js\";\nimport type { SkillConfig } from \"../../../types/config.js\";\nimport type { SourceLoadResult } from \"../../loading/source-loader.js\";\n\nexport type SkillCopyResult = {\n projectCopied: CopiedSkill[];\n globalCopied: CopiedSkill[];\n totalCopied: number;\n};\n\n/** Copies one scope's local skills into its skills directory. */\nasync function copyScopedLocalSkills(\n scopeSkills: SkillConfig[],\n skillsDir: string,\n sourceResult: SourceLoadResult,\n): Promise<CopiedSkill[]> {\n if (scopeSkills.length === 0) return [];\n\n await ensureDir(skillsDir);\n\n return copySkillsToLocalFlattened(\n scopeSkills.map((s) => s.id),\n skillsDir,\n sourceResult,\n );\n}\n\n/**\n * Copies local-source skills to their scope-appropriate directories.\n *\n * Splits skills by scope (project vs global), resolves install paths,\n * ensures directories exist, and copies from source.\n */\nexport async function copyLocalSkills(\n skills: SkillConfig[],\n projectDir: string,\n sourceResult: SourceLoadResult,\n): Promise<SkillCopyResult> {\n const projectLocalSkills = skills.filter((s) => s.scope !== \"global\");\n const globalLocalSkills = skills.filter((s) => s.scope === \"global\");\n\n const projectPaths = resolveInstallPaths(projectDir, \"project\");\n const globalPaths = resolveInstallPaths(projectDir, \"global\");\n\n const projectCopied = await copyScopedLocalSkills(\n projectLocalSkills,\n projectPaths.skillsDir,\n sourceResult,\n );\n const globalCopied = await copyScopedLocalSkills(\n globalLocalSkills,\n globalPaths.skillsDir,\n sourceResult,\n );\n\n return {\n projectCopied,\n globalCopied,\n totalCopied: projectCopied.length + globalCopied.length,\n };\n}\n","import { claudePluginUninstall } from \"../../../utils/exec.js\";\nimport { buildMarketplacePluginRef, toClaudePluginScope } from \"../../plugins/index.js\";\nimport { getErrorMessage } from \"../../../utils/errors.js\";\nimport type { SkillId } from \"../../../types/index.js\";\nimport type { SkillConfig } from \"../../../types/config.js\";\n\nexport type PluginUninstallResult = {\n uninstalled: SkillId[];\n failed: Array<{ id: SkillId; error: string }>;\n};\n\n/**\n * Uninstalls skill plugins via the Claude CLI, using scope from old config.\n *\n * Each plugin reference is qualified as `{skillId}@{marketplace}` to match\n * the form used at install time — bare skill IDs will not match the registry.\n */\nexport async function uninstallPluginSkills(\n skillIds: SkillId[],\n oldSkills: SkillConfig[],\n marketplace: string,\n projectDir: string,\n): Promise<PluginUninstallResult> {\n const uninstalled: SkillId[] = [];\n const failed: PluginUninstallResult[\"failed\"] = [];\n\n for (const skillId of skillIds) {\n const oldSkill = oldSkills.find((s) => s.id === skillId);\n const pluginScope = toClaudePluginScope(oldSkill?.scope);\n const pluginRef = buildMarketplacePluginRef(skillId, marketplace);\n try {\n await claudePluginUninstall(pluginRef, pluginScope, projectDir);\n uninstalled.push(skillId);\n } catch (error) {\n failed.push({ id: skillId, error: getErrorMessage(error) });\n }\n }\n\n return { uninstalled, failed };\n}\n","import { compileAgents, type CompilationResult } from \"./compile-agents.js\";\nimport { loadAgentDefs } from \"./load-agent-defs.js\";\nimport { discoverInstalledSkills } from \"../skills/index.js\";\nimport { resolveInstallPaths } from \"../../installation/index.js\";\nimport { getErrorMessage } from \"../../../utils/errors.js\";\n\n/**\n * Recompiles the PROJECT-scoped agents of a registered project after a global\n * config change was propagated into that project's `config.ts`.\n *\n * Propagation (`propagateGlobalChangesToProjects`) rewrites a registered\n * project's `config.ts` / `config-types.ts` but never touches its compiled\n * `.claude/agents/*.md`, so the compiled agents keep emitting whatever skill\n * reference form the OLD global data dictated. Run this per propagated project,\n * after propagation, to bring the compiled artifacts back in step.\n *\n * Scope: project only. The global agents were already recompiled by the\n * triggering operation's own pass; repeating a global pass per project would\n * rewrite `~/.claude/agents` once per registered project for no gain.\n *\n * `skills` is passed explicitly: without it `recompileAgents` falls back to\n * `discoverAllPluginSkills`, which sees plugin skills only and would silently\n * strip every global-local and project-local skill from the compiled agents.\n *\n * Agent partials always come from the CLI itself (`getLocalAgentDefinitions`\n * returns `sourcePath: PROJECT_ROOT`), so no per-project marketplace source\n * resolution is needed.\n */\nexport async function recompileRegisteredProjectAgents(\n projectDir: string,\n): Promise<CompilationResult> {\n const { allSkills } = await discoverInstalledSkills(projectDir);\n const { sourcePath } = await loadAgentDefs();\n\n return compileAgents({\n projectDir,\n sourcePath,\n skills: allSkills,\n scopeFilter: \"project\",\n outputDir: resolveInstallPaths(projectDir, \"project\").agentsDir,\n });\n}\n\nexport type PropagatedRecompileSummary = {\n /** Projects where at least one compiled agent's content actually moved. */\n rewrittenCount: number;\n /**\n * Projects the fan-out reached whose agents all came back byte-identical. They\n * were visited and left alone, which is a different fact from being recompiled\n * and the one the old single count could not tell apart.\n */\n unchangedCount: number;\n failedCount: number;\n /** Per-project warnings in processing order — the caller surfaces them via warn(). */\n warnings: string[];\n};\n\n/**\n * Runs {@link recompileRegisteredProjectAgents} over every propagated project,\n * isolating per-project failures: one project's unreadable config or broken\n * template must not abort the loop or leave the remaining projects stale.\n * Projects are processed sequentially so the collected warnings keep a\n * deterministic per-project order.\n */\nexport async function recompilePropagatedProjectAgents(\n projectDirs: string[],\n): Promise<PropagatedRecompileSummary> {\n let rewrittenCount = 0;\n let unchangedCount = 0;\n let failedCount = 0;\n const warnings: string[] = [];\n\n for (const dir of projectDirs) {\n try {\n const result = await recompileRegisteredProjectAgents(dir);\n if (result.failed.length > 0) {\n failedCount++;\n warnings.push(...result.warnings);\n continue;\n }\n if (result.rewritten.length > 0) rewrittenCount++;\n else unchangedCount++;\n } catch (error) {\n failedCount++;\n warnings.push(`Could not recompile agents in ${dir}: ${getErrorMessage(error)}`);\n }\n }\n\n return { rewrittenCount, unchangedCount, failedCount, warnings };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,UAAU;AAMjB,IAAM,uBAAuB;AAmC7B,eAAsB,qBACpB,SACqC;AACrC,QAAM,WAAW,MAAM,QAAQ;AAAA,IAC7B,QAAQ,OAAO,IAAI,CAAC,SAAS,wBAAwB,QAAQ,WAAW,IAAI,CAAC;AAAA,EAC/E;AACA,QAAM,qBAAqB,QAAQ,SAAS;AAE5C,SAAO;AAAA,IACL,SAAS,SAAS,QAAQ,CAAC,YAAa,QAAQ,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAE;AAAA,IACzE,QAAQ,SAAS;AAAA,MAAQ,CAAC,YACxB,QAAQ,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,QAAQ,MAAM,OAAO,QAAQ,MAAM,CAAC;AAAA,IACjE;AAAA,EACF;AACF;AASA,eAAsB,oB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