claudekit-cli 3.41.0-dev.2 → 3.41.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/dist/index.js
CHANGED
|
@@ -14880,7 +14880,7 @@ var init_ck_config = __esm(() => {
|
|
|
14880
14880
|
"gemini-3-flash": "gemini-3-flash-preview",
|
|
14881
14881
|
"gemini-3-pro": "gemini-3-pro-preview"
|
|
14882
14882
|
};
|
|
14883
|
-
GeminiModelSchema = exports_external.
|
|
14883
|
+
GeminiModelSchema = exports_external.enum(GEMINI_MODEL_VALUES);
|
|
14884
14884
|
StatuslineModeSchema = exports_external.enum(["full", "compact", "minimal", "none"]);
|
|
14885
14885
|
StatuslineSectionIdSchema = exports_external.enum([
|
|
14886
14886
|
"model",
|
|
@@ -15193,7 +15193,6 @@ __export(exports_types, {
|
|
|
15193
15193
|
GitHubReleaseAssetSchema: () => GitHubReleaseAssetSchema,
|
|
15194
15194
|
GitHubError: () => GitHubError,
|
|
15195
15195
|
GeminiModelSchema: () => GeminiModelSchema,
|
|
15196
|
-
GEMINI_MODEL_VALUES: () => GEMINI_MODEL_VALUES,
|
|
15197
15196
|
FrameworkSchema: () => FrameworkSchema,
|
|
15198
15197
|
FoldersConfigSchema: () => FoldersConfigSchema,
|
|
15199
15198
|
ExtractionError: () => ExtractionError,
|
|
@@ -57633,7 +57632,7 @@ var package_default;
|
|
|
57633
57632
|
var init_package = __esm(() => {
|
|
57634
57633
|
package_default = {
|
|
57635
57634
|
name: "claudekit-cli",
|
|
57636
|
-
version: "3.41.
|
|
57635
|
+
version: "3.41.1",
|
|
57637
57636
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
57638
57637
|
type: "module",
|
|
57639
57638
|
repository: {
|
|
@@ -68344,7 +68343,7 @@ var init_content_validator = __esm(() => {
|
|
|
68344
68343
|
import { createHash as createHash6 } from "node:crypto";
|
|
68345
68344
|
import { existsSync as existsSync66, mkdirSync as mkdirSync4, readFileSync as readFileSync15, readdirSync as readdirSync8, statSync as statSync10 } from "node:fs";
|
|
68346
68345
|
import { rename as rename9, writeFile as writeFile35 } from "node:fs/promises";
|
|
68347
|
-
import { homedir as
|
|
68346
|
+
import { homedir as homedir34 } from "node:os";
|
|
68348
68347
|
import { basename as basename19, join as join132 } from "node:path";
|
|
68349
68348
|
function getCachedContext(repoPath) {
|
|
68350
68349
|
const cachePath = getCacheFilePath(repoPath);
|
|
@@ -68419,7 +68418,7 @@ function getCacheFilePath(repoPath) {
|
|
|
68419
68418
|
}
|
|
68420
68419
|
var CACHE_DIR, CACHE_TTL_MS4;
|
|
68421
68420
|
var init_context_cache_manager = __esm(() => {
|
|
68422
|
-
CACHE_DIR = join132(
|
|
68421
|
+
CACHE_DIR = join132(homedir34(), ".claudekit", "cache");
|
|
68423
68422
|
CACHE_TTL_MS4 = 24 * 60 * 60 * 1000;
|
|
68424
68423
|
});
|
|
68425
68424
|
|
|
@@ -68873,10 +68872,10 @@ IMPORTANT: Generate the image and output the path as JSON: {"imagePath": "/path/
|
|
|
68873
68872
|
// src/commands/content/phases/photo-generator.ts
|
|
68874
68873
|
import { execSync as execSync7 } from "node:child_process";
|
|
68875
68874
|
import { existsSync as existsSync68, mkdirSync as mkdirSync5, readdirSync as readdirSync10 } from "node:fs";
|
|
68876
|
-
import { homedir as
|
|
68875
|
+
import { homedir as homedir35 } from "node:os";
|
|
68877
68876
|
import { join as join134 } from "node:path";
|
|
68878
68877
|
async function generatePhoto(_content, context, config, platform14, contentId, contentLogger) {
|
|
68879
|
-
const mediaDir = join134(config.contentDir.replace(/^~/,
|
|
68878
|
+
const mediaDir = join134(config.contentDir.replace(/^~/, homedir35()), "media", String(contentId));
|
|
68880
68879
|
if (!existsSync68(mediaDir)) {
|
|
68881
68880
|
mkdirSync5(mediaDir, { recursive: true });
|
|
68882
68881
|
}
|
|
@@ -68990,7 +68989,7 @@ var init_content_creator = __esm(() => {
|
|
|
68990
68989
|
|
|
68991
68990
|
// src/commands/content/phases/content-logger.ts
|
|
68992
68991
|
import { createWriteStream as createWriteStream4, existsSync as existsSync69, mkdirSync as mkdirSync6, statSync as statSync11 } from "node:fs";
|
|
68993
|
-
import { homedir as
|
|
68992
|
+
import { homedir as homedir36 } from "node:os";
|
|
68994
68993
|
import { join as join135 } from "node:path";
|
|
68995
68994
|
|
|
68996
68995
|
class ContentLogger {
|
|
@@ -68999,7 +68998,7 @@ class ContentLogger {
|
|
|
68999
68998
|
logDir;
|
|
69000
68999
|
maxBytes;
|
|
69001
69000
|
constructor(maxBytes = 0) {
|
|
69002
|
-
this.logDir = join135(
|
|
69001
|
+
this.logDir = join135(homedir36(), ".claudekit", "logs");
|
|
69003
69002
|
this.maxBytes = maxBytes;
|
|
69004
69003
|
}
|
|
69005
69004
|
init() {
|
|
@@ -70598,11 +70597,11 @@ var init_setup_wizard = __esm(() => {
|
|
|
70598
70597
|
|
|
70599
70598
|
// src/commands/content/content-review-commands.ts
|
|
70600
70599
|
import { existsSync as existsSync73 } from "node:fs";
|
|
70601
|
-
import { homedir as
|
|
70600
|
+
import { homedir as homedir37 } from "node:os";
|
|
70602
70601
|
async function queueContent() {
|
|
70603
70602
|
const cwd2 = process.cwd();
|
|
70604
70603
|
const config = await loadContentConfig(cwd2);
|
|
70605
|
-
const dbPath = config.dbPath.replace(/^~/,
|
|
70604
|
+
const dbPath = config.dbPath.replace(/^~/, homedir37());
|
|
70606
70605
|
if (!existsSync73(dbPath)) {
|
|
70607
70606
|
logger.info("No content database found. Run 'ck content setup' first.");
|
|
70608
70607
|
return;
|
|
@@ -70629,7 +70628,7 @@ async function queueContent() {
|
|
|
70629
70628
|
async function approveContentCmd(id) {
|
|
70630
70629
|
const cwd2 = process.cwd();
|
|
70631
70630
|
const config = await loadContentConfig(cwd2);
|
|
70632
|
-
const dbPath = config.dbPath.replace(/^~/,
|
|
70631
|
+
const dbPath = config.dbPath.replace(/^~/, homedir37());
|
|
70633
70632
|
const db = initDatabase(dbPath);
|
|
70634
70633
|
try {
|
|
70635
70634
|
approveContent(db, Number.parseInt(id, 10));
|
|
@@ -70641,7 +70640,7 @@ async function approveContentCmd(id) {
|
|
|
70641
70640
|
async function rejectContentCmd(id, reason) {
|
|
70642
70641
|
const cwd2 = process.cwd();
|
|
70643
70642
|
const config = await loadContentConfig(cwd2);
|
|
70644
|
-
const dbPath = config.dbPath.replace(/^~/,
|
|
70643
|
+
const dbPath = config.dbPath.replace(/^~/, homedir37());
|
|
70645
70644
|
const db = initDatabase(dbPath);
|
|
70646
70645
|
try {
|
|
70647
70646
|
rejectContent(db, Number.parseInt(id, 10), reason);
|
|
@@ -70672,7 +70671,7 @@ __export(exports_content_subcommands, {
|
|
|
70672
70671
|
approveContentCmd: () => approveContentCmd
|
|
70673
70672
|
});
|
|
70674
70673
|
import { existsSync as existsSync74, readFileSync as readFileSync18, unlinkSync as unlinkSync5 } from "node:fs";
|
|
70675
|
-
import { homedir as
|
|
70674
|
+
import { homedir as homedir38 } from "node:os";
|
|
70676
70675
|
import { join as join140 } from "node:path";
|
|
70677
70676
|
function isDaemonRunning() {
|
|
70678
70677
|
const lockFile = join140(LOCK_DIR, `${LOCK_NAME2}.lock`);
|
|
@@ -70746,7 +70745,7 @@ async function statusContent() {
|
|
|
70746
70745
|
} catch {}
|
|
70747
70746
|
}
|
|
70748
70747
|
async function logsContent(options2) {
|
|
70749
|
-
const logDir = join140(
|
|
70748
|
+
const logDir = join140(homedir38(), ".claudekit", "logs");
|
|
70750
70749
|
const dateStr = new Date().toISOString().slice(0, 10).replace(/-/g, "");
|
|
70751
70750
|
const logPath = join140(logDir, `content-${dateStr}.log`);
|
|
70752
70751
|
if (!existsSync74(logPath)) {
|
|
@@ -70780,12 +70779,12 @@ var init_content_subcommands = __esm(() => {
|
|
|
70780
70779
|
init_setup_wizard();
|
|
70781
70780
|
init_state_manager();
|
|
70782
70781
|
init_content_review_commands();
|
|
70783
|
-
LOCK_DIR = join140(
|
|
70782
|
+
LOCK_DIR = join140(homedir38(), ".claudekit", "locks");
|
|
70784
70783
|
});
|
|
70785
70784
|
|
|
70786
70785
|
// src/commands/content/content-command.ts
|
|
70787
70786
|
import { existsSync as existsSync75, mkdirSync as mkdirSync8, unlinkSync as unlinkSync6, writeFileSync as writeFileSync6 } from "node:fs";
|
|
70788
|
-
import { homedir as
|
|
70787
|
+
import { homedir as homedir39 } from "node:os";
|
|
70789
70788
|
import { join as join141 } from "node:path";
|
|
70790
70789
|
async function contentCommand(options2) {
|
|
70791
70790
|
const cwd2 = process.cwd();
|
|
@@ -70818,7 +70817,7 @@ async function contentCommand(options2) {
|
|
|
70818
70817
|
if (!existsSync75(LOCK_DIR2))
|
|
70819
70818
|
mkdirSync8(LOCK_DIR2, { recursive: true });
|
|
70820
70819
|
writeFileSync6(LOCK_FILE, String(process.pid), "utf-8");
|
|
70821
|
-
const dbPath = config.dbPath.replace(/^~/,
|
|
70820
|
+
const dbPath = config.dbPath.replace(/^~/, homedir39());
|
|
70822
70821
|
const db = initDatabase(dbPath);
|
|
70823
70822
|
contentLogger.info(`Database initialised at ${dbPath}`);
|
|
70824
70823
|
const adapters = initializeAdapters(config);
|
|
@@ -70964,7 +70963,7 @@ var init_content_command = __esm(() => {
|
|
|
70964
70963
|
init_publisher();
|
|
70965
70964
|
init_review_manager();
|
|
70966
70965
|
init_state_manager();
|
|
70967
|
-
LOCK_DIR2 = join141(
|
|
70966
|
+
LOCK_DIR2 = join141(homedir39(), ".claudekit", "locks");
|
|
70968
70967
|
LOCK_FILE = join141(LOCK_DIR2, "ck-content.lock");
|
|
70969
70968
|
});
|
|
70970
70969
|
|
|
@@ -82793,9 +82792,9 @@ var import_proper_lockfile4 = __toESM(require_proper_lockfile(), 1);
|
|
|
82793
82792
|
import { mkdir as mkdir19 } from "node:fs/promises";
|
|
82794
82793
|
import os5 from "node:os";
|
|
82795
82794
|
import { join as join75 } from "node:path";
|
|
82796
|
-
var
|
|
82797
|
-
|
|
82798
|
-
|
|
82795
|
+
var LOCK_CONFIG = {
|
|
82796
|
+
stale: 60000,
|
|
82797
|
+
retries: 0
|
|
82799
82798
|
};
|
|
82800
82799
|
var activeLocks = new Set;
|
|
82801
82800
|
var cleanupRegistered = false;
|
|
@@ -82805,7 +82804,8 @@ function getLocksDir() {
|
|
|
82805
82804
|
function cleanupLocks() {
|
|
82806
82805
|
for (const name of activeLocks) {
|
|
82807
82806
|
try {
|
|
82808
|
-
|
|
82807
|
+
const lockPath = join75(getLocksDir(), `${name}.lock`);
|
|
82808
|
+
import_proper_lockfile4.default.unlockSync(lockPath, { realpath: false });
|
|
82809
82809
|
} catch {
|
|
82810
82810
|
try {
|
|
82811
82811
|
logger.verbose(`Failed to cleanup lock: ${name}`);
|
|
@@ -82824,24 +82824,13 @@ async function ensureLocksDir() {
|
|
|
82824
82824
|
const lockDir = getLocksDir();
|
|
82825
82825
|
await mkdir19(lockDir, { recursive: true });
|
|
82826
82826
|
}
|
|
82827
|
-
function
|
|
82828
|
-
const resource = join75(getLocksDir(), `${lockName}.lock`);
|
|
82829
|
-
return { resource, lockfile: `${resource}.lock` };
|
|
82830
|
-
}
|
|
82831
|
-
async function withProcessLock(lockName, fn, duration = "short") {
|
|
82827
|
+
async function withProcessLock(lockName, fn) {
|
|
82832
82828
|
registerCleanupHandlers();
|
|
82833
82829
|
await ensureLocksDir();
|
|
82834
|
-
const
|
|
82835
|
-
const config = LOCK_CONFIGS[duration];
|
|
82830
|
+
const lockPath = join75(getLocksDir(), `${lockName}.lock`);
|
|
82836
82831
|
let release;
|
|
82837
82832
|
try {
|
|
82838
|
-
release = await import_proper_lockfile4.default.lock(lockPath, {
|
|
82839
|
-
...config,
|
|
82840
|
-
realpath: false,
|
|
82841
|
-
onCompromised: duration === "long" ? (err) => {
|
|
82842
|
-
logger.warning(`Lock "${lockName}" compromised: ${err.message}. Continuing...`);
|
|
82843
|
-
} : undefined
|
|
82844
|
-
});
|
|
82833
|
+
release = await import_proper_lockfile4.default.lock(lockPath, { ...LOCK_CONFIG, realpath: false });
|
|
82845
82834
|
activeLocks.add(lockName);
|
|
82846
82835
|
return await fn();
|
|
82847
82836
|
} catch (e2) {
|
|
@@ -82851,24 +82840,11 @@ async function withProcessLock(lockName, fn, duration = "short") {
|
|
|
82851
82840
|
|
|
82852
82841
|
Operation: ${lockName}
|
|
82853
82842
|
Wait for it to complete or remove lock: ${lockPath}`);
|
|
82854
|
-
}
|
|
82855
|
-
if (error.code === "ECOMPROMISED") {
|
|
82856
|
-
throw new Error(`Lock was compromised (stale or externally removed).
|
|
82857
|
-
|
|
82858
|
-
Operation: ${lockName}
|
|
82859
|
-
Use --force to clear and restart.`);
|
|
82860
82843
|
}
|
|
82861
82844
|
throw e2;
|
|
82862
82845
|
} finally {
|
|
82863
82846
|
if (release) {
|
|
82864
|
-
|
|
82865
|
-
await release();
|
|
82866
|
-
} catch (releaseErr) {
|
|
82867
|
-
const code = releaseErr.code;
|
|
82868
|
-
if (code !== "ERELEASED") {
|
|
82869
|
-
logger.warning(`Failed to release lock "${lockName}": ${releaseErr.message}`);
|
|
82870
|
-
}
|
|
82871
|
-
}
|
|
82847
|
+
await release();
|
|
82872
82848
|
}
|
|
82873
82849
|
activeLocks.delete(lockName);
|
|
82874
82850
|
}
|
|
@@ -93473,7 +93449,10 @@ class SettingsProcessor {
|
|
|
93473
93449
|
}
|
|
93474
93450
|
let transformed = content;
|
|
93475
93451
|
const rawPrefix = prefix.replace(/"/g, "");
|
|
93476
|
-
transformed = transformed.replace(/(node\s+)(?:\.\/)?(\.claude\/[^\s"\\]+)/g,
|
|
93452
|
+
transformed = transformed.replace(/(node\s+)(?:\.\/)?(\.claude\/[^\s"\\]+)([^"\\]*)/g, (_match, nodePrefix, relativePath, suffix) => {
|
|
93453
|
+
const normalizedRelativePath = relativePath.replace(/\\/g, "/");
|
|
93454
|
+
return rawPrefix === "$CLAUDE_PROJECT_DIR" ? `${nodePrefix}\\"${rawPrefix}\\"/${normalizedRelativePath}${suffix}` : `${nodePrefix}\\"${rawPrefix}/${normalizedRelativePath}\\"${suffix}`;
|
|
93455
|
+
});
|
|
93477
93456
|
if (rawPrefix.includes("HOME") || rawPrefix.includes("USERPROFILE")) {
|
|
93478
93457
|
transformed = transformed.replace(/\$CLAUDE_PROJECT_DIR/g, rawPrefix);
|
|
93479
93458
|
transformed = transformed.replace(/%CLAUDE_PROJECT_DIR%/g, rawPrefix);
|
|
@@ -93519,33 +93498,38 @@ class SettingsProcessor {
|
|
|
93519
93498
|
fixSingleCommandPath(cmd) {
|
|
93520
93499
|
if (!cmd.includes(".claude/") && !cmd.includes(".claude\\"))
|
|
93521
93500
|
return cmd;
|
|
93522
|
-
const
|
|
93523
|
-
if (
|
|
93524
|
-
const
|
|
93525
|
-
return
|
|
93526
|
-
}
|
|
93527
|
-
const
|
|
93528
|
-
|
|
93529
|
-
|
|
93530
|
-
|
|
93531
|
-
|
|
93532
|
-
|
|
93533
|
-
|
|
93534
|
-
|
|
93535
|
-
|
|
93501
|
+
const bareRelativeMatch = cmd.match(/^(node\s+)(?:\.\/)?(\.claude[/\\][^\s"]+)(.*)$/);
|
|
93502
|
+
if (bareRelativeMatch) {
|
|
93503
|
+
const [, nodePrefix, relativePath, suffix] = bareRelativeMatch;
|
|
93504
|
+
return this.formatCommandPath(nodePrefix, this.isGlobal ? "$HOME" : "$CLAUDE_PROJECT_DIR", relativePath, suffix);
|
|
93505
|
+
}
|
|
93506
|
+
const embeddedQuotedMatch = cmd.match(/^(node\s+)"(\$HOME|\$CLAUDE_PROJECT_DIR|%USERPROFILE%|%CLAUDE_PROJECT_DIR%)[/\\](\.claude[/\\][^"]+)"(.*)$/);
|
|
93507
|
+
if (embeddedQuotedMatch) {
|
|
93508
|
+
const [, nodePrefix, capturedVar, relativePath, suffix] = embeddedQuotedMatch;
|
|
93509
|
+
return this.formatCommandPath(nodePrefix, capturedVar, relativePath, suffix);
|
|
93510
|
+
}
|
|
93511
|
+
const varOnlyQuotedMatch = cmd.match(/^(node\s+)"(\$HOME|\$CLAUDE_PROJECT_DIR|%USERPROFILE%|%CLAUDE_PROJECT_DIR%)"[/\\](\.claude[/\\][^\s"]+)(.*)$/);
|
|
93512
|
+
if (varOnlyQuotedMatch) {
|
|
93513
|
+
const [, nodePrefix, capturedVar, relativePath, suffix] = varOnlyQuotedMatch;
|
|
93514
|
+
return this.formatCommandPath(nodePrefix, capturedVar, relativePath, suffix);
|
|
93515
|
+
}
|
|
93516
|
+
const tildeMatch = cmd.match(/^(node\s+)~[/\\](\.claude[/\\][^\s"]+)(.*)$/);
|
|
93536
93517
|
if (tildeMatch) {
|
|
93537
|
-
const [, nodePrefix,
|
|
93538
|
-
return
|
|
93518
|
+
const [, nodePrefix, relativePath, suffix] = tildeMatch;
|
|
93519
|
+
return this.formatCommandPath(nodePrefix, "$HOME", relativePath, suffix);
|
|
93539
93520
|
}
|
|
93540
|
-
const
|
|
93541
|
-
const unquotedMatch = cmd.match(unquotedRe);
|
|
93521
|
+
const unquotedMatch = cmd.match(/^(node\s+)(\$HOME|\$CLAUDE_PROJECT_DIR|%USERPROFILE%|%CLAUDE_PROJECT_DIR%)[/\\](\.claude[/\\][^\s"]+)(.*)$/);
|
|
93542
93522
|
if (unquotedMatch) {
|
|
93543
|
-
const [, nodePrefix, capturedVar,
|
|
93544
|
-
|
|
93545
|
-
return `${nodePrefix}"${canonicalVar}/${restPath.replace(/\\/g, "/")}"`;
|
|
93523
|
+
const [, nodePrefix, capturedVar, relativePath, suffix] = unquotedMatch;
|
|
93524
|
+
return this.formatCommandPath(nodePrefix, capturedVar, relativePath, suffix);
|
|
93546
93525
|
}
|
|
93547
93526
|
return cmd;
|
|
93548
93527
|
}
|
|
93528
|
+
formatCommandPath(nodePrefix, capturedVar, relativePath, suffix = "") {
|
|
93529
|
+
const canonicalVar = this.canonicalizePathVar(capturedVar);
|
|
93530
|
+
const normalizedRelativePath = relativePath.replace(/\\/g, "/").replace(/^\/+/, "");
|
|
93531
|
+
return canonicalVar === "$CLAUDE_PROJECT_DIR" ? `${nodePrefix}"${canonicalVar}"/${normalizedRelativePath}${suffix}` : `${nodePrefix}"${canonicalVar}/${normalizedRelativePath}"${suffix}`;
|
|
93532
|
+
}
|
|
93549
93533
|
canonicalizePathVar(capturedVar) {
|
|
93550
93534
|
switch (capturedVar) {
|
|
93551
93535
|
case "%USERPROFILE%":
|
|
@@ -93594,7 +93578,6 @@ class SettingsProcessor {
|
|
|
93594
93578
|
logger.warning("Failed to read settings file for team hooks injection");
|
|
93595
93579
|
return;
|
|
93596
93580
|
}
|
|
93597
|
-
const prefix = this.isGlobal ? "$HOME" : "$CLAUDE_PROJECT_DIR";
|
|
93598
93581
|
if (!settings.hooks) {
|
|
93599
93582
|
settings.hooks = {};
|
|
93600
93583
|
}
|
|
@@ -93605,7 +93588,7 @@ class SettingsProcessor {
|
|
|
93605
93588
|
{ event: "TeammateIdle", handler: "teammate-idle-handler.cjs" }
|
|
93606
93589
|
];
|
|
93607
93590
|
for (const { event, handler } of teamHooks) {
|
|
93608
|
-
const hookCommand =
|
|
93591
|
+
const hookCommand = this.formatCommandPath("node ", this.isGlobal ? "$HOME" : "$CLAUDE_PROJECT_DIR", `.claude/hooks/${handler}`);
|
|
93609
93592
|
const eventHooks = settings.hooks[event];
|
|
93610
93593
|
if (eventHooks && eventHooks.length > 0)
|
|
93611
93594
|
continue;
|
|
@@ -101708,6 +101691,7 @@ ${import_picocolors38.default.bold(import_picocolors38.default.cyan(result.kitCo
|
|
|
101708
101691
|
init_logger();
|
|
101709
101692
|
import { existsSync as existsSync65 } from "node:fs";
|
|
101710
101693
|
import { rm as rm16 } from "node:fs/promises";
|
|
101694
|
+
import { homedir as homedir33 } from "node:os";
|
|
101711
101695
|
import { join as join131 } from "node:path";
|
|
101712
101696
|
var import_picocolors39 = __toESM(require_picocolors(), 1);
|
|
101713
101697
|
|
|
@@ -102259,9 +102243,6 @@ async function invokeClaude(options2) {
|
|
|
102259
102243
|
"--allowedTools",
|
|
102260
102244
|
tools
|
|
102261
102245
|
];
|
|
102262
|
-
if (outputFormat === "stream-json") {
|
|
102263
|
-
args.push("--verbose");
|
|
102264
|
-
}
|
|
102265
102246
|
const child = spawn10("claude", args, {
|
|
102266
102247
|
cwd: options2.cwd,
|
|
102267
102248
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -102307,7 +102288,7 @@ function collectClaudeOutput(child, timeoutSec, verbose = false) {
|
|
|
102307
102288
|
});
|
|
102308
102289
|
}
|
|
102309
102290
|
function logStreamEvent(chunk) {
|
|
102310
|
-
for (const line of chunk.
|
|
102291
|
+
for (const line of chunk.split(`
|
|
102311
102292
|
`).filter(Boolean)) {
|
|
102312
102293
|
try {
|
|
102313
102294
|
const event = JSON.parse(line);
|
|
@@ -102335,7 +102316,7 @@ function logStreamEvent(chunk) {
|
|
|
102335
102316
|
}
|
|
102336
102317
|
}
|
|
102337
102318
|
function parseStreamJsonOutput(stdout2) {
|
|
102338
|
-
const lines = stdout2.
|
|
102319
|
+
const lines = stdout2.split(`
|
|
102339
102320
|
`).filter(Boolean);
|
|
102340
102321
|
for (let i = lines.length - 1;i >= 0; i--) {
|
|
102341
102322
|
try {
|
|
@@ -103435,13 +103416,11 @@ async function watchCommand(options2) {
|
|
|
103435
103416
|
process.removeListener("SIGINT", shutdown);
|
|
103436
103417
|
process.removeListener("SIGTERM", shutdown);
|
|
103437
103418
|
}
|
|
103438
|
-
}
|
|
103419
|
+
});
|
|
103439
103420
|
} catch (error) {
|
|
103440
103421
|
const err = error;
|
|
103441
103422
|
if (err.message?.includes("Another ClaudeKit process")) {
|
|
103442
103423
|
logger.error("Another ck watch instance is already running. Use --force to override.");
|
|
103443
|
-
} else if (err.message?.includes("Lock was compromised")) {
|
|
103444
|
-
logger.error("Lock was compromised (stale or externally removed). Use --force to restart.");
|
|
103445
103424
|
} else {
|
|
103446
103425
|
watchLog.error("Watch command failed", err);
|
|
103447
103426
|
console.error(`[ck watch] Fatal: ${err.message}`);
|
|
@@ -103524,12 +103503,9 @@ async function resetState(state, projectDir, watchLog) {
|
|
|
103524
103503
|
watchLog.info(`Watch state reset (--force) for ${projectDir}`);
|
|
103525
103504
|
}
|
|
103526
103505
|
async function forceRemoveLock(watchLog) {
|
|
103527
|
-
const
|
|
103506
|
+
const lockPath = join131(homedir33(), ".claudekit", "locks", `${LOCK_NAME}.lock`);
|
|
103528
103507
|
try {
|
|
103529
|
-
await
|
|
103530
|
-
rm16(resource, { recursive: true, force: true }),
|
|
103531
|
-
rm16(lockfile5, { recursive: true, force: true })
|
|
103532
|
-
]);
|
|
103508
|
+
await rm16(lockPath, { recursive: true, force: true });
|
|
103533
103509
|
watchLog.info("Removed existing lock file (--force)");
|
|
103534
103510
|
} catch {}
|
|
103535
103511
|
}
|