claudekit-cli 3.41.4-dev.4 → 3.41.4-dev.6
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 +12 -0
- package/dist/index.js +52 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -148,6 +148,10 @@ ck new --prefix
|
|
|
148
148
|
# Offline installation (from local archive or directory)
|
|
149
149
|
ck new --archive ~/downloads/engineer-v1.16.0.zip
|
|
150
150
|
ck new --kit-path ~/extracted-kit/
|
|
151
|
+
|
|
152
|
+
# Direct repo downloads are also supported
|
|
153
|
+
ck new --archive ~/downloads/claudekit-engineer-main.zip
|
|
154
|
+
ck new --kit-path ~/downloads/claudekit-engineer-main/
|
|
151
155
|
```
|
|
152
156
|
|
|
153
157
|
**Flags:**
|
|
@@ -158,6 +162,8 @@ ck new --kit-path ~/extracted-kit/
|
|
|
158
162
|
- `--archive <path>`: Use local archive (zip/tar.gz) instead of downloading
|
|
159
163
|
- `--kit-path <path>`: Use local kit directory instead of downloading
|
|
160
164
|
|
|
165
|
+
`--archive` and `--kit-path` both accept direct repo downloads with a single wrapper directory, including GitHub "Download ZIP" archives and extracted repo folders that still contain `claudekit-engineer-main/` or similar at the top level.
|
|
166
|
+
|
|
161
167
|
### Initialize or Update Project
|
|
162
168
|
|
|
163
169
|
**Note:** Run from project root.
|
|
@@ -188,6 +194,10 @@ ck init --exclude "*.local" --prefix
|
|
|
188
194
|
# Offline installation (from local archive or directory)
|
|
189
195
|
ck init --archive ~/downloads/engineer-v1.16.0.zip
|
|
190
196
|
ck init --kit-path ~/extracted-kit/
|
|
197
|
+
|
|
198
|
+
# Direct repo downloads are also supported
|
|
199
|
+
ck init --archive ~/downloads/claudekit-engineer-main.zip
|
|
200
|
+
ck init --kit-path ~/downloads/claudekit-engineer-main/
|
|
191
201
|
```
|
|
192
202
|
|
|
193
203
|
**Flags:**
|
|
@@ -199,6 +209,8 @@ ck init --kit-path ~/extracted-kit/
|
|
|
199
209
|
- `--archive <path>`: Use local archive (zip/tar.gz) instead of downloading
|
|
200
210
|
- `--kit-path <path>`: Use local kit directory instead of downloading
|
|
201
211
|
|
|
212
|
+
`--archive` and `--kit-path` both accept direct repo downloads with a single wrapper directory, including GitHub "Download ZIP" archives and extracted repo folders that still contain `claudekit-engineer-main/` or similar at the top level.
|
|
213
|
+
|
|
202
214
|
**Default Behavior with `-y` Flag:**
|
|
203
215
|
|
|
204
216
|
| Prompt | Default |
|
package/dist/index.js
CHANGED
|
@@ -56454,7 +56454,7 @@ function extractResultContent(block) {
|
|
|
56454
56454
|
return;
|
|
56455
56455
|
}
|
|
56456
56456
|
async function parseSessionDetail(filePath, limit, offset) {
|
|
56457
|
-
const MAX_SESSION_FILE_BYTES =
|
|
56457
|
+
const MAX_SESSION_FILE_BYTES = 50 * 1024 * 1024;
|
|
56458
56458
|
const fileStats = await stat8(filePath);
|
|
56459
56459
|
if (fileStats.size > MAX_SESSION_FILE_BYTES) {
|
|
56460
56460
|
return {
|
|
@@ -58323,7 +58323,7 @@ var package_default;
|
|
|
58323
58323
|
var init_package = __esm(() => {
|
|
58324
58324
|
package_default = {
|
|
58325
58325
|
name: "claudekit-cli",
|
|
58326
|
-
version: "3.41.4-dev.
|
|
58326
|
+
version: "3.41.4-dev.6",
|
|
58327
58327
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
58328
58328
|
type: "module",
|
|
58329
58329
|
repository: {
|
|
@@ -93126,7 +93126,6 @@ Solutions:
|
|
|
93126
93126
|
init_kit_layout();
|
|
93127
93127
|
init_logger();
|
|
93128
93128
|
init_output_manager();
|
|
93129
|
-
init_types3();
|
|
93130
93129
|
var RELEASE_ROOT_ALLOWLIST = [
|
|
93131
93130
|
"plans",
|
|
93132
93131
|
"CLAUDE.md",
|
|
@@ -93137,6 +93136,8 @@ var RELEASE_ROOT_ALLOWLIST = [
|
|
|
93137
93136
|
".opencode",
|
|
93138
93137
|
"release-manifest.json"
|
|
93139
93138
|
];
|
|
93139
|
+
var NESTED_KIT_ROOT_MAX_LEVELS = 5;
|
|
93140
|
+
var IGNORED_WRAPPER_ENTRY_NAMES = new Set([".DS_Store", "__MACOSX"]);
|
|
93140
93141
|
function buildReleaseAllowlist(layout) {
|
|
93141
93142
|
return [...new Set([layout.sourceDir, ...RELEASE_ROOT_ALLOWLIST])];
|
|
93142
93143
|
}
|
|
@@ -93171,6 +93172,33 @@ async function materializeRuntimeLayoutInPlace(projectRoot, layout) {
|
|
|
93171
93172
|
await fs19.promises.rm(runtimeDir, { recursive: true, force: true });
|
|
93172
93173
|
await fs19.promises.rename(sourceDir, runtimeDir);
|
|
93173
93174
|
}
|
|
93175
|
+
function isIgnoredWrapperEntry(entryName) {
|
|
93176
|
+
const normalizedName = entryName.toLowerCase();
|
|
93177
|
+
return IGNORED_WRAPPER_ENTRY_NAMES.has(entryName) || normalizedName === "thumbs.db" || normalizedName === "desktop.ini" || entryName.startsWith("._");
|
|
93178
|
+
}
|
|
93179
|
+
async function listVisibleEntries(projectRoot) {
|
|
93180
|
+
return (await fs19.promises.readdir(projectRoot, { withFileTypes: true })).filter((entry) => !isIgnoredWrapperEntry(entry.name));
|
|
93181
|
+
}
|
|
93182
|
+
function isLikelyKitRoot(projectRoot, entries) {
|
|
93183
|
+
const entrySet = new Set(entries.map((entry) => entry.name));
|
|
93184
|
+
const layout = resolveKitLayout(projectRoot);
|
|
93185
|
+
return entrySet.has("CLAUDE.md") || entrySet.has(layout.runtimeDir) || entrySet.has(layout.sourceDir) || entrySet.has("claude");
|
|
93186
|
+
}
|
|
93187
|
+
async function resolveOfflineKitRoot(rootDir) {
|
|
93188
|
+
let currentDir = rootDir;
|
|
93189
|
+
for (let level = 0;level < NESTED_KIT_ROOT_MAX_LEVELS; level++) {
|
|
93190
|
+
const entries = await listVisibleEntries(currentDir);
|
|
93191
|
+
if (isLikelyKitRoot(currentDir, entries)) {
|
|
93192
|
+
return currentDir;
|
|
93193
|
+
}
|
|
93194
|
+
const childDirectories = entries.filter((entry) => entry.isDirectory());
|
|
93195
|
+
if (entries.length !== 1 || childDirectories.length !== 1) {
|
|
93196
|
+
break;
|
|
93197
|
+
}
|
|
93198
|
+
currentDir = path14.join(currentDir, childDirectories[0].name);
|
|
93199
|
+
}
|
|
93200
|
+
return rootDir;
|
|
93201
|
+
}
|
|
93174
93202
|
async function stageLocalKitPathForRuntimeLayout(kitRoot, layout) {
|
|
93175
93203
|
const sourceDir = await ensureLayoutSourceDir(kitRoot, layout, false);
|
|
93176
93204
|
if (!sourceDir) {
|
|
@@ -93326,11 +93354,15 @@ Please verify the path exists and is accessible.`);
|
|
|
93326
93354
|
}
|
|
93327
93355
|
throw error;
|
|
93328
93356
|
}
|
|
93329
|
-
const
|
|
93357
|
+
const kitRoot = await resolveOfflineKitRoot(absolutePath);
|
|
93358
|
+
if (kitRoot !== absolutePath) {
|
|
93359
|
+
logger.info(`Detected nested kit root: ${kitRoot}`);
|
|
93360
|
+
}
|
|
93361
|
+
const layout = resolveKitLayout(kitRoot);
|
|
93330
93362
|
if (layout.sourceDir !== layout.runtimeDir) {
|
|
93331
|
-
const stagedKit = await stageLocalKitPathForRuntimeLayout(
|
|
93363
|
+
const stagedKit = await stageLocalKitPathForRuntimeLayout(kitRoot, layout);
|
|
93332
93364
|
if (stagedKit) {
|
|
93333
|
-
logger.info(`Using kit from: ${
|
|
93365
|
+
logger.info(`Using kit from: ${kitRoot}`);
|
|
93334
93366
|
return {
|
|
93335
93367
|
tempDir: stagedKit.tempDir,
|
|
93336
93368
|
archivePath: "",
|
|
@@ -93338,7 +93370,7 @@ Please verify the path exists and is accessible.`);
|
|
|
93338
93370
|
};
|
|
93339
93371
|
}
|
|
93340
93372
|
}
|
|
93341
|
-
const claudeDir3 = path14.join(
|
|
93373
|
+
const claudeDir3 = path14.join(kitRoot, layout.runtimeDir);
|
|
93342
93374
|
try {
|
|
93343
93375
|
const stat15 = await fs19.promises.stat(claudeDir3);
|
|
93344
93376
|
if (!stat15.isDirectory()) {
|
|
@@ -93347,15 +93379,15 @@ This may not be a valid ClaudeKit installation.`);
|
|
|
93347
93379
|
}
|
|
93348
93380
|
} catch (error) {
|
|
93349
93381
|
if (error.code === "ENOENT") {
|
|
93350
|
-
logger.warning(`Warning: No .
|
|
93382
|
+
logger.warning(`Warning: No ${layout.runtimeDir} directory found in ${kitRoot}
|
|
93351
93383
|
This may not be a valid ClaudeKit installation. Proceeding anyway...`);
|
|
93352
93384
|
}
|
|
93353
93385
|
}
|
|
93354
|
-
logger.info(`Using kit from: ${
|
|
93386
|
+
logger.info(`Using kit from: ${kitRoot}`);
|
|
93355
93387
|
return {
|
|
93356
93388
|
tempDir: absolutePath,
|
|
93357
93389
|
archivePath: "",
|
|
93358
|
-
extractDir:
|
|
93390
|
+
extractDir: kitRoot
|
|
93359
93391
|
};
|
|
93360
93392
|
}
|
|
93361
93393
|
var VALID_ARCHIVE_FORMATS = [".zip", ".tar.gz", ".tgz", ".tar"];
|
|
@@ -93404,12 +93436,20 @@ Please verify the file exists and is accessible.`);
|
|
|
93404
93436
|
const extractDir = `${tempDir}/extracted`;
|
|
93405
93437
|
logger.verbose("Extraction", { archivePath: absolutePath, extractDir });
|
|
93406
93438
|
await downloadManager.extractArchive(absolutePath, extractDir);
|
|
93407
|
-
await
|
|
93439
|
+
const kitRoot = await resolveOfflineKitRoot(extractDir);
|
|
93440
|
+
if (kitRoot !== extractDir) {
|
|
93441
|
+
logger.info(`Detected nested kit root in archive: ${kitRoot}`);
|
|
93442
|
+
}
|
|
93443
|
+
const layout = resolveKitLayout(kitRoot);
|
|
93444
|
+
if (layout.sourceDir !== layout.runtimeDir && await ensureLayoutSourceDir(kitRoot, layout, false)) {
|
|
93445
|
+
await materializeRuntimeLayoutInPlace(kitRoot, layout);
|
|
93446
|
+
}
|
|
93447
|
+
await downloadManager.validateExtraction(kitRoot);
|
|
93408
93448
|
logger.info(`Extracted from: ${absolutePath}`);
|
|
93409
93449
|
return {
|
|
93410
93450
|
tempDir,
|
|
93411
93451
|
archivePath: absolutePath,
|
|
93412
|
-
extractDir
|
|
93452
|
+
extractDir: kitRoot
|
|
93413
93453
|
};
|
|
93414
93454
|
}
|
|
93415
93455
|
async function downloadViaGitClone(release, kit) {
|