aiblueprint-cli 1.4.51 → 1.4.53

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 (132) hide show
  1. package/README.md +17 -17
  2. package/agents-config/codex-config/AGENTS.md +5 -0
  3. package/dist/cli.js +335 -265
  4. package/package.json +4 -4
  5. /package/{ai-coding → agents-config}/.claude-plugin/plugin.json +0 -0
  6. /package/{ai-coding → agents-config}/agents/action.md +0 -0
  7. /package/{ai-coding → agents-config}/agents/explore-codebase.md +0 -0
  8. /package/{ai-coding → agents-config}/agents/explore-docs.md +0 -0
  9. /package/{ai-coding → agents-config}/agents/websearch.md +0 -0
  10. /package/{ai-coding → agents-config/claude-config}/scripts/.claude/commands/fix-on-my-computer.md +0 -0
  11. /package/{ai-coding → agents-config/claude-config}/scripts/CLAUDE.md +0 -0
  12. /package/{ai-coding → agents-config/claude-config}/scripts/biome.json +0 -0
  13. /package/{ai-coding → agents-config/claude-config}/scripts/bun.lockb +0 -0
  14. /package/{ai-coding → agents-config/claude-config}/scripts/package.json +0 -0
  15. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/CLAUDE.md +0 -0
  16. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/README.md +0 -0
  17. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/__tests__/context.test.ts +0 -0
  18. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/__tests__/formatters.test.ts +0 -0
  19. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/__tests__/statusline.test.ts +0 -0
  20. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/data/.gitignore +0 -0
  21. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/data/.gitkeep +0 -0
  22. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/defaults.json +0 -0
  23. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/docs/ARCHITECTURE.md +0 -0
  24. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/fixtures/mock-transcript.jsonl +0 -0
  25. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/fixtures/test-input.json +0 -0
  26. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/src/index.ts +0 -0
  27. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/src/lib/config-types.ts +0 -0
  28. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/src/lib/config.ts +0 -0
  29. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/src/lib/context.ts +0 -0
  30. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/src/lib/formatters.ts +0 -0
  31. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/src/lib/git.ts +0 -0
  32. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/src/lib/menu-factories.ts +0 -0
  33. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/src/lib/presets.ts +0 -0
  34. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/src/lib/render-pure.ts +0 -0
  35. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/src/lib/types.ts +0 -0
  36. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/src/lib/utils.ts +0 -0
  37. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/src/tests/spend-v2.test.ts +0 -0
  38. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/statusline.config.json +0 -0
  39. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/test-with-fixtures.ts +0 -0
  40. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/test.ts +0 -0
  41. /package/{ai-coding → agents-config/claude-config}/scripts/statusline/tsconfig.json +0 -0
  42. /package/{ai-coding → agents-config/claude-config}/scripts/tsconfig.json +0 -0
  43. /package/{ai-coding → agents-config}/skills/apex/SKILL.md +0 -0
  44. /package/{ai-coding → agents-config}/skills/apex/scripts/setup-templates.sh +0 -0
  45. /package/{ai-coding → agents-config}/skills/apex/scripts/update-progress.sh +0 -0
  46. /package/{ai-coding → agents-config}/skills/apex/steps/step-00-init.md +0 -0
  47. /package/{ai-coding → agents-config}/skills/apex/steps/step-00b-branch.md +0 -0
  48. /package/{ai-coding → agents-config}/skills/apex/steps/step-00b-economy.md +0 -0
  49. /package/{ai-coding → agents-config}/skills/apex/steps/step-00b-interactive.md +0 -0
  50. /package/{ai-coding → agents-config}/skills/apex/steps/step-01-analyze.md +0 -0
  51. /package/{ai-coding → agents-config}/skills/apex/steps/step-02-plan.md +0 -0
  52. /package/{ai-coding → agents-config}/skills/apex/steps/step-03-execute.md +0 -0
  53. /package/{ai-coding → agents-config}/skills/apex/steps/step-04-validate.md +0 -0
  54. /package/{ai-coding → agents-config}/skills/apex/templates/00-context.md +0 -0
  55. /package/{ai-coding → agents-config}/skills/apex/templates/01-analyze.md +0 -0
  56. /package/{ai-coding → agents-config}/skills/apex/templates/02-plan.md +0 -0
  57. /package/{ai-coding → agents-config}/skills/apex/templates/03-execute.md +0 -0
  58. /package/{ai-coding → agents-config}/skills/apex/templates/04-validate.md +0 -0
  59. /package/{ai-coding → agents-config}/skills/apex/templates/README.md +0 -0
  60. /package/{ai-coding → agents-config}/skills/apex/templates/step-complete.md +0 -0
  61. /package/{ai-coding → agents-config}/skills/claude-memory/SKILL.md +0 -0
  62. /package/{ai-coding → agents-config}/skills/claude-memory/references/comprehensive-example.md +0 -0
  63. /package/{ai-coding → agents-config}/skills/claude-memory/references/optimize-guide.md +0 -0
  64. /package/{ai-coding → agents-config}/skills/claude-memory/references/project-patterns.md +0 -0
  65. /package/{ai-coding → agents-config}/skills/claude-memory/references/prompting-techniques.md +0 -0
  66. /package/{ai-coding → agents-config}/skills/claude-memory/references/rules-directory-guide.md +0 -0
  67. /package/{ai-coding → agents-config}/skills/claude-memory/references/section-templates.md +0 -0
  68. /package/{ai-coding → agents-config}/skills/codex-environment/SKILL.md +0 -0
  69. /package/{ai-coding → agents-config}/skills/commit/SKILL.md +0 -0
  70. /package/{ai-coding → agents-config}/skills/create-pr/SKILL.md +0 -0
  71. /package/{ai-coding → agents-config}/skills/fix-errors/SKILL.md +0 -0
  72. /package/{ai-coding → agents-config}/skills/fix-grammar/SKILL.md +0 -0
  73. /package/{ai-coding → agents-config}/skills/fix-pr-comments/SKILL.md +0 -0
  74. /package/{ai-coding → agents-config}/skills/merge/SKILL.md +0 -0
  75. /package/{ai-coding → agents-config}/skills/oneshot/SKILL.md +0 -0
  76. /package/{ai-coding → agents-config}/skills/prompt-creator/SKILL.md +0 -0
  77. /package/{ai-coding → agents-config}/skills/prompt-creator/references/anthropic-best-practices.md +0 -0
  78. /package/{ai-coding → agents-config}/skills/prompt-creator/references/anti-patterns.md +0 -0
  79. /package/{ai-coding → agents-config}/skills/prompt-creator/references/clarity-principles.md +0 -0
  80. /package/{ai-coding → agents-config}/skills/prompt-creator/references/context-management.md +0 -0
  81. /package/{ai-coding → agents-config}/skills/prompt-creator/references/few-shot-patterns.md +0 -0
  82. /package/{ai-coding → agents-config}/skills/prompt-creator/references/openai-best-practices.md +0 -0
  83. /package/{ai-coding → agents-config}/skills/prompt-creator/references/prompt-templates.md +0 -0
  84. /package/{ai-coding → agents-config}/skills/prompt-creator/references/reasoning-techniques.md +0 -0
  85. /package/{ai-coding → agents-config}/skills/prompt-creator/references/system-prompt-patterns.md +0 -0
  86. /package/{ai-coding → agents-config}/skills/prompt-creator/references/xml-structure.md +0 -0
  87. /package/{ai-coding → agents-config}/skills/ralph-loop/SKILL.md +0 -0
  88. /package/{ai-coding → agents-config}/skills/ralph-loop/scripts/setup.sh +0 -0
  89. /package/{ai-coding → agents-config}/skills/ralph-loop/steps/step-00-init.md +0 -0
  90. /package/{ai-coding → agents-config}/skills/ralph-loop/steps/step-01-interactive-prd.md +0 -0
  91. /package/{ai-coding → agents-config}/skills/ralph-loop/steps/step-02-create-stories.md +0 -0
  92. /package/{ai-coding → agents-config}/skills/ralph-loop/steps/step-03-finish.md +0 -0
  93. /package/{ai-coding → agents-config}/skills/skill-creator/LICENSE.txt +0 -0
  94. /package/{ai-coding → agents-config}/skills/skill-creator/SKILL.md +0 -0
  95. /package/{ai-coding → agents-config}/skills/skill-creator/package.json +0 -0
  96. /package/{ai-coding → agents-config}/skills/skill-creator/references/output-patterns.md +0 -0
  97. /package/{ai-coding → agents-config}/skills/skill-creator/references/progressive-disclosure-patterns.md +0 -0
  98. /package/{ai-coding → agents-config}/skills/skill-creator/references/prompting-integration.md +0 -0
  99. /package/{ai-coding → agents-config}/skills/skill-creator/references/real-world-examples.md +0 -0
  100. /package/{ai-coding → agents-config}/skills/skill-creator/references/script-patterns.md +0 -0
  101. /package/{ai-coding → agents-config}/skills/skill-creator/references/workflows.md +0 -0
  102. /package/{ai-coding → agents-config}/skills/skill-creator/references/xml-tag-guide.md +0 -0
  103. /package/{ai-coding → agents-config}/skills/skill-creator/scripts/init-skill.ts +0 -0
  104. /package/{ai-coding → agents-config}/skills/skill-creator/scripts/package-skill.ts +0 -0
  105. /package/{ai-coding → agents-config}/skills/skill-creator/scripts/validate.ts +0 -0
  106. /package/{ai-coding → agents-config}/skills/subagent-creator/SKILL.md +0 -0
  107. /package/{ai-coding → agents-config}/skills/subagent-creator/references/context-management.md +0 -0
  108. /package/{ai-coding → agents-config}/skills/subagent-creator/references/debugging-agents.md +0 -0
  109. /package/{ai-coding → agents-config}/skills/subagent-creator/references/error-handling-and-recovery.md +0 -0
  110. /package/{ai-coding → agents-config}/skills/subagent-creator/references/evaluation-and-testing.md +0 -0
  111. /package/{ai-coding → agents-config}/skills/subagent-creator/references/orchestration-patterns.md +0 -0
  112. /package/{ai-coding → agents-config}/skills/subagent-creator/references/subagents.md +0 -0
  113. /package/{ai-coding → agents-config}/skills/subagent-creator/references/writing-subagent-prompts.md +0 -0
  114. /package/{ai-coding → agents-config}/skills/ultrathink/SKILL.md +0 -0
  115. /package/{ai-coding → agents-config}/skills/workflow-apex-free/SKILL.md +0 -0
  116. /package/{ai-coding → agents-config}/skills/workflow-apex-free/scripts/setup-templates.sh +0 -0
  117. /package/{ai-coding → agents-config}/skills/workflow-apex-free/scripts/update-progress.sh +0 -0
  118. /package/{ai-coding → agents-config}/skills/workflow-apex-free/steps/step-00-init.md +0 -0
  119. /package/{ai-coding → agents-config}/skills/workflow-apex-free/steps/step-00b-branch.md +0 -0
  120. /package/{ai-coding → agents-config}/skills/workflow-apex-free/steps/step-00b-economy.md +0 -0
  121. /package/{ai-coding → agents-config}/skills/workflow-apex-free/steps/step-00b-interactive.md +0 -0
  122. /package/{ai-coding → agents-config}/skills/workflow-apex-free/steps/step-01-analyze.md +0 -0
  123. /package/{ai-coding → agents-config}/skills/workflow-apex-free/steps/step-02-plan.md +0 -0
  124. /package/{ai-coding → agents-config}/skills/workflow-apex-free/steps/step-03-execute.md +0 -0
  125. /package/{ai-coding → agents-config}/skills/workflow-apex-free/steps/step-04-validate.md +0 -0
  126. /package/{ai-coding → agents-config}/skills/workflow-apex-free/templates/00-context.md +0 -0
  127. /package/{ai-coding → agents-config}/skills/workflow-apex-free/templates/01-analyze.md +0 -0
  128. /package/{ai-coding → agents-config}/skills/workflow-apex-free/templates/02-plan.md +0 -0
  129. /package/{ai-coding → agents-config}/skills/workflow-apex-free/templates/03-execute.md +0 -0
  130. /package/{ai-coding → agents-config}/skills/workflow-apex-free/templates/04-validate.md +0 -0
  131. /package/{ai-coding → agents-config}/skills/workflow-apex-free/templates/README.md +0 -0
  132. /package/{ai-coding → agents-config}/skills/workflow-apex-free/templates/step-complete.md +0 -0
package/dist/cli.js CHANGED
@@ -32264,8 +32264,8 @@ var lib_default = inquirer;
32264
32264
 
32265
32265
  // src/commands/setup.ts
32266
32266
  var import_fs_extra8 = __toESM(require_lib4(), 1);
32267
- import path11 from "path";
32268
- import os11 from "os";
32267
+ import path12 from "path";
32268
+ import os12 from "os";
32269
32269
 
32270
32270
  // node_modules/chalk/source/vendor/ansi-styles/index.js
32271
32271
  var ANSI_BACKGROUND_OFFSET = 10;
@@ -33142,7 +33142,7 @@ async function resolveConfigDir(repoPath) {
33142
33142
  }
33143
33143
  return null;
33144
33144
  }
33145
- var CONFIG_FOLDER_CANDIDATES = ["ai-coding", "claude-code-config", "ai-config"];
33145
+ var CONFIG_FOLDER_CANDIDATES = ["agents-config", "ai-coding", "claude-code-config", "ai-config"];
33146
33146
 
33147
33147
  // src/lib/version.ts
33148
33148
  import { readFileSync as readFileSync2 } from "fs";
@@ -33535,10 +33535,21 @@ async function flushTelemetry() {
33535
33535
  var import_fs_extra7 = __toESM(require_lib4(), 1);
33536
33536
  import os10 from "os";
33537
33537
  import path10 from "path";
33538
- var AGENT_CATEGORIES = ["skills"];
33539
- function getAgentsDir(custom) {
33540
- return custom ? path10.resolve(custom) : path10.join(os10.homedir(), ".agents");
33538
+ async function applyPathPlaceholders(target, claudeDir) {
33539
+ const stat = await import_fs_extra7.default.stat(target).catch(() => null);
33540
+ if (!stat)
33541
+ return;
33542
+ if (stat.isDirectory()) {
33543
+ await replacePathPlaceholdersInDir(target, claudeDir);
33544
+ } else if (isTextFile(target)) {
33545
+ const content = await import_fs_extra7.default.readFile(target, "utf-8");
33546
+ const replaced = replaceClaudePathPlaceholder(content, claudeDir);
33547
+ if (replaced !== content) {
33548
+ await import_fs_extra7.default.writeFile(target, replaced, "utf-8");
33549
+ }
33550
+ }
33541
33551
  }
33552
+ var AGENT_CATEGORIES = ["skills", "agents"];
33542
33553
  async function platformSymlink(source, target) {
33543
33554
  await import_fs_extra7.default.ensureDir(path10.dirname(target));
33544
33555
  const isWindows2 = os10.platform() === "win32";
@@ -33581,13 +33592,13 @@ async function installCategoryToAgents(sourceCategoryDir, category, agentsDir, c
33581
33592
  }
33582
33593
  if (!migrated) {
33583
33594
  await import_fs_extra7.default.copy(sourcePath, agentsTarget, { overwrite: false });
33584
- await replacePathPlaceholdersInDir(agentsTarget, claudeDir);
33595
+ await applyPathPlaceholders(agentsTarget, claudeDir);
33585
33596
  result.copied.push(entry.name);
33586
33597
  }
33587
33598
  } else if (options.overwrite) {
33588
33599
  await import_fs_extra7.default.remove(agentsTarget);
33589
33600
  await import_fs_extra7.default.copy(sourcePath, agentsTarget, { overwrite: false });
33590
- await replacePathPlaceholdersInDir(agentsTarget, claudeDir);
33601
+ await applyPathPlaceholders(agentsTarget, claudeDir);
33591
33602
  result.copied.push(entry.name);
33592
33603
  }
33593
33604
  }
@@ -33641,15 +33652,38 @@ function isAgentCategory(category) {
33641
33652
  return AGENT_CATEGORIES.includes(category);
33642
33653
  }
33643
33654
 
33655
+ // src/lib/folder-paths.ts
33656
+ import os11 from "os";
33657
+ import path11 from "path";
33658
+ function resolveFolders(options = {}) {
33659
+ const rootDir = options.folder ? path11.resolve(options.folder) : os11.homedir();
33660
+ const claudeDir = options.claudeCodeFolder ? path11.resolve(options.claudeCodeFolder) : path11.join(rootDir, ".claude");
33661
+ const codexDir = options.codexFolder ? path11.resolve(options.codexFolder) : path11.join(rootDir, ".codex");
33662
+ const agentsDir = options.agentsFolder ? path11.resolve(options.agentsFolder) : path11.join(rootDir, ".agents");
33663
+ return { rootDir, claudeDir, codexDir, agentsDir };
33664
+ }
33665
+
33644
33666
  // src/commands/setup.ts
33645
33667
  var __filename2 = fileURLToPath2(import.meta.url);
33646
33668
  var __dirname2 = dirname2(__filename2);
33669
+ async function resolveClaudeAssetPath(sourceDir, name) {
33670
+ const candidates = [
33671
+ path12.join(sourceDir, "claude-config", name),
33672
+ path12.join(sourceDir, name)
33673
+ ];
33674
+ for (const candidate of candidates) {
33675
+ if (await import_fs_extra8.default.pathExists(candidate))
33676
+ return candidate;
33677
+ }
33678
+ return null;
33679
+ }
33647
33680
  async function setupCommand(params = {}) {
33648
33681
  const {
33649
- claudeCodeFolder: customClaudeCodeFolder,
33650
- codexFolder: customCodexFolder,
33651
- openCodeFolder: customOpenCodeFolder,
33652
- agentsFolder: customAgentsFolder,
33682
+ folder,
33683
+ claudeCodeFolder,
33684
+ codexFolder,
33685
+ openCodeFolder,
33686
+ agentsFolder,
33653
33687
  skipInteractive
33654
33688
  } = params;
33655
33689
  let repoPath = null;
@@ -33704,7 +33738,7 @@ async function setupCommand(params = {}) {
33704
33738
  },
33705
33739
  {
33706
33740
  value: "codexSymlink",
33707
- name: "Codex symlink - Link commands to ~/.codex/prompts",
33741
+ name: "Codex symlink - Link commands/skills/agents to ~/.codex",
33708
33742
  checked: false
33709
33743
  },
33710
33744
  {
@@ -33732,10 +33766,15 @@ async function setupCommand(params = {}) {
33732
33766
  skipInteractive
33733
33767
  };
33734
33768
  const s = new SimpleSpinner;
33735
- const claudeDir = customClaudeCodeFolder ? path11.resolve(customClaudeCodeFolder) : path11.join(os11.homedir(), ".claude");
33736
- const agentsDir = getAgentsDir(customAgentsFolder);
33737
- console.log(source_default.gray(`Installing to: ${claudeDir}`));
33738
- console.log(source_default.gray(`Skills source: ${agentsDir}/skills`));
33769
+ const { claudeDir, codexDir, agentsDir } = resolveFolders({
33770
+ folder,
33771
+ claudeCodeFolder,
33772
+ codexFolder,
33773
+ agentsFolder
33774
+ });
33775
+ console.log(source_default.gray(`Claude: ${claudeDir}`));
33776
+ console.log(source_default.gray(`Codex: ${codexDir}`));
33777
+ console.log(source_default.gray(`Agents: ${agentsDir}`));
33739
33778
  await import_fs_extra8.default.ensureDir(claudeDir);
33740
33779
  await import_fs_extra8.default.ensureDir(agentsDir);
33741
33780
  s.start("Creating backup of existing configuration");
@@ -33753,7 +33792,7 @@ async function setupCommand(params = {}) {
33753
33792
  const sourceDir = await resolveConfigDir(repoPath);
33754
33793
  if (!sourceDir) {
33755
33794
  await cleanupRepository(repoPath);
33756
- throw new Error("Configuration directory not found in cloned repository (looked for ai-coding/, claude-code-config/, and ai-config/)");
33795
+ throw new Error("Configuration directory not found in cloned repository (looked for agents-config/, ai-coding/, claude-code-config/, and ai-config/)");
33757
33796
  }
33758
33797
  s.stop("Repository cloned successfully");
33759
33798
  if (options.shellShortcuts) {
@@ -33763,43 +33802,50 @@ async function setupCommand(params = {}) {
33763
33802
  }
33764
33803
  if (options.customStatusline) {
33765
33804
  s.start("Setting up scripts");
33766
- await import_fs_extra8.default.copy(path11.join(sourceDir, "scripts"), path11.join(claudeDir, "scripts"), { overwrite: true });
33767
- await replacePathPlaceholdersInDir(path11.join(claudeDir, "scripts"), claudeDir);
33768
- if (options.customStatusline) {
33769
- await import_fs_extra8.default.ensureDir(path11.join(claudeDir, "scripts/statusline/data"));
33805
+ const scriptsSource = await resolveClaudeAssetPath(sourceDir, "scripts");
33806
+ if (scriptsSource) {
33807
+ await import_fs_extra8.default.copy(scriptsSource, path12.join(claudeDir, "scripts"), {
33808
+ overwrite: true
33809
+ });
33810
+ await replacePathPlaceholdersInDir(path12.join(claudeDir, "scripts"), claudeDir);
33811
+ await import_fs_extra8.default.ensureDir(path12.join(claudeDir, "scripts/statusline/data"));
33812
+ s.stop("Scripts installed");
33813
+ } else {
33814
+ s.stop("Scripts not available in repository");
33770
33815
  }
33771
- s.stop("Scripts installed");
33772
33816
  }
33773
33817
  if (options.aiblueprintCommands) {
33774
33818
  s.start("Setting up AIBlueprint commands");
33775
- const commandsSourcePath = path11.join(sourceDir, "commands");
33776
- if (await import_fs_extra8.default.pathExists(commandsSourcePath)) {
33777
- await import_fs_extra8.default.copy(commandsSourcePath, path11.join(claudeDir, "commands"), { overwrite: true });
33778
- await replacePathPlaceholdersInDir(path11.join(claudeDir, "commands"), claudeDir);
33819
+ const commandsSource = await resolveClaudeAssetPath(sourceDir, "commands");
33820
+ if (commandsSource) {
33821
+ await import_fs_extra8.default.copy(commandsSource, path12.join(claudeDir, "commands"), {
33822
+ overwrite: true
33823
+ });
33824
+ await replacePathPlaceholdersInDir(path12.join(claudeDir, "commands"), claudeDir);
33779
33825
  s.stop("Commands installed");
33780
33826
  } else {
33781
33827
  s.stop("Commands not available in repository");
33782
33828
  }
33783
33829
  }
33784
- if (options.codexSymlink && options.aiblueprintCommands) {
33785
- s.start("Setting up Codex symlink");
33786
- await setupCodexSymlink(claudeDir, customCodexFolder, customClaudeCodeFolder);
33787
- s.stop("Codex symlink configured");
33788
- }
33789
- if (options.openCodeSymlink && options.aiblueprintCommands) {
33790
- s.start("Setting up OpenCode symlink");
33791
- await setupOpenCodeSymlink(claudeDir, customOpenCodeFolder, customClaudeCodeFolder);
33792
- s.stop("OpenCode symlink configured");
33793
- }
33794
33830
  if (options.aiblueprintAgents) {
33795
33831
  s.start("Setting up AIBlueprint agents");
33796
- await import_fs_extra8.default.copy(path11.join(sourceDir, "agents"), path11.join(claudeDir, "agents"), { overwrite: true });
33797
- await replacePathPlaceholdersInDir(path11.join(claudeDir, "agents"), claudeDir);
33798
- s.stop("Agents installed");
33832
+ const agentsSource = path12.join(sourceDir, "agents");
33833
+ if (await import_fs_extra8.default.pathExists(agentsSource)) {
33834
+ const installResult = await installCategoryToAgents(agentsSource, "agents", agentsDir, claudeDir, { migrateClaudeDirs: true, silent: true });
33835
+ const summary = [
33836
+ installResult.copied.length && `${installResult.copied.length} copied`,
33837
+ installResult.migrated.length && `${installResult.migrated.length} migrated`,
33838
+ installResult.symlinked.length && `${installResult.symlinked.length} linked`,
33839
+ installResult.skipped.length && `${installResult.skipped.length} skipped`
33840
+ ].filter(Boolean).join(", ");
33841
+ s.stop(`Agents installed${summary ? ` (${summary})` : ""}`);
33842
+ } else {
33843
+ s.stop("Agents not available in repository");
33844
+ }
33799
33845
  }
33800
33846
  if (options.aiblueprintSkills) {
33801
33847
  s.start("Setting up AIBlueprint Skills");
33802
- const skillsSourcePath = path11.join(sourceDir, "skills");
33848
+ const skillsSourcePath = path12.join(sourceDir, "skills");
33803
33849
  if (await import_fs_extra8.default.pathExists(skillsSourcePath)) {
33804
33850
  const installResult = await installCategoryToAgents(skillsSourcePath, "skills", agentsDir, claudeDir, { migrateClaudeDirs: true, silent: true });
33805
33851
  const summary = [
@@ -33818,6 +33864,28 @@ async function setupCommand(params = {}) {
33818
33864
  s.stop("Skills not available in repository");
33819
33865
  }
33820
33866
  }
33867
+ if (options.codexSymlink) {
33868
+ s.start("Setting up Codex configuration");
33869
+ const codexConfigSource = path12.join(sourceDir, "codex-config");
33870
+ if (await import_fs_extra8.default.pathExists(codexConfigSource)) {
33871
+ await import_fs_extra8.default.copy(codexConfigSource, codexDir, { overwrite: false });
33872
+ }
33873
+ if (options.aiblueprintCommands) {
33874
+ await setupCodexSymlink(claudeDir, codexDir, claudeCodeFolder);
33875
+ }
33876
+ if (options.aiblueprintSkills) {
33877
+ await syncCategorySymlinks("skills", agentsDir, codexDir, undefined, true);
33878
+ }
33879
+ if (options.aiblueprintAgents) {
33880
+ await syncCategorySymlinks("agents", agentsDir, codexDir, undefined, true);
33881
+ }
33882
+ s.stop("Codex configured");
33883
+ }
33884
+ if (options.openCodeSymlink && options.aiblueprintCommands) {
33885
+ s.start("Setting up OpenCode symlink");
33886
+ await setupOpenCodeSymlink(claudeDir, openCodeFolder, claudeCodeFolder);
33887
+ s.stop("OpenCode symlink configured");
33888
+ }
33821
33889
  if (options.customStatusline) {
33822
33890
  s.start("Checking dependencies");
33823
33891
  await checkAndInstallDependencies();
@@ -33854,7 +33922,7 @@ async function setupCommand(params = {}) {
33854
33922
  console.log(source_default.gray(`
33855
33923
  Next steps:`));
33856
33924
  if (options.shellShortcuts) {
33857
- const platform = os11.platform();
33925
+ const platform = os12.platform();
33858
33926
  if (platform === "win32") {
33859
33927
  console.log(source_default.gray(" • Restart PowerShell to load the new functions"));
33860
33928
  } else {
@@ -33881,8 +33949,8 @@ Next steps:`));
33881
33949
 
33882
33950
  // src/commands/setup-terminal.ts
33883
33951
  var import_fs_extra9 = __toESM(require_lib4(), 1);
33884
- import path12 from "path";
33885
- import os12 from "os";
33952
+ import path13 from "path";
33953
+ import os13 from "os";
33886
33954
  import { execSync as execSync3, exec as exec2 } from "child_process";
33887
33955
  var OHMYZSH_INSTALL_URL = "https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh";
33888
33956
  var INSTALL_TIMEOUT = 120000;
@@ -33916,7 +33984,7 @@ function commandExists(cmd) {
33916
33984
  }
33917
33985
  }
33918
33986
  function isOhMyZshInstalled(homeDir) {
33919
- const ohMyZshDir = path12.join(homeDir, ".oh-my-zsh");
33987
+ const ohMyZshDir = path13.join(homeDir, ".oh-my-zsh");
33920
33988
  return import_fs_extra9.default.existsSync(ohMyZshDir);
33921
33989
  }
33922
33990
  function backupFile(filePath) {
@@ -33964,7 +34032,7 @@ function installPrerequisiteSync(packageName, installCmd) {
33964
34032
  async function installOhMyZsh(homeDir) {
33965
34033
  return new Promise((resolve, reject) => {
33966
34034
  const installCmd = `sh -c "$(curl -fsSL ${OHMYZSH_INSTALL_URL})" "" --unattended`;
33967
- const env2 = { ...process.env, HOME: homeDir, ZSH: path12.join(homeDir, ".oh-my-zsh") };
34035
+ const env2 = { ...process.env, HOME: homeDir, ZSH: path13.join(homeDir, ".oh-my-zsh") };
33968
34036
  exec2(installCmd, { timeout: INSTALL_TIMEOUT, env: env2 }, (error, stdout, stderr) => {
33969
34037
  if (error) {
33970
34038
  if ("killed" in error && error.killed) {
@@ -33985,7 +34053,7 @@ async function installPlugin(pluginName, repoUrl, homeDir) {
33985
34053
  if (!/^https:\/\/github\.com\/[\w-]+\/[\w-]+$/.test(repoUrl)) {
33986
34054
  throw new Error(`Invalid repository URL: ${repoUrl}`);
33987
34055
  }
33988
- const customPluginsDir = path12.join(homeDir, ".oh-my-zsh/custom/plugins", pluginName);
34056
+ const customPluginsDir = path13.join(homeDir, ".oh-my-zsh/custom/plugins", pluginName);
33989
34057
  if (import_fs_extra9.default.existsSync(customPluginsDir)) {
33990
34058
  return;
33991
34059
  }
@@ -34004,7 +34072,7 @@ async function installPlugin(pluginName, repoUrl, homeDir) {
34004
34072
  });
34005
34073
  }
34006
34074
  function updateZshrcTheme(theme, homeDir) {
34007
- const zshrcPath = path12.join(homeDir, ".zshrc");
34075
+ const zshrcPath = path13.join(homeDir, ".zshrc");
34008
34076
  const sanitizedTheme = sanitizeThemeName(theme);
34009
34077
  if (!import_fs_extra9.default.existsSync(zshrcPath)) {
34010
34078
  throw new Error(".zshrc file not found. Please ensure Oh My ZSH is installed correctly.");
@@ -34026,7 +34094,7 @@ ${content}`;
34026
34094
  }
34027
34095
  }
34028
34096
  function updateZshrcPlugins(plugins, homeDir) {
34029
- const zshrcPath = path12.join(homeDir, ".zshrc");
34097
+ const zshrcPath = path13.join(homeDir, ".zshrc");
34030
34098
  if (!import_fs_extra9.default.existsSync(zshrcPath)) {
34031
34099
  throw new Error(".zshrc file not found. Please ensure Oh My ZSH is installed correctly.");
34032
34100
  }
@@ -34049,7 +34117,7 @@ plugins=(${pluginsString})`;
34049
34117
  }
34050
34118
  async function setupTerminalCommand(options = {}) {
34051
34119
  const { skipInteractive, homeDir: customHomeDir } = options;
34052
- const homeDir = customHomeDir || os12.homedir();
34120
+ const homeDir = customHomeDir || os13.homedir();
34053
34121
  try {
34054
34122
  console.log(source_default.blue.bold(`
34055
34123
  \uD83D\uDDA5️ AIBlueprint Terminal Setup ${source_default.gray(`v${getVersion()}`)}
@@ -34146,7 +34214,7 @@ Installing missing prerequisites: ${missingPrereqs.join(", ")}`));
34146
34214
  selectedTheme = themeAnswer.theme;
34147
34215
  }
34148
34216
  }
34149
- const zshrcPath = path12.join(homeDir, ".zshrc");
34217
+ const zshrcPath = path13.join(homeDir, ".zshrc");
34150
34218
  if (import_fs_extra9.default.existsSync(zshrcPath)) {
34151
34219
  s.start("Backing up .zshrc");
34152
34220
  const backupPath = backupFile(zshrcPath);
@@ -34313,9 +34381,14 @@ async function symlinkCommand(params = {}) {
34313
34381
  }
34314
34382
  ]);
34315
34383
  const selectedDestinations = destinationAnswer.destinations;
34384
+ const { claudeDir, codexDir } = resolveFolders({
34385
+ folder: params.folder,
34386
+ claudeCodeFolder: params.claudeCodeFolder,
34387
+ codexFolder: params.codexFolder
34388
+ });
34316
34389
  const customFolders = {
34317
- "claude-code": params.claudeCodeFolder,
34318
- codex: params.codexFolder,
34390
+ "claude-code": claudeDir,
34391
+ codex: codexDir,
34319
34392
  opencode: params.openCodeFolder,
34320
34393
  factoryai: params.factoryAiFolder
34321
34394
  };
@@ -35078,28 +35151,38 @@ var Y2 = ({ indicator: t = "dots" } = {}) => {
35078
35151
  };
35079
35152
 
35080
35153
  // src/commands/pro.ts
35081
- import os15 from "os";
35082
- import path15 from "path";
35154
+ import path16 from "path";
35083
35155
 
35084
35156
  // src/lib/pro-installer.ts
35085
35157
  var import_fs_extra10 = __toESM(require_lib4(), 1);
35086
- import os13 from "os";
35087
- import path13 from "path";
35158
+ import os14 from "os";
35159
+ import path14 from "path";
35088
35160
  import { exec as exec3 } from "child_process";
35089
35161
  import { promisify as promisify2 } from "util";
35090
35162
  var execAsync2 = promisify2(exec3);
35091
35163
  var PREMIUM_REPO = "Melvynx/aiblueprint-cli-premium";
35092
35164
  var PREMIUM_BRANCH = "main";
35093
- var CONFIG_FOLDER_CANDIDATES2 = ["ai-coding", "claude-code-config", "ai-config"];
35094
- function resolveBaseDir(relativePath, claudeDir, agentsDir) {
35095
- const firstSeg = relativePath.split(path13.sep)[0];
35096
- if (isAgentCategory(firstSeg)) {
35097
- return { base: agentsDir, isAgentTarget: true };
35165
+ var CONFIG_FOLDER_CANDIDATES2 = ["agents-config", "ai-coding", "claude-code-config", "ai-config"];
35166
+ function routePath(relativePath) {
35167
+ const segments = relativePath.split(path14.sep);
35168
+ const first = segments[0];
35169
+ const rest = segments.slice(1).join(path14.sep);
35170
+ if (first === "claude-config") {
35171
+ return { kind: "claude", relativePath: rest };
35172
+ }
35173
+ if (first === "codex-config") {
35174
+ return { kind: "codex", relativePath: rest };
35175
+ }
35176
+ if (isAgentCategory(first)) {
35177
+ return { kind: "agents-category", category: first, relativePath };
35098
35178
  }
35099
- return { base: claudeDir, isAgentTarget: false };
35179
+ if (first === ".claude") {
35180
+ return { kind: "claude", relativePath: rest };
35181
+ }
35182
+ return { kind: "claude", relativePath };
35100
35183
  }
35101
35184
  function getCacheRepoDir() {
35102
- return path13.join(os13.homedir(), ".config", "aiblueprint", "pro-repos", "aiblueprint-cli-premium");
35185
+ return path14.join(os14.homedir(), ".config", "aiblueprint", "pro-repos", "aiblueprint-cli-premium");
35103
35186
  }
35104
35187
  async function execGitWithAuth(command, token, repoUrl, cwd) {
35105
35188
  const authenticatedUrl = `https://x-access-token:${token}@${repoUrl.replace(/^https?:\/\//, "")}`;
@@ -35113,57 +35196,53 @@ async function execGitWithAuth(command, token, repoUrl, cwd) {
35113
35196
  async function cloneOrUpdateRepo(token) {
35114
35197
  const cacheDir = getCacheRepoDir();
35115
35198
  const repoUrl = `https://github.com/${PREMIUM_REPO}.git`;
35116
- if (await import_fs_extra10.default.pathExists(path13.join(cacheDir, ".git"))) {
35199
+ if (await import_fs_extra10.default.pathExists(path14.join(cacheDir, ".git"))) {
35117
35200
  try {
35118
35201
  await execGitWithAuth("pull", token, repoUrl, cacheDir);
35119
35202
  } catch (error) {
35120
35203
  await import_fs_extra10.default.remove(cacheDir);
35121
- await import_fs_extra10.default.ensureDir(path13.dirname(cacheDir));
35204
+ await import_fs_extra10.default.ensureDir(path14.dirname(cacheDir));
35122
35205
  await execGitWithAuth(`clone ${repoUrl} ${cacheDir}`, token, repoUrl);
35123
35206
  }
35124
35207
  } else {
35125
- await import_fs_extra10.default.ensureDir(path13.dirname(cacheDir));
35208
+ await import_fs_extra10.default.ensureDir(path14.dirname(cacheDir));
35126
35209
  await execGitWithAuth(`clone ${repoUrl} ${cacheDir}`, token, repoUrl);
35127
35210
  }
35128
35211
  for (const candidate of CONFIG_FOLDER_CANDIDATES2) {
35129
- const candidatePath = path13.join(cacheDir, candidate);
35212
+ const candidatePath = path14.join(cacheDir, candidate);
35130
35213
  if (await import_fs_extra10.default.pathExists(candidatePath)) {
35131
35214
  return candidatePath;
35132
35215
  }
35133
35216
  }
35134
- throw new Error("Premium repo missing config folder (ai-coding or claude-code-config)");
35217
+ throw new Error("Premium repo missing config folder (agents-config, ai-coding, or claude-code-config)");
35135
35218
  }
35136
- async function copyConfigFromCache(cacheConfigDir, claudeDir, agentsDir, onProgress) {
35219
+ async function copyConfigFromCache(cacheConfigDir, dest, onProgress) {
35137
35220
  const walk = async (dir, baseDir = dir) => {
35138
35221
  const entries = await import_fs_extra10.default.readdir(dir, { withFileTypes: true });
35139
35222
  for (const entry of entries) {
35140
- const sourcePath = path13.join(dir, entry.name);
35141
- const relativePath = path13.relative(baseDir, sourcePath);
35142
- if (entry.isDirectory() && entry.name === ".claude" && dir === baseDir) {
35143
- await walk(sourcePath, sourcePath);
35223
+ if (entry.name === ".DS_Store" || entry.name === "node_modules")
35144
35224
  continue;
35145
- }
35146
- const { base, isAgentTarget } = resolveBaseDir(relativePath, claudeDir, agentsDir);
35147
- const targetPath = path13.join(base, relativePath);
35148
- if (isAgentTarget) {
35149
- const segments = relativePath.split(path13.sep);
35150
- if (segments.length >= 2) {
35151
- const claudeTop = path13.join(claudeDir, segments[0], segments[1]);
35152
- const claudeStat = await import_fs_extra10.default.lstat(claudeTop).catch(() => null);
35153
- if (claudeStat && !claudeStat.isSymbolicLink()) {
35154
- onProgress?.(`${relativePath} (skipped - real dir)`, "file");
35155
- continue;
35156
- }
35225
+ const sourcePath = path14.join(dir, entry.name);
35226
+ const relativePath = path14.relative(baseDir, sourcePath);
35227
+ const route = routePath(relativePath);
35228
+ if (route.kind === "skip")
35229
+ continue;
35230
+ if (route.kind === "agents-category") {
35231
+ if (relativePath.split(path14.sep).length === 1) {
35232
+ await copyAgentCategory(sourcePath, route.category, dest.agentsDir, dest.claudeDir, onProgress);
35157
35233
  }
35234
+ continue;
35158
35235
  }
35236
+ const targetBase = route.kind === "claude" ? dest.claudeDir : dest.codexDir;
35237
+ const targetPath = path14.join(targetBase, route.relativePath);
35159
35238
  if (entry.isDirectory()) {
35160
35239
  await import_fs_extra10.default.ensureDir(targetPath);
35161
35240
  onProgress?.(relativePath, "directory");
35162
35241
  await walk(sourcePath, baseDir);
35163
35242
  } else if (isTextFile(entry.name)) {
35164
35243
  const content = await import_fs_extra10.default.readFile(sourcePath, "utf-8");
35165
- const replaced = replaceClaudePathPlaceholder(content, claudeDir);
35166
- await import_fs_extra10.default.ensureDir(path13.dirname(targetPath));
35244
+ const replaced = replaceClaudePathPlaceholder(content, dest.claudeDir);
35245
+ await import_fs_extra10.default.ensureDir(path14.dirname(targetPath));
35167
35246
  await import_fs_extra10.default.writeFile(targetPath, replaced, "utf-8");
35168
35247
  onProgress?.(relativePath, "file");
35169
35248
  } else {
@@ -35174,6 +35253,26 @@ async function copyConfigFromCache(cacheConfigDir, claudeDir, agentsDir, onProgr
35174
35253
  };
35175
35254
  await walk(cacheConfigDir);
35176
35255
  }
35256
+ async function copyAgentCategory(sourceCategoryDir, category, agentsDir, claudeDir, onProgress) {
35257
+ const agentsCategoryDir = path14.join(agentsDir, category);
35258
+ await import_fs_extra10.default.ensureDir(agentsCategoryDir);
35259
+ const entries = await import_fs_extra10.default.readdir(sourceCategoryDir, { withFileTypes: true });
35260
+ for (const entry of entries) {
35261
+ if (entry.name === ".DS_Store")
35262
+ continue;
35263
+ const src = path14.join(sourceCategoryDir, entry.name);
35264
+ const dst = path14.join(agentsCategoryDir, entry.name);
35265
+ const claudeTop = path14.join(claudeDir, category, entry.name);
35266
+ const claudeStat = await import_fs_extra10.default.lstat(claudeTop).catch(() => null);
35267
+ if (claudeStat && !claudeStat.isSymbolicLink()) {
35268
+ onProgress?.(`${category}/${entry.name} (skipped - real dir in claude)`, "file");
35269
+ continue;
35270
+ }
35271
+ await import_fs_extra10.default.copy(src, dst, { overwrite: true });
35272
+ await replacePathPlaceholdersInDir(dst, claudeDir);
35273
+ onProgress?.(`${category}/${entry.name}`, entry.isDirectory() ? "directory" : "file");
35274
+ }
35275
+ }
35177
35276
  async function downloadFromPrivateGitHub(repo, branch, relativePath, targetPath, githubToken) {
35178
35277
  try {
35179
35278
  const url = `https://raw.githubusercontent.com/${repo}/${branch}/${relativePath}`;
@@ -35188,7 +35287,7 @@ async function downloadFromPrivateGitHub(repo, branch, relativePath, targetPath,
35188
35287
  return false;
35189
35288
  }
35190
35289
  const content = await response.arrayBuffer();
35191
- await import_fs_extra10.default.ensureDir(path13.dirname(targetPath));
35290
+ await import_fs_extra10.default.ensureDir(path14.dirname(targetPath));
35192
35291
  await import_fs_extra10.default.writeFile(targetPath, Buffer.from(content));
35193
35292
  return true;
35194
35293
  } catch (error) {
@@ -35217,8 +35316,8 @@ async function downloadDirectoryFromPrivateGitHub(repo, branch, dirPath, targetD
35217
35316
  await import_fs_extra10.default.ensureDir(targetDir);
35218
35317
  for (const file of files) {
35219
35318
  const relativePath = dirPath ? `${dirPath}/${file.name}` : file.name;
35220
- const targetPath = path13.join(targetDir, file.name);
35221
- const displayPath = relativePath.replace(/^(ai-coding|claude-code-config|ai-config)\//, "");
35319
+ const targetPath = path14.join(targetDir, file.name);
35320
+ const displayPath = relativePath.replace(/^(agents-config|ai-coding|claude-code-config|ai-config)\//, "");
35222
35321
  if (file.type === "file") {
35223
35322
  onProgress?.(displayPath, "file");
35224
35323
  await downloadFromPrivateGitHub(repo, branch, relativePath, targetPath, githubToken);
@@ -35233,20 +35332,25 @@ async function downloadDirectoryFromPrivateGitHub(repo, branch, dirPath, targetD
35233
35332
  }
35234
35333
  }
35235
35334
  async function installProConfigs(options) {
35236
- const { githubToken, claudeCodeFolder, agentsFolder, onProgress } = options;
35237
- const claudeFolder = claudeCodeFolder || path13.join(os13.homedir(), ".claude");
35238
- const agentsDir = getAgentsDir(agentsFolder);
35239
- await import_fs_extra10.default.ensureDir(claudeFolder);
35335
+ const { githubToken, folder, claudeCodeFolder, codexFolder, agentsFolder, onProgress } = options;
35336
+ const { claudeDir, codexDir, agentsDir } = resolveFolders({
35337
+ folder,
35338
+ claudeCodeFolder,
35339
+ codexFolder,
35340
+ agentsFolder
35341
+ });
35342
+ await import_fs_extra10.default.ensureDir(claudeDir);
35240
35343
  await import_fs_extra10.default.ensureDir(agentsDir);
35344
+ const dest = { claudeDir, codexDir, agentsDir };
35241
35345
  try {
35242
35346
  const cacheConfigDir = await cloneOrUpdateRepo(githubToken);
35243
- await copyConfigFromCache(cacheConfigDir, claudeFolder, agentsDir, onProgress);
35244
- await syncAllAgentSymlinks(agentsDir, claudeFolder);
35347
+ await copyConfigFromCache(cacheConfigDir, dest, onProgress);
35348
+ await syncAllAgentSymlinks(agentsDir, claudeDir);
35245
35349
  return;
35246
35350
  } catch (error) {
35247
35351
  console.warn("Git caching failed, falling back to API download");
35248
35352
  }
35249
- const tempDir = path13.join(os13.tmpdir(), `aiblueprint-premium-${Date.now()}`);
35353
+ const tempDir = path14.join(os14.tmpdir(), `aiblueprint-premium-${Date.now()}`);
35250
35354
  try {
35251
35355
  let success = false;
35252
35356
  for (const candidate of CONFIG_FOLDER_CANDIDATES2) {
@@ -35257,20 +35361,15 @@ async function installProConfigs(options) {
35257
35361
  if (!success) {
35258
35362
  throw new Error("Failed to download premium configurations");
35259
35363
  }
35260
- const dotClaudeDir = path13.join(tempDir, ".claude");
35261
- if (await import_fs_extra10.default.pathExists(dotClaudeDir)) {
35262
- await import_fs_extra10.default.copy(dotClaudeDir, tempDir, { overwrite: true });
35263
- await import_fs_extra10.default.remove(dotClaudeDir);
35264
- }
35265
- await copyTreeWithRouting(tempDir, claudeFolder, agentsDir);
35266
- await replacePathPlaceholdersInDir(claudeFolder, claudeFolder);
35364
+ await copyConfigFromCache(tempDir, dest, onProgress);
35365
+ await replacePathPlaceholdersInDir(claudeDir, claudeDir);
35267
35366
  for (const category of AGENT_CATEGORIES) {
35268
- const agentsCategoryDir = path13.join(agentsDir, category);
35367
+ const agentsCategoryDir = path14.join(agentsDir, category);
35269
35368
  if (await import_fs_extra10.default.pathExists(agentsCategoryDir)) {
35270
- await replacePathPlaceholdersInDir(agentsCategoryDir, claudeFolder);
35369
+ await replacePathPlaceholdersInDir(agentsCategoryDir, claudeDir);
35271
35370
  }
35272
35371
  }
35273
- await syncAllAgentSymlinks(agentsDir, claudeFolder);
35372
+ await syncAllAgentSymlinks(agentsDir, claudeDir);
35274
35373
  } catch (error) {
35275
35374
  throw new Error(`Failed to install premium configs: ${error instanceof Error ? error.message : "Unknown error"}`);
35276
35375
  } finally {
@@ -35279,28 +35378,6 @@ async function installProConfigs(options) {
35279
35378
  } catch {}
35280
35379
  }
35281
35380
  }
35282
- async function copyTreeWithRouting(source, claudeDir, agentsDir) {
35283
- const entries = await import_fs_extra10.default.readdir(source, { withFileTypes: true });
35284
- for (const entry of entries) {
35285
- const src = path13.join(source, entry.name);
35286
- const { base } = resolveBaseDir(entry.name, claudeDir, agentsDir);
35287
- const dst = path13.join(base, entry.name);
35288
- if (entry.isDirectory() && isAgentCategory(entry.name)) {
35289
- const inner = await import_fs_extra10.default.readdir(src, { withFileTypes: true });
35290
- for (const innerEntry of inner) {
35291
- const innerSrc = path13.join(src, innerEntry.name);
35292
- const innerDst = path13.join(dst, innerEntry.name);
35293
- const claudeTop = path13.join(claudeDir, entry.name, innerEntry.name);
35294
- const claudeStat = await import_fs_extra10.default.lstat(claudeTop).catch(() => null);
35295
- if (claudeStat && !claudeStat.isSymbolicLink())
35296
- continue;
35297
- await import_fs_extra10.default.copy(innerSrc, innerDst, { overwrite: true });
35298
- }
35299
- } else {
35300
- await import_fs_extra10.default.copy(src, dst, { overwrite: true });
35301
- }
35302
- }
35303
- }
35304
35381
  async function syncAllAgentSymlinks(agentsDir, claudeDir) {
35305
35382
  for (const category of AGENT_CATEGORIES) {
35306
35383
  await syncCategorySymlinks(category, agentsDir, claudeDir, undefined, true);
@@ -35309,24 +35386,24 @@ async function syncAllAgentSymlinks(agentsDir, claudeDir) {
35309
35386
 
35310
35387
  // src/lib/token-storage.ts
35311
35388
  var import_fs_extra11 = __toESM(require_lib4(), 1);
35312
- import os14 from "os";
35313
- import path14 from "path";
35389
+ import os15 from "os";
35390
+ import path15 from "path";
35314
35391
  function getConfigDir() {
35315
- const platform = os14.platform();
35392
+ const platform = os15.platform();
35316
35393
  if (platform === "win32") {
35317
- const appData = process.env.APPDATA || path14.join(os14.homedir(), "AppData", "Roaming");
35318
- return path14.join(appData, "aiblueprint");
35394
+ const appData = process.env.APPDATA || path15.join(os15.homedir(), "AppData", "Roaming");
35395
+ return path15.join(appData, "aiblueprint");
35319
35396
  } else {
35320
- const configHome = process.env.XDG_CONFIG_HOME || path14.join(os14.homedir(), ".config");
35321
- return path14.join(configHome, "aiblueprint");
35397
+ const configHome = process.env.XDG_CONFIG_HOME || path15.join(os15.homedir(), ".config");
35398
+ return path15.join(configHome, "aiblueprint");
35322
35399
  }
35323
35400
  }
35324
35401
  function getTokenFilePath2() {
35325
- return path14.join(getConfigDir(), "token.txt");
35402
+ return path15.join(getConfigDir(), "token.txt");
35326
35403
  }
35327
35404
  async function saveToken(githubToken) {
35328
35405
  const tokenFile = getTokenFilePath2();
35329
- const configDir = path14.dirname(tokenFile);
35406
+ const configDir = path15.dirname(tokenFile);
35330
35407
  try {
35331
35408
  await import_fs_extra11.default.ensureDir(configDir);
35332
35409
  } catch (error) {
@@ -35353,7 +35430,7 @@ async function getToken() {
35353
35430
  function getTokenInfo() {
35354
35431
  return {
35355
35432
  path: getTokenFilePath2(),
35356
- platform: os14.platform()
35433
+ platform: os15.platform()
35357
35434
  };
35358
35435
  }
35359
35436
 
@@ -35368,7 +35445,7 @@ async function countInstalledItems(claudeDir) {
35368
35445
  skills: 0
35369
35446
  };
35370
35447
  try {
35371
- const commandsDir = path15.join(claudeDir, "commands");
35448
+ const commandsDir = path16.join(claudeDir, "commands");
35372
35449
  if (await import_fs_extra12.default.pathExists(commandsDir)) {
35373
35450
  const files = await import_fs_extra12.default.readdir(commandsDir);
35374
35451
  counts.commands = files.filter((f) => f.endsWith(".md")).length;
@@ -35377,7 +35454,7 @@ async function countInstalledItems(claudeDir) {
35377
35454
  console.error("Failed to count commands:", error instanceof Error ? error.message : error);
35378
35455
  }
35379
35456
  try {
35380
- const agentsDir = path15.join(claudeDir, "agents");
35457
+ const agentsDir = path16.join(claudeDir, "agents");
35381
35458
  if (await import_fs_extra12.default.pathExists(agentsDir)) {
35382
35459
  const files = await import_fs_extra12.default.readdir(agentsDir);
35383
35460
  counts.agents = files.filter((f) => f.endsWith(".md")).length;
@@ -35386,11 +35463,11 @@ async function countInstalledItems(claudeDir) {
35386
35463
  console.error("Failed to count agents:", error instanceof Error ? error.message : error);
35387
35464
  }
35388
35465
  try {
35389
- const skillsDir = path15.join(claudeDir, "skills");
35466
+ const skillsDir = path16.join(claudeDir, "skills");
35390
35467
  if (await import_fs_extra12.default.pathExists(skillsDir)) {
35391
35468
  const items = await import_fs_extra12.default.readdir(skillsDir);
35392
35469
  const dirs = await Promise.all(items.map(async (item) => {
35393
- const stat = await import_fs_extra12.default.stat(path15.join(skillsDir, item));
35470
+ const stat = await import_fs_extra12.default.stat(path16.join(skillsDir, item));
35394
35471
  return stat.isDirectory();
35395
35472
  }));
35396
35473
  counts.skills = dirs.filter(Boolean).length;
@@ -35459,7 +35536,7 @@ async function proActivateCommand(userToken) {
35459
35536
  M2.info(`Product: ${data.product.title}`);
35460
35537
  M2.info(`Token saved to: ${tokenInfo.path}`);
35461
35538
  M2.info(source_default.cyan(`
35462
- \uD83D\uDCA1 Next step: Run 'npx aiblueprint-cli@latest ai-coding pro setup' to install premium configs`));
35539
+ \uD83D\uDCA1 Next step: Run 'npx aiblueprint-cli@latest agents pro setup' to install premium configs`));
35463
35540
  trackEvent("pro-activate");
35464
35541
  Se(source_default.green("✅ Activation complete!"));
35465
35542
  } catch (error) {
@@ -35478,7 +35555,7 @@ async function proStatusCommand() {
35478
35555
  const token = await getToken();
35479
35556
  if (!token) {
35480
35557
  M2.warn("No token found");
35481
- M2.info("Run: npx aiblueprint-cli@latest ai-coding pro activate <token>");
35558
+ M2.info("Run: npx aiblueprint-cli@latest agents pro activate <token>");
35482
35559
  M2.info("Get your token at: https://mlv.sh/claude-cli");
35483
35560
  Se(source_default.yellow("⚠️ Not activated"));
35484
35561
  process.exit(0);
@@ -35502,11 +35579,11 @@ async function proSetupCommand(options = {}) {
35502
35579
  const githubToken = await getToken();
35503
35580
  if (!githubToken) {
35504
35581
  M2.error("No token found");
35505
- M2.info("Run: npx aiblueprint-cli@latest ai-coding pro activate <token>");
35582
+ M2.info("Run: npx aiblueprint-cli@latest agents pro activate <token>");
35506
35583
  Se(source_default.red("❌ Not activated"));
35507
35584
  process.exit(1);
35508
35585
  }
35509
- const claudeDir = options.folder ? path15.resolve(options.folder) : path15.join(os15.homedir(), ".claude");
35586
+ const { claudeDir } = resolveFolders(options);
35510
35587
  const spinner = Y2();
35511
35588
  const onProgress = (file, type) => {
35512
35589
  spinner.message(`Installing: ${source_default.cyan(file)} ${source_default.gray(`(${type})`)}`);
@@ -35514,7 +35591,9 @@ async function proSetupCommand(options = {}) {
35514
35591
  spinner.start("Installing premium configurations...");
35515
35592
  await installProConfigs({
35516
35593
  githubToken,
35517
- claudeCodeFolder: claudeDir,
35594
+ folder: options.folder,
35595
+ claudeCodeFolder: options.claudeCodeFolder,
35596
+ codexFolder: options.codexFolder,
35518
35597
  agentsFolder: options.agentsFolder,
35519
35598
  onProgress
35520
35599
  });
@@ -35572,7 +35651,7 @@ async function proUpdateCommand(options = {}) {
35572
35651
  const githubToken = await getToken();
35573
35652
  if (!githubToken) {
35574
35653
  M2.error("No token found");
35575
- M2.info("Run: npx aiblueprint-cli@latest ai-coding pro activate <token>");
35654
+ M2.info("Run: npx aiblueprint-cli@latest agents pro activate <token>");
35576
35655
  Se(source_default.red("❌ Not activated"));
35577
35656
  process.exit(1);
35578
35657
  }
@@ -35580,7 +35659,9 @@ async function proUpdateCommand(options = {}) {
35580
35659
  spinner.start("Updating premium configurations...");
35581
35660
  await installProConfigs({
35582
35661
  githubToken,
35583
- claudeCodeFolder: options.folder,
35662
+ folder: options.folder,
35663
+ claudeCodeFolder: options.claudeCodeFolder,
35664
+ codexFolder: options.codexFolder,
35584
35665
  agentsFolder: options.agentsFolder
35585
35666
  });
35586
35667
  spinner.stop("Premium configurations updated");
@@ -35597,17 +35678,13 @@ async function proUpdateCommand(options = {}) {
35597
35678
  }
35598
35679
  }
35599
35680
 
35600
- // src/commands/sync.ts
35601
- import os16 from "os";
35602
- import path17 from "path";
35603
-
35604
35681
  // src/lib/sync-utils.ts
35605
35682
  var import_fs_extra13 = __toESM(require_lib4(), 1);
35606
- import path16 from "path";
35683
+ import path17 from "path";
35607
35684
  import crypto from "crypto";
35608
35685
  var PREMIUM_REPO2 = "Melvynx/aiblueprint-cli-premium";
35609
35686
  var PREMIUM_BRANCH2 = "main";
35610
- var CONFIG_FOLDER_CANDIDATES3 = ["ai-coding", "claude-code-config", "ai-config"];
35687
+ var CONFIG_FOLDER_CANDIDATES3 = ["agents-config", "ai-coding", "claude-code-config", "ai-config"];
35611
35688
  function computeFileSha(content) {
35612
35689
  const size = content.length;
35613
35690
  const header = `blob ${size}\x00`;
@@ -35631,8 +35708,8 @@ async function resolveRemoteConfigFolder(githubToken) {
35631
35708
  return candidate;
35632
35709
  }
35633
35710
  }
35634
- resolvedConfigFolder = "ai-coding";
35635
- return "ai-coding";
35711
+ resolvedConfigFolder = "agents-config";
35712
+ return "agents-config";
35636
35713
  }
35637
35714
  async function listRemoteDirectory(dirPath, githubToken) {
35638
35715
  const configFolder = await resolveRemoteConfigFolder(githubToken);
@@ -35689,7 +35766,7 @@ async function listLocalFiles(dir) {
35689
35766
  for (const item of items) {
35690
35767
  if (item === "node_modules" || item === ".DS_Store")
35691
35768
  continue;
35692
- const fullPath = path16.join(dir, item);
35769
+ const fullPath = path17.join(dir, item);
35693
35770
  const stat = await import_fs_extra13.default.stat(fullPath).catch(() => null);
35694
35771
  if (!stat)
35695
35772
  continue;
@@ -35709,7 +35786,7 @@ async function listLocalFilesRecursive(dir, basePath) {
35709
35786
  for (const item of items) {
35710
35787
  if (item === "node_modules" || item === ".DS_Store")
35711
35788
  continue;
35712
- const fullPath = path16.join(dir, item);
35789
+ const fullPath = path17.join(dir, item);
35713
35790
  const relativePath = `${basePath}/${item}`;
35714
35791
  const stat = await import_fs_extra13.default.stat(fullPath).catch(() => null);
35715
35792
  if (!stat)
@@ -35732,7 +35809,7 @@ async function listClaudeRealTopLevel(claudeCategoryDir) {
35732
35809
  for (const name of entries) {
35733
35810
  if (name === "node_modules" || name === ".DS_Store")
35734
35811
  continue;
35735
- const stat = await import_fs_extra13.default.lstat(path16.join(claudeCategoryDir, name)).catch(() => null);
35812
+ const stat = await import_fs_extra13.default.lstat(path17.join(claudeCategoryDir, name)).catch(() => null);
35736
35813
  if (!stat)
35737
35814
  continue;
35738
35815
  if (stat.isDirectory())
@@ -35740,12 +35817,18 @@ async function listClaudeRealTopLevel(claudeCategoryDir) {
35740
35817
  }
35741
35818
  return real;
35742
35819
  }
35820
+ function getRemoteCategoryPath(category) {
35821
+ if (category === "scripts")
35822
+ return "claude-config/scripts";
35823
+ return category;
35824
+ }
35743
35825
  async function analyzeCategory(category, claudeDir, agentsDir, githubToken) {
35744
35826
  const items = [];
35745
35827
  const useAgents = isAgentCategory(category);
35746
35828
  const localBase = useAgents ? agentsDir : claudeDir;
35747
- const localDir = path16.join(localBase, category);
35748
- const remoteFiles = await listRemoteFilesRecursive(category, githubToken);
35829
+ const localDir = path17.join(localBase, category);
35830
+ const remoteCategoryPath = getRemoteCategoryPath(category);
35831
+ const remoteFiles = await listRemoteFilesRecursive(remoteCategoryPath, githubToken);
35749
35832
  const localFiles = await listLocalFiles(localDir);
35750
35833
  const remoteSet = new Map;
35751
35834
  for (const rf of remoteFiles) {
@@ -35757,7 +35840,7 @@ async function analyzeCategory(category, claudeDir, agentsDir, githubToken) {
35757
35840
  }
35758
35841
  const localSet = new Set(localFiles);
35759
35842
  for (const [remotePath, { sha, isFolder }] of remoteSet) {
35760
- const localPath = path16.join(localDir, remotePath);
35843
+ const localPath = path17.join(localDir, remotePath);
35761
35844
  if (isFolder) {
35762
35845
  continue;
35763
35846
  }
@@ -35792,7 +35875,7 @@ async function analyzeCategory(category, claudeDir, agentsDir, githubToken) {
35792
35875
  for (const localPath of localSet) {
35793
35876
  agentsTopLevels.add(localPath.split("/")[0]);
35794
35877
  }
35795
- const claudeCategoryDir = path16.join(claudeDir, category);
35878
+ const claudeCategoryDir = path17.join(claudeDir, category);
35796
35879
  const claudeRealEntries = await listClaudeRealTopLevel(claudeCategoryDir);
35797
35880
  for (const top of claudeRealEntries) {
35798
35881
  if (!remoteTopLevels.has(top))
@@ -35832,10 +35915,16 @@ async function analyzeSyncChanges(claudeDir, githubToken, agentsDir) {
35832
35915
  migrationCount: allItems.filter((i) => i.status === "migration").length
35833
35916
  };
35834
35917
  }
35918
+ function translateRemotePath(relativePath) {
35919
+ const [first, ...rest] = relativePath.split("/");
35920
+ const remoteFirst = getRemoteCategoryPath(first);
35921
+ return [remoteFirst, ...rest].join("/");
35922
+ }
35835
35923
  async function downloadFromPrivateGitHub2(relativePath, targetPath, githubToken, claudeDir) {
35836
35924
  try {
35837
35925
  const configFolder = await resolveRemoteConfigFolder(githubToken);
35838
- const url = `https://raw.githubusercontent.com/${PREMIUM_REPO2}/${PREMIUM_BRANCH2}/${configFolder}/${relativePath}`;
35926
+ const remotePath = translateRemotePath(relativePath);
35927
+ const url = `https://raw.githubusercontent.com/${PREMIUM_REPO2}/${PREMIUM_BRANCH2}/${configFolder}/${remotePath}`;
35839
35928
  const response = await fetch(url, {
35840
35929
  headers: {
35841
35930
  Authorization: `token ${githubToken}`,
@@ -35846,7 +35935,7 @@ async function downloadFromPrivateGitHub2(relativePath, targetPath, githubToken,
35846
35935
  return false;
35847
35936
  }
35848
35937
  const content = await response.arrayBuffer();
35849
- await import_fs_extra13.default.ensureDir(path16.dirname(targetPath));
35938
+ await import_fs_extra13.default.ensureDir(path17.dirname(targetPath));
35850
35939
  if (isTextFile(relativePath)) {
35851
35940
  const textContent = Buffer.from(content).toString("utf-8");
35852
35941
  const transformedContent = transformFileContent(textContent, claudeDir);
@@ -35868,11 +35957,11 @@ async function syncSelectedItems(claudeDir, items, githubToken, agentsDir, onPro
35868
35957
  for (const item of items) {
35869
35958
  const useAgents = isAgentCategory(item.category);
35870
35959
  const baseDir = useAgents ? agentsDir : claudeDir;
35871
- const targetPath = path16.join(baseDir, item.relativePath);
35960
+ const targetPath = path17.join(baseDir, item.relativePath);
35872
35961
  if (item.status === "migration" && useAgents) {
35873
35962
  const topName = item.name.split("/")[0];
35874
- const agentsTop = path16.join(agentsDir, item.category, topName);
35875
- const claudeTop = path16.join(claudeDir, item.category, topName);
35963
+ const agentsTop = path17.join(agentsDir, item.category, topName);
35964
+ const claudeTop = path17.join(claudeDir, item.category, topName);
35876
35965
  try {
35877
35966
  const claudeStat = await import_fs_extra13.default.lstat(claudeTop).catch(() => null);
35878
35967
  if (!claudeStat || claudeStat.isSymbolicLink()) {
@@ -35887,7 +35976,7 @@ async function syncSelectedItems(claudeDir, items, githubToken, agentsDir, onPro
35887
35976
  continue;
35888
35977
  }
35889
35978
  onProgress?.(item.relativePath, "moving to .agents");
35890
- await import_fs_extra13.default.ensureDir(path16.dirname(agentsTop));
35979
+ await import_fs_extra13.default.ensureDir(path17.dirname(agentsTop));
35891
35980
  await import_fs_extra13.default.move(claudeTop, agentsTop);
35892
35981
  migrated++;
35893
35982
  touchedAgentCategories.add(item.category);
@@ -35898,7 +35987,7 @@ async function syncSelectedItems(claudeDir, items, githubToken, agentsDir, onPro
35898
35987
  }
35899
35988
  if (useAgents) {
35900
35989
  const topName = item.name.split("/")[0];
35901
- const claudeTop = path16.join(claudeDir, item.category, topName);
35990
+ const claudeTop = path17.join(claudeDir, item.category, topName);
35902
35991
  const claudeTopStat = await import_fs_extra13.default.lstat(claudeTop).catch(() => null);
35903
35992
  if (claudeTopStat && !claudeTopStat.isSymbolicLink()) {
35904
35993
  onProgress?.(item.relativePath, "skipping (real dir in .claude)");
@@ -36080,12 +36169,11 @@ async function proSyncCommand(options = {}) {
36080
36169
  const githubToken = await getToken();
36081
36170
  if (!githubToken) {
36082
36171
  M2.error("No token found");
36083
- M2.info("Run: npx aiblueprint-cli@latest ai-coding pro activate <token>");
36172
+ M2.info("Run: npx aiblueprint-cli@latest agents pro activate <token>");
36084
36173
  Se(source_default.red("❌ Not activated"));
36085
36174
  process.exit(1);
36086
36175
  }
36087
- const claudeDir = options.folder ? path17.resolve(options.folder) : path17.join(os16.homedir(), ".claude");
36088
- const agentsDir = getAgentsDir(options.agentsFolder);
36176
+ const { claudeDir, agentsDir } = resolveFolders(options);
36089
36177
  const spinner = Y2();
36090
36178
  spinner.start("Analyzing changes...");
36091
36179
  const result = await analyzeSyncChanges(claudeDir, githubToken, agentsDir);
@@ -36248,8 +36336,6 @@ async function proSyncCommand(options = {}) {
36248
36336
  }
36249
36337
 
36250
36338
  // src/commands/backup.ts
36251
- import os17 from "os";
36252
- import path18 from "path";
36253
36339
  function formatBackupDate(date) {
36254
36340
  const now = new Date;
36255
36341
  const diffMs = now.getTime() - date.getTime();
@@ -36269,8 +36355,7 @@ function formatBackupDate(date) {
36269
36355
  return `${date.toLocaleString()} (${relative})`;
36270
36356
  }
36271
36357
  async function backupLoadCommand(options = {}) {
36272
- const claudeDir = options.folder || path18.join(os17.homedir(), ".claude");
36273
- const agentsDir = getAgentsDir(options.agentsFolder);
36358
+ const { claudeDir, agentsDir } = resolveFolders(options);
36274
36359
  Ie(source_default.blue("\uD83D\uDCE6 Load Backup"));
36275
36360
  const spinner = Y2();
36276
36361
  spinner.start("Scanning for backups...");
@@ -36326,19 +36411,19 @@ async function backupLoadCommand(options = {}) {
36326
36411
  }
36327
36412
 
36328
36413
  // src/commands/openclaw-pro.ts
36329
- import os20 from "os";
36330
- import path21 from "path";
36414
+ import os18 from "os";
36415
+ import path20 from "path";
36331
36416
 
36332
36417
  // src/lib/openclaw-installer.ts
36333
36418
  var import_fs_extra14 = __toESM(require_lib4(), 1);
36334
- import os18 from "os";
36335
- import path19 from "path";
36419
+ import os16 from "os";
36420
+ import path18 from "path";
36336
36421
  import { exec as exec4 } from "child_process";
36337
36422
  import { promisify as promisify3 } from "util";
36338
36423
  var execAsync3 = promisify3(exec4);
36339
36424
  var OPENCLAW_PRO_REPO = "Melvynx/openclawpro";
36340
36425
  function getCacheRepoDir2() {
36341
- return path19.join(os18.homedir(), ".config", "openclaw", "pro-repos", "openclawpro");
36426
+ return path18.join(os16.homedir(), ".config", "openclaw", "pro-repos", "openclawpro");
36342
36427
  }
36343
36428
  async function execGitWithAuth2(command, token, repoUrl, cwd) {
36344
36429
  const authenticatedUrl = `https://x-access-token:${token}@${repoUrl.replace(/^https?:\/\//, "")}`;
@@ -36352,27 +36437,27 @@ async function execGitWithAuth2(command, token, repoUrl, cwd) {
36352
36437
  async function cloneOrUpdateRepo2(token) {
36353
36438
  const cacheDir = getCacheRepoDir2();
36354
36439
  const repoUrl = `https://github.com/${OPENCLAW_PRO_REPO}.git`;
36355
- if (await import_fs_extra14.default.pathExists(path19.join(cacheDir, ".git"))) {
36440
+ if (await import_fs_extra14.default.pathExists(path18.join(cacheDir, ".git"))) {
36356
36441
  try {
36357
36442
  await execGitWithAuth2("pull", token, repoUrl, cacheDir);
36358
36443
  } catch (error) {
36359
36444
  await import_fs_extra14.default.remove(cacheDir);
36360
- await import_fs_extra14.default.ensureDir(path19.dirname(cacheDir));
36445
+ await import_fs_extra14.default.ensureDir(path18.dirname(cacheDir));
36361
36446
  await execGitWithAuth2(`clone ${repoUrl} ${cacheDir}`, token, repoUrl);
36362
36447
  }
36363
36448
  } else {
36364
- await import_fs_extra14.default.ensureDir(path19.dirname(cacheDir));
36449
+ await import_fs_extra14.default.ensureDir(path18.dirname(cacheDir));
36365
36450
  await execGitWithAuth2(`clone ${repoUrl} ${cacheDir}`, token, repoUrl);
36366
36451
  }
36367
- return path19.join(cacheDir, "openclaw-config");
36452
+ return path18.join(cacheDir, "openclaw-config");
36368
36453
  }
36369
36454
  async function copyConfigFromCache2(cacheConfigDir, targetDir, onProgress) {
36370
36455
  const walk = async (dir, baseDir = dir) => {
36371
36456
  const entries = await import_fs_extra14.default.readdir(dir, { withFileTypes: true });
36372
36457
  for (const entry of entries) {
36373
- const sourcePath = path19.join(dir, entry.name);
36374
- const relativePath = path19.relative(baseDir, sourcePath);
36375
- const targetPath = path19.join(targetDir, relativePath);
36458
+ const sourcePath = path18.join(dir, entry.name);
36459
+ const relativePath = path18.relative(baseDir, sourcePath);
36460
+ const targetPath = path18.join(targetDir, relativePath);
36376
36461
  if (entry.isDirectory()) {
36377
36462
  await import_fs_extra14.default.ensureDir(targetPath);
36378
36463
  onProgress?.(relativePath, "directory");
@@ -36387,7 +36472,7 @@ async function copyConfigFromCache2(cacheConfigDir, targetDir, onProgress) {
36387
36472
  }
36388
36473
  async function installOpenclawProConfigs(options) {
36389
36474
  const { githubToken, openclawFolder, onProgress } = options;
36390
- const targetFolder = openclawFolder || path19.join(os18.homedir(), ".openclaw");
36475
+ const targetFolder = openclawFolder || path18.join(os16.homedir(), ".openclaw");
36391
36476
  try {
36392
36477
  const cacheConfigDir = await cloneOrUpdateRepo2(githubToken);
36393
36478
  await copyConfigFromCache2(cacheConfigDir, targetFolder, onProgress);
@@ -36399,17 +36484,17 @@ async function installOpenclawProConfigs(options) {
36399
36484
 
36400
36485
  // src/lib/openclaw-token-storage.ts
36401
36486
  var import_fs_extra15 = __toESM(require_lib4(), 1);
36402
- import os19 from "os";
36403
- import path20 from "path";
36487
+ import os17 from "os";
36488
+ import path19 from "path";
36404
36489
  function getConfigDir2() {
36405
- const platform = os19.platform();
36490
+ const platform = os17.platform();
36406
36491
  if (platform === "win32") {
36407
- return path20.join(process.env.APPDATA || os19.homedir(), "openclaw");
36492
+ return path19.join(process.env.APPDATA || os17.homedir(), "openclaw");
36408
36493
  }
36409
- return path20.join(os19.homedir(), ".config", "openclaw");
36494
+ return path19.join(os17.homedir(), ".config", "openclaw");
36410
36495
  }
36411
36496
  function getTokenPath() {
36412
- return path20.join(getConfigDir2(), "token.txt");
36497
+ return path19.join(getConfigDir2(), "token.txt");
36413
36498
  }
36414
36499
  async function saveOpenclawToken(githubToken) {
36415
36500
  const configDir = getConfigDir2();
@@ -36427,7 +36512,7 @@ async function getOpenclawToken() {
36427
36512
  function getOpenclawTokenInfo() {
36428
36513
  return {
36429
36514
  path: getTokenPath(),
36430
- platform: os19.platform()
36515
+ platform: os17.platform()
36431
36516
  };
36432
36517
  }
36433
36518
 
@@ -36539,7 +36624,7 @@ async function openclawProSetupCommand(options = {}) {
36539
36624
  Se(source_default.red("❌ Not activated"));
36540
36625
  process.exit(1);
36541
36626
  }
36542
- const openclawDir = options.folder ? path21.resolve(options.folder) : path21.join(os20.homedir(), ".openclaw");
36627
+ const openclawDir = options.folder ? path20.resolve(options.folder) : path20.join(os18.homedir(), ".openclaw");
36543
36628
  const spinner = Y2();
36544
36629
  const onProgress = (file, type) => {
36545
36630
  spinner.message(`Installing: ${source_default.cyan(file)} ${source_default.gray(`(${type})`)}`);
@@ -36552,18 +36637,18 @@ async function openclawProSetupCommand(options = {}) {
36552
36637
  });
36553
36638
  spinner.stop("OpenClaw Pro configurations installed");
36554
36639
  let skillCount = 0;
36555
- const skillsDir = path21.join(openclawDir, "skills");
36640
+ const skillsDir = path20.join(openclawDir, "skills");
36556
36641
  if (await import_fs_extra16.default.pathExists(skillsDir)) {
36557
36642
  const items = await import_fs_extra16.default.readdir(skillsDir);
36558
36643
  const dirs = await Promise.all(items.map(async (item) => {
36559
- const stat = await import_fs_extra16.default.stat(path21.join(skillsDir, item));
36644
+ const stat = await import_fs_extra16.default.stat(path20.join(skillsDir, item));
36560
36645
  return stat.isDirectory();
36561
36646
  }));
36562
36647
  skillCount = dirs.filter(Boolean).length;
36563
36648
  }
36564
36649
  spinner.start("Setting up workspace TOOLS.md...");
36565
- const workspaceDir = path21.join(openclawDir, "workspace");
36566
- const toolsPath = path21.join(workspaceDir, "TOOLS.md");
36650
+ const workspaceDir = path20.join(openclawDir, "workspace");
36651
+ const toolsPath = path20.join(workspaceDir, "TOOLS.md");
36567
36652
  await import_fs_extra16.default.ensureDir(workspaceDir);
36568
36653
  if (await import_fs_extra16.default.pathExists(toolsPath)) {
36569
36654
  const existingContent = await import_fs_extra16.default.readFile(toolsPath, "utf-8");
@@ -36593,7 +36678,7 @@ ${CLAUDE_CODE_TOOLS_INSTRUCTIONS}
36593
36678
  script -q -c "claude $*" /dev/null
36594
36679
  `;
36595
36680
  const binDir = "/usr/local/bin";
36596
- const wrapperPath = path21.join(binDir, "claude-run");
36681
+ const wrapperPath = path20.join(binDir, "claude-run");
36597
36682
  try {
36598
36683
  await import_fs_extra16.default.writeFile(wrapperPath, claudeRunWrapper, { mode: 493 });
36599
36684
  spinner.stop("claude-run wrapper created");
@@ -36644,12 +36729,12 @@ async function openclawProUpdateCommand(options = {}) {
36644
36729
  }
36645
36730
 
36646
36731
  // src/commands/dynamic-scripts.ts
36647
- import path24 from "path";
36732
+ import path23 from "path";
36648
36733
  import { homedir } from "os";
36649
36734
 
36650
36735
  // src/lib/script-parser.ts
36651
36736
  var import_fs_extra17 = __toESM(require_lib4(), 1);
36652
- import path22 from "path";
36737
+ import path21 from "path";
36653
36738
  var EXCLUDED_SCRIPTS = ["test", "lint", "format", "start"];
36654
36739
  var EXCLUDED_SUFFIXES = [":test", ":lint", ":test-fixtures", ":start"];
36655
36740
  function shouldIncludeScript(scriptName) {
@@ -36660,7 +36745,7 @@ function shouldIncludeScript(scriptName) {
36660
36745
  return true;
36661
36746
  }
36662
36747
  async function readScriptsPackageJson(claudeDir) {
36663
- const packageJsonPath = path22.join(claudeDir, "scripts", "package.json");
36748
+ const packageJsonPath = path21.join(claudeDir, "scripts", "package.json");
36664
36749
  try {
36665
36750
  if (!await import_fs_extra17.default.pathExists(packageJsonPath)) {
36666
36751
  return null;
@@ -36712,11 +36797,11 @@ function groupScriptsByPrefix(commands) {
36712
36797
  var import_fs_extra18 = __toESM(require_lib4(), 1);
36713
36798
  import { spawn as spawn2 } from "child_process";
36714
36799
  import { execSync as execSync4 } from "child_process";
36715
- import path23 from "path";
36716
- import os21 from "os";
36800
+ import path22 from "path";
36801
+ import os19 from "os";
36717
36802
  function checkCommand2(cmd) {
36718
36803
  try {
36719
- const isWindows2 = os21.platform() === "win32";
36804
+ const isWindows2 = os19.platform() === "win32";
36720
36805
  const whichCmd = isWindows2 ? `where ${cmd}` : `which ${cmd}`;
36721
36806
  execSync4(whichCmd, { stdio: "ignore" });
36722
36807
  return true;
@@ -36742,13 +36827,13 @@ async function executeScript(scriptName, claudeDir) {
36742
36827
  console.error(source_default.red("Bun is not installed. Install with: npm install -g bun"));
36743
36828
  return 1;
36744
36829
  }
36745
- const scriptsDir = path23.join(claudeDir, "scripts");
36830
+ const scriptsDir = path22.join(claudeDir, "scripts");
36746
36831
  if (!await import_fs_extra18.default.pathExists(scriptsDir)) {
36747
36832
  console.error(source_default.red(`Scripts directory not found at ${scriptsDir}`));
36748
- console.log(source_default.gray("Run: aiblueprint ai-coding setup"));
36833
+ console.log(source_default.gray("Run: aiblueprint agents setup"));
36749
36834
  return 1;
36750
36835
  }
36751
- const packageJsonPath = path23.join(scriptsDir, "package.json");
36836
+ const packageJsonPath = path22.join(scriptsDir, "package.json");
36752
36837
  if (!await import_fs_extra18.default.pathExists(packageJsonPath)) {
36753
36838
  console.error(source_default.red(`package.json not found in ${scriptsDir}`));
36754
36839
  return 1;
@@ -36776,7 +36861,7 @@ async function executeScript(scriptName, claudeDir) {
36776
36861
 
36777
36862
  // src/commands/dynamic-scripts.ts
36778
36863
  function getClaudeDir(parentOptions) {
36779
- return parentOptions.claudeCodeFolder || parentOptions.folder ? path24.resolve(parentOptions.claudeCodeFolder || parentOptions.folder) : path24.join(homedir(), ".claude");
36864
+ return parentOptions.claudeCodeFolder || parentOptions.folder ? path23.resolve(parentOptions.claudeCodeFolder || parentOptions.folder) : path23.join(homedir(), ".claude");
36780
36865
  }
36781
36866
  async function registerDynamicScriptCommands(claudeCodeCmd, claudeDir) {
36782
36867
  const scripts = await readScriptsPackageJson(claudeDir);
@@ -36811,12 +36896,13 @@ var __dirname3 = dirname3(fileURLToPath3(import.meta.url));
36811
36896
  var packageJson = JSON.parse(readFileSync3(join2(__dirname3, "../package.json"), "utf8"));
36812
36897
  var program2 = new Command;
36813
36898
  program2.name("aiblueprint").description("AIBlueprint CLI for setting up AI coding configurations").version(packageJson.version);
36814
- function registerAiCodingCommands(cmd) {
36815
- cmd.option("-f, --folder <path>", "Specify custom Claude Code folder path (default: ~/.claude) - alias for --claudeCodeFolder").option("--claudeCodeFolder <path>", "Specify custom Claude Code folder path (default: ~/.claude)").option("--codexFolder <path>", "Specify custom Codex folder path (default: ~/.codex)").option("--openCodeFolder <path>", "Specify custom OpenCode folder path (default: ~/.config/opencode)").option("--factoryAiFolder <path>", "Specify custom FactoryAI folder path (default: ~/.factory)").option("--agentsFolder <path>", "Specify custom agents folder path (default: ~/.agents)").option("-s, --skip", "Skip interactive prompts and install all features");
36899
+ function registerAgentsCommands(cmd) {
36900
+ cmd.option("-f, --folder <path>", "Root folder that contains .claude/, .codex/, .agents/ (default: $HOME)").option("--claudeCodeFolder <path>", "Override Claude Code folder (default: {folder}/.claude)").option("--codexFolder <path>", "Override Codex folder (default: {folder}/.codex)").option("--openCodeFolder <path>", "Override OpenCode folder (default: ~/.config/opencode)").option("--factoryAiFolder <path>", "Override FactoryAI folder (default: ~/.factory)").option("--agentsFolder <path>", "Override shared agents folder (default: {folder}/.agents)").option("-s, --skip", "Skip interactive prompts and install all features");
36816
36901
  cmd.command("setup").description("Setup AI coding configuration with AIBlueprint defaults").action((options, command) => {
36817
36902
  const parentOptions = command.parent.opts();
36818
36903
  setupCommand({
36819
- claudeCodeFolder: parentOptions.claudeCodeFolder || parentOptions.folder,
36904
+ folder: parentOptions.folder,
36905
+ claudeCodeFolder: parentOptions.claudeCodeFolder,
36820
36906
  codexFolder: parentOptions.codexFolder,
36821
36907
  openCodeFolder: parentOptions.openCodeFolder,
36822
36908
  agentsFolder: parentOptions.agentsFolder,
@@ -36827,13 +36913,14 @@ function registerAiCodingCommands(cmd) {
36827
36913
  const parentOptions = command.parent.opts();
36828
36914
  setupTerminalCommand({
36829
36915
  skipInteractive: parentOptions.skip,
36830
- homeDir: parentOptions.claudeCodeFolder || parentOptions.folder
36916
+ homeDir: parentOptions.folder
36831
36917
  });
36832
36918
  });
36833
36919
  cmd.command("symlink").description("Create symlinks between different AI coding tools (Claude Code, Codex, OpenCode, FactoryAI)").action((options, command) => {
36834
36920
  const parentOptions = command.parent.opts();
36835
36921
  symlinkCommand({
36836
- claudeCodeFolder: parentOptions.claudeCodeFolder || parentOptions.folder,
36922
+ folder: parentOptions.folder,
36923
+ claudeCodeFolder: parentOptions.claudeCodeFolder,
36837
36924
  codexFolder: parentOptions.codexFolder,
36838
36925
  openCodeFolder: parentOptions.openCodeFolder,
36839
36926
  factoryAiFolder: parentOptions.factoryAiFolder
@@ -36848,65 +36935,47 @@ function registerAiCodingCommands(cmd) {
36848
36935
  });
36849
36936
  proCmd.command("setup").description("Install premium configurations (requires activation)").action((options, command) => {
36850
36937
  const parentOptions = command.parent.parent.opts();
36851
- const claudeCodeFolder = parentOptions.claudeCodeFolder || parentOptions.folder;
36852
- proSetupCommand({ folder: claudeCodeFolder, agentsFolder: parentOptions.agentsFolder });
36938
+ proSetupCommand({
36939
+ folder: parentOptions.folder,
36940
+ claudeCodeFolder: parentOptions.claudeCodeFolder,
36941
+ codexFolder: parentOptions.codexFolder,
36942
+ agentsFolder: parentOptions.agentsFolder
36943
+ });
36853
36944
  });
36854
36945
  proCmd.command("update").description("Update premium configurations").action((options, command) => {
36855
36946
  const parentOptions = command.parent.parent.opts();
36856
- const claudeCodeFolder = parentOptions.claudeCodeFolder || parentOptions.folder;
36857
- proUpdateCommand({ folder: claudeCodeFolder, agentsFolder: parentOptions.agentsFolder });
36947
+ proUpdateCommand({
36948
+ folder: parentOptions.folder,
36949
+ claudeCodeFolder: parentOptions.claudeCodeFolder,
36950
+ codexFolder: parentOptions.codexFolder,
36951
+ agentsFolder: parentOptions.agentsFolder
36952
+ });
36858
36953
  });
36859
36954
  proCmd.command("sync").description("Sync premium configurations with selective update").action((options, command) => {
36860
36955
  const parentOptions = command.parent.parent.opts();
36861
- const claudeCodeFolder = parentOptions.claudeCodeFolder || parentOptions.folder;
36862
- proSyncCommand({ folder: claudeCodeFolder, agentsFolder: parentOptions.agentsFolder });
36956
+ proSyncCommand({
36957
+ folder: parentOptions.folder,
36958
+ claudeCodeFolder: parentOptions.claudeCodeFolder,
36959
+ codexFolder: parentOptions.codexFolder,
36960
+ agentsFolder: parentOptions.agentsFolder
36961
+ });
36863
36962
  });
36864
36963
  const backupCmd = cmd.command("backup").description("Manage AI coding configuration backups");
36865
36964
  backupCmd.command("load").description("Load a previous backup interactively").action((options, command) => {
36866
36965
  const parentOptions = command.parent.parent.opts();
36867
- const claudeCodeFolder = parentOptions.claudeCodeFolder || parentOptions.folder;
36868
36966
  backupLoadCommand({
36869
- folder: claudeCodeFolder,
36967
+ folder: parentOptions.folder,
36968
+ claudeCodeFolder: parentOptions.claudeCodeFolder,
36870
36969
  agentsFolder: parentOptions.agentsFolder
36871
36970
  });
36872
36971
  });
36873
36972
  }
36874
- var aiCodingCmd = program2.command("ai-coding").description("AI coding configuration commands");
36875
- registerAiCodingCommands(aiCodingCmd);
36876
- var claudeCodeCmd = program2.command("claude-code").description("Legacy alias for ai-coding configuration commands");
36877
- registerAiCodingCommands(claudeCodeCmd);
36878
- var agentsCmd = program2.command("agents").description("Manage AIBlueprint configurations under ~/.agents (with ~/.claude symlinks)").option("-f, --folder <path>", "Specify custom Claude Code folder path (default: ~/.claude) - alias for --claudeCodeFolder").option("--claudeCodeFolder <path>", "Specify custom Claude Code folder path (default: ~/.claude)").option("--agentsFolder <path>", "Specify custom agents folder path (default: ~/.agents)");
36879
- var agentsProCmd = agentsCmd.command("pro").description("Manage AIBlueprint CLI Premium features");
36880
- agentsProCmd.command("activate [token]").description("Activate AIBlueprint CLI Premium with your access token").action((token) => {
36881
- proActivateCommand(token);
36882
- });
36883
- agentsProCmd.command("status").description("Check your Premium token status").action(() => {
36884
- proStatusCommand();
36885
- });
36886
- agentsProCmd.command("setup").description("Install premium configurations into ~/.agents and symlink into ~/.claude").action((options, command) => {
36887
- const parentOptions = command.parent.parent.opts();
36888
- const claudeCodeFolder = parentOptions.claudeCodeFolder || parentOptions.folder;
36889
- proSetupCommand({
36890
- folder: claudeCodeFolder,
36891
- agentsFolder: parentOptions.agentsFolder
36892
- });
36893
- });
36894
- agentsProCmd.command("update").description("Update premium configurations").action((options, command) => {
36895
- const parentOptions = command.parent.parent.opts();
36896
- const claudeCodeFolder = parentOptions.claudeCodeFolder || parentOptions.folder;
36897
- proUpdateCommand({
36898
- folder: claudeCodeFolder,
36899
- agentsFolder: parentOptions.agentsFolder
36900
- });
36901
- });
36902
- agentsProCmd.command("sync").description("Sync premium configurations with selective update").action((options, command) => {
36903
- const parentOptions = command.parent.parent.opts();
36904
- const claudeCodeFolder = parentOptions.claudeCodeFolder || parentOptions.folder;
36905
- proSyncCommand({
36906
- folder: claudeCodeFolder,
36907
- agentsFolder: parentOptions.agentsFolder
36908
- });
36909
- });
36973
+ var agentsCmd = program2.command("agents").description("AI coding configuration commands");
36974
+ registerAgentsCommands(agentsCmd);
36975
+ var aiCodingCmd = program2.command("ai-coding").description("Legacy alias for agents configuration commands");
36976
+ registerAgentsCommands(aiCodingCmd);
36977
+ var claudeCodeCmd = program2.command("claude-code").description("Legacy alias for agents configuration commands");
36978
+ registerAgentsCommands(claudeCodeCmd);
36910
36979
  var openclawCmd = program2.command("openclaw").description("OpenClaw configuration commands").option("-f, --folder <path>", "Specify custom OpenClaw folder path (default: ~/.openclaw)");
36911
36980
  var openclawProCmd = openclawCmd.command("pro").description("Manage OpenClaw Pro features");
36912
36981
  openclawProCmd.command("activate [token]").description("Activate OpenClaw Pro with your access token").action((token) => {
@@ -36927,6 +36996,7 @@ openclawProCmd.command("update").description("Update OpenClaw Pro configurations
36927
36996
  });
36928
36997
  try {
36929
36998
  const claudeDir = join2(homedir2(), ".claude");
36999
+ await registerDynamicScriptCommands(agentsCmd, claudeDir);
36930
37000
  await registerDynamicScriptCommands(aiCodingCmd, claudeDir);
36931
37001
  await registerDynamicScriptCommands(claudeCodeCmd, claudeDir);
36932
37002
  } catch (error) {