claudekit-cli 3.35.0-dev.26 → 3.35.0-dev.28
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.
package/dist/index.js
CHANGED
|
@@ -51613,11 +51613,14 @@ var init_skill_scanner = __esm(() => {
|
|
|
51613
51613
|
|
|
51614
51614
|
// src/services/claude-data/settings-reader.ts
|
|
51615
51615
|
import { existsSync as existsSync23 } from "node:fs";
|
|
51616
|
-
import { readFile as readFile18 } from "node:fs/promises";
|
|
51616
|
+
import { copyFile as copyFile2, mkdir as mkdir8, readFile as readFile18, rename as rename5, rm as rm6, writeFile as writeFile10 } from "node:fs/promises";
|
|
51617
51617
|
import { homedir as homedir17 } from "node:os";
|
|
51618
51618
|
import { join as join26 } from "node:path";
|
|
51619
|
+
function getSettingsPath() {
|
|
51620
|
+
return join26(claudeDir, settingsFilename);
|
|
51621
|
+
}
|
|
51619
51622
|
async function readSettings() {
|
|
51620
|
-
const settingsPath =
|
|
51623
|
+
const settingsPath = getSettingsPath();
|
|
51621
51624
|
try {
|
|
51622
51625
|
if (!existsSync23(settingsPath))
|
|
51623
51626
|
return null;
|
|
@@ -51627,6 +51630,31 @@ async function readSettings() {
|
|
|
51627
51630
|
return null;
|
|
51628
51631
|
}
|
|
51629
51632
|
}
|
|
51633
|
+
function getBackupTimestamp() {
|
|
51634
|
+
return new Date().toISOString().replace(/[-:]/g, "").replace(/\..+/, "").replace("T", "-");
|
|
51635
|
+
}
|
|
51636
|
+
async function backupAndSaveSettings(settings) {
|
|
51637
|
+
const settingsPath = getSettingsPath();
|
|
51638
|
+
await mkdir8(claudeDir, { recursive: true });
|
|
51639
|
+
let backupPath = null;
|
|
51640
|
+
if (existsSync23(settingsPath)) {
|
|
51641
|
+
await mkdir8(settingsBackupDir, { recursive: true });
|
|
51642
|
+
backupPath = join26(settingsBackupDir, `${getBackupTimestamp()}-${settingsFilename}`);
|
|
51643
|
+
await copyFile2(settingsPath, backupPath);
|
|
51644
|
+
}
|
|
51645
|
+
const tempPath = `${settingsPath}.tmp-${Date.now()}`;
|
|
51646
|
+
try {
|
|
51647
|
+
await writeFile10(tempPath, `${JSON.stringify(settings, null, 2)}
|
|
51648
|
+
`, "utf-8");
|
|
51649
|
+
await rename5(tempPath, settingsPath);
|
|
51650
|
+
return { backupPath, savedPath: settingsPath };
|
|
51651
|
+
} catch (error) {
|
|
51652
|
+
await rm6(tempPath, { force: true }).catch(() => {
|
|
51653
|
+
return;
|
|
51654
|
+
});
|
|
51655
|
+
throw error;
|
|
51656
|
+
}
|
|
51657
|
+
}
|
|
51630
51658
|
function getCurrentModel() {
|
|
51631
51659
|
return process.env.ANTHROPIC_MODEL || null;
|
|
51632
51660
|
}
|
|
@@ -51646,9 +51674,10 @@ function countMcpServers(settings) {
|
|
|
51646
51674
|
return 0;
|
|
51647
51675
|
return Object.keys(settings.mcpServers).length;
|
|
51648
51676
|
}
|
|
51649
|
-
var claudeDir;
|
|
51677
|
+
var claudeDir, settingsFilename = "settings.json", settingsBackupDir;
|
|
51650
51678
|
var init_settings_reader = __esm(() => {
|
|
51651
51679
|
claudeDir = join26(homedir17(), ".claude");
|
|
51680
|
+
settingsBackupDir = join26(claudeDir, ".ck-backups", "settings");
|
|
51652
51681
|
});
|
|
51653
51682
|
|
|
51654
51683
|
// src/services/claude-data/project-scanner.ts
|
|
@@ -52244,6 +52273,7 @@ var init_session_routes = __esm(() => {
|
|
|
52244
52273
|
});
|
|
52245
52274
|
|
|
52246
52275
|
// src/domains/web-server/routes/settings-routes.ts
|
|
52276
|
+
import { homedir as homedir22 } from "node:os";
|
|
52247
52277
|
function registerSettingsRoutes(app) {
|
|
52248
52278
|
app.get("/api/settings", async (_req, res) => {
|
|
52249
52279
|
try {
|
|
@@ -52255,20 +52285,85 @@ function registerSettingsRoutes(app) {
|
|
|
52255
52285
|
model,
|
|
52256
52286
|
hookCount,
|
|
52257
52287
|
mcpServerCount,
|
|
52258
|
-
permissions: settings?.permissions || null
|
|
52288
|
+
permissions: settings?.permissions || null,
|
|
52289
|
+
settingsPath: "~/.claude/settings.json",
|
|
52290
|
+
settingsExists: settings !== null,
|
|
52291
|
+
settings: settings ?? {}
|
|
52259
52292
|
});
|
|
52260
52293
|
} catch (error) {
|
|
52261
52294
|
res.status(500).json({ error: "Failed to read settings" });
|
|
52262
52295
|
}
|
|
52263
52296
|
});
|
|
52297
|
+
app.get("/api/settings/raw", async (_req, res) => {
|
|
52298
|
+
try {
|
|
52299
|
+
const settings = await readSettings();
|
|
52300
|
+
res.json({
|
|
52301
|
+
path: "~/.claude/settings.json",
|
|
52302
|
+
exists: settings !== null,
|
|
52303
|
+
settings: settings ?? {}
|
|
52304
|
+
});
|
|
52305
|
+
} catch (error) {
|
|
52306
|
+
res.status(500).json({ error: "Failed to read settings file" });
|
|
52307
|
+
}
|
|
52308
|
+
});
|
|
52309
|
+
app.put("/api/settings/raw", async (req, res) => {
|
|
52310
|
+
try {
|
|
52311
|
+
const payload = req.body;
|
|
52312
|
+
if (!payload || typeof payload !== "object" || payload.settings === undefined) {
|
|
52313
|
+
res.status(400).json({ error: "Missing settings payload" });
|
|
52314
|
+
return;
|
|
52315
|
+
}
|
|
52316
|
+
if (payload.settings === null || typeof payload.settings !== "object") {
|
|
52317
|
+
res.status(400).json({ error: "settings must be a JSON object" });
|
|
52318
|
+
return;
|
|
52319
|
+
}
|
|
52320
|
+
const validation = ClaudeSettingsWriteSchema.safeParse(payload.settings);
|
|
52321
|
+
if (!validation.success) {
|
|
52322
|
+
res.status(400).json({
|
|
52323
|
+
error: "Settings validation failed",
|
|
52324
|
+
details: validation.error.issues
|
|
52325
|
+
});
|
|
52326
|
+
return;
|
|
52327
|
+
}
|
|
52328
|
+
const saveResult = await backupAndSaveSettings(validation.data);
|
|
52329
|
+
res.json({
|
|
52330
|
+
success: true,
|
|
52331
|
+
path: "~/.claude/settings.json",
|
|
52332
|
+
backupPath: saveResult.backupPath ? saveResult.backupPath.replace(homedir22(), "~") : null,
|
|
52333
|
+
absolutePath: getSettingsPath()
|
|
52334
|
+
});
|
|
52335
|
+
} catch (error) {
|
|
52336
|
+
res.status(500).json({ error: "Failed to save settings file" });
|
|
52337
|
+
}
|
|
52338
|
+
});
|
|
52264
52339
|
}
|
|
52340
|
+
var HookGroupSchema, ClaudeSettingsWriteSchema;
|
|
52265
52341
|
var init_settings_routes = __esm(() => {
|
|
52266
52342
|
init_claude_data();
|
|
52343
|
+
init_zod();
|
|
52344
|
+
HookGroupSchema = exports_external.object({
|
|
52345
|
+
matcher: exports_external.string().optional(),
|
|
52346
|
+
hooks: exports_external.array(exports_external.unknown())
|
|
52347
|
+
}).passthrough();
|
|
52348
|
+
ClaudeSettingsWriteSchema = exports_external.object({
|
|
52349
|
+
model: exports_external.string().optional(),
|
|
52350
|
+
includeCoAuthoredBy: exports_external.boolean().optional(),
|
|
52351
|
+
permissions: exports_external.object({
|
|
52352
|
+
allow: exports_external.array(exports_external.string()).optional(),
|
|
52353
|
+
deny: exports_external.array(exports_external.string()).optional(),
|
|
52354
|
+
defaultMode: exports_external.string().optional()
|
|
52355
|
+
}).passthrough().optional(),
|
|
52356
|
+
hooks: exports_external.record(exports_external.array(HookGroupSchema)).optional(),
|
|
52357
|
+
mcpServers: exports_external.record(exports_external.unknown()).optional(),
|
|
52358
|
+
statusLine: exports_external.unknown().optional(),
|
|
52359
|
+
enabledPlugins: exports_external.record(exports_external.unknown()).optional(),
|
|
52360
|
+
effortLevel: exports_external.string().optional()
|
|
52361
|
+
}).passthrough();
|
|
52267
52362
|
});
|
|
52268
52363
|
|
|
52269
52364
|
// src/commands/skills/agents.ts
|
|
52270
52365
|
import { existsSync as existsSync25 } from "node:fs";
|
|
52271
|
-
import { homedir as
|
|
52366
|
+
import { homedir as homedir23 } from "node:os";
|
|
52272
52367
|
import { join as join31 } from "node:path";
|
|
52273
52368
|
async function detectInstalledAgents() {
|
|
52274
52369
|
const installed = [];
|
|
@@ -52293,7 +52388,7 @@ function isSkillInstalled(skillName, agent, options2) {
|
|
|
52293
52388
|
}
|
|
52294
52389
|
var home6, agents;
|
|
52295
52390
|
var init_agents = __esm(() => {
|
|
52296
|
-
home6 =
|
|
52391
|
+
home6 = homedir23();
|
|
52297
52392
|
agents = {
|
|
52298
52393
|
"claude-code": {
|
|
52299
52394
|
name: "claude-code",
|
|
@@ -52398,8 +52493,8 @@ var init_agents = __esm(() => {
|
|
|
52398
52493
|
|
|
52399
52494
|
// src/commands/skills/skills-registry.ts
|
|
52400
52495
|
import { existsSync as existsSync26 } from "node:fs";
|
|
52401
|
-
import { mkdir as
|
|
52402
|
-
import { homedir as
|
|
52496
|
+
import { mkdir as mkdir9, readFile as readFile21, writeFile as writeFile11 } from "node:fs/promises";
|
|
52497
|
+
import { homedir as homedir24 } from "node:os";
|
|
52403
52498
|
import { dirname as dirname10, join as join32 } from "node:path";
|
|
52404
52499
|
function getCliVersion3() {
|
|
52405
52500
|
try {
|
|
@@ -52435,9 +52530,9 @@ async function readRegistry() {
|
|
|
52435
52530
|
async function writeRegistry(registry) {
|
|
52436
52531
|
const dir = dirname10(REGISTRY_PATH2);
|
|
52437
52532
|
if (!existsSync26(dir)) {
|
|
52438
|
-
await
|
|
52533
|
+
await mkdir9(dir, { recursive: true });
|
|
52439
52534
|
}
|
|
52440
|
-
await
|
|
52535
|
+
await writeFile11(REGISTRY_PATH2, JSON.stringify(registry, null, 2), "utf-8");
|
|
52441
52536
|
}
|
|
52442
52537
|
async function addInstallation(skill, agent, global3, path4, sourcePath) {
|
|
52443
52538
|
const registry = await readRegistry();
|
|
@@ -52492,7 +52587,7 @@ async function syncRegistry() {
|
|
|
52492
52587
|
var home7, REGISTRY_PATH2, SkillInstallationSchema, SkillRegistrySchema;
|
|
52493
52588
|
var init_skills_registry = __esm(() => {
|
|
52494
52589
|
init_zod();
|
|
52495
|
-
home7 =
|
|
52590
|
+
home7 = homedir24();
|
|
52496
52591
|
REGISTRY_PATH2 = join32(home7, ".claudekit", "skill-registry.json");
|
|
52497
52592
|
SkillInstallationSchema = exports_external.object({
|
|
52498
52593
|
skill: exports_external.string(),
|
|
@@ -52511,7 +52606,7 @@ var init_skills_registry = __esm(() => {
|
|
|
52511
52606
|
|
|
52512
52607
|
// src/commands/skills/skills-installer.ts
|
|
52513
52608
|
import { existsSync as existsSync27 } from "node:fs";
|
|
52514
|
-
import { cp as cp2, mkdir as
|
|
52609
|
+
import { cp as cp2, mkdir as mkdir10, stat as stat7 } from "node:fs/promises";
|
|
52515
52610
|
import { dirname as dirname11, resolve as resolve10 } from "node:path";
|
|
52516
52611
|
function isSamePath2(path1, path22) {
|
|
52517
52612
|
try {
|
|
@@ -52556,7 +52651,7 @@ async function installSkillForAgent(skill, agent, options2) {
|
|
|
52556
52651
|
try {
|
|
52557
52652
|
const parentDir = dirname11(targetPath);
|
|
52558
52653
|
if (!existsSync27(parentDir)) {
|
|
52559
|
-
await
|
|
52654
|
+
await mkdir10(parentDir, { recursive: true });
|
|
52560
52655
|
}
|
|
52561
52656
|
if (existsSync27(targetPath)) {
|
|
52562
52657
|
const stats = await stat7(targetPath);
|
|
@@ -52615,7 +52710,7 @@ var init_skills_installer = __esm(() => {
|
|
|
52615
52710
|
|
|
52616
52711
|
// src/commands/skills/skills-uninstaller.ts
|
|
52617
52712
|
import { existsSync as existsSync28 } from "node:fs";
|
|
52618
|
-
import { rm as
|
|
52713
|
+
import { rm as rm7 } from "node:fs/promises";
|
|
52619
52714
|
import { join as join33 } from "node:path";
|
|
52620
52715
|
async function uninstallSkillFromAgent(skill, agent, global3) {
|
|
52621
52716
|
const agentConfig = agents[agent];
|
|
@@ -52637,7 +52732,7 @@ async function uninstallSkillFromAgent(skill, agent, global3) {
|
|
|
52637
52732
|
const fileExists = existsSync28(path4);
|
|
52638
52733
|
try {
|
|
52639
52734
|
if (fileExists) {
|
|
52640
|
-
await
|
|
52735
|
+
await rm7(path4, { recursive: true, force: true });
|
|
52641
52736
|
}
|
|
52642
52737
|
await removeInstallation(skill, agent, global3);
|
|
52643
52738
|
return {
|
|
@@ -52677,7 +52772,7 @@ async function forceUninstallSkill(skill, agent, global3) {
|
|
|
52677
52772
|
};
|
|
52678
52773
|
}
|
|
52679
52774
|
try {
|
|
52680
|
-
await
|
|
52775
|
+
await rm7(path4, { recursive: true, force: true });
|
|
52681
52776
|
await removeInstallation(skill, agent, global3);
|
|
52682
52777
|
return {
|
|
52683
52778
|
skill,
|
|
@@ -53206,7 +53301,7 @@ var init_pnpm_detector = __esm(() => {
|
|
|
53206
53301
|
|
|
53207
53302
|
// src/domains/installation/package-managers/detection-core.ts
|
|
53208
53303
|
import { existsSync as existsSync29, realpathSync } from "node:fs";
|
|
53209
|
-
import { chmod as chmod2, mkdir as
|
|
53304
|
+
import { chmod as chmod2, mkdir as mkdir11, readFile as readFile22, writeFile as writeFile12 } from "node:fs/promises";
|
|
53210
53305
|
import { platform as platform4 } from "node:os";
|
|
53211
53306
|
import { join as join34, sep as sep3 } from "node:path";
|
|
53212
53307
|
function detectFromBinaryPath() {
|
|
@@ -53306,7 +53401,7 @@ async function saveCachedPm(pm, getVersion) {
|
|
|
53306
53401
|
const configDir = PathResolver.getConfigDir(false);
|
|
53307
53402
|
const cacheFile = join34(configDir, CACHE_FILE);
|
|
53308
53403
|
if (!existsSync29(configDir)) {
|
|
53309
|
-
await
|
|
53404
|
+
await mkdir11(configDir, { recursive: true });
|
|
53310
53405
|
if (platform4() !== "win32") {
|
|
53311
53406
|
await chmod2(configDir, 448);
|
|
53312
53407
|
}
|
|
@@ -53317,7 +53412,7 @@ async function saveCachedPm(pm, getVersion) {
|
|
|
53317
53412
|
detectedAt: Date.now(),
|
|
53318
53413
|
version: version ?? undefined
|
|
53319
53414
|
};
|
|
53320
|
-
await
|
|
53415
|
+
await writeFile12(cacheFile, JSON.stringify(data, null, 2), "utf-8");
|
|
53321
53416
|
if (platform4() !== "win32") {
|
|
53322
53417
|
await chmod2(cacheFile, 384);
|
|
53323
53418
|
}
|
|
@@ -53918,7 +54013,7 @@ var package_default;
|
|
|
53918
54013
|
var init_package = __esm(() => {
|
|
53919
54014
|
package_default = {
|
|
53920
54015
|
name: "claudekit-cli",
|
|
53921
|
-
version: "3.35.0-dev.
|
|
54016
|
+
version: "3.35.0-dev.28",
|
|
53922
54017
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
53923
54018
|
type: "module",
|
|
53924
54019
|
repository: {
|
|
@@ -54763,7 +54858,7 @@ var init_error_handler2 = __esm(() => {
|
|
|
54763
54858
|
|
|
54764
54859
|
// src/domains/versioning/release-cache.ts
|
|
54765
54860
|
import { existsSync as existsSync30 } from "node:fs";
|
|
54766
|
-
import { mkdir as
|
|
54861
|
+
import { mkdir as mkdir12, readFile as readFile26, unlink as unlink6, writeFile as writeFile14 } from "node:fs/promises";
|
|
54767
54862
|
import { join as join38 } from "node:path";
|
|
54768
54863
|
var ReleaseCacheEntrySchema, ReleaseCache;
|
|
54769
54864
|
var init_release_cache = __esm(() => {
|
|
@@ -54809,12 +54904,12 @@ var init_release_cache = __esm(() => {
|
|
|
54809
54904
|
async set(key, releases) {
|
|
54810
54905
|
const cacheFile = this.getCachePath(key);
|
|
54811
54906
|
try {
|
|
54812
|
-
await
|
|
54907
|
+
await mkdir12(this.cacheDir, { recursive: true, mode: 448 });
|
|
54813
54908
|
const cacheEntry = {
|
|
54814
54909
|
timestamp: Date.now(),
|
|
54815
54910
|
releases
|
|
54816
54911
|
};
|
|
54817
|
-
await
|
|
54912
|
+
await writeFile14(cacheFile, JSON.stringify(cacheEntry, null, 2), "utf-8");
|
|
54818
54913
|
logger.debug(`Release cache set for key: ${key}, cached ${releases.length} releases`);
|
|
54819
54914
|
} catch (error) {
|
|
54820
54915
|
logger.debug(`Failed to set release cache for key ${key}: ${error}`);
|
|
@@ -55525,7 +55620,7 @@ var init_version_utils = __esm(() => {
|
|
|
55525
55620
|
|
|
55526
55621
|
// src/domains/versioning/version-cache.ts
|
|
55527
55622
|
import { existsSync as existsSync31 } from "node:fs";
|
|
55528
|
-
import { mkdir as
|
|
55623
|
+
import { mkdir as mkdir13, readFile as readFile27, writeFile as writeFile15 } from "node:fs/promises";
|
|
55529
55624
|
import { join as join39 } from "node:path";
|
|
55530
55625
|
var VersionCacheManager;
|
|
55531
55626
|
var init_version_cache = __esm(() => {
|
|
@@ -55563,9 +55658,9 @@ var init_version_cache = __esm(() => {
|
|
|
55563
55658
|
const cacheDir = PathResolver.getCacheDir(false);
|
|
55564
55659
|
try {
|
|
55565
55660
|
if (!existsSync31(cacheDir)) {
|
|
55566
|
-
await
|
|
55661
|
+
await mkdir13(cacheDir, { recursive: true, mode: 448 });
|
|
55567
55662
|
}
|
|
55568
|
-
await
|
|
55663
|
+
await writeFile15(cacheFile, JSON.stringify(cache3, null, 2), "utf-8");
|
|
55569
55664
|
logger.debug(`Version check cache saved to ${cacheFile}`);
|
|
55570
55665
|
} catch (error) {
|
|
55571
55666
|
logger.debug(`Failed to save version check cache: ${error}`);
|
|
@@ -61727,7 +61822,7 @@ var init_skills_installer2 = __esm(() => {
|
|
|
61727
61822
|
|
|
61728
61823
|
// src/services/package-installer/gemini-mcp/config-manager.ts
|
|
61729
61824
|
import { existsSync as existsSync45 } from "node:fs";
|
|
61730
|
-
import { mkdir as
|
|
61825
|
+
import { mkdir as mkdir17, readFile as readFile35, writeFile as writeFile20 } from "node:fs/promises";
|
|
61731
61826
|
import { dirname as dirname15, join as join62 } from "node:path";
|
|
61732
61827
|
async function readJsonFile(filePath) {
|
|
61733
61828
|
try {
|
|
@@ -61758,7 +61853,7 @@ async function addGeminiToGitignore(projectDir) {
|
|
|
61758
61853
|
`) || content === "" ? "" : `
|
|
61759
61854
|
`;
|
|
61760
61855
|
const comment = "# Gemini CLI settings (contains user-specific config)";
|
|
61761
|
-
await
|
|
61856
|
+
await writeFile20(gitignorePath, `${content}${newLine}${comment}
|
|
61762
61857
|
${geminiPattern}
|
|
61763
61858
|
`, "utf-8");
|
|
61764
61859
|
logger.debug(`Added ${geminiPattern} to .gitignore`);
|
|
@@ -61770,7 +61865,7 @@ ${geminiPattern}
|
|
|
61770
61865
|
async function createNewSettingsWithMerge(geminiSettingsPath, mcpConfigPath) {
|
|
61771
61866
|
const linkDir = dirname15(geminiSettingsPath);
|
|
61772
61867
|
if (!existsSync45(linkDir)) {
|
|
61773
|
-
await
|
|
61868
|
+
await mkdir17(linkDir, { recursive: true });
|
|
61774
61869
|
logger.debug(`Created directory: ${linkDir}`);
|
|
61775
61870
|
}
|
|
61776
61871
|
const mcpConfig = await readJsonFile(mcpConfigPath);
|
|
@@ -61783,7 +61878,7 @@ async function createNewSettingsWithMerge(geminiSettingsPath, mcpConfigPath) {
|
|
|
61783
61878
|
}
|
|
61784
61879
|
const newSettings = { mcpServers };
|
|
61785
61880
|
try {
|
|
61786
|
-
await
|
|
61881
|
+
await writeFile20(geminiSettingsPath, JSON.stringify(newSettings, null, 2), "utf-8");
|
|
61787
61882
|
logger.debug(`Created new Gemini settings with mcpServers: ${geminiSettingsPath}`);
|
|
61788
61883
|
return { success: true, method: "merge", targetPath: mcpConfigPath };
|
|
61789
61884
|
} catch (error) {
|
|
@@ -61813,7 +61908,7 @@ async function mergeGeminiSettings(geminiSettingsPath, mcpConfigPath) {
|
|
|
61813
61908
|
mcpServers
|
|
61814
61909
|
};
|
|
61815
61910
|
try {
|
|
61816
|
-
await
|
|
61911
|
+
await writeFile20(geminiSettingsPath, JSON.stringify(mergedSettings, null, 2), "utf-8");
|
|
61817
61912
|
logger.debug(`Merged mcpServers into: ${geminiSettingsPath}`);
|
|
61818
61913
|
return { success: true, method: "merge", targetPath: mcpConfigPath };
|
|
61819
61914
|
} catch (error) {
|
|
@@ -61831,10 +61926,10 @@ var init_config_manager2 = __esm(() => {
|
|
|
61831
61926
|
|
|
61832
61927
|
// src/services/package-installer/gemini-mcp/validation.ts
|
|
61833
61928
|
import { existsSync as existsSync46, lstatSync, readlinkSync } from "node:fs";
|
|
61834
|
-
import { homedir as
|
|
61929
|
+
import { homedir as homedir27 } from "node:os";
|
|
61835
61930
|
import { join as join63 } from "node:path";
|
|
61836
61931
|
function getGlobalMcpConfigPath() {
|
|
61837
|
-
return join63(
|
|
61932
|
+
return join63(homedir27(), ".claude", ".mcp.json");
|
|
61838
61933
|
}
|
|
61839
61934
|
function getLocalMcpConfigPath(projectDir) {
|
|
61840
61935
|
return join63(projectDir, ".mcp.json");
|
|
@@ -61855,7 +61950,7 @@ function findMcpConfigPath(projectDir) {
|
|
|
61855
61950
|
}
|
|
61856
61951
|
function getGeminiSettingsPath(projectDir, isGlobal) {
|
|
61857
61952
|
if (isGlobal) {
|
|
61858
|
-
return join63(
|
|
61953
|
+
return join63(homedir27(), ".gemini", "settings.json");
|
|
61859
61954
|
}
|
|
61860
61955
|
return join63(projectDir, ".gemini", "settings.json");
|
|
61861
61956
|
}
|
|
@@ -61886,12 +61981,12 @@ var init_validation = __esm(() => {
|
|
|
61886
61981
|
|
|
61887
61982
|
// src/services/package-installer/gemini-mcp/linker-core.ts
|
|
61888
61983
|
import { existsSync as existsSync47 } from "node:fs";
|
|
61889
|
-
import { mkdir as
|
|
61984
|
+
import { mkdir as mkdir18, symlink as symlink2 } from "node:fs/promises";
|
|
61890
61985
|
import { dirname as dirname16, join as join64 } from "node:path";
|
|
61891
61986
|
async function createSymlink(targetPath, linkPath, projectDir, isGlobal) {
|
|
61892
61987
|
const linkDir = dirname16(linkPath);
|
|
61893
61988
|
if (!existsSync47(linkDir)) {
|
|
61894
|
-
await
|
|
61989
|
+
await mkdir18(linkDir, { recursive: true });
|
|
61895
61990
|
logger.debug(`Created directory: ${linkDir}`);
|
|
61896
61991
|
}
|
|
61897
61992
|
let symlinkTarget;
|
|
@@ -68962,7 +69057,7 @@ function checkComponentCounts(setup) {
|
|
|
68962
69057
|
// src/domains/health-checks/checkers/permissions-checker.ts
|
|
68963
69058
|
init_logger();
|
|
68964
69059
|
init_path_resolver();
|
|
68965
|
-
import { constants as constants2, access as access2, unlink as unlink7, writeFile as
|
|
69060
|
+
import { constants as constants2, access as access2, unlink as unlink7, writeFile as writeFile16 } from "node:fs/promises";
|
|
68966
69061
|
import { join as join45 } from "node:path";
|
|
68967
69062
|
|
|
68968
69063
|
// src/domains/health-checks/checkers/shared.ts
|
|
@@ -69031,7 +69126,7 @@ async function checkGlobalDirWritable() {
|
|
|
69031
69126
|
const random = Math.random().toString(36).substring(2);
|
|
69032
69127
|
const testFile = join45(globalDir, `.ck-write-test-${timestamp}-${random}`);
|
|
69033
69128
|
try {
|
|
69034
|
-
await
|
|
69129
|
+
await writeFile16(testFile, "test", { encoding: "utf-8", flag: "wx" });
|
|
69035
69130
|
} catch (error) {
|
|
69036
69131
|
return {
|
|
69037
69132
|
id: "ck-global-dir-writable",
|
|
@@ -69204,7 +69299,7 @@ init_logger();
|
|
|
69204
69299
|
init_path_resolver();
|
|
69205
69300
|
import { existsSync as existsSync40 } from "node:fs";
|
|
69206
69301
|
import { readFile as readFile30 } from "node:fs/promises";
|
|
69207
|
-
import { homedir as
|
|
69302
|
+
import { homedir as homedir25 } from "node:os";
|
|
69208
69303
|
import { dirname as dirname13, join as join48, normalize as normalize5, resolve as resolve11 } from "node:path";
|
|
69209
69304
|
async function checkPathRefsValid(projectDir) {
|
|
69210
69305
|
const globalClaudeMd = join48(PathResolver.getGlobalKitDir(), "CLAUDE.md");
|
|
@@ -69237,7 +69332,7 @@ async function checkPathRefsValid(projectDir) {
|
|
|
69237
69332
|
};
|
|
69238
69333
|
}
|
|
69239
69334
|
const baseDir = dirname13(claudeMdPath);
|
|
69240
|
-
const home8 =
|
|
69335
|
+
const home8 = homedir25();
|
|
69241
69336
|
const broken = [];
|
|
69242
69337
|
for (const ref of refs) {
|
|
69243
69338
|
let refPath;
|
|
@@ -70865,8 +70960,8 @@ import { platform as platform6 } from "node:os";
|
|
|
70865
70960
|
// src/domains/health-checks/platform/environment-checker.ts
|
|
70866
70961
|
init_environment();
|
|
70867
70962
|
init_path_resolver();
|
|
70868
|
-
import { constants as constants3, access as access3, mkdir as
|
|
70869
|
-
import { arch as arch2, homedir as
|
|
70963
|
+
import { constants as constants3, access as access3, mkdir as mkdir14, readFile as readFile32, unlink as unlink8, writeFile as writeFile17 } from "node:fs/promises";
|
|
70964
|
+
import { arch as arch2, homedir as homedir26, platform as platform5 } from "node:os";
|
|
70870
70965
|
import { join as join54, normalize as normalize6 } from "node:path";
|
|
70871
70966
|
function shouldSkipExpensiveOperations4() {
|
|
70872
70967
|
return shouldSkipExpensiveOperations();
|
|
@@ -70889,7 +70984,7 @@ async function checkPlatformDetect() {
|
|
|
70889
70984
|
};
|
|
70890
70985
|
}
|
|
70891
70986
|
async function checkHomeDirResolution() {
|
|
70892
|
-
const nodeHome = normalize6(
|
|
70987
|
+
const nodeHome = normalize6(homedir26());
|
|
70893
70988
|
const rawEnvHome = getHomeDirectoryFromEnv(platform5());
|
|
70894
70989
|
const envHome = rawEnvHome ? normalize6(rawEnvHome) : "";
|
|
70895
70990
|
const match = nodeHome === envHome && envHome !== "";
|
|
@@ -70960,8 +71055,8 @@ async function checkGlobalDirAccess() {
|
|
|
70960
71055
|
}
|
|
70961
71056
|
const testFile = join54(globalDir, ".ck-doctor-access-test");
|
|
70962
71057
|
try {
|
|
70963
|
-
await
|
|
70964
|
-
await
|
|
71058
|
+
await mkdir14(globalDir, { recursive: true });
|
|
71059
|
+
await writeFile17(testFile, "test", "utf-8");
|
|
70965
71060
|
const content = await readFile32(testFile, "utf-8");
|
|
70966
71061
|
await unlink8(testFile);
|
|
70967
71062
|
if (content !== "test")
|
|
@@ -71035,7 +71130,7 @@ async function checkWSLBoundary() {
|
|
|
71035
71130
|
|
|
71036
71131
|
// src/domains/health-checks/platform/windows-checker.ts
|
|
71037
71132
|
init_path_resolver();
|
|
71038
|
-
import { mkdir as
|
|
71133
|
+
import { mkdir as mkdir15, symlink, unlink as unlink9, writeFile as writeFile18 } from "node:fs/promises";
|
|
71039
71134
|
import { join as join55 } from "node:path";
|
|
71040
71135
|
async function checkLongPathSupport() {
|
|
71041
71136
|
if (shouldSkipExpensiveOperations4()) {
|
|
@@ -71091,8 +71186,8 @@ async function checkSymlinkSupport() {
|
|
|
71091
71186
|
const target = join55(testDir, ".ck-symlink-test-target");
|
|
71092
71187
|
const link = join55(testDir, ".ck-symlink-test-link");
|
|
71093
71188
|
try {
|
|
71094
|
-
await
|
|
71095
|
-
await
|
|
71189
|
+
await mkdir15(testDir, { recursive: true });
|
|
71190
|
+
await writeFile18(target, "test", "utf-8");
|
|
71096
71191
|
await symlink(target, link);
|
|
71097
71192
|
await unlink9(link);
|
|
71098
71193
|
await unlink9(target);
|
|
@@ -71855,7 +71950,7 @@ init_claudekit_constants();
|
|
|
71855
71950
|
init_logger();
|
|
71856
71951
|
init_path_resolver();
|
|
71857
71952
|
var import_compare_versions6 = __toESM(require_umd(), 1);
|
|
71858
|
-
import { mkdir as
|
|
71953
|
+
import { mkdir as mkdir16, readFile as readFile33, unlink as unlink10, writeFile as writeFile19 } from "node:fs/promises";
|
|
71859
71954
|
import { join as join57 } from "node:path";
|
|
71860
71955
|
var CACHE_TTL_HOURS = 24;
|
|
71861
71956
|
var DEFAULT_CACHE_TTL_MS = CACHE_TTL_HOURS * 60 * 60 * 1000;
|
|
@@ -71913,8 +72008,8 @@ class ConfigVersionChecker {
|
|
|
71913
72008
|
try {
|
|
71914
72009
|
const cachePath = ConfigVersionChecker.getCacheFilePath(kitType, global3);
|
|
71915
72010
|
const cacheDir = PathResolver.getCacheDir(global3);
|
|
71916
|
-
await
|
|
71917
|
-
await
|
|
72011
|
+
await mkdir16(cacheDir, { recursive: true });
|
|
72012
|
+
await writeFile19(cachePath, JSON.stringify(cache3, null, 2));
|
|
71918
72013
|
} catch (error) {
|
|
71919
72014
|
logger.debug(`Cache write failed: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
71920
72015
|
}
|
|
@@ -74648,7 +74743,7 @@ init_logger();
|
|
|
74648
74743
|
// src/shared/process-lock.ts
|
|
74649
74744
|
init_logger();
|
|
74650
74745
|
var import_proper_lockfile4 = __toESM(require_proper_lockfile(), 1);
|
|
74651
|
-
import { mkdir as
|
|
74746
|
+
import { mkdir as mkdir19 } from "node:fs/promises";
|
|
74652
74747
|
import os5 from "node:os";
|
|
74653
74748
|
import { join as join65 } from "node:path";
|
|
74654
74749
|
var LOCK_CONFIG = {
|
|
@@ -74681,7 +74776,7 @@ function registerCleanupHandlers() {
|
|
|
74681
74776
|
}
|
|
74682
74777
|
async function ensureLocksDir() {
|
|
74683
74778
|
const lockDir = getLocksDir();
|
|
74684
|
-
await
|
|
74779
|
+
await mkdir19(lockDir, { recursive: true });
|
|
74685
74780
|
}
|
|
74686
74781
|
async function withProcessLock(lockName, fn) {
|
|
74687
74782
|
registerCleanupHandlers();
|
|
@@ -74836,7 +74931,7 @@ init_github_client();
|
|
|
74836
74931
|
init_environment();
|
|
74837
74932
|
init_logger();
|
|
74838
74933
|
init_safe_spinner();
|
|
74839
|
-
import { mkdir as
|
|
74934
|
+
import { mkdir as mkdir25, stat as stat12 } from "node:fs/promises";
|
|
74840
74935
|
import { tmpdir as tmpdir4 } from "node:os";
|
|
74841
74936
|
import { join as join73 } from "node:path";
|
|
74842
74937
|
|
|
@@ -74856,7 +74951,7 @@ var import_ignore = __toESM(require_ignore(), 1);
|
|
|
74856
74951
|
init_logger();
|
|
74857
74952
|
init_output_manager();
|
|
74858
74953
|
import { createWriteStream as createWriteStream2, rmSync } from "node:fs";
|
|
74859
|
-
import { mkdir as
|
|
74954
|
+
import { mkdir as mkdir20 } from "node:fs/promises";
|
|
74860
74955
|
import { join as join67 } from "node:path";
|
|
74861
74956
|
|
|
74862
74957
|
// src/shared/progress-bar.ts
|
|
@@ -75068,7 +75163,7 @@ class FileDownloader {
|
|
|
75068
75163
|
async downloadAsset(asset, destDir) {
|
|
75069
75164
|
try {
|
|
75070
75165
|
const destPath = join67(destDir, asset.name);
|
|
75071
|
-
await
|
|
75166
|
+
await mkdir20(destDir, { recursive: true });
|
|
75072
75167
|
output.info(`Downloading ${asset.name} (${formatBytes(asset.size)})...`);
|
|
75073
75168
|
logger.verbose("Download details", {
|
|
75074
75169
|
url: asset.browser_download_url,
|
|
@@ -75153,7 +75248,7 @@ class FileDownloader {
|
|
|
75153
75248
|
async downloadFile(params) {
|
|
75154
75249
|
const { url, name, size, destDir, token } = params;
|
|
75155
75250
|
const destPath = join67(destDir, name);
|
|
75156
|
-
await
|
|
75251
|
+
await mkdir20(destDir, { recursive: true });
|
|
75157
75252
|
output.info(`Downloading ${name}${size ? ` (${formatBytes(size)})` : ""}...`);
|
|
75158
75253
|
const headers = {};
|
|
75159
75254
|
if (token && url.includes("api.github.com")) {
|
|
@@ -75271,7 +75366,7 @@ async function validateExtraction(extractDir) {
|
|
|
75271
75366
|
|
|
75272
75367
|
// src/domains/installation/extraction/tar-extractor.ts
|
|
75273
75368
|
init_logger();
|
|
75274
|
-
import { copyFile as
|
|
75369
|
+
import { copyFile as copyFile4, mkdir as mkdir23, readdir as readdir15, rm as rm8, stat as stat10 } from "node:fs/promises";
|
|
75275
75370
|
import { join as join71 } from "node:path";
|
|
75276
75371
|
|
|
75277
75372
|
// node_modules/@isaacs/fs-minipass/dist/esm/index.js
|
|
@@ -80901,7 +80996,7 @@ var checkCwd = (dir, cb) => {
|
|
|
80901
80996
|
cb(er);
|
|
80902
80997
|
});
|
|
80903
80998
|
};
|
|
80904
|
-
var
|
|
80999
|
+
var mkdir21 = (dir, opt, cb) => {
|
|
80905
81000
|
dir = normalizeWindowsPath(dir);
|
|
80906
81001
|
const umask = opt.umask ?? 18;
|
|
80907
81002
|
const mode = opt.mode | 448;
|
|
@@ -81424,7 +81519,7 @@ class Unpack extends Parser {
|
|
|
81424
81519
|
}
|
|
81425
81520
|
}
|
|
81426
81521
|
[MKDIR](dir, mode, cb) {
|
|
81427
|
-
|
|
81522
|
+
mkdir21(normalizeWindowsPath(dir), {
|
|
81428
81523
|
uid: this.uid,
|
|
81429
81524
|
gid: this.gid,
|
|
81430
81525
|
processUid: this.processUid,
|
|
@@ -82140,7 +82235,7 @@ function decodeFilePath(path12) {
|
|
|
82140
82235
|
// src/domains/installation/utils/file-utils.ts
|
|
82141
82236
|
init_logger();
|
|
82142
82237
|
init_types3();
|
|
82143
|
-
import { copyFile as
|
|
82238
|
+
import { copyFile as copyFile3, lstat as lstat4, mkdir as mkdir22, readdir as readdir14 } from "node:fs/promises";
|
|
82144
82239
|
import { join as join70, relative as relative9 } from "node:path";
|
|
82145
82240
|
async function withRetry(fn, retries = 3) {
|
|
82146
82241
|
for (let i = 0;i < retries; i++) {
|
|
@@ -82160,7 +82255,7 @@ var isRetryable = (e2) => {
|
|
|
82160
82255
|
};
|
|
82161
82256
|
var delay = (ms) => new Promise((r2) => setTimeout(r2, ms));
|
|
82162
82257
|
async function moveDirectoryContents(sourceDir, destDir, shouldExclude, sizeTracker) {
|
|
82163
|
-
await
|
|
82258
|
+
await mkdir22(destDir, { recursive: true });
|
|
82164
82259
|
const entries = await readdir14(sourceDir, { encoding: "utf8" });
|
|
82165
82260
|
for (const entry of entries) {
|
|
82166
82261
|
const sourcePath = join70(sourceDir, entry);
|
|
@@ -82181,14 +82276,14 @@ async function moveDirectoryContents(sourceDir, destDir, shouldExclude, sizeTrac
|
|
|
82181
82276
|
if (sizeTracker) {
|
|
82182
82277
|
sizeTracker.checkExtractionSize(entryStat.size);
|
|
82183
82278
|
}
|
|
82184
|
-
await withRetry(() =>
|
|
82279
|
+
await withRetry(() => copyFile3(sourcePath, destPath));
|
|
82185
82280
|
} else {
|
|
82186
82281
|
throw new ExtractionError(`Not a regular file: ${relativePath}`);
|
|
82187
82282
|
}
|
|
82188
82283
|
}
|
|
82189
82284
|
}
|
|
82190
82285
|
async function copyDirectory(sourceDir, destDir, shouldExclude, sizeTracker) {
|
|
82191
|
-
await
|
|
82286
|
+
await mkdir22(destDir, { recursive: true });
|
|
82192
82287
|
const entries = await readdir14(sourceDir, { encoding: "utf8" });
|
|
82193
82288
|
for (const entry of entries) {
|
|
82194
82289
|
const sourcePath = join70(sourceDir, entry);
|
|
@@ -82209,7 +82304,7 @@ async function copyDirectory(sourceDir, destDir, shouldExclude, sizeTracker) {
|
|
|
82209
82304
|
if (sizeTracker) {
|
|
82210
82305
|
sizeTracker.checkExtractionSize(entryStat.size);
|
|
82211
82306
|
}
|
|
82212
|
-
await withRetry(() =>
|
|
82307
|
+
await withRetry(() => copyFile3(sourcePath, destPath));
|
|
82213
82308
|
} else {
|
|
82214
82309
|
throw new ExtractionError(`Not a regular file: ${relativePath}`);
|
|
82215
82310
|
}
|
|
@@ -82220,7 +82315,7 @@ async function copyDirectory(sourceDir, destDir, shouldExclude, sizeTracker) {
|
|
|
82220
82315
|
class TarExtractor {
|
|
82221
82316
|
async extract(archivePath, destDir, shouldExclude, sizeTracker) {
|
|
82222
82317
|
const tempExtractDir = `${destDir}-temp`;
|
|
82223
|
-
await
|
|
82318
|
+
await mkdir23(tempExtractDir, { recursive: true });
|
|
82224
82319
|
try {
|
|
82225
82320
|
await extract({
|
|
82226
82321
|
file: archivePath,
|
|
@@ -82255,18 +82350,18 @@ class TarExtractor {
|
|
|
82255
82350
|
await moveDirectoryContents(tempExtractDir, destDir, shouldExclude, sizeTracker);
|
|
82256
82351
|
}
|
|
82257
82352
|
} else {
|
|
82258
|
-
await
|
|
82259
|
-
await
|
|
82353
|
+
await mkdir23(destDir, { recursive: true });
|
|
82354
|
+
await copyFile4(rootPath, join71(destDir, rootEntry));
|
|
82260
82355
|
}
|
|
82261
82356
|
} else {
|
|
82262
82357
|
logger.debug("Multiple root entries - moving all");
|
|
82263
82358
|
await moveDirectoryContents(tempExtractDir, destDir, shouldExclude, sizeTracker);
|
|
82264
82359
|
}
|
|
82265
82360
|
logger.debug(`Moved contents to: ${destDir}`);
|
|
82266
|
-
await
|
|
82361
|
+
await rm8(tempExtractDir, { recursive: true, force: true });
|
|
82267
82362
|
} catch (error) {
|
|
82268
82363
|
try {
|
|
82269
|
-
await
|
|
82364
|
+
await rm8(tempExtractDir, { recursive: true, force: true });
|
|
82270
82365
|
} catch {}
|
|
82271
82366
|
throw error;
|
|
82272
82367
|
}
|
|
@@ -82278,7 +82373,7 @@ init_environment();
|
|
|
82278
82373
|
init_logger();
|
|
82279
82374
|
var import_extract_zip = __toESM(require_extract_zip(), 1);
|
|
82280
82375
|
import { execFile as execFile8 } from "node:child_process";
|
|
82281
|
-
import { copyFile as
|
|
82376
|
+
import { copyFile as copyFile5, mkdir as mkdir24, readdir as readdir16, rm as rm9, stat as stat11 } from "node:fs/promises";
|
|
82282
82377
|
import { join as join72 } from "node:path";
|
|
82283
82378
|
class ZipExtractor {
|
|
82284
82379
|
async tryNativeUnzip(archivePath, destDir) {
|
|
@@ -82286,7 +82381,7 @@ class ZipExtractor {
|
|
|
82286
82381
|
return false;
|
|
82287
82382
|
}
|
|
82288
82383
|
return new Promise((resolve16) => {
|
|
82289
|
-
|
|
82384
|
+
mkdir24(destDir, { recursive: true }).then(() => {
|
|
82290
82385
|
execFile8("unzip", ["-o", "-q", archivePath, "-d", destDir], (error, _stdout, stderr) => {
|
|
82291
82386
|
if (error) {
|
|
82292
82387
|
logger.debug(`Native unzip failed: ${stderr || error.message}`);
|
|
@@ -82304,7 +82399,7 @@ class ZipExtractor {
|
|
|
82304
82399
|
}
|
|
82305
82400
|
async extract(archivePath, destDir, shouldExclude, sizeTracker) {
|
|
82306
82401
|
const tempExtractDir = `${destDir}-temp`;
|
|
82307
|
-
await
|
|
82402
|
+
await mkdir24(tempExtractDir, { recursive: true });
|
|
82308
82403
|
try {
|
|
82309
82404
|
const nativeSuccess = await this.tryNativeUnzip(archivePath, tempExtractDir);
|
|
82310
82405
|
if (!nativeSuccess) {
|
|
@@ -82342,18 +82437,18 @@ class ZipExtractor {
|
|
|
82342
82437
|
await moveDirectoryContents(tempExtractDir, destDir, shouldExclude, sizeTracker);
|
|
82343
82438
|
}
|
|
82344
82439
|
} else {
|
|
82345
|
-
await
|
|
82346
|
-
await
|
|
82440
|
+
await mkdir24(destDir, { recursive: true });
|
|
82441
|
+
await copyFile5(rootPath, join72(destDir, rootEntry));
|
|
82347
82442
|
}
|
|
82348
82443
|
} else {
|
|
82349
82444
|
logger.debug("Multiple root entries - moving all");
|
|
82350
82445
|
await moveDirectoryContents(tempExtractDir, destDir, shouldExclude, sizeTracker);
|
|
82351
82446
|
}
|
|
82352
82447
|
logger.debug(`Moved contents to: ${destDir}`);
|
|
82353
|
-
await
|
|
82448
|
+
await rm9(tempExtractDir, { recursive: true, force: true });
|
|
82354
82449
|
} catch (error) {
|
|
82355
82450
|
try {
|
|
82356
|
-
await
|
|
82451
|
+
await rm9(tempExtractDir, { recursive: true, force: true });
|
|
82357
82452
|
} catch {}
|
|
82358
82453
|
throw error;
|
|
82359
82454
|
}
|
|
@@ -82417,7 +82512,7 @@ class DownloadManager {
|
|
|
82417
82512
|
try {
|
|
82418
82513
|
this.sizeTracker.reset();
|
|
82419
82514
|
const detectedType = archiveType || detectArchiveType(archivePath);
|
|
82420
|
-
await
|
|
82515
|
+
await mkdir25(destDir, { recursive: true });
|
|
82421
82516
|
if (detectedType === "tar.gz") {
|
|
82422
82517
|
await this.tarExtractor.extract(archivePath, destDir, this.shouldExclude, this.sizeTracker);
|
|
82423
82518
|
} else if (detectedType === "zip") {
|
|
@@ -82444,7 +82539,7 @@ class DownloadManager {
|
|
|
82444
82539
|
const counter = DownloadManager.tempDirCounter++;
|
|
82445
82540
|
const primaryTempDir = join73(tmpdir4(), `claudekit-${timestamp}-${counter}`);
|
|
82446
82541
|
try {
|
|
82447
|
-
await
|
|
82542
|
+
await mkdir25(primaryTempDir, { recursive: true });
|
|
82448
82543
|
logger.debug(`Created temp directory: ${primaryTempDir}`);
|
|
82449
82544
|
registerTempDir(primaryTempDir);
|
|
82450
82545
|
return primaryTempDir;
|
|
@@ -82461,7 +82556,7 @@ Solutions:
|
|
|
82461
82556
|
}
|
|
82462
82557
|
const fallbackTempDir = join73(homeDir, ".claudekit", "tmp", `claudekit-${timestamp}-${counter}`);
|
|
82463
82558
|
try {
|
|
82464
|
-
await
|
|
82559
|
+
await mkdir25(fallbackTempDir, { recursive: true });
|
|
82465
82560
|
logger.debug(`Created temp directory (fallback): ${fallbackTempDir}`);
|
|
82466
82561
|
logger.warning(`Using fallback temp directory: ${fallbackTempDir}
|
|
82467
82562
|
(OS temp directory was not accessible)`);
|
|
@@ -84836,7 +84931,7 @@ import { execSync as execSync4 } from "node:child_process";
|
|
|
84836
84931
|
// src/domains/config/installed-settings-tracker.ts
|
|
84837
84932
|
init_shared();
|
|
84838
84933
|
import { existsSync as existsSync49 } from "node:fs";
|
|
84839
|
-
import { mkdir as
|
|
84934
|
+
import { mkdir as mkdir26, readFile as readFile38, writeFile as writeFile22 } from "node:fs/promises";
|
|
84840
84935
|
import { dirname as dirname19, join as join78 } from "node:path";
|
|
84841
84936
|
var CK_JSON_FILE = ".ck.json";
|
|
84842
84937
|
|
|
@@ -84888,8 +84983,8 @@ class InstalledSettingsTracker {
|
|
|
84888
84983
|
data.kits[this.kitName] = {};
|
|
84889
84984
|
}
|
|
84890
84985
|
data.kits[this.kitName].installedSettings = settings;
|
|
84891
|
-
await
|
|
84892
|
-
await
|
|
84986
|
+
await mkdir26(dirname19(ckJsonPath), { recursive: true });
|
|
84987
|
+
await writeFile22(ckJsonPath, JSON.stringify(data, null, 2), "utf-8");
|
|
84893
84988
|
logger.debug(`Saved installed settings to ${ckJsonPath}`);
|
|
84894
84989
|
} catch (error) {
|
|
84895
84990
|
logger.warning(`Failed to save installed settings: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
@@ -86263,12 +86358,12 @@ class FileScanner2 {
|
|
|
86263
86358
|
// src/services/transformers/commands-prefix/prefix-applier.ts
|
|
86264
86359
|
init_logger();
|
|
86265
86360
|
var import_fs_extra17 = __toESM(require_lib3(), 1);
|
|
86266
|
-
import { lstat as lstat7, mkdir as
|
|
86361
|
+
import { lstat as lstat7, mkdir as mkdir27, readdir as readdir21, stat as stat15 } from "node:fs/promises";
|
|
86267
86362
|
import { join as join86 } from "node:path";
|
|
86268
86363
|
|
|
86269
86364
|
// src/services/transformers/commands-prefix/content-transformer.ts
|
|
86270
86365
|
init_logger();
|
|
86271
|
-
import { readFile as readFile42, readdir as readdir20, writeFile as
|
|
86366
|
+
import { readFile as readFile42, readdir as readdir20, writeFile as writeFile26 } from "node:fs/promises";
|
|
86272
86367
|
import { join as join85 } from "node:path";
|
|
86273
86368
|
var TRANSFORMABLE_EXTENSIONS = new Set([
|
|
86274
86369
|
".md",
|
|
@@ -86344,7 +86439,7 @@ async function transformCommandReferences(directory, options2 = {}) {
|
|
|
86344
86439
|
if (options2.dryRun) {
|
|
86345
86440
|
logger.debug(`[dry-run] Would transform ${changes} command ref(s) in ${fullPath}`);
|
|
86346
86441
|
} else {
|
|
86347
|
-
await
|
|
86442
|
+
await writeFile26(fullPath, transformed, "utf-8");
|
|
86348
86443
|
if (options2.verbose) {
|
|
86349
86444
|
logger.verbose(`Transformed ${changes} command ref(s) in ${fullPath}`);
|
|
86350
86445
|
}
|
|
@@ -86429,9 +86524,9 @@ async function applyPrefix(extractDir) {
|
|
|
86429
86524
|
}
|
|
86430
86525
|
await import_fs_extra17.copy(commandsDir, backupDir);
|
|
86431
86526
|
logger.verbose("Created backup of commands directory");
|
|
86432
|
-
await
|
|
86527
|
+
await mkdir27(tempDir, { recursive: true });
|
|
86433
86528
|
const ckDir = join86(tempDir, "ck");
|
|
86434
|
-
await
|
|
86529
|
+
await mkdir27(ckDir, { recursive: true });
|
|
86435
86530
|
let processedCount = 0;
|
|
86436
86531
|
for (const entry of entries) {
|
|
86437
86532
|
const sourcePath = join86(commandsDir, entry);
|
|
@@ -86869,7 +86964,7 @@ init_skip_directories();
|
|
|
86869
86964
|
init_types3();
|
|
86870
86965
|
var import_fs_extra21 = __toESM(require_lib3(), 1);
|
|
86871
86966
|
import { createHash as createHash4 } from "node:crypto";
|
|
86872
|
-
import { readFile as readFile44, readdir as readdir24, writeFile as
|
|
86967
|
+
import { readFile as readFile44, readdir as readdir24, writeFile as writeFile27 } from "node:fs/promises";
|
|
86873
86968
|
import { join as join90, relative as relative15 } from "node:path";
|
|
86874
86969
|
|
|
86875
86970
|
class SkillsManifestManager {
|
|
@@ -86893,7 +86988,7 @@ class SkillsManifestManager {
|
|
|
86893
86988
|
}
|
|
86894
86989
|
static async writeManifest(skillsDir2, manifest) {
|
|
86895
86990
|
const manifestPath = join90(skillsDir2, SkillsManifestManager.MANIFEST_FILENAME);
|
|
86896
|
-
await
|
|
86991
|
+
await writeFile27(manifestPath, JSON.stringify(manifest, null, 2), "utf-8");
|
|
86897
86992
|
logger.debug(`Wrote manifest to: ${manifestPath}`);
|
|
86898
86993
|
}
|
|
86899
86994
|
static async readManifest(skillsDir2) {
|
|
@@ -87286,7 +87381,7 @@ import { join as join96 } from "node:path";
|
|
|
87286
87381
|
|
|
87287
87382
|
// src/domains/skills/migrator/migration-executor.ts
|
|
87288
87383
|
init_logger();
|
|
87289
|
-
import { copyFile as
|
|
87384
|
+
import { copyFile as copyFile6, mkdir as mkdir28, readdir as readdir26, rm as rm10 } from "node:fs/promises";
|
|
87290
87385
|
import { join as join92 } from "node:path";
|
|
87291
87386
|
var import_fs_extra24 = __toESM(require_lib3(), 1);
|
|
87292
87387
|
|
|
@@ -87449,7 +87544,7 @@ Detected changes:`;
|
|
|
87449
87544
|
|
|
87450
87545
|
// src/domains/skills/migrator/migration-executor.ts
|
|
87451
87546
|
async function copySkillDirectory(sourceDir, destDir) {
|
|
87452
|
-
await
|
|
87547
|
+
await mkdir28(destDir, { recursive: true });
|
|
87453
87548
|
const entries = await readdir26(sourceDir, { withFileTypes: true });
|
|
87454
87549
|
for (const entry of entries) {
|
|
87455
87550
|
const sourcePath = join92(sourceDir, entry.name);
|
|
@@ -87460,7 +87555,7 @@ async function copySkillDirectory(sourceDir, destDir) {
|
|
|
87460
87555
|
if (entry.isDirectory()) {
|
|
87461
87556
|
await copySkillDirectory(sourcePath, destPath);
|
|
87462
87557
|
} else if (entry.isFile()) {
|
|
87463
|
-
await
|
|
87558
|
+
await copyFile6(sourcePath, destPath);
|
|
87464
87559
|
}
|
|
87465
87560
|
}
|
|
87466
87561
|
}
|
|
@@ -87469,7 +87564,7 @@ async function executeInternal(mappings, customizations, currentSkillsDir, inter
|
|
|
87469
87564
|
const preserved = [];
|
|
87470
87565
|
const errors2 = [];
|
|
87471
87566
|
const tempDir = join92(currentSkillsDir, "..", ".skills-migration-temp");
|
|
87472
|
-
await
|
|
87567
|
+
await mkdir28(tempDir, { recursive: true });
|
|
87473
87568
|
try {
|
|
87474
87569
|
for (const mapping of mappings) {
|
|
87475
87570
|
try {
|
|
@@ -87491,7 +87586,7 @@ async function executeInternal(mappings, customizations, currentSkillsDir, inter
|
|
|
87491
87586
|
const category = mapping.category;
|
|
87492
87587
|
const targetPath = category ? join92(tempDir, category, skillName) : join92(tempDir, skillName);
|
|
87493
87588
|
if (category) {
|
|
87494
|
-
await
|
|
87589
|
+
await mkdir28(join92(tempDir, category), { recursive: true });
|
|
87495
87590
|
}
|
|
87496
87591
|
await copySkillDirectory(currentSkillPath, targetPath);
|
|
87497
87592
|
migrated.push(skillName);
|
|
@@ -87509,14 +87604,14 @@ async function executeInternal(mappings, customizations, currentSkillsDir, inter
|
|
|
87509
87604
|
logger.error(`Failed to migrate ${mapping.skillName}: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
87510
87605
|
}
|
|
87511
87606
|
}
|
|
87512
|
-
await
|
|
87513
|
-
await
|
|
87607
|
+
await rm10(currentSkillsDir, { recursive: true, force: true });
|
|
87608
|
+
await mkdir28(currentSkillsDir, { recursive: true });
|
|
87514
87609
|
await copySkillDirectory(tempDir, currentSkillsDir);
|
|
87515
|
-
await
|
|
87610
|
+
await rm10(tempDir, { recursive: true, force: true });
|
|
87516
87611
|
return { migrated, preserved, errors: errors2 };
|
|
87517
87612
|
} catch (error) {
|
|
87518
87613
|
try {
|
|
87519
|
-
await
|
|
87614
|
+
await rm10(tempDir, { recursive: true, force: true });
|
|
87520
87615
|
} catch {}
|
|
87521
87616
|
throw error;
|
|
87522
87617
|
}
|
|
@@ -87557,7 +87652,7 @@ function validateMigrationPath(path14, paramName) {
|
|
|
87557
87652
|
init_logger();
|
|
87558
87653
|
init_types3();
|
|
87559
87654
|
var import_fs_extra25 = __toESM(require_lib3(), 1);
|
|
87560
|
-
import { copyFile as
|
|
87655
|
+
import { copyFile as copyFile7, mkdir as mkdir29, readdir as readdir27, rm as rm11, stat as stat16 } from "node:fs/promises";
|
|
87561
87656
|
import { basename as basename10, join as join93, normalize as normalize8 } from "node:path";
|
|
87562
87657
|
function validatePath2(path14, paramName) {
|
|
87563
87658
|
if (!path14 || typeof path14 !== "string") {
|
|
@@ -87587,13 +87682,13 @@ class SkillsBackupManager {
|
|
|
87587
87682
|
const backupDir = parentDir ? join93(parentDir, backupDirName) : join93(skillsDir2, "..", backupDirName);
|
|
87588
87683
|
logger.info(`Creating backup at: ${backupDir}`);
|
|
87589
87684
|
try {
|
|
87590
|
-
await
|
|
87685
|
+
await mkdir29(backupDir, { recursive: true });
|
|
87591
87686
|
await SkillsBackupManager.copyDirectory(skillsDir2, backupDir);
|
|
87592
87687
|
logger.success("Backup created successfully");
|
|
87593
87688
|
return backupDir;
|
|
87594
87689
|
} catch (error) {
|
|
87595
87690
|
try {
|
|
87596
|
-
await
|
|
87691
|
+
await rm11(backupDir, { recursive: true, force: true });
|
|
87597
87692
|
} catch {}
|
|
87598
87693
|
throw new SkillsMigrationError(`Failed to create backup: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
87599
87694
|
}
|
|
@@ -87607,9 +87702,9 @@ class SkillsBackupManager {
|
|
|
87607
87702
|
logger.info(`Restoring from backup: ${backupDir}`);
|
|
87608
87703
|
try {
|
|
87609
87704
|
if (await import_fs_extra25.pathExists(targetDir)) {
|
|
87610
|
-
await
|
|
87705
|
+
await rm11(targetDir, { recursive: true, force: true });
|
|
87611
87706
|
}
|
|
87612
|
-
await
|
|
87707
|
+
await mkdir29(targetDir, { recursive: true });
|
|
87613
87708
|
await SkillsBackupManager.copyDirectory(backupDir, targetDir);
|
|
87614
87709
|
logger.success("Backup restored successfully");
|
|
87615
87710
|
} catch (error) {
|
|
@@ -87623,7 +87718,7 @@ class SkillsBackupManager {
|
|
|
87623
87718
|
}
|
|
87624
87719
|
logger.debug(`Deleting backup: ${backupDir}`);
|
|
87625
87720
|
try {
|
|
87626
|
-
await
|
|
87721
|
+
await rm11(backupDir, { recursive: true, force: true });
|
|
87627
87722
|
logger.debug("Backup deleted successfully");
|
|
87628
87723
|
} catch (error) {
|
|
87629
87724
|
logger.warning(`Failed to delete backup: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
@@ -87669,10 +87764,10 @@ class SkillsBackupManager {
|
|
|
87669
87764
|
continue;
|
|
87670
87765
|
}
|
|
87671
87766
|
if (entry.isDirectory()) {
|
|
87672
|
-
await
|
|
87767
|
+
await mkdir29(destPath, { recursive: true });
|
|
87673
87768
|
await SkillsBackupManager.copyDirectory(sourcePath, destPath);
|
|
87674
87769
|
} else if (entry.isFile()) {
|
|
87675
|
-
await
|
|
87770
|
+
await copyFile7(sourcePath, destPath);
|
|
87676
87771
|
}
|
|
87677
87772
|
}
|
|
87678
87773
|
}
|
|
@@ -88083,12 +88178,12 @@ async function handleMigration(ctx) {
|
|
|
88083
88178
|
return ctx;
|
|
88084
88179
|
}
|
|
88085
88180
|
// src/commands/init/phases/opencode-handler.ts
|
|
88086
|
-
import { cp as cp3, readdir as readdir31, rm as
|
|
88181
|
+
import { cp as cp3, readdir as readdir31, rm as rm12 } from "node:fs/promises";
|
|
88087
88182
|
import { join as join99 } from "node:path";
|
|
88088
88183
|
|
|
88089
88184
|
// src/services/transformers/opencode-path-transformer.ts
|
|
88090
88185
|
init_logger();
|
|
88091
|
-
import { readFile as readFile46, readdir as readdir30, writeFile as
|
|
88186
|
+
import { readFile as readFile46, readdir as readdir30, writeFile as writeFile28 } from "node:fs/promises";
|
|
88092
88187
|
import { platform as platform12 } from "node:os";
|
|
88093
88188
|
import { extname as extname5, join as join98 } from "node:path";
|
|
88094
88189
|
var IS_WINDOWS2 = platform12() === "win32";
|
|
@@ -88162,7 +88257,7 @@ async function transformPathsForGlobalOpenCode(directory, options2 = {}) {
|
|
|
88162
88257
|
const content = await readFile46(fullPath, "utf-8");
|
|
88163
88258
|
const { transformed, changes } = transformOpenCodeContent(content);
|
|
88164
88259
|
if (changes > 0) {
|
|
88165
|
-
await
|
|
88260
|
+
await writeFile28(fullPath, transformed, "utf-8");
|
|
88166
88261
|
filesTransformed++;
|
|
88167
88262
|
totalChanges += changes;
|
|
88168
88263
|
if (options2.verbose) {
|
|
@@ -88219,7 +88314,7 @@ async function handleOpenCode(ctx) {
|
|
|
88219
88314
|
await cp3(sourcePath, targetPath, { recursive: true });
|
|
88220
88315
|
logger.verbose(`Copied: ${entry.name}`);
|
|
88221
88316
|
}
|
|
88222
|
-
await
|
|
88317
|
+
await rm12(openCodeSource, { recursive: true, force: true });
|
|
88223
88318
|
logger.success(`OpenCode config installed to ${targetDir}`);
|
|
88224
88319
|
} else {
|
|
88225
88320
|
logger.debug("Local mode: .opencode will be placed at project root");
|
|
@@ -88387,7 +88482,7 @@ async function handlePostInstall(ctx) {
|
|
|
88387
88482
|
// src/commands/init/phases/selection-handler.ts
|
|
88388
88483
|
init_config_manager();
|
|
88389
88484
|
init_github_client();
|
|
88390
|
-
import { mkdir as
|
|
88485
|
+
import { mkdir as mkdir30 } from "node:fs/promises";
|
|
88391
88486
|
import { join as join102, resolve as resolve20 } from "node:path";
|
|
88392
88487
|
|
|
88393
88488
|
// src/domains/github/kit-access-checker.ts
|
|
@@ -88910,7 +89005,7 @@ async function handleSelection(ctx) {
|
|
|
88910
89005
|
}
|
|
88911
89006
|
if (!await import_fs_extra32.pathExists(resolvedDir)) {
|
|
88912
89007
|
if (ctx.options.global) {
|
|
88913
|
-
await
|
|
89008
|
+
await mkdir30(resolvedDir, { recursive: true });
|
|
88914
89009
|
logger.info(`Created global directory: ${resolvedDir}`);
|
|
88915
89010
|
} else {
|
|
88916
89011
|
logger.error(`Directory does not exist: ${resolvedDir}`);
|
|
@@ -89045,7 +89140,7 @@ async function handleSelection(ctx) {
|
|
|
89045
89140
|
};
|
|
89046
89141
|
}
|
|
89047
89142
|
// src/commands/init/phases/sync-handler.ts
|
|
89048
|
-
import { copyFile as
|
|
89143
|
+
import { copyFile as copyFile8, mkdir as mkdir31, open as open4, readFile as readFile48, rename as rename6, stat as stat17, unlink as unlink11, writeFile as writeFile30 } from "node:fs/promises";
|
|
89049
89144
|
import { dirname as dirname22, join as join103, resolve as resolve21 } from "node:path";
|
|
89050
89145
|
init_logger();
|
|
89051
89146
|
init_path_resolver();
|
|
@@ -89165,7 +89260,7 @@ async function acquireSyncLock(global3) {
|
|
|
89165
89260
|
const lockPath = join103(cacheDir, ".sync-lock");
|
|
89166
89261
|
const startTime = Date.now();
|
|
89167
89262
|
const lockTimeout = getLockTimeout();
|
|
89168
|
-
await
|
|
89263
|
+
await mkdir31(dirname22(lockPath), { recursive: true });
|
|
89169
89264
|
while (Date.now() - startTime < lockTimeout) {
|
|
89170
89265
|
try {
|
|
89171
89266
|
const handle = await open4(lockPath, "wx");
|
|
@@ -89245,7 +89340,7 @@ async function executeSyncMerge(ctx) {
|
|
|
89245
89340
|
const targetPath = await validateSyncPath(ctx.claudeDir, file.path);
|
|
89246
89341
|
const targetDir = join103(targetPath, "..");
|
|
89247
89342
|
try {
|
|
89248
|
-
await
|
|
89343
|
+
await mkdir31(targetDir, { recursive: true });
|
|
89249
89344
|
} catch (mkdirError) {
|
|
89250
89345
|
const errCode = mkdirError.code;
|
|
89251
89346
|
if (errCode === "ENOSPC") {
|
|
@@ -89260,7 +89355,7 @@ async function executeSyncMerge(ctx) {
|
|
|
89260
89355
|
}
|
|
89261
89356
|
throw mkdirError;
|
|
89262
89357
|
}
|
|
89263
|
-
await
|
|
89358
|
+
await copyFile8(sourcePath, targetPath);
|
|
89264
89359
|
logger.debug(`Updated: ${file.path}`);
|
|
89265
89360
|
updateSuccess++;
|
|
89266
89361
|
} catch (error) {
|
|
@@ -89324,8 +89419,8 @@ async function executeSyncMerge(ctx) {
|
|
|
89324
89419
|
try {
|
|
89325
89420
|
const tempPath = `${currentPath}.tmp.${Date.now()}`;
|
|
89326
89421
|
try {
|
|
89327
|
-
await
|
|
89328
|
-
await
|
|
89422
|
+
await writeFile30(tempPath, result.result, "utf-8");
|
|
89423
|
+
await rename6(tempPath, currentPath);
|
|
89329
89424
|
} catch (atomicError) {
|
|
89330
89425
|
await unlink11(tempPath).catch(() => {});
|
|
89331
89426
|
throw atomicError;
|
|
@@ -89408,15 +89503,15 @@ function displaySyncPlan(plan) {
|
|
|
89408
89503
|
console.log(import_picocolors23.default.dim("─".repeat(40)));
|
|
89409
89504
|
}
|
|
89410
89505
|
async function createBackup(claudeDir2, files, backupDir) {
|
|
89411
|
-
await
|
|
89506
|
+
await mkdir31(backupDir, { recursive: true });
|
|
89412
89507
|
for (const file of files) {
|
|
89413
89508
|
try {
|
|
89414
89509
|
const sourcePath = await validateSyncPath(claudeDir2, file.path);
|
|
89415
89510
|
if (await import_fs_extra33.pathExists(sourcePath)) {
|
|
89416
89511
|
const targetPath = await validateSyncPath(backupDir, file.path);
|
|
89417
89512
|
const targetDir = join103(targetPath, "..");
|
|
89418
|
-
await
|
|
89419
|
-
await
|
|
89513
|
+
await mkdir31(targetDir, { recursive: true });
|
|
89514
|
+
await copyFile8(sourcePath, targetPath);
|
|
89420
89515
|
}
|
|
89421
89516
|
} catch (error) {
|
|
89422
89517
|
const errCode = error.code;
|
|
@@ -89439,7 +89534,7 @@ init_types3();
|
|
|
89439
89534
|
init_logger();
|
|
89440
89535
|
init_types3();
|
|
89441
89536
|
var import_fs_extra34 = __toESM(require_lib3(), 1);
|
|
89442
|
-
import { rename as
|
|
89537
|
+
import { rename as rename7, rm as rm13 } from "node:fs/promises";
|
|
89443
89538
|
import { join as join104, relative as relative18 } from "node:path";
|
|
89444
89539
|
async function collectDirsToRename(extractDir, folders) {
|
|
89445
89540
|
const dirsToRename = [];
|
|
@@ -89479,12 +89574,12 @@ async function collectDirsToRename(extractDir, folders) {
|
|
|
89479
89574
|
}
|
|
89480
89575
|
async function moveAcrossDevices(src, dest) {
|
|
89481
89576
|
try {
|
|
89482
|
-
await
|
|
89577
|
+
await rename7(src, dest);
|
|
89483
89578
|
} catch (e2) {
|
|
89484
89579
|
if (e2.code === "EXDEV") {
|
|
89485
89580
|
logger.debug(`Cross-device move detected, using copy+delete: ${src} -> ${dest}`);
|
|
89486
89581
|
await import_fs_extra34.copy(src, dest, { overwrite: true });
|
|
89487
|
-
await
|
|
89582
|
+
await rm13(src, { recursive: true, force: true });
|
|
89488
89583
|
} else {
|
|
89489
89584
|
throw e2;
|
|
89490
89585
|
}
|
|
@@ -89511,7 +89606,7 @@ async function renameFolders(dirsToRename, extractDir, options2) {
|
|
|
89511
89606
|
// src/services/transformers/folder-transform/path-replacer.ts
|
|
89512
89607
|
init_logger();
|
|
89513
89608
|
init_types3();
|
|
89514
|
-
import { readFile as readFile49, readdir as readdir32, writeFile as
|
|
89609
|
+
import { readFile as readFile49, readdir as readdir32, writeFile as writeFile31 } from "node:fs/promises";
|
|
89515
89610
|
import { join as join105, relative as relative19 } from "node:path";
|
|
89516
89611
|
var TRANSFORMABLE_FILE_PATTERNS = [
|
|
89517
89612
|
".md",
|
|
@@ -89594,7 +89689,7 @@ async function transformFileContents(dir, compiledReplacements, options2) {
|
|
|
89594
89689
|
if (options2.dryRun) {
|
|
89595
89690
|
logger.debug(`[dry-run] Would update ${relative19(dir, fullPath)}: ${changeCount} replacement(s)`);
|
|
89596
89691
|
} else {
|
|
89597
|
-
await
|
|
89692
|
+
await writeFile31(fullPath, newContent, "utf-8");
|
|
89598
89693
|
logger.debug(`Updated ${relative19(dir, fullPath)}: ${changeCount} replacement(s)`);
|
|
89599
89694
|
}
|
|
89600
89695
|
filesChanged++;
|
|
@@ -89700,7 +89795,7 @@ async function transformFolderPaths(extractDir, folders, options2 = {}) {
|
|
|
89700
89795
|
|
|
89701
89796
|
// src/services/transformers/global-path-transformer.ts
|
|
89702
89797
|
init_logger();
|
|
89703
|
-
import { readFile as readFile50, readdir as readdir33, writeFile as
|
|
89798
|
+
import { readFile as readFile50, readdir as readdir33, writeFile as writeFile32 } from "node:fs/promises";
|
|
89704
89799
|
import { platform as platform13 } from "node:os";
|
|
89705
89800
|
import { extname as extname6, join as join106 } from "node:path";
|
|
89706
89801
|
var IS_WINDOWS3 = platform13() === "win32";
|
|
@@ -89823,7 +89918,7 @@ async function transformPathsForGlobalInstall(directory, options2 = {}) {
|
|
|
89823
89918
|
const content = await readFile50(fullPath, "utf-8");
|
|
89824
89919
|
const { transformed, changes } = transformContent(content);
|
|
89825
89920
|
if (changes > 0) {
|
|
89826
|
-
await
|
|
89921
|
+
await writeFile32(fullPath, transformed, "utf-8");
|
|
89827
89922
|
filesTransformed++;
|
|
89828
89923
|
totalChanges += changes;
|
|
89829
89924
|
if (options2.verbose) {
|
|
@@ -90082,7 +90177,7 @@ init_checksum_utils();
|
|
|
90082
90177
|
init_config_discovery();
|
|
90083
90178
|
var import_picocolors25 = __toESM(require_picocolors(), 1);
|
|
90084
90179
|
import { existsSync as existsSync51 } from "node:fs";
|
|
90085
|
-
import { readFile as readFile51, rm as
|
|
90180
|
+
import { readFile as readFile51, rm as rm14, unlink as unlink12 } from "node:fs/promises";
|
|
90086
90181
|
import { resolve as resolve22 } from "node:path";
|
|
90087
90182
|
|
|
90088
90183
|
// src/commands/portable/conflict-resolver.ts
|
|
@@ -90433,7 +90528,7 @@ async function executeDeleteAction(action, options2) {
|
|
|
90433
90528
|
const shouldPreserveTarget = action.targetPath.length > 0 && preservePaths.has(resolve22(action.targetPath));
|
|
90434
90529
|
try {
|
|
90435
90530
|
if (!shouldPreserveTarget && action.targetPath && existsSync51(action.targetPath)) {
|
|
90436
|
-
await
|
|
90531
|
+
await rm14(action.targetPath, { recursive: true, force: true });
|
|
90437
90532
|
}
|
|
90438
90533
|
await removePortableInstallation(action.item, action.type, action.provider, action.global);
|
|
90439
90534
|
return {
|
|
@@ -90555,8 +90650,7 @@ async function migrateCommand(options2) {
|
|
|
90555
90650
|
value: a3,
|
|
90556
90651
|
label: providers[a3].displayName
|
|
90557
90652
|
})),
|
|
90558
|
-
required: true
|
|
90559
|
-
initialValues: detectedProviders
|
|
90653
|
+
required: true
|
|
90560
90654
|
});
|
|
90561
90655
|
if (lD(selected)) {
|
|
90562
90656
|
ue("Migrate cancelled");
|
|
@@ -90800,7 +90894,7 @@ async function rollbackResults(results) {
|
|
|
90800
90894
|
continue;
|
|
90801
90895
|
const stat18 = await import("node:fs/promises").then((fs19) => fs19.stat(result.path));
|
|
90802
90896
|
if (stat18.isDirectory()) {
|
|
90803
|
-
await
|
|
90897
|
+
await rm14(result.path, { recursive: true, force: true });
|
|
90804
90898
|
} else {
|
|
90805
90899
|
await unlink12(result.path);
|
|
90806
90900
|
}
|