@agents-inc/cli 0.74.7 → 0.74.8

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 (112) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{chunk-HA35FGPO.js → chunk-4Q2JLBCX.js} +2 -2
  3. package/dist/{chunk-RO6BG4ZW.js → chunk-7JVDZFJG.js} +3 -5
  4. package/dist/chunk-7JVDZFJG.js.map +1 -0
  5. package/dist/{chunk-TJBOCGLR.js → chunk-7SKGMV7P.js} +11 -11
  6. package/dist/{chunk-JB2QTE7M.js → chunk-7W226BOV.js} +5 -6
  7. package/dist/chunk-7W226BOV.js.map +1 -0
  8. package/dist/{chunk-STC7IEVI.js → chunk-BQW4ONJE.js} +2 -2
  9. package/dist/{chunk-6VIOO74O.js → chunk-CBYRFAUN.js} +1 -3
  10. package/dist/{chunk-6VIOO74O.js.map → chunk-CBYRFAUN.js.map} +1 -1
  11. package/dist/{chunk-GFTBHBRQ.js → chunk-E3MF6GGS.js} +14 -3
  12. package/dist/chunk-E3MF6GGS.js.map +1 -0
  13. package/dist/{chunk-BKTPEATV.js → chunk-F7LOH754.js} +2 -2
  14. package/dist/{chunk-UKYWXIDT.js → chunk-FVMYBN5K.js} +85 -68
  15. package/dist/chunk-FVMYBN5K.js.map +1 -0
  16. package/dist/{chunk-HIVZDWJC.js → chunk-GNA6IOQZ.js} +2 -2
  17. package/dist/{chunk-VMTZ5WC5.js → chunk-HJY4354Y.js} +2 -2
  18. package/dist/{chunk-MVYJVKVT.js → chunk-HT5KOOUQ.js} +2 -2
  19. package/dist/{chunk-RHAZARG3.js → chunk-KZG3EQSH.js} +5 -5
  20. package/dist/{chunk-KYULKBFC.js → chunk-NA6I5P5P.js} +2 -2
  21. package/dist/{chunk-CJSCCLT5.js → chunk-PN65K3LH.js} +2 -2
  22. package/dist/{chunk-MOWZ2FLG.js → chunk-Q53GBFTO.js} +2 -2
  23. package/dist/{chunk-2GD57LQE.js → chunk-RBR355UI.js} +5 -5
  24. package/dist/{chunk-FDIKV4ON.js → chunk-SM4FX2IU.js} +4 -88
  25. package/dist/chunk-SM4FX2IU.js.map +1 -0
  26. package/dist/{chunk-COZ75NET.js → chunk-TPXDHJDB.js} +2 -2
  27. package/dist/{chunk-2ZQKORJI.js → chunk-TUGXTCGX.js} +3 -3
  28. package/dist/{chunk-2MHSOPIU.js → chunk-UFKDY45I.js} +2 -2
  29. package/dist/{chunk-W3GHDONP.js → chunk-ULP3GGXG.js} +4 -4
  30. package/dist/{chunk-JZPQI7YI.js → chunk-X6LXHVA6.js} +2 -2
  31. package/dist/commands/build/plugins.js +2 -2
  32. package/dist/commands/build/stack.js +2 -2
  33. package/dist/commands/compile.js +2 -2
  34. package/dist/commands/config/index.js +2 -2
  35. package/dist/commands/config/path.js +1 -1
  36. package/dist/commands/config/show.js +2 -2
  37. package/dist/commands/diff.js +1 -1
  38. package/dist/commands/doctor.js +1 -1
  39. package/dist/commands/edit.js +47 -40
  40. package/dist/commands/edit.js.map +1 -1
  41. package/dist/commands/eject.js +1 -1
  42. package/dist/commands/import/skill.js +1 -1
  43. package/dist/commands/info.js +1 -1
  44. package/dist/commands/init.js +18 -18
  45. package/dist/commands/list.js +1 -1
  46. package/dist/commands/new/agent.js +2 -2
  47. package/dist/commands/new/marketplace.js +2 -2
  48. package/dist/commands/new/skill.js +2 -2
  49. package/dist/commands/outdated.js +1 -1
  50. package/dist/commands/search.js +3 -3
  51. package/dist/commands/uninstall.js +1 -1
  52. package/dist/commands/update.js +2 -2
  53. package/dist/commands/validate.js +62 -44
  54. package/dist/commands/validate.js.map +1 -1
  55. package/dist/components/skill-search/skill-search.js +2 -2
  56. package/dist/components/wizard/category-grid.js +2 -2
  57. package/dist/components/wizard/category-grid.test.js +4 -4
  58. package/dist/components/wizard/domain-selection.js +3 -3
  59. package/dist/components/wizard/help-modal.js +2 -2
  60. package/dist/components/wizard/search-modal.js +2 -2
  61. package/dist/components/wizard/search-modal.test.js +2 -2
  62. package/dist/components/wizard/source-grid.js +3 -3
  63. package/dist/components/wizard/source-grid.test.js +5 -5
  64. package/dist/components/wizard/stack-selection.js +3 -3
  65. package/dist/components/wizard/step-agents.js +3 -3
  66. package/dist/components/wizard/step-agents.test.js +3 -3
  67. package/dist/components/wizard/step-build.js +5 -5
  68. package/dist/components/wizard/step-build.test.js +5 -5
  69. package/dist/components/wizard/step-confirm.js +2 -2
  70. package/dist/components/wizard/step-confirm.test.js +4 -4
  71. package/dist/components/wizard/step-refine.js +2 -2
  72. package/dist/components/wizard/step-refine.test.js +2 -2
  73. package/dist/components/wizard/step-settings.js +3 -3
  74. package/dist/components/wizard/step-settings.test.js +6 -6
  75. package/dist/components/wizard/step-sources.js +6 -6
  76. package/dist/components/wizard/step-sources.test.js +6 -6
  77. package/dist/components/wizard/step-stack.js +5 -5
  78. package/dist/components/wizard/step-stack.test.js +5 -5
  79. package/dist/components/wizard/wizard-layout.js +5 -5
  80. package/dist/components/wizard/wizard.js +17 -17
  81. package/dist/hooks/init.js +18 -18
  82. package/dist/source-loader-X46F4X2B.js +23 -0
  83. package/dist/{source-manager-A3QLBYCU.js → source-manager-WG7HJHVW.js} +2 -2
  84. package/dist/stores/wizard-store.js +2 -2
  85. package/dist/stores/wizard-store.test.js +26 -5
  86. package/dist/stores/wizard-store.test.js.map +1 -1
  87. package/package.json +1 -1
  88. package/dist/chunk-FDIKV4ON.js.map +0 -1
  89. package/dist/chunk-GFTBHBRQ.js.map +0 -1
  90. package/dist/chunk-JB2QTE7M.js.map +0 -1
  91. package/dist/chunk-RO6BG4ZW.js.map +0 -1
  92. package/dist/chunk-UKYWXIDT.js.map +0 -1
  93. package/dist/source-loader-HQTTAMS7.js +0 -17
  94. /package/dist/{chunk-HA35FGPO.js.map → chunk-4Q2JLBCX.js.map} +0 -0
  95. /package/dist/{chunk-TJBOCGLR.js.map → chunk-7SKGMV7P.js.map} +0 -0
  96. /package/dist/{chunk-STC7IEVI.js.map → chunk-BQW4ONJE.js.map} +0 -0
  97. /package/dist/{chunk-BKTPEATV.js.map → chunk-F7LOH754.js.map} +0 -0
  98. /package/dist/{chunk-HIVZDWJC.js.map → chunk-GNA6IOQZ.js.map} +0 -0
  99. /package/dist/{chunk-VMTZ5WC5.js.map → chunk-HJY4354Y.js.map} +0 -0
  100. /package/dist/{chunk-MVYJVKVT.js.map → chunk-HT5KOOUQ.js.map} +0 -0
  101. /package/dist/{chunk-RHAZARG3.js.map → chunk-KZG3EQSH.js.map} +0 -0
  102. /package/dist/{chunk-KYULKBFC.js.map → chunk-NA6I5P5P.js.map} +0 -0
  103. /package/dist/{chunk-CJSCCLT5.js.map → chunk-PN65K3LH.js.map} +0 -0
  104. /package/dist/{chunk-MOWZ2FLG.js.map → chunk-Q53GBFTO.js.map} +0 -0
  105. /package/dist/{chunk-2GD57LQE.js.map → chunk-RBR355UI.js.map} +0 -0
  106. /package/dist/{chunk-COZ75NET.js.map → chunk-TPXDHJDB.js.map} +0 -0
  107. /package/dist/{chunk-2ZQKORJI.js.map → chunk-TUGXTCGX.js.map} +0 -0
  108. /package/dist/{chunk-2MHSOPIU.js.map → chunk-UFKDY45I.js.map} +0 -0
  109. /package/dist/{chunk-W3GHDONP.js.map → chunk-ULP3GGXG.js.map} +0 -0
  110. /package/dist/{chunk-JZPQI7YI.js.map → chunk-X6LXHVA6.js.map} +0 -0
  111. /package/dist/{source-loader-HQTTAMS7.js.map → source-loader-X46F4X2B.js.map} +0 -0
  112. /package/dist/{source-manager-A3QLBYCU.js.map → source-manager-WG7HJHVW.js.map} +0 -0
@@ -1,41 +1,41 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  Wizard
4
- } from "../chunk-TJBOCGLR.js";
5
- import "../chunk-JB2QTE7M.js";
4
+ } from "../chunk-7SKGMV7P.js";
5
+ import "../chunk-7W226BOV.js";
6
6
  import "../chunk-SXGBPQY6.js";
7
- import "../chunk-2ZQKORJI.js";
8
- import "../chunk-RHAZARG3.js";
7
+ import "../chunk-TUGXTCGX.js";
8
+ import "../chunk-KZG3EQSH.js";
9
9
  import "../chunk-HGTC76BX.js";
10
- import "../chunk-W3GHDONP.js";
11
- import "../chunk-MOWZ2FLG.js";
12
- import "../chunk-STC7IEVI.js";
13
- import "../chunk-2GD57LQE.js";
10
+ import "../chunk-ULP3GGXG.js";
11
+ import "../chunk-Q53GBFTO.js";
12
+ import "../chunk-BQW4ONJE.js";
13
+ import "../chunk-RBR355UI.js";
14
14
  import "../chunk-K77I4XGL.js";
15
- import "../chunk-CJSCCLT5.js";
15
+ import "../chunk-PN65K3LH.js";
16
16
  import "../chunk-MWGDG4QN.js";
17
- import "../chunk-COZ75NET.js";
17
+ import "../chunk-TPXDHJDB.js";
18
18
  import "../chunk-7SOPVGDV.js";
19
- import "../chunk-2MHSOPIU.js";
20
- import "../chunk-JZPQI7YI.js";
19
+ import "../chunk-UFKDY45I.js";
20
+ import "../chunk-X6LXHVA6.js";
21
21
  import "../chunk-GG4BSB6S.js";
22
- import "../chunk-VMTZ5WC5.js";
22
+ import "../chunk-HJY4354Y.js";
23
23
  import "../chunk-LVNNP7T4.js";
24
24
  import "../chunk-OV5UJWS5.js";
25
25
  import "../chunk-XMLCXRTS.js";
26
26
  import "../chunk-AQYAVLZK.js";
27
27
  import "../chunk-AUNBGZS4.js";
28
- import "../chunk-KYULKBFC.js";
28
+ import "../chunk-NA6I5P5P.js";
29
29
  import "../chunk-WF5PMBIR.js";
30
30
  import "../chunk-KUV24B5M.js";
31
- import "../chunk-GFTBHBRQ.js";
31
+ import "../chunk-E3MF6GGS.js";
32
32
  import "../chunk-T5DJCIUP.js";
33
33
  import "../chunk-U3IGFMCY.js";
34
- import "../chunk-6VIOO74O.js";
34
+ import "../chunk-CBYRFAUN.js";
35
35
  import {
36
36
  getAgentDefinitions,
37
37
  recompileAgents
38
- } from "../chunk-RO6BG4ZW.js";
38
+ } from "../chunk-7JVDZFJG.js";
39
39
  import {
40
40
  ERROR_MESSAGES,
41
41
  INFO_MESSAGES,
@@ -52,13 +52,14 @@ import {
52
52
  detectInstallation,
53
53
  detectMigrations,
54
54
  discoverAllPluginSkills,
55
+ ensureBlankGlobalConfig,
55
56
  executeMigration,
56
57
  getMarketplaceLabel,
57
58
  loadProjectConfig,
58
59
  loadSkillsMatrixFromSource,
59
60
  migrateLocalSkillScope,
60
61
  writeScopedConfigs
61
- } from "../chunk-UKYWXIDT.js";
62
+ } from "../chunk-FVMYBN5K.js";
62
63
  import {
63
64
  loadAllAgents
64
65
  } from "../chunk-RRBWNEG3.js";
@@ -79,10 +80,13 @@ import {
79
80
  } from "../chunk-4CRWKTNQ.js";
80
81
  import "../chunk-SRIH4U5Y.js";
81
82
  import {
83
+ CLAUDE_DIR,
84
+ CLAUDE_SRC_DIR,
82
85
  CLI_BIN_NAME,
83
86
  GLOBAL_INSTALL_ROOT,
84
87
  PROJECT_ROOT,
85
- SOURCE_DISPLAY_NAMES
88
+ SOURCE_DISPLAY_NAMES,
89
+ STANDARD_FILES
86
90
  } from "../chunk-EGMQ3SXN.js";
87
91
  import "../chunk-NKKYTCBH.js";
88
92
  import {
@@ -92,6 +96,7 @@ import {
92
96
  // src/cli/commands/edit.tsx
93
97
  init_esm_shims();
94
98
  import os from "os";
99
+ import path from "path";
95
100
  import { Flags } from "@oclif/core";
96
101
  import { render } from "ink";
97
102
  import { jsx } from "react/jsx-runtime";
@@ -127,6 +132,7 @@ var Edit = class _Edit extends BaseCommand {
127
132
  };
128
133
  async run() {
129
134
  const { flags } = await this.parse(_Edit);
135
+ const cwd = process.cwd();
130
136
  const installation = await detectInstallation();
131
137
  if (!installation) {
132
138
  this.error(ERROR_MESSAGES.NO_INSTALLATION, {
@@ -135,12 +141,6 @@ var Edit = class _Edit extends BaseCommand {
135
141
  }
136
142
  const projectDir = installation.projectDir;
137
143
  enableBuffering();
138
- if (installation.projectDir === os.homedir()) {
139
- pushBufferMessage(
140
- "info",
141
- "No project installation found. Using global installation from ~/.claude-src/"
142
- );
143
- }
144
144
  let sourceResult;
145
145
  let startupMessages = [];
146
146
  try {
@@ -177,7 +177,7 @@ var Edit = class _Edit extends BaseCommand {
177
177
  disableBuffering();
178
178
  let wizardResult = null;
179
179
  const marketplaceLabel = getMarketplaceLabel(sourceResult);
180
- const isGlobalDir = projectDir === GLOBAL_INSTALL_ROOT;
180
+ const isGlobalDir = cwd === GLOBAL_INSTALL_ROOT;
181
181
  const lockedSkillIds = isGlobalDir ? void 0 : projectConfig?.config?.skills?.filter((s) => s.scope === "global").map((s) => s.id);
182
182
  const lockedAgentNames = isGlobalDir ? void 0 : projectConfig?.config?.agents?.filter((a) => a.scope === "global").map((a) => a.name);
183
183
  const { waitUntilExit } = render(
@@ -300,7 +300,7 @@ var Edit = class _Edit extends BaseCommand {
300
300
  this.log(` - ${migration.id}`);
301
301
  }
302
302
  }
303
- const migrationResult = await executeMigration(migrationPlan, projectDir, sourceResult);
303
+ const migrationResult = await executeMigration(migrationPlan, cwd, sourceResult);
304
304
  for (const warning of migrationResult.warnings) {
305
305
  this.warn(warning);
306
306
  }
@@ -312,14 +312,14 @@ var Edit = class _Edit extends BaseCommand {
312
312
  for (const [skillId, change] of scopeChanges) {
313
313
  const skillConfig = result.skills.find((s) => s.id === skillId);
314
314
  if (skillConfig?.source === "local") {
315
- await migrateLocalSkillScope(skillId, change.from, projectDir);
315
+ await migrateLocalSkillScope(skillId, change.from, cwd);
316
316
  } else if (sourceResult.marketplace && skillConfig) {
317
317
  const oldPluginScope = change.from === "global" ? "user" : "project";
318
318
  const newPluginScope = change.to === "global" ? "user" : "project";
319
319
  try {
320
- await claudePluginUninstall(skillId, oldPluginScope, projectDir);
320
+ await claudePluginUninstall(skillId, oldPluginScope, cwd);
321
321
  const pluginRef = `${skillId}@${sourceResult.marketplace}`;
322
- await claudePluginInstall(pluginRef, newPluginScope, projectDir);
322
+ await claudePluginInstall(pluginRef, newPluginScope, cwd);
323
323
  } catch (error) {
324
324
  this.warn(`Failed to migrate plugin scope for ${skillId}: ${getErrorMessage(error)}`);
325
325
  }
@@ -330,7 +330,7 @@ var Edit = class _Edit extends BaseCommand {
330
330
  continue;
331
331
  }
332
332
  if (change.from === "local") {
333
- await deleteLocalSkill(projectDir, skillId);
333
+ await deleteLocalSkill(cwd, skillId);
334
334
  }
335
335
  }
336
336
  if (sourceResult.marketplace) {
@@ -348,7 +348,7 @@ var Edit = class _Edit extends BaseCommand {
348
348
  const pluginScope = skillConfig.scope === "global" ? "user" : "project";
349
349
  this.log(`Installing plugin: ${pluginRef}...`);
350
350
  try {
351
- await claudePluginInstall(pluginRef, pluginScope, projectDir);
351
+ await claudePluginInstall(pluginRef, pluginScope, cwd);
352
352
  } catch (error) {
353
353
  this.warn(`Failed to install plugin ${pluginRef}: ${getErrorMessage(error)}`);
354
354
  }
@@ -358,7 +358,7 @@ var Edit = class _Edit extends BaseCommand {
358
358
  const pluginScope = oldSkill?.scope === "global" ? "user" : "project";
359
359
  this.log(`Uninstalling plugin: ${skillId}...`);
360
360
  try {
361
- await claudePluginUninstall(skillId, pluginScope, projectDir);
361
+ await claudePluginUninstall(skillId, pluginScope, cwd);
362
362
  } catch (error) {
363
363
  this.warn(`Failed to uninstall plugin ${skillId}: ${getErrorMessage(error)}`);
364
364
  }
@@ -378,30 +378,37 @@ var Edit = class _Edit extends BaseCommand {
378
378
  this.handleError(error);
379
379
  }
380
380
  try {
381
- const mergeResult = await buildAndMergeConfig(result, sourceResult, projectDir, flags.source);
381
+ const mergeResult = await buildAndMergeConfig(result, sourceResult, cwd, flags.source);
382
382
  const cliAgents = await loadAllAgents(PROJECT_ROOT);
383
383
  const sourceAgents = await loadAllAgents(sourcePath);
384
384
  const agents = { ...cliAgents, ...sourceAgents };
385
+ if (cwd !== os.homedir()) {
386
+ await ensureBlankGlobalConfig();
387
+ }
388
+ const configPath = path.join(cwd, CLAUDE_SRC_DIR, STANDARD_FILES.CONFIG_TS);
389
+ const projectInstallationExists = path.resolve(installation.projectDir) !== path.resolve(os.homedir());
385
390
  await writeScopedConfigs(
386
391
  mergeResult.config,
387
392
  sourceResult.matrix,
388
393
  agents,
389
- projectDir,
390
- installation.configPath
394
+ cwd,
395
+ configPath,
396
+ projectInstallationExists
391
397
  );
392
398
  } catch (error) {
393
399
  this.warn(`Could not update config: ${getErrorMessage(error)}`);
394
400
  }
395
401
  this.log(STATUS_MESSAGES.RECOMPILING_AGENTS);
396
402
  try {
397
- const recompileSkills = await discoverAllPluginSkills(projectDir);
403
+ const recompileSkills = await discoverAllPluginSkills(cwd);
398
404
  const agentScopeMap = new Map(result.agentConfigs.map((a) => [a.name, a.scope]));
405
+ const outputDir = path.join(cwd, CLAUDE_DIR, "agents");
399
406
  const recompileResult = await recompileAgents({
400
- pluginDir: projectDir,
407
+ pluginDir: cwd,
401
408
  sourcePath,
402
409
  skills: recompileSkills,
403
- projectDir,
404
- outputDir: installation.agentsDir,
410
+ projectDir: cwd,
411
+ outputDir,
405
412
  installMode: deriveInstallMode(result.skills),
406
413
  agentScopeMap
407
414
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cli/commands/edit.tsx"],"sourcesContent":["import os from \"os\";\n\nimport { Flags } from \"@oclif/core\";\nimport { render } from \"ink\";\n\nimport { BaseCommand } from \"../base-command.js\";\nimport { Wizard, type WizardResultV2 } from \"../components/wizard/wizard.js\";\nimport {\n CLI_BIN_NAME,\n GLOBAL_INSTALL_ROOT,\n PROJECT_ROOT,\n SOURCE_DISPLAY_NAMES,\n} from \"../consts.js\";\nimport { getAgentDefinitions, recompileAgents } from \"../lib/agents/index.js\";\nimport { loadProjectConfig } from \"../lib/configuration/index.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport {\n detectInstallation,\n buildAndMergeConfig,\n writeScopedConfigs,\n detectMigrations,\n executeMigration,\n deriveInstallMode,\n} from \"../lib/installation/index.js\";\nimport {\n getMarketplaceLabel,\n loadAllAgents,\n loadSkillsMatrixFromSource,\n} from \"../lib/loading/index.js\";\nimport { matrix, getSkillById } from \"../lib/matrix/matrix-provider\";\nimport { discoverAllPluginSkills } from \"../lib/plugins/index.js\";\nimport { deleteLocalSkill, migrateLocalSkillScope } from \"../lib/skills/index.js\";\nimport type { AgentDefinition, AgentName, SkillId } from \"../types/index.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport {\n claudePluginInstall,\n claudePluginUninstall,\n claudePluginMarketplaceExists,\n claudePluginMarketplaceAdd,\n} from \"../utils/exec.js\";\nimport {\n enableBuffering,\n drainBuffer,\n disableBuffering,\n pushBufferMessage,\n type StartupMessage,\n} from \"../utils/logger.js\";\nimport { ERROR_MESSAGES, INFO_MESSAGES, STATUS_MESSAGES } from \"../utils/messages.js\";\n\nfunction formatSourceDisplayName(sourceName: string): string {\n return SOURCE_DISPLAY_NAMES[sourceName] ?? sourceName;\n}\n\nexport default class Edit extends BaseCommand {\n static summary = \"Edit skills in the plugin\";\n static description = \"Modify the currently installed skills via interactive wizard\";\n\n static examples = [\n {\n description: \"Open the edit wizard\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n {\n description: \"Edit with a custom source\",\n command: \"<%= config.bin %> <%= command.id %> --source github:org/marketplace\",\n },\n {\n description: \"Force refresh skills from remote\",\n command: \"<%= config.bin %> <%= command.id %> --refresh\",\n },\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n refresh: Flags.boolean({\n description: \"Force refresh from remote sources\",\n default: false,\n }),\n \"agent-source\": Flags.string({\n description: \"Remote agent partials source (default: local CLI)\",\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(Edit);\n\n const installation = await detectInstallation();\n\n if (!installation) {\n this.error(ERROR_MESSAGES.NO_INSTALLATION, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n const projectDir = installation.projectDir;\n\n enableBuffering();\n\n if (installation.projectDir === os.homedir()) {\n pushBufferMessage(\n \"info\",\n \"No project installation found. Using global installation from ~/.claude-src/\",\n );\n }\n let sourceResult;\n let startupMessages: StartupMessage[] = [];\n try {\n sourceResult = await loadSkillsMatrixFromSource({\n sourceFlag: flags.source,\n projectDir,\n forceRefresh: flags.refresh,\n });\n\n const sourceInfo = sourceResult.isLocal ? \"local\" : sourceResult.sourceConfig.sourceOrigin;\n pushBufferMessage(\n \"info\",\n `Loaded ${Object.keys(matrix.skills).length} skills (${sourceInfo})`,\n );\n } catch (error) {\n disableBuffering();\n this.handleError(error);\n }\n\n const projectConfig = await loadProjectConfig(projectDir);\n\n let currentSkillIds: SkillId[];\n try {\n const discoveredSkills = await discoverAllPluginSkills(projectDir);\n // Boundary cast: discoverAllPluginSkills keys are skill IDs from frontmatter\n currentSkillIds = Object.keys(discoveredSkills) as SkillId[];\n\n // In local mode, plugin discovery returns empty — fall back to project config skills\n if (currentSkillIds.length === 0 && projectConfig?.config?.skills?.length) {\n currentSkillIds = projectConfig.config.skills.map((s) => s.id);\n pushBufferMessage(\"info\", `Found ${currentSkillIds.length} skills from project config`);\n } else {\n pushBufferMessage(\"info\", `Current plugin has ${currentSkillIds.length} skills`);\n }\n } catch (error) {\n disableBuffering();\n this.handleError(error);\n }\n\n startupMessages = drainBuffer();\n disableBuffering();\n\n let wizardResult: WizardResultV2 | null = null;\n const marketplaceLabel = getMarketplaceLabel(sourceResult);\n\n // D9: In project context, existing global items are read-only (locked).\n // When editing from ~/ (global context), nothing is locked.\n const isGlobalDir = projectDir === GLOBAL_INSTALL_ROOT;\n const lockedSkillIds = isGlobalDir\n ? undefined\n : projectConfig?.config?.skills?.filter((s) => s.scope === \"global\").map((s) => s.id);\n const lockedAgentNames = isGlobalDir\n ? undefined\n : projectConfig?.config?.agents?.filter((a) => a.scope === \"global\").map((a) => a.name);\n\n const { waitUntilExit } = render(\n <Wizard\n version={this.config.version}\n marketplaceLabel={marketplaceLabel}\n initialStep=\"build\"\n initialDomains={projectConfig?.config?.domains}\n initialAgents={projectConfig?.config?.selectedAgents}\n installedSkillIds={currentSkillIds}\n installedSkillConfigs={projectConfig?.config?.skills}\n lockedSkillIds={lockedSkillIds}\n installedAgentConfigs={projectConfig?.config?.agents}\n lockedAgentNames={lockedAgentNames}\n projectDir={projectDir}\n startupMessages={startupMessages}\n onComplete={(result) => {\n wizardResult = result;\n }}\n onCancel={() => {\n this.log(\"\\nEdit cancelled\");\n }}\n />,\n );\n\n await waitUntilExit();\n\n // TypeScript can't track that onComplete callback mutates wizardResult before waitUntilExit resolves\n const result = wizardResult as WizardResultV2 | null;\n\n if (!result || result.cancelled) {\n this.error(\"Cancelled\", { exit: EXIT_CODES.CANCELLED });\n }\n\n if (!result.validation.valid) {\n const errorMessages = result.validation.errors.map((e) => e.message).join(\"\\n \");\n this.error(`Selection has validation errors:\\n ${errorMessages}`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n const newSkillIds = result.skills.map((s) => s.id);\n const addedSkills = newSkillIds.filter((id) => !currentSkillIds.includes(id));\n const removedSkills = currentSkillIds.filter((id) => !newSkillIds.includes(id));\n\n const sourceChanges = new Map<SkillId, { from: string; to: string }>();\n const scopeChanges = new Map<\n SkillId,\n { from: \"project\" | \"global\"; to: \"project\" | \"global\" }\n >();\n if (projectConfig?.config?.skills) {\n for (const newSkill of result.skills) {\n const oldSkill = projectConfig.config.skills.find((s) => s.id === newSkill.id);\n if (oldSkill && oldSkill.source !== newSkill.source) {\n sourceChanges.set(newSkill.id, {\n from: oldSkill.source,\n to: newSkill.source,\n });\n }\n if (oldSkill && oldSkill.scope !== newSkill.scope) {\n scopeChanges.set(newSkill.id, {\n from: oldSkill.scope,\n to: newSkill.scope,\n });\n }\n }\n }\n\n const agentScopeChanges = new Map<\n AgentName,\n { from: \"project\" | \"global\"; to: \"project\" | \"global\" }\n >();\n if (projectConfig?.config?.agents) {\n for (const newAgent of result.agentConfigs) {\n const oldAgent = projectConfig.config.agents.find((a) => a.name === newAgent.name);\n if (oldAgent && oldAgent.scope !== newAgent.scope) {\n agentScopeChanges.set(newAgent.name, {\n from: oldAgent.scope,\n to: newAgent.scope,\n });\n }\n }\n }\n\n const hasSourceChanges = sourceChanges.size > 0;\n const hasScopeChanges = scopeChanges.size > 0;\n const hasAgentScopeChanges = agentScopeChanges.size > 0;\n const hasSkillChanges = addedSkills.length > 0 || removedSkills.length > 0;\n\n if (!hasSkillChanges && !hasSourceChanges && !hasScopeChanges && !hasAgentScopeChanges) {\n this.log(INFO_MESSAGES.NO_CHANGES_MADE);\n this.log(\"Plugin unchanged\\n\");\n return;\n }\n\n this.log(\"\\nChanges:\");\n for (const skillId of addedSkills) {\n this.log(` + ${getSkillById(skillId).displayName}`);\n }\n for (const skillId of removedSkills) {\n const skill = matrix.skills[skillId];\n this.log(` - ${skill?.displayName ?? skillId}`);\n }\n for (const [skillId, change] of sourceChanges) {\n const fromLabel = formatSourceDisplayName(change.from);\n const toLabel = formatSourceDisplayName(change.to);\n this.log(` ~ ${skillId} (${fromLabel} \\u2192 ${toLabel})`);\n }\n for (const [skillId, change] of scopeChanges) {\n const fromLabel = change.from === \"global\" ? \"[G]\" : \"[P]\";\n const toLabel = change.to === \"global\" ? \"[G]\" : \"[P]\";\n this.log(` ~ ${skillId} (${fromLabel} \\u2192 ${toLabel})`);\n }\n for (const [agentName, change] of agentScopeChanges) {\n const fromLabel = change.from === \"global\" ? \"[G]\" : \"[P]\";\n const toLabel = change.to === \"global\" ? \"[G]\" : \"[P]\";\n this.log(` ~ ${agentName} (${fromLabel} \\u2192 ${toLabel})`);\n }\n this.log(\"\");\n\n // Handle per-skill mode migrations (local <-> plugin)\n const oldSkills = projectConfig?.config?.skills ?? [];\n const migrationPlan = detectMigrations(oldSkills, result.skills);\n const hasMigrations = migrationPlan.toLocal.length > 0 || migrationPlan.toPlugin.length > 0;\n\n if (hasMigrations) {\n if (migrationPlan.toLocal.length > 0) {\n this.log(`Switching ${migrationPlan.toLocal.length} skill(s) to local:`);\n for (const migration of migrationPlan.toLocal) {\n this.log(` - ${migration.id}`);\n }\n }\n if (migrationPlan.toPlugin.length > 0) {\n this.log(`Switching ${migrationPlan.toPlugin.length} skill(s) to plugin:`);\n for (const migration of migrationPlan.toPlugin) {\n this.log(` - ${migration.id}`);\n }\n }\n\n const migrationResult = await executeMigration(migrationPlan, projectDir, sourceResult);\n\n for (const warning of migrationResult.warnings) {\n this.warn(warning);\n }\n }\n\n const migratedSkillIds = new Set([\n ...migrationPlan.toLocal.map((m) => m.id),\n ...migrationPlan.toPlugin.map((m) => m.id),\n ]);\n\n // Handle scope migrations (P→G or G→P) for local-mode skills\n for (const [skillId, change] of scopeChanges) {\n const skillConfig = result.skills.find((s) => s.id === skillId);\n if (skillConfig?.source === \"local\") {\n await migrateLocalSkillScope(skillId, change.from, projectDir);\n } else if (sourceResult.marketplace && skillConfig) {\n // Plugin-mode scope change: uninstall from old scope, install to new scope\n const oldPluginScope = change.from === \"global\" ? \"user\" : \"project\";\n const newPluginScope = change.to === \"global\" ? \"user\" : \"project\";\n try {\n await claudePluginUninstall(skillId, oldPluginScope, projectDir);\n const pluginRef = `${skillId}@${sourceResult.marketplace}`;\n await claudePluginInstall(pluginRef, newPluginScope, projectDir);\n } catch (error) {\n this.warn(`Failed to migrate plugin scope for ${skillId}: ${getErrorMessage(error)}`);\n }\n }\n }\n\n // Handle remaining non-migration source changes (e.g., marketplace A -> marketplace B)\n for (const [skillId, change] of sourceChanges) {\n // Skip skills already handled by mode migration\n if (migratedSkillIds.has(skillId)) {\n continue;\n }\n if (change.from === \"local\") {\n await deleteLocalSkill(projectDir, skillId);\n }\n }\n\n if (sourceResult.marketplace) {\n const marketplaceExists = await claudePluginMarketplaceExists(sourceResult.marketplace);\n if (!marketplaceExists) {\n this.log(`Registering marketplace \"${sourceResult.marketplace}\"...`);\n const marketplaceSource = sourceResult.sourceConfig.source.replace(/^github:/, \"\");\n await claudePluginMarketplaceAdd(marketplaceSource);\n this.log(`Registered marketplace: ${sourceResult.marketplace}`);\n }\n\n for (const skillId of addedSkills) {\n // Find the skill config to get its scope\n const skillConfig = result.skills.find((s) => s.id === skillId);\n if (!skillConfig || skillConfig.source === \"local\") continue;\n\n const pluginRef = `${skillId}@${sourceResult.marketplace}`;\n const pluginScope = skillConfig.scope === \"global\" ? \"user\" : \"project\";\n this.log(`Installing plugin: ${pluginRef}...`);\n try {\n await claudePluginInstall(pluginRef, pluginScope, projectDir);\n } catch (error) {\n this.warn(`Failed to install plugin ${pluginRef}: ${getErrorMessage(error)}`);\n }\n }\n for (const skillId of removedSkills) {\n // For removed skills, use old config to determine scope\n const oldSkill = projectConfig?.config?.skills?.find((s) => s.id === skillId);\n const pluginScope = oldSkill?.scope === \"global\" ? \"user\" : \"project\";\n this.log(`Uninstalling plugin: ${skillId}...`);\n try {\n await claudePluginUninstall(skillId, pluginScope, projectDir);\n } catch (error) {\n this.warn(`Failed to uninstall plugin ${skillId}: ${getErrorMessage(error)}`);\n }\n }\n }\n\n // Load agent definitions first — needed for both config-types.ts and recompilation\n let sourcePath: string;\n this.log(\n flags[\"agent-source\"]\n ? STATUS_MESSAGES.FETCHING_AGENT_PARTIALS\n : STATUS_MESSAGES.LOADING_AGENT_PARTIALS,\n );\n try {\n const agentDefs = await getAgentDefinitions(flags[\"agent-source\"], {\n forceRefresh: flags.refresh,\n });\n sourcePath = agentDefs.sourcePath;\n this.log(flags[\"agent-source\"] ? \"✓ Agent partials fetched\\n\" : \"✓ Agent partials loaded\\n\");\n } catch (error) {\n this.handleError(error);\n }\n\n // Persist wizard result to config.ts and config-types.ts (split by scope when in project context)\n try {\n const mergeResult = await buildAndMergeConfig(result, sourceResult, projectDir, flags.source);\n\n // Load full agent definitions for config-types.ts generation\n const cliAgents = await loadAllAgents(PROJECT_ROOT);\n const sourceAgents = await loadAllAgents(sourcePath);\n const agents: Record<AgentName, AgentDefinition> = { ...cliAgents, ...sourceAgents };\n\n await writeScopedConfigs(\n mergeResult.config,\n sourceResult.matrix,\n agents,\n projectDir,\n installation.configPath,\n );\n } catch (error) {\n this.warn(`Could not update config: ${getErrorMessage(error)}`);\n }\n\n this.log(STATUS_MESSAGES.RECOMPILING_AGENTS);\n try {\n const recompileSkills = await discoverAllPluginSkills(projectDir);\n\n // Build scope map so recompileAgents routes agents to the correct directory:\n // global agents -> ~/.claude/agents/, project agents -> installation.agentsDir\n const agentScopeMap = new Map(result.agentConfigs.map((a) => [a.name, a.scope] as const));\n\n const recompileResult = await recompileAgents({\n pluginDir: projectDir,\n sourcePath,\n skills: recompileSkills,\n projectDir,\n outputDir: installation.agentsDir,\n installMode: deriveInstallMode(result.skills),\n agentScopeMap,\n });\n\n if (recompileResult.failed.length > 0) {\n this.log(\n `✓ Recompiled ${recompileResult.compiled.length} agents (${recompileResult.failed.length} failed)\\n`,\n );\n for (const warning of recompileResult.warnings) {\n this.warn(warning);\n }\n } else if (recompileResult.compiled.length > 0) {\n this.log(`✓ Recompiled ${recompileResult.compiled.length} agents\\n`);\n } else {\n this.log(\"✓ No agents to recompile\\n\");\n }\n } catch (error) {\n this.warn(`Agent recompilation failed: ${getErrorMessage(error)}`);\n this.log(`You can manually recompile with '${CLI_BIN_NAME} compile'.\\n`);\n }\n\n const summaryParts = [`${addedSkills.length} added`, `${removedSkills.length} removed`];\n if (hasSourceChanges) {\n summaryParts.push(`${sourceChanges.size} source${sourceChanges.size > 1 ? \"s\" : \"\"} changed`);\n }\n if (hasScopeChanges || hasAgentScopeChanges) {\n const totalScopeChanges = scopeChanges.size + agentScopeChanges.size;\n summaryParts.push(`${totalScopeChanges} scope${totalScopeChanges > 1 ? \"s\" : \"\"} changed`);\n }\n this.log(`\\n\\u2713 Plugin updated! (${summaryParts.join(\", \")})\\n`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,QAAQ;AAEf,SAAS,aAAa;AACtB,SAAS,cAAc;AA6JjB;AA/GN,SAAS,wBAAwB,YAA4B;AAC3D,SAAO,qBAAqB,UAAU,KAAK;AAC7C;AAEA,IAAqB,OAArB,MAAqB,cAAa,YAAY;AAAA,EAC5C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port path from \"path\";\n\nimport { Flags } from \"@oclif/core\";\nimport { render } from \"ink\";\n\nimport { BaseCommand } from \"../base-command.js\";\nimport { Wizard, type WizardResultV2 } from \"../components/wizard/wizard.js\";\nimport {\n CLAUDE_DIR,\n CLAUDE_SRC_DIR,\n CLI_BIN_NAME,\n GLOBAL_INSTALL_ROOT,\n PROJECT_ROOT,\n SOURCE_DISPLAY_NAMES,\n STANDARD_FILES,\n} from \"../consts.js\";\nimport { getAgentDefinitions, recompileAgents } from \"../lib/agents/index.js\";\nimport { loadProjectConfig } from \"../lib/configuration/index.js\";\nimport { ensureBlankGlobalConfig } from \"../lib/configuration/config-writer.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport {\n detectInstallation,\n buildAndMergeConfig,\n writeScopedConfigs,\n detectMigrations,\n executeMigration,\n deriveInstallMode,\n} from \"../lib/installation/index.js\";\nimport {\n getMarketplaceLabel,\n loadAllAgents,\n loadSkillsMatrixFromSource,\n} from \"../lib/loading/index.js\";\nimport { matrix, getSkillById } from \"../lib/matrix/matrix-provider\";\nimport { discoverAllPluginSkills } from \"../lib/plugins/index.js\";\nimport { deleteLocalSkill, migrateLocalSkillScope } from \"../lib/skills/index.js\";\nimport type { AgentDefinition, AgentName, SkillId } from \"../types/index.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport {\n claudePluginInstall,\n claudePluginUninstall,\n claudePluginMarketplaceExists,\n claudePluginMarketplaceAdd,\n} from \"../utils/exec.js\";\nimport {\n enableBuffering,\n drainBuffer,\n disableBuffering,\n pushBufferMessage,\n type StartupMessage,\n} from \"../utils/logger.js\";\nimport { ERROR_MESSAGES, INFO_MESSAGES, STATUS_MESSAGES } from \"../utils/messages.js\";\n\nfunction formatSourceDisplayName(sourceName: string): string {\n return SOURCE_DISPLAY_NAMES[sourceName] ?? sourceName;\n}\n\nexport default class Edit extends BaseCommand {\n static summary = \"Edit skills in the plugin\";\n static description = \"Modify the currently installed skills via interactive wizard\";\n\n static examples = [\n {\n description: \"Open the edit wizard\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n {\n description: \"Edit with a custom source\",\n command: \"<%= config.bin %> <%= command.id %> --source github:org/marketplace\",\n },\n {\n description: \"Force refresh skills from remote\",\n command: \"<%= config.bin %> <%= command.id %> --refresh\",\n },\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n refresh: Flags.boolean({\n description: \"Force refresh from remote sources\",\n default: false,\n }),\n \"agent-source\": Flags.string({\n description: \"Remote agent partials source (default: local CLI)\",\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(Edit);\n const cwd = process.cwd();\n\n const installation = await detectInstallation();\n\n if (!installation) {\n this.error(ERROR_MESSAGES.NO_INSTALLATION, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n // Use installation.projectDir for reads (loading config, discovering installed skills).\n // Use cwd for writes (config saves, plugin installs, scope migrations, recompilation output)\n // and for the locked-items check (determining whether global items are read-only).\n const projectDir = installation.projectDir;\n\n enableBuffering();\n\n let sourceResult;\n let startupMessages: StartupMessage[] = [];\n try {\n sourceResult = await loadSkillsMatrixFromSource({\n sourceFlag: flags.source,\n projectDir,\n forceRefresh: flags.refresh,\n });\n\n const sourceInfo = sourceResult.isLocal ? \"local\" : sourceResult.sourceConfig.sourceOrigin;\n pushBufferMessage(\n \"info\",\n `Loaded ${Object.keys(matrix.skills).length} skills (${sourceInfo})`,\n );\n } catch (error) {\n disableBuffering();\n this.handleError(error);\n }\n\n const projectConfig = await loadProjectConfig(projectDir);\n\n let currentSkillIds: SkillId[];\n try {\n const discoveredSkills = await discoverAllPluginSkills(projectDir);\n // Boundary cast: discoverAllPluginSkills keys are skill IDs from frontmatter\n currentSkillIds = Object.keys(discoveredSkills) as SkillId[];\n\n // In local mode, plugin discovery returns empty — fall back to project config skills\n if (currentSkillIds.length === 0 && projectConfig?.config?.skills?.length) {\n currentSkillIds = projectConfig.config.skills.map((s) => s.id);\n pushBufferMessage(\"info\", `Found ${currentSkillIds.length} skills from project config`);\n } else {\n pushBufferMessage(\"info\", `Current plugin has ${currentSkillIds.length} skills`);\n }\n } catch (error) {\n disableBuffering();\n this.handleError(error);\n }\n\n startupMessages = drainBuffer();\n disableBuffering();\n\n let wizardResult: WizardResultV2 | null = null;\n const marketplaceLabel = getMarketplaceLabel(sourceResult);\n\n // D9: In project context, existing global items are read-only (locked).\n // When editing from ~/ (global context), nothing is locked.\n // Uses cwd (not projectDir) so that global items are correctly locked\n // even when detectInstallation() fell back to the global installation.\n const isGlobalDir = cwd === GLOBAL_INSTALL_ROOT;\n const lockedSkillIds = isGlobalDir\n ? undefined\n : projectConfig?.config?.skills?.filter((s) => s.scope === \"global\").map((s) => s.id);\n const lockedAgentNames = isGlobalDir\n ? undefined\n : projectConfig?.config?.agents?.filter((a) => a.scope === \"global\").map((a) => a.name);\n\n const { waitUntilExit } = render(\n <Wizard\n version={this.config.version}\n marketplaceLabel={marketplaceLabel}\n initialStep=\"build\"\n initialDomains={projectConfig?.config?.domains}\n initialAgents={projectConfig?.config?.selectedAgents}\n installedSkillIds={currentSkillIds}\n installedSkillConfigs={projectConfig?.config?.skills}\n lockedSkillIds={lockedSkillIds}\n installedAgentConfigs={projectConfig?.config?.agents}\n lockedAgentNames={lockedAgentNames}\n projectDir={projectDir}\n startupMessages={startupMessages}\n onComplete={(result) => {\n wizardResult = result;\n }}\n onCancel={() => {\n this.log(\"\\nEdit cancelled\");\n }}\n />,\n );\n\n await waitUntilExit();\n\n // TypeScript can't track that onComplete callback mutates wizardResult before waitUntilExit resolves\n const result = wizardResult as WizardResultV2 | null;\n\n if (!result || result.cancelled) {\n this.error(\"Cancelled\", { exit: EXIT_CODES.CANCELLED });\n }\n\n if (!result.validation.valid) {\n const errorMessages = result.validation.errors.map((e) => e.message).join(\"\\n \");\n this.error(`Selection has validation errors:\\n ${errorMessages}`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n const newSkillIds = result.skills.map((s) => s.id);\n const addedSkills = newSkillIds.filter((id) => !currentSkillIds.includes(id));\n const removedSkills = currentSkillIds.filter((id) => !newSkillIds.includes(id));\n\n const sourceChanges = new Map<SkillId, { from: string; to: string }>();\n const scopeChanges = new Map<\n SkillId,\n { from: \"project\" | \"global\"; to: \"project\" | \"global\" }\n >();\n if (projectConfig?.config?.skills) {\n for (const newSkill of result.skills) {\n const oldSkill = projectConfig.config.skills.find((s) => s.id === newSkill.id);\n if (oldSkill && oldSkill.source !== newSkill.source) {\n sourceChanges.set(newSkill.id, {\n from: oldSkill.source,\n to: newSkill.source,\n });\n }\n if (oldSkill && oldSkill.scope !== newSkill.scope) {\n scopeChanges.set(newSkill.id, {\n from: oldSkill.scope,\n to: newSkill.scope,\n });\n }\n }\n }\n\n const agentScopeChanges = new Map<\n AgentName,\n { from: \"project\" | \"global\"; to: \"project\" | \"global\" }\n >();\n if (projectConfig?.config?.agents) {\n for (const newAgent of result.agentConfigs) {\n const oldAgent = projectConfig.config.agents.find((a) => a.name === newAgent.name);\n if (oldAgent && oldAgent.scope !== newAgent.scope) {\n agentScopeChanges.set(newAgent.name, {\n from: oldAgent.scope,\n to: newAgent.scope,\n });\n }\n }\n }\n\n const hasSourceChanges = sourceChanges.size > 0;\n const hasScopeChanges = scopeChanges.size > 0;\n const hasAgentScopeChanges = agentScopeChanges.size > 0;\n const hasSkillChanges = addedSkills.length > 0 || removedSkills.length > 0;\n\n if (!hasSkillChanges && !hasSourceChanges && !hasScopeChanges && !hasAgentScopeChanges) {\n this.log(INFO_MESSAGES.NO_CHANGES_MADE);\n this.log(\"Plugin unchanged\\n\");\n return;\n }\n\n this.log(\"\\nChanges:\");\n for (const skillId of addedSkills) {\n this.log(` + ${getSkillById(skillId).displayName}`);\n }\n for (const skillId of removedSkills) {\n const skill = matrix.skills[skillId];\n this.log(` - ${skill?.displayName ?? skillId}`);\n }\n for (const [skillId, change] of sourceChanges) {\n const fromLabel = formatSourceDisplayName(change.from);\n const toLabel = formatSourceDisplayName(change.to);\n this.log(` ~ ${skillId} (${fromLabel} \\u2192 ${toLabel})`);\n }\n for (const [skillId, change] of scopeChanges) {\n const fromLabel = change.from === \"global\" ? \"[G]\" : \"[P]\";\n const toLabel = change.to === \"global\" ? \"[G]\" : \"[P]\";\n this.log(` ~ ${skillId} (${fromLabel} \\u2192 ${toLabel})`);\n }\n for (const [agentName, change] of agentScopeChanges) {\n const fromLabel = change.from === \"global\" ? \"[G]\" : \"[P]\";\n const toLabel = change.to === \"global\" ? \"[G]\" : \"[P]\";\n this.log(` ~ ${agentName} (${fromLabel} \\u2192 ${toLabel})`);\n }\n this.log(\"\");\n\n // Handle per-skill mode migrations (local <-> plugin)\n const oldSkills = projectConfig?.config?.skills ?? [];\n const migrationPlan = detectMigrations(oldSkills, result.skills);\n const hasMigrations = migrationPlan.toLocal.length > 0 || migrationPlan.toPlugin.length > 0;\n\n if (hasMigrations) {\n if (migrationPlan.toLocal.length > 0) {\n this.log(`Switching ${migrationPlan.toLocal.length} skill(s) to local:`);\n for (const migration of migrationPlan.toLocal) {\n this.log(` - ${migration.id}`);\n }\n }\n if (migrationPlan.toPlugin.length > 0) {\n this.log(`Switching ${migrationPlan.toPlugin.length} skill(s) to plugin:`);\n for (const migration of migrationPlan.toPlugin) {\n this.log(` - ${migration.id}`);\n }\n }\n\n const migrationResult = await executeMigration(migrationPlan, cwd, sourceResult);\n\n for (const warning of migrationResult.warnings) {\n this.warn(warning);\n }\n }\n\n const migratedSkillIds = new Set([\n ...migrationPlan.toLocal.map((m) => m.id),\n ...migrationPlan.toPlugin.map((m) => m.id),\n ]);\n\n // Handle scope migrations (P→G or G→P) for local-mode skills\n for (const [skillId, change] of scopeChanges) {\n const skillConfig = result.skills.find((s) => s.id === skillId);\n if (skillConfig?.source === \"local\") {\n await migrateLocalSkillScope(skillId, change.from, cwd);\n } else if (sourceResult.marketplace && skillConfig) {\n // Plugin-mode scope change: uninstall from old scope, install to new scope\n const oldPluginScope = change.from === \"global\" ? \"user\" : \"project\";\n const newPluginScope = change.to === \"global\" ? \"user\" : \"project\";\n try {\n await claudePluginUninstall(skillId, oldPluginScope, cwd);\n const pluginRef = `${skillId}@${sourceResult.marketplace}`;\n await claudePluginInstall(pluginRef, newPluginScope, cwd);\n } catch (error) {\n this.warn(`Failed to migrate plugin scope for ${skillId}: ${getErrorMessage(error)}`);\n }\n }\n }\n\n // Handle remaining non-migration source changes (e.g., marketplace A -> marketplace B)\n for (const [skillId, change] of sourceChanges) {\n // Skip skills already handled by mode migration\n if (migratedSkillIds.has(skillId)) {\n continue;\n }\n if (change.from === \"local\") {\n await deleteLocalSkill(cwd, skillId);\n }\n }\n\n if (sourceResult.marketplace) {\n const marketplaceExists = await claudePluginMarketplaceExists(sourceResult.marketplace);\n if (!marketplaceExists) {\n this.log(`Registering marketplace \"${sourceResult.marketplace}\"...`);\n const marketplaceSource = sourceResult.sourceConfig.source.replace(/^github:/, \"\");\n await claudePluginMarketplaceAdd(marketplaceSource);\n this.log(`Registered marketplace: ${sourceResult.marketplace}`);\n }\n\n for (const skillId of addedSkills) {\n // Find the skill config to get its scope\n const skillConfig = result.skills.find((s) => s.id === skillId);\n if (!skillConfig || skillConfig.source === \"local\") continue;\n\n const pluginRef = `${skillId}@${sourceResult.marketplace}`;\n const pluginScope = skillConfig.scope === \"global\" ? \"user\" : \"project\";\n this.log(`Installing plugin: ${pluginRef}...`);\n try {\n await claudePluginInstall(pluginRef, pluginScope, cwd);\n } catch (error) {\n this.warn(`Failed to install plugin ${pluginRef}: ${getErrorMessage(error)}`);\n }\n }\n for (const skillId of removedSkills) {\n // For removed skills, use old config to determine scope\n const oldSkill = projectConfig?.config?.skills?.find((s) => s.id === skillId);\n const pluginScope = oldSkill?.scope === \"global\" ? \"user\" : \"project\";\n this.log(`Uninstalling plugin: ${skillId}...`);\n try {\n await claudePluginUninstall(skillId, pluginScope, cwd);\n } catch (error) {\n this.warn(`Failed to uninstall plugin ${skillId}: ${getErrorMessage(error)}`);\n }\n }\n }\n\n // Load agent definitions first — needed for both config-types.ts and recompilation\n let sourcePath: string;\n this.log(\n flags[\"agent-source\"]\n ? STATUS_MESSAGES.FETCHING_AGENT_PARTIALS\n : STATUS_MESSAGES.LOADING_AGENT_PARTIALS,\n );\n try {\n const agentDefs = await getAgentDefinitions(flags[\"agent-source\"], {\n forceRefresh: flags.refresh,\n });\n sourcePath = agentDefs.sourcePath;\n this.log(flags[\"agent-source\"] ? \"✓ Agent partials fetched\\n\" : \"✓ Agent partials loaded\\n\");\n } catch (error) {\n this.handleError(error);\n }\n\n // Persist wizard result to config.ts and config-types.ts (split by scope when in project context)\n try {\n const mergeResult = await buildAndMergeConfig(result, sourceResult, cwd, flags.source);\n\n // Load full agent definitions for config-types.ts generation\n const cliAgents = await loadAllAgents(PROJECT_ROOT);\n const sourceAgents = await loadAllAgents(sourcePath);\n const agents: Record<AgentName, AgentDefinition> = { ...cliAgents, ...sourceAgents };\n\n // Ensure global config exists before writing project config (so the\n // `import globalConfig from \"~/.claude-src/config\"` doesn't throw)\n if (cwd !== os.homedir()) {\n await ensureBlankGlobalConfig();\n }\n\n // Recompute configPath from cwd — when detectInstallation() fell back to\n // global, installation.configPath points to ~/.claude-src/config.ts, but\n // writeScopedConfigs uses it as the project config path.\n const configPath = path.join(cwd, CLAUDE_SRC_DIR, STANDARD_FILES.CONFIG_TS);\n\n // Determine whether a project installation already exists:\n // If detectInstallation() found a project config, projectDir differs from homedir.\n // If it fell back to global, projectDir === homedir (no project installation).\n const projectInstallationExists =\n path.resolve(installation.projectDir) !== path.resolve(os.homedir());\n\n await writeScopedConfigs(\n mergeResult.config,\n sourceResult.matrix,\n agents,\n cwd,\n configPath,\n projectInstallationExists,\n );\n } catch (error) {\n this.warn(`Could not update config: ${getErrorMessage(error)}`);\n }\n\n this.log(STATUS_MESSAGES.RECOMPILING_AGENTS);\n try {\n const recompileSkills = await discoverAllPluginSkills(cwd);\n\n // Build scope map so recompileAgents routes agents to the correct directory:\n // global agents -> ~/.claude/agents/, project agents -> <cwd>/.claude/agents/\n const agentScopeMap = new Map(result.agentConfigs.map((a) => [a.name, a.scope] as const));\n const outputDir = path.join(cwd, CLAUDE_DIR, \"agents\");\n\n const recompileResult = await recompileAgents({\n pluginDir: cwd,\n sourcePath,\n skills: recompileSkills,\n projectDir: cwd,\n outputDir,\n installMode: deriveInstallMode(result.skills),\n agentScopeMap,\n });\n\n if (recompileResult.failed.length > 0) {\n this.log(\n `✓ Recompiled ${recompileResult.compiled.length} agents (${recompileResult.failed.length} failed)\\n`,\n );\n for (const warning of recompileResult.warnings) {\n this.warn(warning);\n }\n } else if (recompileResult.compiled.length > 0) {\n this.log(`✓ Recompiled ${recompileResult.compiled.length} agents\\n`);\n } else {\n this.log(\"✓ No agents to recompile\\n\");\n }\n } catch (error) {\n this.warn(`Agent recompilation failed: ${getErrorMessage(error)}`);\n this.log(`You can manually recompile with '${CLI_BIN_NAME} compile'.\\n`);\n }\n\n const summaryParts = [`${addedSkills.length} added`, `${removedSkills.length} removed`];\n if (hasSourceChanges) {\n summaryParts.push(`${sourceChanges.size} source${sourceChanges.size > 1 ? \"s\" : \"\"} changed`);\n }\n if (hasScopeChanges || hasAgentScopeChanges) {\n const totalScopeChanges = scopeChanges.size + agentScopeChanges.size;\n summaryParts.push(`${totalScopeChanges} scope${totalScopeChanges > 1 ? \"s\" : \"\"} changed`);\n }\n this.log(`\\n\\u2713 Plugin updated! (${summaryParts.join(\", \")})\\n`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAEjB,SAAS,aAAa;AACtB,SAAS,cAAc;AAiKjB;AA/GN,SAAS,wBAAwB,YAA4B;AAC3D,SAAO,qBAAqB,UAAU,KAAK;AAC7C;AAEA,IAAqB,OAArB,MAAqB,cAAa,YAAY;AAAA,EAC5C,OAAO,UAAU;AAAA,EACjB,OAAO,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3F;AACA,SAAK,IAAI;AAAA,0BAA6B,aAAa,KAAK,IAAI,CAAC;AAAA,CAAK;AAAA,EACpE;AACF;","names":["result"]}
@@ -5,7 +5,7 @@ import {
5
5
  loadSkillsMatrixFromSource,
6
6
  resolveSource,
7
7
  saveSourceToProjectConfig
8
- } from "../chunk-UKYWXIDT.js";
8
+ } from "../chunk-FVMYBN5K.js";
9
9
  import "../chunk-RRBWNEG3.js";
10
10
  import {
11
11
  matrix,
@@ -8,7 +8,7 @@ import {
8
8
  computeFileHash,
9
9
  fetchFromSource,
10
10
  getCurrentDate
11
- } from "../../chunk-UKYWXIDT.js";
11
+ } from "../../chunk-FVMYBN5K.js";
12
12
  import "../../chunk-RRBWNEG3.js";
13
13
  import "../../chunk-NG2GGK6P.js";
14
14
  import {
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  discoverLocalSkills,
7
7
  loadSkillsMatrixFromSource
8
- } from "../chunk-UKYWXIDT.js";
8
+ } from "../chunk-FVMYBN5K.js";
9
9
  import "../chunk-RRBWNEG3.js";
10
10
  import {
11
11
  matrix
@@ -4,40 +4,40 @@ import {
4
4
  formatDashboardText,
5
5
  getDashboardData,
6
6
  showDashboard
7
- } from "../chunk-FDIKV4ON.js";
8
- import "../chunk-TJBOCGLR.js";
9
- import "../chunk-JB2QTE7M.js";
7
+ } from "../chunk-SM4FX2IU.js";
8
+ import "../chunk-7SKGMV7P.js";
9
+ import "../chunk-7W226BOV.js";
10
10
  import "../chunk-SXGBPQY6.js";
11
- import "../chunk-2ZQKORJI.js";
12
- import "../chunk-RHAZARG3.js";
11
+ import "../chunk-TUGXTCGX.js";
12
+ import "../chunk-KZG3EQSH.js";
13
13
  import "../chunk-HGTC76BX.js";
14
- import "../chunk-W3GHDONP.js";
15
- import "../chunk-MOWZ2FLG.js";
16
- import "../chunk-STC7IEVI.js";
17
- import "../chunk-2GD57LQE.js";
14
+ import "../chunk-ULP3GGXG.js";
15
+ import "../chunk-Q53GBFTO.js";
16
+ import "../chunk-BQW4ONJE.js";
17
+ import "../chunk-RBR355UI.js";
18
18
  import "../chunk-K77I4XGL.js";
19
- import "../chunk-CJSCCLT5.js";
19
+ import "../chunk-PN65K3LH.js";
20
20
  import "../chunk-MWGDG4QN.js";
21
- import "../chunk-COZ75NET.js";
21
+ import "../chunk-TPXDHJDB.js";
22
22
  import "../chunk-7SOPVGDV.js";
23
- import "../chunk-2MHSOPIU.js";
24
- import "../chunk-JZPQI7YI.js";
23
+ import "../chunk-UFKDY45I.js";
24
+ import "../chunk-X6LXHVA6.js";
25
25
  import "../chunk-GG4BSB6S.js";
26
- import "../chunk-VMTZ5WC5.js";
26
+ import "../chunk-HJY4354Y.js";
27
27
  import "../chunk-LVNNP7T4.js";
28
28
  import "../chunk-OV5UJWS5.js";
29
29
  import "../chunk-XMLCXRTS.js";
30
30
  import "../chunk-AQYAVLZK.js";
31
31
  import "../chunk-AUNBGZS4.js";
32
- import "../chunk-KYULKBFC.js";
32
+ import "../chunk-NA6I5P5P.js";
33
33
  import "../chunk-WF5PMBIR.js";
34
34
  import "../chunk-KUV24B5M.js";
35
- import "../chunk-GFTBHBRQ.js";
35
+ import "../chunk-E3MF6GGS.js";
36
36
  import "../chunk-T5DJCIUP.js";
37
37
  import "../chunk-U3IGFMCY.js";
38
- import "../chunk-6VIOO74O.js";
38
+ import "../chunk-CBYRFAUN.js";
39
39
  import "../chunk-CXRVM7BA.js";
40
- import "../chunk-UKYWXIDT.js";
40
+ import "../chunk-FVMYBN5K.js";
41
41
  import "../chunk-RRBWNEG3.js";
42
42
  import "../chunk-NG2GGK6P.js";
43
43
  import "../chunk-IJLAVOKZ.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  formatInstallationDisplay,
4
4
  getInstallationInfo
5
- } from "../chunk-UKYWXIDT.js";
5
+ } from "../chunk-FVMYBN5K.js";
6
6
  import "../chunk-RRBWNEG3.js";
7
7
  import "../chunk-NG2GGK6P.js";
8
8
  import {
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  getAgentDefinitions
4
- } from "../../chunk-RO6BG4ZW.js";
4
+ } from "../../chunk-7JVDZFJG.js";
5
5
  import {
6
6
  isClaudeCLIAvailable,
7
7
  loadConfigTypesDataInBackground,
8
8
  regenerateConfigTypes,
9
9
  resolveSource
10
- } from "../../chunk-UKYWXIDT.js";
10
+ } from "../../chunk-FVMYBN5K.js";
11
11
  import "../../chunk-RRBWNEG3.js";
12
12
  import "../../chunk-NG2GGK6P.js";
13
13
  import {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  generateSkillCategoriesTs,
4
4
  generateSkillRulesTs
5
- } from "../../chunk-HA35FGPO.js";
5
+ } from "../../chunk-4Q2JLBCX.js";
6
6
  import {
7
7
  generateMarketplace,
8
8
  writeMarketplace
@@ -13,7 +13,7 @@ import {
13
13
  generateConfigSource,
14
14
  loadConfigTypesDataInBackground,
15
15
  regenerateConfigTypes
16
- } from "../../chunk-UKYWXIDT.js";
16
+ } from "../../chunk-FVMYBN5K.js";
17
17
  import "../../chunk-RRBWNEG3.js";
18
18
  import "../../chunk-NG2GGK6P.js";
19
19
  import {
@@ -7,8 +7,8 @@ import {
7
7
  generateSkillRulesTs,
8
8
  toTitleCase,
9
9
  validateSkillName
10
- } from "../../chunk-HA35FGPO.js";
11
- import "../../chunk-UKYWXIDT.js";
10
+ } from "../../chunk-4Q2JLBCX.js";
11
+ import "../../chunk-FVMYBN5K.js";
12
12
  import "../../chunk-RRBWNEG3.js";
13
13
  import "../../chunk-NG2GGK6P.js";
14
14
  import "../../chunk-IJLAVOKZ.js";
@@ -3,7 +3,7 @@ import {
3
3
  compareLocalSkillsWithSource,
4
4
  detectInstallation,
5
5
  loadSkillsMatrixFromSource
6
- } from "../chunk-UKYWXIDT.js";
6
+ } from "../chunk-FVMYBN5K.js";
7
7
  import "../chunk-RRBWNEG3.js";
8
8
  import {
9
9
  typedEntries
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  SkillSearch
4
- } from "../chunk-MVYJVKVT.js";
4
+ } from "../chunk-HT5KOOUQ.js";
5
5
  import "../chunk-T5DJCIUP.js";
6
6
  import "../chunk-U3IGFMCY.js";
7
- import "../chunk-6VIOO74O.js";
7
+ import "../chunk-CBYRFAUN.js";
8
8
  import {
9
9
  INFO_MESSAGES,
10
10
  STATUS_MESSAGES,
@@ -14,7 +14,7 @@ import {
14
14
  fetchFromSource,
15
15
  loadSkillsMatrixFromSource,
16
16
  resolveAllSources
17
- } from "../chunk-UKYWXIDT.js";
17
+ } from "../chunk-FVMYBN5K.js";
18
18
  import {
19
19
  parseFrontmatter
20
20
  } from "../chunk-RRBWNEG3.js";
@@ -13,7 +13,7 @@ import {
13
13
  listPluginNames,
14
14
  loadProjectSourceConfig,
15
15
  readForkedFromMetadata
16
- } from "../chunk-UKYWXIDT.js";
16
+ } from "../chunk-FVMYBN5K.js";
17
17
  import "../chunk-RRBWNEG3.js";
18
18
  import "../chunk-NG2GGK6P.js";
19
19
  import {
@@ -4,7 +4,7 @@ import {
4
4
  } from "../chunk-N6S7ZRIL.js";
5
5
  import {
6
6
  recompileAgents
7
- } from "../chunk-RO6BG4ZW.js";
7
+ } from "../chunk-7JVDZFJG.js";
8
8
  import {
9
9
  ERROR_MESSAGES,
10
10
  INFO_MESSAGES,
@@ -15,7 +15,7 @@ import {
15
15
  compareLocalSkillsWithSource,
16
16
  injectForkedFromMetadata,
17
17
  loadSkillsMatrixFromSource
18
- } from "../chunk-UKYWXIDT.js";
18
+ } from "../chunk-FVMYBN5K.js";
19
19
  import "../chunk-RRBWNEG3.js";
20
20
  import {
21
21
  matrix