@baton-dx/cli 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { i as __toESM } from "./dist-BoZnMvNi.mjs";
3
3
  import { a as Ne, i as Le, l as We, m as defineCommand, p as Ct, t as findSourceRoot, u as Ze } from "./context-detection-BxY5Qs8X.mjs";
4
- import { E as require_lib, Rt as KEBAB_CASE_REGEX } from "./src-qYK6F_wF.mjs";
4
+ import { E as require_lib, Rt as KEBAB_CASE_REGEX } from "./src-BC9rP9z6.mjs";
5
5
  import "./ai-tool-detection-CMsBNa9e.mjs";
6
6
  import { mkdir, readFile, readdir, writeFile } from "node:fs/promises";
7
7
  import { dirname, join } from "node:path";
@@ -78,4 +78,4 @@ async function copyProfileTemplate(sourceDir, targetDir, variables) {
78
78
 
79
79
  //#endregion
80
80
  export { createCommand };
81
- //# sourceMappingURL=create-DFhPMuBR.mjs.map
81
+ //# sourceMappingURL=create-DU8qIWn9.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-DFhPMuBR.mjs","names":["p.text","p.isCancel","Handlebars"],"sources":["../src/commands/profile/create.ts"],"sourcesContent":["import { mkdir, readFile, readdir, writeFile } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { KEBAB_CASE_REGEX } from \"@baton-dx/core\";\nimport * as p from \"@clack/prompts\";\nimport { defineCommand } from \"citty\";\nimport Handlebars from \"handlebars\";\nimport { findSourceRoot } from \"../../utils/context-detection.js\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nexport const createCommand = defineCommand({\n meta: {\n name: \"create\",\n description: \"Create a new profile in your source repository\",\n },\n args: {\n name: {\n type: \"positional\",\n description: \"Profile name (kebab-case)\",\n required: false,\n },\n },\n async run({ args }) {\n p.intro(\"Create Profile\");\n\n // Check for baton.source.yaml in current or parent directories\n const sourceRoot = await findSourceRoot();\n if (!sourceRoot) {\n p.cancel(\"This command must be run inside a source directory (baton.source.yaml not found)\");\n process.exit(1);\n }\n\n // Get profile name — from argument or wizard prompt\n let name = args.name as string | undefined;\n\n if (!name) {\n const nameInput = await p.text({\n message: \"Profile name (kebab-case)\",\n placeholder: \"e.g., backend, frontend, my-profile\",\n validate(value) {\n if (!value || value.trim().length === 0) {\n return \"Profile name is required\";\n }\n if (!KEBAB_CASE_REGEX.test(value.trim())) {\n return \"Profile name must be in kebab-case (e.g., my-profile, backend, frontend)\";\n }\n },\n });\n\n if (p.isCancel(nameInput)) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n name = (nameInput as string).trim();\n }\n\n // Validate name format (kebab-case)\n if (!KEBAB_CASE_REGEX.test(name)) {\n p.cancel(\"Profile name must be in kebab-case (e.g., my-profile, backend, frontend)\");\n process.exit(1);\n }\n\n // Check if profile already exists in profiles/ directory\n const targetDir = join(sourceRoot, \"profiles\", name);\n try {\n await readdir(targetDir);\n p.cancel(`Profile '${name}' already exists in profiles/${name}/`);\n process.exit(1);\n } catch {\n // Directory doesn't exist - good to proceed\n }\n\n // Create profile directory\n await mkdir(targetDir, { recursive: true });\n\n // Copy minimal template files\n const templateDir = join(__dirname, \"templates\", \"profile\", \"minimal\");\n await copyProfileTemplate(templateDir, targetDir, { name });\n\n p.outro(`Profile '${name}' created in profiles/${name}/`);\n },\n});\n\n/**\n * Recursively copy profile template with variable substitution\n */\nasync function copyProfileTemplate(\n sourceDir: string,\n targetDir: string,\n variables: { name: string },\n): Promise<void> {\n const entries = await readdir(sourceDir, { withFileTypes: true });\n\n for (const entry of entries) {\n const sourcePath = join(sourceDir, entry.name);\n const targetPath = join(targetDir, entry.name);\n\n if (entry.isDirectory()) {\n await mkdir(targetPath, { recursive: true });\n await copyProfileTemplate(sourcePath, targetPath, variables);\n } else {\n // Read file content\n const content = await readFile(sourcePath, \"utf-8\");\n\n // Apply Handlebars substitution for text files\n const processed = Handlebars.compile(content, { noEscape: true })(variables);\n\n // Write processed content\n await writeFile(targetPath, processed, \"utf-8\");\n }\n }\n}\n"],"mappings":";;;;;;;;;;;AASA,MAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AAEzD,MAAa,gBAAgB,cAAc;CACzC,MAAM;EACJ,MAAM;EACN,aAAa;EACd;CACD,MAAM,EACJ,MAAM;EACJ,MAAM;EACN,aAAa;EACb,UAAU;EACX,EACF;CACD,MAAM,IAAI,EAAE,QAAQ;AAClB,KAAQ,iBAAiB;EAGzB,MAAM,aAAa,MAAM,gBAAgB;AACzC,MAAI,CAAC,YAAY;AACf,MAAS,mFAAmF;AAC5F,WAAQ,KAAK,EAAE;;EAIjB,IAAI,OAAO,KAAK;AAEhB,MAAI,CAAC,MAAM;GACT,MAAM,YAAY,MAAMA,GAAO;IAC7B,SAAS;IACT,aAAa;IACb,SAAS,OAAO;AACd,SAAI,CAAC,SAAS,MAAM,MAAM,CAAC,WAAW,EACpC,QAAO;AAET,SAAI,CAAC,iBAAiB,KAAK,MAAM,MAAM,CAAC,CACtC,QAAO;;IAGZ,CAAC;AAEF,OAAIC,GAAW,UAAU,EAAE;AACzB,OAAS,aAAa;AACtB,YAAQ,KAAK,EAAE;;AAGjB,UAAQ,UAAqB,MAAM;;AAIrC,MAAI,CAAC,iBAAiB,KAAK,KAAK,EAAE;AAChC,MAAS,2EAA2E;AACpF,WAAQ,KAAK,EAAE;;EAIjB,MAAM,YAAY,KAAK,YAAY,YAAY,KAAK;AACpD,MAAI;AACF,SAAM,QAAQ,UAAU;AACxB,MAAS,YAAY,KAAK,+BAA+B,KAAK,GAAG;AACjE,WAAQ,KAAK,EAAE;UACT;AAKR,QAAM,MAAM,WAAW,EAAE,WAAW,MAAM,CAAC;AAI3C,QAAM,oBADc,KAAK,WAAW,aAAa,WAAW,UAAU,EAC/B,WAAW,EAAE,MAAM,CAAC;AAE3D,KAAQ,YAAY,KAAK,wBAAwB,KAAK,GAAG;;CAE5D,CAAC;;;;AAKF,eAAe,oBACb,WACA,WACA,WACe;CACf,MAAM,UAAU,MAAM,QAAQ,WAAW,EAAE,eAAe,MAAM,CAAC;AAEjE,MAAK,MAAM,SAAS,SAAS;EAC3B,MAAM,aAAa,KAAK,WAAW,MAAM,KAAK;EAC9C,MAAM,aAAa,KAAK,WAAW,MAAM,KAAK;AAE9C,MAAI,MAAM,aAAa,EAAE;AACvB,SAAM,MAAM,YAAY,EAAE,WAAW,MAAM,CAAC;AAC5C,SAAM,oBAAoB,YAAY,YAAY,UAAU;SACvD;GAEL,MAAM,UAAU,MAAM,SAAS,YAAY,QAAQ;AAMnD,SAAM,UAAU,YAHEC,mBAAW,QAAQ,SAAS,EAAE,UAAU,MAAM,CAAC,CAAC,UAAU,EAGrC,QAAQ"}
1
+ {"version":3,"file":"create-DU8qIWn9.mjs","names":["p.text","p.isCancel","Handlebars"],"sources":["../src/commands/profile/create.ts"],"sourcesContent":["import { mkdir, readFile, readdir, writeFile } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { KEBAB_CASE_REGEX } from \"@baton-dx/core\";\nimport * as p from \"@clack/prompts\";\nimport { defineCommand } from \"citty\";\nimport Handlebars from \"handlebars\";\nimport { findSourceRoot } from \"../../utils/context-detection.js\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nexport const createCommand = defineCommand({\n meta: {\n name: \"create\",\n description: \"Create a new profile in your source repository\",\n },\n args: {\n name: {\n type: \"positional\",\n description: \"Profile name (kebab-case)\",\n required: false,\n },\n },\n async run({ args }) {\n p.intro(\"Create Profile\");\n\n // Check for baton.source.yaml in current or parent directories\n const sourceRoot = await findSourceRoot();\n if (!sourceRoot) {\n p.cancel(\"This command must be run inside a source directory (baton.source.yaml not found)\");\n process.exit(1);\n }\n\n // Get profile name — from argument or wizard prompt\n let name = args.name as string | undefined;\n\n if (!name) {\n const nameInput = await p.text({\n message: \"Profile name (kebab-case)\",\n placeholder: \"e.g., backend, frontend, my-profile\",\n validate(value) {\n if (!value || value.trim().length === 0) {\n return \"Profile name is required\";\n }\n if (!KEBAB_CASE_REGEX.test(value.trim())) {\n return \"Profile name must be in kebab-case (e.g., my-profile, backend, frontend)\";\n }\n },\n });\n\n if (p.isCancel(nameInput)) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n name = (nameInput as string).trim();\n }\n\n // Validate name format (kebab-case)\n if (!KEBAB_CASE_REGEX.test(name)) {\n p.cancel(\"Profile name must be in kebab-case (e.g., my-profile, backend, frontend)\");\n process.exit(1);\n }\n\n // Check if profile already exists in profiles/ directory\n const targetDir = join(sourceRoot, \"profiles\", name);\n try {\n await readdir(targetDir);\n p.cancel(`Profile '${name}' already exists in profiles/${name}/`);\n process.exit(1);\n } catch {\n // Directory doesn't exist - good to proceed\n }\n\n // Create profile directory\n await mkdir(targetDir, { recursive: true });\n\n // Copy minimal template files\n const templateDir = join(__dirname, \"templates\", \"profile\", \"minimal\");\n await copyProfileTemplate(templateDir, targetDir, { name });\n\n p.outro(`Profile '${name}' created in profiles/${name}/`);\n },\n});\n\n/**\n * Recursively copy profile template with variable substitution\n */\nasync function copyProfileTemplate(\n sourceDir: string,\n targetDir: string,\n variables: { name: string },\n): Promise<void> {\n const entries = await readdir(sourceDir, { withFileTypes: true });\n\n for (const entry of entries) {\n const sourcePath = join(sourceDir, entry.name);\n const targetPath = join(targetDir, entry.name);\n\n if (entry.isDirectory()) {\n await mkdir(targetPath, { recursive: true });\n await copyProfileTemplate(sourcePath, targetPath, variables);\n } else {\n // Read file content\n const content = await readFile(sourcePath, \"utf-8\");\n\n // Apply Handlebars substitution for text files\n const processed = Handlebars.compile(content, { noEscape: true })(variables);\n\n // Write processed content\n await writeFile(targetPath, processed, \"utf-8\");\n }\n }\n}\n"],"mappings":";;;;;;;;;;;AASA,MAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AAEzD,MAAa,gBAAgB,cAAc;CACzC,MAAM;EACJ,MAAM;EACN,aAAa;EACd;CACD,MAAM,EACJ,MAAM;EACJ,MAAM;EACN,aAAa;EACb,UAAU;EACX,EACF;CACD,MAAM,IAAI,EAAE,QAAQ;AAClB,KAAQ,iBAAiB;EAGzB,MAAM,aAAa,MAAM,gBAAgB;AACzC,MAAI,CAAC,YAAY;AACf,MAAS,mFAAmF;AAC5F,WAAQ,KAAK,EAAE;;EAIjB,IAAI,OAAO,KAAK;AAEhB,MAAI,CAAC,MAAM;GACT,MAAM,YAAY,MAAMA,GAAO;IAC7B,SAAS;IACT,aAAa;IACb,SAAS,OAAO;AACd,SAAI,CAAC,SAAS,MAAM,MAAM,CAAC,WAAW,EACpC,QAAO;AAET,SAAI,CAAC,iBAAiB,KAAK,MAAM,MAAM,CAAC,CACtC,QAAO;;IAGZ,CAAC;AAEF,OAAIC,GAAW,UAAU,EAAE;AACzB,OAAS,aAAa;AACtB,YAAQ,KAAK,EAAE;;AAGjB,UAAQ,UAAqB,MAAM;;AAIrC,MAAI,CAAC,iBAAiB,KAAK,KAAK,EAAE;AAChC,MAAS,2EAA2E;AACpF,WAAQ,KAAK,EAAE;;EAIjB,MAAM,YAAY,KAAK,YAAY,YAAY,KAAK;AACpD,MAAI;AACF,SAAM,QAAQ,UAAU;AACxB,MAAS,YAAY,KAAK,+BAA+B,KAAK,GAAG;AACjE,WAAQ,KAAK,EAAE;UACT;AAKR,QAAM,MAAM,WAAW,EAAE,WAAW,MAAM,CAAC;AAI3C,QAAM,oBADc,KAAK,WAAW,aAAa,WAAW,UAAU,EAC/B,WAAW,EAAE,MAAM,CAAC;AAE3D,KAAQ,YAAY,KAAK,wBAAwB,KAAK,GAAG;;CAE5D,CAAC;;;;AAKF,eAAe,oBACb,WACA,WACA,WACe;CACf,MAAM,UAAU,MAAM,QAAQ,WAAW,EAAE,eAAe,MAAM,CAAC;AAEjE,MAAK,MAAM,SAAS,SAAS;EAC3B,MAAM,aAAa,KAAK,WAAW,MAAM,KAAK;EAC9C,MAAM,aAAa,KAAK,WAAW,MAAM,KAAK;AAE9C,MAAI,MAAM,aAAa,EAAE;AACvB,SAAM,MAAM,YAAY,EAAE,WAAW,MAAM,CAAC;AAC5C,SAAM,oBAAoB,YAAY,YAAY,UAAU;SACvD;GAEL,MAAM,UAAU,MAAM,SAAS,YAAY,QAAQ;AAMnD,SAAM,UAAU,YAHEC,mBAAW,QAAQ,SAAS,EAAE,UAAU,MAAM,CAAC,CAAC,UAAU,EAGrC,QAAQ"}
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { i as __toESM, t as require_dist } from "./dist-BoZnMvNi.mjs";
3
3
  import { a as Ne, c as Ve, d as bt, f as je, h as runMain, i as Le, l as We, m as defineCommand, o as R, p as Ct, r as Je, s as Re, t as findSourceRoot, u as Ze } from "./context-detection-BxY5Qs8X.mjs";
4
- import { $ as resolveVersion, A as mergeRules, At as parseSource, B as resolveProfileChain, C as saveGlobalConfig, D as mergeMemory, E as require_lib, F as getProfileWeight, Gt as SourceParseError, H as placeFile, Ht as FileNotFoundError, I as isLockedProfile, J as writeState, Jt as getAIToolPath, L as sortProfilesByWeight, M as mergeSkills, Mt as loadProjectManifest, N as mergeSkillsWithWarnings, O as mergeMemoryWithWarnings, Q as writeLock, R as mergeContentParts, Rt as KEBAB_CASE_REGEX, S as removeGlobalSource, T as setGlobalIdePlatforms, U as discoverProfilesInSourceRepo, V as detectLegacyPaths, W as findSourceManifest, X as generateLock, Y as removePlacedFiles, Yt as getAllAIToolKeys, Z as readLock, _ as getGlobalAiTools, a as formatInstallCommand, at as removeGitignoreManagedSection, b as getGlobalSources, c as readProjectPreferences, ct as getRegisteredIdePlatforms, d as computeIntersection, et as cloneGitSource, f as clearIdeCache, ft as getAIToolAdaptersForKeys, g as getDefaultGlobalSource, i as detectInstallMethod, it as ensureBatonDirGitignored, j as mergeRulesWithWarnings, jt as loadProfileManifest, k as mergeAgentsWithWarnings, kt as parseFrontmatter, l as writeProjectPreferences, lt as idePlatformRegistry, m as addGlobalSource, n as checkLatestVersion, nt as esm_default, o as resolvePreferences, ot as updateGitignore, p as detectInstalledIdes, pt as getAllAIToolAdapters, q as readState, qt as getAIToolConfig, r as isUpdateAvailable, rt as collectComprehensivePatterns, st as getIdePlatformTargetDir, t as validateSource, ut as isKnownIdePlatform, w as setGlobalAiTools, x as loadGlobalConfig, y as getGlobalIdePlatforms, z as resolveProfileSupport } from "./src-qYK6F_wF.mjs";
4
+ import { $ as resolveVersion, A as mergeRules, At as parseSource, B as resolveProfileChain, C as saveGlobalConfig, D as mergeMemory, E as require_lib, F as getProfileWeight, Gt as SourceParseError, H as placeFile, Ht as FileNotFoundError, I as isLockedProfile, J as writeState, Jt as getAIToolPath, L as sortProfilesByWeight, M as mergeSkills, Mt as loadProjectManifest, N as mergeSkillsWithWarnings, O as mergeMemoryWithWarnings, Q as writeLock, R as mergeContentParts, Rt as KEBAB_CASE_REGEX, S as removeGlobalSource, T as setGlobalIdePlatforms, U as discoverProfilesInSourceRepo, V as detectLegacyPaths, W as findSourceManifest, X as generateLock, Y as removePlacedFiles, Yt as getAllAIToolKeys, Z as readLock, _ as getGlobalAiTools, a as formatInstallCommand, at as removeGitignoreManagedSection, b as getGlobalSources, c as readProjectPreferences, ct as getRegisteredIdePlatforms, d as computeIntersection, et as cloneGitSource, f as clearIdeCache, ft as getAIToolAdaptersForKeys, g as getDefaultGlobalSource, i as detectInstallMethod, it as ensureBatonDirGitignored, j as mergeRulesWithWarnings, jt as loadProfileManifest, k as mergeAgentsWithWarnings, kt as parseFrontmatter, l as writeProjectPreferences, lt as idePlatformRegistry, m as addGlobalSource, n as checkLatestVersion, nt as esm_default, o as resolvePreferences, ot as updateGitignore, p as detectInstalledIdes, pt as getAllAIToolAdapters, q as readState, qt as getAIToolConfig, r as isUpdateAvailable, rt as collectComprehensivePatterns, st as getIdePlatformTargetDir, t as validateSource, ut as isKnownIdePlatform, w as setGlobalAiTools, x as loadGlobalConfig, y as getGlobalIdePlatforms, z as resolveProfileSupport } from "./src-BC9rP9z6.mjs";
5
5
  import { n as detectInstalledAITools, t as clearAIToolCache } from "./ai-tool-detection-CMsBNa9e.mjs";
6
6
  import { access, mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
7
7
  import { dirname, isAbsolute, join, relative, resolve } from "node:path";
@@ -632,7 +632,7 @@ async function loadPreviousPlacedPaths(projectRoot) {
632
632
  const state = await readState(projectRoot);
633
633
  if (state) return new Set(state.placed_files);
634
634
  try {
635
- const { readLock } = await import("./src-Cjti8F9a.mjs");
635
+ const { readLock } = await import("./src-CYXVBXKq.mjs");
636
636
  const previousLock = await readLock(resolve(projectRoot, "baton.lock"));
637
637
  const paths = /* @__PURE__ */ new Set();
638
638
  for (const pkg of Object.values(previousLock.packages)) for (const filePath of Object.keys(pkg.integrity)) if (filePath.startsWith(".") || filePath.includes("/")) paths.add(filePath);
@@ -3087,8 +3087,8 @@ const profileCommand = defineCommand({
3087
3087
  description: "Manage profiles (create, list, remove)"
3088
3088
  },
3089
3089
  subCommands: {
3090
- create: () => import("./create-DFhPMuBR.mjs").then((m) => m.createCommand),
3091
- list: () => import("./list-TKfJJ1i-.mjs").then((m) => m.profileListCommand),
3090
+ create: () => import("./create-DU8qIWn9.mjs").then((m) => m.createCommand),
3091
+ list: () => import("./list-aDpgCGh4.mjs").then((m) => m.profileListCommand),
3092
3092
  remove: () => import("./remove-Lb4YUPYV.mjs").then((m) => m.profileRemoveCommand)
3093
3093
  }
3094
3094
  });
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import "./dist-BoZnMvNi.mjs";
3
3
  import { c as Ve, i as Le, l as We, m as defineCommand, n as isInSourceRepo } from "./context-detection-BxY5Qs8X.mjs";
4
- import { U as discoverProfilesInSourceRepo } from "./src-qYK6F_wF.mjs";
4
+ import { U as discoverProfilesInSourceRepo } from "./src-BC9rP9z6.mjs";
5
5
  import "./ai-tool-detection-CMsBNa9e.mjs";
6
6
 
7
7
  //#region src/commands/profile/list.ts
@@ -53,4 +53,4 @@ Note: Must be run from a source repository (directory with baton.source.yaml)`
53
53
 
54
54
  //#endregion
55
55
  export { profileListCommand };
56
- //# sourceMappingURL=list-TKfJJ1i-.mjs.map
56
+ //# sourceMappingURL=list-aDpgCGh4.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-TKfJJ1i-.mjs","names":[],"sources":["../src/commands/profile/list.ts"],"sourcesContent":["import { discoverProfilesInSourceRepo } from \"@baton-dx/core\";\nimport * as p from \"@clack/prompts\";\nimport { defineCommand } from \"citty\";\nimport { isInSourceRepo } from \"../../utils/context-detection.js\";\n\nexport const profileListCommand = defineCommand({\n meta: {\n name: \"profile list\",\n description: `List all profiles in the current source repository\n\nShows a table of all profiles with:\n - Profile name (root profile marked with \"(root)\")\n - Version from baton.profile.yaml\n - Description from profile manifest\n\nExamples:\n baton profile list\n\nNote: Must be run from a source repository (directory with baton.source.yaml)`,\n },\n run: async () => {\n p.intro(\"List Profiles\");\n\n // Check if we're in a source repo\n const inSourceRepo = await isInSourceRepo();\n if (!inSourceRepo) {\n p.outro(\n \"Error: Not in a source repository. Run this command from a directory containing baton.source.yaml\",\n );\n process.exit(1);\n }\n\n const cwd = process.cwd();\n\n // Discover all profiles in the profiles/ directory\n const profiles = await discoverProfilesInSourceRepo(cwd);\n\n if (profiles.length === 0) {\n p.outro(\"No profiles found.\");\n process.exit(0);\n }\n\n // Build table output\n const lines: string[] = [];\n lines.push(\"┌─────────────────────┬─────────┬────────────────────────────────────┐\");\n lines.push(\"│ Name │ Version │ Description │\");\n lines.push(\"├─────────────────────┼─────────┼────────────────────────────────────┤\");\n\n for (const profile of profiles) {\n const name = profile.name;\n const version = profile.version || \"-\";\n const description = profile.description || \"-\";\n\n // Pad columns to fixed width\n const namePadded = name.padEnd(19);\n const versionPadded = version.padEnd(7);\n const descPadded = description.padEnd(34);\n\n lines.push(`│ ${namePadded} │ ${versionPadded} │ ${descPadded} │`);\n }\n\n lines.push(\"└─────────────────────┴─────────┴────────────────────────────────────┘\");\n\n p.note(lines.join(\"\\n\"), \"Profiles\");\n p.outro(`Found ${profiles.length} profile${profiles.length === 1 ? \"\" : \"s\"}`);\n process.exit(0);\n },\n});\n"],"mappings":";;;;;;;AAKA,MAAa,qBAAqB,cAAc;CAC9C,MAAM;EACJ,MAAM;EACN,aAAa;;;;;;;;;;;EAWd;CACD,KAAK,YAAY;AACf,KAAQ,gBAAgB;AAIxB,MAAI,CADiB,MAAM,gBAAgB,EACxB;AACjB,MACE,oGACD;AACD,WAAQ,KAAK,EAAE;;EAMjB,MAAM,WAAW,MAAM,6BAHX,QAAQ,KAAK,CAG+B;AAExD,MAAI,SAAS,WAAW,GAAG;AACzB,MAAQ,qBAAqB;AAC7B,WAAQ,KAAK,EAAE;;EAIjB,MAAM,QAAkB,EAAE;AAC1B,QAAM,KAAK,yEAAyE;AACpF,QAAM,KAAK,yEAAyE;AACpF,QAAM,KAAK,yEAAyE;AAEpF,OAAK,MAAM,WAAW,UAAU;GAC9B,MAAM,OAAO,QAAQ;GACrB,MAAM,UAAU,QAAQ,WAAW;GACnC,MAAM,cAAc,QAAQ,eAAe;GAG3C,MAAM,aAAa,KAAK,OAAO,GAAG;GAClC,MAAM,gBAAgB,QAAQ,OAAO,EAAE;GACvC,MAAM,aAAa,YAAY,OAAO,GAAG;AAEzC,SAAM,KAAK,KAAK,WAAW,KAAK,cAAc,KAAK,WAAW,IAAI;;AAGpE,QAAM,KAAK,yEAAyE;AAEpF,KAAO,MAAM,KAAK,KAAK,EAAE,WAAW;AACpC,KAAQ,SAAS,SAAS,OAAO,UAAU,SAAS,WAAW,IAAI,KAAK,MAAM;AAC9E,UAAQ,KAAK,EAAE;;CAElB,CAAC"}
1
+ {"version":3,"file":"list-aDpgCGh4.mjs","names":[],"sources":["../src/commands/profile/list.ts"],"sourcesContent":["import { discoverProfilesInSourceRepo } from \"@baton-dx/core\";\nimport * as p from \"@clack/prompts\";\nimport { defineCommand } from \"citty\";\nimport { isInSourceRepo } from \"../../utils/context-detection.js\";\n\nexport const profileListCommand = defineCommand({\n meta: {\n name: \"profile list\",\n description: `List all profiles in the current source repository\n\nShows a table of all profiles with:\n - Profile name (root profile marked with \"(root)\")\n - Version from baton.profile.yaml\n - Description from profile manifest\n\nExamples:\n baton profile list\n\nNote: Must be run from a source repository (directory with baton.source.yaml)`,\n },\n run: async () => {\n p.intro(\"List Profiles\");\n\n // Check if we're in a source repo\n const inSourceRepo = await isInSourceRepo();\n if (!inSourceRepo) {\n p.outro(\n \"Error: Not in a source repository. Run this command from a directory containing baton.source.yaml\",\n );\n process.exit(1);\n }\n\n const cwd = process.cwd();\n\n // Discover all profiles in the profiles/ directory\n const profiles = await discoverProfilesInSourceRepo(cwd);\n\n if (profiles.length === 0) {\n p.outro(\"No profiles found.\");\n process.exit(0);\n }\n\n // Build table output\n const lines: string[] = [];\n lines.push(\"┌─────────────────────┬─────────┬────────────────────────────────────┐\");\n lines.push(\"│ Name │ Version │ Description │\");\n lines.push(\"├─────────────────────┼─────────┼────────────────────────────────────┤\");\n\n for (const profile of profiles) {\n const name = profile.name;\n const version = profile.version || \"-\";\n const description = profile.description || \"-\";\n\n // Pad columns to fixed width\n const namePadded = name.padEnd(19);\n const versionPadded = version.padEnd(7);\n const descPadded = description.padEnd(34);\n\n lines.push(`│ ${namePadded} │ ${versionPadded} │ ${descPadded} │`);\n }\n\n lines.push(\"└─────────────────────┴─────────┴────────────────────────────────────┘\");\n\n p.note(lines.join(\"\\n\"), \"Profiles\");\n p.outro(`Found ${profiles.length} profile${profiles.length === 1 ? \"\" : \"s\"}`);\n process.exit(0);\n },\n});\n"],"mappings":";;;;;;;AAKA,MAAa,qBAAqB,cAAc;CAC9C,MAAM;EACJ,MAAM;EACN,aAAa;;;;;;;;;;;EAWd;CACD,KAAK,YAAY;AACf,KAAQ,gBAAgB;AAIxB,MAAI,CADiB,MAAM,gBAAgB,EACxB;AACjB,MACE,oGACD;AACD,WAAQ,KAAK,EAAE;;EAMjB,MAAM,WAAW,MAAM,6BAHX,QAAQ,KAAK,CAG+B;AAExD,MAAI,SAAS,WAAW,GAAG;AACzB,MAAQ,qBAAqB;AAC7B,WAAQ,KAAK,EAAE;;EAIjB,MAAM,QAAkB,EAAE;AAC1B,QAAM,KAAK,yEAAyE;AACpF,QAAM,KAAK,yEAAyE;AACpF,QAAM,KAAK,yEAAyE;AAEpF,OAAK,MAAM,WAAW,UAAU;GAC9B,MAAM,OAAO,QAAQ;GACrB,MAAM,UAAU,QAAQ,WAAW;GACnC,MAAM,cAAc,QAAQ,eAAe;GAG3C,MAAM,aAAa,KAAK,OAAO,GAAG;GAClC,MAAM,gBAAgB,QAAQ,OAAO,EAAE;GACvC,MAAM,aAAa,YAAY,OAAO,GAAG;AAEzC,SAAM,KAAK,KAAK,WAAW,KAAK,cAAc,KAAK,WAAW,IAAI;;AAGpE,QAAM,KAAK,yEAAyE;AAEpF,KAAO,MAAM,KAAK,KAAK,EAAE,WAAW;AACpC,KAAQ,SAAS,SAAS,OAAO,UAAU,SAAS,WAAW,IAAI,KAAK,MAAM;AAC9E,UAAQ,KAAK,EAAE;;CAElB,CAAC"}
@@ -3816,11 +3816,13 @@ const aiSectionSchema = objectType({
3816
3816
  }).optional();
3817
3817
  /**
3818
3818
  * File configuration item with optional target mapping
3819
+ *
3820
+ * Note: Files are deduplicated by target path (last-wins by weight),
3821
+ * not merged. Merge strategies only apply to memory items.
3819
3822
  */
3820
3823
  const fileConfigItemSchema = objectType({
3821
3824
  source: stringType(),
3822
- target: stringType().optional(),
3823
- merge: mergeStrategySchema
3825
+ target: stringType().optional()
3824
3826
  });
3825
3827
  /**
3826
3828
  * Files section in profile manifest - array of file configurations
@@ -19843,4 +19845,4 @@ function buildReport(issues, profilesChecked) {
19843
19845
 
19844
19846
  //#endregion
19845
19847
  export { resolveVersion as $, mergeRules as A, parseSource as At, resolveProfileChain as B, BatonError as Bt, saveGlobalConfig as C, CodexAdapter as Ct, mergeMemory as D, AmpAdapter as Dt, require_lib as E, AntigravityAdapter as Et, getProfileWeight as F, profileManifestSchema as Ft, getStatePath as G, SourceParseError as Gt, placeFile as H, FileNotFoundError as Ht, isLockedProfile as I, sourceManifestSchema as It, writeState as J, getAIToolPath as Jt, placementStateSchema as K, VersionNotFoundError as Kt, sortProfilesByWeight as L, weightSchema as Lt, mergeSkills as M, loadProjectManifest as Mt, mergeSkillsWithWarnings as N, lockfileSchema as Nt, mergeMemoryWithWarnings as O, BaseAIToolAdapter as Ot, WEIGHT_LOCK as P, projectManifestSchema as Pt, writeLock as Q, mergeContentParts as R, KEBAB_CASE_REGEX as Rt, removeGlobalSource as S, CursorAdapter as St, setGlobalIdePlatforms as T, ClaudeCodeAdapter as Tt, discoverProfilesInSourceRepo as U, GitSourceError as Ut, detectLegacyPaths as V, CircularInheritanceError as Vt, findSourceManifest as W, ManifestValidationError as Wt, generateLock as X, AIToolNotFoundError as Xt, removePlacedFiles as Y, getAllAIToolKeys as Yt, readLock as Z, getGlobalAiTools as _, RooAdapter as _t, formatInstallCommand as a, removeGitignoreManagedSection as at, getGlobalSources as b, JunieAdapter as bt, readProjectPreferences as c, getRegisteredIdePlatforms as ct, computeIntersection as d, getAIToolAdapter as dt, cloneGitSource as et, clearIdeCache as f, getAIToolAdaptersForKeys as ft, getDefaultGlobalSource as g, TraeAdapter as gt, getBatonHome as h, WindsurfAdapter as ht, detectInstallMethod as i, ensureBatonDirGitignored as it, mergeRulesWithWarnings as j, loadProfileManifest as jt, mergeAgentsWithWarnings as k, parseFrontmatter as kt, writeProjectPreferences as l, idePlatformRegistry as lt, addGlobalSource as m, ZedAdapter as mt, checkLatestVersion as n, esm_default as nt, resolvePreferences as o, updateGitignore as ot, detectInstalledIdes as p, getAllAIToolAdapters as pt, readState as q, getAIToolConfig as qt, isUpdateAvailable as r, collectComprehensivePatterns as rt, getPreferencesPath as s, getIdePlatformTargetDir as st, validateSource as t, expandSparseCheckout as tt, projectPreferencesSchema as u, isKnownIdePlatform as ut, getGlobalConfigPath as v, OpenCodeAdapter as vt, setGlobalAiTools as w, ClineAdapter as wt, loadGlobalConfig as x, GitHubCopilotAdapter as xt, getGlobalIdePlatforms as y, KiroAdapter as yt, resolveProfileSupport as z, AIToolAdapterNotFoundError as zt };
19846
- //# sourceMappingURL=src-qYK6F_wF.mjs.map
19848
+ //# sourceMappingURL=src-BC9rP9z6.mjs.map