aiblueprint-cli 1.4.34 → 1.4.36
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 /
|
|
138
|
-
/
|
|
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
|
|
32253
|
-
import
|
|
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
|
|
32996
|
-
import
|
|
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 =
|
|
33224
|
+
const settingsPath = path6.join(claudeDir, "settings.json");
|
|
33204
33225
|
try {
|
|
33205
|
-
const existingSettings = await
|
|
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 =
|
|
33234
|
+
const settingsPath = path6.join(claudeDir, "settings.json");
|
|
33214
33235
|
let settings = {};
|
|
33215
33236
|
try {
|
|
33216
|
-
const existingSettings = await
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
33313
|
+
await import_fs_extra4.default.writeJson(settingsPath, settings, { spaces: 2 });
|
|
33293
33314
|
}
|
|
33294
33315
|
|
|
33295
33316
|
// src/commands/setup/utils.ts
|
|
33296
|
-
var
|
|
33297
|
-
import
|
|
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 =
|
|
33336
|
+
const tmpDir = path7.join(os7.tmpdir(), `aiblueprint-${Date.now()}`);
|
|
33316
33337
|
try {
|
|
33317
|
-
await
|
|
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
|
|
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
|
|
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
|
|
33354
|
-
import
|
|
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 =
|
|
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
|
|
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
|
|
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:
|
|
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
|
|
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
|
|
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 =
|
|
33393
|
-
const destPath =
|
|
33394
|
-
if (await
|
|
33395
|
-
await
|
|
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
|
|
33421
|
+
const exists = await import_fs_extra6.default.pathExists(claudeDir);
|
|
33401
33422
|
if (!exists) {
|
|
33402
33423
|
return null;
|
|
33403
33424
|
}
|
|
33404
|
-
const files = await
|
|
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 =
|
|
33411
|
-
await
|
|
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 =
|
|
33415
|
-
const destPath =
|
|
33416
|
-
if (await
|
|
33417
|
-
await
|
|
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 ?
|
|
33542
|
+
const claudeDir = customClaudeCodeFolder ? path9.resolve(customClaudeCodeFolder) : path9.join(os9.homedir(), ".claude");
|
|
33522
33543
|
console.log(source_default.gray(`Installing to: ${claudeDir}`));
|
|
33523
|
-
await
|
|
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 =
|
|
33537
|
-
if (!await
|
|
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
|
|
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
|
|
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 =
|
|
33558
|
-
if (await
|
|
33559
|
-
await
|
|
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
|
|
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 =
|
|
33583
|
-
if (await
|
|
33584
|
-
await
|
|
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
|
|
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
|
|
33655
|
-
import
|
|
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 =
|
|
33691
|
-
return
|
|
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 (!
|
|
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
|
-
|
|
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:
|
|
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 =
|
|
33760
|
-
if (
|
|
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 =
|
|
33803
|
+
const zshrcPath = path10.join(homeDir, ".zshrc");
|
|
33779
33804
|
const sanitizedTheme = sanitizeThemeName(theme);
|
|
33780
|
-
if (!
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
33801
|
-
if (!
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
33921
|
-
if (
|
|
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
|
|
34878
|
+
import path13 from "path";
|
|
34854
34879
|
|
|
34855
34880
|
// src/lib/pro-installer.ts
|
|
34856
|
-
var
|
|
34881
|
+
var import_fs_extra9 = __toESM(require_lib4(), 1);
|
|
34857
34882
|
import os11 from "os";
|
|
34858
|
-
import
|
|
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
|
|
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,43 @@ 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
|
|
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
|
|
34884
|
-
await
|
|
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
|
|
34913
|
+
await import_fs_extra9.default.ensureDir(path11.dirname(cacheDir));
|
|
34889
34914
|
await execGitWithAuth(`clone ${repoUrl} ${cacheDir}`, token, repoUrl);
|
|
34890
34915
|
}
|
|
34891
|
-
return
|
|
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
|
|
34920
|
+
const entries = await import_fs_extra9.default.readdir(dir, { withFileTypes: true });
|
|
34896
34921
|
for (const entry of entries) {
|
|
34897
|
-
const sourcePath =
|
|
34898
|
-
const relativePath =
|
|
34899
|
-
|
|
34922
|
+
const sourcePath = path11.join(dir, entry.name);
|
|
34923
|
+
const relativePath = path11.relative(baseDir, sourcePath);
|
|
34924
|
+
if (entry.isDirectory() && entry.name === ".claude" && dir === baseDir) {
|
|
34925
|
+
await walk(sourcePath, sourcePath);
|
|
34926
|
+
continue;
|
|
34927
|
+
}
|
|
34928
|
+
const targetPath = path11.join(targetDir, relativePath);
|
|
34900
34929
|
if (entry.isDirectory()) {
|
|
34901
|
-
await
|
|
34930
|
+
await import_fs_extra9.default.ensureDir(targetPath);
|
|
34902
34931
|
onProgress?.(relativePath, "directory");
|
|
34903
34932
|
await walk(sourcePath, baseDir);
|
|
34933
|
+
} else if (isTextFile(entry.name)) {
|
|
34934
|
+
const content = await import_fs_extra9.default.readFile(sourcePath, "utf-8");
|
|
34935
|
+
const replaced = replaceClaudePathPlaceholder(content, targetDir);
|
|
34936
|
+
await import_fs_extra9.default.ensureDir(path11.dirname(targetPath));
|
|
34937
|
+
await import_fs_extra9.default.writeFile(targetPath, replaced, "utf-8");
|
|
34938
|
+
onProgress?.(relativePath, "file");
|
|
34904
34939
|
} else {
|
|
34905
|
-
await
|
|
34940
|
+
await import_fs_extra9.default.copy(sourcePath, targetPath, { overwrite: true });
|
|
34906
34941
|
onProgress?.(relativePath, "file");
|
|
34907
34942
|
}
|
|
34908
34943
|
}
|
|
@@ -34923,8 +34958,8 @@ async function downloadFromPrivateGitHub(repo, branch, relativePath, targetPath,
|
|
|
34923
34958
|
return false;
|
|
34924
34959
|
}
|
|
34925
34960
|
const content = await response.arrayBuffer();
|
|
34926
|
-
await
|
|
34927
|
-
await
|
|
34961
|
+
await import_fs_extra9.default.ensureDir(path11.dirname(targetPath));
|
|
34962
|
+
await import_fs_extra9.default.writeFile(targetPath, Buffer.from(content));
|
|
34928
34963
|
return true;
|
|
34929
34964
|
} catch (error) {
|
|
34930
34965
|
console.error(`Error downloading ${relativePath}:`, error);
|
|
@@ -34949,10 +34984,10 @@ async function downloadDirectoryFromPrivateGitHub(repo, branch, dirPath, targetD
|
|
|
34949
34984
|
console.error(`Unexpected response for directory ${dirPath}`);
|
|
34950
34985
|
return false;
|
|
34951
34986
|
}
|
|
34952
|
-
await
|
|
34987
|
+
await import_fs_extra9.default.ensureDir(targetDir);
|
|
34953
34988
|
for (const file of files) {
|
|
34954
34989
|
const relativePath = dirPath ? `${dirPath}/${file.name}` : file.name;
|
|
34955
|
-
const targetPath =
|
|
34990
|
+
const targetPath = path11.join(targetDir, file.name);
|
|
34956
34991
|
const displayPath = relativePath.replace("claude-code-config/", "");
|
|
34957
34992
|
if (file.type === "file") {
|
|
34958
34993
|
onProgress?.(displayPath, "file");
|
|
@@ -34969,7 +35004,7 @@ async function downloadDirectoryFromPrivateGitHub(repo, branch, dirPath, targetD
|
|
|
34969
35004
|
}
|
|
34970
35005
|
async function installProConfigs(options) {
|
|
34971
35006
|
const { githubToken, claudeCodeFolder, onProgress } = options;
|
|
34972
|
-
const claudeFolder = claudeCodeFolder ||
|
|
35007
|
+
const claudeFolder = claudeCodeFolder || path11.join(os11.homedir(), ".claude");
|
|
34973
35008
|
try {
|
|
34974
35009
|
const cacheConfigDir = await cloneOrUpdateRepo(githubToken);
|
|
34975
35010
|
await copyConfigFromCache(cacheConfigDir, claudeFolder, onProgress);
|
|
@@ -34977,46 +35012,51 @@ async function installProConfigs(options) {
|
|
|
34977
35012
|
} catch (error) {
|
|
34978
35013
|
console.warn("Git caching failed, falling back to API download");
|
|
34979
35014
|
}
|
|
34980
|
-
const tempDir =
|
|
35015
|
+
const tempDir = path11.join(os11.tmpdir(), `aiblueprint-premium-${Date.now()}`);
|
|
34981
35016
|
try {
|
|
34982
35017
|
const success = await downloadDirectoryFromPrivateGitHub(PREMIUM_REPO, PREMIUM_BRANCH, "claude-code-config", tempDir, githubToken, onProgress);
|
|
34983
35018
|
if (!success) {
|
|
34984
35019
|
throw new Error("Failed to download premium configurations");
|
|
34985
35020
|
}
|
|
34986
|
-
|
|
35021
|
+
const dotClaudeDir = path11.join(tempDir, ".claude");
|
|
35022
|
+
if (await import_fs_extra9.default.pathExists(dotClaudeDir)) {
|
|
35023
|
+
await import_fs_extra9.default.copy(dotClaudeDir, tempDir, { overwrite: true });
|
|
35024
|
+
await import_fs_extra9.default.remove(dotClaudeDir);
|
|
35025
|
+
}
|
|
35026
|
+
await import_fs_extra9.default.copy(tempDir, claudeFolder, {
|
|
34987
35027
|
overwrite: true
|
|
34988
35028
|
});
|
|
34989
35029
|
} catch (error) {
|
|
34990
35030
|
throw new Error(`Failed to install premium configs: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
34991
35031
|
} finally {
|
|
34992
35032
|
try {
|
|
34993
|
-
await
|
|
35033
|
+
await import_fs_extra9.default.remove(tempDir);
|
|
34994
35034
|
} catch {}
|
|
34995
35035
|
}
|
|
34996
35036
|
}
|
|
34997
35037
|
|
|
34998
35038
|
// src/lib/token-storage.ts
|
|
34999
|
-
var
|
|
35039
|
+
var import_fs_extra10 = __toESM(require_lib4(), 1);
|
|
35000
35040
|
import os12 from "os";
|
|
35001
|
-
import
|
|
35041
|
+
import path12 from "path";
|
|
35002
35042
|
function getConfigDir() {
|
|
35003
35043
|
const platform = os12.platform();
|
|
35004
35044
|
if (platform === "win32") {
|
|
35005
|
-
const appData = process.env.APPDATA ||
|
|
35006
|
-
return
|
|
35045
|
+
const appData = process.env.APPDATA || path12.join(os12.homedir(), "AppData", "Roaming");
|
|
35046
|
+
return path12.join(appData, "aiblueprint");
|
|
35007
35047
|
} else {
|
|
35008
|
-
const configHome = process.env.XDG_CONFIG_HOME ||
|
|
35009
|
-
return
|
|
35048
|
+
const configHome = process.env.XDG_CONFIG_HOME || path12.join(os12.homedir(), ".config");
|
|
35049
|
+
return path12.join(configHome, "aiblueprint");
|
|
35010
35050
|
}
|
|
35011
35051
|
}
|
|
35012
35052
|
function getTokenFilePath() {
|
|
35013
|
-
return
|
|
35053
|
+
return path12.join(getConfigDir(), "token.txt");
|
|
35014
35054
|
}
|
|
35015
35055
|
async function saveToken(githubToken) {
|
|
35016
35056
|
const tokenFile = getTokenFilePath();
|
|
35017
|
-
const configDir =
|
|
35057
|
+
const configDir = path12.dirname(tokenFile);
|
|
35018
35058
|
try {
|
|
35019
|
-
await
|
|
35059
|
+
await import_fs_extra10.default.ensureDir(configDir);
|
|
35020
35060
|
} catch (error) {
|
|
35021
35061
|
if (error.code === "EACCES") {
|
|
35022
35062
|
throw new Error(`Permission denied creating config directory: ${configDir}
|
|
@@ -35024,15 +35064,15 @@ async function saveToken(githubToken) {
|
|
|
35024
35064
|
}
|
|
35025
35065
|
throw error;
|
|
35026
35066
|
}
|
|
35027
|
-
await
|
|
35067
|
+
await import_fs_extra10.default.writeFile(tokenFile, githubToken, { mode: 384 });
|
|
35028
35068
|
}
|
|
35029
35069
|
async function getToken() {
|
|
35030
35070
|
const tokenFile = getTokenFilePath();
|
|
35031
|
-
if (!await
|
|
35071
|
+
if (!await import_fs_extra10.default.pathExists(tokenFile)) {
|
|
35032
35072
|
return null;
|
|
35033
35073
|
}
|
|
35034
35074
|
try {
|
|
35035
|
-
const token = await
|
|
35075
|
+
const token = await import_fs_extra10.default.readFile(tokenFile, "utf-8");
|
|
35036
35076
|
return token.trim();
|
|
35037
35077
|
} catch (error) {
|
|
35038
35078
|
return null;
|
|
@@ -35046,7 +35086,7 @@ function getTokenInfo() {
|
|
|
35046
35086
|
}
|
|
35047
35087
|
|
|
35048
35088
|
// src/commands/pro.ts
|
|
35049
|
-
var
|
|
35089
|
+
var import_fs_extra11 = __toESM(require_lib4(), 1);
|
|
35050
35090
|
var API_URL = "https://codeline.app/api/products";
|
|
35051
35091
|
var PRODUCT_IDS = ["prd_XJVgxVPbGG", "prd_NKabAkdOkw"];
|
|
35052
35092
|
async function countInstalledItems(claudeDir) {
|
|
@@ -35056,29 +35096,29 @@ async function countInstalledItems(claudeDir) {
|
|
|
35056
35096
|
skills: 0
|
|
35057
35097
|
};
|
|
35058
35098
|
try {
|
|
35059
|
-
const commandsDir =
|
|
35060
|
-
if (await
|
|
35061
|
-
const files = await
|
|
35099
|
+
const commandsDir = path13.join(claudeDir, "commands");
|
|
35100
|
+
if (await import_fs_extra11.default.pathExists(commandsDir)) {
|
|
35101
|
+
const files = await import_fs_extra11.default.readdir(commandsDir);
|
|
35062
35102
|
counts.commands = files.filter((f) => f.endsWith(".md")).length;
|
|
35063
35103
|
}
|
|
35064
35104
|
} catch (error) {
|
|
35065
35105
|
console.error("Failed to count commands:", error instanceof Error ? error.message : error);
|
|
35066
35106
|
}
|
|
35067
35107
|
try {
|
|
35068
|
-
const agentsDir =
|
|
35069
|
-
if (await
|
|
35070
|
-
const files = await
|
|
35108
|
+
const agentsDir = path13.join(claudeDir, "agents");
|
|
35109
|
+
if (await import_fs_extra11.default.pathExists(agentsDir)) {
|
|
35110
|
+
const files = await import_fs_extra11.default.readdir(agentsDir);
|
|
35071
35111
|
counts.agents = files.filter((f) => f.endsWith(".md")).length;
|
|
35072
35112
|
}
|
|
35073
35113
|
} catch (error) {
|
|
35074
35114
|
console.error("Failed to count agents:", error instanceof Error ? error.message : error);
|
|
35075
35115
|
}
|
|
35076
35116
|
try {
|
|
35077
|
-
const skillsDir =
|
|
35078
|
-
if (await
|
|
35079
|
-
const items = await
|
|
35117
|
+
const skillsDir = path13.join(claudeDir, "skills");
|
|
35118
|
+
if (await import_fs_extra11.default.pathExists(skillsDir)) {
|
|
35119
|
+
const items = await import_fs_extra11.default.readdir(skillsDir);
|
|
35080
35120
|
const dirs = await Promise.all(items.map(async (item) => {
|
|
35081
|
-
const stat = await
|
|
35121
|
+
const stat = await import_fs_extra11.default.stat(path13.join(skillsDir, item));
|
|
35082
35122
|
return stat.isDirectory();
|
|
35083
35123
|
}));
|
|
35084
35124
|
counts.skills = dirs.filter(Boolean).length;
|
|
@@ -35191,7 +35231,7 @@ async function proSetupCommand(options = {}) {
|
|
|
35191
35231
|
Se(source_default.red("❌ Not activated"));
|
|
35192
35232
|
process.exit(1);
|
|
35193
35233
|
}
|
|
35194
|
-
const claudeDir = options.folder ?
|
|
35234
|
+
const claudeDir = options.folder ? path13.resolve(options.folder) : path13.join(os13.homedir(), ".claude");
|
|
35195
35235
|
const spinner = Y2();
|
|
35196
35236
|
const onProgress = (file, type) => {
|
|
35197
35237
|
spinner.message(`Installing: ${source_default.cyan(file)} ${source_default.gray(`(${type})`)}`);
|
|
@@ -35274,11 +35314,11 @@ async function proUpdateCommand(options = {}) {
|
|
|
35274
35314
|
|
|
35275
35315
|
// src/commands/sync.ts
|
|
35276
35316
|
import os14 from "os";
|
|
35277
|
-
import
|
|
35317
|
+
import path15 from "path";
|
|
35278
35318
|
|
|
35279
35319
|
// src/lib/sync-utils.ts
|
|
35280
|
-
var
|
|
35281
|
-
import
|
|
35320
|
+
var import_fs_extra12 = __toESM(require_lib4(), 1);
|
|
35321
|
+
import path14 from "path";
|
|
35282
35322
|
import crypto from "crypto";
|
|
35283
35323
|
var PREMIUM_REPO2 = "Melvynx/aiblueprint-cli-premium";
|
|
35284
35324
|
var PREMIUM_BRANCH2 = "main";
|
|
@@ -35327,7 +35367,7 @@ async function listRemoteFilesRecursive(dirPath, githubToken, basePath = "") {
|
|
|
35327
35367
|
}
|
|
35328
35368
|
async function computeLocalFileSha(filePath) {
|
|
35329
35369
|
try {
|
|
35330
|
-
const content = await
|
|
35370
|
+
const content = await import_fs_extra12.default.readFile(filePath);
|
|
35331
35371
|
return computeFileSha(content);
|
|
35332
35372
|
} catch {
|
|
35333
35373
|
return null;
|
|
@@ -35335,15 +35375,15 @@ async function computeLocalFileSha(filePath) {
|
|
|
35335
35375
|
}
|
|
35336
35376
|
async function listLocalFiles(dir) {
|
|
35337
35377
|
const files = [];
|
|
35338
|
-
if (!await
|
|
35378
|
+
if (!await import_fs_extra12.default.pathExists(dir)) {
|
|
35339
35379
|
return files;
|
|
35340
35380
|
}
|
|
35341
|
-
const items = await
|
|
35381
|
+
const items = await import_fs_extra12.default.readdir(dir);
|
|
35342
35382
|
for (const item of items) {
|
|
35343
35383
|
if (item === "node_modules" || item === ".DS_Store")
|
|
35344
35384
|
continue;
|
|
35345
|
-
const fullPath =
|
|
35346
|
-
const stat = await
|
|
35385
|
+
const fullPath = path14.join(dir, item);
|
|
35386
|
+
const stat = await import_fs_extra12.default.stat(fullPath);
|
|
35347
35387
|
if (stat.isDirectory()) {
|
|
35348
35388
|
files.push(item);
|
|
35349
35389
|
const subFiles = await listLocalFilesRecursive(fullPath, item);
|
|
@@ -35356,13 +35396,13 @@ async function listLocalFiles(dir) {
|
|
|
35356
35396
|
}
|
|
35357
35397
|
async function listLocalFilesRecursive(dir, basePath) {
|
|
35358
35398
|
const files = [];
|
|
35359
|
-
const items = await
|
|
35399
|
+
const items = await import_fs_extra12.default.readdir(dir);
|
|
35360
35400
|
for (const item of items) {
|
|
35361
35401
|
if (item === "node_modules" || item === ".DS_Store")
|
|
35362
35402
|
continue;
|
|
35363
|
-
const fullPath =
|
|
35403
|
+
const fullPath = path14.join(dir, item);
|
|
35364
35404
|
const relativePath = `${basePath}/${item}`;
|
|
35365
|
-
const stat = await
|
|
35405
|
+
const stat = await import_fs_extra12.default.stat(fullPath);
|
|
35366
35406
|
if (stat.isDirectory()) {
|
|
35367
35407
|
files.push(relativePath);
|
|
35368
35408
|
const subFiles = await listLocalFilesRecursive(fullPath, relativePath);
|
|
@@ -35375,7 +35415,7 @@ async function listLocalFilesRecursive(dir, basePath) {
|
|
|
35375
35415
|
}
|
|
35376
35416
|
async function analyzeCategory(category, claudeDir, githubToken) {
|
|
35377
35417
|
const items = [];
|
|
35378
|
-
const localDir =
|
|
35418
|
+
const localDir = path14.join(claudeDir, category);
|
|
35379
35419
|
const remoteFiles = await listRemoteFilesRecursive(category, githubToken);
|
|
35380
35420
|
const localFiles = await listLocalFiles(localDir);
|
|
35381
35421
|
const remoteSet = new Map;
|
|
@@ -35384,7 +35424,7 @@ async function analyzeCategory(category, claudeDir, githubToken) {
|
|
|
35384
35424
|
}
|
|
35385
35425
|
const localSet = new Set(localFiles);
|
|
35386
35426
|
for (const [remotePath, { sha, isFolder }] of remoteSet) {
|
|
35387
|
-
const localPath =
|
|
35427
|
+
const localPath = path14.join(localDir, remotePath);
|
|
35388
35428
|
if (isFolder) {
|
|
35389
35429
|
continue;
|
|
35390
35430
|
}
|
|
@@ -35427,8 +35467,8 @@ async function analyzeCategory(category, claudeDir, githubToken) {
|
|
|
35427
35467
|
if (parentAlreadyDeleted) {
|
|
35428
35468
|
continue;
|
|
35429
35469
|
}
|
|
35430
|
-
const fullPath =
|
|
35431
|
-
const stat = await
|
|
35470
|
+
const fullPath = path14.join(localDir, localPath);
|
|
35471
|
+
const stat = await import_fs_extra12.default.stat(fullPath).catch(() => null);
|
|
35432
35472
|
if (stat) {
|
|
35433
35473
|
const isFolder = stat.isDirectory();
|
|
35434
35474
|
items.push({
|
|
@@ -35464,9 +35504,9 @@ async function fetchRemoteSettings(githubToken) {
|
|
|
35464
35504
|
}
|
|
35465
35505
|
}
|
|
35466
35506
|
async function getLocalSettings(claudeDir) {
|
|
35467
|
-
const settingsPath =
|
|
35507
|
+
const settingsPath = path14.join(claudeDir, "settings.json");
|
|
35468
35508
|
try {
|
|
35469
|
-
const content = await
|
|
35509
|
+
const content = await import_fs_extra12.default.readFile(settingsPath, "utf-8");
|
|
35470
35510
|
return JSON.parse(content);
|
|
35471
35511
|
} catch {
|
|
35472
35512
|
return {};
|
|
@@ -35548,13 +35588,13 @@ async function downloadFromPrivateGitHub2(relativePath, targetPath, githubToken,
|
|
|
35548
35588
|
return false;
|
|
35549
35589
|
}
|
|
35550
35590
|
const content = await response.arrayBuffer();
|
|
35551
|
-
await
|
|
35591
|
+
await import_fs_extra12.default.ensureDir(path14.dirname(targetPath));
|
|
35552
35592
|
if (isTextFile(relativePath)) {
|
|
35553
35593
|
const textContent = Buffer.from(content).toString("utf-8");
|
|
35554
35594
|
const transformedContent = transformFileContent(textContent, claudeDir);
|
|
35555
|
-
await
|
|
35595
|
+
await import_fs_extra12.default.writeFile(targetPath, transformedContent, "utf-8");
|
|
35556
35596
|
} else {
|
|
35557
|
-
await
|
|
35597
|
+
await import_fs_extra12.default.writeFile(targetPath, Buffer.from(content));
|
|
35558
35598
|
}
|
|
35559
35599
|
return true;
|
|
35560
35600
|
} catch {
|
|
@@ -35565,10 +35605,10 @@ async function syncSelectedHooks(claudeDir, hooks, onProgress) {
|
|
|
35565
35605
|
if (hooks.length === 0) {
|
|
35566
35606
|
return { success: 0, failed: 0 };
|
|
35567
35607
|
}
|
|
35568
|
-
const settingsPath =
|
|
35608
|
+
const settingsPath = path14.join(claudeDir, "settings.json");
|
|
35569
35609
|
let settings = {};
|
|
35570
35610
|
try {
|
|
35571
|
-
const content = await
|
|
35611
|
+
const content = await import_fs_extra12.default.readFile(settingsPath, "utf-8");
|
|
35572
35612
|
settings = JSON.parse(content);
|
|
35573
35613
|
} catch {
|
|
35574
35614
|
settings = {};
|
|
@@ -35596,7 +35636,7 @@ async function syncSelectedHooks(claudeDir, hooks, onProgress) {
|
|
|
35596
35636
|
failed++;
|
|
35597
35637
|
}
|
|
35598
35638
|
}
|
|
35599
|
-
await
|
|
35639
|
+
await import_fs_extra12.default.writeFile(settingsPath, JSON.stringify(settings, null, 2));
|
|
35600
35640
|
return { success, failed };
|
|
35601
35641
|
}
|
|
35602
35642
|
async function syncSelectedItems(claudeDir, items, githubToken, onProgress) {
|
|
@@ -35604,11 +35644,11 @@ async function syncSelectedItems(claudeDir, items, githubToken, onProgress) {
|
|
|
35604
35644
|
let failed = 0;
|
|
35605
35645
|
let deleted = 0;
|
|
35606
35646
|
for (const item of items) {
|
|
35607
|
-
const targetPath =
|
|
35647
|
+
const targetPath = path14.join(claudeDir, item.relativePath);
|
|
35608
35648
|
if (item.status === "deleted") {
|
|
35609
35649
|
onProgress?.(item.relativePath, "deleting");
|
|
35610
35650
|
try {
|
|
35611
|
-
await
|
|
35651
|
+
await import_fs_extra12.default.remove(targetPath);
|
|
35612
35652
|
deleted++;
|
|
35613
35653
|
} catch {
|
|
35614
35654
|
failed++;
|
|
@@ -35760,7 +35800,7 @@ async function proSyncCommand(options = {}) {
|
|
|
35760
35800
|
Se(source_default.red("❌ Not activated"));
|
|
35761
35801
|
process.exit(1);
|
|
35762
35802
|
}
|
|
35763
|
-
const claudeDir = options.folder ?
|
|
35803
|
+
const claudeDir = options.folder ? path15.resolve(options.folder) : path15.join(os14.homedir(), ".claude");
|
|
35764
35804
|
const spinner = Y2();
|
|
35765
35805
|
spinner.start("Analyzing changes...");
|
|
35766
35806
|
const result = await analyzeSyncChanges(claudeDir, githubToken);
|
|
@@ -36006,7 +36046,7 @@ async function proSyncCommand(options = {}) {
|
|
|
36006
36046
|
|
|
36007
36047
|
// src/commands/backup.ts
|
|
36008
36048
|
import os15 from "os";
|
|
36009
|
-
import
|
|
36049
|
+
import path16 from "path";
|
|
36010
36050
|
function formatBackupDate(date) {
|
|
36011
36051
|
const now = new Date;
|
|
36012
36052
|
const diffMs = now.getTime() - date.getTime();
|
|
@@ -36026,7 +36066,7 @@ function formatBackupDate(date) {
|
|
|
36026
36066
|
return `${date.toLocaleString()} (${relative})`;
|
|
36027
36067
|
}
|
|
36028
36068
|
async function backupLoadCommand(options = {}) {
|
|
36029
|
-
const claudeDir = options.folder ||
|
|
36069
|
+
const claudeDir = options.folder || path16.join(os15.homedir(), ".claude");
|
|
36030
36070
|
Ie(source_default.blue("\uD83D\uDCE6 Load Backup"));
|
|
36031
36071
|
const spinner = Y2();
|
|
36032
36072
|
spinner.start("Scanning for backups...");
|
|
@@ -36083,18 +36123,18 @@ async function backupLoadCommand(options = {}) {
|
|
|
36083
36123
|
|
|
36084
36124
|
// src/commands/openclaw-pro.ts
|
|
36085
36125
|
import os18 from "os";
|
|
36086
|
-
import
|
|
36126
|
+
import path19 from "path";
|
|
36087
36127
|
|
|
36088
36128
|
// src/lib/openclaw-installer.ts
|
|
36089
|
-
var
|
|
36129
|
+
var import_fs_extra13 = __toESM(require_lib4(), 1);
|
|
36090
36130
|
import os16 from "os";
|
|
36091
|
-
import
|
|
36131
|
+
import path17 from "path";
|
|
36092
36132
|
import { exec as exec4 } from "child_process";
|
|
36093
36133
|
import { promisify as promisify3 } from "util";
|
|
36094
36134
|
var execAsync3 = promisify3(exec4);
|
|
36095
36135
|
var OPENCLAW_PRO_REPO = "Melvynx/openclawpro";
|
|
36096
36136
|
function getCacheRepoDir2() {
|
|
36097
|
-
return
|
|
36137
|
+
return path17.join(os16.homedir(), ".config", "openclaw", "pro-repos", "openclawpro");
|
|
36098
36138
|
}
|
|
36099
36139
|
async function execGitWithAuth2(command, token, repoUrl, cwd) {
|
|
36100
36140
|
const authenticatedUrl = `https://x-access-token:${token}@${repoUrl.replace(/^https?:\/\//, "")}`;
|
|
@@ -36108,33 +36148,33 @@ async function execGitWithAuth2(command, token, repoUrl, cwd) {
|
|
|
36108
36148
|
async function cloneOrUpdateRepo2(token) {
|
|
36109
36149
|
const cacheDir = getCacheRepoDir2();
|
|
36110
36150
|
const repoUrl = `https://github.com/${OPENCLAW_PRO_REPO}.git`;
|
|
36111
|
-
if (await
|
|
36151
|
+
if (await import_fs_extra13.default.pathExists(path17.join(cacheDir, ".git"))) {
|
|
36112
36152
|
try {
|
|
36113
36153
|
await execGitWithAuth2("pull", token, repoUrl, cacheDir);
|
|
36114
36154
|
} catch (error) {
|
|
36115
|
-
await
|
|
36116
|
-
await
|
|
36155
|
+
await import_fs_extra13.default.remove(cacheDir);
|
|
36156
|
+
await import_fs_extra13.default.ensureDir(path17.dirname(cacheDir));
|
|
36117
36157
|
await execGitWithAuth2(`clone ${repoUrl} ${cacheDir}`, token, repoUrl);
|
|
36118
36158
|
}
|
|
36119
36159
|
} else {
|
|
36120
|
-
await
|
|
36160
|
+
await import_fs_extra13.default.ensureDir(path17.dirname(cacheDir));
|
|
36121
36161
|
await execGitWithAuth2(`clone ${repoUrl} ${cacheDir}`, token, repoUrl);
|
|
36122
36162
|
}
|
|
36123
|
-
return
|
|
36163
|
+
return path17.join(cacheDir, "openclaw-config");
|
|
36124
36164
|
}
|
|
36125
36165
|
async function copyConfigFromCache2(cacheConfigDir, targetDir, onProgress) {
|
|
36126
36166
|
const walk = async (dir, baseDir = dir) => {
|
|
36127
|
-
const entries = await
|
|
36167
|
+
const entries = await import_fs_extra13.default.readdir(dir, { withFileTypes: true });
|
|
36128
36168
|
for (const entry of entries) {
|
|
36129
|
-
const sourcePath =
|
|
36130
|
-
const relativePath =
|
|
36131
|
-
const targetPath =
|
|
36169
|
+
const sourcePath = path17.join(dir, entry.name);
|
|
36170
|
+
const relativePath = path17.relative(baseDir, sourcePath);
|
|
36171
|
+
const targetPath = path17.join(targetDir, relativePath);
|
|
36132
36172
|
if (entry.isDirectory()) {
|
|
36133
|
-
await
|
|
36173
|
+
await import_fs_extra13.default.ensureDir(targetPath);
|
|
36134
36174
|
onProgress?.(relativePath, "directory");
|
|
36135
36175
|
await walk(sourcePath, baseDir);
|
|
36136
36176
|
} else {
|
|
36137
|
-
await
|
|
36177
|
+
await import_fs_extra13.default.copy(sourcePath, targetPath, { overwrite: true });
|
|
36138
36178
|
onProgress?.(relativePath, "file");
|
|
36139
36179
|
}
|
|
36140
36180
|
}
|
|
@@ -36143,7 +36183,7 @@ async function copyConfigFromCache2(cacheConfigDir, targetDir, onProgress) {
|
|
|
36143
36183
|
}
|
|
36144
36184
|
async function installOpenclawProConfigs(options) {
|
|
36145
36185
|
const { githubToken, openclawFolder, onProgress } = options;
|
|
36146
|
-
const targetFolder = openclawFolder ||
|
|
36186
|
+
const targetFolder = openclawFolder || path17.join(os16.homedir(), ".openclaw");
|
|
36147
36187
|
try {
|
|
36148
36188
|
const cacheConfigDir = await cloneOrUpdateRepo2(githubToken);
|
|
36149
36189
|
await copyConfigFromCache2(cacheConfigDir, targetFolder, onProgress);
|
|
@@ -36154,28 +36194,28 @@ async function installOpenclawProConfigs(options) {
|
|
|
36154
36194
|
}
|
|
36155
36195
|
|
|
36156
36196
|
// src/lib/openclaw-token-storage.ts
|
|
36157
|
-
var
|
|
36197
|
+
var import_fs_extra14 = __toESM(require_lib4(), 1);
|
|
36158
36198
|
import os17 from "os";
|
|
36159
|
-
import
|
|
36199
|
+
import path18 from "path";
|
|
36160
36200
|
function getConfigDir2() {
|
|
36161
36201
|
const platform = os17.platform();
|
|
36162
36202
|
if (platform === "win32") {
|
|
36163
|
-
return
|
|
36203
|
+
return path18.join(process.env.APPDATA || os17.homedir(), "openclaw");
|
|
36164
36204
|
}
|
|
36165
|
-
return
|
|
36205
|
+
return path18.join(os17.homedir(), ".config", "openclaw");
|
|
36166
36206
|
}
|
|
36167
36207
|
function getTokenPath() {
|
|
36168
|
-
return
|
|
36208
|
+
return path18.join(getConfigDir2(), "token.txt");
|
|
36169
36209
|
}
|
|
36170
36210
|
async function saveOpenclawToken(githubToken) {
|
|
36171
36211
|
const configDir = getConfigDir2();
|
|
36172
|
-
await
|
|
36173
|
-
await
|
|
36212
|
+
await import_fs_extra14.default.ensureDir(configDir);
|
|
36213
|
+
await import_fs_extra14.default.writeFile(getTokenPath(), githubToken, { mode: 384 });
|
|
36174
36214
|
}
|
|
36175
36215
|
async function getOpenclawToken() {
|
|
36176
36216
|
const tokenPath = getTokenPath();
|
|
36177
|
-
if (await
|
|
36178
|
-
const token = await
|
|
36217
|
+
if (await import_fs_extra14.default.pathExists(tokenPath)) {
|
|
36218
|
+
const token = await import_fs_extra14.default.readFile(tokenPath, "utf8");
|
|
36179
36219
|
return token.trim();
|
|
36180
36220
|
}
|
|
36181
36221
|
return null;
|
|
@@ -36188,7 +36228,7 @@ function getOpenclawTokenInfo() {
|
|
|
36188
36228
|
}
|
|
36189
36229
|
|
|
36190
36230
|
// src/commands/openclaw-pro.ts
|
|
36191
|
-
var
|
|
36231
|
+
var import_fs_extra15 = __toESM(require_lib4(), 1);
|
|
36192
36232
|
var API_URL2 = "https://codeline.app/api/products";
|
|
36193
36233
|
var OPENCLAW_PRODUCT_ID = "prd_t2GRwX3aH1";
|
|
36194
36234
|
var CLAUDE_CODE_TOOLS_INSTRUCTIONS = `
|
|
@@ -36295,7 +36335,7 @@ async function openclawProSetupCommand(options = {}) {
|
|
|
36295
36335
|
Se(source_default.red("❌ Not activated"));
|
|
36296
36336
|
process.exit(1);
|
|
36297
36337
|
}
|
|
36298
|
-
const openclawDir = options.folder ?
|
|
36338
|
+
const openclawDir = options.folder ? path19.resolve(options.folder) : path19.join(os18.homedir(), ".openclaw");
|
|
36299
36339
|
const spinner = Y2();
|
|
36300
36340
|
const onProgress = (file, type) => {
|
|
36301
36341
|
spinner.message(`Installing: ${source_default.cyan(file)} ${source_default.gray(`(${type})`)}`);
|
|
@@ -36308,23 +36348,23 @@ async function openclawProSetupCommand(options = {}) {
|
|
|
36308
36348
|
});
|
|
36309
36349
|
spinner.stop("OpenClaw Pro configurations installed");
|
|
36310
36350
|
let skillCount = 0;
|
|
36311
|
-
const skillsDir =
|
|
36312
|
-
if (await
|
|
36313
|
-
const items = await
|
|
36351
|
+
const skillsDir = path19.join(openclawDir, "skills");
|
|
36352
|
+
if (await import_fs_extra15.default.pathExists(skillsDir)) {
|
|
36353
|
+
const items = await import_fs_extra15.default.readdir(skillsDir);
|
|
36314
36354
|
const dirs = await Promise.all(items.map(async (item) => {
|
|
36315
|
-
const stat = await
|
|
36355
|
+
const stat = await import_fs_extra15.default.stat(path19.join(skillsDir, item));
|
|
36316
36356
|
return stat.isDirectory();
|
|
36317
36357
|
}));
|
|
36318
36358
|
skillCount = dirs.filter(Boolean).length;
|
|
36319
36359
|
}
|
|
36320
36360
|
spinner.start("Setting up workspace TOOLS.md...");
|
|
36321
|
-
const workspaceDir =
|
|
36322
|
-
const toolsPath =
|
|
36323
|
-
await
|
|
36324
|
-
if (await
|
|
36325
|
-
const existingContent = await
|
|
36361
|
+
const workspaceDir = path19.join(openclawDir, "workspace");
|
|
36362
|
+
const toolsPath = path19.join(workspaceDir, "TOOLS.md");
|
|
36363
|
+
await import_fs_extra15.default.ensureDir(workspaceDir);
|
|
36364
|
+
if (await import_fs_extra15.default.pathExists(toolsPath)) {
|
|
36365
|
+
const existingContent = await import_fs_extra15.default.readFile(toolsPath, "utf-8");
|
|
36326
36366
|
if (!existingContent.includes("Claude Code CLI")) {
|
|
36327
|
-
await
|
|
36367
|
+
await import_fs_extra15.default.appendFile(toolsPath, `
|
|
36328
36368
|
|
|
36329
36369
|
` + CLAUDE_CODE_TOOLS_INSTRUCTIONS);
|
|
36330
36370
|
spinner.stop("TOOLS.md updated with Claude Code instructions");
|
|
@@ -36338,7 +36378,7 @@ Skills define _how_ tools work. This file is for _your_ specifics — the stuff
|
|
|
36338
36378
|
|
|
36339
36379
|
${CLAUDE_CODE_TOOLS_INSTRUCTIONS}
|
|
36340
36380
|
`;
|
|
36341
|
-
await
|
|
36381
|
+
await import_fs_extra15.default.writeFile(toolsPath, defaultToolsMd);
|
|
36342
36382
|
spinner.stop("TOOLS.md created with Claude Code instructions");
|
|
36343
36383
|
}
|
|
36344
36384
|
spinner.start("Creating claude-run wrapper...");
|
|
@@ -36349,9 +36389,9 @@ ${CLAUDE_CODE_TOOLS_INSTRUCTIONS}
|
|
|
36349
36389
|
script -q -c "claude $*" /dev/null
|
|
36350
36390
|
`;
|
|
36351
36391
|
const binDir = "/usr/local/bin";
|
|
36352
|
-
const wrapperPath =
|
|
36392
|
+
const wrapperPath = path19.join(binDir, "claude-run");
|
|
36353
36393
|
try {
|
|
36354
|
-
await
|
|
36394
|
+
await import_fs_extra15.default.writeFile(wrapperPath, claudeRunWrapper, { mode: 493 });
|
|
36355
36395
|
spinner.stop("claude-run wrapper created");
|
|
36356
36396
|
} catch {
|
|
36357
36397
|
spinner.stop("claude-run wrapper skipped (no write access to /usr/local/bin)");
|
|
@@ -36400,12 +36440,12 @@ async function openclawProUpdateCommand(options = {}) {
|
|
|
36400
36440
|
}
|
|
36401
36441
|
|
|
36402
36442
|
// src/commands/dynamic-scripts.ts
|
|
36403
|
-
import
|
|
36443
|
+
import path22 from "path";
|
|
36404
36444
|
import { homedir } from "os";
|
|
36405
36445
|
|
|
36406
36446
|
// src/lib/script-parser.ts
|
|
36407
|
-
var
|
|
36408
|
-
import
|
|
36447
|
+
var import_fs_extra16 = __toESM(require_lib4(), 1);
|
|
36448
|
+
import path20 from "path";
|
|
36409
36449
|
var EXCLUDED_SCRIPTS = ["test", "lint", "format", "start"];
|
|
36410
36450
|
var EXCLUDED_SUFFIXES = [":test", ":lint", ":test-fixtures", ":start"];
|
|
36411
36451
|
function shouldIncludeScript(scriptName) {
|
|
@@ -36416,12 +36456,12 @@ function shouldIncludeScript(scriptName) {
|
|
|
36416
36456
|
return true;
|
|
36417
36457
|
}
|
|
36418
36458
|
async function readScriptsPackageJson(claudeDir) {
|
|
36419
|
-
const packageJsonPath =
|
|
36459
|
+
const packageJsonPath = path20.join(claudeDir, "scripts", "package.json");
|
|
36420
36460
|
try {
|
|
36421
|
-
if (!await
|
|
36461
|
+
if (!await import_fs_extra16.default.pathExists(packageJsonPath)) {
|
|
36422
36462
|
return null;
|
|
36423
36463
|
}
|
|
36424
|
-
const content = await
|
|
36464
|
+
const content = await import_fs_extra16.default.readFile(packageJsonPath, "utf-8");
|
|
36425
36465
|
const parsed = JSON.parse(content);
|
|
36426
36466
|
return parsed.scripts || null;
|
|
36427
36467
|
} catch (error) {
|
|
@@ -36465,10 +36505,10 @@ function groupScriptsByPrefix(commands) {
|
|
|
36465
36505
|
}
|
|
36466
36506
|
|
|
36467
36507
|
// src/commands/script-runner.ts
|
|
36468
|
-
var
|
|
36508
|
+
var import_fs_extra17 = __toESM(require_lib4(), 1);
|
|
36469
36509
|
import { spawn as spawn2 } from "child_process";
|
|
36470
36510
|
import { execSync as execSync4 } from "child_process";
|
|
36471
|
-
import
|
|
36511
|
+
import path21 from "path";
|
|
36472
36512
|
import os19 from "os";
|
|
36473
36513
|
function checkCommand(cmd) {
|
|
36474
36514
|
try {
|
|
@@ -36498,18 +36538,18 @@ async function executeScript(scriptName, claudeDir) {
|
|
|
36498
36538
|
console.error(source_default.red("Bun is not installed. Install with: npm install -g bun"));
|
|
36499
36539
|
return 1;
|
|
36500
36540
|
}
|
|
36501
|
-
const scriptsDir =
|
|
36502
|
-
if (!await
|
|
36541
|
+
const scriptsDir = path21.join(claudeDir, "scripts");
|
|
36542
|
+
if (!await import_fs_extra17.default.pathExists(scriptsDir)) {
|
|
36503
36543
|
console.error(source_default.red(`Scripts directory not found at ${scriptsDir}`));
|
|
36504
36544
|
console.log(source_default.gray("Run: aiblueprint claude-code setup"));
|
|
36505
36545
|
return 1;
|
|
36506
36546
|
}
|
|
36507
|
-
const packageJsonPath =
|
|
36508
|
-
if (!await
|
|
36547
|
+
const packageJsonPath = path21.join(scriptsDir, "package.json");
|
|
36548
|
+
if (!await import_fs_extra17.default.pathExists(packageJsonPath)) {
|
|
36509
36549
|
console.error(source_default.red(`package.json not found in ${scriptsDir}`));
|
|
36510
36550
|
return 1;
|
|
36511
36551
|
}
|
|
36512
|
-
const packageJson = await
|
|
36552
|
+
const packageJson = await import_fs_extra17.default.readJson(packageJsonPath);
|
|
36513
36553
|
if (!packageJson.scripts || !packageJson.scripts[scriptName]) {
|
|
36514
36554
|
console.error(source_default.red(`Script "${scriptName}" not found in package.json`));
|
|
36515
36555
|
return 1;
|
|
@@ -36532,7 +36572,7 @@ async function executeScript(scriptName, claudeDir) {
|
|
|
36532
36572
|
|
|
36533
36573
|
// src/commands/dynamic-scripts.ts
|
|
36534
36574
|
function getClaudeDir(parentOptions) {
|
|
36535
|
-
return parentOptions.claudeCodeFolder || parentOptions.folder ?
|
|
36575
|
+
return parentOptions.claudeCodeFolder || parentOptions.folder ? path22.resolve(parentOptions.claudeCodeFolder || parentOptions.folder) : path22.join(homedir(), ".claude");
|
|
36536
36576
|
}
|
|
36537
36577
|
async function registerDynamicScriptCommands(claudeCodeCmd, claudeDir) {
|
|
36538
36578
|
const scripts = await readScriptsPackageJson(claudeDir);
|