claudekit-cli 3.40.0 → 3.40.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/bin/ck.js +17 -128
- package/dist/index.js +82 -74
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Command-line tool and web dashboard for managing ClaudeKit projects.
|
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
9
|
-
ClaudeKit Config UI (`ck`) provides both CLI and web dashboard for managing ClaudeKit projects.
|
|
9
|
+
ClaudeKit Config UI (`ck`) provides both CLI and web dashboard for managing ClaudeKit projects. It is built with Bun, TypeScript, and React for development, while the published CLI runs on plain Node.js so end users do not need Bun installed.
|
|
10
10
|
|
|
11
11
|
**Key Features:**
|
|
12
12
|
- **CLI Commands (16)**: new, init, config, projects, setup, skills, agents, commands, migrate, doctor, versions, update, uninstall, watch, content, easter-egg
|
|
@@ -50,6 +50,8 @@ Without a purchased kit and repository access, the CLI will not be able to downl
|
|
|
50
50
|
|
|
51
51
|
The ClaudeKit CLI is published on npm at [npmjs.com/package/claudekit-cli](https://www.npmjs.com/package/claudekit-cli).
|
|
52
52
|
|
|
53
|
+
End-user runtime note: global installs from `npm`, `pnpm`, `yarn`, or `bun` all execute the packaged Node.js CLI. Bun is optional for users and only needed for local ClaudeKit CLI development workflows.
|
|
54
|
+
|
|
53
55
|
### Using npm (Recommended)
|
|
54
56
|
|
|
55
57
|
```bash
|
package/bin/ck.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* CLI entry point
|
|
5
|
-
*
|
|
4
|
+
* CLI entry point for npm-installed ClaudeKit CLI.
|
|
5
|
+
* Runs the packaged Node-targeted bundle without requiring Bun on user machines.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
8
|
+
import { existsSync } from "node:fs";
|
|
10
9
|
import { dirname, join } from "node:path";
|
|
11
10
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
12
11
|
|
|
13
|
-
// Minimum required Node.js version (major.minor)
|
|
14
12
|
const MIN_NODE_VERSION = [18, 0];
|
|
13
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
|
|
15
|
+
const getErrorMessage = (err) => {
|
|
16
|
+
return err instanceof Error ? err.message : String(err);
|
|
17
|
+
};
|
|
15
18
|
|
|
16
|
-
/**
|
|
17
|
-
* Check if the current Node.js version meets minimum requirements.
|
|
18
|
-
* Required because dependencies like ora@8 use ES2022+ features.
|
|
19
|
-
*/
|
|
20
19
|
const checkNodeVersion = () => {
|
|
21
20
|
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
22
21
|
const [minMajor, minMinor] = MIN_NODE_VERSION;
|
|
@@ -30,136 +29,26 @@ const checkNodeVersion = () => {
|
|
|
30
29
|
}
|
|
31
30
|
};
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
checkNodeVersion();
|
|
35
|
-
|
|
36
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Extract error message safely with type guard
|
|
40
|
-
*/
|
|
41
|
-
const getErrorMessage = (err) => {
|
|
42
|
-
return err instanceof Error ? err.message : String(err);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Check if bun runtime is available on the system.
|
|
47
|
-
* dist/index.js may contain bun-specific imports (bun:sqlite) that Node.js can't handle.
|
|
48
|
-
* Result is cached to avoid repeated execSync calls.
|
|
49
|
-
*/
|
|
50
|
-
let _bunAvailable = undefined;
|
|
51
|
-
const hasBun = () => {
|
|
52
|
-
if (_bunAvailable !== undefined) return _bunAvailable;
|
|
53
|
-
try {
|
|
54
|
-
execSync("bun --version", { stdio: "ignore", timeout: 3000 });
|
|
55
|
-
_bunAvailable = true;
|
|
56
|
-
} catch {
|
|
57
|
-
_bunAvailable = false;
|
|
58
|
-
}
|
|
59
|
-
return _bunAvailable;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
let _installedVersion = undefined;
|
|
63
|
-
const readInstalledPackageVersion = () => {
|
|
64
|
-
if (_installedVersion !== undefined) return _installedVersion;
|
|
65
|
-
try {
|
|
66
|
-
const packageJsonPath = join(__dirname, "..", "package.json");
|
|
67
|
-
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
68
|
-
_installedVersion = typeof packageJson.version === "string" ? packageJson.version : null;
|
|
69
|
-
} catch {
|
|
70
|
-
_installedVersion = null;
|
|
71
|
-
}
|
|
72
|
-
return _installedVersion;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const isDevPrerelease = () => {
|
|
76
|
-
const version = readInstalledPackageVersion();
|
|
77
|
-
return typeof version === "string" && /-dev\.\d+$/i.test(version);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const shouldWarnForBunFallback = () => !isDevPrerelease();
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Run CLI via bun runtime. Preferred over Node.js when dist/index.js contains
|
|
84
|
-
* bun-specific imports (e.g., bun:sqlite) that the Node.js ESM loader rejects.
|
|
85
|
-
* Uses spawnSync to hand full terminal control to bun — this prevents Unicode
|
|
86
|
-
* rendering issues (garbled @clack/prompts box-drawing chars) that occur when
|
|
87
|
-
* bun runs as an async child of a Node.js parent process.
|
|
88
|
-
* @param {boolean} showWarning - Whether to show runtime info message
|
|
89
|
-
* @returns {boolean} true if bun ran successfully, false if spawn failed
|
|
90
|
-
*/
|
|
91
|
-
const runWithBun = (showWarning = false) => {
|
|
32
|
+
const runWithNode = async () => {
|
|
92
33
|
const distPath = join(__dirname, "..", "dist", "index.js");
|
|
93
34
|
if (!existsSync(distPath)) {
|
|
94
|
-
throw new Error(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
console.error("[i] Using bun runtime");
|
|
98
|
-
}
|
|
99
|
-
const result = spawnSync("bun", [distPath, ...process.argv.slice(2)], {
|
|
100
|
-
stdio: "inherit",
|
|
101
|
-
windowsHide: true,
|
|
102
|
-
});
|
|
103
|
-
if (result.error) {
|
|
104
|
-
// bun spawn failed (e.g., ENOENT) — caller handles fallback
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
if (result.signal) {
|
|
108
|
-
process.kill(process.pid, result.signal);
|
|
35
|
+
throw new Error(
|
|
36
|
+
"Compiled distribution not found. Reinstall ClaudeKit CLI or report a packaging issue.",
|
|
37
|
+
);
|
|
109
38
|
}
|
|
110
|
-
process.exit(result.status || 0);
|
|
111
|
-
};
|
|
112
39
|
|
|
113
|
-
/**
|
|
114
|
-
* Run CLI via Node.js as last-resort fallback (slower, no bun: protocol support).
|
|
115
|
-
* @param {boolean} showWarning - Whether to show fallback warning message
|
|
116
|
-
*/
|
|
117
|
-
const runWithNode = async (showWarning = false) => {
|
|
118
|
-
const distPath = join(__dirname, "..", "dist", "index.js");
|
|
119
|
-
if (!existsSync(distPath)) {
|
|
120
|
-
throw new Error("Compiled distribution not found. This may indicate a packaging issue.");
|
|
121
|
-
}
|
|
122
|
-
if (showWarning) {
|
|
123
|
-
console.error("[i] Using Node.js runtime (slower startup)");
|
|
124
|
-
}
|
|
125
40
|
const distUrl = pathToFileURL(distPath).href;
|
|
126
|
-
|
|
127
|
-
await import(distUrl);
|
|
128
|
-
} catch (importErr) {
|
|
129
|
-
throw new Error(`Failed to load CLI module: ${getErrorMessage(importErr)}`);
|
|
130
|
-
}
|
|
41
|
+
await import(distUrl);
|
|
131
42
|
};
|
|
132
43
|
|
|
133
|
-
/**
|
|
134
|
-
* Main execution — try Bun first, fall back to Node.js
|
|
135
|
-
*/
|
|
136
44
|
const main = async () => {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
// Prefer bun — dist/index.js may contain bun-specific imports (bun:sqlite)
|
|
140
|
-
if (hasBun()) {
|
|
141
|
-
const bunOk = runWithBun(false);
|
|
142
|
-
if (!bunOk && showBunWarning) {
|
|
143
|
-
console.error("[i] Bun spawn failed, falling back to Node.js");
|
|
144
|
-
}
|
|
145
|
-
}
|
|
45
|
+
checkNodeVersion();
|
|
146
46
|
|
|
147
|
-
// Last resort: Node.js (works for stable builds without bun: imports)
|
|
148
47
|
try {
|
|
149
|
-
await runWithNode(
|
|
48
|
+
await runWithNode();
|
|
150
49
|
} catch (err) {
|
|
151
|
-
|
|
152
|
-
console.error(
|
|
153
|
-
if (errMsg.includes("bun:") || errMsg.includes("Received protocol")) {
|
|
154
|
-
console.error("");
|
|
155
|
-
console.error("This version of ClaudeKit CLI requires the bun runtime.");
|
|
156
|
-
console.error("Install bun: curl -fsSL https://bun.sh/install | bash");
|
|
157
|
-
console.error("Or switch to stable: npm install -g claudekit-cli@latest");
|
|
158
|
-
} else {
|
|
159
|
-
console.error(
|
|
160
|
-
"Please report this issue at: https://github.com/mrgoonie/claudekit-cli/issues",
|
|
161
|
-
);
|
|
162
|
-
}
|
|
50
|
+
console.error(`[X] Failed to run CLI: ${getErrorMessage(err)}`);
|
|
51
|
+
console.error("Please report this issue at: https://github.com/mrgoonie/claudekit-cli/issues");
|
|
163
52
|
process.exit(1);
|
|
164
53
|
}
|
|
165
54
|
};
|
package/dist/index.js
CHANGED
|
@@ -49974,13 +49974,14 @@ var init_config_discovery = __esm(() => {
|
|
|
49974
49974
|
|
|
49975
49975
|
// src/commands/portable/hooks-settings-merger.ts
|
|
49976
49976
|
import { existsSync as existsSync22, mkdirSync, renameSync, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
49977
|
+
import { readFile as readFile17 } from "node:fs/promises";
|
|
49977
49978
|
import { basename as basename8, dirname as dirname9, join as join32 } from "node:path";
|
|
49978
49979
|
async function inspectHooksSettings(settingsPath) {
|
|
49979
49980
|
try {
|
|
49980
49981
|
if (!existsSync22(settingsPath)) {
|
|
49981
49982
|
return { status: "missing-file" };
|
|
49982
49983
|
}
|
|
49983
|
-
const raw = await
|
|
49984
|
+
const raw = await readFile17(settingsPath, "utf8");
|
|
49984
49985
|
const parsed = JSON.parse(raw);
|
|
49985
49986
|
if (!parsed.hooks || typeof parsed.hooks !== "object") {
|
|
49986
49987
|
return { status: "missing-hooks" };
|
|
@@ -50052,7 +50053,7 @@ async function mergeHooksIntoSettings(targetSettingsPath, newHooks) {
|
|
|
50052
50053
|
if (existsSync22(targetSettingsPath)) {
|
|
50053
50054
|
let raw;
|
|
50054
50055
|
try {
|
|
50055
|
-
raw = await
|
|
50056
|
+
raw = await readFile17(targetSettingsPath, "utf8");
|
|
50056
50057
|
existingSettings = JSON.parse(raw);
|
|
50057
50058
|
} catch {
|
|
50058
50059
|
existingSettings = {};
|
|
@@ -52035,7 +52036,7 @@ var require_semver2 = __commonJS((exports, module) => {
|
|
|
52035
52036
|
|
|
52036
52037
|
// src/commands/portable/portable-manifest.ts
|
|
52037
52038
|
import { existsSync as existsSync23 } from "node:fs";
|
|
52038
|
-
import { readFile as
|
|
52039
|
+
import { readFile as readFile18 } from "node:fs/promises";
|
|
52039
52040
|
import path2 from "node:path";
|
|
52040
52041
|
async function loadPortableManifest(kitPath) {
|
|
52041
52042
|
const manifestPath = path2.join(kitPath, "portable-manifest.json");
|
|
@@ -52044,7 +52045,7 @@ async function loadPortableManifest(kitPath) {
|
|
|
52044
52045
|
logger.verbose("No portable-manifest.json found — no evolution tracking");
|
|
52045
52046
|
return null;
|
|
52046
52047
|
}
|
|
52047
|
-
const raw = await
|
|
52048
|
+
const raw = await readFile18(manifestPath, "utf-8");
|
|
52048
52049
|
let parsed;
|
|
52049
52050
|
try {
|
|
52050
52051
|
parsed = JSON.parse(raw);
|
|
@@ -52155,7 +52156,7 @@ var init_reconcile_registry_backfill = __esm(() => {
|
|
|
52155
52156
|
|
|
52156
52157
|
// src/commands/portable/reconcile-state-builders.ts
|
|
52157
52158
|
import { existsSync as existsSync24 } from "node:fs";
|
|
52158
|
-
import { readFile as
|
|
52159
|
+
import { readFile as readFile19 } from "node:fs/promises";
|
|
52159
52160
|
function getProviderPathKeyForPortableType2(type) {
|
|
52160
52161
|
switch (type) {
|
|
52161
52162
|
case "agent":
|
|
@@ -52265,7 +52266,7 @@ async function buildTargetStates(entries, options2) {
|
|
|
52265
52266
|
const state = { path: entryPath, exists };
|
|
52266
52267
|
if (exists) {
|
|
52267
52268
|
try {
|
|
52268
|
-
const content = await
|
|
52269
|
+
const content = await readFile19(entryPath, "utf-8");
|
|
52269
52270
|
state.currentChecksum = computeContentChecksum(content);
|
|
52270
52271
|
if (groupedEntries.some((entry) => usesMergeSingleChecksums(entry))) {
|
|
52271
52272
|
state.sectionChecksums = computeManagedSectionChecksums(content);
|
|
@@ -52752,7 +52753,7 @@ var init_reconciler = __esm(() => {
|
|
|
52752
52753
|
|
|
52753
52754
|
// src/commands/skills/skills-discovery.ts
|
|
52754
52755
|
import { existsSync as existsSync25 } from "node:fs";
|
|
52755
|
-
import { readFile as
|
|
52756
|
+
import { readFile as readFile20, readdir as readdir8, stat as stat6 } from "node:fs/promises";
|
|
52756
52757
|
import { homedir as homedir20 } from "node:os";
|
|
52757
52758
|
import { dirname as dirname10, join as join33 } from "node:path";
|
|
52758
52759
|
function getSkillSourcePath() {
|
|
@@ -52782,7 +52783,7 @@ async function hasSkillMd(dir) {
|
|
|
52782
52783
|
}
|
|
52783
52784
|
async function parseSkillMd(skillMdPath) {
|
|
52784
52785
|
try {
|
|
52785
|
-
const content = await
|
|
52786
|
+
const content = await readFile20(skillMdPath, "utf-8");
|
|
52786
52787
|
const { data } = import_gray_matter5.default(content);
|
|
52787
52788
|
const skillDir = dirname10(skillMdPath);
|
|
52788
52789
|
const dirName = skillDir.split(/[/\\]/).pop() || "";
|
|
@@ -52943,7 +52944,7 @@ var init_migration_result_utils = __esm(() => {
|
|
|
52943
52944
|
|
|
52944
52945
|
// src/domains/web-server/routes/migration-routes.ts
|
|
52945
52946
|
import { existsSync as existsSync26 } from "node:fs";
|
|
52946
|
-
import { readFile as
|
|
52947
|
+
import { readFile as readFile21, rm as rm6 } from "node:fs/promises";
|
|
52947
52948
|
import { homedir as homedir21 } from "node:os";
|
|
52948
52949
|
import { basename as basename9, join as join34, resolve as resolve8 } from "node:path";
|
|
52949
52950
|
function isDisallowedControlCode(codePoint) {
|
|
@@ -53608,9 +53609,9 @@ function registerMigrationRoutes(app) {
|
|
|
53608
53609
|
const readmePath = `${skill.path}/README.md`;
|
|
53609
53610
|
let content;
|
|
53610
53611
|
if (existsSync26(skillMdPath)) {
|
|
53611
|
-
content = await
|
|
53612
|
+
content = await readFile21(skillMdPath, "utf-8");
|
|
53612
53613
|
} else if (existsSync26(readmePath)) {
|
|
53613
|
-
content = await
|
|
53614
|
+
content = await readFile21(readmePath, "utf-8");
|
|
53614
53615
|
} else {
|
|
53615
53616
|
console.warn(`[migrate] Skill "${sanitizeUntrusted(skill.name, 80)}" has neither SKILL.md nor README.md, skipping`);
|
|
53616
53617
|
continue;
|
|
@@ -55063,7 +55064,7 @@ var init_plan_routes = __esm(() => {
|
|
|
55063
55064
|
|
|
55064
55065
|
// src/domains/web-server/routes/project-routes.ts
|
|
55065
55066
|
import { existsSync as existsSync31 } from "node:fs";
|
|
55066
|
-
import { readFile as
|
|
55067
|
+
import { readFile as readFile22 } from "node:fs/promises";
|
|
55067
55068
|
import { homedir as homedir22 } from "node:os";
|
|
55068
55069
|
import { basename as basename13, join as join37, resolve as resolve11 } from "node:path";
|
|
55069
55070
|
function registerProjectRoutes(app) {
|
|
@@ -55305,7 +55306,7 @@ async function buildProjectInfoFromRegistry(registered) {
|
|
|
55305
55306
|
let metadata = {};
|
|
55306
55307
|
try {
|
|
55307
55308
|
if (hasClaudeDir && existsSync31(metadataPath)) {
|
|
55308
|
-
const content = await
|
|
55309
|
+
const content = await readFile22(metadataPath, "utf-8");
|
|
55309
55310
|
try {
|
|
55310
55311
|
metadata = JSON.parse(content);
|
|
55311
55312
|
} catch {}
|
|
@@ -55347,7 +55348,7 @@ async function detectAndBuildProjectInfo(path4, id) {
|
|
|
55347
55348
|
let metadata = {};
|
|
55348
55349
|
try {
|
|
55349
55350
|
if (existsSync31(metadataPath)) {
|
|
55350
|
-
const content = await
|
|
55351
|
+
const content = await readFile22(metadataPath, "utf-8");
|
|
55351
55352
|
try {
|
|
55352
55353
|
metadata = JSON.parse(content);
|
|
55353
55354
|
} catch {}
|
|
@@ -55681,7 +55682,7 @@ var init_agents = __esm(() => {
|
|
|
55681
55682
|
|
|
55682
55683
|
// src/commands/skills/skills-registry.ts
|
|
55683
55684
|
import { existsSync as existsSync33 } from "node:fs";
|
|
55684
|
-
import { mkdir as mkdir9, readFile as
|
|
55685
|
+
import { mkdir as mkdir9, readFile as readFile23, writeFile as writeFile11 } from "node:fs/promises";
|
|
55685
55686
|
import { homedir as homedir26 } from "node:os";
|
|
55686
55687
|
import { dirname as dirname16, join as join40, sep as sep5 } from "node:path";
|
|
55687
55688
|
function getCliVersion3() {
|
|
@@ -55718,7 +55719,7 @@ async function readRegistry() {
|
|
|
55718
55719
|
if (!existsSync33(REGISTRY_PATH2)) {
|
|
55719
55720
|
return { version: "1.0", installations: [] };
|
|
55720
55721
|
}
|
|
55721
|
-
const content = await
|
|
55722
|
+
const content = await readFile23(REGISTRY_PATH2, "utf-8");
|
|
55722
55723
|
const data = JSON.parse(content);
|
|
55723
55724
|
const registry = SkillRegistrySchema.parse(data);
|
|
55724
55725
|
if (migrateRegistryPaths(registry)) {
|
|
@@ -56555,7 +56556,7 @@ var init_pnpm_detector = __esm(() => {
|
|
|
56555
56556
|
|
|
56556
56557
|
// src/domains/installation/package-managers/detection-core.ts
|
|
56557
56558
|
import { existsSync as existsSync36, realpathSync as realpathSync2 } from "node:fs";
|
|
56558
|
-
import { chmod as chmod2, mkdir as mkdir11, readFile as
|
|
56559
|
+
import { chmod as chmod2, mkdir as mkdir11, readFile as readFile24, writeFile as writeFile12 } from "node:fs/promises";
|
|
56559
56560
|
import { platform as platform4 } from "node:os";
|
|
56560
56561
|
import { join as join43 } from "node:path";
|
|
56561
56562
|
function detectFromBinaryPath() {
|
|
@@ -56638,7 +56639,7 @@ async function readCachedPm() {
|
|
|
56638
56639
|
if (!existsSync36(cacheFile)) {
|
|
56639
56640
|
return null;
|
|
56640
56641
|
}
|
|
56641
|
-
const content = await
|
|
56642
|
+
const content = await readFile24(cacheFile, "utf-8");
|
|
56642
56643
|
const data = JSON.parse(content);
|
|
56643
56644
|
if (!data.packageManager || !data.detectedAt) {
|
|
56644
56645
|
logger.debug("Invalid cache structure, ignoring");
|
|
@@ -57328,7 +57329,7 @@ var package_default;
|
|
|
57328
57329
|
var init_package = __esm(() => {
|
|
57329
57330
|
package_default = {
|
|
57330
57331
|
name: "claudekit-cli",
|
|
57331
|
-
version: "3.
|
|
57332
|
+
version: "3.40.0",
|
|
57332
57333
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
57333
57334
|
type: "module",
|
|
57334
57335
|
repository: {
|
|
@@ -57352,7 +57353,7 @@ var init_package = __esm(() => {
|
|
|
57352
57353
|
"dashboard:dev": "cd src/ui && bun install --silent && cd ../.. && bun run src/index.ts config ui --dev",
|
|
57353
57354
|
"ui:build": "cd src/ui && bun install --silent && bun run build",
|
|
57354
57355
|
"ui:dev": "cd src/ui && bun run dev",
|
|
57355
|
-
build: `bun build src/index.ts --outdir dist --target node --external @octokit/rest && node -e "const fs=require('fs'),f='dist/index.js',c=fs.readFileSync(f,'utf-8');fs.writeFileSync(f,c.replace(/^#!.*\\n\\/\\/ @bun\\n/,''))"`,
|
|
57356
|
+
build: `bun build src/index.ts --outdir dist --target node --external @octokit/rest --external better-sqlite3 && node -e "const fs=require('fs'),f='dist/index.js',c=fs.readFileSync(f,'utf-8');fs.writeFileSync(f,c.replace(/^#!.*\\n\\/\\/ @bun\\n/,''))"`,
|
|
57356
57357
|
"verify:package": "node scripts/prepublish-check.js",
|
|
57357
57358
|
test: "bun test",
|
|
57358
57359
|
"test:integration": "CK_RUN_CLI_INTEGRATION=1 bun test tests/integration/cli.test.ts",
|
|
@@ -57380,7 +57381,6 @@ var init_package = __esm(() => {
|
|
|
57380
57381
|
author: "ClaudeKit",
|
|
57381
57382
|
license: "MIT",
|
|
57382
57383
|
engines: {
|
|
57383
|
-
bun: ">=1.3.2",
|
|
57384
57384
|
node: ">=18.0.0"
|
|
57385
57385
|
},
|
|
57386
57386
|
dependencies: {
|
|
@@ -57880,7 +57880,7 @@ var init_error_handler2 = __esm(() => {
|
|
|
57880
57880
|
|
|
57881
57881
|
// src/domains/versioning/release-cache.ts
|
|
57882
57882
|
import { existsSync as existsSync37 } from "node:fs";
|
|
57883
|
-
import { mkdir as mkdir12, readFile as
|
|
57883
|
+
import { mkdir as mkdir12, readFile as readFile27, unlink as unlink6, writeFile as writeFile14 } from "node:fs/promises";
|
|
57884
57884
|
import { join as join46 } from "node:path";
|
|
57885
57885
|
var ReleaseCacheEntrySchema, ReleaseCache;
|
|
57886
57886
|
var init_release_cache = __esm(() => {
|
|
@@ -57905,7 +57905,7 @@ var init_release_cache = __esm(() => {
|
|
|
57905
57905
|
logger.debug(`Release cache not found for key: ${key}`);
|
|
57906
57906
|
return null;
|
|
57907
57907
|
}
|
|
57908
|
-
const content = await
|
|
57908
|
+
const content = await readFile27(cacheFile, "utf-8");
|
|
57909
57909
|
const parsed = JSON.parse(content);
|
|
57910
57910
|
const cacheEntry = ReleaseCacheEntrySchema.parse(parsed);
|
|
57911
57911
|
if (this.isExpired(cacheEntry.timestamp)) {
|
|
@@ -59108,7 +59108,7 @@ var init_update_cli = __esm(() => {
|
|
|
59108
59108
|
|
|
59109
59109
|
// src/domains/versioning/version-cache.ts
|
|
59110
59110
|
import { existsSync as existsSync38 } from "node:fs";
|
|
59111
|
-
import { mkdir as mkdir13, readFile as
|
|
59111
|
+
import { mkdir as mkdir13, readFile as readFile29, writeFile as writeFile15 } from "node:fs/promises";
|
|
59112
59112
|
import { join as join48 } from "node:path";
|
|
59113
59113
|
var VersionCacheManager;
|
|
59114
59114
|
var init_version_cache = __esm(() => {
|
|
@@ -59128,7 +59128,7 @@ var init_version_cache = __esm(() => {
|
|
|
59128
59128
|
logger.debug("Version check cache not found");
|
|
59129
59129
|
return null;
|
|
59130
59130
|
}
|
|
59131
|
-
const content = await
|
|
59131
|
+
const content = await readFile29(cacheFile, "utf-8");
|
|
59132
59132
|
const cache3 = JSON.parse(content);
|
|
59133
59133
|
if (!cache3.lastCheck || !cache3.currentVersion || !cache3.latestVersion) {
|
|
59134
59134
|
logger.debug("Invalid cache structure, ignoring");
|
|
@@ -59387,7 +59387,7 @@ var init_version_checker = __esm(() => {
|
|
|
59387
59387
|
// src/domains/web-server/routes/system-routes.ts
|
|
59388
59388
|
import { spawn as spawn3 } from "node:child_process";
|
|
59389
59389
|
import { existsSync as existsSync39 } from "node:fs";
|
|
59390
|
-
import { readFile as
|
|
59390
|
+
import { readFile as readFile30 } from "node:fs/promises";
|
|
59391
59391
|
import { join as join49 } from "node:path";
|
|
59392
59392
|
function hasCliUpdate(currentVersion, latestVersion) {
|
|
59393
59393
|
if (!latestVersion) {
|
|
@@ -59634,7 +59634,7 @@ async function getKitMetadata2(kitName) {
|
|
|
59634
59634
|
const metadataPath = join49(PathResolver.getGlobalKitDir(), "metadata.json");
|
|
59635
59635
|
if (!existsSync39(metadataPath))
|
|
59636
59636
|
return null;
|
|
59637
|
-
const content = await
|
|
59637
|
+
const content = await readFile30(metadataPath, "utf-8");
|
|
59638
59638
|
const metadata = JSON.parse(content);
|
|
59639
59639
|
if (metadata.kits?.[kitName]) {
|
|
59640
59640
|
return { version: metadata.kits[kitName].version };
|
|
@@ -65088,8 +65088,8 @@ async function installSkillsDependencies(skillsDir2, options2 = {}) {
|
|
|
65088
65088
|
logger.info(` Platform: ${platform7 === "win32" ? "Windows (PowerShell)" : "Unix (bash)"}`);
|
|
65089
65089
|
if (logger.isVerbose()) {
|
|
65090
65090
|
try {
|
|
65091
|
-
const { readFile:
|
|
65092
|
-
const scriptContent = await
|
|
65091
|
+
const { readFile: readFile37 } = await import("node:fs/promises");
|
|
65092
|
+
const scriptContent = await readFile37(scriptPath, "utf-8");
|
|
65093
65093
|
const previewLines = scriptContent.split(`
|
|
65094
65094
|
`).slice(0, 20);
|
|
65095
65095
|
logger.verbose("Script preview (first 20 lines):");
|
|
@@ -65285,11 +65285,11 @@ var init_skills_installer2 = __esm(() => {
|
|
|
65285
65285
|
|
|
65286
65286
|
// src/services/package-installer/gemini-mcp/config-manager.ts
|
|
65287
65287
|
import { existsSync as existsSync52 } from "node:fs";
|
|
65288
|
-
import { mkdir as mkdir17, readFile as
|
|
65288
|
+
import { mkdir as mkdir17, readFile as readFile37, writeFile as writeFile20 } from "node:fs/promises";
|
|
65289
65289
|
import { dirname as dirname21, join as join71 } from "node:path";
|
|
65290
65290
|
async function readJsonFile(filePath) {
|
|
65291
65291
|
try {
|
|
65292
|
-
const content = await
|
|
65292
|
+
const content = await readFile37(filePath, "utf-8");
|
|
65293
65293
|
return JSON.parse(content);
|
|
65294
65294
|
} catch (error) {
|
|
65295
65295
|
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
@@ -65303,7 +65303,7 @@ async function addGeminiToGitignore(projectDir) {
|
|
|
65303
65303
|
try {
|
|
65304
65304
|
let content = "";
|
|
65305
65305
|
if (existsSync52(gitignorePath)) {
|
|
65306
|
-
content = await
|
|
65306
|
+
content = await readFile37(gitignorePath, "utf-8");
|
|
65307
65307
|
const lines = content.split(`
|
|
65308
65308
|
`).map((line) => line.trim()).filter((line) => !line.startsWith("#"));
|
|
65309
65309
|
const geminiPatterns = [".gemini/", ".gemini", "/.gemini/", "/.gemini"];
|
|
@@ -67872,7 +67872,7 @@ __export(exports_worktree_manager, {
|
|
|
67872
67872
|
cleanupAllWorktrees: () => cleanupAllWorktrees
|
|
67873
67873
|
});
|
|
67874
67874
|
import { existsSync as existsSync62 } from "node:fs";
|
|
67875
|
-
import { readFile as
|
|
67875
|
+
import { readFile as readFile54, writeFile as writeFile33 } from "node:fs/promises";
|
|
67876
67876
|
import { join as join124 } from "node:path";
|
|
67877
67877
|
async function createWorktree(projectDir, issueNumber, baseBranch) {
|
|
67878
67878
|
const worktreePath = join124(projectDir, WORKTREE_DIR, `issue-${issueNumber}`);
|
|
@@ -67937,7 +67937,7 @@ async function cleanupAllWorktrees(projectDir) {
|
|
|
67937
67937
|
async function ensureGitignore(projectDir) {
|
|
67938
67938
|
const gitignorePath = join124(projectDir, ".gitignore");
|
|
67939
67939
|
try {
|
|
67940
|
-
const content = existsSync62(gitignorePath) ? await
|
|
67940
|
+
const content = existsSync62(gitignorePath) ? await readFile54(gitignorePath, "utf-8") : "";
|
|
67941
67941
|
if (!content.includes(".worktrees")) {
|
|
67942
67942
|
const newContent = content.endsWith(`
|
|
67943
67943
|
`) ? `${content}.worktrees/
|
|
@@ -68785,13 +68785,19 @@ var init_content_logger = __esm(() => {
|
|
|
68785
68785
|
];
|
|
68786
68786
|
});
|
|
68787
68787
|
|
|
68788
|
+
// src/commands/content/phases/sqlite-client.ts
|
|
68789
|
+
import BetterSqlite3 from "better-sqlite3";
|
|
68790
|
+
function openDatabase(dbPath) {
|
|
68791
|
+
return new BetterSqlite3(dbPath);
|
|
68792
|
+
}
|
|
68793
|
+
var init_sqlite_client = () => {};
|
|
68794
|
+
|
|
68788
68795
|
// src/commands/content/phases/db-manager.ts
|
|
68789
|
-
import { Database } from "bun:sqlite";
|
|
68790
68796
|
import { existsSync as existsSync72, mkdirSync as mkdirSync7 } from "node:fs";
|
|
68791
68797
|
import { dirname as dirname33 } from "node:path";
|
|
68792
68798
|
function initDatabase(dbPath) {
|
|
68793
68799
|
ensureParentDir(dbPath);
|
|
68794
|
-
const db =
|
|
68800
|
+
const db = openDatabase(dbPath);
|
|
68795
68801
|
db.exec("PRAGMA journal_mode = WAL");
|
|
68796
68802
|
db.exec("PRAGMA busy_timeout = 5000");
|
|
68797
68803
|
runMigrations(db);
|
|
@@ -68919,7 +68925,9 @@ var SCHEMA_V1 = `
|
|
|
68919
68925
|
`, SCHEMA_V2_RETRY_COUNT = `
|
|
68920
68926
|
ALTER TABLE git_events ADD COLUMN retry_count INTEGER NOT NULL DEFAULT 0;
|
|
68921
68927
|
`;
|
|
68922
|
-
var init_db_manager = () => {
|
|
68928
|
+
var init_db_manager = __esm(() => {
|
|
68929
|
+
init_sqlite_client();
|
|
68930
|
+
});
|
|
68923
68931
|
|
|
68924
68932
|
// src/commands/content/phases/engagement-tracker.ts
|
|
68925
68933
|
async function trackEngagement(db, adapters, config, contentLogger) {
|
|
@@ -69839,12 +69847,12 @@ var init_types6 = __esm(() => {
|
|
|
69839
69847
|
});
|
|
69840
69848
|
|
|
69841
69849
|
// src/commands/content/phases/state-manager.ts
|
|
69842
|
-
import { readFile as
|
|
69850
|
+
import { readFile as readFile56, rename as rename10, writeFile as writeFile36 } from "node:fs/promises";
|
|
69843
69851
|
import { join as join137 } from "node:path";
|
|
69844
69852
|
async function loadContentConfig(projectDir) {
|
|
69845
69853
|
const configPath = join137(projectDir, CK_CONFIG_FILE2);
|
|
69846
69854
|
try {
|
|
69847
|
-
const raw2 = await
|
|
69855
|
+
const raw2 = await readFile56(configPath, "utf-8");
|
|
69848
69856
|
const json = JSON.parse(raw2);
|
|
69849
69857
|
return ContentConfigSchema.parse(json.content ?? {});
|
|
69850
69858
|
} catch {
|
|
@@ -69860,7 +69868,7 @@ async function saveContentConfig(projectDir, config) {
|
|
|
69860
69868
|
async function loadContentState(projectDir) {
|
|
69861
69869
|
const configPath = join137(projectDir, CK_CONFIG_FILE2);
|
|
69862
69870
|
try {
|
|
69863
|
-
const raw2 = await
|
|
69871
|
+
const raw2 = await readFile56(configPath, "utf-8");
|
|
69864
69872
|
const json = JSON.parse(raw2);
|
|
69865
69873
|
const contentBlock = json.content ?? {};
|
|
69866
69874
|
return ContentStateSchema.parse(contentBlock.state ?? {});
|
|
@@ -69887,7 +69895,7 @@ async function saveContentState(projectDir, state) {
|
|
|
69887
69895
|
}
|
|
69888
69896
|
async function readJsonSafe(filePath) {
|
|
69889
69897
|
try {
|
|
69890
|
-
const raw2 = await
|
|
69898
|
+
const raw2 = await readFile56(filePath, "utf-8");
|
|
69891
69899
|
return JSON.parse(raw2);
|
|
69892
69900
|
} catch {
|
|
69893
69901
|
return {};
|
|
@@ -76959,7 +76967,7 @@ async function checkHooksExist(projectDir) {
|
|
|
76959
76967
|
init_logger();
|
|
76960
76968
|
init_path_resolver();
|
|
76961
76969
|
import { existsSync as existsSync46 } from "node:fs";
|
|
76962
|
-
import { readFile as
|
|
76970
|
+
import { readFile as readFile31 } from "node:fs/promises";
|
|
76963
76971
|
import { join as join56 } from "node:path";
|
|
76964
76972
|
async function checkSettingsValid(projectDir) {
|
|
76965
76973
|
const globalSettings = join56(PathResolver.getGlobalKitDir(), "settings.json");
|
|
@@ -76977,7 +76985,7 @@ async function checkSettingsValid(projectDir) {
|
|
|
76977
76985
|
};
|
|
76978
76986
|
}
|
|
76979
76987
|
try {
|
|
76980
|
-
const content = await
|
|
76988
|
+
const content = await readFile31(settingsPath, "utf-8");
|
|
76981
76989
|
JSON.parse(content);
|
|
76982
76990
|
return {
|
|
76983
76991
|
id: "ck-settings-valid",
|
|
@@ -77034,7 +77042,7 @@ async function checkSettingsValid(projectDir) {
|
|
|
77034
77042
|
init_logger();
|
|
77035
77043
|
init_path_resolver();
|
|
77036
77044
|
import { existsSync as existsSync47 } from "node:fs";
|
|
77037
|
-
import { readFile as
|
|
77045
|
+
import { readFile as readFile32 } from "node:fs/promises";
|
|
77038
77046
|
import { homedir as homedir28 } from "node:os";
|
|
77039
77047
|
import { dirname as dirname19, join as join57, normalize as normalize5, resolve as resolve14 } from "node:path";
|
|
77040
77048
|
async function checkPathRefsValid(projectDir) {
|
|
@@ -77053,7 +77061,7 @@ async function checkPathRefsValid(projectDir) {
|
|
|
77053
77061
|
};
|
|
77054
77062
|
}
|
|
77055
77063
|
try {
|
|
77056
|
-
const content = await
|
|
77064
|
+
const content = await readFile32(claudeMdPath, "utf-8");
|
|
77057
77065
|
const refPattern = /@([^\s\)]+)/g;
|
|
77058
77066
|
const refs = [...content.matchAll(refPattern)].map((m2) => m2[1]);
|
|
77059
77067
|
if (refs.length === 0) {
|
|
@@ -78696,7 +78704,7 @@ import { platform as platform6 } from "node:os";
|
|
|
78696
78704
|
// src/domains/health-checks/platform/environment-checker.ts
|
|
78697
78705
|
init_environment();
|
|
78698
78706
|
init_path_resolver();
|
|
78699
|
-
import { constants as constants3, access as access3, mkdir as mkdir14, readFile as
|
|
78707
|
+
import { constants as constants3, access as access3, mkdir as mkdir14, readFile as readFile34, unlink as unlink8, writeFile as writeFile17 } from "node:fs/promises";
|
|
78700
78708
|
import { arch as arch2, homedir as homedir29, platform as platform5 } from "node:os";
|
|
78701
78709
|
import { join as join63, normalize as normalize6 } from "node:path";
|
|
78702
78710
|
function shouldSkipExpensiveOperations4() {
|
|
@@ -78793,7 +78801,7 @@ async function checkGlobalDirAccess() {
|
|
|
78793
78801
|
try {
|
|
78794
78802
|
await mkdir14(globalDir, { recursive: true });
|
|
78795
78803
|
await writeFile17(testFile, "test", "utf-8");
|
|
78796
|
-
const content = await
|
|
78804
|
+
const content = await readFile34(testFile, "utf-8");
|
|
78797
78805
|
await unlink8(testFile);
|
|
78798
78806
|
if (content !== "test")
|
|
78799
78807
|
throw new Error("Read mismatch");
|
|
@@ -79686,7 +79694,7 @@ init_version_utils();
|
|
|
79686
79694
|
init_claudekit_constants();
|
|
79687
79695
|
init_logger();
|
|
79688
79696
|
init_path_resolver();
|
|
79689
|
-
import { mkdir as mkdir16, readFile as
|
|
79697
|
+
import { mkdir as mkdir16, readFile as readFile35, unlink as unlink10, writeFile as writeFile19 } from "node:fs/promises";
|
|
79690
79698
|
import { join as join66 } from "node:path";
|
|
79691
79699
|
var CACHE_TTL_HOURS = 24;
|
|
79692
79700
|
var DEFAULT_CACHE_TTL_MS = CACHE_TTL_HOURS * 60 * 60 * 1000;
|
|
@@ -79729,7 +79737,7 @@ class ConfigVersionChecker {
|
|
|
79729
79737
|
static async loadCache(kitType, global3) {
|
|
79730
79738
|
try {
|
|
79731
79739
|
const cachePath = ConfigVersionChecker.getCacheFilePath(kitType, global3);
|
|
79732
|
-
const data = await
|
|
79740
|
+
const data = await readFile35(cachePath, "utf8");
|
|
79733
79741
|
const parsed = JSON.parse(data);
|
|
79734
79742
|
if (typeof parsed !== "object" || parsed === null || typeof parsed.lastCheck !== "number" || typeof parsed.latestVersion !== "string" || !parsed.latestVersion || parsed.lastCheck < 0 || parsed.lastCheck > Date.now() + 7 * 24 * 60 * 60 * 1000) {
|
|
79735
79743
|
logger.debug("Invalid cache structure, ignoring");
|
|
@@ -79886,7 +79894,7 @@ class ConfigVersionChecker {
|
|
|
79886
79894
|
}
|
|
79887
79895
|
}
|
|
79888
79896
|
// src/domains/sync/sync-engine.ts
|
|
79889
|
-
import { lstat as lstat3, readFile as
|
|
79897
|
+
import { lstat as lstat3, readFile as readFile36, readlink, realpath as realpath3, stat as stat9 } from "node:fs/promises";
|
|
79890
79898
|
import { isAbsolute as isAbsolute3, join as join67, normalize as normalize7, relative as relative8 } from "node:path";
|
|
79891
79899
|
|
|
79892
79900
|
// src/services/file-operations/ownership-checker.ts
|
|
@@ -81470,7 +81478,7 @@ class SyncEngine {
|
|
|
81470
81478
|
if (lstats.size > MAX_SYNC_FILE_SIZE) {
|
|
81471
81479
|
throw new Error(`File too large for sync (${Math.round(lstats.size / 1024 / 1024)}MB > ${MAX_SYNC_FILE_SIZE / 1024 / 1024}MB limit)`);
|
|
81472
81480
|
}
|
|
81473
|
-
const buffer = await
|
|
81481
|
+
const buffer = await readFile36(filePath);
|
|
81474
81482
|
if (buffer.includes(0)) {
|
|
81475
81483
|
return { content: "", isBinary: true };
|
|
81476
81484
|
}
|
|
@@ -92668,7 +92676,7 @@ import { execSync as execSync4 } from "node:child_process";
|
|
|
92668
92676
|
// src/domains/config/installed-settings-tracker.ts
|
|
92669
92677
|
init_shared();
|
|
92670
92678
|
import { existsSync as existsSync56 } from "node:fs";
|
|
92671
|
-
import { mkdir as mkdir26, readFile as
|
|
92679
|
+
import { mkdir as mkdir26, readFile as readFile40, writeFile as writeFile22 } from "node:fs/promises";
|
|
92672
92680
|
import { dirname as dirname25, join as join87 } from "node:path";
|
|
92673
92681
|
var CK_JSON_FILE = ".ck.json";
|
|
92674
92682
|
|
|
@@ -92693,7 +92701,7 @@ class InstalledSettingsTracker {
|
|
|
92693
92701
|
return { hooks: [], mcpServers: [] };
|
|
92694
92702
|
}
|
|
92695
92703
|
try {
|
|
92696
|
-
const content = await
|
|
92704
|
+
const content = await readFile40(ckJsonPath, "utf-8");
|
|
92697
92705
|
const data = JSON.parse(content);
|
|
92698
92706
|
const installed = data.kits?.[this.kitName]?.installedSettings;
|
|
92699
92707
|
if (installed) {
|
|
@@ -92710,7 +92718,7 @@ class InstalledSettingsTracker {
|
|
|
92710
92718
|
try {
|
|
92711
92719
|
let data = {};
|
|
92712
92720
|
if (existsSync56(ckJsonPath)) {
|
|
92713
|
-
const content = await
|
|
92721
|
+
const content = await readFile40(ckJsonPath, "utf-8");
|
|
92714
92722
|
data = JSON.parse(content);
|
|
92715
92723
|
}
|
|
92716
92724
|
if (!data.kits) {
|
|
@@ -94172,7 +94180,7 @@ import { join as join95 } from "node:path";
|
|
|
94172
94180
|
|
|
94173
94181
|
// src/services/transformers/commands-prefix/content-transformer.ts
|
|
94174
94182
|
init_logger();
|
|
94175
|
-
import { readFile as
|
|
94183
|
+
import { readFile as readFile44, readdir as readdir20, writeFile as writeFile26 } from "node:fs/promises";
|
|
94176
94184
|
import { join as join94 } from "node:path";
|
|
94177
94185
|
var TRANSFORMABLE_EXTENSIONS = new Set([
|
|
94178
94186
|
".md",
|
|
@@ -94242,7 +94250,7 @@ async function transformCommandReferences(directory, options2 = {}) {
|
|
|
94242
94250
|
await processDirectory(fullPath);
|
|
94243
94251
|
} else if (entry.isFile() && shouldTransformFile(entry.name)) {
|
|
94244
94252
|
try {
|
|
94245
|
-
const content = await
|
|
94253
|
+
const content = await readFile44(fullPath, "utf-8");
|
|
94246
94254
|
const { transformed, changes } = transformCommandContent(content);
|
|
94247
94255
|
if (changes > 0) {
|
|
94248
94256
|
if (options2.dryRun) {
|
|
@@ -94779,7 +94787,7 @@ init_skip_directories();
|
|
|
94779
94787
|
init_types3();
|
|
94780
94788
|
var import_fs_extra21 = __toESM(require_lib3(), 1);
|
|
94781
94789
|
import { createHash as createHash4 } from "node:crypto";
|
|
94782
|
-
import { readFile as
|
|
94790
|
+
import { readFile as readFile46, readdir as readdir24, writeFile as writeFile27 } from "node:fs/promises";
|
|
94783
94791
|
import { join as join99, relative as relative16 } from "node:path";
|
|
94784
94792
|
|
|
94785
94793
|
class SkillsManifestManager {
|
|
@@ -94813,7 +94821,7 @@ class SkillsManifestManager {
|
|
|
94813
94821
|
return null;
|
|
94814
94822
|
}
|
|
94815
94823
|
try {
|
|
94816
|
-
const content = await
|
|
94824
|
+
const content = await readFile46(manifestPath, "utf-8");
|
|
94817
94825
|
const data = JSON.parse(content);
|
|
94818
94826
|
const manifest = SkillsManifestSchema.parse(data);
|
|
94819
94827
|
logger.debug(`Read manifest from: ${manifestPath}`);
|
|
@@ -94885,7 +94893,7 @@ class SkillsManifestManager {
|
|
|
94885
94893
|
files.sort();
|
|
94886
94894
|
for (const file of files) {
|
|
94887
94895
|
const relativePath = relative16(dirPath, file);
|
|
94888
|
-
const content = await
|
|
94896
|
+
const content = await readFile46(file);
|
|
94889
94897
|
hash.update(relativePath);
|
|
94890
94898
|
hash.update(content);
|
|
94891
94899
|
}
|
|
@@ -95625,7 +95633,7 @@ import { relative as relative18 } from "node:path";
|
|
|
95625
95633
|
init_skip_directories();
|
|
95626
95634
|
import { createHash as createHash5 } from "node:crypto";
|
|
95627
95635
|
import { createReadStream as createReadStream3 } from "node:fs";
|
|
95628
|
-
import { readFile as
|
|
95636
|
+
import { readFile as readFile47, readdir as readdir28 } from "node:fs/promises";
|
|
95629
95637
|
import { join as join103, relative as relative17 } from "node:path";
|
|
95630
95638
|
async function getAllFiles(dirPath) {
|
|
95631
95639
|
const files = [];
|
|
@@ -95664,7 +95672,7 @@ async function hashDirectory(dirPath) {
|
|
|
95664
95672
|
files.sort();
|
|
95665
95673
|
for (const file of files) {
|
|
95666
95674
|
const relativePath = relative17(dirPath, file);
|
|
95667
|
-
const content = await
|
|
95675
|
+
const content = await readFile47(file);
|
|
95668
95676
|
hash.update(relativePath);
|
|
95669
95677
|
hash.update(content);
|
|
95670
95678
|
}
|
|
@@ -95998,7 +96006,7 @@ import { join as join108 } from "node:path";
|
|
|
95998
96006
|
|
|
95999
96007
|
// src/services/transformers/opencode-path-transformer.ts
|
|
96000
96008
|
init_logger();
|
|
96001
|
-
import { readFile as
|
|
96009
|
+
import { readFile as readFile48, readdir as readdir30, writeFile as writeFile28 } from "node:fs/promises";
|
|
96002
96010
|
import { platform as platform12 } from "node:os";
|
|
96003
96011
|
import { extname as extname5, join as join107 } from "node:path";
|
|
96004
96012
|
var IS_WINDOWS2 = platform12() === "win32";
|
|
@@ -96069,7 +96077,7 @@ async function transformPathsForGlobalOpenCode(directory, options2 = {}) {
|
|
|
96069
96077
|
await processDirectory2(fullPath);
|
|
96070
96078
|
} else if (entry.isFile() && shouldTransformFile2(entry.name)) {
|
|
96071
96079
|
try {
|
|
96072
|
-
const content = await
|
|
96080
|
+
const content = await readFile48(fullPath, "utf-8");
|
|
96073
96081
|
const { transformed, changes } = transformOpenCodeContent(content);
|
|
96074
96082
|
if (changes > 0) {
|
|
96075
96083
|
await writeFile28(fullPath, transformed, "utf-8");
|
|
@@ -96975,7 +96983,7 @@ async function handleSelection(ctx) {
|
|
|
96975
96983
|
};
|
|
96976
96984
|
}
|
|
96977
96985
|
// src/commands/init/phases/sync-handler.ts
|
|
96978
|
-
import { copyFile as copyFile8, mkdir as mkdir31, open as open5, readFile as
|
|
96986
|
+
import { copyFile as copyFile8, mkdir as mkdir31, open as open5, readFile as readFile50, rename as rename6, stat as stat17, unlink as unlink11, writeFile as writeFile30 } from "node:fs/promises";
|
|
96979
96987
|
import { dirname as dirname28, join as join112, resolve as resolve24 } from "node:path";
|
|
96980
96988
|
init_logger();
|
|
96981
96989
|
init_path_resolver();
|
|
@@ -97143,7 +97151,7 @@ async function executeSyncMerge(ctx) {
|
|
|
97143
97151
|
try {
|
|
97144
97152
|
const sourceMetadataPath = join112(upstreamDir, "metadata.json");
|
|
97145
97153
|
if (await import_fs_extra33.pathExists(sourceMetadataPath)) {
|
|
97146
|
-
const content = await
|
|
97154
|
+
const content = await readFile50(sourceMetadataPath, "utf-8");
|
|
97147
97155
|
const sourceMetadata = JSON.parse(content);
|
|
97148
97156
|
deletions = sourceMetadata.deletions || [];
|
|
97149
97157
|
}
|
|
@@ -97441,7 +97449,7 @@ async function renameFolders(dirsToRename, extractDir, options2) {
|
|
|
97441
97449
|
// src/services/transformers/folder-transform/path-replacer.ts
|
|
97442
97450
|
init_logger();
|
|
97443
97451
|
init_types3();
|
|
97444
|
-
import { readFile as
|
|
97452
|
+
import { readFile as readFile51, readdir as readdir32, writeFile as writeFile31 } from "node:fs/promises";
|
|
97445
97453
|
import { join as join114, relative as relative20 } from "node:path";
|
|
97446
97454
|
var TRANSFORMABLE_FILE_PATTERNS = [
|
|
97447
97455
|
".md",
|
|
@@ -97508,7 +97516,7 @@ async function transformFileContents(dir, compiledReplacements, options2) {
|
|
|
97508
97516
|
if (!shouldTransform)
|
|
97509
97517
|
continue;
|
|
97510
97518
|
try {
|
|
97511
|
-
const content = await
|
|
97519
|
+
const content = await readFile51(fullPath, "utf-8");
|
|
97512
97520
|
let newContent = content;
|
|
97513
97521
|
let changeCount = 0;
|
|
97514
97522
|
for (const { regex: regex2, replacement } of compiledReplacements) {
|
|
@@ -97630,7 +97638,7 @@ async function transformFolderPaths(extractDir, folders, options2 = {}) {
|
|
|
97630
97638
|
|
|
97631
97639
|
// src/services/transformers/global-path-transformer.ts
|
|
97632
97640
|
init_logger();
|
|
97633
|
-
import { readFile as
|
|
97641
|
+
import { readFile as readFile52, readdir as readdir33, writeFile as writeFile32 } from "node:fs/promises";
|
|
97634
97642
|
import { platform as platform13 } from "node:os";
|
|
97635
97643
|
import { extname as extname6, join as join115 } from "node:path";
|
|
97636
97644
|
var IS_WINDOWS3 = platform13() === "win32";
|
|
@@ -97752,7 +97760,7 @@ async function transformPathsForGlobalInstall(directory, options2 = {}) {
|
|
|
97752
97760
|
await processDirectory2(fullPath);
|
|
97753
97761
|
} else if (entry.isFile() && shouldTransformFile3(entry.name)) {
|
|
97754
97762
|
try {
|
|
97755
|
-
const content = await
|
|
97763
|
+
const content = await readFile52(fullPath, "utf-8");
|
|
97756
97764
|
const { transformed, changes } = transformContent(content);
|
|
97757
97765
|
if (changes > 0) {
|
|
97758
97766
|
await writeFile32(fullPath, transformed, "utf-8");
|
|
@@ -98010,7 +98018,7 @@ async function initCommand(options2) {
|
|
|
98010
98018
|
init_dist2();
|
|
98011
98019
|
var import_picocolors28 = __toESM(require_picocolors(), 1);
|
|
98012
98020
|
import { existsSync as existsSync58 } from "node:fs";
|
|
98013
|
-
import { readFile as
|
|
98021
|
+
import { readFile as readFile53, rm as rm15, unlink as unlink12 } from "node:fs/promises";
|
|
98014
98022
|
import { homedir as homedir31 } from "node:os";
|
|
98015
98023
|
import { basename as basename16, join as join117, resolve as resolve25 } from "node:path";
|
|
98016
98024
|
init_logger();
|
|
@@ -98442,7 +98450,7 @@ async function processMetadataDeletions(skillSourcePath, installGlobally) {
|
|
|
98442
98450
|
return;
|
|
98443
98451
|
let sourceMetadata;
|
|
98444
98452
|
try {
|
|
98445
|
-
const content = await
|
|
98453
|
+
const content = await readFile53(sourceMetadataPath, "utf-8");
|
|
98446
98454
|
sourceMetadata = JSON.parse(content);
|
|
98447
98455
|
} catch (error) {
|
|
98448
98456
|
logger.debug(`[migrate] Failed to parse source metadata.json: ${error}`);
|
|
@@ -98702,7 +98710,7 @@ async function migrateCommand(options2) {
|
|
|
98702
98710
|
for (const action of conflictActions) {
|
|
98703
98711
|
if (!action.diff && action.targetPath && existsSync58(action.targetPath)) {
|
|
98704
98712
|
try {
|
|
98705
|
-
const targetContent = await
|
|
98713
|
+
const targetContent = await readFile53(action.targetPath, "utf-8");
|
|
98706
98714
|
const sourceItem = agents2.find((a3) => a3.name === action.item) || commands.find((c2) => c2.name === action.item) || (configItem?.name === action.item ? configItem : null) || ruleItems.find((r2) => r2.name === action.item) || hookItems.find((h2) => h2.name === action.item);
|
|
98707
98715
|
if (sourceItem) {
|
|
98708
98716
|
const providerConfig = providers[action.provider];
|
|
@@ -102599,7 +102607,7 @@ init_ck_config_manager();
|
|
|
102599
102607
|
init_file_io();
|
|
102600
102608
|
init_logger();
|
|
102601
102609
|
import { existsSync as existsSync63 } from "node:fs";
|
|
102602
|
-
import { mkdir as mkdir33, readFile as
|
|
102610
|
+
import { mkdir as mkdir33, readFile as readFile55 } from "node:fs/promises";
|
|
102603
102611
|
import { dirname as dirname32 } from "node:path";
|
|
102604
102612
|
var PROCESSED_ISSUES_CAP = 500;
|
|
102605
102613
|
async function readCkJson(projectDir) {
|
|
@@ -102607,7 +102615,7 @@ async function readCkJson(projectDir) {
|
|
|
102607
102615
|
try {
|
|
102608
102616
|
if (!existsSync63(configPath))
|
|
102609
102617
|
return {};
|
|
102610
|
-
const content = await
|
|
102618
|
+
const content = await readFile55(configPath, "utf-8");
|
|
102611
102619
|
return JSON.parse(content);
|
|
102612
102620
|
} catch (error) {
|
|
102613
102621
|
logger.warning(`Failed to parse .ck.json: ${error instanceof Error ? error.message : "Unknown"}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudekit-cli",
|
|
3
|
-
"version": "3.40.
|
|
3
|
+
"version": "3.40.1",
|
|
4
4
|
"description": "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dashboard:dev": "cd src/ui && bun install --silent && cd ../.. && bun run src/index.ts config ui --dev",
|
|
25
25
|
"ui:build": "cd src/ui && bun install --silent && bun run build",
|
|
26
26
|
"ui:dev": "cd src/ui && bun run dev",
|
|
27
|
-
"build": "bun build src/index.ts --outdir dist --target node --external @octokit/rest && node -e \"const fs=require('fs'),f='dist/index.js',c=fs.readFileSync(f,'utf-8');fs.writeFileSync(f,c.replace(/^#!.*\\n\\/\\/ @bun\\n/,''))\"",
|
|
27
|
+
"build": "bun build src/index.ts --outdir dist --target node --external @octokit/rest --external better-sqlite3 && node -e \"const fs=require('fs'),f='dist/index.js',c=fs.readFileSync(f,'utf-8');fs.writeFileSync(f,c.replace(/^#!.*\\n\\/\\/ @bun\\n/,''))\"",
|
|
28
28
|
"verify:package": "node scripts/prepublish-check.js",
|
|
29
29
|
"test": "bun test",
|
|
30
30
|
"test:integration": "CK_RUN_CLI_INTEGRATION=1 bun test tests/integration/cli.test.ts",
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
"author": "ClaudeKit",
|
|
53
53
|
"license": "MIT",
|
|
54
54
|
"engines": {
|
|
55
|
-
"bun": ">=1.3.2",
|
|
56
55
|
"node": ">=18.0.0"
|
|
57
56
|
},
|
|
58
57
|
"dependencies": {
|