agents-inc 0.172.0 → 0.173.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 (59) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/{chunk-MBIOZ5LW.js → chunk-2RTBSLSR.js} +2 -2
  3. package/dist/{chunk-255DGUCH.js → chunk-3N4FSTVX.js} +12 -6
  4. package/dist/{chunk-255DGUCH.js.map → chunk-3N4FSTVX.js.map} +1 -1
  5. package/dist/{chunk-5MGRHS2G.js → chunk-AARQBW5L.js} +22 -12
  6. package/dist/chunk-AARQBW5L.js.map +1 -0
  7. package/dist/{chunk-NISWBQNS.js → chunk-BRZA7ZCX.js} +3 -3
  8. package/dist/{chunk-LUKDDHSI.js → chunk-EHJIQDXR.js} +2 -2
  9. package/dist/{chunk-MOL2J5HS.js → chunk-F437ICEG.js} +2 -2
  10. package/dist/{chunk-KCLBLK3F.js → chunk-ITQF35UQ.js} +3 -3
  11. package/dist/{chunk-7ZOWSCAO.js → chunk-LJQXQTFC.js} +2 -2
  12. package/dist/{chunk-6LUTY35Q.js → chunk-Q4UNHVPX.js} +4 -4
  13. package/dist/{chunk-33JICQD5.js → chunk-Q6WRR4BN.js} +4 -5
  14. package/dist/{chunk-33JICQD5.js.map → chunk-Q6WRR4BN.js.map} +1 -1
  15. package/dist/{chunk-5PPB6HT6.js → chunk-SPQSNZMM.js} +2 -2
  16. package/dist/{chunk-Y23MP2OC.js → chunk-VR6QTK5Z.js} +3 -3
  17. package/dist/{chunk-6CRA46YO.js → chunk-VSPC74SS.js} +41 -19
  18. package/dist/chunk-VSPC74SS.js.map +1 -0
  19. package/dist/{chunk-VILFCMRN.js → chunk-WVFBBZEP.js} +252 -102
  20. package/dist/chunk-WVFBBZEP.js.map +1 -0
  21. package/dist/commands/build/marketplace.js +2 -2
  22. package/dist/commands/build/plugins.js +4 -4
  23. package/dist/commands/compile.js +10 -10
  24. package/dist/commands/doctor.js +31 -13
  25. package/dist/commands/doctor.js.map +1 -1
  26. package/dist/commands/edit.js +13 -13
  27. package/dist/commands/eject.js +23 -28
  28. package/dist/commands/eject.js.map +1 -1
  29. package/dist/commands/init.js +12 -12
  30. package/dist/commands/list.js +3 -3
  31. package/dist/commands/new/marketplace.js +2 -2
  32. package/dist/commands/search.js +7 -7
  33. package/dist/commands/share.js +6 -6
  34. package/dist/commands/uninstall.js +45 -41
  35. package/dist/commands/uninstall.js.map +1 -1
  36. package/dist/commands/update.js +4 -4
  37. package/dist/components/common/summary-panel.js +1 -1
  38. package/dist/hooks/init.js +29 -20
  39. package/dist/hooks/init.js.map +1 -1
  40. package/dist/load-agent-defs-E67DSYTN.js +14 -0
  41. package/dist/{recompile-project-agents-5A44NJRD.js → recompile-project-agents-6G6M2RS6.js} +6 -6
  42. package/dist/{source-loader-LQNRI5UZ.js → source-loader-W7XCNKNA.js} +2 -2
  43. package/package.json +1 -1
  44. package/dist/chunk-5MGRHS2G.js.map +0 -1
  45. package/dist/chunk-6CRA46YO.js.map +0 -1
  46. package/dist/chunk-VILFCMRN.js.map +0 -1
  47. package/dist/load-agent-defs-54VIKN4T.js +0 -14
  48. /package/dist/{chunk-MBIOZ5LW.js.map → chunk-2RTBSLSR.js.map} +0 -0
  49. /package/dist/{chunk-NISWBQNS.js.map → chunk-BRZA7ZCX.js.map} +0 -0
  50. /package/dist/{chunk-LUKDDHSI.js.map → chunk-EHJIQDXR.js.map} +0 -0
  51. /package/dist/{chunk-MOL2J5HS.js.map → chunk-F437ICEG.js.map} +0 -0
  52. /package/dist/{chunk-KCLBLK3F.js.map → chunk-ITQF35UQ.js.map} +0 -0
  53. /package/dist/{chunk-7ZOWSCAO.js.map → chunk-LJQXQTFC.js.map} +0 -0
  54. /package/dist/{chunk-6LUTY35Q.js.map → chunk-Q4UNHVPX.js.map} +0 -0
  55. /package/dist/{chunk-5PPB6HT6.js.map → chunk-SPQSNZMM.js.map} +0 -0
  56. /package/dist/{chunk-Y23MP2OC.js.map → chunk-VR6QTK5Z.js.map} +0 -0
  57. /package/dist/{load-agent-defs-54VIKN4T.js.map → load-agent-defs-E67DSYTN.js.map} +0 -0
  58. /package/dist/{recompile-project-agents-5A44NJRD.js.map → recompile-project-agents-6G6M2RS6.js.map} +0 -0
  59. /package/dist/{source-loader-LQNRI5UZ.js.map → source-loader-W7XCNKNA.js.map} +0 -0
@@ -6,13 +6,13 @@ import {
6
6
  editorPayloadForInstallation,
7
7
  publishSeedConfig,
8
8
  skillsAuthoredHere
9
- } from "../chunk-6LUTY35Q.js";
9
+ } from "../chunk-Q4UNHVPX.js";
10
10
  import {
11
11
  unofferablePlacementsFound
12
- } from "../chunk-MOL2J5HS.js";
12
+ } from "../chunk-F437ICEG.js";
13
13
  import {
14
14
  openUrl
15
- } from "../chunk-5PPB6HT6.js";
15
+ } from "../chunk-SPQSNZMM.js";
16
16
  import {
17
17
  fetchSeedConfig
18
18
  } from "../chunk-A3ZAXL5T.js";
@@ -24,11 +24,11 @@ import {
24
24
  } from "../chunk-P6CYS4JK.js";
25
25
  import {
26
26
  summaryPanelBlock
27
- } from "../chunk-33JICQD5.js";
27
+ } from "../chunk-Q6WRR4BN.js";
28
28
  import "../chunk-N33AKFLR.js";
29
29
  import {
30
30
  hostCompileNotices
31
- } from "../chunk-255DGUCH.js";
31
+ } from "../chunk-3N4FSTVX.js";
32
32
  import {
33
33
  compileAgentsAllScopes,
34
34
  compileProjectScope,
@@ -38,18 +38,18 @@ import {
38
38
  projectsAFanOutReaches,
39
39
  sayCapturedWarnings,
40
40
  writeProjectConfig
41
- } from "../chunk-6CRA46YO.js";
41
+ } from "../chunk-VSPC74SS.js";
42
42
  import {
43
43
  copyLocalSkills,
44
44
  discoverInstalledSkills,
45
45
  removeCompiledAgents,
46
46
  uninstallPluginSkills
47
- } from "../chunk-Y23MP2OC.js";
47
+ } from "../chunk-VR6QTK5Z.js";
48
48
  import {
49
49
  loadAgentDefs
50
- } from "../chunk-KCLBLK3F.js";
51
- import "../chunk-NISWBQNS.js";
52
- import "../chunk-LUKDDHSI.js";
50
+ } from "../chunk-ITQF35UQ.js";
51
+ import "../chunk-BRZA7ZCX.js";
52
+ import "../chunk-EHJIQDXR.js";
53
53
  import "../chunk-KIK5EZYD.js";
54
54
  import {
55
55
  agentChangesAmong,
@@ -60,7 +60,7 @@ import {
60
60
  providerFlag,
61
61
  providerNamedBy,
62
62
  refuseAnAmbiguousInstallation
63
- } from "../chunk-MBIOZ5LW.js";
63
+ } from "../chunk-2RTBSLSR.js";
64
64
  import {
65
65
  BaseCommand,
66
66
  EXIT_CODES,
@@ -74,7 +74,7 @@ import {
74
74
  restoreInstalledGlobal,
75
75
  sameAssignments,
76
76
  writeExternalSkills
77
- } from "../chunk-7ZOWSCAO.js";
77
+ } from "../chunk-LJQXQTFC.js";
78
78
  import {
79
79
  ERROR_MESSAGES,
80
80
  INCOMPLETE_WORK_RECOVERY,
@@ -117,7 +117,7 @@ import {
117
117
  sharedConfigNeedsTerminal,
118
118
  subAgentChanged,
119
119
  unplaceableKept
120
- } from "../chunk-VILFCMRN.js";
120
+ } from "../chunk-WVFBBZEP.js";
121
121
  import {
122
122
  getSkillById,
123
123
  getSkillDisplayName,
@@ -5,20 +5,20 @@ import {
5
5
  loadSource,
6
6
  mutateGlobal,
7
7
  writeProjectPartial
8
- } from "../chunk-6CRA46YO.js";
9
- import "../chunk-Y23MP2OC.js";
10
- import "../chunk-KCLBLK3F.js";
11
- import "../chunk-NISWBQNS.js";
12
- import "../chunk-LUKDDHSI.js";
8
+ } from "../chunk-VSPC74SS.js";
9
+ import "../chunk-VR6QTK5Z.js";
10
+ import "../chunk-ITQF35UQ.js";
11
+ import "../chunk-BRZA7ZCX.js";
12
+ import "../chunk-EHJIQDXR.js";
13
13
  import {
14
14
  providerFlag,
15
15
  providerNamedBy,
16
16
  refuseAnAmbiguousInstallation
17
- } from "../chunk-MBIOZ5LW.js";
17
+ } from "../chunk-2RTBSLSR.js";
18
18
  import {
19
19
  BaseCommand,
20
20
  EXIT_CODES
21
- } from "../chunk-7ZOWSCAO.js";
21
+ } from "../chunk-LJQXQTFC.js";
22
22
  import {
23
23
  INCOMPLETE_WORK_RECOVERY,
24
24
  INFO_MESSAGES,
@@ -37,7 +37,7 @@ import {
37
37
  resolveInstallPaths,
38
38
  resolveSource,
39
39
  sourceFolderInUse
40
- } from "../chunk-VILFCMRN.js";
40
+ } from "../chunk-WVFBBZEP.js";
41
41
  import {
42
42
  matrix,
43
43
  plural
@@ -57,6 +57,9 @@ var EJECT_TYPES = ["agent-partials", "templates", "skills", "all"];
57
57
  function isEjectType(value) {
58
58
  return EJECT_TYPES.includes(value);
59
59
  }
60
+ function loadedSourceOf(plan) {
61
+ return "sourceResult" in plan ? plan.sourceResult : void 0;
62
+ }
60
63
  var Eject = class _Eject extends BaseCommand {
61
64
  static summary = "Eject skills, agent partials, or templates for local customization";
62
65
  static description = "Copy agent partials, templates, or skills to your project for customization. Agent partials and templates are always copied from the CLI. Skills are copied from the marketplace this installation is configured to read (the public one by default).";
@@ -118,9 +121,9 @@ var Eject = class _Eject extends BaseCommand {
118
121
  await this.resolveBrandingName(projectDir),
119
122
  flags.output ? outputBase : void 0
120
123
  );
121
- const sourceResult = await this.loadSourceIfNeeded(ejectType, projectDir);
122
- await this.executeEject(ejectType, outputBase, flags, projectDir, sourceResult);
123
- await this.ensureConfig(projectDir, sourceResult);
124
+ const plan = await this.planEject(ejectType, projectDir);
125
+ await this.executeEject(plan, outputBase, flags, projectDir);
126
+ await this.ensureConfig(projectDir, loadedSourceOf(plan));
124
127
  this.reportEnding();
125
128
  }
126
129
  /** Withholds `Eject complete!` when part of the eject did not land. */
@@ -170,16 +173,14 @@ var Eject = class _Eject extends BaseCommand {
170
173
  this.log(`Output directory: ${outputBase}`);
171
174
  }
172
175
  }
173
- async loadSourceIfNeeded(ejectType, projectDir) {
174
- if (ejectType === "skills" || ejectType === "all") {
175
- const loaded = await loadSource({ projectDir });
176
- return loaded.sourceResult;
177
- }
178
- return void 0;
176
+ async planEject(type, projectDir) {
177
+ if (type === "agent-partials" || type === "templates") return { type };
178
+ const { sourceResult } = await loadSource({ projectDir });
179
+ return { type, sourceResult };
179
180
  }
180
- async executeEject(ejectType, outputBase, flags, projectDir, sourceResult) {
181
+ async executeEject(plan, outputBase, flags, projectDir) {
181
182
  const directOutput = !!flags.output;
182
- switch (ejectType) {
183
+ switch (plan.type) {
183
184
  case "agent-partials":
184
185
  await this.handleAgentPartials(outputBase, flags.force, directOutput, false);
185
186
  break;
@@ -187,29 +188,23 @@ var Eject = class _Eject extends BaseCommand {
187
188
  await this.handleAgentPartials(outputBase, flags.force, directOutput, true);
188
189
  break;
189
190
  case "skills":
190
- if (!sourceResult) {
191
- throw new Error("The marketplace must be loaded for skills eject");
192
- }
193
191
  await this.handleSkills(
194
192
  skillsDestination(projectDir, directOutput, outputBase),
195
193
  flags.force,
196
- sourceResult
194
+ plan.sourceResult
197
195
  );
198
196
  break;
199
197
  case "all": {
200
- if (!sourceResult) {
201
- throw new Error("The marketplace must be loaded for full eject");
202
- }
203
198
  await this.handleAgentPartials(outputBase, flags.force, directOutput, false);
204
199
  await this.handleSkills(
205
200
  skillsDestination(projectDir, directOutput, outputBase),
206
201
  flags.force,
207
- sourceResult
202
+ plan.sourceResult
208
203
  );
209
204
  break;
210
205
  }
211
206
  default: {
212
- const _exhaustive = ejectType;
207
+ const _exhaustive = plan;
213
208
  return _exhaustive;
214
209
  }
215
210
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cli/commands/eject.ts"],"sourcesContent":["import { Args, Flags } from \"@oclif/core\";\nimport path from \"path\";\nimport os from \"os\";\nimport { BaseCommand } from \"../base-command.js\";\nimport {\n copy,\n ensureDir,\n directoryExists,\n fileExists,\n isSymlink,\n listDirectories,\n} from \"../utils/fs.js\";\nimport { DIRS, PROJECT_ROOT } from \"../consts.js\";\nimport {\n providerInUse,\n relativeConfigPath,\n sourceFolderInUse,\n} from \"../lib/installation/install-layout.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { type SourceLoadResult } from \"../lib/loading/index.js\";\nimport { loadSource } from \"../lib/operations/index.js\";\nimport { matrix } from \"../lib/matrix/matrix-provider\";\nimport { resolveSource, getProjectConfigPath } from \"../lib/configuration/index.js\";\nimport {\n ensureBlankPair,\n lazyGateDeps,\n mutateGlobal,\n writeProjectPartial,\n} from \"../lib/config-gate/index.js\";\nimport { isHomeDirectory, resolveInstallPaths } from \"../lib/installation/index.js\";\nimport {\n providerFlag,\n providerNamedBy,\n refuseAnAmbiguousInstallation,\n} from \"../lib/installation/provider-flag.js\";\nimport { copySkillsToLocalFlattened, type CopiedSkill } from \"../lib/skills/index.js\";\nimport { INCOMPLETE_WORK_RECOVERY, INFO_MESSAGES } from \"../utils/messages.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport { bytewise, plural } from \"../utils/string.js\";\nimport type { MergedSkillsMatrix } from \"../types/index.js\";\n\nconst EJECT_TYPES = [\"agent-partials\", \"templates\", \"skills\", \"all\"] as const;\ntype EjectType = (typeof EJECT_TYPES)[number];\n\nfunction isEjectType(value: string): value is EjectType {\n return (EJECT_TYPES as readonly string[]).includes(value);\n}\n\nexport default class Eject extends BaseCommand {\n static summary = \"Eject skills, agent partials, or templates for local customization\";\n static description =\n \"Copy agent partials, templates, or skills to your project for customization. \" +\n \"Agent partials and templates are always copied from the CLI. \" +\n \"Skills are copied from the marketplace this installation is configured to read \" +\n \"(the public one by default).\";\n\n static examples = [\n {\n description: \"Eject agent partials for customization\",\n command: \"<%= config.bin %> <%= command.id %> agent-partials\",\n },\n {\n description: \"Eject only agent templates\",\n command: \"<%= config.bin %> <%= command.id %> templates\",\n },\n {\n description: \"Eject skills to local directory\",\n command: \"<%= config.bin %> <%= command.id %> skills\",\n },\n {\n description: \"Eject everything with force overwrite\",\n command: \"<%= config.bin %> <%= command.id %> all --force\",\n },\n {\n description: \"Eject to a custom output directory\",\n command: \"<%= config.bin %> <%= command.id %> skills -o ./custom-dir\",\n },\n ];\n\n static args = {\n type: Args.string({\n description: \"What to eject: agent-partials, templates, skills, all\",\n required: false,\n options: [...EJECT_TYPES],\n }),\n };\n\n static flags = {\n provider: providerFlag(),\n force: Flags.boolean({\n char: \"f\",\n description: \"Overwrite existing files\",\n default: false,\n }),\n output: Flags.string({\n char: \"o\",\n // No default: each eject type has its own destination and this replaces all three.\n description:\n \"Write everything into this directory instead of each eject type's own destination\",\n }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(Eject);\n const projectDir = process.cwd();\n\n // Before the layout settle: this decides which installation that refusal is about.\n await refuseAnAmbiguousInstallation(\n projectDir,\n \"eject\",\n providerNamedBy(flags.provider),\n (message) => this.error(message, { exit: EXIT_CODES.INVALID_ARGS }),\n );\n\n // Before anything is copied, so a refusal never follows files already written.\n await this.ensureConfigReadable(projectDir);\n const ejectType = this.validateEjectType(args.type);\n const outputBase = await this.resolveOutputBase(flags, projectDir);\n\n this.printHeader(\n await this.resolveBrandingName(projectDir),\n flags.output ? outputBase : undefined,\n );\n\n const sourceResult = await this.loadSourceIfNeeded(ejectType, projectDir);\n await this.executeEject(ejectType, outputBase, flags, projectDir, sourceResult);\n await this.ensureConfig(projectDir, sourceResult);\n\n this.reportEnding();\n }\n\n /** Withholds `Eject complete!` when part of the eject did not land. */\n private reportEnding(): void {\n this.log(\"\");\n if (!this.hasIncompleteWork) this.logSuccess(\"Eject complete!\");\n this.log(\"\");\n\n this.exitIfWorkIncomplete();\n }\n\n private validateEjectType(typeArg: string | undefined): EjectType {\n if (!typeArg) {\n this.error(\"Please specify what to eject: agent-partials, templates, skills, or all\", {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n\n if (!isEjectType(typeArg)) {\n this.error(`Unknown eject type: ${typeArg}`, {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n\n return typeArg;\n }\n\n private async resolveOutputBase(\n flags: { output: string | undefined },\n projectDir: string,\n ): Promise<string> {\n if (!flags.output) return sourceFolderInUse(projectDir, providerInUse(projectDir)).dir;\n\n const outputBase = path.resolve(projectDir, expandHome(flags.output));\n await this.refuseUnwritableOutput(outputBase);\n return outputBase;\n }\n\n private async refuseUnwritableOutput(outputBase: string): Promise<void> {\n // First, as the checks below follow a link, and so would every write.\n if (await isSymlink(outputBase)) {\n this.error(`Output path is a link: ${outputBase}. Name the folder it points to instead.`, {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n\n // `fileExists` is true of a directory too; an existing directory is written into, and each\n // kind then skips what it would write there already unless --force.\n const namesAFile = (await fileExists(outputBase)) && !(await directoryExists(outputBase));\n if (namesAFile) {\n this.error(`Output path exists as a file: ${outputBase}`, {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n }\n\n private printHeader(brandingName: string, outputBase?: string): void {\n this.log(\"\");\n this.log(`${brandingName} Eject`);\n this.log(\"\");\n\n if (outputBase) {\n this.log(`Output directory: ${outputBase}`);\n }\n }\n\n private async loadSourceIfNeeded(\n ejectType: EjectType,\n projectDir: string,\n ): Promise<SourceLoadResult | undefined> {\n if (ejectType === \"skills\" || ejectType === \"all\") {\n const loaded = await loadSource({ projectDir });\n return loaded.sourceResult;\n }\n return undefined;\n }\n\n private async executeEject(\n ejectType: EjectType,\n outputBase: string,\n flags: { force: boolean; output: string | undefined },\n projectDir: string,\n sourceResult: SourceLoadResult | undefined,\n ): Promise<void> {\n const directOutput = !!flags.output;\n\n switch (ejectType) {\n case \"agent-partials\":\n await this.handleAgentPartials(outputBase, flags.force, directOutput, false);\n break;\n case \"templates\":\n await this.handleAgentPartials(outputBase, flags.force, directOutput, true);\n break;\n case \"skills\":\n if (!sourceResult) {\n throw new Error(\"The marketplace must be loaded for skills eject\");\n }\n await this.handleSkills(\n skillsDestination(projectDir, directOutput, outputBase),\n flags.force,\n sourceResult,\n );\n break;\n case \"all\": {\n if (!sourceResult) {\n throw new Error(\"The marketplace must be loaded for full eject\");\n }\n // The partials carry the templates as one unit, so they arrive once and obey --force.\n await this.handleAgentPartials(outputBase, flags.force, directOutput, false);\n await this.handleSkills(\n skillsDestination(projectDir, directOutput, outputBase),\n flags.force,\n sourceResult,\n );\n break;\n }\n default: {\n const _exhaustive: never = ejectType;\n return _exhaustive;\n }\n }\n }\n\n /**\n * Writes a minimal config so `compile` works afterwards. A refusal is reported as incomplete\n * work rather than thrown, because the ejection has already landed.\n */\n private async ensureConfig(\n projectDir: string,\n sourceResult: SourceLoadResult | undefined,\n ): Promise<void> {\n // Named before the write, which may create the provider folder.\n const configTsRel = relativeConfigPath(projectDir, providerInUse(projectDir));\n\n try {\n const configResult = await ensureMinimalConfig({\n projectDir,\n ...(sourceResult !== undefined && { sourceResult }),\n });\n if (configResult.created) {\n this.logSuccess(`Created ${configTsRel}`);\n }\n } catch (error) {\n this.reportIncompleteWork(\n `Could not create ${configTsRel}: ${getErrorMessage(error)}`,\n INCOMPLETE_WORK_RECOVERY.INSPECT_INSTALLATION,\n );\n }\n }\n\n private async handleAgentPartials(\n outputBase: string,\n force: boolean,\n directOutput: boolean,\n templatesOnly: boolean,\n ): Promise<void> {\n const result = await ejectAgentPartials({\n outputBase,\n force,\n directOutput,\n templatesOnly,\n });\n\n if (result.skipped) {\n this.warn(result.skipReason);\n return;\n }\n\n if (result.skippedSubAgents.length > 0) {\n this.warn(subAgentsAlreadyThere(result.destDir, result.skippedSubAgents));\n }\n\n if (result.templatesSkipped) {\n this.warn(\n \"Agent templates already exist — skipping templates, only ejecting agent partials.\",\n );\n }\n\n this.logSuccess(\n `${templatesOnly ? \"Agent templates\" : \"Agent partials\"} ejected to ${result.destDir}`,\n );\n this.log(\n templatesOnly\n ? \"You can now customize agent templates locally.\"\n : INFO_MESSAGES.AGENT_PARTIALS_CUSTOMIZABLE,\n );\n }\n\n private async handleSkills(\n destinationDir: string,\n force: boolean,\n sourceResult: SourceLoadResult,\n ): Promise<void> {\n const result = await ejectSkills({ destinationDir, force, sourceResult, matrix });\n\n if (result.skipped) {\n this.warn(result.skipReason);\n return;\n }\n\n if (result.skippedSkillCount > 0) {\n this.warn(skillsAlreadyThere(destinationDir, result.skippedSkillCount));\n }\n\n this.logSuccess(\n `${plural(result.copiedSkills.length, \"skill\")} ejected to ${destinationDir} from ${result.sourceLabel}`,\n );\n this.log(\"You can now customize skill content locally.\");\n }\n}\n\nfunction expandHome(outputPath: string): string {\n return outputPath.startsWith(\"~\") ? path.join(os.homedir(), outputPath.slice(1)) : outputPath;\n}\n\n/** Some of what an eject copies was already there: named, with the rest copied beside it. */\nfunction subAgentsAlreadyThere(destDir: string, subAgents: readonly string[]): string {\n return `Agent partials already exist at ${destDir} — skipped ${plural(subAgents.length, \"sub-agent\")}: ${subAgents.join(\", \")}. Use --force to overwrite them.`;\n}\n\n/** Counted rather than named: a re-run into a nearly full folder skips most of the marketplace. */\nfunction skillsAlreadyThere(destinationDir: string, skippedCount: number): string {\n return `Skills already exist at ${destinationDir} — skipped ${plural(skippedCount, \"skill\")}. Use --force to overwrite them.`;\n}\n\n/** Those of `names` already at `dir`, file or folder: what an eject without --force leaves. */\nasync function alreadyIn<Name extends string>(\n dir: string,\n names: readonly Name[],\n): Promise<Name[]> {\n const checked = await Promise.all(\n names.map(async (name) => ({ name, there: await fileExists(path.join(dir, name)) })),\n );\n return checked.filter(({ there }) => there).map(({ name }) => name);\n}\n\ntype EjectAgentPartialsOptions = {\n outputBase: string;\n force: boolean;\n directOutput?: boolean;\n templatesOnly?: boolean;\n};\n\ntype EjectAgentPartialsResult =\n | {\n skipped: true;\n skipReason: string;\n }\n | {\n skipped: false;\n destDir: string;\n /** The sub-agents left as they were, by name, bytewise-sorted. */\n skippedSubAgents: string[];\n templatesSkipped: boolean;\n };\n\nfunction resolveEjectDestDir(\n outputBase: string,\n directOutput: boolean,\n templatesOnly: boolean,\n): string {\n if (directOutput) return outputBase;\n const agentsDir = path.join(outputBase, path.basename(DIRS.agents));\n return templatesOnly ? path.join(agentsDir, path.basename(DIRS.templates)) : agentsDir;\n}\n\nasync function ejectAgentPartials(\n options: EjectAgentPartialsOptions,\n): Promise<EjectAgentPartialsResult> {\n const { outputBase, force, directOutput = false, templatesOnly = false } = options;\n const destDir = resolveEjectDestDir(outputBase, directOutput, templatesOnly);\n\n return templatesOnly ? ejectTemplates(destDir, force) : ejectSubAgentPartials(destDir, force);\n}\n\n/** Whole or not at all: a templates folder already there is kept unless --force. */\nasync function ejectTemplates(destDir: string, force: boolean): Promise<EjectAgentPartialsResult> {\n const sourceDir = path.join(PROJECT_ROOT, DIRS.templates);\n\n if (!(await directoryExists(sourceDir))) {\n return { skipped: true, skipReason: \"No agent templates found in CLI.\" };\n }\n\n if ((await directoryExists(destDir)) && !force) {\n return {\n skipped: true,\n skipReason: `Agent templates already exist at ${destDir}. Use --force to overwrite.`,\n };\n }\n\n await ensureDir(destDir);\n await copy(sourceDir, destDir);\n return { skipped: false, destDir, skippedSubAgents: [], templatesSkipped: false };\n}\n\n/** Unit by unit: one already there is kept unless --force, and the rest are copied beside it. */\nasync function ejectSubAgentPartials(\n destDir: string,\n force: boolean,\n): Promise<EjectAgentPartialsResult> {\n const sourceDir = path.join(PROJECT_ROOT, DIRS.agents);\n\n if (!(await directoryExists(sourceDir))) {\n return { skipped: true, skipReason: \"No agent partials found in CLI.\" };\n }\n\n const units = await partialUnitsIn(sourceDir);\n const present = force ? [] : await alreadyIn(destDir, units);\n const absent = units.filter((unit) => !present.includes(unit));\n\n if (absent.length === 0) {\n return {\n skipped: true,\n skipReason: `Agent partials already exist at ${destDir}. Use --force to overwrite.`,\n };\n }\n\n await copyUnits(absent, sourceDir, destDir);\n\n return {\n skipped: false,\n destDir,\n skippedSubAgents: subAgentNames(present),\n templatesSkipped: present.some(isTemplatesUnit),\n };\n}\n\nconst TEMPLATES_UNIT = path.basename(DIRS.templates);\n\nfunction isTemplatesUnit(unit: string): boolean {\n return unit === TEMPLATES_UNIT;\n}\n\n/**\n * What a re-eject keeps or copies whole: each sub-agent's directory, as `<category>/<agent>`, and\n * the templates. A category folder is not one, so a file of the user's in it is written beside.\n */\nasync function partialUnitsIn(agentsSourceDir: string): Promise<string[]> {\n const entries = await listDirectories(agentsSourceDir);\n const categories = entries.filter((entry) => !isTemplatesUnit(entry));\n const subAgentDirs = await Promise.all(\n categories.map((category) => subAgentDirsOf(agentsSourceDir, category)),\n );\n return [...entries.filter(isTemplatesUnit), ...subAgentDirs.flat()];\n}\n\nasync function subAgentDirsOf(agentsSourceDir: string, category: string): Promise<string[]> {\n const agents = await listDirectories(path.join(agentsSourceDir, category));\n return agents.map((agent) => path.join(category, agent));\n}\n\n/** As the skipped-list warning names them: by directory name, bytewise-sorted. */\nfunction subAgentNames(units: readonly string[]): string[] {\n return units\n .filter((unit) => !isTemplatesUnit(unit))\n .map((unit) => path.basename(unit))\n .sort(bytewise);\n}\n\n/** `copy` makes the folders above each unit. */\nasync function copyUnits(\n units: readonly string[],\n sourceDir: string,\n destDir: string,\n): Promise<void> {\n for (const unit of units) {\n await copy(path.join(sourceDir, unit), path.join(destDir, unit));\n }\n}\n\nfunction skillsDestination(projectDir: string, directOutput: boolean, outputBase: string): string {\n return directOutput ? outputBase : installedSkillsDir(projectDir);\n}\n\ntype EjectSkillsOptions = {\n destinationDir: string;\n force: boolean;\n sourceResult: SourceLoadResult;\n matrix: MergedSkillsMatrix;\n};\n\ntype EjectSkillsResult =\n | {\n skipped: true;\n skipReason: string;\n }\n | {\n skipped: false;\n copiedSkills: CopiedSkill[];\n /** How many skills were left as they were. */\n skippedSkillCount: number;\n sourceLabel: string;\n };\n\n/**\n * Only the loaded marketplace's own non-local skills: others' skills are not on disk here. One\n * already in the destination is skipped first, as the local copy may be the one there.\n */\nasync function ejectSkills(options: EjectSkillsOptions): Promise<EjectSkillsResult> {\n const { destinationDir, force, sourceResult, matrix } = options;\n\n const marketplaceSkillIds = [...sourceResult.marketplaceSkillIds];\n const alreadyThere = force ? [] : await alreadyIn(destinationDir, marketplaceSkillIds);\n const notThere = marketplaceSkillIds.filter((skillId) => !alreadyThere.includes(skillId));\n const skillIds = notThere.filter((skillId) => !matrix.skills[skillId]?.local);\n\n if (skillIds.length === 0 && alreadyThere.length > 0) {\n return {\n skipped: true,\n skipReason: `Skills already exist at ${destinationDir}. Use --force to overwrite.`,\n };\n }\n\n if (skillIds.length === 0) {\n return { skipped: true, skipReason: \"No skills found in the marketplace to eject.\" };\n }\n\n await ensureDir(destinationDir);\n\n const copiedSkills = await copySkillsToLocalFlattened(skillIds, destinationDir, sourceResult);\n\n const sourceLabel = sourceResult.isLocal\n ? sourceResult.sourcePath\n : sourceResult.marketplace || sourceResult.sourceConfig.source;\n\n return {\n skipped: false,\n copiedSkills,\n skippedSkillCount: alreadyThere.length,\n sourceLabel,\n };\n}\n\n/** Where the host of the installation `projectDir` roots reads skills. */\nfunction installedSkillsDir(projectDir: string): string {\n const scope = isHomeDirectory(projectDir) ? \"global\" : \"project\";\n return resolveInstallPaths(projectDir, scope).skillsDir;\n}\n\ntype EnsureMinimalConfigOptions = {\n projectDir: string;\n sourceResult?: SourceLoadResult;\n};\n\ntype EnsureMinimalConfigResult = {\n configPath: string;\n created: boolean;\n};\n\nasync function ensureMinimalConfig(\n options: EnsureMinimalConfigOptions,\n): Promise<EnsureMinimalConfigResult> {\n const { projectDir, sourceResult } = options;\n\n const provider = providerInUse(projectDir);\n const tsConfigPath = getProjectConfigPath(projectDir, provider);\n\n if (await fileExists(tsConfigPath)) {\n return { configPath: tsConfigPath, created: false };\n }\n\n // ABORT on an unreadable global config: the invented file would record a marketplace from nowhere.\n const resolvedConfig =\n sourceResult?.sourceConfig ?? (await resolveSource({ caller: \"stored\", projectDir }));\n const source = resolvedConfig.source || undefined;\n\n // At home the invented config is the global manifest, which needs its config-types sibling.\n if (isHomeDirectory(projectDir)) {\n await ensureBlankPair(provider);\n if (source) await recordSourceInGlobal(projectDir, source);\n return { configPath: tsConfigPath, created: true };\n }\n\n await writeProjectPartial(\n projectDir,\n {\n skills: [],\n agents: [],\n ...(source ? { marketplace: source } : {}),\n ...(resolvedConfig.marketplace ? { marketplaceName: resolvedConfig.marketplace } : {}),\n },\n { fallbackName: path.basename(projectDir) },\n );\n\n return { configPath: tsConfigPath, created: true };\n}\n\n/** At home the config is the global manifest projects inline from, so it goes through the gate. */\nasync function recordSourceInGlobal(projectDir: string, source: string): Promise<void> {\n await mutateGlobal(\n { kind: \"set-source\", source, fallbackName: path.basename(projectDir) },\n lazyGateDeps(projectDir),\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,aAAa;AAC5B,OAAO,UAAU;AACjB,OAAO,QAAQ;AAuCf,IAAM,cAAc,CAAC,kBAAkB,aAAa,UAAU,KAAK;AAGnE,SAAS,YAAY,OAAmC;AACtD,SAAQ,YAAkC,SAAS,KAAK;AAC1D;AAEA,IAAqB,QAArB,MAAqB,eAAc,YAAY;AAAA,EAC7C,OAAO,UAAU;AAAA,EACjB,OAAO,cACL;AAAA,EAKF,OAAO,WAAW;AAAA,IAChB;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,OAAO,OAAO;AAAA,IACZ,MAAM,KAAK,OAAO;AAAA,MAChB,aAAa;AAAA,MACb,UAAU;AAAA,MACV,SAAS,CAAC,GAAG,WAAW;AAAA,IAC1B,CAAC;AAAA,EACH;AAAA,EAEA,OAAO,QAAQ;AAAA,IACb,UAAU,aAAa;AAAA,IACvB,OAAO,MAAM,QAAQ;AAAA,MACnB,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS;AAAA,IACX,CAAC;AAAA,IACD,QAAQ,MAAM,OAAO;AAAA,MACnB,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,cAAc,gBAAiB,MAAM,cAAc,EAAE,QAAQ,UAAU,WAAW,CAAC;AACrF,QAAM,SAAS,eAAe,UAAU;AAGxC,MAAI,gBAAgB,UAAU,GAAG;AAC/B,UAAM,gBAAgB,QAAQ;AAC9B,QAAI,OAAQ,OAAM,qBAAqB,YAAY,MAAM;AACzD,WAAO,EAAE,YAAY,cAAc,SAAS,KAAK;AAAA,EACnD;AAEA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,MACE,QAAQ,CAAC;AAAA,MACT,QAAQ,CAAC;AAAA,MACT,GAAI,SAAS,EAAE,aAAa,OAAO,IAAI,CAAC;AAAA,MACxC,GAAI,eAAe,cAAc,EAAE,iBAAiB,eAAe,YAAY,IAAI,CAAC;AAAA,IACtF;AAAA,IACA,EAAE,cAAc,KAAK,SAAS,UAAU,EAAE;AAAA,EAC5C;AAEA,SAAO,EAAE,YAAY,cAAc,SAAS,KAAK;AACnD;AAGA,eAAe,qBAAqB,YAAoB,QAA+B;AACrF,QAAM;AAAA,IACJ,EAAE,MAAM,cAAc,QAAQ,cAAc,KAAK,SAAS,UAAU,EAAE;AAAA,IACtE,aAAa,UAAU;AAAA,EACzB;AACF;","names":["matrix"]}
1
+ {"version":3,"sources":["../../src/cli/commands/eject.ts"],"sourcesContent":["import { Args, Flags } from \"@oclif/core\";\nimport path from \"path\";\nimport os from \"os\";\nimport { BaseCommand } from \"../base-command.js\";\nimport {\n copy,\n ensureDir,\n directoryExists,\n fileExists,\n isSymlink,\n listDirectories,\n} from \"../utils/fs.js\";\nimport { DIRS, PROJECT_ROOT } from \"../consts.js\";\nimport {\n providerInUse,\n relativeConfigPath,\n sourceFolderInUse,\n} from \"../lib/installation/install-layout.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { type SourceLoadResult } from \"../lib/loading/index.js\";\nimport { loadSource } from \"../lib/operations/index.js\";\nimport { matrix } from \"../lib/matrix/matrix-provider\";\nimport { resolveSource, getProjectConfigPath } from \"../lib/configuration/index.js\";\nimport {\n ensureBlankPair,\n lazyGateDeps,\n mutateGlobal,\n writeProjectPartial,\n} from \"../lib/config-gate/index.js\";\nimport { isHomeDirectory, resolveInstallPaths } from \"../lib/installation/index.js\";\nimport {\n providerFlag,\n providerNamedBy,\n refuseAnAmbiguousInstallation,\n} from \"../lib/installation/provider-flag.js\";\nimport { copySkillsToLocalFlattened, type CopiedSkill } from \"../lib/skills/index.js\";\nimport { INCOMPLETE_WORK_RECOVERY, INFO_MESSAGES } from \"../utils/messages.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport { bytewise, plural } from \"../utils/string.js\";\nimport type { MergedSkillsMatrix } from \"../types/index.js\";\n\nconst EJECT_TYPES = [\"agent-partials\", \"templates\", \"skills\", \"all\"] as const;\ntype EjectType = (typeof EJECT_TYPES)[number];\n\nfunction isEjectType(value: string): value is EjectType {\n return (EJECT_TYPES as readonly string[]).includes(value);\n}\n\n/** Skills come from the marketplace this installation reads, so only their ejects load it. */\ntype EjectPlan =\n | { type: \"agent-partials\" | \"templates\" }\n | { type: \"skills\" | \"all\"; sourceResult: SourceLoadResult };\n\nfunction loadedSourceOf(plan: EjectPlan): SourceLoadResult | undefined {\n return \"sourceResult\" in plan ? plan.sourceResult : undefined;\n}\n\nexport default class Eject extends BaseCommand {\n static summary = \"Eject skills, agent partials, or templates for local customization\";\n static description =\n \"Copy agent partials, templates, or skills to your project for customization. \" +\n \"Agent partials and templates are always copied from the CLI. \" +\n \"Skills are copied from the marketplace this installation is configured to read \" +\n \"(the public one by default).\";\n\n static examples = [\n {\n description: \"Eject agent partials for customization\",\n command: \"<%= config.bin %> <%= command.id %> agent-partials\",\n },\n {\n description: \"Eject only agent templates\",\n command: \"<%= config.bin %> <%= command.id %> templates\",\n },\n {\n description: \"Eject skills to local directory\",\n command: \"<%= config.bin %> <%= command.id %> skills\",\n },\n {\n description: \"Eject everything with force overwrite\",\n command: \"<%= config.bin %> <%= command.id %> all --force\",\n },\n {\n description: \"Eject to a custom output directory\",\n command: \"<%= config.bin %> <%= command.id %> skills -o ./custom-dir\",\n },\n ];\n\n static args = {\n type: Args.string({\n description: \"What to eject: agent-partials, templates, skills, all\",\n required: false,\n options: [...EJECT_TYPES],\n }),\n };\n\n static flags = {\n provider: providerFlag(),\n force: Flags.boolean({\n char: \"f\",\n description: \"Overwrite existing files\",\n default: false,\n }),\n output: Flags.string({\n char: \"o\",\n // No default: each eject type has its own destination and this replaces all three.\n description:\n \"Write everything into this directory instead of each eject type's own destination\",\n }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(Eject);\n const projectDir = process.cwd();\n\n // Before the layout settle: this decides which installation that refusal is about.\n await refuseAnAmbiguousInstallation(\n projectDir,\n \"eject\",\n providerNamedBy(flags.provider),\n (message) => this.error(message, { exit: EXIT_CODES.INVALID_ARGS }),\n );\n\n // Before anything is copied, so a refusal never follows files already written.\n await this.ensureConfigReadable(projectDir);\n const ejectType = this.validateEjectType(args.type);\n const outputBase = await this.resolveOutputBase(flags, projectDir);\n\n this.printHeader(\n await this.resolveBrandingName(projectDir),\n flags.output ? outputBase : undefined,\n );\n\n const plan = await this.planEject(ejectType, projectDir);\n await this.executeEject(plan, outputBase, flags, projectDir);\n await this.ensureConfig(projectDir, loadedSourceOf(plan));\n\n this.reportEnding();\n }\n\n /** Withholds `Eject complete!` when part of the eject did not land. */\n private reportEnding(): void {\n this.log(\"\");\n if (!this.hasIncompleteWork) this.logSuccess(\"Eject complete!\");\n this.log(\"\");\n\n this.exitIfWorkIncomplete();\n }\n\n private validateEjectType(typeArg: string | undefined): EjectType {\n if (!typeArg) {\n this.error(\"Please specify what to eject: agent-partials, templates, skills, or all\", {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n\n if (!isEjectType(typeArg)) {\n this.error(`Unknown eject type: ${typeArg}`, {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n\n return typeArg;\n }\n\n private async resolveOutputBase(\n flags: { output: string | undefined },\n projectDir: string,\n ): Promise<string> {\n if (!flags.output) return sourceFolderInUse(projectDir, providerInUse(projectDir)).dir;\n\n const outputBase = path.resolve(projectDir, expandHome(flags.output));\n await this.refuseUnwritableOutput(outputBase);\n return outputBase;\n }\n\n private async refuseUnwritableOutput(outputBase: string): Promise<void> {\n // First, as the checks below follow a link, and so would every write.\n if (await isSymlink(outputBase)) {\n this.error(`Output path is a link: ${outputBase}. Name the folder it points to instead.`, {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n\n // `fileExists` is true of a directory too; an existing directory is written into, and each\n // kind then skips what it would write there already unless --force.\n const namesAFile = (await fileExists(outputBase)) && !(await directoryExists(outputBase));\n if (namesAFile) {\n this.error(`Output path exists as a file: ${outputBase}`, {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n }\n\n private printHeader(brandingName: string, outputBase?: string): void {\n this.log(\"\");\n this.log(`${brandingName} Eject`);\n this.log(\"\");\n\n if (outputBase) {\n this.log(`Output directory: ${outputBase}`);\n }\n }\n\n private async planEject(type: EjectType, projectDir: string): Promise<EjectPlan> {\n if (type === \"agent-partials\" || type === \"templates\") return { type };\n\n const { sourceResult } = await loadSource({ projectDir });\n return { type, sourceResult };\n }\n\n private async executeEject(\n plan: EjectPlan,\n outputBase: string,\n flags: { force: boolean; output: string | undefined },\n projectDir: string,\n ): Promise<void> {\n const directOutput = !!flags.output;\n\n switch (plan.type) {\n case \"agent-partials\":\n await this.handleAgentPartials(outputBase, flags.force, directOutput, false);\n break;\n case \"templates\":\n await this.handleAgentPartials(outputBase, flags.force, directOutput, true);\n break;\n case \"skills\":\n await this.handleSkills(\n skillsDestination(projectDir, directOutput, outputBase),\n flags.force,\n plan.sourceResult,\n );\n break;\n case \"all\": {\n // The partials carry the templates as one unit, so they arrive once and obey --force.\n await this.handleAgentPartials(outputBase, flags.force, directOutput, false);\n await this.handleSkills(\n skillsDestination(projectDir, directOutput, outputBase),\n flags.force,\n plan.sourceResult,\n );\n break;\n }\n default: {\n const _exhaustive: never = plan;\n return _exhaustive;\n }\n }\n }\n\n /**\n * Writes a minimal config so `compile` works afterwards. A refusal is reported as incomplete\n * work rather than thrown, because the ejection has already landed.\n */\n private async ensureConfig(\n projectDir: string,\n sourceResult: SourceLoadResult | undefined,\n ): Promise<void> {\n // Named before the write, which may create the provider folder.\n const configTsRel = relativeConfigPath(projectDir, providerInUse(projectDir));\n\n try {\n const configResult = await ensureMinimalConfig({\n projectDir,\n ...(sourceResult !== undefined && { sourceResult }),\n });\n if (configResult.created) {\n this.logSuccess(`Created ${configTsRel}`);\n }\n } catch (error) {\n this.reportIncompleteWork(\n `Could not create ${configTsRel}: ${getErrorMessage(error)}`,\n INCOMPLETE_WORK_RECOVERY.INSPECT_INSTALLATION,\n );\n }\n }\n\n private async handleAgentPartials(\n outputBase: string,\n force: boolean,\n directOutput: boolean,\n templatesOnly: boolean,\n ): Promise<void> {\n const result = await ejectAgentPartials({\n outputBase,\n force,\n directOutput,\n templatesOnly,\n });\n\n if (result.skipped) {\n this.warn(result.skipReason);\n return;\n }\n\n if (result.skippedSubAgents.length > 0) {\n this.warn(subAgentsAlreadyThere(result.destDir, result.skippedSubAgents));\n }\n\n if (result.templatesSkipped) {\n this.warn(\n \"Agent templates already exist — skipping templates, only ejecting agent partials.\",\n );\n }\n\n this.logSuccess(\n `${templatesOnly ? \"Agent templates\" : \"Agent partials\"} ejected to ${result.destDir}`,\n );\n this.log(\n templatesOnly\n ? \"You can now customize agent templates locally.\"\n : INFO_MESSAGES.AGENT_PARTIALS_CUSTOMIZABLE,\n );\n }\n\n private async handleSkills(\n destinationDir: string,\n force: boolean,\n sourceResult: SourceLoadResult,\n ): Promise<void> {\n const result = await ejectSkills({ destinationDir, force, sourceResult, matrix });\n\n if (result.skipped) {\n this.warn(result.skipReason);\n return;\n }\n\n if (result.skippedSkillCount > 0) {\n this.warn(skillsAlreadyThere(destinationDir, result.skippedSkillCount));\n }\n\n this.logSuccess(\n `${plural(result.copiedSkills.length, \"skill\")} ejected to ${destinationDir} from ${result.sourceLabel}`,\n );\n this.log(\"You can now customize skill content locally.\");\n }\n}\n\nfunction expandHome(outputPath: string): string {\n return outputPath.startsWith(\"~\") ? path.join(os.homedir(), outputPath.slice(1)) : outputPath;\n}\n\n/** Some of what an eject copies was already there: named, with the rest copied beside it. */\nfunction subAgentsAlreadyThere(destDir: string, subAgents: readonly string[]): string {\n return `Agent partials already exist at ${destDir} — skipped ${plural(subAgents.length, \"sub-agent\")}: ${subAgents.join(\", \")}. Use --force to overwrite them.`;\n}\n\n/** Counted rather than named: a re-run into a nearly full folder skips most of the marketplace. */\nfunction skillsAlreadyThere(destinationDir: string, skippedCount: number): string {\n return `Skills already exist at ${destinationDir} — skipped ${plural(skippedCount, \"skill\")}. Use --force to overwrite them.`;\n}\n\n/** Those of `names` already at `dir`, file or folder: what an eject without --force leaves. */\nasync function alreadyIn<Name extends string>(\n dir: string,\n names: readonly Name[],\n): Promise<Name[]> {\n const checked = await Promise.all(\n names.map(async (name) => ({ name, there: await fileExists(path.join(dir, name)) })),\n );\n return checked.filter(({ there }) => there).map(({ name }) => name);\n}\n\ntype EjectAgentPartialsOptions = {\n outputBase: string;\n force: boolean;\n directOutput?: boolean;\n templatesOnly?: boolean;\n};\n\ntype EjectAgentPartialsResult =\n | {\n skipped: true;\n skipReason: string;\n }\n | {\n skipped: false;\n destDir: string;\n /** The sub-agents left as they were, by name, bytewise-sorted. */\n skippedSubAgents: string[];\n templatesSkipped: boolean;\n };\n\nfunction resolveEjectDestDir(\n outputBase: string,\n directOutput: boolean,\n templatesOnly: boolean,\n): string {\n if (directOutput) return outputBase;\n const agentsDir = path.join(outputBase, path.basename(DIRS.agents));\n return templatesOnly ? path.join(agentsDir, path.basename(DIRS.templates)) : agentsDir;\n}\n\nasync function ejectAgentPartials(\n options: EjectAgentPartialsOptions,\n): Promise<EjectAgentPartialsResult> {\n const { outputBase, force, directOutput = false, templatesOnly = false } = options;\n const destDir = resolveEjectDestDir(outputBase, directOutput, templatesOnly);\n\n return templatesOnly ? ejectTemplates(destDir, force) : ejectSubAgentPartials(destDir, force);\n}\n\n/** Whole or not at all: a templates folder already there is kept unless --force. */\nasync function ejectTemplates(destDir: string, force: boolean): Promise<EjectAgentPartialsResult> {\n const sourceDir = path.join(PROJECT_ROOT, DIRS.templates);\n\n if (!(await directoryExists(sourceDir))) {\n return { skipped: true, skipReason: \"No agent templates found in CLI.\" };\n }\n\n if ((await directoryExists(destDir)) && !force) {\n return {\n skipped: true,\n skipReason: `Agent templates already exist at ${destDir}. Use --force to overwrite.`,\n };\n }\n\n await ensureDir(destDir);\n await copy(sourceDir, destDir);\n return { skipped: false, destDir, skippedSubAgents: [], templatesSkipped: false };\n}\n\n/** Unit by unit: one already there is kept unless --force, and the rest are copied beside it. */\nasync function ejectSubAgentPartials(\n destDir: string,\n force: boolean,\n): Promise<EjectAgentPartialsResult> {\n const sourceDir = path.join(PROJECT_ROOT, DIRS.agents);\n\n if (!(await directoryExists(sourceDir))) {\n return { skipped: true, skipReason: \"No agent partials found in CLI.\" };\n }\n\n const units = await partialUnitsIn(sourceDir);\n const present = force ? [] : await alreadyIn(destDir, units);\n const absent = units.filter((unit) => !present.includes(unit));\n\n if (absent.length === 0) {\n return {\n skipped: true,\n skipReason: `Agent partials already exist at ${destDir}. Use --force to overwrite.`,\n };\n }\n\n await copyUnits(absent, sourceDir, destDir);\n\n return {\n skipped: false,\n destDir,\n skippedSubAgents: subAgentNames(present),\n templatesSkipped: present.some(isTemplatesUnit),\n };\n}\n\nconst TEMPLATES_UNIT = path.basename(DIRS.templates);\n\nfunction isTemplatesUnit(unit: string): boolean {\n return unit === TEMPLATES_UNIT;\n}\n\n/**\n * What a re-eject keeps or copies whole: each sub-agent's directory, as `<category>/<agent>`, and\n * the templates. A category folder is not one, so a file of the user's in it is written beside.\n */\nasync function partialUnitsIn(agentsSourceDir: string): Promise<string[]> {\n const entries = await listDirectories(agentsSourceDir);\n const categories = entries.filter((entry) => !isTemplatesUnit(entry));\n const subAgentDirs = await Promise.all(\n categories.map((category) => subAgentDirsOf(agentsSourceDir, category)),\n );\n return [...entries.filter(isTemplatesUnit), ...subAgentDirs.flat()];\n}\n\nasync function subAgentDirsOf(agentsSourceDir: string, category: string): Promise<string[]> {\n const agents = await listDirectories(path.join(agentsSourceDir, category));\n return agents.map((agent) => path.join(category, agent));\n}\n\n/** As the skipped-list warning names them: by directory name, bytewise-sorted. */\nfunction subAgentNames(units: readonly string[]): string[] {\n return units\n .filter((unit) => !isTemplatesUnit(unit))\n .map((unit) => path.basename(unit))\n .sort(bytewise);\n}\n\n/** `copy` makes the folders above each unit. */\nasync function copyUnits(\n units: readonly string[],\n sourceDir: string,\n destDir: string,\n): Promise<void> {\n for (const unit of units) {\n await copy(path.join(sourceDir, unit), path.join(destDir, unit));\n }\n}\n\nfunction skillsDestination(projectDir: string, directOutput: boolean, outputBase: string): string {\n return directOutput ? outputBase : installedSkillsDir(projectDir);\n}\n\ntype EjectSkillsOptions = {\n destinationDir: string;\n force: boolean;\n sourceResult: SourceLoadResult;\n matrix: MergedSkillsMatrix;\n};\n\ntype EjectSkillsResult =\n | {\n skipped: true;\n skipReason: string;\n }\n | {\n skipped: false;\n copiedSkills: CopiedSkill[];\n /** How many skills were left as they were. */\n skippedSkillCount: number;\n sourceLabel: string;\n };\n\n/**\n * Only the loaded marketplace's own non-local skills: others' skills are not on disk here. One\n * already in the destination is skipped first, as the local copy may be the one there.\n */\nasync function ejectSkills(options: EjectSkillsOptions): Promise<EjectSkillsResult> {\n const { destinationDir, force, sourceResult, matrix } = options;\n\n const marketplaceSkillIds = [...sourceResult.marketplaceSkillIds];\n const alreadyThere = force ? [] : await alreadyIn(destinationDir, marketplaceSkillIds);\n const notThere = marketplaceSkillIds.filter((skillId) => !alreadyThere.includes(skillId));\n const skillIds = notThere.filter((skillId) => !matrix.skills[skillId]?.local);\n\n if (skillIds.length === 0 && alreadyThere.length > 0) {\n return {\n skipped: true,\n skipReason: `Skills already exist at ${destinationDir}. Use --force to overwrite.`,\n };\n }\n\n if (skillIds.length === 0) {\n return { skipped: true, skipReason: \"No skills found in the marketplace to eject.\" };\n }\n\n await ensureDir(destinationDir);\n\n const copiedSkills = await copySkillsToLocalFlattened(skillIds, destinationDir, sourceResult);\n\n const sourceLabel = sourceResult.isLocal\n ? sourceResult.sourcePath\n : sourceResult.marketplace || sourceResult.sourceConfig.source;\n\n return {\n skipped: false,\n copiedSkills,\n skippedSkillCount: alreadyThere.length,\n sourceLabel,\n };\n}\n\n/** Where the host of the installation `projectDir` roots reads skills. */\nfunction installedSkillsDir(projectDir: string): string {\n const scope = isHomeDirectory(projectDir) ? \"global\" : \"project\";\n return resolveInstallPaths(projectDir, scope).skillsDir;\n}\n\ntype EnsureMinimalConfigOptions = {\n projectDir: string;\n sourceResult?: SourceLoadResult;\n};\n\ntype EnsureMinimalConfigResult = {\n configPath: string;\n created: boolean;\n};\n\nasync function ensureMinimalConfig(\n options: EnsureMinimalConfigOptions,\n): Promise<EnsureMinimalConfigResult> {\n const { projectDir, sourceResult } = options;\n\n const provider = providerInUse(projectDir);\n const tsConfigPath = getProjectConfigPath(projectDir, provider);\n\n if (await fileExists(tsConfigPath)) {\n return { configPath: tsConfigPath, created: false };\n }\n\n // ABORT on an unreadable global config: the invented file would record a marketplace from nowhere.\n const resolvedConfig =\n sourceResult?.sourceConfig ?? (await resolveSource({ caller: \"stored\", projectDir }));\n const source = resolvedConfig.source || undefined;\n\n // At home the invented config is the global manifest, which needs its config-types sibling.\n if (isHomeDirectory(projectDir)) {\n await ensureBlankPair(provider);\n if (source) await recordSourceInGlobal(projectDir, source);\n return { configPath: tsConfigPath, created: true };\n }\n\n await writeProjectPartial(\n projectDir,\n {\n skills: [],\n agents: [],\n ...(source ? { marketplace: source } : {}),\n ...(resolvedConfig.marketplace ? { marketplaceName: resolvedConfig.marketplace } : {}),\n },\n { fallbackName: path.basename(projectDir) },\n );\n\n return { configPath: tsConfigPath, created: true };\n}\n\n/** At home the config is the global manifest projects inline from, so it goes through the gate. */\nasync function recordSourceInGlobal(projectDir: string, source: string): Promise<void> {\n await mutateGlobal(\n { kind: \"set-source\", source, fallbackName: path.basename(projectDir) },\n lazyGateDeps(projectDir),\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,aAAa;AAC5B,OAAO,UAAU;AACjB,OAAO,QAAQ;AAuCf,IAAM,cAAc,CAAC,kBAAkB,aAAa,UAAU,KAAK;AAGnE,SAAS,YAAY,OAAmC;AACtD,SAAQ,YAAkC,SAAS,KAAK;AAC1D;AAOA,SAAS,eAAe,MAA+C;AACrE,SAAO,kBAAkB,OAAO,KAAK,eAAe;AACtD;AAEA,IAAqB,QAArB,MAAqB,eAAc,YAAY;AAAA,EAC7C,OAAO,UAAU;AAAA,EACjB,OAAO,cACL;AAAA,EAKF,OAAO,WAAW;AAAA,IAChB;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,OAAO,OAAO;AAAA,IACZ,MAAM,KAAK,OAAO;AAAA,MAChB,aAAa;AAAA,MACb,UAAU;AAAA,MACV,SAAS,CAAC,GAAG,WAAW;AAAA,IAC1B,CAAC;AAAA,EACH;AAAA,EAEA,OAAO,QAAQ;AAAA,IACb,UAAU,aAAa;AAAA,IACvB,OAAO,MAAM,QAAQ;AAAA,MACnB,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS;AAAA,IACX,CAAC;AAAA,IACD,QAAQ,MAAM,OAAO;AAAA,MACnB,MAAM;AAAA;AAAA,MAEN,aACE;AAAA,IACJ,CAAC;AAAA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AAQ;AAC9B,QAAI,OAAQ,OAAM,qBAAqB,YAAY,MAAM;AACzD,WAAO,EAAE,YAAY,cAAc,SAAS,KAAK;AAAA,EACnD;AAEA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,MACE,QAAQ,CAAC;AAAA,MACT,QAAQ,CAAC;AAAA,MACT,GAAI,SAAS,EAAE,aAAa,OAAO,IAAI,CAAC;AAAA,MACxC,GAAI,eAAe,cAAc,EAAE,iBAAiB,eAAe,YAAY,IAAI,CAAC;AAAA,IACtF;AAAA,IACA,EAAE,cAAc,KAAK,SAAS,UAAU,EAAE;AAAA,EAC5C;AAEA,SAAO,EAAE,YAAY,cAAc,SAAS,KAAK;AACnD;AAGA,eAAe,qBAAqB,YAAoB,QAA+B;AACrF,QAAM;AAAA,IACJ,EAAE,MAAM,cAAc,QAAQ,cAAc,KAAK,SAAS,UAAU,EAAE;AAAA,IACtE,aAAa,UAAU;AAAA,EACzB;AACF;","names":["matrix"]}
@@ -4,25 +4,25 @@ import {
4
4
  Init,
5
5
  formatDashboardText,
6
6
  runDashboardFlow
7
- } from "../chunk-5MGRHS2G.js";
7
+ } from "../chunk-AARQBW5L.js";
8
8
  import "../chunk-3R3LHA4Q.js";
9
- import "../chunk-5PPB6HT6.js";
9
+ import "../chunk-SPQSNZMM.js";
10
10
  import "../chunk-A3ZAXL5T.js";
11
11
  import "../chunk-OZXAJNLA.js";
12
12
  import "../chunk-P6CYS4JK.js";
13
- import "../chunk-33JICQD5.js";
13
+ import "../chunk-Q6WRR4BN.js";
14
14
  import "../chunk-N33AKFLR.js";
15
- import "../chunk-255DGUCH.js";
16
- import "../chunk-6CRA46YO.js";
17
- import "../chunk-Y23MP2OC.js";
18
- import "../chunk-KCLBLK3F.js";
19
- import "../chunk-NISWBQNS.js";
20
- import "../chunk-LUKDDHSI.js";
15
+ import "../chunk-3N4FSTVX.js";
16
+ import "../chunk-VSPC74SS.js";
17
+ import "../chunk-VR6QTK5Z.js";
18
+ import "../chunk-ITQF35UQ.js";
19
+ import "../chunk-BRZA7ZCX.js";
20
+ import "../chunk-EHJIQDXR.js";
21
21
  import "../chunk-KIK5EZYD.js";
22
22
  import "../chunk-G7NUK3BF.js";
23
- import "../chunk-MBIOZ5LW.js";
24
- import "../chunk-7ZOWSCAO.js";
25
- import "../chunk-VILFCMRN.js";
23
+ import "../chunk-2RTBSLSR.js";
24
+ import "../chunk-LJQXQTFC.js";
25
+ import "../chunk-WVFBBZEP.js";
26
26
  import "../chunk-7OG635DK.js";
27
27
  import "../chunk-MHAQWMNJ.js";
28
28
  import "../chunk-GHHJYNAN.js";
@@ -9,10 +9,10 @@ import {
9
9
  otherInstallationsInThisScope,
10
10
  providerFlag,
11
11
  providerNamedBy
12
- } from "../chunk-MBIOZ5LW.js";
12
+ } from "../chunk-2RTBSLSR.js";
13
13
  import {
14
14
  BaseCommand
15
- } from "../chunk-7ZOWSCAO.js";
15
+ } from "../chunk-LJQXQTFC.js";
16
16
  import {
17
17
  INSTALL_MODE_LABELS,
18
18
  chooseProviderForThisRun,
@@ -21,7 +21,7 @@ import {
21
21
  getInstallationInfo,
22
22
  loadProjectConfig,
23
23
  providerInUse
24
- } from "../chunk-VILFCMRN.js";
24
+ } from "../chunk-WVFBBZEP.js";
25
25
  import "../chunk-7OG635DK.js";
26
26
  import {
27
27
  CLI_COLORS,
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  BaseCommand,
4
4
  EXIT_CODES
5
- } from "../../chunk-7ZOWSCAO.js";
5
+ } from "../../chunk-LJQXQTFC.js";
6
6
  import {
7
7
  isDirectoryEmpty,
8
8
  validateKebabCaseName,
9
9
  validateMarketplaceName,
10
10
  writeFile
11
- } from "../../chunk-VILFCMRN.js";
11
+ } from "../../chunk-WVFBBZEP.js";
12
12
  import "../../chunk-7OG635DK.js";
13
13
  import {
14
14
  CLI_INVOKE_COMMAND,
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  loadSource
4
- } from "../chunk-6CRA46YO.js";
5
- import "../chunk-Y23MP2OC.js";
6
- import "../chunk-KCLBLK3F.js";
7
- import "../chunk-NISWBQNS.js";
8
- import "../chunk-LUKDDHSI.js";
4
+ } from "../chunk-VSPC74SS.js";
5
+ import "../chunk-VR6QTK5Z.js";
6
+ import "../chunk-ITQF35UQ.js";
7
+ import "../chunk-BRZA7ZCX.js";
8
+ import "../chunk-EHJIQDXR.js";
9
9
  import {
10
10
  BaseCommand
11
- } from "../chunk-7ZOWSCAO.js";
11
+ } from "../chunk-LJQXQTFC.js";
12
12
  import {
13
13
  STATUS_MESSAGES
14
- } from "../chunk-VILFCMRN.js";
14
+ } from "../chunk-WVFBBZEP.js";
15
15
  import {
16
16
  plural,
17
17
  stripTerminalControls,
@@ -2,21 +2,21 @@
2
2
  import {
3
3
  publishSeedConfig,
4
4
  seedPayloadForInstallation
5
- } from "../chunk-6LUTY35Q.js";
5
+ } from "../chunk-Q4UNHVPX.js";
6
6
  import {
7
7
  unofferablePlacementsFound
8
- } from "../chunk-MOL2J5HS.js";
8
+ } from "../chunk-F437ICEG.js";
9
9
  import "../chunk-A3ZAXL5T.js";
10
- import "../chunk-LUKDDHSI.js";
10
+ import "../chunk-EHJIQDXR.js";
11
11
  import {
12
12
  providerFlag,
13
13
  providerNamedBy,
14
14
  refuseAnAmbiguousInstallation
15
- } from "../chunk-MBIOZ5LW.js";
15
+ } from "../chunk-2RTBSLSR.js";
16
16
  import {
17
17
  BaseCommand,
18
18
  EXIT_CODES
19
- } from "../chunk-7ZOWSCAO.js";
19
+ } from "../chunk-LJQXQTFC.js";
20
20
  import {
21
21
  formatZodErrors,
22
22
  getErrorMessage,
@@ -26,7 +26,7 @@ import {
26
26
  sharedIdNamesAFolder,
27
27
  sharedSkillsLeftBehind,
28
28
  warn
29
- } from "../chunk-VILFCMRN.js";
29
+ } from "../chunk-WVFBBZEP.js";
30
30
  import {
31
31
  stripTerminalControls,
32
32
  truncateText,