aiblueprint-cli 1.4.34 → 1.4.35

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.
@@ -134,8 +134,8 @@ fi
134
134
 
135
135
  ```bash
136
136
  # Make script executable and run it
137
- chmod +x /Users/melvynx/.claude/skills/setup-ralph/scripts/setup.sh
138
- /Users/melvynx/.claude/skills/setup-ralph/scripts/setup.sh "{project_path}" "{feature_name}"
137
+ chmod +x {SKILL_PATH}/scripts/setup.sh
138
+ {SKILL_PATH}/scripts/setup.sh "{project_path}" "{feature_name}"
139
139
  ```
140
140
 
141
141
  The setup script creates:
package/dist/cli.js CHANGED
@@ -32249,8 +32249,8 @@ var inquirer = {
32249
32249
  var lib_default = inquirer;
32250
32250
 
32251
32251
  // src/commands/setup.ts
32252
- var import_fs_extra6 = __toESM(require_lib4(), 1);
32253
- import path8 from "path";
32252
+ var import_fs_extra7 = __toESM(require_lib4(), 1);
32253
+ import path9 from "path";
32254
32254
  import os9 from "os";
32255
32255
 
32256
32256
  // node_modules/chalk/source/vendor/ansi-styles/index.js
@@ -32992,11 +32992,13 @@ async function installStatuslineDependencies(claudeDir) {
32992
32992
  }
32993
32993
 
32994
32994
  // src/commands/setup/settings.ts
32995
- var import_fs_extra3 = __toESM(require_lib4(), 1);
32996
- import path5 from "path";
32995
+ var import_fs_extra4 = __toESM(require_lib4(), 1);
32996
+ import path6 from "path";
32997
32997
 
32998
32998
  // src/lib/platform.ts
32999
+ var import_fs_extra3 = __toESM(require_lib4(), 1);
32999
33000
  import os6 from "os";
33001
+ import path5 from "path";
33000
33002
  import { execSync as execSync2 } from "child_process";
33001
33003
  function escapeShellArg(arg) {
33002
33004
  return "'" + arg.replace(/'/g, "'\\''") + "'";
@@ -33172,8 +33174,27 @@ function transformAudioCommand(command, claudeDir) {
33172
33174
  }
33173
33175
  return getPlaySoundCommand(soundPath);
33174
33176
  }
33177
+ function replaceClaudePathPlaceholder(content, claudeDir) {
33178
+ return content.replaceAll("{CLAUDE_PATH}", claudeDir);
33179
+ }
33180
+ async function replacePathPlaceholdersInDir(dir, claudeDir) {
33181
+ const entries = await import_fs_extra3.default.readdir(dir, { withFileTypes: true });
33182
+ for (const entry of entries) {
33183
+ const fullPath = path5.join(dir, entry.name);
33184
+ if (entry.isDirectory()) {
33185
+ await replacePathPlaceholdersInDir(fullPath, claudeDir);
33186
+ } else if (isTextFile(entry.name)) {
33187
+ const content = await import_fs_extra3.default.readFile(fullPath, "utf-8");
33188
+ const replaced = replaceClaudePathPlaceholder(content, claudeDir);
33189
+ if (replaced !== content) {
33190
+ await import_fs_extra3.default.writeFile(fullPath, replaced, "utf-8");
33191
+ }
33192
+ }
33193
+ }
33194
+ }
33175
33195
  function transformFileContent(content, claudeDir) {
33176
33196
  let transformed = content;
33197
+ transformed = replaceClaudePathPlaceholder(transformed, claudeDir);
33177
33198
  for (const pattern of KNOWN_CLAUDE_PATHS) {
33178
33199
  transformed = transformed.replace(new RegExp(pattern.source, "g"), `${claudeDir}/`);
33179
33200
  }
@@ -33200,9 +33221,9 @@ function toPosixPath(p) {
33200
33221
  return p.replace(/\\/g, "/");
33201
33222
  }
33202
33223
  async function hasExistingStatusLine(claudeDir) {
33203
- const settingsPath = path5.join(claudeDir, "settings.json");
33224
+ const settingsPath = path6.join(claudeDir, "settings.json");
33204
33225
  try {
33205
- const existingSettings = await import_fs_extra3.default.readFile(settingsPath, "utf-8");
33226
+ const existingSettings = await import_fs_extra4.default.readFile(settingsPath, "utf-8");
33206
33227
  const settings = JSON.parse(existingSettings);
33207
33228
  return !!settings.statusLine;
33208
33229
  } catch {
@@ -33210,10 +33231,10 @@ async function hasExistingStatusLine(claudeDir) {
33210
33231
  }
33211
33232
  }
33212
33233
  async function updateSettings(options, claudeDir) {
33213
- const settingsPath = path5.join(claudeDir, "settings.json");
33234
+ const settingsPath = path6.join(claudeDir, "settings.json");
33214
33235
  let settings = {};
33215
33236
  try {
33216
- const existingSettings = await import_fs_extra3.default.readFile(settingsPath, "utf-8");
33237
+ const existingSettings = await import_fs_extra4.default.readFile(settingsPath, "utf-8");
33217
33238
  settings = JSON.parse(existingSettings);
33218
33239
  } catch {}
33219
33240
  if (options.customStatusline) {
@@ -33221,7 +33242,7 @@ async function updateSettings(options, claudeDir) {
33221
33242
  if (shouldReplace) {
33222
33243
  settings.statusLine = {
33223
33244
  type: "command",
33224
- command: `bun ${toPosixPath(path5.join(claudeDir, "scripts/statusline/src/index.ts"))}`,
33245
+ command: `bun ${toPosixPath(path6.join(claudeDir, "scripts/statusline/src/index.ts"))}`,
33225
33246
  padding: 0
33226
33247
  };
33227
33248
  }
@@ -33238,7 +33259,7 @@ async function updateSettings(options, claudeDir) {
33238
33259
  hooks: [
33239
33260
  {
33240
33261
  type: "command",
33241
- command: `bun ${toPosixPath(path5.join(claudeDir, "scripts/command-validator/src/cli.ts"))}`
33262
+ command: `bun ${toPosixPath(path6.join(claudeDir, "scripts/command-validator/src/cli.ts"))}`
33242
33263
  }
33243
33264
  ]
33244
33265
  };
@@ -33248,7 +33269,7 @@ async function updateSettings(options, claudeDir) {
33248
33269
  }
33249
33270
  }
33250
33271
  if (options.notificationSounds) {
33251
- const finishSoundPath = toPosixPath(path5.join(claudeDir, "song/finish.mp3"));
33272
+ const finishSoundPath = toPosixPath(path6.join(claudeDir, "song/finish.mp3"));
33252
33273
  const finishSoundCommand = getPlaySoundCommand(finishSoundPath);
33253
33274
  if (finishSoundCommand) {
33254
33275
  if (!settings.hooks.Stop) {
@@ -33268,7 +33289,7 @@ async function updateSettings(options, claudeDir) {
33268
33289
  settings.hooks.Stop.push(stopHook);
33269
33290
  }
33270
33291
  }
33271
- const needHumanSoundPath = toPosixPath(path5.join(claudeDir, "song/need-human.mp3"));
33292
+ const needHumanSoundPath = toPosixPath(path6.join(claudeDir, "song/need-human.mp3"));
33272
33293
  const needHumanSoundCommand = getPlaySoundCommand(needHumanSoundPath);
33273
33294
  if (needHumanSoundCommand) {
33274
33295
  if (!settings.hooks.Notification) {
@@ -33289,12 +33310,12 @@ async function updateSettings(options, claudeDir) {
33289
33310
  }
33290
33311
  }
33291
33312
  }
33292
- await import_fs_extra3.default.writeJson(settingsPath, settings, { spaces: 2 });
33313
+ await import_fs_extra4.default.writeJson(settingsPath, settings, { spaces: 2 });
33293
33314
  }
33294
33315
 
33295
33316
  // src/commands/setup/utils.ts
33296
- var import_fs_extra4 = __toESM(require_lib4(), 1);
33297
- import path6 from "path";
33317
+ var import_fs_extra5 = __toESM(require_lib4(), 1);
33318
+ import path7 from "path";
33298
33319
  import os7 from "os";
33299
33320
  import { exec } from "child_process";
33300
33321
  import { promisify } from "util";
@@ -33312,20 +33333,20 @@ class SimpleSpinner {
33312
33333
  }
33313
33334
  var GITHUB_REPO = "https://github.com/Melvynx/aiblueprint.git";
33314
33335
  async function cloneRepository() {
33315
- const tmpDir = path6.join(os7.tmpdir(), `aiblueprint-${Date.now()}`);
33336
+ const tmpDir = path7.join(os7.tmpdir(), `aiblueprint-${Date.now()}`);
33316
33337
  try {
33317
- await import_fs_extra4.default.ensureDir(tmpDir);
33338
+ await import_fs_extra5.default.ensureDir(tmpDir);
33318
33339
  await execAsync(`git clone --depth 1 --quiet ${GITHUB_REPO} "${tmpDir}"`);
33319
33340
  return tmpDir;
33320
33341
  } catch (error) {
33321
33342
  console.error(source_default.yellow(` Warning: Failed to clone repository: ${error instanceof Error ? error.message : String(error)}`));
33322
- await import_fs_extra4.default.remove(tmpDir).catch(() => {});
33343
+ await import_fs_extra5.default.remove(tmpDir).catch(() => {});
33323
33344
  return null;
33324
33345
  }
33325
33346
  }
33326
33347
  async function cleanupRepository(repoPath) {
33327
33348
  try {
33328
- await import_fs_extra4.default.remove(repoPath);
33349
+ await import_fs_extra5.default.remove(repoPath);
33329
33350
  } catch (error) {
33330
33351
  console.error(source_default.yellow(` Warning: Failed to cleanup temporary directory: ${error instanceof Error ? error.message : String(error)}`));
33331
33352
  }
@@ -33350,20 +33371,20 @@ function getVersion() {
33350
33371
  }
33351
33372
 
33352
33373
  // src/lib/backup-utils.ts
33353
- var import_fs_extra5 = __toESM(require_lib4(), 1);
33354
- import path7 from "path";
33374
+ var import_fs_extra6 = __toESM(require_lib4(), 1);
33375
+ import path8 from "path";
33355
33376
  import os8 from "os";
33356
- var BACKUP_BASE_DIR = path7.join(os8.homedir(), ".config", "aiblueprint", "backup");
33377
+ var BACKUP_BASE_DIR = path8.join(os8.homedir(), ".config", "aiblueprint", "backup");
33357
33378
  function formatDate(date) {
33358
33379
  const pad = (n) => n.toString().padStart(2, "0");
33359
33380
  return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}-${pad(date.getHours())}-${pad(date.getMinutes())}-${pad(date.getSeconds())}`;
33360
33381
  }
33361
33382
  async function listBackups() {
33362
- const exists = await import_fs_extra5.default.pathExists(BACKUP_BASE_DIR);
33383
+ const exists = await import_fs_extra6.default.pathExists(BACKUP_BASE_DIR);
33363
33384
  if (!exists) {
33364
33385
  return [];
33365
33386
  }
33366
- const entries = await import_fs_extra5.default.readdir(BACKUP_BASE_DIR, { withFileTypes: true });
33387
+ const entries = await import_fs_extra6.default.readdir(BACKUP_BASE_DIR, { withFileTypes: true });
33367
33388
  const backups = [];
33368
33389
  for (const entry of entries) {
33369
33390
  if (!entry.isDirectory())
@@ -33375,46 +33396,46 @@ async function listBackups() {
33375
33396
  const date = new Date(parseInt(year), parseInt(month) - 1, parseInt(day), parseInt(hour), parseInt(minute), parseInt(second));
33376
33397
  backups.push({
33377
33398
  name: entry.name,
33378
- path: path7.join(BACKUP_BASE_DIR, entry.name),
33399
+ path: path8.join(BACKUP_BASE_DIR, entry.name),
33379
33400
  date
33380
33401
  });
33381
33402
  }
33382
33403
  return backups.sort((a, b) => b.date.getTime() - a.date.getTime());
33383
33404
  }
33384
33405
  async function loadBackup(backupPath, claudeDir) {
33385
- const exists = await import_fs_extra5.default.pathExists(backupPath);
33406
+ const exists = await import_fs_extra6.default.pathExists(backupPath);
33386
33407
  if (!exists) {
33387
33408
  throw new Error(`Backup not found: ${backupPath}`);
33388
33409
  }
33389
- await import_fs_extra5.default.ensureDir(claudeDir);
33410
+ await import_fs_extra6.default.ensureDir(claudeDir);
33390
33411
  const itemsToCopy = ["commands", "agents", "skills", "scripts", "song", "settings.json"];
33391
33412
  for (const item of itemsToCopy) {
33392
- const sourcePath = path7.join(backupPath, item);
33393
- const destPath = path7.join(claudeDir, item);
33394
- if (await import_fs_extra5.default.pathExists(sourcePath)) {
33395
- await import_fs_extra5.default.copy(sourcePath, destPath, { overwrite: true });
33413
+ const sourcePath = path8.join(backupPath, item);
33414
+ const destPath = path8.join(claudeDir, item);
33415
+ if (await import_fs_extra6.default.pathExists(sourcePath)) {
33416
+ await import_fs_extra6.default.copy(sourcePath, destPath, { overwrite: true });
33396
33417
  }
33397
33418
  }
33398
33419
  }
33399
33420
  async function createBackup(claudeDir) {
33400
- const exists = await import_fs_extra5.default.pathExists(claudeDir);
33421
+ const exists = await import_fs_extra6.default.pathExists(claudeDir);
33401
33422
  if (!exists) {
33402
33423
  return null;
33403
33424
  }
33404
- const files = await import_fs_extra5.default.readdir(claudeDir);
33425
+ const files = await import_fs_extra6.default.readdir(claudeDir);
33405
33426
  const hasContent = files.some((f) => f !== ".DS_Store");
33406
33427
  if (!hasContent) {
33407
33428
  return null;
33408
33429
  }
33409
33430
  const timestamp = formatDate(new Date);
33410
- const backupPath = path7.join(BACKUP_BASE_DIR, timestamp);
33411
- await import_fs_extra5.default.ensureDir(backupPath);
33431
+ const backupPath = path8.join(BACKUP_BASE_DIR, timestamp);
33432
+ await import_fs_extra6.default.ensureDir(backupPath);
33412
33433
  const itemsToCopy = ["commands", "agents", "skills", "scripts", "song", "settings.json"];
33413
33434
  for (const item of itemsToCopy) {
33414
- const sourcePath = path7.join(claudeDir, item);
33415
- const destPath = path7.join(backupPath, item);
33416
- if (await import_fs_extra5.default.pathExists(sourcePath)) {
33417
- await import_fs_extra5.default.copy(sourcePath, destPath, { overwrite: true });
33435
+ const sourcePath = path8.join(claudeDir, item);
33436
+ const destPath = path8.join(backupPath, item);
33437
+ if (await import_fs_extra6.default.pathExists(sourcePath)) {
33438
+ await import_fs_extra6.default.copy(sourcePath, destPath, { overwrite: true });
33418
33439
  }
33419
33440
  }
33420
33441
  return backupPath;
@@ -33518,9 +33539,9 @@ async function setupCommand(params = {}) {
33518
33539
  skipInteractive
33519
33540
  };
33520
33541
  const s = new SimpleSpinner;
33521
- const claudeDir = customClaudeCodeFolder ? path8.resolve(customClaudeCodeFolder) : path8.join(os9.homedir(), ".claude");
33542
+ const claudeDir = customClaudeCodeFolder ? path9.resolve(customClaudeCodeFolder) : path9.join(os9.homedir(), ".claude");
33522
33543
  console.log(source_default.gray(`Installing to: ${claudeDir}`));
33523
- await import_fs_extra6.default.ensureDir(claudeDir);
33544
+ await import_fs_extra7.default.ensureDir(claudeDir);
33524
33545
  s.start("Creating backup of existing configuration");
33525
33546
  const backupPath = await createBackup(claudeDir);
33526
33547
  if (backupPath) {
@@ -33533,8 +33554,8 @@ async function setupCommand(params = {}) {
33533
33554
  if (!repoPath) {
33534
33555
  throw new Error("Failed to clone repository. Please check your internet connection and try again.");
33535
33556
  }
33536
- const sourceDir = path8.join(repoPath, "claude-code-config");
33537
- if (!await import_fs_extra6.default.pathExists(sourceDir)) {
33557
+ const sourceDir = path9.join(repoPath, "claude-code-config");
33558
+ if (!await import_fs_extra7.default.pathExists(sourceDir)) {
33538
33559
  await cleanupRepository(repoPath);
33539
33560
  throw new Error("Configuration directory not found in cloned repository");
33540
33561
  }
@@ -33546,17 +33567,19 @@ async function setupCommand(params = {}) {
33546
33567
  }
33547
33568
  if (options.commandValidation || options.customStatusline || options.notificationSounds) {
33548
33569
  s.start("Setting up scripts");
33549
- await import_fs_extra6.default.copy(path8.join(sourceDir, "scripts"), path8.join(claudeDir, "scripts"), { overwrite: true });
33570
+ await import_fs_extra7.default.copy(path9.join(sourceDir, "scripts"), path9.join(claudeDir, "scripts"), { overwrite: true });
33571
+ await replacePathPlaceholdersInDir(path9.join(claudeDir, "scripts"), claudeDir);
33550
33572
  if (options.customStatusline) {
33551
- await import_fs_extra6.default.ensureDir(path8.join(claudeDir, "scripts/statusline/data"));
33573
+ await import_fs_extra7.default.ensureDir(path9.join(claudeDir, "scripts/statusline/data"));
33552
33574
  }
33553
33575
  s.stop("Scripts installed");
33554
33576
  }
33555
33577
  if (options.aiblueprintCommands) {
33556
33578
  s.start("Setting up AIBlueprint commands");
33557
- const commandsSourcePath = path8.join(sourceDir, "commands");
33558
- if (await import_fs_extra6.default.pathExists(commandsSourcePath)) {
33559
- await import_fs_extra6.default.copy(commandsSourcePath, path8.join(claudeDir, "commands"), { overwrite: true });
33579
+ const commandsSourcePath = path9.join(sourceDir, "commands");
33580
+ if (await import_fs_extra7.default.pathExists(commandsSourcePath)) {
33581
+ await import_fs_extra7.default.copy(commandsSourcePath, path9.join(claudeDir, "commands"), { overwrite: true });
33582
+ await replacePathPlaceholdersInDir(path9.join(claudeDir, "commands"), claudeDir);
33560
33583
  s.stop("Commands installed");
33561
33584
  } else {
33562
33585
  s.stop("Commands not available in repository");
@@ -33574,14 +33597,16 @@ async function setupCommand(params = {}) {
33574
33597
  }
33575
33598
  if (options.aiblueprintAgents) {
33576
33599
  s.start("Setting up AIBlueprint agents");
33577
- await import_fs_extra6.default.copy(path8.join(sourceDir, "agents"), path8.join(claudeDir, "agents"), { overwrite: true });
33600
+ await import_fs_extra7.default.copy(path9.join(sourceDir, "agents"), path9.join(claudeDir, "agents"), { overwrite: true });
33601
+ await replacePathPlaceholdersInDir(path9.join(claudeDir, "agents"), claudeDir);
33578
33602
  s.stop("Agents installed");
33579
33603
  }
33580
33604
  if (options.aiblueprintSkills) {
33581
33605
  s.start("Setting up AIBlueprint Skills");
33582
- const skillsSourcePath = path8.join(sourceDir, "skills");
33583
- if (await import_fs_extra6.default.pathExists(skillsSourcePath)) {
33584
- await import_fs_extra6.default.copy(skillsSourcePath, path8.join(claudeDir, "skills"), { overwrite: true });
33606
+ const skillsSourcePath = path9.join(sourceDir, "skills");
33607
+ if (await import_fs_extra7.default.pathExists(skillsSourcePath)) {
33608
+ await import_fs_extra7.default.copy(skillsSourcePath, path9.join(claudeDir, "skills"), { overwrite: true });
33609
+ await replacePathPlaceholdersInDir(path9.join(claudeDir, "skills"), claudeDir);
33585
33610
  s.stop("Skills installed");
33586
33611
  } else {
33587
33612
  s.stop("Skills not available in repository");
@@ -33589,7 +33614,7 @@ async function setupCommand(params = {}) {
33589
33614
  }
33590
33615
  if (options.notificationSounds) {
33591
33616
  s.start("Setting up notification sounds");
33592
- await import_fs_extra6.default.copy(path8.join(sourceDir, "song"), path8.join(claudeDir, "song"), { overwrite: true });
33617
+ await import_fs_extra7.default.copy(path9.join(sourceDir, "song"), path9.join(claudeDir, "song"), { overwrite: true });
33593
33618
  s.stop("Notification sounds installed");
33594
33619
  }
33595
33620
  if (options.customStatusline) {
@@ -33651,8 +33676,8 @@ Next steps:`));
33651
33676
  }
33652
33677
 
33653
33678
  // src/commands/setup-terminal.ts
33654
- var import_fs_extra7 = __toESM(require_lib4(), 1);
33655
- import path9 from "path";
33679
+ var import_fs_extra8 = __toESM(require_lib4(), 1);
33680
+ import path10 from "path";
33656
33681
  import os10 from "os";
33657
33682
  import { execSync as execSync3, exec as exec2 } from "child_process";
33658
33683
  var OHMYZSH_INSTALL_URL = "https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh";
@@ -33687,16 +33712,16 @@ function commandExists(cmd) {
33687
33712
  }
33688
33713
  }
33689
33714
  function isOhMyZshInstalled(homeDir) {
33690
- const ohMyZshDir = path9.join(homeDir, ".oh-my-zsh");
33691
- return import_fs_extra7.default.existsSync(ohMyZshDir);
33715
+ const ohMyZshDir = path10.join(homeDir, ".oh-my-zsh");
33716
+ return import_fs_extra8.default.existsSync(ohMyZshDir);
33692
33717
  }
33693
33718
  function backupFile(filePath) {
33694
- if (!import_fs_extra7.default.existsSync(filePath))
33719
+ if (!import_fs_extra8.default.existsSync(filePath))
33695
33720
  return null;
33696
33721
  const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
33697
33722
  const backupPath = `${filePath}.backup-${timestamp}`;
33698
33723
  try {
33699
- import_fs_extra7.default.copyFileSync(filePath, backupPath);
33724
+ import_fs_extra8.default.copyFileSync(filePath, backupPath);
33700
33725
  return backupPath;
33701
33726
  } catch (error) {
33702
33727
  throw new Error(`Failed to create backup: ${error.message}`);
@@ -33735,7 +33760,7 @@ function installPrerequisiteSync(packageName, installCmd) {
33735
33760
  async function installOhMyZsh(homeDir) {
33736
33761
  return new Promise((resolve, reject) => {
33737
33762
  const installCmd = `sh -c "$(curl -fsSL ${OHMYZSH_INSTALL_URL})" "" --unattended`;
33738
- const env2 = { ...process.env, HOME: homeDir, ZSH: path9.join(homeDir, ".oh-my-zsh") };
33763
+ const env2 = { ...process.env, HOME: homeDir, ZSH: path10.join(homeDir, ".oh-my-zsh") };
33739
33764
  exec2(installCmd, { timeout: INSTALL_TIMEOUT, env: env2 }, (error, stdout, stderr) => {
33740
33765
  if (error) {
33741
33766
  if ("killed" in error && error.killed) {
@@ -33756,8 +33781,8 @@ async function installPlugin(pluginName, repoUrl, homeDir) {
33756
33781
  if (!/^https:\/\/github\.com\/[\w-]+\/[\w-]+$/.test(repoUrl)) {
33757
33782
  throw new Error(`Invalid repository URL: ${repoUrl}`);
33758
33783
  }
33759
- const customPluginsDir = path9.join(homeDir, ".oh-my-zsh/custom/plugins", pluginName);
33760
- if (import_fs_extra7.default.existsSync(customPluginsDir)) {
33784
+ const customPluginsDir = path10.join(homeDir, ".oh-my-zsh/custom/plugins", pluginName);
33785
+ if (import_fs_extra8.default.existsSync(customPluginsDir)) {
33761
33786
  return;
33762
33787
  }
33763
33788
  return new Promise((resolve, reject) => {
@@ -33775,20 +33800,20 @@ async function installPlugin(pluginName, repoUrl, homeDir) {
33775
33800
  });
33776
33801
  }
33777
33802
  function updateZshrcTheme(theme, homeDir) {
33778
- const zshrcPath = path9.join(homeDir, ".zshrc");
33803
+ const zshrcPath = path10.join(homeDir, ".zshrc");
33779
33804
  const sanitizedTheme = sanitizeThemeName(theme);
33780
- if (!import_fs_extra7.default.existsSync(zshrcPath)) {
33805
+ if (!import_fs_extra8.default.existsSync(zshrcPath)) {
33781
33806
  throw new Error(".zshrc file not found. Please ensure Oh My ZSH is installed correctly.");
33782
33807
  }
33783
33808
  try {
33784
- let content = import_fs_extra7.default.readFileSync(zshrcPath, "utf-8");
33809
+ let content = import_fs_extra8.default.readFileSync(zshrcPath, "utf-8");
33785
33810
  if (content.match(/^ZSH_THEME=/m)) {
33786
33811
  content = content.replace(/^ZSH_THEME=.*/m, `ZSH_THEME="${sanitizedTheme}"`);
33787
33812
  } else {
33788
33813
  content = `ZSH_THEME="${sanitizedTheme}"
33789
33814
  ${content}`;
33790
33815
  }
33791
- import_fs_extra7.default.writeFileSync(zshrcPath, content);
33816
+ import_fs_extra8.default.writeFileSync(zshrcPath, content);
33792
33817
  } catch (error) {
33793
33818
  if (error.message.includes(".zshrc file not found")) {
33794
33819
  throw error;
@@ -33797,12 +33822,12 @@ ${content}`;
33797
33822
  }
33798
33823
  }
33799
33824
  function updateZshrcPlugins(plugins, homeDir) {
33800
- const zshrcPath = path9.join(homeDir, ".zshrc");
33801
- if (!import_fs_extra7.default.existsSync(zshrcPath)) {
33825
+ const zshrcPath = path10.join(homeDir, ".zshrc");
33826
+ if (!import_fs_extra8.default.existsSync(zshrcPath)) {
33802
33827
  throw new Error(".zshrc file not found. Please ensure Oh My ZSH is installed correctly.");
33803
33828
  }
33804
33829
  try {
33805
- let content = import_fs_extra7.default.readFileSync(zshrcPath, "utf-8");
33830
+ let content = import_fs_extra8.default.readFileSync(zshrcPath, "utf-8");
33806
33831
  const pluginsString = plugins.join(" ");
33807
33832
  if (content.match(/^plugins=\(/m)) {
33808
33833
  content = content.replace(/^plugins=\([^)]*\)/m, `plugins=(${pluginsString})`);
@@ -33810,7 +33835,7 @@ function updateZshrcPlugins(plugins, homeDir) {
33810
33835
  content = `${content}
33811
33836
  plugins=(${pluginsString})`;
33812
33837
  }
33813
- import_fs_extra7.default.writeFileSync(zshrcPath, content);
33838
+ import_fs_extra8.default.writeFileSync(zshrcPath, content);
33814
33839
  } catch (error) {
33815
33840
  if (error.message.includes(".zshrc file not found")) {
33816
33841
  throw error;
@@ -33917,8 +33942,8 @@ Installing missing prerequisites: ${missingPrereqs.join(", ")}`));
33917
33942
  selectedTheme = themeAnswer.theme;
33918
33943
  }
33919
33944
  }
33920
- const zshrcPath = path9.join(homeDir, ".zshrc");
33921
- if (import_fs_extra7.default.existsSync(zshrcPath)) {
33945
+ const zshrcPath = path10.join(homeDir, ".zshrc");
33946
+ if (import_fs_extra8.default.existsSync(zshrcPath)) {
33922
33947
  s.start("Backing up .zshrc");
33923
33948
  const backupPath = backupFile(zshrcPath);
33924
33949
  if (backupPath) {
@@ -34850,19 +34875,19 @@ var Y2 = ({ indicator: t = "dots" } = {}) => {
34850
34875
 
34851
34876
  // src/commands/pro.ts
34852
34877
  import os13 from "os";
34853
- import path12 from "path";
34878
+ import path13 from "path";
34854
34879
 
34855
34880
  // src/lib/pro-installer.ts
34856
- var import_fs_extra8 = __toESM(require_lib4(), 1);
34881
+ var import_fs_extra9 = __toESM(require_lib4(), 1);
34857
34882
  import os11 from "os";
34858
- import path10 from "path";
34883
+ import path11 from "path";
34859
34884
  import { exec as exec3 } from "child_process";
34860
34885
  import { promisify as promisify2 } from "util";
34861
34886
  var execAsync2 = promisify2(exec3);
34862
34887
  var PREMIUM_REPO = "Melvynx/aiblueprint-cli-premium";
34863
34888
  var PREMIUM_BRANCH = "main";
34864
34889
  function getCacheRepoDir() {
34865
- return path10.join(os11.homedir(), ".config", "aiblueprint", "pro-repos", "aiblueprint-cli-premium");
34890
+ return path11.join(os11.homedir(), ".config", "aiblueprint", "pro-repos", "aiblueprint-cli-premium");
34866
34891
  }
34867
34892
  async function execGitWithAuth(command, token, repoUrl, cwd) {
34868
34893
  const authenticatedUrl = `https://x-access-token:${token}@${repoUrl.replace(/^https?:\/\//, "")}`;
@@ -34876,33 +34901,39 @@ async function execGitWithAuth(command, token, repoUrl, cwd) {
34876
34901
  async function cloneOrUpdateRepo(token) {
34877
34902
  const cacheDir = getCacheRepoDir();
34878
34903
  const repoUrl = `https://github.com/${PREMIUM_REPO}.git`;
34879
- if (await import_fs_extra8.default.pathExists(path10.join(cacheDir, ".git"))) {
34904
+ if (await import_fs_extra9.default.pathExists(path11.join(cacheDir, ".git"))) {
34880
34905
  try {
34881
34906
  await execGitWithAuth("pull", token, repoUrl, cacheDir);
34882
34907
  } catch (error) {
34883
- await import_fs_extra8.default.remove(cacheDir);
34884
- await import_fs_extra8.default.ensureDir(path10.dirname(cacheDir));
34908
+ await import_fs_extra9.default.remove(cacheDir);
34909
+ await import_fs_extra9.default.ensureDir(path11.dirname(cacheDir));
34885
34910
  await execGitWithAuth(`clone ${repoUrl} ${cacheDir}`, token, repoUrl);
34886
34911
  }
34887
34912
  } else {
34888
- await import_fs_extra8.default.ensureDir(path10.dirname(cacheDir));
34913
+ await import_fs_extra9.default.ensureDir(path11.dirname(cacheDir));
34889
34914
  await execGitWithAuth(`clone ${repoUrl} ${cacheDir}`, token, repoUrl);
34890
34915
  }
34891
- return path10.join(cacheDir, "claude-code-config");
34916
+ return path11.join(cacheDir, "claude-code-config");
34892
34917
  }
34893
34918
  async function copyConfigFromCache(cacheConfigDir, targetDir, onProgress) {
34894
34919
  const walk = async (dir, baseDir = dir) => {
34895
- const entries = await import_fs_extra8.default.readdir(dir, { withFileTypes: true });
34920
+ const entries = await import_fs_extra9.default.readdir(dir, { withFileTypes: true });
34896
34921
  for (const entry of entries) {
34897
- const sourcePath = path10.join(dir, entry.name);
34898
- const relativePath = path10.relative(baseDir, sourcePath);
34899
- const targetPath = path10.join(targetDir, relativePath);
34922
+ const sourcePath = path11.join(dir, entry.name);
34923
+ const relativePath = path11.relative(baseDir, sourcePath);
34924
+ const targetPath = path11.join(targetDir, relativePath);
34900
34925
  if (entry.isDirectory()) {
34901
- await import_fs_extra8.default.ensureDir(targetPath);
34926
+ await import_fs_extra9.default.ensureDir(targetPath);
34902
34927
  onProgress?.(relativePath, "directory");
34903
34928
  await walk(sourcePath, baseDir);
34929
+ } else if (isTextFile(entry.name)) {
34930
+ const content = await import_fs_extra9.default.readFile(sourcePath, "utf-8");
34931
+ const replaced = replaceClaudePathPlaceholder(content, targetDir);
34932
+ await import_fs_extra9.default.ensureDir(path11.dirname(targetPath));
34933
+ await import_fs_extra9.default.writeFile(targetPath, replaced, "utf-8");
34934
+ onProgress?.(relativePath, "file");
34904
34935
  } else {
34905
- await import_fs_extra8.default.copy(sourcePath, targetPath, { overwrite: true });
34936
+ await import_fs_extra9.default.copy(sourcePath, targetPath, { overwrite: true });
34906
34937
  onProgress?.(relativePath, "file");
34907
34938
  }
34908
34939
  }
@@ -34923,8 +34954,8 @@ async function downloadFromPrivateGitHub(repo, branch, relativePath, targetPath,
34923
34954
  return false;
34924
34955
  }
34925
34956
  const content = await response.arrayBuffer();
34926
- await import_fs_extra8.default.ensureDir(path10.dirname(targetPath));
34927
- await import_fs_extra8.default.writeFile(targetPath, Buffer.from(content));
34957
+ await import_fs_extra9.default.ensureDir(path11.dirname(targetPath));
34958
+ await import_fs_extra9.default.writeFile(targetPath, Buffer.from(content));
34928
34959
  return true;
34929
34960
  } catch (error) {
34930
34961
  console.error(`Error downloading ${relativePath}:`, error);
@@ -34949,10 +34980,10 @@ async function downloadDirectoryFromPrivateGitHub(repo, branch, dirPath, targetD
34949
34980
  console.error(`Unexpected response for directory ${dirPath}`);
34950
34981
  return false;
34951
34982
  }
34952
- await import_fs_extra8.default.ensureDir(targetDir);
34983
+ await import_fs_extra9.default.ensureDir(targetDir);
34953
34984
  for (const file of files) {
34954
34985
  const relativePath = dirPath ? `${dirPath}/${file.name}` : file.name;
34955
- const targetPath = path10.join(targetDir, file.name);
34986
+ const targetPath = path11.join(targetDir, file.name);
34956
34987
  const displayPath = relativePath.replace("claude-code-config/", "");
34957
34988
  if (file.type === "file") {
34958
34989
  onProgress?.(displayPath, "file");
@@ -34969,7 +35000,7 @@ async function downloadDirectoryFromPrivateGitHub(repo, branch, dirPath, targetD
34969
35000
  }
34970
35001
  async function installProConfigs(options) {
34971
35002
  const { githubToken, claudeCodeFolder, onProgress } = options;
34972
- const claudeFolder = claudeCodeFolder || path10.join(os11.homedir(), ".claude");
35003
+ const claudeFolder = claudeCodeFolder || path11.join(os11.homedir(), ".claude");
34973
35004
  try {
34974
35005
  const cacheConfigDir = await cloneOrUpdateRepo(githubToken);
34975
35006
  await copyConfigFromCache(cacheConfigDir, claudeFolder, onProgress);
@@ -34977,46 +35008,46 @@ async function installProConfigs(options) {
34977
35008
  } catch (error) {
34978
35009
  console.warn("Git caching failed, falling back to API download");
34979
35010
  }
34980
- const tempDir = path10.join(os11.tmpdir(), `aiblueprint-premium-${Date.now()}`);
35011
+ const tempDir = path11.join(os11.tmpdir(), `aiblueprint-premium-${Date.now()}`);
34981
35012
  try {
34982
35013
  const success = await downloadDirectoryFromPrivateGitHub(PREMIUM_REPO, PREMIUM_BRANCH, "claude-code-config", tempDir, githubToken, onProgress);
34983
35014
  if (!success) {
34984
35015
  throw new Error("Failed to download premium configurations");
34985
35016
  }
34986
- await import_fs_extra8.default.copy(tempDir, claudeFolder, {
35017
+ await import_fs_extra9.default.copy(tempDir, claudeFolder, {
34987
35018
  overwrite: true
34988
35019
  });
34989
35020
  } catch (error) {
34990
35021
  throw new Error(`Failed to install premium configs: ${error instanceof Error ? error.message : "Unknown error"}`);
34991
35022
  } finally {
34992
35023
  try {
34993
- await import_fs_extra8.default.remove(tempDir);
35024
+ await import_fs_extra9.default.remove(tempDir);
34994
35025
  } catch {}
34995
35026
  }
34996
35027
  }
34997
35028
 
34998
35029
  // src/lib/token-storage.ts
34999
- var import_fs_extra9 = __toESM(require_lib4(), 1);
35030
+ var import_fs_extra10 = __toESM(require_lib4(), 1);
35000
35031
  import os12 from "os";
35001
- import path11 from "path";
35032
+ import path12 from "path";
35002
35033
  function getConfigDir() {
35003
35034
  const platform = os12.platform();
35004
35035
  if (platform === "win32") {
35005
- const appData = process.env.APPDATA || path11.join(os12.homedir(), "AppData", "Roaming");
35006
- return path11.join(appData, "aiblueprint");
35036
+ const appData = process.env.APPDATA || path12.join(os12.homedir(), "AppData", "Roaming");
35037
+ return path12.join(appData, "aiblueprint");
35007
35038
  } else {
35008
- const configHome = process.env.XDG_CONFIG_HOME || path11.join(os12.homedir(), ".config");
35009
- return path11.join(configHome, "aiblueprint");
35039
+ const configHome = process.env.XDG_CONFIG_HOME || path12.join(os12.homedir(), ".config");
35040
+ return path12.join(configHome, "aiblueprint");
35010
35041
  }
35011
35042
  }
35012
35043
  function getTokenFilePath() {
35013
- return path11.join(getConfigDir(), "token.txt");
35044
+ return path12.join(getConfigDir(), "token.txt");
35014
35045
  }
35015
35046
  async function saveToken(githubToken) {
35016
35047
  const tokenFile = getTokenFilePath();
35017
- const configDir = path11.dirname(tokenFile);
35048
+ const configDir = path12.dirname(tokenFile);
35018
35049
  try {
35019
- await import_fs_extra9.default.ensureDir(configDir);
35050
+ await import_fs_extra10.default.ensureDir(configDir);
35020
35051
  } catch (error) {
35021
35052
  if (error.code === "EACCES") {
35022
35053
  throw new Error(`Permission denied creating config directory: ${configDir}
@@ -35024,15 +35055,15 @@ async function saveToken(githubToken) {
35024
35055
  }
35025
35056
  throw error;
35026
35057
  }
35027
- await import_fs_extra9.default.writeFile(tokenFile, githubToken, { mode: 384 });
35058
+ await import_fs_extra10.default.writeFile(tokenFile, githubToken, { mode: 384 });
35028
35059
  }
35029
35060
  async function getToken() {
35030
35061
  const tokenFile = getTokenFilePath();
35031
- if (!await import_fs_extra9.default.pathExists(tokenFile)) {
35062
+ if (!await import_fs_extra10.default.pathExists(tokenFile)) {
35032
35063
  return null;
35033
35064
  }
35034
35065
  try {
35035
- const token = await import_fs_extra9.default.readFile(tokenFile, "utf-8");
35066
+ const token = await import_fs_extra10.default.readFile(tokenFile, "utf-8");
35036
35067
  return token.trim();
35037
35068
  } catch (error) {
35038
35069
  return null;
@@ -35046,7 +35077,7 @@ function getTokenInfo() {
35046
35077
  }
35047
35078
 
35048
35079
  // src/commands/pro.ts
35049
- var import_fs_extra10 = __toESM(require_lib4(), 1);
35080
+ var import_fs_extra11 = __toESM(require_lib4(), 1);
35050
35081
  var API_URL = "https://codeline.app/api/products";
35051
35082
  var PRODUCT_IDS = ["prd_XJVgxVPbGG", "prd_NKabAkdOkw"];
35052
35083
  async function countInstalledItems(claudeDir) {
@@ -35056,29 +35087,29 @@ async function countInstalledItems(claudeDir) {
35056
35087
  skills: 0
35057
35088
  };
35058
35089
  try {
35059
- const commandsDir = path12.join(claudeDir, "commands");
35060
- if (await import_fs_extra10.default.pathExists(commandsDir)) {
35061
- const files = await import_fs_extra10.default.readdir(commandsDir);
35090
+ const commandsDir = path13.join(claudeDir, "commands");
35091
+ if (await import_fs_extra11.default.pathExists(commandsDir)) {
35092
+ const files = await import_fs_extra11.default.readdir(commandsDir);
35062
35093
  counts.commands = files.filter((f) => f.endsWith(".md")).length;
35063
35094
  }
35064
35095
  } catch (error) {
35065
35096
  console.error("Failed to count commands:", error instanceof Error ? error.message : error);
35066
35097
  }
35067
35098
  try {
35068
- const agentsDir = path12.join(claudeDir, "agents");
35069
- if (await import_fs_extra10.default.pathExists(agentsDir)) {
35070
- const files = await import_fs_extra10.default.readdir(agentsDir);
35099
+ const agentsDir = path13.join(claudeDir, "agents");
35100
+ if (await import_fs_extra11.default.pathExists(agentsDir)) {
35101
+ const files = await import_fs_extra11.default.readdir(agentsDir);
35071
35102
  counts.agents = files.filter((f) => f.endsWith(".md")).length;
35072
35103
  }
35073
35104
  } catch (error) {
35074
35105
  console.error("Failed to count agents:", error instanceof Error ? error.message : error);
35075
35106
  }
35076
35107
  try {
35077
- const skillsDir = path12.join(claudeDir, "skills");
35078
- if (await import_fs_extra10.default.pathExists(skillsDir)) {
35079
- const items = await import_fs_extra10.default.readdir(skillsDir);
35108
+ const skillsDir = path13.join(claudeDir, "skills");
35109
+ if (await import_fs_extra11.default.pathExists(skillsDir)) {
35110
+ const items = await import_fs_extra11.default.readdir(skillsDir);
35080
35111
  const dirs = await Promise.all(items.map(async (item) => {
35081
- const stat = await import_fs_extra10.default.stat(path12.join(skillsDir, item));
35112
+ const stat = await import_fs_extra11.default.stat(path13.join(skillsDir, item));
35082
35113
  return stat.isDirectory();
35083
35114
  }));
35084
35115
  counts.skills = dirs.filter(Boolean).length;
@@ -35191,7 +35222,7 @@ async function proSetupCommand(options = {}) {
35191
35222
  Se(source_default.red("❌ Not activated"));
35192
35223
  process.exit(1);
35193
35224
  }
35194
- const claudeDir = options.folder ? path12.resolve(options.folder) : path12.join(os13.homedir(), ".claude");
35225
+ const claudeDir = options.folder ? path13.resolve(options.folder) : path13.join(os13.homedir(), ".claude");
35195
35226
  const spinner = Y2();
35196
35227
  const onProgress = (file, type) => {
35197
35228
  spinner.message(`Installing: ${source_default.cyan(file)} ${source_default.gray(`(${type})`)}`);
@@ -35274,11 +35305,11 @@ async function proUpdateCommand(options = {}) {
35274
35305
 
35275
35306
  // src/commands/sync.ts
35276
35307
  import os14 from "os";
35277
- import path14 from "path";
35308
+ import path15 from "path";
35278
35309
 
35279
35310
  // src/lib/sync-utils.ts
35280
- var import_fs_extra11 = __toESM(require_lib4(), 1);
35281
- import path13 from "path";
35311
+ var import_fs_extra12 = __toESM(require_lib4(), 1);
35312
+ import path14 from "path";
35282
35313
  import crypto from "crypto";
35283
35314
  var PREMIUM_REPO2 = "Melvynx/aiblueprint-cli-premium";
35284
35315
  var PREMIUM_BRANCH2 = "main";
@@ -35327,7 +35358,7 @@ async function listRemoteFilesRecursive(dirPath, githubToken, basePath = "") {
35327
35358
  }
35328
35359
  async function computeLocalFileSha(filePath) {
35329
35360
  try {
35330
- const content = await import_fs_extra11.default.readFile(filePath);
35361
+ const content = await import_fs_extra12.default.readFile(filePath);
35331
35362
  return computeFileSha(content);
35332
35363
  } catch {
35333
35364
  return null;
@@ -35335,15 +35366,15 @@ async function computeLocalFileSha(filePath) {
35335
35366
  }
35336
35367
  async function listLocalFiles(dir) {
35337
35368
  const files = [];
35338
- if (!await import_fs_extra11.default.pathExists(dir)) {
35369
+ if (!await import_fs_extra12.default.pathExists(dir)) {
35339
35370
  return files;
35340
35371
  }
35341
- const items = await import_fs_extra11.default.readdir(dir);
35372
+ const items = await import_fs_extra12.default.readdir(dir);
35342
35373
  for (const item of items) {
35343
35374
  if (item === "node_modules" || item === ".DS_Store")
35344
35375
  continue;
35345
- const fullPath = path13.join(dir, item);
35346
- const stat = await import_fs_extra11.default.stat(fullPath);
35376
+ const fullPath = path14.join(dir, item);
35377
+ const stat = await import_fs_extra12.default.stat(fullPath);
35347
35378
  if (stat.isDirectory()) {
35348
35379
  files.push(item);
35349
35380
  const subFiles = await listLocalFilesRecursive(fullPath, item);
@@ -35356,13 +35387,13 @@ async function listLocalFiles(dir) {
35356
35387
  }
35357
35388
  async function listLocalFilesRecursive(dir, basePath) {
35358
35389
  const files = [];
35359
- const items = await import_fs_extra11.default.readdir(dir);
35390
+ const items = await import_fs_extra12.default.readdir(dir);
35360
35391
  for (const item of items) {
35361
35392
  if (item === "node_modules" || item === ".DS_Store")
35362
35393
  continue;
35363
- const fullPath = path13.join(dir, item);
35394
+ const fullPath = path14.join(dir, item);
35364
35395
  const relativePath = `${basePath}/${item}`;
35365
- const stat = await import_fs_extra11.default.stat(fullPath);
35396
+ const stat = await import_fs_extra12.default.stat(fullPath);
35366
35397
  if (stat.isDirectory()) {
35367
35398
  files.push(relativePath);
35368
35399
  const subFiles = await listLocalFilesRecursive(fullPath, relativePath);
@@ -35375,7 +35406,7 @@ async function listLocalFilesRecursive(dir, basePath) {
35375
35406
  }
35376
35407
  async function analyzeCategory(category, claudeDir, githubToken) {
35377
35408
  const items = [];
35378
- const localDir = path13.join(claudeDir, category);
35409
+ const localDir = path14.join(claudeDir, category);
35379
35410
  const remoteFiles = await listRemoteFilesRecursive(category, githubToken);
35380
35411
  const localFiles = await listLocalFiles(localDir);
35381
35412
  const remoteSet = new Map;
@@ -35384,7 +35415,7 @@ async function analyzeCategory(category, claudeDir, githubToken) {
35384
35415
  }
35385
35416
  const localSet = new Set(localFiles);
35386
35417
  for (const [remotePath, { sha, isFolder }] of remoteSet) {
35387
- const localPath = path13.join(localDir, remotePath);
35418
+ const localPath = path14.join(localDir, remotePath);
35388
35419
  if (isFolder) {
35389
35420
  continue;
35390
35421
  }
@@ -35427,8 +35458,8 @@ async function analyzeCategory(category, claudeDir, githubToken) {
35427
35458
  if (parentAlreadyDeleted) {
35428
35459
  continue;
35429
35460
  }
35430
- const fullPath = path13.join(localDir, localPath);
35431
- const stat = await import_fs_extra11.default.stat(fullPath).catch(() => null);
35461
+ const fullPath = path14.join(localDir, localPath);
35462
+ const stat = await import_fs_extra12.default.stat(fullPath).catch(() => null);
35432
35463
  if (stat) {
35433
35464
  const isFolder = stat.isDirectory();
35434
35465
  items.push({
@@ -35464,9 +35495,9 @@ async function fetchRemoteSettings(githubToken) {
35464
35495
  }
35465
35496
  }
35466
35497
  async function getLocalSettings(claudeDir) {
35467
- const settingsPath = path13.join(claudeDir, "settings.json");
35498
+ const settingsPath = path14.join(claudeDir, "settings.json");
35468
35499
  try {
35469
- const content = await import_fs_extra11.default.readFile(settingsPath, "utf-8");
35500
+ const content = await import_fs_extra12.default.readFile(settingsPath, "utf-8");
35470
35501
  return JSON.parse(content);
35471
35502
  } catch {
35472
35503
  return {};
@@ -35548,13 +35579,13 @@ async function downloadFromPrivateGitHub2(relativePath, targetPath, githubToken,
35548
35579
  return false;
35549
35580
  }
35550
35581
  const content = await response.arrayBuffer();
35551
- await import_fs_extra11.default.ensureDir(path13.dirname(targetPath));
35582
+ await import_fs_extra12.default.ensureDir(path14.dirname(targetPath));
35552
35583
  if (isTextFile(relativePath)) {
35553
35584
  const textContent = Buffer.from(content).toString("utf-8");
35554
35585
  const transformedContent = transformFileContent(textContent, claudeDir);
35555
- await import_fs_extra11.default.writeFile(targetPath, transformedContent, "utf-8");
35586
+ await import_fs_extra12.default.writeFile(targetPath, transformedContent, "utf-8");
35556
35587
  } else {
35557
- await import_fs_extra11.default.writeFile(targetPath, Buffer.from(content));
35588
+ await import_fs_extra12.default.writeFile(targetPath, Buffer.from(content));
35558
35589
  }
35559
35590
  return true;
35560
35591
  } catch {
@@ -35565,10 +35596,10 @@ async function syncSelectedHooks(claudeDir, hooks, onProgress) {
35565
35596
  if (hooks.length === 0) {
35566
35597
  return { success: 0, failed: 0 };
35567
35598
  }
35568
- const settingsPath = path13.join(claudeDir, "settings.json");
35599
+ const settingsPath = path14.join(claudeDir, "settings.json");
35569
35600
  let settings = {};
35570
35601
  try {
35571
- const content = await import_fs_extra11.default.readFile(settingsPath, "utf-8");
35602
+ const content = await import_fs_extra12.default.readFile(settingsPath, "utf-8");
35572
35603
  settings = JSON.parse(content);
35573
35604
  } catch {
35574
35605
  settings = {};
@@ -35596,7 +35627,7 @@ async function syncSelectedHooks(claudeDir, hooks, onProgress) {
35596
35627
  failed++;
35597
35628
  }
35598
35629
  }
35599
- await import_fs_extra11.default.writeFile(settingsPath, JSON.stringify(settings, null, 2));
35630
+ await import_fs_extra12.default.writeFile(settingsPath, JSON.stringify(settings, null, 2));
35600
35631
  return { success, failed };
35601
35632
  }
35602
35633
  async function syncSelectedItems(claudeDir, items, githubToken, onProgress) {
@@ -35604,11 +35635,11 @@ async function syncSelectedItems(claudeDir, items, githubToken, onProgress) {
35604
35635
  let failed = 0;
35605
35636
  let deleted = 0;
35606
35637
  for (const item of items) {
35607
- const targetPath = path13.join(claudeDir, item.relativePath);
35638
+ const targetPath = path14.join(claudeDir, item.relativePath);
35608
35639
  if (item.status === "deleted") {
35609
35640
  onProgress?.(item.relativePath, "deleting");
35610
35641
  try {
35611
- await import_fs_extra11.default.remove(targetPath);
35642
+ await import_fs_extra12.default.remove(targetPath);
35612
35643
  deleted++;
35613
35644
  } catch {
35614
35645
  failed++;
@@ -35760,7 +35791,7 @@ async function proSyncCommand(options = {}) {
35760
35791
  Se(source_default.red("❌ Not activated"));
35761
35792
  process.exit(1);
35762
35793
  }
35763
- const claudeDir = options.folder ? path14.resolve(options.folder) : path14.join(os14.homedir(), ".claude");
35794
+ const claudeDir = options.folder ? path15.resolve(options.folder) : path15.join(os14.homedir(), ".claude");
35764
35795
  const spinner = Y2();
35765
35796
  spinner.start("Analyzing changes...");
35766
35797
  const result = await analyzeSyncChanges(claudeDir, githubToken);
@@ -36006,7 +36037,7 @@ async function proSyncCommand(options = {}) {
36006
36037
 
36007
36038
  // src/commands/backup.ts
36008
36039
  import os15 from "os";
36009
- import path15 from "path";
36040
+ import path16 from "path";
36010
36041
  function formatBackupDate(date) {
36011
36042
  const now = new Date;
36012
36043
  const diffMs = now.getTime() - date.getTime();
@@ -36026,7 +36057,7 @@ function formatBackupDate(date) {
36026
36057
  return `${date.toLocaleString()} (${relative})`;
36027
36058
  }
36028
36059
  async function backupLoadCommand(options = {}) {
36029
- const claudeDir = options.folder || path15.join(os15.homedir(), ".claude");
36060
+ const claudeDir = options.folder || path16.join(os15.homedir(), ".claude");
36030
36061
  Ie(source_default.blue("\uD83D\uDCE6 Load Backup"));
36031
36062
  const spinner = Y2();
36032
36063
  spinner.start("Scanning for backups...");
@@ -36083,18 +36114,18 @@ async function backupLoadCommand(options = {}) {
36083
36114
 
36084
36115
  // src/commands/openclaw-pro.ts
36085
36116
  import os18 from "os";
36086
- import path18 from "path";
36117
+ import path19 from "path";
36087
36118
 
36088
36119
  // src/lib/openclaw-installer.ts
36089
- var import_fs_extra12 = __toESM(require_lib4(), 1);
36120
+ var import_fs_extra13 = __toESM(require_lib4(), 1);
36090
36121
  import os16 from "os";
36091
- import path16 from "path";
36122
+ import path17 from "path";
36092
36123
  import { exec as exec4 } from "child_process";
36093
36124
  import { promisify as promisify3 } from "util";
36094
36125
  var execAsync3 = promisify3(exec4);
36095
36126
  var OPENCLAW_PRO_REPO = "Melvynx/openclawpro";
36096
36127
  function getCacheRepoDir2() {
36097
- return path16.join(os16.homedir(), ".config", "openclaw", "pro-repos", "openclawpro");
36128
+ return path17.join(os16.homedir(), ".config", "openclaw", "pro-repos", "openclawpro");
36098
36129
  }
36099
36130
  async function execGitWithAuth2(command, token, repoUrl, cwd) {
36100
36131
  const authenticatedUrl = `https://x-access-token:${token}@${repoUrl.replace(/^https?:\/\//, "")}`;
@@ -36108,33 +36139,33 @@ async function execGitWithAuth2(command, token, repoUrl, cwd) {
36108
36139
  async function cloneOrUpdateRepo2(token) {
36109
36140
  const cacheDir = getCacheRepoDir2();
36110
36141
  const repoUrl = `https://github.com/${OPENCLAW_PRO_REPO}.git`;
36111
- if (await import_fs_extra12.default.pathExists(path16.join(cacheDir, ".git"))) {
36142
+ if (await import_fs_extra13.default.pathExists(path17.join(cacheDir, ".git"))) {
36112
36143
  try {
36113
36144
  await execGitWithAuth2("pull", token, repoUrl, cacheDir);
36114
36145
  } catch (error) {
36115
- await import_fs_extra12.default.remove(cacheDir);
36116
- await import_fs_extra12.default.ensureDir(path16.dirname(cacheDir));
36146
+ await import_fs_extra13.default.remove(cacheDir);
36147
+ await import_fs_extra13.default.ensureDir(path17.dirname(cacheDir));
36117
36148
  await execGitWithAuth2(`clone ${repoUrl} ${cacheDir}`, token, repoUrl);
36118
36149
  }
36119
36150
  } else {
36120
- await import_fs_extra12.default.ensureDir(path16.dirname(cacheDir));
36151
+ await import_fs_extra13.default.ensureDir(path17.dirname(cacheDir));
36121
36152
  await execGitWithAuth2(`clone ${repoUrl} ${cacheDir}`, token, repoUrl);
36122
36153
  }
36123
- return path16.join(cacheDir, "openclaw-config");
36154
+ return path17.join(cacheDir, "openclaw-config");
36124
36155
  }
36125
36156
  async function copyConfigFromCache2(cacheConfigDir, targetDir, onProgress) {
36126
36157
  const walk = async (dir, baseDir = dir) => {
36127
- const entries = await import_fs_extra12.default.readdir(dir, { withFileTypes: true });
36158
+ const entries = await import_fs_extra13.default.readdir(dir, { withFileTypes: true });
36128
36159
  for (const entry of entries) {
36129
- const sourcePath = path16.join(dir, entry.name);
36130
- const relativePath = path16.relative(baseDir, sourcePath);
36131
- const targetPath = path16.join(targetDir, relativePath);
36160
+ const sourcePath = path17.join(dir, entry.name);
36161
+ const relativePath = path17.relative(baseDir, sourcePath);
36162
+ const targetPath = path17.join(targetDir, relativePath);
36132
36163
  if (entry.isDirectory()) {
36133
- await import_fs_extra12.default.ensureDir(targetPath);
36164
+ await import_fs_extra13.default.ensureDir(targetPath);
36134
36165
  onProgress?.(relativePath, "directory");
36135
36166
  await walk(sourcePath, baseDir);
36136
36167
  } else {
36137
- await import_fs_extra12.default.copy(sourcePath, targetPath, { overwrite: true });
36168
+ await import_fs_extra13.default.copy(sourcePath, targetPath, { overwrite: true });
36138
36169
  onProgress?.(relativePath, "file");
36139
36170
  }
36140
36171
  }
@@ -36143,7 +36174,7 @@ async function copyConfigFromCache2(cacheConfigDir, targetDir, onProgress) {
36143
36174
  }
36144
36175
  async function installOpenclawProConfigs(options) {
36145
36176
  const { githubToken, openclawFolder, onProgress } = options;
36146
- const targetFolder = openclawFolder || path16.join(os16.homedir(), ".openclaw");
36177
+ const targetFolder = openclawFolder || path17.join(os16.homedir(), ".openclaw");
36147
36178
  try {
36148
36179
  const cacheConfigDir = await cloneOrUpdateRepo2(githubToken);
36149
36180
  await copyConfigFromCache2(cacheConfigDir, targetFolder, onProgress);
@@ -36154,28 +36185,28 @@ async function installOpenclawProConfigs(options) {
36154
36185
  }
36155
36186
 
36156
36187
  // src/lib/openclaw-token-storage.ts
36157
- var import_fs_extra13 = __toESM(require_lib4(), 1);
36188
+ var import_fs_extra14 = __toESM(require_lib4(), 1);
36158
36189
  import os17 from "os";
36159
- import path17 from "path";
36190
+ import path18 from "path";
36160
36191
  function getConfigDir2() {
36161
36192
  const platform = os17.platform();
36162
36193
  if (platform === "win32") {
36163
- return path17.join(process.env.APPDATA || os17.homedir(), "openclaw");
36194
+ return path18.join(process.env.APPDATA || os17.homedir(), "openclaw");
36164
36195
  }
36165
- return path17.join(os17.homedir(), ".config", "openclaw");
36196
+ return path18.join(os17.homedir(), ".config", "openclaw");
36166
36197
  }
36167
36198
  function getTokenPath() {
36168
- return path17.join(getConfigDir2(), "token.txt");
36199
+ return path18.join(getConfigDir2(), "token.txt");
36169
36200
  }
36170
36201
  async function saveOpenclawToken(githubToken) {
36171
36202
  const configDir = getConfigDir2();
36172
- await import_fs_extra13.default.ensureDir(configDir);
36173
- await import_fs_extra13.default.writeFile(getTokenPath(), githubToken, { mode: 384 });
36203
+ await import_fs_extra14.default.ensureDir(configDir);
36204
+ await import_fs_extra14.default.writeFile(getTokenPath(), githubToken, { mode: 384 });
36174
36205
  }
36175
36206
  async function getOpenclawToken() {
36176
36207
  const tokenPath = getTokenPath();
36177
- if (await import_fs_extra13.default.pathExists(tokenPath)) {
36178
- const token = await import_fs_extra13.default.readFile(tokenPath, "utf8");
36208
+ if (await import_fs_extra14.default.pathExists(tokenPath)) {
36209
+ const token = await import_fs_extra14.default.readFile(tokenPath, "utf8");
36179
36210
  return token.trim();
36180
36211
  }
36181
36212
  return null;
@@ -36188,7 +36219,7 @@ function getOpenclawTokenInfo() {
36188
36219
  }
36189
36220
 
36190
36221
  // src/commands/openclaw-pro.ts
36191
- var import_fs_extra14 = __toESM(require_lib4(), 1);
36222
+ var import_fs_extra15 = __toESM(require_lib4(), 1);
36192
36223
  var API_URL2 = "https://codeline.app/api/products";
36193
36224
  var OPENCLAW_PRODUCT_ID = "prd_t2GRwX3aH1";
36194
36225
  var CLAUDE_CODE_TOOLS_INSTRUCTIONS = `
@@ -36295,7 +36326,7 @@ async function openclawProSetupCommand(options = {}) {
36295
36326
  Se(source_default.red("❌ Not activated"));
36296
36327
  process.exit(1);
36297
36328
  }
36298
- const openclawDir = options.folder ? path18.resolve(options.folder) : path18.join(os18.homedir(), ".openclaw");
36329
+ const openclawDir = options.folder ? path19.resolve(options.folder) : path19.join(os18.homedir(), ".openclaw");
36299
36330
  const spinner = Y2();
36300
36331
  const onProgress = (file, type) => {
36301
36332
  spinner.message(`Installing: ${source_default.cyan(file)} ${source_default.gray(`(${type})`)}`);
@@ -36308,23 +36339,23 @@ async function openclawProSetupCommand(options = {}) {
36308
36339
  });
36309
36340
  spinner.stop("OpenClaw Pro configurations installed");
36310
36341
  let skillCount = 0;
36311
- const skillsDir = path18.join(openclawDir, "skills");
36312
- if (await import_fs_extra14.default.pathExists(skillsDir)) {
36313
- const items = await import_fs_extra14.default.readdir(skillsDir);
36342
+ const skillsDir = path19.join(openclawDir, "skills");
36343
+ if (await import_fs_extra15.default.pathExists(skillsDir)) {
36344
+ const items = await import_fs_extra15.default.readdir(skillsDir);
36314
36345
  const dirs = await Promise.all(items.map(async (item) => {
36315
- const stat = await import_fs_extra14.default.stat(path18.join(skillsDir, item));
36346
+ const stat = await import_fs_extra15.default.stat(path19.join(skillsDir, item));
36316
36347
  return stat.isDirectory();
36317
36348
  }));
36318
36349
  skillCount = dirs.filter(Boolean).length;
36319
36350
  }
36320
36351
  spinner.start("Setting up workspace TOOLS.md...");
36321
- const workspaceDir = path18.join(openclawDir, "workspace");
36322
- const toolsPath = path18.join(workspaceDir, "TOOLS.md");
36323
- await import_fs_extra14.default.ensureDir(workspaceDir);
36324
- if (await import_fs_extra14.default.pathExists(toolsPath)) {
36325
- const existingContent = await import_fs_extra14.default.readFile(toolsPath, "utf-8");
36352
+ const workspaceDir = path19.join(openclawDir, "workspace");
36353
+ const toolsPath = path19.join(workspaceDir, "TOOLS.md");
36354
+ await import_fs_extra15.default.ensureDir(workspaceDir);
36355
+ if (await import_fs_extra15.default.pathExists(toolsPath)) {
36356
+ const existingContent = await import_fs_extra15.default.readFile(toolsPath, "utf-8");
36326
36357
  if (!existingContent.includes("Claude Code CLI")) {
36327
- await import_fs_extra14.default.appendFile(toolsPath, `
36358
+ await import_fs_extra15.default.appendFile(toolsPath, `
36328
36359
 
36329
36360
  ` + CLAUDE_CODE_TOOLS_INSTRUCTIONS);
36330
36361
  spinner.stop("TOOLS.md updated with Claude Code instructions");
@@ -36338,7 +36369,7 @@ Skills define _how_ tools work. This file is for _your_ specifics — the stuff
36338
36369
 
36339
36370
  ${CLAUDE_CODE_TOOLS_INSTRUCTIONS}
36340
36371
  `;
36341
- await import_fs_extra14.default.writeFile(toolsPath, defaultToolsMd);
36372
+ await import_fs_extra15.default.writeFile(toolsPath, defaultToolsMd);
36342
36373
  spinner.stop("TOOLS.md created with Claude Code instructions");
36343
36374
  }
36344
36375
  spinner.start("Creating claude-run wrapper...");
@@ -36349,9 +36380,9 @@ ${CLAUDE_CODE_TOOLS_INSTRUCTIONS}
36349
36380
  script -q -c "claude $*" /dev/null
36350
36381
  `;
36351
36382
  const binDir = "/usr/local/bin";
36352
- const wrapperPath = path18.join(binDir, "claude-run");
36383
+ const wrapperPath = path19.join(binDir, "claude-run");
36353
36384
  try {
36354
- await import_fs_extra14.default.writeFile(wrapperPath, claudeRunWrapper, { mode: 493 });
36385
+ await import_fs_extra15.default.writeFile(wrapperPath, claudeRunWrapper, { mode: 493 });
36355
36386
  spinner.stop("claude-run wrapper created");
36356
36387
  } catch {
36357
36388
  spinner.stop("claude-run wrapper skipped (no write access to /usr/local/bin)");
@@ -36400,12 +36431,12 @@ async function openclawProUpdateCommand(options = {}) {
36400
36431
  }
36401
36432
 
36402
36433
  // src/commands/dynamic-scripts.ts
36403
- import path21 from "path";
36434
+ import path22 from "path";
36404
36435
  import { homedir } from "os";
36405
36436
 
36406
36437
  // src/lib/script-parser.ts
36407
- var import_fs_extra15 = __toESM(require_lib4(), 1);
36408
- import path19 from "path";
36438
+ var import_fs_extra16 = __toESM(require_lib4(), 1);
36439
+ import path20 from "path";
36409
36440
  var EXCLUDED_SCRIPTS = ["test", "lint", "format", "start"];
36410
36441
  var EXCLUDED_SUFFIXES = [":test", ":lint", ":test-fixtures", ":start"];
36411
36442
  function shouldIncludeScript(scriptName) {
@@ -36416,12 +36447,12 @@ function shouldIncludeScript(scriptName) {
36416
36447
  return true;
36417
36448
  }
36418
36449
  async function readScriptsPackageJson(claudeDir) {
36419
- const packageJsonPath = path19.join(claudeDir, "scripts", "package.json");
36450
+ const packageJsonPath = path20.join(claudeDir, "scripts", "package.json");
36420
36451
  try {
36421
- if (!await import_fs_extra15.default.pathExists(packageJsonPath)) {
36452
+ if (!await import_fs_extra16.default.pathExists(packageJsonPath)) {
36422
36453
  return null;
36423
36454
  }
36424
- const content = await import_fs_extra15.default.readFile(packageJsonPath, "utf-8");
36455
+ const content = await import_fs_extra16.default.readFile(packageJsonPath, "utf-8");
36425
36456
  const parsed = JSON.parse(content);
36426
36457
  return parsed.scripts || null;
36427
36458
  } catch (error) {
@@ -36465,10 +36496,10 @@ function groupScriptsByPrefix(commands) {
36465
36496
  }
36466
36497
 
36467
36498
  // src/commands/script-runner.ts
36468
- var import_fs_extra16 = __toESM(require_lib4(), 1);
36499
+ var import_fs_extra17 = __toESM(require_lib4(), 1);
36469
36500
  import { spawn as spawn2 } from "child_process";
36470
36501
  import { execSync as execSync4 } from "child_process";
36471
- import path20 from "path";
36502
+ import path21 from "path";
36472
36503
  import os19 from "os";
36473
36504
  function checkCommand(cmd) {
36474
36505
  try {
@@ -36498,18 +36529,18 @@ async function executeScript(scriptName, claudeDir) {
36498
36529
  console.error(source_default.red("Bun is not installed. Install with: npm install -g bun"));
36499
36530
  return 1;
36500
36531
  }
36501
- const scriptsDir = path20.join(claudeDir, "scripts");
36502
- if (!await import_fs_extra16.default.pathExists(scriptsDir)) {
36532
+ const scriptsDir = path21.join(claudeDir, "scripts");
36533
+ if (!await import_fs_extra17.default.pathExists(scriptsDir)) {
36503
36534
  console.error(source_default.red(`Scripts directory not found at ${scriptsDir}`));
36504
36535
  console.log(source_default.gray("Run: aiblueprint claude-code setup"));
36505
36536
  return 1;
36506
36537
  }
36507
- const packageJsonPath = path20.join(scriptsDir, "package.json");
36508
- if (!await import_fs_extra16.default.pathExists(packageJsonPath)) {
36538
+ const packageJsonPath = path21.join(scriptsDir, "package.json");
36539
+ if (!await import_fs_extra17.default.pathExists(packageJsonPath)) {
36509
36540
  console.error(source_default.red(`package.json not found in ${scriptsDir}`));
36510
36541
  return 1;
36511
36542
  }
36512
- const packageJson = await import_fs_extra16.default.readJson(packageJsonPath);
36543
+ const packageJson = await import_fs_extra17.default.readJson(packageJsonPath);
36513
36544
  if (!packageJson.scripts || !packageJson.scripts[scriptName]) {
36514
36545
  console.error(source_default.red(`Script "${scriptName}" not found in package.json`));
36515
36546
  return 1;
@@ -36532,7 +36563,7 @@ async function executeScript(scriptName, claudeDir) {
36532
36563
 
36533
36564
  // src/commands/dynamic-scripts.ts
36534
36565
  function getClaudeDir(parentOptions) {
36535
- return parentOptions.claudeCodeFolder || parentOptions.folder ? path21.resolve(parentOptions.claudeCodeFolder || parentOptions.folder) : path21.join(homedir(), ".claude");
36566
+ return parentOptions.claudeCodeFolder || parentOptions.folder ? path22.resolve(parentOptions.claudeCodeFolder || parentOptions.folder) : path22.join(homedir(), ".claude");
36536
36567
  }
36537
36568
  async function registerDynamicScriptCommands(claudeCodeCmd, claudeDir) {
36538
36569
  const scripts = await readScriptsPackageJson(claudeDir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiblueprint-cli",
3
- "version": "1.4.34",
3
+ "version": "1.4.35",
4
4
  "description": "AIBlueprint CLI for setting up Claude Code configurations",
5
5
  "author": "AIBlueprint",
6
6
  "license": "MIT",