claudekit-cli 3.41.4-dev.41 → 3.41.4-dev.42
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 +1213 -519
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10632,6 +10632,7 @@ __export(exports_provider_registry, {
|
|
|
10632
10632
|
getProvidersSupporting: () => getProvidersSupporting,
|
|
10633
10633
|
getProviderConfig: () => getProviderConfig,
|
|
10634
10634
|
getPortableInstallPath: () => getPortableInstallPath,
|
|
10635
|
+
getPortableBasePath: () => getPortableBasePath,
|
|
10635
10636
|
getAllProviderTypes: () => getAllProviderTypes,
|
|
10636
10637
|
detectProviderPathCollisions: () => detectProviderPathCollisions,
|
|
10637
10638
|
detectInstalledProviders: () => detectInstalledProviders,
|
|
@@ -10704,12 +10705,19 @@ async function detectInstalledProviders() {
|
|
|
10704
10705
|
function getProvidersSupporting(type) {
|
|
10705
10706
|
return Object.entries(providers).filter(([, config]) => config[type] != null).map(([name]) => name);
|
|
10706
10707
|
}
|
|
10708
|
+
function getPortableBasePath(provider, portableType, options2) {
|
|
10709
|
+
const config = providers[provider];
|
|
10710
|
+
const pathConfig = config[portableType];
|
|
10711
|
+
if (!pathConfig)
|
|
10712
|
+
return null;
|
|
10713
|
+
return options2.global ? pathConfig.globalPath : pathConfig.projectPath;
|
|
10714
|
+
}
|
|
10707
10715
|
function getPortableInstallPath(itemName, provider, portableType, options2) {
|
|
10708
10716
|
const config = providers[provider];
|
|
10709
10717
|
const pathConfig = config[portableType];
|
|
10710
10718
|
if (!pathConfig)
|
|
10711
10719
|
return null;
|
|
10712
|
-
const basePath =
|
|
10720
|
+
const basePath = getPortableBasePath(provider, portableType, options2);
|
|
10713
10721
|
if (!basePath)
|
|
10714
10722
|
return null;
|
|
10715
10723
|
if (pathConfig.writeStrategy === "merge-single" || pathConfig.writeStrategy === "yaml-merge" || pathConfig.writeStrategy === "json-merge" || pathConfig.writeStrategy === "single-file") {
|
|
@@ -60747,7 +60755,7 @@ var package_default;
|
|
|
60747
60755
|
var init_package = __esm(() => {
|
|
60748
60756
|
package_default = {
|
|
60749
60757
|
name: "claudekit-cli",
|
|
60750
|
-
version: "3.41.4-dev.
|
|
60758
|
+
version: "3.41.4-dev.42",
|
|
60751
60759
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
60752
60760
|
type: "module",
|
|
60753
60761
|
repository: {
|
|
@@ -71839,7 +71847,7 @@ async function restoreOriginalBranch(branchName, cwd2, issueNumber) {
|
|
|
71839
71847
|
}
|
|
71840
71848
|
}
|
|
71841
71849
|
function spawnAndCollect(command, args, cwd2) {
|
|
71842
|
-
return new Promise((
|
|
71850
|
+
return new Promise((resolve44, reject) => {
|
|
71843
71851
|
const child = spawn6(command, args, { ...cwd2 && { cwd: cwd2 }, stdio: ["ignore", "pipe", "pipe"] });
|
|
71844
71852
|
const chunks = [];
|
|
71845
71853
|
const stderrChunks = [];
|
|
@@ -71852,7 +71860,7 @@ function spawnAndCollect(command, args, cwd2) {
|
|
|
71852
71860
|
reject(new Error(`${command} ${args[0] ?? ""} exited with code ${code2}: ${stderr}`));
|
|
71853
71861
|
return;
|
|
71854
71862
|
}
|
|
71855
|
-
|
|
71863
|
+
resolve44(Buffer.concat(chunks).toString("utf-8"));
|
|
71856
71864
|
});
|
|
71857
71865
|
});
|
|
71858
71866
|
}
|
|
@@ -71971,15 +71979,15 @@ function countTwitterChars(text) {
|
|
|
71971
71979
|
}
|
|
71972
71980
|
return count;
|
|
71973
71981
|
}
|
|
71974
|
-
function validateContent(content,
|
|
71982
|
+
function validateContent(content, platform17) {
|
|
71975
71983
|
const issues = [];
|
|
71976
71984
|
if (!content.text || content.text.trim().length === 0) {
|
|
71977
71985
|
issues.push("Content text is empty");
|
|
71978
71986
|
return { valid: false, issues };
|
|
71979
71987
|
}
|
|
71980
|
-
if (
|
|
71981
|
-
const limit =
|
|
71982
|
-
const charCount =
|
|
71988
|
+
if (platform17 !== "x_thread") {
|
|
71989
|
+
const limit = platform17 === "facebook" ? 500 : 280;
|
|
71990
|
+
const charCount = platform17 === "x" ? countTwitterChars(content.text) : content.text.length;
|
|
71983
71991
|
if (charCount > limit) {
|
|
71984
71992
|
issues.push(`Text exceeds ${limit} char limit (${charCount} weighted chars)`);
|
|
71985
71993
|
}
|
|
@@ -72002,7 +72010,7 @@ function validateContent(content, platform16) {
|
|
|
72002
72010
|
issues.push("Hook (first sentence) is too long (>25 words)");
|
|
72003
72011
|
}
|
|
72004
72012
|
const hashtagCount = content.hashtags?.length ?? 0;
|
|
72005
|
-
if (
|
|
72013
|
+
if (platform17 === "x" && hashtagCount > 5) {
|
|
72006
72014
|
issues.push("Too many hashtags for X (max 5)");
|
|
72007
72015
|
}
|
|
72008
72016
|
return { valid: issues.length === 0, issues };
|
|
@@ -72039,8 +72047,8 @@ var init_content_validator = __esm(() => {
|
|
|
72039
72047
|
import { createHash as createHash8 } from "node:crypto";
|
|
72040
72048
|
import { existsSync as existsSync73, mkdirSync as mkdirSync5, readFileSync as readFileSync18, readdirSync as readdirSync10, statSync as statSync13 } from "node:fs";
|
|
72041
72049
|
import { rename as rename12, writeFile as writeFile35 } from "node:fs/promises";
|
|
72042
|
-
import { homedir as
|
|
72043
|
-
import { basename as
|
|
72050
|
+
import { homedir as homedir48 } from "node:os";
|
|
72051
|
+
import { basename as basename30, join as join155 } from "node:path";
|
|
72044
72052
|
function getCachedContext(repoPath) {
|
|
72045
72053
|
const cachePath = getCacheFilePath(repoPath);
|
|
72046
72054
|
if (!existsSync73(cachePath))
|
|
@@ -72108,13 +72116,13 @@ function getDocSourcePaths(repoPath) {
|
|
|
72108
72116
|
return paths.sort();
|
|
72109
72117
|
}
|
|
72110
72118
|
function getCacheFilePath(repoPath) {
|
|
72111
|
-
const repoName =
|
|
72119
|
+
const repoName = basename30(repoPath).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
72112
72120
|
const pathHash = createHash8("sha256").update(repoPath).digest("hex").slice(0, 8);
|
|
72113
72121
|
return join155(CACHE_DIR, `${repoName}-${pathHash}-context-cache.json`);
|
|
72114
72122
|
}
|
|
72115
72123
|
var CACHE_DIR, CACHE_TTL_MS4;
|
|
72116
72124
|
var init_context_cache_manager = __esm(() => {
|
|
72117
|
-
CACHE_DIR = join155(
|
|
72125
|
+
CACHE_DIR = join155(homedir48(), ".claudekit", "cache");
|
|
72118
72126
|
CACHE_TTL_MS4 = 24 * 60 * 60 * 1000;
|
|
72119
72127
|
});
|
|
72120
72128
|
|
|
@@ -72416,10 +72424,10 @@ var MAX_RAW_CONTENT_CHARS = 50000;
|
|
|
72416
72424
|
var init_docs_summarizer = () => {};
|
|
72417
72425
|
|
|
72418
72426
|
// src/commands/content/phases/context-builder.ts
|
|
72419
|
-
async function buildContentContext(event, repoPath, config, db,
|
|
72427
|
+
async function buildContentContext(event, repoPath, config, db, platform17, contentLogger) {
|
|
72420
72428
|
const cached = getCachedContext(repoPath);
|
|
72421
72429
|
if (cached) {
|
|
72422
|
-
return buildFromCache(cached, event, db,
|
|
72430
|
+
return buildFromCache(cached, event, db, platform17, config);
|
|
72423
72431
|
}
|
|
72424
72432
|
const noopLogger = { debug: () => {}, info: () => {}, warn: () => {}, error: () => {} };
|
|
72425
72433
|
const log2 = contentLogger ?? noopLogger;
|
|
@@ -72434,16 +72442,16 @@ async function buildContentContext(event, repoPath, config, db, platform16, cont
|
|
|
72434
72442
|
sourceHash: hash
|
|
72435
72443
|
};
|
|
72436
72444
|
await saveCachedContext(repoPath, newCache);
|
|
72437
|
-
return buildFromCache(newCache, event, db,
|
|
72445
|
+
return buildFromCache(newCache, event, db, platform17, config);
|
|
72438
72446
|
}
|
|
72439
|
-
function buildFromCache(cache5, event, db,
|
|
72447
|
+
function buildFromCache(cache5, event, db, platform17, config) {
|
|
72440
72448
|
return {
|
|
72441
72449
|
brandGuidelines: cache5.brandSummary,
|
|
72442
72450
|
writingStyles: cache5.stylesSummary,
|
|
72443
72451
|
gitEventDetails: formatGitEvent(event),
|
|
72444
72452
|
recentContent: formatRecentContent(db),
|
|
72445
72453
|
topPerformingContent: "",
|
|
72446
|
-
platformRules: getPlatformRules(
|
|
72454
|
+
platformRules: getPlatformRules(platform17, config),
|
|
72447
72455
|
projectReadme: cache5.readmeSummary,
|
|
72448
72456
|
projectDocsSummary: cache5.docsSummary,
|
|
72449
72457
|
currentDateTime: new Date().toISOString()
|
|
@@ -72472,8 +72480,8 @@ function formatRecentContent(db) {
|
|
|
72472
72480
|
return recent.map((c2) => `[${c2.platform}] ${c2.textContent.slice(0, 100)}`).join(`
|
|
72473
72481
|
`);
|
|
72474
72482
|
}
|
|
72475
|
-
function getPlatformRules(
|
|
72476
|
-
switch (
|
|
72483
|
+
function getPlatformRules(platform17, config) {
|
|
72484
|
+
switch (platform17) {
|
|
72477
72485
|
case "x":
|
|
72478
72486
|
return [
|
|
72479
72487
|
"Platform: X (Twitter)",
|
|
@@ -72512,8 +72520,8 @@ var init_context_builder = __esm(() => {
|
|
|
72512
72520
|
});
|
|
72513
72521
|
|
|
72514
72522
|
// src/commands/content/phases/prompt-templates.ts
|
|
72515
|
-
function buildTextPrompt(context,
|
|
72516
|
-
const charLimit =
|
|
72523
|
+
function buildTextPrompt(context, platform17) {
|
|
72524
|
+
const charLimit = platform17 === "x" || platform17 === "x_thread" ? 280 : 500;
|
|
72517
72525
|
return `You are a social media content creator.
|
|
72518
72526
|
|
|
72519
72527
|
## Project Context
|
|
@@ -72528,14 +72536,14 @@ ${context.writingStyles}
|
|
|
72528
72536
|
## Content Source
|
|
72529
72537
|
${context.gitEventDetails}
|
|
72530
72538
|
|
|
72531
|
-
## Platform: ${
|
|
72539
|
+
## Platform: ${platform17}
|
|
72532
72540
|
${context.platformRules}
|
|
72533
72541
|
|
|
72534
72542
|
## Past Content (avoid repetition)
|
|
72535
72543
|
${context.recentContent}
|
|
72536
72544
|
|
|
72537
72545
|
## Instructions
|
|
72538
|
-
1. Create a ${
|
|
72546
|
+
1. Create a ${platform17} post about this development update
|
|
72539
72547
|
2. Start with a compelling hook that creates curiosity
|
|
72540
72548
|
3. Keep it conversational and authentic (avoid AI-sounding language)
|
|
72541
72549
|
4. No generic statements — be specific about what changed and why it matters
|
|
@@ -72545,8 +72553,8 @@ ${context.recentContent}
|
|
|
72545
72553
|
|
|
72546
72554
|
IMPORTANT: Output ONLY the JSON object, nothing else.`;
|
|
72547
72555
|
}
|
|
72548
|
-
function buildPhotoPrompt(context,
|
|
72549
|
-
const dimensions =
|
|
72556
|
+
function buildPhotoPrompt(context, platform17) {
|
|
72557
|
+
const dimensions = platform17 === "facebook" ? "1200x630" : "1200x675";
|
|
72550
72558
|
return `Generate an image for this social media post.
|
|
72551
72559
|
|
|
72552
72560
|
## Brand Guidelines
|
|
@@ -72568,15 +72576,15 @@ IMPORTANT: Generate the image and output the path as JSON: {"imagePath": "/path/
|
|
|
72568
72576
|
// src/commands/content/phases/photo-generator.ts
|
|
72569
72577
|
import { execSync as execSync8 } from "node:child_process";
|
|
72570
72578
|
import { existsSync as existsSync75, mkdirSync as mkdirSync6, readdirSync as readdirSync12 } from "node:fs";
|
|
72571
|
-
import { homedir as
|
|
72579
|
+
import { homedir as homedir49 } from "node:os";
|
|
72572
72580
|
import { join as join157 } from "node:path";
|
|
72573
|
-
async function generatePhoto(_content, context, config,
|
|
72574
|
-
const mediaDir = join157(config.contentDir.replace(/^~/,
|
|
72581
|
+
async function generatePhoto(_content, context, config, platform17, contentId, contentLogger) {
|
|
72582
|
+
const mediaDir = join157(config.contentDir.replace(/^~/, homedir49()), "media", String(contentId));
|
|
72575
72583
|
if (!existsSync75(mediaDir)) {
|
|
72576
72584
|
mkdirSync6(mediaDir, { recursive: true });
|
|
72577
72585
|
}
|
|
72578
|
-
const prompt = buildPhotoPrompt(context,
|
|
72579
|
-
const dimensions =
|
|
72586
|
+
const prompt = buildPhotoPrompt(context, platform17);
|
|
72587
|
+
const dimensions = platform17 === "facebook" ? { width: 1200, height: 630 } : { width: 1200, height: 675 };
|
|
72580
72588
|
try {
|
|
72581
72589
|
contentLogger.debug(`Generating photo for content ${contentId}...`);
|
|
72582
72590
|
const result = execSync8("claude -p --output-format text --max-turns 40", {
|
|
@@ -72614,14 +72622,14 @@ async function createContent(event, config, db, contentLogger, options2) {
|
|
|
72614
72622
|
const startTime = Date.now();
|
|
72615
72623
|
const items = [];
|
|
72616
72624
|
const platforms = resolveEnabledPlatforms(config);
|
|
72617
|
-
for (const
|
|
72625
|
+
for (const platform17 of platforms) {
|
|
72618
72626
|
try {
|
|
72619
|
-
const item = await createContentForPlatform(event,
|
|
72627
|
+
const item = await createContentForPlatform(event, platform17, config, db, contentLogger, options2);
|
|
72620
72628
|
if (item)
|
|
72621
72629
|
items.push(item);
|
|
72622
72630
|
} catch (err) {
|
|
72623
72631
|
const msg = err instanceof Error ? err.message : String(err);
|
|
72624
|
-
contentLogger.error(`Failed to create ${
|
|
72632
|
+
contentLogger.error(`Failed to create ${platform17} content: ${msg}`);
|
|
72625
72633
|
}
|
|
72626
72634
|
}
|
|
72627
72635
|
insertTaskLog(db, {
|
|
@@ -72640,10 +72648,10 @@ function resolveEnabledPlatforms(config) {
|
|
|
72640
72648
|
platforms.push("facebook");
|
|
72641
72649
|
return platforms;
|
|
72642
72650
|
}
|
|
72643
|
-
async function createContentForPlatform(event,
|
|
72644
|
-
const context = await buildContentContext(event, event.repoPath, config, db,
|
|
72645
|
-
const prompt = buildTextPrompt(context,
|
|
72646
|
-
contentLogger.debug(`Generating ${
|
|
72651
|
+
async function createContentForPlatform(event, platform17, config, db, contentLogger, options2) {
|
|
72652
|
+
const context = await buildContentContext(event, event.repoPath, config, db, platform17, contentLogger);
|
|
72653
|
+
const prompt = buildTextPrompt(context, platform17);
|
|
72654
|
+
contentLogger.debug(`Generating ${platform17} content for event ${event.id}...`);
|
|
72647
72655
|
const stdout2 = execSync9("claude -p --output-format text --max-turns 5", {
|
|
72648
72656
|
input: prompt,
|
|
72649
72657
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -72651,14 +72659,14 @@ async function createContentForPlatform(event, platform16, config, db, contentLo
|
|
|
72651
72659
|
}).toString();
|
|
72652
72660
|
const parsed = parseClaudeJsonOutput(stdout2);
|
|
72653
72661
|
const generated = extractContentFromResponse(parsed);
|
|
72654
|
-
const validation = validateContent(generated,
|
|
72662
|
+
const validation = validateContent(generated, platform17);
|
|
72655
72663
|
if (!validation.valid) {
|
|
72656
|
-
contentLogger.warn(`Content validation failed for ${
|
|
72664
|
+
contentLogger.warn(`Content validation failed for ${platform17}: ${validation.issues.join(", ")}`);
|
|
72657
72665
|
}
|
|
72658
72666
|
const status = validation.valid ? config.reviewMode === "auto" ? "scheduled" : "reviewing" : "draft";
|
|
72659
72667
|
const itemId = insertContentItem(db, {
|
|
72660
72668
|
gitEventId: event.id,
|
|
72661
|
-
platform:
|
|
72669
|
+
platform: platform17,
|
|
72662
72670
|
textContent: generated.text,
|
|
72663
72671
|
hashtags: JSON.stringify(generated.hashtags),
|
|
72664
72672
|
hookLine: generated.hook,
|
|
@@ -72668,12 +72676,12 @@ async function createContentForPlatform(event, platform16, config, db, contentLo
|
|
|
72668
72676
|
scheduledAt: null
|
|
72669
72677
|
});
|
|
72670
72678
|
if (!options2.dryRun && generated.mediaPrompt) {
|
|
72671
|
-
const photo = await generatePhoto(generated, context, config,
|
|
72679
|
+
const photo = await generatePhoto(generated, context, config, platform17, itemId, contentLogger);
|
|
72672
72680
|
if (photo) {
|
|
72673
72681
|
db.prepare("UPDATE content_items SET media_path = ? WHERE id = ?").run(photo.path, itemId);
|
|
72674
72682
|
}
|
|
72675
72683
|
}
|
|
72676
|
-
contentLogger.info(`Created ${
|
|
72684
|
+
contentLogger.info(`Created ${platform17} content (id: ${itemId}, status: ${status})`);
|
|
72677
72685
|
return getContentById(db, itemId);
|
|
72678
72686
|
}
|
|
72679
72687
|
var init_content_creator = __esm(() => {
|
|
@@ -72685,7 +72693,7 @@ var init_content_creator = __esm(() => {
|
|
|
72685
72693
|
|
|
72686
72694
|
// src/commands/content/phases/content-logger.ts
|
|
72687
72695
|
import { createWriteStream as createWriteStream4, existsSync as existsSync76, mkdirSync as mkdirSync7, statSync as statSync14 } from "node:fs";
|
|
72688
|
-
import { homedir as
|
|
72696
|
+
import { homedir as homedir50 } from "node:os";
|
|
72689
72697
|
import { join as join158 } from "node:path";
|
|
72690
72698
|
|
|
72691
72699
|
class ContentLogger {
|
|
@@ -72694,7 +72702,7 @@ class ContentLogger {
|
|
|
72694
72702
|
logDir;
|
|
72695
72703
|
maxBytes;
|
|
72696
72704
|
constructor(maxBytes = 0) {
|
|
72697
|
-
this.logDir = join158(
|
|
72705
|
+
this.logDir = join158(homedir50(), ".claudekit", "logs");
|
|
72698
72706
|
this.maxBytes = maxBytes;
|
|
72699
72707
|
}
|
|
72700
72708
|
init() {
|
|
@@ -72792,7 +72800,7 @@ var init_sqlite_client = () => {};
|
|
|
72792
72800
|
|
|
72793
72801
|
// src/commands/content/phases/db-manager.ts
|
|
72794
72802
|
import { existsSync as existsSync77, mkdirSync as mkdirSync8 } from "node:fs";
|
|
72795
|
-
import { dirname as
|
|
72803
|
+
import { dirname as dirname45 } from "node:path";
|
|
72796
72804
|
function initDatabase(dbPath) {
|
|
72797
72805
|
ensureParentDir(dbPath);
|
|
72798
72806
|
const db = openDatabase(dbPath);
|
|
@@ -72813,7 +72821,7 @@ function runRetentionCleanup(db, retentionDays = 90) {
|
|
|
72813
72821
|
db.prepare("DELETE FROM git_events WHERE processed = 1 AND created_at < ?").run(cutoff);
|
|
72814
72822
|
}
|
|
72815
72823
|
function ensureParentDir(dbPath) {
|
|
72816
|
-
const dir =
|
|
72824
|
+
const dir = dirname45(dbPath);
|
|
72817
72825
|
if (dir && !existsSync77(dir)) {
|
|
72818
72826
|
mkdirSync8(dir, { recursive: true });
|
|
72819
72827
|
}
|
|
@@ -73560,15 +73568,15 @@ class RateLimiter {
|
|
|
73560
73568
|
this.state = state;
|
|
73561
73569
|
this.config = config;
|
|
73562
73570
|
}
|
|
73563
|
-
canPost(
|
|
73564
|
-
return this.getTodayCount(
|
|
73571
|
+
canPost(platform17) {
|
|
73572
|
+
return this.getTodayCount(platform17) < this.getMaxPerDay(platform17);
|
|
73565
73573
|
}
|
|
73566
|
-
recordPost(
|
|
73567
|
-
const key = this.dailyKey(
|
|
73574
|
+
recordPost(platform17) {
|
|
73575
|
+
const key = this.dailyKey(platform17);
|
|
73568
73576
|
this.state.dailyPostCounts[key] = (this.state.dailyPostCounts[key] ?? 0) + 1;
|
|
73569
73577
|
}
|
|
73570
|
-
getRemainingToday(
|
|
73571
|
-
return Math.max(0, this.getMaxPerDay(
|
|
73578
|
+
getRemainingToday(platform17) {
|
|
73579
|
+
return Math.max(0, this.getMaxPerDay(platform17) - this.getTodayCount(platform17));
|
|
73572
73580
|
}
|
|
73573
73581
|
isInQuietHours() {
|
|
73574
73582
|
const { timezone, quietHoursStart, quietHoursEnd } = this.config.schedule;
|
|
@@ -73588,19 +73596,19 @@ class RateLimiter {
|
|
|
73588
73596
|
return false;
|
|
73589
73597
|
}
|
|
73590
73598
|
}
|
|
73591
|
-
getMaxPerDay(
|
|
73592
|
-
if (
|
|
73599
|
+
getMaxPerDay(platform17) {
|
|
73600
|
+
if (platform17 === "x" || platform17 === "x_thread") {
|
|
73593
73601
|
return this.config.platforms.x.maxPostsPerDay;
|
|
73594
73602
|
}
|
|
73595
|
-
if (
|
|
73603
|
+
if (platform17 === "facebook") {
|
|
73596
73604
|
return this.config.platforms.facebook.maxPostsPerDay;
|
|
73597
73605
|
}
|
|
73598
73606
|
return this.config.maxContentPerDay;
|
|
73599
73607
|
}
|
|
73600
|
-
getTodayCount(
|
|
73601
|
-
return this.state.dailyPostCounts[this.dailyKey(
|
|
73608
|
+
getTodayCount(platform17) {
|
|
73609
|
+
return this.state.dailyPostCounts[this.dailyKey(platform17)] ?? 0;
|
|
73602
73610
|
}
|
|
73603
|
-
dailyKey(
|
|
73611
|
+
dailyKey(platform17) {
|
|
73604
73612
|
const { timezone } = this.config.schedule;
|
|
73605
73613
|
let dateStr;
|
|
73606
73614
|
try {
|
|
@@ -73614,7 +73622,7 @@ class RateLimiter {
|
|
|
73614
73622
|
} catch {
|
|
73615
73623
|
dateStr = new Date().toISOString().slice(0, 10);
|
|
73616
73624
|
}
|
|
73617
|
-
return `${
|
|
73625
|
+
return `${platform17}-${dateStr}`;
|
|
73618
73626
|
}
|
|
73619
73627
|
}
|
|
73620
73628
|
|
|
@@ -73704,9 +73712,9 @@ function previewContent(content) {
|
|
|
73704
73712
|
const statusColor = getStatusColor(content.status);
|
|
73705
73713
|
console.log();
|
|
73706
73714
|
console.log(`${badge} ${statusColor(content.status.toUpperCase())} ID: ${content.id}`);
|
|
73707
|
-
console.log(
|
|
73715
|
+
console.log(import_picocolors42.default.dim("─".repeat(60)));
|
|
73708
73716
|
if (content.hookLine) {
|
|
73709
|
-
console.log(
|
|
73717
|
+
console.log(import_picocolors42.default.bold(import_picocolors42.default.cyan("Hook: ")) + content.hookLine);
|
|
73710
73718
|
}
|
|
73711
73719
|
console.log();
|
|
73712
73720
|
console.log(content.textContent);
|
|
@@ -73715,53 +73723,53 @@ function previewContent(content) {
|
|
|
73715
73723
|
try {
|
|
73716
73724
|
const tags = JSON.parse(content.hashtags);
|
|
73717
73725
|
if (tags.length > 0) {
|
|
73718
|
-
console.log(
|
|
73726
|
+
console.log(import_picocolors42.default.dim("Tags: ") + tags.map((t) => import_picocolors42.default.blue(`#${t}`)).join(" "));
|
|
73719
73727
|
}
|
|
73720
73728
|
} catch {}
|
|
73721
73729
|
}
|
|
73722
73730
|
if (content.callToAction) {
|
|
73723
|
-
console.log(
|
|
73731
|
+
console.log(import_picocolors42.default.dim("CTA: ") + content.callToAction);
|
|
73724
73732
|
}
|
|
73725
73733
|
if (content.mediaPath) {
|
|
73726
|
-
console.log(
|
|
73734
|
+
console.log(import_picocolors42.default.dim("Media: ") + content.mediaPath);
|
|
73727
73735
|
}
|
|
73728
73736
|
if (content.scheduledAt) {
|
|
73729
|
-
console.log(
|
|
73737
|
+
console.log(import_picocolors42.default.dim("Scheduled: ") + content.scheduledAt);
|
|
73730
73738
|
}
|
|
73731
|
-
console.log(
|
|
73739
|
+
console.log(import_picocolors42.default.dim("─".repeat(60)));
|
|
73732
73740
|
console.log();
|
|
73733
73741
|
}
|
|
73734
|
-
function getPlatformBadge(
|
|
73735
|
-
switch (
|
|
73742
|
+
function getPlatformBadge(platform17) {
|
|
73743
|
+
switch (platform17) {
|
|
73736
73744
|
case "x":
|
|
73737
|
-
return
|
|
73745
|
+
return import_picocolors42.default.bgBlue(import_picocolors42.default.white(" X "));
|
|
73738
73746
|
case "x_thread":
|
|
73739
|
-
return
|
|
73747
|
+
return import_picocolors42.default.bgBlue(import_picocolors42.default.white(" X Thread "));
|
|
73740
73748
|
case "facebook":
|
|
73741
|
-
return
|
|
73749
|
+
return import_picocolors42.default.bgCyan(import_picocolors42.default.white(" Facebook "));
|
|
73742
73750
|
default:
|
|
73743
|
-
return
|
|
73751
|
+
return import_picocolors42.default.bgBlack(import_picocolors42.default.white(` ${platform17} `));
|
|
73744
73752
|
}
|
|
73745
73753
|
}
|
|
73746
73754
|
function getStatusColor(status) {
|
|
73747
73755
|
switch (status) {
|
|
73748
73756
|
case "published":
|
|
73749
|
-
return
|
|
73757
|
+
return import_picocolors42.default.green;
|
|
73750
73758
|
case "failed":
|
|
73751
|
-
return
|
|
73759
|
+
return import_picocolors42.default.red;
|
|
73752
73760
|
case "reviewing":
|
|
73753
|
-
return
|
|
73761
|
+
return import_picocolors42.default.yellow;
|
|
73754
73762
|
case "scheduled":
|
|
73755
|
-
return
|
|
73763
|
+
return import_picocolors42.default.blue;
|
|
73756
73764
|
case "draft":
|
|
73757
|
-
return
|
|
73765
|
+
return import_picocolors42.default.gray;
|
|
73758
73766
|
default:
|
|
73759
|
-
return
|
|
73767
|
+
return import_picocolors42.default.white;
|
|
73760
73768
|
}
|
|
73761
73769
|
}
|
|
73762
|
-
var
|
|
73770
|
+
var import_picocolors42;
|
|
73763
73771
|
var init_content_previewer = __esm(() => {
|
|
73764
|
-
|
|
73772
|
+
import_picocolors42 = __toESM(require_picocolors(), 1);
|
|
73765
73773
|
});
|
|
73766
73774
|
|
|
73767
73775
|
// src/commands/content/phases/review-manager.ts
|
|
@@ -74020,15 +74028,15 @@ async function autoInstallFbcli(contentLogger) {
|
|
|
74020
74028
|
contentLogger.warn("go install failed or Go not available");
|
|
74021
74029
|
}
|
|
74022
74030
|
try {
|
|
74023
|
-
const { platform:
|
|
74031
|
+
const { platform: platform17, arch: arch3 } = process;
|
|
74024
74032
|
const osMap = { darwin: "darwin", linux: "linux", win32: "windows" };
|
|
74025
74033
|
const archMap = { arm64: "arm64", x64: "amd64" };
|
|
74026
|
-
const os7 = osMap[
|
|
74034
|
+
const os7 = osMap[platform17];
|
|
74027
74035
|
const cpu = archMap[arch3];
|
|
74028
74036
|
if (os7 && cpu) {
|
|
74029
|
-
const ext2 =
|
|
74037
|
+
const ext2 = platform17 === "win32" ? ".exe" : "";
|
|
74030
74038
|
const url = `https://github.com/mrgoonie/fbcli/releases/latest/download/fbcli_${os7}_${cpu}${ext2}`;
|
|
74031
|
-
const dest =
|
|
74039
|
+
const dest = platform17 === "win32" ? "fbcli.exe" : "/usr/local/bin/fbcli";
|
|
74032
74040
|
f2.warning(`Will download fbcli binary from: ${url}`);
|
|
74033
74041
|
f2.warning("Note: Binary integrity is not verified. Review the source at https://github.com/mrgoonie/fbcli");
|
|
74034
74042
|
const consent = await se({ message: `Download and install fbcli to ${dest}?` });
|
|
@@ -74112,15 +74120,15 @@ async function autoInstallXurl(contentLogger) {
|
|
|
74112
74120
|
contentLogger.warn("go install failed or Go not available");
|
|
74113
74121
|
}
|
|
74114
74122
|
try {
|
|
74115
|
-
const { platform:
|
|
74123
|
+
const { platform: platform17, arch: arch3 } = process;
|
|
74116
74124
|
const osMap = { darwin: "darwin", linux: "linux", win32: "windows" };
|
|
74117
74125
|
const archMap = { arm64: "arm64", x64: "amd64" };
|
|
74118
|
-
const os7 = osMap[
|
|
74126
|
+
const os7 = osMap[platform17];
|
|
74119
74127
|
const cpu = archMap[arch3];
|
|
74120
74128
|
if (os7 && cpu) {
|
|
74121
|
-
const ext2 =
|
|
74129
|
+
const ext2 = platform17 === "win32" ? ".exe" : "";
|
|
74122
74130
|
const url = `https://github.com/xdevplatform/xurl/releases/latest/download/xurl_${os7}_${cpu}${ext2}`;
|
|
74123
|
-
const dest =
|
|
74131
|
+
const dest = platform17 === "win32" ? "xurl.exe" : "/usr/local/bin/xurl";
|
|
74124
74132
|
f2.info(`Downloading xurl binary for ${os7}/${cpu}...`);
|
|
74125
74133
|
execSync14(`curl -fsSL "${url}" -o "${dest}" && chmod +x "${dest}"`, {
|
|
74126
74134
|
stdio: "inherit",
|
|
@@ -74172,7 +74180,7 @@ import { existsSync as existsSync79 } from "node:fs";
|
|
|
74172
74180
|
import { join as join162 } from "node:path";
|
|
74173
74181
|
async function runSetupWizard2(cwd2, contentLogger) {
|
|
74174
74182
|
console.log();
|
|
74175
|
-
oe(
|
|
74183
|
+
oe(import_picocolors43.default.bgCyan(import_picocolors43.default.white(" CK Content — Multi-Channel Content Engine ")));
|
|
74176
74184
|
f2.info("This wizard will help you set up automated content publishing");
|
|
74177
74185
|
f2.info(`from your git activity to social media platforms.
|
|
74178
74186
|
`);
|
|
@@ -74231,7 +74239,7 @@ async function showRepoSummary(cwd2) {
|
|
|
74231
74239
|
f2.info(`Found ${repos.length} git repo(s) to monitor:`);
|
|
74232
74240
|
for (const repo of repos) {
|
|
74233
74241
|
const remote = repo.remoteUrl ? ` (${repo.remoteUrl})` : " (local only)";
|
|
74234
|
-
f2.info(` ${
|
|
74242
|
+
f2.info(` ${import_picocolors43.default.green("●")} ${repo.name}${remote}`);
|
|
74235
74243
|
}
|
|
74236
74244
|
}
|
|
74237
74245
|
function detectBrandAssets(cwd2, contentLogger) {
|
|
@@ -74287,29 +74295,29 @@ async function configureReviewMode(config) {
|
|
|
74287
74295
|
function printSummary(selectedPlatforms, config) {
|
|
74288
74296
|
f2.success("Configuration saved!");
|
|
74289
74297
|
console.log();
|
|
74290
|
-
console.log(` ${
|
|
74291
|
-
console.log(` ${
|
|
74292
|
-
console.log(` ${
|
|
74293
|
-
console.log(` ${
|
|
74298
|
+
console.log(` ${import_picocolors43.default.dim("Platforms:")} ${selectedPlatforms.join(", ")}`);
|
|
74299
|
+
console.log(` ${import_picocolors43.default.dim("Review:")} ${config.reviewMode}`);
|
|
74300
|
+
console.log(` ${import_picocolors43.default.dim("Max/day:")} ${config.maxContentPerDay}`);
|
|
74301
|
+
console.log(` ${import_picocolors43.default.dim("Timezone:")} ${config.schedule.timezone}`);
|
|
74294
74302
|
console.log();
|
|
74295
74303
|
}
|
|
74296
|
-
var
|
|
74304
|
+
var import_picocolors43;
|
|
74297
74305
|
var init_setup_wizard = __esm(() => {
|
|
74298
74306
|
init_dist2();
|
|
74299
74307
|
init_platform_setup_facebook();
|
|
74300
74308
|
init_platform_setup_x();
|
|
74301
74309
|
init_repo_discoverer();
|
|
74302
74310
|
init_state_manager();
|
|
74303
|
-
|
|
74311
|
+
import_picocolors43 = __toESM(require_picocolors(), 1);
|
|
74304
74312
|
});
|
|
74305
74313
|
|
|
74306
74314
|
// src/commands/content/content-review-commands.ts
|
|
74307
74315
|
import { existsSync as existsSync80 } from "node:fs";
|
|
74308
|
-
import { homedir as
|
|
74316
|
+
import { homedir as homedir51 } from "node:os";
|
|
74309
74317
|
async function queueContent() {
|
|
74310
74318
|
const cwd2 = process.cwd();
|
|
74311
74319
|
const config = await loadContentConfig(cwd2);
|
|
74312
|
-
const dbPath = config.dbPath.replace(/^~/,
|
|
74320
|
+
const dbPath = config.dbPath.replace(/^~/, homedir51());
|
|
74313
74321
|
if (!existsSync80(dbPath)) {
|
|
74314
74322
|
logger.info("No content database found. Run 'ck content setup' first.");
|
|
74315
74323
|
return;
|
|
@@ -74336,7 +74344,7 @@ async function queueContent() {
|
|
|
74336
74344
|
async function approveContentCmd(id) {
|
|
74337
74345
|
const cwd2 = process.cwd();
|
|
74338
74346
|
const config = await loadContentConfig(cwd2);
|
|
74339
|
-
const dbPath = config.dbPath.replace(/^~/,
|
|
74347
|
+
const dbPath = config.dbPath.replace(/^~/, homedir51());
|
|
74340
74348
|
const db = initDatabase(dbPath);
|
|
74341
74349
|
try {
|
|
74342
74350
|
approveContent(db, Number.parseInt(id, 10));
|
|
@@ -74348,7 +74356,7 @@ async function approveContentCmd(id) {
|
|
|
74348
74356
|
async function rejectContentCmd(id, reason) {
|
|
74349
74357
|
const cwd2 = process.cwd();
|
|
74350
74358
|
const config = await loadContentConfig(cwd2);
|
|
74351
|
-
const dbPath = config.dbPath.replace(/^~/,
|
|
74359
|
+
const dbPath = config.dbPath.replace(/^~/, homedir51());
|
|
74352
74360
|
const db = initDatabase(dbPath);
|
|
74353
74361
|
try {
|
|
74354
74362
|
rejectContent(db, Number.parseInt(id, 10), reason);
|
|
@@ -74379,7 +74387,7 @@ __export(exports_content_subcommands, {
|
|
|
74379
74387
|
approveContentCmd: () => approveContentCmd
|
|
74380
74388
|
});
|
|
74381
74389
|
import { existsSync as existsSync81, readFileSync as readFileSync21, unlinkSync as unlinkSync6 } from "node:fs";
|
|
74382
|
-
import { homedir as
|
|
74390
|
+
import { homedir as homedir52 } from "node:os";
|
|
74383
74391
|
import { join as join163 } from "node:path";
|
|
74384
74392
|
function isDaemonRunning() {
|
|
74385
74393
|
const lockFile = join163(LOCK_DIR, `${LOCK_NAME2}.lock`);
|
|
@@ -74453,7 +74461,7 @@ async function statusContent() {
|
|
|
74453
74461
|
} catch {}
|
|
74454
74462
|
}
|
|
74455
74463
|
async function logsContent(options2) {
|
|
74456
|
-
const logDir = join163(
|
|
74464
|
+
const logDir = join163(homedir52(), ".claudekit", "logs");
|
|
74457
74465
|
const dateStr = new Date().toISOString().slice(0, 10).replace(/-/g, "");
|
|
74458
74466
|
const logPath = join163(logDir, `content-${dateStr}.log`);
|
|
74459
74467
|
if (!existsSync81(logPath)) {
|
|
@@ -74487,12 +74495,12 @@ var init_content_subcommands = __esm(() => {
|
|
|
74487
74495
|
init_setup_wizard();
|
|
74488
74496
|
init_state_manager();
|
|
74489
74497
|
init_content_review_commands();
|
|
74490
|
-
LOCK_DIR = join163(
|
|
74498
|
+
LOCK_DIR = join163(homedir52(), ".claudekit", "locks");
|
|
74491
74499
|
});
|
|
74492
74500
|
|
|
74493
74501
|
// src/commands/content/content-command.ts
|
|
74494
74502
|
import { existsSync as existsSync82, mkdirSync as mkdirSync9, unlinkSync as unlinkSync7, writeFileSync as writeFileSync7 } from "node:fs";
|
|
74495
|
-
import { homedir as
|
|
74503
|
+
import { homedir as homedir53 } from "node:os";
|
|
74496
74504
|
import { join as join164 } from "node:path";
|
|
74497
74505
|
async function contentCommand(options2) {
|
|
74498
74506
|
const cwd2 = process.cwd();
|
|
@@ -74525,7 +74533,7 @@ async function contentCommand(options2) {
|
|
|
74525
74533
|
if (!existsSync82(LOCK_DIR2))
|
|
74526
74534
|
mkdirSync9(LOCK_DIR2, { recursive: true });
|
|
74527
74535
|
writeFileSync7(LOCK_FILE, String(process.pid), "utf-8");
|
|
74528
|
-
const dbPath = config.dbPath.replace(/^~/,
|
|
74536
|
+
const dbPath = config.dbPath.replace(/^~/, homedir53());
|
|
74529
74537
|
const db = initDatabase(dbPath);
|
|
74530
74538
|
contentLogger.info(`Database initialised at ${dbPath}`);
|
|
74531
74539
|
const adapters = initializeAdapters(config);
|
|
@@ -74654,8 +74662,8 @@ function shouldRunCleanup(lastAt) {
|
|
|
74654
74662
|
return Date.now() - new Date(lastAt).getTime() >= 86400000;
|
|
74655
74663
|
}
|
|
74656
74664
|
function sleep2(ms) {
|
|
74657
|
-
return new Promise((
|
|
74658
|
-
setTimeout(
|
|
74665
|
+
return new Promise((resolve44) => {
|
|
74666
|
+
setTimeout(resolve44, ms);
|
|
74659
74667
|
});
|
|
74660
74668
|
}
|
|
74661
74669
|
var LOCK_DIR2, LOCK_FILE, MAX_CREATION_RETRIES = 3, MAX_PUBLISH_RETRIES_PER_CYCLE = 3, PUBLISH_RETRY_WINDOW_HOURS = 24;
|
|
@@ -74671,7 +74679,7 @@ var init_content_command = __esm(() => {
|
|
|
74671
74679
|
init_publisher();
|
|
74672
74680
|
init_review_manager();
|
|
74673
74681
|
init_state_manager();
|
|
74674
|
-
LOCK_DIR2 = join164(
|
|
74682
|
+
LOCK_DIR2 = join164(homedir53(), ".claudekit", "locks");
|
|
74675
74683
|
LOCK_FILE = join164(LOCK_DIR2, "ck-content.lock");
|
|
74676
74684
|
});
|
|
74677
74685
|
|
|
@@ -75844,20 +75852,20 @@ var migrateCommandHelp;
|
|
|
75844
75852
|
var init_migrate_command_help = __esm(() => {
|
|
75845
75853
|
migrateCommandHelp = {
|
|
75846
75854
|
name: "migrate",
|
|
75847
|
-
description: "Migrate agents, commands, skills, config, rules, and hooks to other providers",
|
|
75855
|
+
description: "Migrate Claude Code agents, commands, skills, config, rules, and hooks to other providers",
|
|
75848
75856
|
usage: "ck migrate [options]",
|
|
75849
75857
|
examples: [
|
|
75850
75858
|
{
|
|
75851
|
-
command: "ck migrate --agent
|
|
75852
|
-
description: "
|
|
75859
|
+
command: "ck migrate --agent codex --dry-run",
|
|
75860
|
+
description: "Preview the destination-aware migration plan before writing files"
|
|
75853
75861
|
},
|
|
75854
75862
|
{
|
|
75855
|
-
command: "ck migrate --agent
|
|
75856
|
-
description: "
|
|
75863
|
+
command: "ck migrate --agent codex -g",
|
|
75864
|
+
description: "Write to Codex global paths such as ~/.codex/ and ~/.agents/skills"
|
|
75857
75865
|
},
|
|
75858
75866
|
{
|
|
75859
|
-
command: "ck migrate --
|
|
75860
|
-
description: "
|
|
75867
|
+
command: "CK_FORCE_ASCII=1 ck migrate --agent codex",
|
|
75868
|
+
description: "Force ASCII borders on legacy Windows terminals (cmd.exe, older PowerShell)"
|
|
75861
75869
|
}
|
|
75862
75870
|
],
|
|
75863
75871
|
optionGroups: [
|
|
@@ -75874,19 +75882,19 @@ var init_migrate_command_help = __esm(() => {
|
|
|
75874
75882
|
},
|
|
75875
75883
|
{
|
|
75876
75884
|
flags: "-g, --global",
|
|
75877
|
-
description: "Install globally instead of project-level"
|
|
75885
|
+
description: "Install globally instead of the default project-level scope"
|
|
75878
75886
|
},
|
|
75879
75887
|
{
|
|
75880
75888
|
flags: "-y, --yes",
|
|
75881
|
-
description: "Skip confirmation prompts"
|
|
75889
|
+
description: "Skip confirmation prompts after the pre-flight summary"
|
|
75882
75890
|
},
|
|
75883
75891
|
{
|
|
75884
75892
|
flags: "-f, --force",
|
|
75885
|
-
description: "Force reinstall deleted
|
|
75893
|
+
description: "Force reinstall deleted or edited managed items"
|
|
75886
75894
|
},
|
|
75887
75895
|
{
|
|
75888
75896
|
flags: "--dry-run",
|
|
75889
|
-
description: "Preview plan without writing files"
|
|
75897
|
+
description: "Preview plan, destinations, and next steps without writing files"
|
|
75890
75898
|
}
|
|
75891
75899
|
]
|
|
75892
75900
|
},
|
|
@@ -76030,22 +76038,22 @@ function padEnd(text, width) {
|
|
|
76030
76038
|
const padding = Math.max(0, width - visibleLength);
|
|
76031
76039
|
return text + " ".repeat(padding);
|
|
76032
76040
|
}
|
|
76033
|
-
var
|
|
76041
|
+
var import_picocolors47, NO_COLOR, isColorSupported, identity = (text) => text, colors, defaultTheme;
|
|
76034
76042
|
var init_help_colors = __esm(() => {
|
|
76035
|
-
|
|
76043
|
+
import_picocolors47 = __toESM(require_picocolors(), 1);
|
|
76036
76044
|
NO_COLOR = process.env.NO_COLOR !== undefined;
|
|
76037
76045
|
isColorSupported = !NO_COLOR && Boolean(process.stdout.isTTY);
|
|
76038
76046
|
colors = {
|
|
76039
|
-
banner: isColorSupported ?
|
|
76040
|
-
command: isColorSupported ?
|
|
76041
|
-
heading: isColorSupported ?
|
|
76042
|
-
flag: isColorSupported ?
|
|
76043
|
-
description: isColorSupported ?
|
|
76044
|
-
example: isColorSupported ?
|
|
76045
|
-
warning: isColorSupported ?
|
|
76046
|
-
error: isColorSupported ?
|
|
76047
|
-
muted: isColorSupported ?
|
|
76048
|
-
success: isColorSupported ?
|
|
76047
|
+
banner: isColorSupported ? import_picocolors47.default.cyan : identity,
|
|
76048
|
+
command: isColorSupported ? import_picocolors47.default.bold : identity,
|
|
76049
|
+
heading: isColorSupported ? import_picocolors47.default.yellow : identity,
|
|
76050
|
+
flag: isColorSupported ? import_picocolors47.default.green : identity,
|
|
76051
|
+
description: isColorSupported ? import_picocolors47.default.gray : identity,
|
|
76052
|
+
example: isColorSupported ? import_picocolors47.default.blue : identity,
|
|
76053
|
+
warning: isColorSupported ? import_picocolors47.default.yellow : identity,
|
|
76054
|
+
error: isColorSupported ? import_picocolors47.default.red : identity,
|
|
76055
|
+
muted: isColorSupported ? import_picocolors47.default.dim : identity,
|
|
76056
|
+
success: isColorSupported ? import_picocolors47.default.green : identity
|
|
76049
76057
|
};
|
|
76050
76058
|
defaultTheme = {
|
|
76051
76059
|
banner: colors.banner,
|
|
@@ -76093,7 +76101,7 @@ function getPagerArgs(pagerCmd) {
|
|
|
76093
76101
|
return [];
|
|
76094
76102
|
}
|
|
76095
76103
|
async function trySystemPager(content) {
|
|
76096
|
-
return new Promise((
|
|
76104
|
+
return new Promise((resolve44) => {
|
|
76097
76105
|
const pagerCmd = process.env.PAGER || "less";
|
|
76098
76106
|
const pagerArgs = getPagerArgs(pagerCmd);
|
|
76099
76107
|
try {
|
|
@@ -76103,20 +76111,20 @@ async function trySystemPager(content) {
|
|
|
76103
76111
|
});
|
|
76104
76112
|
const timeout2 = setTimeout(() => {
|
|
76105
76113
|
pager.kill();
|
|
76106
|
-
|
|
76114
|
+
resolve44(false);
|
|
76107
76115
|
}, 30000);
|
|
76108
76116
|
pager.stdin.write(content);
|
|
76109
76117
|
pager.stdin.end();
|
|
76110
76118
|
pager.on("close", (code2) => {
|
|
76111
76119
|
clearTimeout(timeout2);
|
|
76112
|
-
|
|
76120
|
+
resolve44(code2 === 0);
|
|
76113
76121
|
});
|
|
76114
76122
|
pager.on("error", () => {
|
|
76115
76123
|
clearTimeout(timeout2);
|
|
76116
|
-
|
|
76124
|
+
resolve44(false);
|
|
76117
76125
|
});
|
|
76118
76126
|
} catch {
|
|
76119
|
-
|
|
76127
|
+
resolve44(false);
|
|
76120
76128
|
}
|
|
76121
76129
|
});
|
|
76122
76130
|
}
|
|
@@ -76143,16 +76151,16 @@ async function basicPager(content) {
|
|
|
76143
76151
|
break;
|
|
76144
76152
|
}
|
|
76145
76153
|
const remaining = lines.length - currentLine;
|
|
76146
|
-
await new Promise((
|
|
76154
|
+
await new Promise((resolve44) => {
|
|
76147
76155
|
rl.question(`-- More (${remaining} lines) [Enter/q] --`, (answer) => {
|
|
76148
76156
|
if (answer.toLowerCase() === "q") {
|
|
76149
76157
|
rl.close();
|
|
76150
76158
|
process.exitCode = 0;
|
|
76151
|
-
|
|
76159
|
+
resolve44();
|
|
76152
76160
|
return;
|
|
76153
76161
|
}
|
|
76154
76162
|
process.stdout.write("\x1B[1A\x1B[2K");
|
|
76155
|
-
|
|
76163
|
+
resolve44();
|
|
76156
76164
|
});
|
|
76157
76165
|
});
|
|
76158
76166
|
}
|
|
@@ -76348,7 +76356,7 @@ var init_help_renderer = __esm(() => {
|
|
|
76348
76356
|
DEFAULT_HELP_OPTIONS = {
|
|
76349
76357
|
showBanner: true,
|
|
76350
76358
|
showExamples: true,
|
|
76351
|
-
maxExamples:
|
|
76359
|
+
maxExamples: 3,
|
|
76352
76360
|
interactive: false,
|
|
76353
76361
|
width: process.stdout.columns || 80,
|
|
76354
76362
|
theme: defaultTheme,
|
|
@@ -76370,7 +76378,7 @@ function getHelpOptions() {
|
|
|
76370
76378
|
...DEFAULT_HELP_OPTIONS,
|
|
76371
76379
|
showBanner: isTTY2,
|
|
76372
76380
|
showExamples: true,
|
|
76373
|
-
maxExamples:
|
|
76381
|
+
maxExamples: 3,
|
|
76374
76382
|
interactive: isTTY2,
|
|
76375
76383
|
width,
|
|
76376
76384
|
noColor
|
|
@@ -103991,12 +103999,326 @@ async function initCommand(options2) {
|
|
|
103991
103999
|
}
|
|
103992
104000
|
// src/commands/migrate/migrate-command.ts
|
|
103993
104001
|
init_dist2();
|
|
103994
|
-
var
|
|
104002
|
+
var import_picocolors30 = __toESM(require_picocolors(), 1);
|
|
103995
104003
|
import { existsSync as existsSync62 } from "node:fs";
|
|
103996
104004
|
import { readFile as readFile59, rm as rm15, unlink as unlink12 } from "node:fs/promises";
|
|
103997
|
-
import { homedir as
|
|
103998
|
-
import { basename as
|
|
104005
|
+
import { homedir as homedir46 } from "node:os";
|
|
104006
|
+
import { basename as basename26, join as join139, resolve as resolve36 } from "node:path";
|
|
103999
104007
|
init_logger();
|
|
104008
|
+
|
|
104009
|
+
// src/ui/ck-cli-design/tokens.ts
|
|
104010
|
+
var import_picocolors27 = __toESM(require_picocolors(), 1);
|
|
104011
|
+
import { homedir as homedir45, platform as platform16 } from "node:os";
|
|
104012
|
+
import { resolve as resolve35, win32 as win323 } from "node:path";
|
|
104013
|
+
var PANEL_MIN_WIDTH = 60;
|
|
104014
|
+
var PANEL_MAX_WIDTH = 72;
|
|
104015
|
+
var DEFAULT_WIDTH = PANEL_MAX_WIDTH;
|
|
104016
|
+
var UNICODE_BOX = {
|
|
104017
|
+
tl: "╔",
|
|
104018
|
+
tr: "╗",
|
|
104019
|
+
bl: "╚",
|
|
104020
|
+
br: "╝",
|
|
104021
|
+
h: "═",
|
|
104022
|
+
v: "║",
|
|
104023
|
+
bullet: "●"
|
|
104024
|
+
};
|
|
104025
|
+
var ASCII_BOX = {
|
|
104026
|
+
tl: "+",
|
|
104027
|
+
tr: "+",
|
|
104028
|
+
bl: "+",
|
|
104029
|
+
br: "+",
|
|
104030
|
+
h: "-",
|
|
104031
|
+
v: "|",
|
|
104032
|
+
bullet: "+"
|
|
104033
|
+
};
|
|
104034
|
+
function createCliDesignContext(options2 = {}) {
|
|
104035
|
+
const env2 = options2.env ?? process.env;
|
|
104036
|
+
const isTTY2 = options2.isTTY ?? process.stdout.isTTY === true;
|
|
104037
|
+
const rawWidth = options2.columns ?? process.stdout.columns ?? DEFAULT_WIDTH;
|
|
104038
|
+
const width = Math.max(40, Math.min(rawWidth, PANEL_MAX_WIDTH));
|
|
104039
|
+
const currentPlatform = options2.platform ?? platform16();
|
|
104040
|
+
return {
|
|
104041
|
+
box: supportsCliUnicode({ env: env2, isTTY: isTTY2, platform: currentPlatform }) ? UNICODE_BOX : ASCII_BOX,
|
|
104042
|
+
platform: currentPlatform,
|
|
104043
|
+
rawWidth,
|
|
104044
|
+
supportsPanels: width >= PANEL_MIN_WIDTH,
|
|
104045
|
+
useColor: isTTY2 && !env2.NO_COLOR,
|
|
104046
|
+
width
|
|
104047
|
+
};
|
|
104048
|
+
}
|
|
104049
|
+
function supportsCliUnicode(options2) {
|
|
104050
|
+
const { env: env2, isTTY: isTTY2, platform: platform17 } = options2;
|
|
104051
|
+
if (env2.CK_FORCE_ASCII === "1" || env2.NO_UNICODE === "1")
|
|
104052
|
+
return false;
|
|
104053
|
+
if (env2.TERM === "dumb")
|
|
104054
|
+
return false;
|
|
104055
|
+
if (env2.WT_SESSION)
|
|
104056
|
+
return true;
|
|
104057
|
+
const ci = (env2.CI ?? "").trim().toLowerCase();
|
|
104058
|
+
if (ci === "true" || ci === "1")
|
|
104059
|
+
return true;
|
|
104060
|
+
if (!isTTY2)
|
|
104061
|
+
return false;
|
|
104062
|
+
if (env2.TERM_PROGRAM === "iTerm.app")
|
|
104063
|
+
return true;
|
|
104064
|
+
if (env2.TERM_PROGRAM === "Apple_Terminal")
|
|
104065
|
+
return true;
|
|
104066
|
+
if (env2.TERM_PROGRAM === "vscode")
|
|
104067
|
+
return true;
|
|
104068
|
+
if (env2.KONSOLE_VERSION)
|
|
104069
|
+
return true;
|
|
104070
|
+
const locale = `${env2.LANG ?? ""}${env2.LC_ALL ?? ""}`.toLowerCase();
|
|
104071
|
+
if (locale.includes("utf"))
|
|
104072
|
+
return true;
|
|
104073
|
+
if (platform17 === "win32")
|
|
104074
|
+
return false;
|
|
104075
|
+
return true;
|
|
104076
|
+
}
|
|
104077
|
+
function stripAnsi2(value) {
|
|
104078
|
+
let result = "";
|
|
104079
|
+
for (let index = 0;index < value.length; index += 1) {
|
|
104080
|
+
const code2 = value.charCodeAt(index);
|
|
104081
|
+
if (code2 !== 27) {
|
|
104082
|
+
result += value[index];
|
|
104083
|
+
continue;
|
|
104084
|
+
}
|
|
104085
|
+
const next = value[index + 1];
|
|
104086
|
+
if (next === "[") {
|
|
104087
|
+
index += 2;
|
|
104088
|
+
while (index < value.length) {
|
|
104089
|
+
const char = value.charCodeAt(index);
|
|
104090
|
+
if (char >= 64 && char <= 126)
|
|
104091
|
+
break;
|
|
104092
|
+
index += 1;
|
|
104093
|
+
}
|
|
104094
|
+
continue;
|
|
104095
|
+
}
|
|
104096
|
+
if (next === "]") {
|
|
104097
|
+
index += 2;
|
|
104098
|
+
while (index < value.length) {
|
|
104099
|
+
if (value.charCodeAt(index) === 7)
|
|
104100
|
+
break;
|
|
104101
|
+
if (value.charCodeAt(index) === 27 && value[index + 1] === "\\") {
|
|
104102
|
+
index += 1;
|
|
104103
|
+
break;
|
|
104104
|
+
}
|
|
104105
|
+
index += 1;
|
|
104106
|
+
}
|
|
104107
|
+
continue;
|
|
104108
|
+
}
|
|
104109
|
+
if (next !== undefined)
|
|
104110
|
+
index += 1;
|
|
104111
|
+
}
|
|
104112
|
+
return result;
|
|
104113
|
+
}
|
|
104114
|
+
function visibleWidth(value) {
|
|
104115
|
+
return stripAnsi2(value).length;
|
|
104116
|
+
}
|
|
104117
|
+
function padVisible(value, width) {
|
|
104118
|
+
const padding = Math.max(0, width - visibleWidth(value));
|
|
104119
|
+
return `${value}${" ".repeat(padding)}`;
|
|
104120
|
+
}
|
|
104121
|
+
function truncateMiddle(value, width) {
|
|
104122
|
+
if (width <= 0)
|
|
104123
|
+
return "";
|
|
104124
|
+
if (visibleWidth(value) <= width)
|
|
104125
|
+
return value;
|
|
104126
|
+
if (width <= 3)
|
|
104127
|
+
return ".".repeat(width);
|
|
104128
|
+
const keep = width - 3;
|
|
104129
|
+
const front = Math.ceil(keep / 2);
|
|
104130
|
+
const back = Math.floor(keep / 2);
|
|
104131
|
+
return `${value.slice(0, front)}...${value.slice(value.length - back)}`;
|
|
104132
|
+
}
|
|
104133
|
+
function wrapText(value, width) {
|
|
104134
|
+
if (width <= 0)
|
|
104135
|
+
return [""];
|
|
104136
|
+
const words = value.split(/\s+/).filter(Boolean);
|
|
104137
|
+
if (words.length === 0)
|
|
104138
|
+
return [""];
|
|
104139
|
+
const lines = [];
|
|
104140
|
+
let current = "";
|
|
104141
|
+
for (const word of words) {
|
|
104142
|
+
const candidate = current.length === 0 ? word : `${current} ${word}`;
|
|
104143
|
+
if (visibleWidth(candidate) <= width) {
|
|
104144
|
+
current = candidate;
|
|
104145
|
+
continue;
|
|
104146
|
+
}
|
|
104147
|
+
if (current.length > 0) {
|
|
104148
|
+
lines.push(current);
|
|
104149
|
+
current = "";
|
|
104150
|
+
}
|
|
104151
|
+
if (visibleWidth(word) <= width) {
|
|
104152
|
+
current = word;
|
|
104153
|
+
continue;
|
|
104154
|
+
}
|
|
104155
|
+
let remaining = word;
|
|
104156
|
+
while (visibleWidth(remaining) > width) {
|
|
104157
|
+
lines.push(`${remaining.slice(0, Math.max(1, width - 3))}...`);
|
|
104158
|
+
remaining = remaining.slice(Math.max(1, width - 3));
|
|
104159
|
+
}
|
|
104160
|
+
current = remaining;
|
|
104161
|
+
}
|
|
104162
|
+
if (current.length > 0) {
|
|
104163
|
+
lines.push(current);
|
|
104164
|
+
}
|
|
104165
|
+
return lines;
|
|
104166
|
+
}
|
|
104167
|
+
function formatDisplayPath(value) {
|
|
104168
|
+
const normalized = value.replace(/\\/g, "/");
|
|
104169
|
+
const home9 = homedir45().replace(/\\/g, "/");
|
|
104170
|
+
if (normalized === home9)
|
|
104171
|
+
return "~";
|
|
104172
|
+
if (normalized.startsWith(`${home9}/`)) {
|
|
104173
|
+
return normalized.replace(home9, "~");
|
|
104174
|
+
}
|
|
104175
|
+
return normalized;
|
|
104176
|
+
}
|
|
104177
|
+
function formatCdHint(value, currentPlatform = platform16()) {
|
|
104178
|
+
if (currentPlatform === "win32") {
|
|
104179
|
+
const absolutePath2 = win323.resolve(value);
|
|
104180
|
+
return `cd /d "${absolutePath2}"`;
|
|
104181
|
+
}
|
|
104182
|
+
const absolutePath = resolve35(value);
|
|
104183
|
+
const displayPath = formatDisplayPath(absolutePath);
|
|
104184
|
+
if (displayPath.includes(" ")) {
|
|
104185
|
+
return `cd "${displayPath}"`;
|
|
104186
|
+
}
|
|
104187
|
+
return `cd ${displayPath}`;
|
|
104188
|
+
}
|
|
104189
|
+
function paint(value, tone, context) {
|
|
104190
|
+
if (!context.useColor)
|
|
104191
|
+
return value;
|
|
104192
|
+
switch (tone) {
|
|
104193
|
+
case "accent":
|
|
104194
|
+
return import_picocolors27.default.cyan(value);
|
|
104195
|
+
case "muted":
|
|
104196
|
+
return import_picocolors27.default.dim(value);
|
|
104197
|
+
case "success":
|
|
104198
|
+
return import_picocolors27.default.green(value);
|
|
104199
|
+
case "warning":
|
|
104200
|
+
return import_picocolors27.default.yellow(value);
|
|
104201
|
+
case "heading":
|
|
104202
|
+
return import_picocolors27.default.bold(value);
|
|
104203
|
+
}
|
|
104204
|
+
}
|
|
104205
|
+
|
|
104206
|
+
// src/ui/ck-cli-design/next-steps-footer.ts
|
|
104207
|
+
function renderNextStepsFooter(options2) {
|
|
104208
|
+
const context = options2.context ?? createCliDesignContext(options2.contextOptions);
|
|
104209
|
+
const bullet = context.box.bullet === "+" ? "-" : "•";
|
|
104210
|
+
return options2.commands.map((command) => `${bullet} ${command}`);
|
|
104211
|
+
}
|
|
104212
|
+
// src/ui/ck-cli-design/panel.ts
|
|
104213
|
+
function renderPanel(options2) {
|
|
104214
|
+
const context = options2.context ?? createCliDesignContext(options2.contextOptions);
|
|
104215
|
+
const title = paint(options2.title, "heading", context);
|
|
104216
|
+
const subtitle = options2.subtitle ? paint(options2.subtitle, "muted", context) : null;
|
|
104217
|
+
if (!context.supportsPanels) {
|
|
104218
|
+
return renderPlainPanel(options2.zones, title, subtitle, context);
|
|
104219
|
+
}
|
|
104220
|
+
return renderBoxedPanel(options2.zones, title, subtitle, context);
|
|
104221
|
+
}
|
|
104222
|
+
function renderPlainPanel(zones, title, subtitle, context) {
|
|
104223
|
+
const lines = [title];
|
|
104224
|
+
if (subtitle)
|
|
104225
|
+
lines.push(subtitle);
|
|
104226
|
+
lines.push("");
|
|
104227
|
+
for (const zone of zones) {
|
|
104228
|
+
lines.push(paint(zone.label, "accent", context));
|
|
104229
|
+
for (const line of zone.lines) {
|
|
104230
|
+
lines.push(...wrapText(line, context.width - 2).map((entry) => ` ${entry}`));
|
|
104231
|
+
}
|
|
104232
|
+
lines.push("");
|
|
104233
|
+
}
|
|
104234
|
+
return trimTrailingBlank(lines);
|
|
104235
|
+
}
|
|
104236
|
+
function renderBoxedPanel(zones, title, subtitle, context) {
|
|
104237
|
+
const labelWidth = Math.min(12, Math.max(...zones.map((zone) => zone.label.length), 4));
|
|
104238
|
+
const innerWidth = context.width - 4;
|
|
104239
|
+
const lines = [renderTopBorder(title, context.box, context.width)];
|
|
104240
|
+
if (subtitle) {
|
|
104241
|
+
lines.push(renderContentLine(subtitle, innerWidth, context.box));
|
|
104242
|
+
lines.push(renderContentLine("", innerWidth, context.box));
|
|
104243
|
+
}
|
|
104244
|
+
for (const [index, zone] of zones.entries()) {
|
|
104245
|
+
for (const line of formatZone(zone, labelWidth, innerWidth, context)) {
|
|
104246
|
+
lines.push(renderContentLine(line, innerWidth, context.box));
|
|
104247
|
+
}
|
|
104248
|
+
if (index < zones.length - 1) {
|
|
104249
|
+
lines.push(renderContentLine("", innerWidth, context.box));
|
|
104250
|
+
}
|
|
104251
|
+
}
|
|
104252
|
+
lines.push(renderBottomBorder(context.box, context.width));
|
|
104253
|
+
return lines;
|
|
104254
|
+
}
|
|
104255
|
+
function formatZone(zone, labelWidth, innerWidth, context) {
|
|
104256
|
+
const availableWidth = Math.max(8, innerWidth - labelWidth - 3);
|
|
104257
|
+
const label = paint(zone.label, "accent", context);
|
|
104258
|
+
const rendered = [];
|
|
104259
|
+
for (const [index, rawLine] of zone.lines.entries()) {
|
|
104260
|
+
const wrappedLines = wrapText(rawLine, availableWidth);
|
|
104261
|
+
for (const [wrappedIndex, wrappedLine] of wrappedLines.entries()) {
|
|
104262
|
+
const prefix = index === 0 && wrappedIndex === 0 ? padVisible(label, labelWidth) : " ".repeat(labelWidth);
|
|
104263
|
+
rendered.push(` ${prefix} ${wrappedLine}`);
|
|
104264
|
+
}
|
|
104265
|
+
}
|
|
104266
|
+
return rendered;
|
|
104267
|
+
}
|
|
104268
|
+
function renderTopBorder(title, box, width) {
|
|
104269
|
+
const availableWidth = width - 2;
|
|
104270
|
+
const decorationWidth = 3;
|
|
104271
|
+
const maxTitleWidth = Math.max(1, availableWidth - decorationWidth - 1);
|
|
104272
|
+
const safeTitle = visibleWidth(title) > maxTitleWidth ? truncateMiddle(title, maxTitleWidth) : title;
|
|
104273
|
+
const heading = `${box.h} ${safeTitle} `;
|
|
104274
|
+
const fill = Math.max(1, availableWidth - visibleWidth(heading));
|
|
104275
|
+
return `${box.tl}${heading}${box.h.repeat(fill)}${box.tr}`;
|
|
104276
|
+
}
|
|
104277
|
+
function renderBottomBorder(box, width) {
|
|
104278
|
+
return `${box.bl}${box.h.repeat(width - 2)}${box.br}`;
|
|
104279
|
+
}
|
|
104280
|
+
function renderContentLine(content, width, box) {
|
|
104281
|
+
return `${box.v} ${padVisible(content, width)} ${box.v}`;
|
|
104282
|
+
}
|
|
104283
|
+
function trimTrailingBlank(lines) {
|
|
104284
|
+
const trimmed = [...lines];
|
|
104285
|
+
while (trimmed[trimmed.length - 1] === "") {
|
|
104286
|
+
trimmed.pop();
|
|
104287
|
+
}
|
|
104288
|
+
return trimmed;
|
|
104289
|
+
}
|
|
104290
|
+
// src/ui/ck-cli-design/preflight-row.ts
|
|
104291
|
+
function renderPreflightRow(options2) {
|
|
104292
|
+
const context = options2.context ?? createCliDesignContext(options2.contextOptions);
|
|
104293
|
+
const icon = options2.icon ?? context.box.bullet;
|
|
104294
|
+
const label = padVisible(options2.label, 10);
|
|
104295
|
+
const count = String(options2.count).padStart(3, " ");
|
|
104296
|
+
const prefix = ` [${icon}] ${label} ${count} -> `;
|
|
104297
|
+
const availableWidth = Math.max(10, context.width - prefix.length);
|
|
104298
|
+
const [firstDestination, ...extraDestinations] = options2.destinations.length > 0 ? options2.destinations : ["unsupported for selected provider(s)"];
|
|
104299
|
+
const lines = [`${prefix}${truncateMiddle(firstDestination, availableWidth)}`];
|
|
104300
|
+
for (const destination of extraDestinations) {
|
|
104301
|
+
lines.push(`${" ".repeat(prefix.length)}${truncateMiddle(destination, availableWidth)}`);
|
|
104302
|
+
}
|
|
104303
|
+
for (const note2 of options2.notes ?? []) {
|
|
104304
|
+
lines.push(`${" ".repeat(prefix.length)}${paint(`(${note2})`, "muted", context)}`);
|
|
104305
|
+
}
|
|
104306
|
+
return lines;
|
|
104307
|
+
}
|
|
104308
|
+
// src/ui/ck-cli-design/source-target-header.ts
|
|
104309
|
+
function renderSourceTargetHeader(options2) {
|
|
104310
|
+
const context = options2.context ?? createCliDesignContext(options2.contextOptions);
|
|
104311
|
+
return renderPanel({
|
|
104312
|
+
context,
|
|
104313
|
+
subtitle: options2.subtitle,
|
|
104314
|
+
title: options2.title,
|
|
104315
|
+
zones: [
|
|
104316
|
+
{ label: "SOURCE", lines: options2.sourceLines },
|
|
104317
|
+
{ label: "DESTINATION", lines: options2.targetLines }
|
|
104318
|
+
]
|
|
104319
|
+
});
|
|
104320
|
+
}
|
|
104321
|
+
// src/commands/migrate/migrate-command.ts
|
|
104000
104322
|
init_agents_discovery();
|
|
104001
104323
|
init_commands_discovery();
|
|
104002
104324
|
init_codex_toml_installer();
|
|
@@ -104150,9 +104472,17 @@ init_hooks_settings_merger();
|
|
|
104150
104472
|
init_model_taxonomy();
|
|
104151
104473
|
|
|
104152
104474
|
// src/commands/portable/plan-display.ts
|
|
104153
|
-
var
|
|
104475
|
+
var import_picocolors28 = __toESM(require_picocolors(), 1);
|
|
104476
|
+
import { basename as basename25, dirname as dirname38, extname as extname7 } from "node:path";
|
|
104154
104477
|
var DEFAULT_MAX_PLAN_GROUP_ITEMS = 20;
|
|
104155
|
-
var TYPE_ORDER = [
|
|
104478
|
+
var TYPE_ORDER = [
|
|
104479
|
+
"agent",
|
|
104480
|
+
"command",
|
|
104481
|
+
"skill",
|
|
104482
|
+
"config",
|
|
104483
|
+
"rules",
|
|
104484
|
+
"hooks"
|
|
104485
|
+
];
|
|
104156
104486
|
var TYPE_LABELS = {
|
|
104157
104487
|
agent: "Subagents",
|
|
104158
104488
|
command: "Commands",
|
|
@@ -104223,7 +104553,7 @@ function printActionGroup(label, actions, prefix, colorName, options2) {
|
|
|
104223
104553
|
break;
|
|
104224
104554
|
const typeLabel = TYPE_LABELS[type];
|
|
104225
104555
|
const subHeader = ` ${typeLabel} (${typeActions.length})`;
|
|
104226
|
-
console.log(options2.color ?
|
|
104556
|
+
console.log(options2.color ? import_picocolors28.default.dim(subHeader) : subHeader);
|
|
104227
104557
|
const shown = typeActions.slice(0, remaining);
|
|
104228
104558
|
for (const action of shown) {
|
|
104229
104559
|
printAction(action, prefix, options2);
|
|
@@ -104232,7 +104562,7 @@ function printActionGroup(label, actions, prefix, colorName, options2) {
|
|
|
104232
104562
|
const hiddenInType = typeActions.length - shown.length;
|
|
104233
104563
|
if (hiddenInType > 0) {
|
|
104234
104564
|
const notice = ` ... and ${hiddenInType} more ${typeLabel.toLowerCase()}`;
|
|
104235
|
-
console.log(options2.color ?
|
|
104565
|
+
console.log(options2.color ? import_picocolors28.default.dim(notice) : notice);
|
|
104236
104566
|
}
|
|
104237
104567
|
}
|
|
104238
104568
|
}
|
|
@@ -104244,22 +104574,22 @@ function printAction(action, prefix, options2) {
|
|
|
104244
104574
|
if (action.reason) {
|
|
104245
104575
|
const reason = sanitizeSingleLineTerminalText(action.reason);
|
|
104246
104576
|
if (reason) {
|
|
104247
|
-
console.log(` ${options2.color ?
|
|
104577
|
+
console.log(` ${options2.color ? import_picocolors28.default.dim(reason) : reason}`);
|
|
104248
104578
|
}
|
|
104249
104579
|
}
|
|
104250
104580
|
}
|
|
104251
104581
|
function applyColor(text, colorName) {
|
|
104252
104582
|
switch (colorName) {
|
|
104253
104583
|
case "green":
|
|
104254
|
-
return
|
|
104584
|
+
return import_picocolors28.default.green(text);
|
|
104255
104585
|
case "yellow":
|
|
104256
|
-
return
|
|
104586
|
+
return import_picocolors28.default.yellow(text);
|
|
104257
104587
|
case "red":
|
|
104258
|
-
return
|
|
104588
|
+
return import_picocolors28.default.red(text);
|
|
104259
104589
|
case "magenta":
|
|
104260
|
-
return
|
|
104590
|
+
return import_picocolors28.default.magenta(text);
|
|
104261
104591
|
case "dim":
|
|
104262
|
-
return
|
|
104592
|
+
return import_picocolors28.default.dim(text);
|
|
104263
104593
|
default:
|
|
104264
104594
|
return text;
|
|
104265
104595
|
}
|
|
@@ -104282,42 +104612,185 @@ function summarizeExecutionResults(results) {
|
|
|
104282
104612
|
return { applied, skipped, failed };
|
|
104283
104613
|
}
|
|
104284
104614
|
function displayMigrationSummary(plan, results, options2) {
|
|
104615
|
+
const footer = buildCompletionFooter(plan, results, options2.dryRun === true);
|
|
104285
104616
|
console.log();
|
|
104286
|
-
console.log(
|
|
104617
|
+
console.log(renderPanel({
|
|
104618
|
+
subtitle: footer.subtitle,
|
|
104619
|
+
title: footer.title,
|
|
104620
|
+
zones: footer.zones
|
|
104621
|
+
}).join(`
|
|
104622
|
+
`));
|
|
104623
|
+
if (footer.conflicts.length > 0) {
|
|
104624
|
+
console.log();
|
|
104625
|
+
console.log(" Conflicts resolved:");
|
|
104626
|
+
for (const conflict of footer.conflicts) {
|
|
104627
|
+
console.log(` ${conflict}`);
|
|
104628
|
+
}
|
|
104629
|
+
}
|
|
104287
104630
|
console.log();
|
|
104288
|
-
|
|
104631
|
+
}
|
|
104632
|
+
function buildCompletionFooter(plan, results, dryRun) {
|
|
104633
|
+
const providersInRun = collectProviders(plan, results);
|
|
104634
|
+
const conflicts = plan.actions.filter((action) => action.action === "conflict" && action.resolution?.type).map((action) => sanitizeSingleLineTerminalText(`${action.provider}/${action.type}/${action.item}: ${action.resolution?.type ?? "skipped"}`));
|
|
104289
104635
|
const resultSummary = summarizeExecutionResults(results);
|
|
104290
|
-
const
|
|
104291
|
-
const
|
|
104292
|
-
const
|
|
104293
|
-
const
|
|
104294
|
-
const
|
|
104295
|
-
|
|
104296
|
-
|
|
104636
|
+
const typeCounts = dryRun ? mergeTypeCounts(collectPlannedTypeCounts(plan), collectResultTypeCounts(results)) : collectResultTypeCounts(results);
|
|
104637
|
+
const whereLines = dryRun ? mergeWhereLines(collectPlannedWhereLines(plan), collectResultWhereLines(results)) : collectResultWhereLines(results);
|
|
104638
|
+
const issuesCount = results.filter((result) => !result.success).length;
|
|
104639
|
+
const deleteCount = results.filter((result) => result.success && !result.skipped && result.operation === "delete").length;
|
|
104640
|
+
const zones = [
|
|
104641
|
+
{
|
|
104642
|
+
label: "WHERE",
|
|
104643
|
+
lines: whereLines.length > 0 ? whereLines : ["No destination paths written"]
|
|
104644
|
+
},
|
|
104645
|
+
{
|
|
104646
|
+
label: "WHAT",
|
|
104647
|
+
lines: dryRun ? buildWhatLines(typeCounts, "would change") : buildWhatLines(typeCounts, buildApplySummary(resultSummary, deleteCount))
|
|
104648
|
+
},
|
|
104649
|
+
{
|
|
104650
|
+
label: "NEXT",
|
|
104651
|
+
lines: renderNextStepsFooter({ commands: buildNextCommands(providersInRun, typeCounts) })
|
|
104652
|
+
}
|
|
104653
|
+
];
|
|
104654
|
+
if (!dryRun && issuesCount > 0) {
|
|
104655
|
+
zones.push({
|
|
104656
|
+
label: "ISSUES",
|
|
104657
|
+
lines: [
|
|
104658
|
+
`${issuesCount} item(s) failed`,
|
|
104659
|
+
"Re-run ck migrate after fixing the reported errors."
|
|
104660
|
+
]
|
|
104661
|
+
});
|
|
104297
104662
|
}
|
|
104298
|
-
|
|
104299
|
-
|
|
104663
|
+
return {
|
|
104664
|
+
conflicts,
|
|
104665
|
+
subtitle: dryRun ? `${sumTypeCounts(typeCounts)} item(s) would change` : `${resultSummary.applied} applied, ${issuesCount} failed`,
|
|
104666
|
+
title: dryRun ? "Dry run complete" : "Migration complete",
|
|
104667
|
+
zones
|
|
104668
|
+
};
|
|
104669
|
+
}
|
|
104670
|
+
function collectProviders(plan, results) {
|
|
104671
|
+
const providersFromResults = results.map((result) => result.provider);
|
|
104672
|
+
const providersFromPlan = plan.actions.map((action) => action.provider);
|
|
104673
|
+
return Array.from(new Set([...providersFromResults, ...providersFromPlan]));
|
|
104674
|
+
}
|
|
104675
|
+
function collectResultTypeCounts(results) {
|
|
104676
|
+
const counts = new Map;
|
|
104677
|
+
for (const result of results) {
|
|
104678
|
+
if (!result.success || result.skipped || !result.portableType)
|
|
104679
|
+
continue;
|
|
104680
|
+
counts.set(result.portableType, (counts.get(result.portableType) ?? 0) + 1);
|
|
104300
104681
|
}
|
|
104301
|
-
|
|
104302
|
-
|
|
104682
|
+
return counts;
|
|
104683
|
+
}
|
|
104684
|
+
function collectPlannedTypeCounts(plan) {
|
|
104685
|
+
const counts = new Map;
|
|
104686
|
+
for (const action of plan.actions) {
|
|
104687
|
+
if (!shouldCountInFooter(action))
|
|
104688
|
+
continue;
|
|
104689
|
+
counts.set(action.type, (counts.get(action.type) ?? 0) + 1);
|
|
104303
104690
|
}
|
|
104304
|
-
|
|
104305
|
-
|
|
104691
|
+
return counts;
|
|
104692
|
+
}
|
|
104693
|
+
function collectResultWhereLines(results) {
|
|
104694
|
+
const destinations = Array.from(new Set(results.filter((result) => result.success && !result.skipped && result.path.length > 0 && result.operation !== "delete").map((result) => normalizeWhereDestination(result.path, result.portableType ?? "config")))).slice(0, 5);
|
|
104695
|
+
return destinations.map((destination) => `${formatDisplayPath(destination)} -> ${formatCdHint(resolveCdTarget(destination))}`);
|
|
104696
|
+
}
|
|
104697
|
+
function collectPlannedWhereLines(plan) {
|
|
104698
|
+
const destinations = Array.from(new Set(plan.actions.filter((action) => shouldCountInFooter(action) && action.targetPath.length > 0).map((action) => normalizeWhereDestination(action.targetPath, action.type)))).slice(0, 5);
|
|
104699
|
+
return destinations.map((destination) => `${formatDisplayPath(destination)} -> ${formatCdHint(resolveCdTarget(destination))}`);
|
|
104700
|
+
}
|
|
104701
|
+
function resolveCdTarget(destination) {
|
|
104702
|
+
return extname7(destination).length > 0 ? dirname38(destination) : destination;
|
|
104703
|
+
}
|
|
104704
|
+
function normalizeWhereDestination(path16, portableType) {
|
|
104705
|
+
if (portableType === "agent" || portableType === "command" || portableType === "skill") {
|
|
104706
|
+
return dirname38(path16);
|
|
104306
104707
|
}
|
|
104307
|
-
if (
|
|
104308
|
-
|
|
104708
|
+
if (portableType === "hooks") {
|
|
104709
|
+
return dirname38(path16);
|
|
104309
104710
|
}
|
|
104310
|
-
|
|
104311
|
-
|
|
104312
|
-
|
|
104313
|
-
|
|
104314
|
-
for (const c2 of conflicts) {
|
|
104315
|
-
const conflictKey = sanitizeSingleLineTerminalText(`${c2.provider}/${c2.type}/${c2.item}`);
|
|
104316
|
-
const resolution = sanitizeSingleLineTerminalText(c2.resolution?.type ?? "skipped");
|
|
104317
|
-
console.log(` ${conflictKey}: ${resolution}`);
|
|
104711
|
+
if (portableType === "rules") {
|
|
104712
|
+
const fileName = basename25(path16).toLowerCase();
|
|
104713
|
+
if (fileName === "agents.md" || fileName === "gemini.md" || fileName === ".goosehints" || fileName === "custom_modes.yaml" || fileName === "custom_modes.yml") {
|
|
104714
|
+
return path16;
|
|
104318
104715
|
}
|
|
104716
|
+
return dirname38(path16);
|
|
104319
104717
|
}
|
|
104320
|
-
|
|
104718
|
+
return path16;
|
|
104719
|
+
}
|
|
104720
|
+
function shouldCountInFooter(action) {
|
|
104721
|
+
if (action.action === "install" || action.action === "update" || action.action === "delete") {
|
|
104722
|
+
return true;
|
|
104723
|
+
}
|
|
104724
|
+
if (action.action !== "conflict")
|
|
104725
|
+
return false;
|
|
104726
|
+
const resolution = action.resolution?.type;
|
|
104727
|
+
return resolution === "overwrite" || resolution === "smart-merge" || resolution === "resolved";
|
|
104728
|
+
}
|
|
104729
|
+
function buildWhatLines(counts, trailingSummary) {
|
|
104730
|
+
const orderedCounts = [
|
|
104731
|
+
"agent",
|
|
104732
|
+
"skill",
|
|
104733
|
+
"command",
|
|
104734
|
+
"config",
|
|
104735
|
+
"rules",
|
|
104736
|
+
"hooks"
|
|
104737
|
+
];
|
|
104738
|
+
const labels = {
|
|
104739
|
+
agent: "agents",
|
|
104740
|
+
command: "commands",
|
|
104741
|
+
config: "config",
|
|
104742
|
+
hooks: "hooks",
|
|
104743
|
+
rules: "rules",
|
|
104744
|
+
skill: "skills"
|
|
104745
|
+
};
|
|
104746
|
+
const parts = orderedCounts.map((type) => counts.get(type) ? `${counts.get(type)} ${labels[type]}` : null).filter((part) => part !== null);
|
|
104747
|
+
if (parts.length === 0) {
|
|
104748
|
+
return [trailingSummary];
|
|
104749
|
+
}
|
|
104750
|
+
return [parts.join(" · "), trailingSummary];
|
|
104751
|
+
}
|
|
104752
|
+
function buildNextCommands(providersInRun, typeCounts) {
|
|
104753
|
+
const firstProvider = providersInRun[0];
|
|
104754
|
+
const commands = ["ck doctor"];
|
|
104755
|
+
if (!firstProvider)
|
|
104756
|
+
return commands;
|
|
104757
|
+
const preferredChecks = [
|
|
104758
|
+
{ flag: "skill", command: `ck skills --installed --agent ${firstProvider}` },
|
|
104759
|
+
{ flag: "agent", command: `ck agents --installed --agent ${firstProvider}` },
|
|
104760
|
+
{ flag: "command", command: `ck commands --installed --agent ${firstProvider}` }
|
|
104761
|
+
];
|
|
104762
|
+
for (const check of preferredChecks) {
|
|
104763
|
+
if ((typeCounts.get(check.flag) ?? 0) > 0 && commands.length < 3) {
|
|
104764
|
+
commands.push(check.command);
|
|
104765
|
+
}
|
|
104766
|
+
}
|
|
104767
|
+
return commands.slice(0, 3);
|
|
104768
|
+
}
|
|
104769
|
+
function mergeTypeCounts(primary, fallback2) {
|
|
104770
|
+
const merged = new Map(primary);
|
|
104771
|
+
for (const [portableType, count] of fallback2) {
|
|
104772
|
+
merged.set(portableType, (merged.get(portableType) ?? 0) + count);
|
|
104773
|
+
}
|
|
104774
|
+
return merged;
|
|
104775
|
+
}
|
|
104776
|
+
function mergeWhereLines(primary, fallback2) {
|
|
104777
|
+
return Array.from(new Set([...primary, ...fallback2]));
|
|
104778
|
+
}
|
|
104779
|
+
function buildApplySummary(resultSummary, deleteCount) {
|
|
104780
|
+
const appliedCount = Math.max(0, resultSummary.applied - deleteCount);
|
|
104781
|
+
const parts = [`${appliedCount} applied`];
|
|
104782
|
+
if (deleteCount > 0) {
|
|
104783
|
+
parts.push(`${deleteCount} deleted`);
|
|
104784
|
+
}
|
|
104785
|
+
parts.push(`${resultSummary.skipped} skipped`);
|
|
104786
|
+
return parts.join(", ");
|
|
104787
|
+
}
|
|
104788
|
+
function sumTypeCounts(counts) {
|
|
104789
|
+
let total = 0;
|
|
104790
|
+
for (const count of counts.values()) {
|
|
104791
|
+
total += count;
|
|
104792
|
+
}
|
|
104793
|
+
return total;
|
|
104321
104794
|
}
|
|
104322
104795
|
|
|
104323
104796
|
// src/commands/migrate/migrate-command.ts
|
|
@@ -104330,6 +104803,58 @@ init_reconcile_state_builders();
|
|
|
104330
104803
|
init_reconciler();
|
|
104331
104804
|
init_skills_discovery();
|
|
104332
104805
|
|
|
104806
|
+
// src/commands/migrate/migrate-progress.ts
|
|
104807
|
+
var import_picocolors29 = __toESM(require_picocolors(), 1);
|
|
104808
|
+
function createMigrateProgressSink(total, context = createCliDesignContext()) {
|
|
104809
|
+
if (!process.stdout.isTTY || process.env.CI || process.env.TERM === "dumb") {
|
|
104810
|
+
return createDotProgressSink();
|
|
104811
|
+
}
|
|
104812
|
+
return createTtyProgressSink(total, context);
|
|
104813
|
+
}
|
|
104814
|
+
function createDotProgressSink() {
|
|
104815
|
+
let current = 0;
|
|
104816
|
+
return {
|
|
104817
|
+
done(message) {
|
|
104818
|
+
if (current > 0)
|
|
104819
|
+
process.stdout.write(`
|
|
104820
|
+
`);
|
|
104821
|
+
if (message)
|
|
104822
|
+
console.log(message);
|
|
104823
|
+
},
|
|
104824
|
+
tick() {
|
|
104825
|
+
current += 1;
|
|
104826
|
+
process.stdout.write(".");
|
|
104827
|
+
}
|
|
104828
|
+
};
|
|
104829
|
+
}
|
|
104830
|
+
function createTtyProgressSink(total, context) {
|
|
104831
|
+
let current = 0;
|
|
104832
|
+
let rendered = false;
|
|
104833
|
+
return {
|
|
104834
|
+
done(message) {
|
|
104835
|
+
if (rendered) {
|
|
104836
|
+
process.stdout.write("\r\x1B[K");
|
|
104837
|
+
}
|
|
104838
|
+
if (message) {
|
|
104839
|
+
console.log(context.useColor ? import_picocolors29.default.green(message) : message);
|
|
104840
|
+
}
|
|
104841
|
+
},
|
|
104842
|
+
tick(label) {
|
|
104843
|
+
current += 1;
|
|
104844
|
+
const width = Math.max(10, Math.min(20, context.width - 34));
|
|
104845
|
+
const percent = total === 0 ? 100 : Math.round(current / total * 100);
|
|
104846
|
+
const filled = Math.round(percent / 100 * width);
|
|
104847
|
+
const empty = width - filled;
|
|
104848
|
+
const isUnicode = context.box.bullet !== "+";
|
|
104849
|
+
const bar = `${isUnicode ? "█".repeat(filled) : "=".repeat(filled)}${isUnicode ? "░".repeat(empty) : "-".repeat(empty)}`;
|
|
104850
|
+
const heading = context.useColor ? import_picocolors29.default.bold(label) : label;
|
|
104851
|
+
const line = ` ${heading} ${bar} ${String(percent).padStart(3, " ")}%`;
|
|
104852
|
+
process.stdout.write(`\r${line}`);
|
|
104853
|
+
rendered = true;
|
|
104854
|
+
}
|
|
104855
|
+
};
|
|
104856
|
+
}
|
|
104857
|
+
|
|
104333
104858
|
// src/commands/migrate/migrate-scope-resolver.ts
|
|
104334
104859
|
function resolveMigrationScope(argv, options2) {
|
|
104335
104860
|
const argSet = new Set(argv);
|
|
@@ -104361,6 +104886,107 @@ function resolveMigrationScope(argv, options2) {
|
|
|
104361
104886
|
};
|
|
104362
104887
|
}
|
|
104363
104888
|
|
|
104889
|
+
// src/commands/migrate/migrate-ui-summary.ts
|
|
104890
|
+
init_provider_registry();
|
|
104891
|
+
var PORTABLE_TYPES = [
|
|
104892
|
+
{ key: "agents", label: "Agents" },
|
|
104893
|
+
{ key: "commands", label: "Commands" },
|
|
104894
|
+
{ key: "skills", label: "Skills" },
|
|
104895
|
+
{ key: "config", label: "Config" },
|
|
104896
|
+
{ key: "rules", label: "Rules" },
|
|
104897
|
+
{ key: "hooks", label: "Hooks" }
|
|
104898
|
+
];
|
|
104899
|
+
var MERGE_STRATEGIES = new Set(["merge-single", "yaml-merge", "json-merge"]);
|
|
104900
|
+
function buildPreflightRows(counts, selectedProviders, options2) {
|
|
104901
|
+
return PORTABLE_TYPES.flatMap(({ key, label }) => {
|
|
104902
|
+
const count = counts[key];
|
|
104903
|
+
if (count <= 0)
|
|
104904
|
+
return [];
|
|
104905
|
+
const destinations = new Map;
|
|
104906
|
+
const notes = new Set;
|
|
104907
|
+
for (const provider of selectedProviders) {
|
|
104908
|
+
const config = providers[provider][key];
|
|
104909
|
+
if (!config) {
|
|
104910
|
+
notes.add(`${providers[provider].displayName}: unsupported`);
|
|
104911
|
+
continue;
|
|
104912
|
+
}
|
|
104913
|
+
const destination = getPortableBasePath(provider, key, { global: options2.actualGlobal });
|
|
104914
|
+
if (!destination) {
|
|
104915
|
+
const note2 = options2.actualGlobal ? "project-only" : "global-only";
|
|
104916
|
+
notes.add(`${providers[provider].displayName}: ${note2}`);
|
|
104917
|
+
continue;
|
|
104918
|
+
}
|
|
104919
|
+
const normalizedDestination = formatDisplayPath(destination);
|
|
104920
|
+
destinations.set(normalizedDestination, [
|
|
104921
|
+
...destinations.get(normalizedDestination) ?? [],
|
|
104922
|
+
provider
|
|
104923
|
+
]);
|
|
104924
|
+
if (!options2.requestedGlobal && config.projectPath === null && config.globalPath !== null) {
|
|
104925
|
+
notes.add(`${providers[provider].displayName}: global-only`);
|
|
104926
|
+
}
|
|
104927
|
+
if (options2.requestedGlobal && config.globalPath === null && config.projectPath !== null) {
|
|
104928
|
+
notes.add(`${providers[provider].displayName}: project-only`);
|
|
104929
|
+
}
|
|
104930
|
+
if (MERGE_STRATEGIES.has(config.writeStrategy)) {
|
|
104931
|
+
notes.add(`${providers[provider].displayName}: merge`);
|
|
104932
|
+
}
|
|
104933
|
+
}
|
|
104934
|
+
for (const [destination, providersAtPath] of destinations) {
|
|
104935
|
+
if (providersAtPath.length > 1) {
|
|
104936
|
+
notes.add(`${providersAtPath.map((provider) => providers[provider].displayName).join(", ")} share ${destination}`);
|
|
104937
|
+
}
|
|
104938
|
+
}
|
|
104939
|
+
return [
|
|
104940
|
+
{
|
|
104941
|
+
count,
|
|
104942
|
+
destinations: Array.from(destinations.keys()),
|
|
104943
|
+
label,
|
|
104944
|
+
notes: Array.from(notes)
|
|
104945
|
+
}
|
|
104946
|
+
];
|
|
104947
|
+
});
|
|
104948
|
+
}
|
|
104949
|
+
function buildTargetSummaryLines(rows) {
|
|
104950
|
+
const allDestinations = Array.from(new Set(rows.flatMap((row) => row.destinations).filter((destination) => destination.length > 0)));
|
|
104951
|
+
if (allDestinations.length === 0) {
|
|
104952
|
+
return ["No compatible destination found for the selected providers"];
|
|
104953
|
+
}
|
|
104954
|
+
if (allDestinations.length <= 3) {
|
|
104955
|
+
return allDestinations;
|
|
104956
|
+
}
|
|
104957
|
+
return [...allDestinations.slice(0, 3), `+${allDestinations.length - 3} more destination(s)`];
|
|
104958
|
+
}
|
|
104959
|
+
function buildProviderScopeSubtitle(selectedProviders, global3) {
|
|
104960
|
+
const scope = global3 ? "global" : "project";
|
|
104961
|
+
if (selectedProviders.length === 1) {
|
|
104962
|
+
return `${providers[selectedProviders[0]].displayName} -> ${scope}`;
|
|
104963
|
+
}
|
|
104964
|
+
if (selectedProviders.length <= 3) {
|
|
104965
|
+
return `${selectedProviders.map((provider) => providers[provider].displayName).join(", ")} -> ${scope}`;
|
|
104966
|
+
}
|
|
104967
|
+
return `${selectedProviders.length} providers -> ${scope}`;
|
|
104968
|
+
}
|
|
104969
|
+
function buildSourceSummaryLines(counts, origins) {
|
|
104970
|
+
const parts = [];
|
|
104971
|
+
if (counts.agents > 0)
|
|
104972
|
+
parts.push(`${counts.agents} agents`);
|
|
104973
|
+
if (counts.skills > 0)
|
|
104974
|
+
parts.push(`${counts.skills} skills`);
|
|
104975
|
+
if (counts.commands > 0)
|
|
104976
|
+
parts.push(`${counts.commands} commands`);
|
|
104977
|
+
if (counts.rules > 0)
|
|
104978
|
+
parts.push(`${counts.rules} rules`);
|
|
104979
|
+
if (counts.hooks > 0)
|
|
104980
|
+
parts.push(`${counts.hooks} hooks`);
|
|
104981
|
+
if (counts.config > 0)
|
|
104982
|
+
parts.push("config");
|
|
104983
|
+
const uniqueOrigins = Array.from(new Set(origins.map((origin) => formatDisplayPath(origin))));
|
|
104984
|
+
const summary = parts.length > 0 ? parts.join(" · ") : "portable items detected";
|
|
104985
|
+
if (uniqueOrigins.length === 0)
|
|
104986
|
+
return [summary];
|
|
104987
|
+
return [summary, `from ${uniqueOrigins.join(" · ")}`];
|
|
104988
|
+
}
|
|
104989
|
+
|
|
104364
104990
|
// src/commands/migrate/migrate-command.ts
|
|
104365
104991
|
init_skill_directory_installer();
|
|
104366
104992
|
function getProviderPathKey(type) {
|
|
@@ -104393,13 +105019,16 @@ function shouldExecuteAction2(action) {
|
|
|
104393
105019
|
}
|
|
104394
105020
|
async function executeDeleteAction(action, options2) {
|
|
104395
105021
|
const preservePaths = options2?.preservePaths ?? new Set;
|
|
104396
|
-
const shouldPreserveTarget = action.targetPath.length > 0 && preservePaths.has(
|
|
105022
|
+
const shouldPreserveTarget = action.targetPath.length > 0 && preservePaths.has(resolve36(action.targetPath));
|
|
104397
105023
|
try {
|
|
104398
105024
|
if (!shouldPreserveTarget && action.targetPath && existsSync62(action.targetPath)) {
|
|
104399
105025
|
await rm15(action.targetPath, { recursive: true, force: true });
|
|
104400
105026
|
}
|
|
104401
105027
|
await removePortableInstallation(action.item, action.type, action.provider, action.global);
|
|
104402
105028
|
return {
|
|
105029
|
+
operation: "delete",
|
|
105030
|
+
portableType: action.type,
|
|
105031
|
+
itemName: action.item,
|
|
104403
105032
|
provider: action.provider,
|
|
104404
105033
|
providerDisplayName: providers[action.provider]?.displayName || action.provider,
|
|
104405
105034
|
success: true,
|
|
@@ -104409,6 +105038,9 @@ async function executeDeleteAction(action, options2) {
|
|
|
104409
105038
|
};
|
|
104410
105039
|
} catch (error) {
|
|
104411
105040
|
return {
|
|
105041
|
+
operation: "delete",
|
|
105042
|
+
portableType: action.type,
|
|
105043
|
+
itemName: action.item,
|
|
104412
105044
|
provider: action.provider,
|
|
104413
105045
|
providerDisplayName: providers[action.provider]?.displayName || action.provider,
|
|
104414
105046
|
success: false,
|
|
@@ -104420,7 +105052,7 @@ async function executeDeleteAction(action, options2) {
|
|
|
104420
105052
|
async function processMetadataDeletions(skillSourcePath, installGlobally) {
|
|
104421
105053
|
if (!skillSourcePath)
|
|
104422
105054
|
return;
|
|
104423
|
-
const sourceMetadataPath = join139(
|
|
105055
|
+
const sourceMetadataPath = join139(resolve36(skillSourcePath, ".."), "metadata.json");
|
|
104424
105056
|
if (!existsSync62(sourceMetadataPath))
|
|
104425
105057
|
return;
|
|
104426
105058
|
let sourceMetadata;
|
|
@@ -104433,7 +105065,7 @@ async function processMetadataDeletions(skillSourcePath, installGlobally) {
|
|
|
104433
105065
|
}
|
|
104434
105066
|
if (!sourceMetadata.deletions || sourceMetadata.deletions.length === 0)
|
|
104435
105067
|
return;
|
|
104436
|
-
const claudeDir3 = installGlobally ? join139(
|
|
105068
|
+
const claudeDir3 = installGlobally ? join139(homedir46(), ".claude") : join139(process.cwd(), ".claude");
|
|
104437
105069
|
if (!existsSync62(claudeDir3))
|
|
104438
105070
|
return;
|
|
104439
105071
|
try {
|
|
@@ -104454,7 +105086,6 @@ function inferKitTypeFromSourceMetadata(sourceMetadata) {
|
|
|
104454
105086
|
}
|
|
104455
105087
|
async function migrateCommand(options2) {
|
|
104456
105088
|
console.log();
|
|
104457
|
-
oe(import_picocolors28.default.bgMagenta(import_picocolors28.default.black(" ck migrate ")));
|
|
104458
105089
|
try {
|
|
104459
105090
|
const scope = resolveMigrationScope(process.argv.slice(2), options2);
|
|
104460
105091
|
const spinner = de();
|
|
@@ -104477,37 +105108,10 @@ async function migrateCommand(options2) {
|
|
|
104477
105108
|
const hasItems = agents2.length > 0 || commands.length > 0 || skills.length > 0 || configItem !== null || ruleItems.length > 0 || hookItems.length > 0;
|
|
104478
105109
|
if (!hasItems) {
|
|
104479
105110
|
f2.error("Nothing to migrate.");
|
|
104480
|
-
f2.info(
|
|
104481
|
-
$e(
|
|
105111
|
+
f2.info(import_picocolors30.default.dim("Check .claude/agents/, .claude/commands/, .claude/skills/, .claude/rules/, .claude/hooks/, and CLAUDE.md (project or ~/.claude/)"));
|
|
105112
|
+
$e(import_picocolors30.default.red("Nothing to migrate"));
|
|
104482
105113
|
return;
|
|
104483
105114
|
}
|
|
104484
|
-
f2.info(import_picocolors28.default.dim(` CWD: ${process.cwd()}`));
|
|
104485
|
-
const parts = [];
|
|
104486
|
-
if (agents2.length > 0) {
|
|
104487
|
-
const origin = resolveSourceOrigin(agentSource);
|
|
104488
|
-
parts.push(`${agents2.length} agent(s) ${import_picocolors28.default.dim(`<- ${origin}`)}`);
|
|
104489
|
-
}
|
|
104490
|
-
if (commands.length > 0) {
|
|
104491
|
-
const origin = resolveSourceOrigin(commandSource);
|
|
104492
|
-
parts.push(`${commands.length} command(s) ${import_picocolors28.default.dim(`<- ${origin}`)}`);
|
|
104493
|
-
}
|
|
104494
|
-
if (skills.length > 0) {
|
|
104495
|
-
const origin = resolveSourceOrigin(skillSource);
|
|
104496
|
-
parts.push(`${skills.length} skill(s) ${import_picocolors28.default.dim(`<- ${origin}`)}`);
|
|
104497
|
-
}
|
|
104498
|
-
if (configItem) {
|
|
104499
|
-
const origin = resolveSourceOrigin(configItem.sourcePath);
|
|
104500
|
-
parts.push(`config ${import_picocolors28.default.dim(`<- ${origin}`)}`);
|
|
104501
|
-
}
|
|
104502
|
-
if (ruleItems.length > 0) {
|
|
104503
|
-
const origin = resolveSourceOrigin(rulesSourcePath);
|
|
104504
|
-
parts.push(`${ruleItems.length} rule(s) ${import_picocolors28.default.dim(`<- ${origin}`)}`);
|
|
104505
|
-
}
|
|
104506
|
-
if (hookItems.length > 0) {
|
|
104507
|
-
const origin = resolveSourceOrigin(hooksSource);
|
|
104508
|
-
parts.push(`${hookItems.length} hook(s) ${import_picocolors28.default.dim(`<- ${origin}`)}`);
|
|
104509
|
-
}
|
|
104510
|
-
f2.info(`Found: ${parts.join(", ")}`);
|
|
104511
105115
|
const detectedProviders = await detectInstalledProviders();
|
|
104512
105116
|
let selectedProviders;
|
|
104513
105117
|
const allSupportedProviders = Array.from(new Set([
|
|
@@ -104523,8 +105127,8 @@ async function migrateCommand(options2) {
|
|
|
104523
105127
|
const invalid = options2.agent.filter((a3) => !validProviders.includes(a3));
|
|
104524
105128
|
if (invalid.length > 0) {
|
|
104525
105129
|
f2.error(`Unknown provider(s): ${invalid.join(", ")}`);
|
|
104526
|
-
f2.info(
|
|
104527
|
-
$e(
|
|
105130
|
+
f2.info(import_picocolors30.default.dim(`Valid providers: ${validProviders.join(", ")}`));
|
|
105131
|
+
$e(import_picocolors30.default.red("Invalid provider"));
|
|
104528
105132
|
return;
|
|
104529
105133
|
}
|
|
104530
105134
|
selectedProviders = options2.agent;
|
|
@@ -104534,7 +105138,7 @@ async function migrateCommand(options2) {
|
|
|
104534
105138
|
} else if (options2.yes) {
|
|
104535
105139
|
if (detectedProviders.length > 0) {
|
|
104536
105140
|
selectedProviders = detectedProviders;
|
|
104537
|
-
f2.info(`Migrating to: ${detectedProviders.map((a3) =>
|
|
105141
|
+
f2.info(`Migrating to: ${detectedProviders.map((a3) => import_picocolors30.default.cyan(providers[a3].displayName)).join(", ")}`);
|
|
104538
105142
|
} else {
|
|
104539
105143
|
selectedProviders = allSupportedProviders;
|
|
104540
105144
|
f2.info("No providers detected, migrating to all");
|
|
@@ -104547,16 +105151,16 @@ async function migrateCommand(options2) {
|
|
|
104547
105151
|
label: providers[key].displayName
|
|
104548
105152
|
});
|
|
104549
105153
|
if (detectedProviders.length > 0) {
|
|
104550
|
-
f2.info(`Detected ${
|
|
105154
|
+
f2.info(`Detected ${import_picocolors30.default.cyan(String(detectedProviders.length))} installed provider(s)`);
|
|
104551
105155
|
} else {
|
|
104552
105156
|
f2.warn("No providers detected on your system.");
|
|
104553
105157
|
}
|
|
104554
105158
|
const groupOptions = {};
|
|
104555
105159
|
if (detectedProviders.length > 0) {
|
|
104556
|
-
groupOptions[`Detected ${
|
|
105160
|
+
groupOptions[`Detected ${import_picocolors30.default.dim("(installed)")}`] = detectedProviders.map(toOption);
|
|
104557
105161
|
}
|
|
104558
105162
|
if (notDetected.length > 0) {
|
|
104559
|
-
groupOptions[`Not detected ${
|
|
105163
|
+
groupOptions[`Not detected ${import_picocolors30.default.dim("(select manually if installed)")}`] = notDetected.map(toOption);
|
|
104560
105164
|
}
|
|
104561
105165
|
if (Object.keys(groupOptions).length === 0) {
|
|
104562
105166
|
ue("No providers available");
|
|
@@ -104575,22 +105179,23 @@ async function migrateCommand(options2) {
|
|
|
104575
105179
|
selectedProviders = selected;
|
|
104576
105180
|
}
|
|
104577
105181
|
selectedProviders = Array.from(new Set(selectedProviders));
|
|
104578
|
-
let
|
|
105182
|
+
let requestedGlobal = options2.global ?? false;
|
|
105183
|
+
let installGlobally = requestedGlobal;
|
|
104579
105184
|
if (options2.global === undefined && !options2.yes) {
|
|
104580
105185
|
const projectTarget = join139(process.cwd(), ".claude");
|
|
104581
|
-
const globalTarget = join139(
|
|
105186
|
+
const globalTarget = join139(homedir46(), ".claude");
|
|
104582
105187
|
const scopeChoice = await ie({
|
|
104583
105188
|
message: "Installation scope",
|
|
104584
105189
|
options: [
|
|
104585
|
-
{
|
|
104586
|
-
value: false,
|
|
104587
|
-
label: "Project",
|
|
104588
|
-
hint: `-> ${projectTarget}`
|
|
104589
|
-
},
|
|
104590
105190
|
{
|
|
104591
105191
|
value: true,
|
|
104592
105192
|
label: "Global",
|
|
104593
105193
|
hint: `-> ${globalTarget}`
|
|
105194
|
+
},
|
|
105195
|
+
{
|
|
105196
|
+
value: false,
|
|
105197
|
+
label: "Project",
|
|
105198
|
+
hint: `-> ${projectTarget}`
|
|
104594
105199
|
}
|
|
104595
105200
|
]
|
|
104596
105201
|
});
|
|
@@ -104598,49 +105203,76 @@ async function migrateCommand(options2) {
|
|
|
104598
105203
|
ue("Migrate cancelled");
|
|
104599
105204
|
return;
|
|
104600
105205
|
}
|
|
104601
|
-
|
|
105206
|
+
requestedGlobal = scopeChoice;
|
|
105207
|
+
installGlobally = requestedGlobal;
|
|
104602
105208
|
}
|
|
104603
105209
|
const codexCommandsRequireGlobal = scope.commands && selectedProviders.includes("codex") && providers.codex.commands !== null && providers.codex.commands.projectPath === null;
|
|
104604
105210
|
if (codexCommandsRequireGlobal && !installGlobally) {
|
|
104605
105211
|
installGlobally = true;
|
|
104606
|
-
f2.info(
|
|
104607
|
-
}
|
|
104608
|
-
|
|
104609
|
-
|
|
105212
|
+
f2.info(import_picocolors30.default.dim("Codex commands are global-only; scope adjusted to global."));
|
|
105213
|
+
}
|
|
105214
|
+
const sourceCounts = {
|
|
105215
|
+
agents: agents2.length,
|
|
105216
|
+
commands: commands.length,
|
|
105217
|
+
config: configItem ? 1 : 0,
|
|
105218
|
+
hooks: hookItems.length,
|
|
105219
|
+
rules: ruleItems.length,
|
|
105220
|
+
skills: skills.length
|
|
105221
|
+
};
|
|
105222
|
+
const sourceOrigins = [
|
|
105223
|
+
agentSource,
|
|
105224
|
+
commandSource,
|
|
105225
|
+
skillSource,
|
|
105226
|
+
configItem?.sourcePath ?? null,
|
|
105227
|
+
rulesSourcePath,
|
|
105228
|
+
hooksSource
|
|
105229
|
+
].filter((origin) => origin !== null);
|
|
105230
|
+
const preflightRows = buildPreflightRows(sourceCounts, selectedProviders, {
|
|
105231
|
+
actualGlobal: installGlobally,
|
|
105232
|
+
requestedGlobal
|
|
105233
|
+
});
|
|
105234
|
+
const discoveryParts = [];
|
|
105235
|
+
const agentSourceDisplay = agentSource ? formatDisplayPath(agentSource) : "source unavailable";
|
|
105236
|
+
const commandSourceDisplay = commandSource ? formatDisplayPath(commandSource) : "source unavailable";
|
|
105237
|
+
const skillSourceDisplay = skillSource ? formatDisplayPath(skillSource) : "source unavailable";
|
|
105238
|
+
const rulesSourceDisplay = rulesSourcePath ? formatDisplayPath(rulesSourcePath) : "source unavailable";
|
|
105239
|
+
const hooksSourceDisplay = hooksSource ? formatDisplayPath(hooksSource) : "source unavailable";
|
|
104610
105240
|
if (agents2.length > 0) {
|
|
104611
|
-
|
|
105241
|
+
discoveryParts.push(`${agents2.length} agent(s) ${import_picocolors30.default.dim(`<- ${agentSourceDisplay}`)}`);
|
|
104612
105242
|
}
|
|
104613
105243
|
if (commands.length > 0) {
|
|
104614
|
-
|
|
104615
|
-
f2.message(` Commands: ${cmdNames}`);
|
|
105244
|
+
discoveryParts.push(`${commands.length} command(s) ${import_picocolors30.default.dim(`<- ${commandSourceDisplay}`)}`);
|
|
104616
105245
|
}
|
|
104617
105246
|
if (skills.length > 0) {
|
|
104618
|
-
|
|
105247
|
+
discoveryParts.push(`${skills.length} skill(s) ${import_picocolors30.default.dim(`<- ${skillSourceDisplay}`)}`);
|
|
104619
105248
|
}
|
|
104620
105249
|
if (configItem) {
|
|
104621
|
-
|
|
104622
|
-
`).length;
|
|
104623
|
-
f2.message(` Config: ${import_picocolors28.default.cyan("CLAUDE.md")} (${lines} lines)`);
|
|
105250
|
+
discoveryParts.push(`config ${import_picocolors30.default.dim(`<- ${formatDisplayPath(configItem.sourcePath)}`)}`);
|
|
104624
105251
|
}
|
|
104625
105252
|
if (ruleItems.length > 0) {
|
|
104626
|
-
|
|
105253
|
+
discoveryParts.push(`${ruleItems.length} rule(s) ${import_picocolors30.default.dim(`<- ${rulesSourceDisplay}`)}`);
|
|
104627
105254
|
}
|
|
104628
105255
|
if (hookItems.length > 0) {
|
|
104629
|
-
|
|
105256
|
+
discoveryParts.push(`${hookItems.length} hook(s) ${import_picocolors30.default.dim(`<- ${hooksSourceDisplay}`)}`);
|
|
104630
105257
|
}
|
|
104631
|
-
|
|
105258
|
+
console.log();
|
|
105259
|
+
console.log(renderSourceTargetHeader({
|
|
105260
|
+
sourceLines: buildSourceSummaryLines(sourceCounts, sourceOrigins),
|
|
105261
|
+
subtitle: buildProviderScopeSubtitle(selectedProviders, installGlobally),
|
|
105262
|
+
targetLines: buildTargetSummaryLines(preflightRows),
|
|
105263
|
+
title: "ck migrate"
|
|
105264
|
+
}).join(`
|
|
105265
|
+
`));
|
|
105266
|
+
f2.info(import_picocolors30.default.dim(` CWD: ${process.cwd()}`));
|
|
105267
|
+
f2.info(`Found: ${discoveryParts.join(", ")}`);
|
|
105268
|
+
console.log();
|
|
105269
|
+
f2.step(import_picocolors30.default.bold("Migrate Summary"));
|
|
105270
|
+
const providerNames = selectedProviders.map((prov) => import_picocolors30.default.cyan(providers[prov].displayName)).join(", ");
|
|
104632
105271
|
f2.message(` Providers: ${providerNames}`);
|
|
104633
|
-
|
|
104634
|
-
|
|
104635
|
-
|
|
104636
|
-
|
|
104637
|
-
if (commands.length > 0 && unsupportedCmd.length > 0) {
|
|
104638
|
-
f2.info(import_picocolors28.default.dim(` [i] Commands skipped for: ${unsupportedCmd.map((pv) => providers[pv].displayName).join(", ")} (unsupported)`));
|
|
104639
|
-
}
|
|
104640
|
-
const hookProviders = getProvidersSupporting("hooks");
|
|
104641
|
-
const unsupportedHooks = selectedProviders.filter((pv) => !hookProviders.includes(pv));
|
|
104642
|
-
if (hookItems.length > 0 && unsupportedHooks.length > 0) {
|
|
104643
|
-
f2.info(import_picocolors28.default.dim(` [i] Hooks skipped for: ${unsupportedHooks.map((pv) => providers[pv].displayName).join(", ")} (unsupported)`));
|
|
105272
|
+
for (const row of preflightRows) {
|
|
105273
|
+
for (const line of renderPreflightRow(row)) {
|
|
105274
|
+
console.log(line);
|
|
105275
|
+
}
|
|
104644
105276
|
}
|
|
104645
105277
|
const { CkConfigManager: CkConfigManager2 } = await Promise.resolve().then(() => (init_ck_config_manager(), exports_ck_config_manager));
|
|
104646
105278
|
const ckConfigResult = await CkConfigManager2.loadFull(process.cwd());
|
|
@@ -104671,8 +105303,7 @@ async function migrateCommand(options2) {
|
|
|
104671
105303
|
const useColor = process.stdout.isTTY && !process.env.NO_COLOR;
|
|
104672
105304
|
displayReconcilePlan(plan, { color: useColor });
|
|
104673
105305
|
if (options2.dryRun) {
|
|
104674
|
-
|
|
104675
|
-
$e(import_picocolors28.default.green("Dry run complete — no files written"));
|
|
105306
|
+
displayMigrationSummary(plan, buildDryRunFallbackResults(skills, selectedProviders, installGlobally, plan.actions), { color: useColor, dryRun: true });
|
|
104676
105307
|
return;
|
|
104677
105308
|
}
|
|
104678
105309
|
if (plan.hasConflicts) {
|
|
@@ -104718,9 +105349,7 @@ async function migrateCommand(options2) {
|
|
|
104718
105349
|
return;
|
|
104719
105350
|
}
|
|
104720
105351
|
}
|
|
104721
|
-
|
|
104722
|
-
installSpinner.start("Migrating...");
|
|
104723
|
-
const allResults = [];
|
|
105352
|
+
let allResults = [];
|
|
104724
105353
|
const installOpts = { global: installGlobally };
|
|
104725
105354
|
const agentByName = new Map(agents2.map((item) => [item.name, item]));
|
|
104726
105355
|
const commandByName = new Map(commands.map((item) => [item.name, item]));
|
|
@@ -104729,6 +105358,8 @@ async function migrateCommand(options2) {
|
|
|
104729
105358
|
const ruleByName = new Map(ruleItems.map((item) => [item.name, item]));
|
|
104730
105359
|
const hookByName = new Map(hookItems.map((item) => [item.name, item]));
|
|
104731
105360
|
const successfulHookFiles = new Map;
|
|
105361
|
+
const postProgressWarnings = [];
|
|
105362
|
+
const writeTasks = [];
|
|
104732
105363
|
for (const action of plannedExecActions) {
|
|
104733
105364
|
const provider = action.provider;
|
|
104734
105365
|
if (!selectedProviders.includes(provider))
|
|
@@ -104737,50 +105368,70 @@ async function migrateCommand(options2) {
|
|
|
104737
105368
|
const item = agentByName.get(action.item);
|
|
104738
105369
|
if (!item || !getProvidersSupporting("agents").includes(provider))
|
|
104739
105370
|
continue;
|
|
104740
|
-
|
|
105371
|
+
writeTasks.push({ item, provider, type: "agent" });
|
|
104741
105372
|
continue;
|
|
104742
105373
|
}
|
|
104743
105374
|
if (action.type === "command") {
|
|
104744
105375
|
const item = commandByName.get(action.item);
|
|
104745
105376
|
if (!item || !getProvidersSupporting("commands").includes(provider))
|
|
104746
105377
|
continue;
|
|
104747
|
-
|
|
105378
|
+
writeTasks.push({ item, provider, type: "command" });
|
|
104748
105379
|
continue;
|
|
104749
105380
|
}
|
|
104750
105381
|
if (action.type === "skill") {
|
|
104751
105382
|
const item = skillByName.get(action.item);
|
|
104752
105383
|
if (!item || !getProvidersSupporting("skills").includes(provider))
|
|
104753
105384
|
continue;
|
|
104754
|
-
|
|
105385
|
+
writeTasks.push({ item, provider, type: "skill" });
|
|
104755
105386
|
continue;
|
|
104756
105387
|
}
|
|
104757
105388
|
if (action.type === "config") {
|
|
104758
105389
|
const item = configByName.get(action.item);
|
|
104759
105390
|
if (!item || !getProvidersSupporting("config").includes(provider))
|
|
104760
105391
|
continue;
|
|
104761
|
-
|
|
105392
|
+
writeTasks.push({ item, provider, type: "config" });
|
|
104762
105393
|
continue;
|
|
104763
105394
|
}
|
|
104764
105395
|
if (action.type === "rules") {
|
|
104765
105396
|
const item = ruleByName.get(action.item);
|
|
104766
105397
|
if (!item || !getProvidersSupporting("rules").includes(provider))
|
|
104767
105398
|
continue;
|
|
104768
|
-
|
|
105399
|
+
writeTasks.push({ item, provider, type: "rules" });
|
|
104769
105400
|
continue;
|
|
104770
105401
|
}
|
|
104771
105402
|
if (action.type === "hooks") {
|
|
104772
105403
|
const item = hookByName.get(action.item);
|
|
104773
105404
|
if (!item || !getProvidersSupporting("hooks").includes(provider))
|
|
104774
105405
|
continue;
|
|
104775
|
-
|
|
104776
|
-
|
|
104777
|
-
|
|
104778
|
-
|
|
104779
|
-
|
|
104780
|
-
|
|
105406
|
+
writeTasks.push({ item, provider, type: "hooks" });
|
|
105407
|
+
}
|
|
105408
|
+
}
|
|
105409
|
+
const plannedSkillActions = plannedExecActions.filter((action) => action.type === "skill").length;
|
|
105410
|
+
if (skills.length > 0 && plannedSkillActions === 0) {
|
|
105411
|
+
const skillProviders = selectedProviders.filter((pv) => getProvidersSupporting("skills").includes(pv));
|
|
105412
|
+
for (const provider of skillProviders) {
|
|
105413
|
+
for (const skill of skills) {
|
|
105414
|
+
writeTasks.push({ item: skill, provider, type: "skill" });
|
|
104781
105415
|
}
|
|
104782
105416
|
}
|
|
104783
105417
|
}
|
|
105418
|
+
const progressSink = createMigrateProgressSink(writeTasks.length + plannedDeleteActions.length);
|
|
105419
|
+
const writtenPaths = new Set;
|
|
105420
|
+
for (const task of writeTasks) {
|
|
105421
|
+
const taskResults = task.type === "skill" ? annotateInstallResults(await installSkillDirectories([task.item], [task.provider], installOpts), "skill", task.item.name) : annotateInstallResults(await installPortableItems([task.item], [task.provider], task.type, installOpts), task.type, task.item.name);
|
|
105422
|
+
allResults.push(...taskResults);
|
|
105423
|
+
for (const result of taskResults.filter((entry) => entry.success && !entry.skipped)) {
|
|
105424
|
+
if (result.path.length > 0) {
|
|
105425
|
+
writtenPaths.add(resolve36(result.path));
|
|
105426
|
+
}
|
|
105427
|
+
if (task.type === "hooks") {
|
|
105428
|
+
const existing = successfulHookFiles.get(task.provider) ?? [];
|
|
105429
|
+
existing.push(basename26(result.path));
|
|
105430
|
+
successfulHookFiles.set(task.provider, existing);
|
|
105431
|
+
}
|
|
105432
|
+
}
|
|
105433
|
+
progressSink.tick(progressLabelForType(task.type));
|
|
105434
|
+
}
|
|
104784
105435
|
for (const [hooksProvider, files] of successfulHookFiles) {
|
|
104785
105436
|
if (files.length === 0)
|
|
104786
105437
|
continue;
|
|
@@ -104795,23 +105446,20 @@ async function migrateCommand(options2) {
|
|
|
104795
105446
|
} else {
|
|
104796
105447
|
const feedbackMessage = mergeResult.error ?? mergeResult.message;
|
|
104797
105448
|
if (feedbackMessage) {
|
|
104798
|
-
|
|
105449
|
+
postProgressWarnings.push(feedbackMessage);
|
|
104799
105450
|
}
|
|
104800
105451
|
}
|
|
104801
105452
|
}
|
|
104802
|
-
const plannedSkillActions = plannedExecActions.filter((action) => action.type === "skill").length;
|
|
104803
|
-
if (skills.length > 0 && plannedSkillActions === 0) {
|
|
104804
|
-
const skillProviders = selectedProviders.filter((pv) => getProvidersSupporting("skills").includes(pv));
|
|
104805
|
-
if (skillProviders.length > 0) {
|
|
104806
|
-
allResults.push(...await installSkillDirectories(skills, skillProviders, installOpts));
|
|
104807
|
-
}
|
|
104808
|
-
}
|
|
104809
105453
|
await processMetadataDeletions(skillSource, installGlobally);
|
|
104810
|
-
const writtenPaths = new Set(allResults.filter((result) => result.success && !result.skipped && result.path.length > 0).map((result) => resolve35(result.path)));
|
|
104811
105454
|
for (const deleteAction of plannedDeleteActions) {
|
|
104812
105455
|
allResults.push(await executeDeleteAction(deleteAction, {
|
|
104813
105456
|
preservePaths: writtenPaths
|
|
104814
105457
|
}));
|
|
105458
|
+
progressSink.tick("Cleanup");
|
|
105459
|
+
}
|
|
105460
|
+
progressSink.done();
|
|
105461
|
+
for (const warning of postProgressWarnings) {
|
|
105462
|
+
f2.warn(warning);
|
|
104815
105463
|
}
|
|
104816
105464
|
try {
|
|
104817
105465
|
await backfillRegistryChecksums(plan.actions, registry);
|
|
@@ -104828,14 +105476,14 @@ async function migrateCommand(options2) {
|
|
|
104828
105476
|
});
|
|
104829
105477
|
if (staleSlugs.length > 0) {
|
|
104830
105478
|
const staleSlugSet = new Set(staleSlugs.map((s) => `${s}.toml`));
|
|
104831
|
-
const removed = await removeInstallationsByFilter((i) => i.type === "agent" && i.provider === provider && i.global === installGlobally && staleSlugSet.has(
|
|
105479
|
+
const removed = await removeInstallationsByFilter((i) => i.type === "agent" && i.provider === provider && i.global === installGlobally && staleSlugSet.has(basename26(i.path)));
|
|
104832
105480
|
for (const entry of removed) {
|
|
104833
105481
|
logger.verbose(`[migrate] Cleaned stale registry entry: ${entry.item} (${provider})`);
|
|
104834
105482
|
}
|
|
104835
105483
|
}
|
|
104836
105484
|
}
|
|
104837
105485
|
try {
|
|
104838
|
-
const kitRoot = (agentSource ?
|
|
105486
|
+
const kitRoot = (agentSource ? resolve36(agentSource, "..") : null) ?? (commandSource ? resolve36(commandSource, "..") : null) ?? (skillSource ? resolve36(skillSource, "..") : null) ?? null;
|
|
104839
105487
|
const manifest = kitRoot ? await loadPortableManifest(kitRoot) : null;
|
|
104840
105488
|
if (manifest?.cliVersion) {
|
|
104841
105489
|
await updateAppliedManifestVersion(manifest.cliVersion);
|
|
@@ -104844,8 +105492,6 @@ async function migrateCommand(options2) {
|
|
|
104844
105492
|
} catch {
|
|
104845
105493
|
logger.debug("[migrate] Failed to update appliedManifestVersion — will retry on next run");
|
|
104846
105494
|
}
|
|
104847
|
-
installSpinner.stop("Migrate complete");
|
|
104848
|
-
displayMigrationSummary(plan, allResults, { color: useColor });
|
|
104849
105495
|
const failed = allResults.filter((r2) => !r2.success);
|
|
104850
105496
|
const successful = allResults.filter((r2) => r2.success && !r2.skipped);
|
|
104851
105497
|
const hasEmbeddedPartialFailures = allResults.some((result) => (result.warnings || []).some((warning) => warning.startsWith("Failed item:")));
|
|
@@ -104862,27 +105508,28 @@ async function migrateCommand(options2) {
|
|
|
104862
105508
|
initialValue: false
|
|
104863
105509
|
});
|
|
104864
105510
|
if (!lD(shouldRollback) && shouldRollback) {
|
|
104865
|
-
await rollbackResults(successful);
|
|
105511
|
+
const rolledBackPaths = await rollbackResults(successful);
|
|
105512
|
+
allResults = allResults.map((result) => result.path.length > 0 && rolledBackPaths.has(result.path) ? { ...result, skipped: true, skipReason: "Rolled back after failure" } : result);
|
|
104866
105513
|
f2.info(`Rolled back ${newWrites.length} file(s)`);
|
|
104867
105514
|
}
|
|
104868
105515
|
}
|
|
104869
105516
|
}
|
|
105517
|
+
displayMigrationSummary(plan, allResults, { color: useColor });
|
|
104870
105518
|
if (failed.length > 0) {
|
|
104871
105519
|
console.log();
|
|
104872
105520
|
displayResults3(allResults);
|
|
104873
|
-
} else {
|
|
104874
|
-
$e(import_picocolors28.default.green("Migration complete!"));
|
|
104875
105521
|
}
|
|
104876
105522
|
if (failed.length > 0 || hasEmbeddedPartialFailures) {
|
|
104877
105523
|
process.exitCode = 1;
|
|
104878
105524
|
}
|
|
104879
105525
|
} catch (error) {
|
|
104880
105526
|
logger.error(error instanceof Error ? error.message : "Unknown error");
|
|
104881
|
-
$e(
|
|
105527
|
+
$e(import_picocolors30.default.red("Migrate failed"));
|
|
104882
105528
|
process.exit(1);
|
|
104883
105529
|
}
|
|
104884
105530
|
}
|
|
104885
105531
|
async function rollbackResults(results) {
|
|
105532
|
+
const rolledBackPaths = new Set;
|
|
104886
105533
|
for (const result of results) {
|
|
104887
105534
|
if (!result.path || !existsSync62(result.path))
|
|
104888
105535
|
continue;
|
|
@@ -104895,28 +105542,30 @@ async function rollbackResults(results) {
|
|
|
104895
105542
|
} else {
|
|
104896
105543
|
await unlink12(result.path);
|
|
104897
105544
|
}
|
|
105545
|
+
rolledBackPaths.add(result.path);
|
|
104898
105546
|
} catch {}
|
|
104899
105547
|
}
|
|
105548
|
+
return rolledBackPaths;
|
|
104900
105549
|
}
|
|
104901
105550
|
function warnConversionFallback2(warning) {
|
|
104902
105551
|
logger.warning(logger.sanitize(`[migrate] Falling back to raw checksum for ${warning.provider} ${warning.type} "${warning.item}" because ${warning.format} conversion failed: ${warning.error}`));
|
|
104903
105552
|
}
|
|
104904
105553
|
async function computeSourceStates(items, selectedProviders) {
|
|
104905
105554
|
const states = [];
|
|
104906
|
-
const processItems =
|
|
105555
|
+
const processItems = (itemList, type) => {
|
|
104907
105556
|
for (const item of itemList) {
|
|
104908
105557
|
states.push(buildSourceItemState(item, type, selectedProviders, {
|
|
104909
105558
|
onConversionFallback: warnConversionFallback2
|
|
104910
105559
|
}));
|
|
104911
105560
|
}
|
|
104912
105561
|
};
|
|
104913
|
-
|
|
104914
|
-
|
|
105562
|
+
processItems(items.agents, "agent");
|
|
105563
|
+
processItems(items.commands, "command");
|
|
104915
105564
|
if (items.config) {
|
|
104916
|
-
|
|
105565
|
+
processItems([items.config], "config");
|
|
104917
105566
|
}
|
|
104918
|
-
|
|
104919
|
-
|
|
105567
|
+
processItems(items.rules, "rules");
|
|
105568
|
+
processItems(items.hooks, "hooks");
|
|
104920
105569
|
return states;
|
|
104921
105570
|
}
|
|
104922
105571
|
async function computeTargetStates(selectedProviders, global3) {
|
|
@@ -104941,22 +105590,22 @@ function displayResults3(results) {
|
|
|
104941
105590
|
const failed = results.filter((r2) => !r2.success);
|
|
104942
105591
|
if (successful.length > 0) {
|
|
104943
105592
|
for (const r2 of successful) {
|
|
104944
|
-
f2.success(`${
|
|
105593
|
+
f2.success(`${import_picocolors30.default.green("[OK]")} ${r2.providerDisplayName}`);
|
|
104945
105594
|
if (r2.warnings) {
|
|
104946
105595
|
for (const w3 of r2.warnings) {
|
|
104947
|
-
f2.warn(` ${
|
|
105596
|
+
f2.warn(` ${import_picocolors30.default.yellow("[!]")} ${w3}`);
|
|
104948
105597
|
}
|
|
104949
105598
|
}
|
|
104950
105599
|
}
|
|
104951
105600
|
}
|
|
104952
105601
|
if (skipped.length > 0) {
|
|
104953
105602
|
for (const r2 of skipped) {
|
|
104954
|
-
f2.info(`${
|
|
105603
|
+
f2.info(`${import_picocolors30.default.yellow("[i]")} ${r2.providerDisplayName}: ${import_picocolors30.default.dim(r2.skipReason || "Skipped")}`);
|
|
104955
105604
|
}
|
|
104956
105605
|
}
|
|
104957
105606
|
if (failed.length > 0) {
|
|
104958
105607
|
for (const r2 of failed) {
|
|
104959
|
-
f2.error(`${
|
|
105608
|
+
f2.error(`${import_picocolors30.default.red("[X]")} ${r2.providerDisplayName}: ${import_picocolors30.default.dim(r2.error || "Failed")}`);
|
|
104960
105609
|
}
|
|
104961
105610
|
}
|
|
104962
105611
|
console.log();
|
|
@@ -104967,24 +105616,69 @@ function displayResults3(results) {
|
|
|
104967
105616
|
summaryParts.push(`${skipped.length} skipped`);
|
|
104968
105617
|
if (failed.length > 0)
|
|
104969
105618
|
summaryParts.push(`${failed.length} failed`);
|
|
104970
|
-
if (summaryParts.length === 0) {
|
|
104971
|
-
$e(import_picocolors28.default.yellow("No installations performed"));
|
|
104972
|
-
} else if (failed.length > 0 && successful.length === 0) {
|
|
104973
|
-
$e(import_picocolors28.default.red("Migrate failed"));
|
|
105619
|
+
if (summaryParts.length === 0) {} else if (failed.length > 0 && successful.length === 0) {
|
|
104974
105620
|
process.exit(1);
|
|
104975
|
-
} else {
|
|
104976
|
-
$e(import_picocolors28.default.green(`Done! ${summaryParts.join(", ")}`));
|
|
104977
105621
|
}
|
|
104978
105622
|
}
|
|
105623
|
+
function annotateInstallResults(results, portableType, itemName) {
|
|
105624
|
+
return results.map((result) => ({
|
|
105625
|
+
...result,
|
|
105626
|
+
itemName,
|
|
105627
|
+
operation: "apply",
|
|
105628
|
+
portableType
|
|
105629
|
+
}));
|
|
105630
|
+
}
|
|
105631
|
+
function progressLabelForType(type) {
|
|
105632
|
+
switch (type) {
|
|
105633
|
+
case "agent":
|
|
105634
|
+
return "Agents";
|
|
105635
|
+
case "command":
|
|
105636
|
+
return "Commands";
|
|
105637
|
+
case "config":
|
|
105638
|
+
return "Config";
|
|
105639
|
+
case "rules":
|
|
105640
|
+
return "Rules";
|
|
105641
|
+
case "hooks":
|
|
105642
|
+
return "Hooks";
|
|
105643
|
+
case "skill":
|
|
105644
|
+
return "Skills";
|
|
105645
|
+
default:
|
|
105646
|
+
return "Migrating";
|
|
105647
|
+
}
|
|
105648
|
+
}
|
|
105649
|
+
function buildDryRunFallbackResults(skills, selectedProviders, installGlobally, plannedActions) {
|
|
105650
|
+
const plannedSkillActions = plannedActions.filter((action) => action.type === "skill").length;
|
|
105651
|
+
if (skills.length === 0 || plannedSkillActions > 0) {
|
|
105652
|
+
return [];
|
|
105653
|
+
}
|
|
105654
|
+
const results = [];
|
|
105655
|
+
for (const provider of selectedProviders.filter((entry) => getProvidersSupporting("skills").includes(entry))) {
|
|
105656
|
+
const basePath = getPortableBasePath(provider, "skills", { global: installGlobally });
|
|
105657
|
+
if (!basePath)
|
|
105658
|
+
continue;
|
|
105659
|
+
for (const skill of skills) {
|
|
105660
|
+
results.push({
|
|
105661
|
+
itemName: skill.name,
|
|
105662
|
+
operation: "apply",
|
|
105663
|
+
path: join139(basePath, skill.name),
|
|
105664
|
+
portableType: "skill",
|
|
105665
|
+
provider,
|
|
105666
|
+
providerDisplayName: providers[provider].displayName,
|
|
105667
|
+
success: true
|
|
105668
|
+
});
|
|
105669
|
+
}
|
|
105670
|
+
}
|
|
105671
|
+
return results;
|
|
105672
|
+
}
|
|
104979
105673
|
// src/commands/new/new-command.ts
|
|
104980
105674
|
init_logger();
|
|
104981
105675
|
init_safe_prompts();
|
|
104982
105676
|
init_types3();
|
|
104983
|
-
var
|
|
105677
|
+
var import_picocolors31 = __toESM(require_picocolors(), 1);
|
|
104984
105678
|
|
|
104985
105679
|
// src/commands/new/phases/directory-setup.ts
|
|
104986
105680
|
init_config_manager();
|
|
104987
|
-
import { resolve as
|
|
105681
|
+
import { resolve as resolve37 } from "node:path";
|
|
104988
105682
|
init_logger();
|
|
104989
105683
|
init_path_resolver();
|
|
104990
105684
|
init_types3();
|
|
@@ -105069,7 +105763,7 @@ async function directorySetup(validOptions, prompts) {
|
|
|
105069
105763
|
targetDir = await prompts.getDirectory(targetDir);
|
|
105070
105764
|
}
|
|
105071
105765
|
}
|
|
105072
|
-
const resolvedDir =
|
|
105766
|
+
const resolvedDir = resolve37(targetDir);
|
|
105073
105767
|
logger.info(`Target directory: ${resolvedDir}`);
|
|
105074
105768
|
if (PathResolver.isLocalSameAsGlobal(resolvedDir)) {
|
|
105075
105769
|
logger.warning("You're creating a project at HOME directory.");
|
|
@@ -105394,7 +106088,7 @@ Please use only one download method.`);
|
|
|
105394
106088
|
if (ctx.cancelled)
|
|
105395
106089
|
return;
|
|
105396
106090
|
prompts.outro(`✨ Project created successfully at ${ctx.resolvedDir}`);
|
|
105397
|
-
log.info(`${
|
|
106091
|
+
log.info(`${import_picocolors31.default.dim("Tip:")} To update later: ${import_picocolors31.default.cyan("ck update")} (CLI) + ${import_picocolors31.default.cyan("ck init")} (kit content)`);
|
|
105398
106092
|
} catch (error) {
|
|
105399
106093
|
logger.error(error instanceof Error ? error.message : "Unknown error occurred");
|
|
105400
106094
|
process.exit(1);
|
|
@@ -105403,7 +106097,7 @@ Please use only one download method.`);
|
|
|
105403
106097
|
// src/commands/plan/plan-command.ts
|
|
105404
106098
|
init_output_manager();
|
|
105405
106099
|
import { existsSync as existsSync65, statSync as statSync11 } from "node:fs";
|
|
105406
|
-
import { dirname as
|
|
106100
|
+
import { dirname as dirname42, isAbsolute as isAbsolute11, join as join144, parse as parse7, resolve as resolve41 } from "node:path";
|
|
105407
106101
|
|
|
105408
106102
|
// src/commands/plan/plan-read-handlers.ts
|
|
105409
106103
|
init_config();
|
|
@@ -105411,20 +106105,20 @@ init_plan_parser();
|
|
|
105411
106105
|
init_plans_registry();
|
|
105412
106106
|
init_logger();
|
|
105413
106107
|
init_output_manager();
|
|
105414
|
-
var
|
|
106108
|
+
var import_picocolors32 = __toESM(require_picocolors(), 1);
|
|
105415
106109
|
import { existsSync as existsSync64, statSync as statSync10 } from "node:fs";
|
|
105416
|
-
import { basename as
|
|
106110
|
+
import { basename as basename27, dirname as dirname40, join as join143, relative as relative27, resolve as resolve39 } from "node:path";
|
|
105417
106111
|
|
|
105418
106112
|
// src/commands/plan/plan-dependencies.ts
|
|
105419
106113
|
init_config();
|
|
105420
106114
|
init_plan_parser();
|
|
105421
106115
|
init_plans_registry();
|
|
105422
106116
|
import { existsSync as existsSync63 } from "node:fs";
|
|
105423
|
-
import { dirname as
|
|
106117
|
+
import { dirname as dirname39, join as join142 } from "node:path";
|
|
105424
106118
|
async function resolvePlanDependencies(references, currentPlanFile, options2 = {}) {
|
|
105425
106119
|
if (references.length === 0)
|
|
105426
106120
|
return [];
|
|
105427
|
-
const currentPlanDir =
|
|
106121
|
+
const currentPlanDir = dirname39(currentPlanFile);
|
|
105428
106122
|
const projectRoot = findProjectRoot(currentPlanDir);
|
|
105429
106123
|
const config = options2.preloadedConfig ?? (await CkConfigManager.loadFull(projectRoot)).config;
|
|
105430
106124
|
const defaultScope = inferPlanScopeForDir(currentPlanDir, config);
|
|
@@ -105471,14 +106165,14 @@ init_config();
|
|
|
105471
106165
|
init_plan_parser();
|
|
105472
106166
|
init_plan_scope();
|
|
105473
106167
|
init_plans_registry();
|
|
105474
|
-
import { isAbsolute as isAbsolute10, resolve as
|
|
106168
|
+
import { isAbsolute as isAbsolute10, resolve as resolve38 } from "node:path";
|
|
105475
106169
|
async function getGlobalPlansDirFromCwd() {
|
|
105476
106170
|
const projectRoot = findProjectRoot(process.cwd());
|
|
105477
106171
|
const { config } = await CkConfigManager.loadFull(projectRoot);
|
|
105478
106172
|
return resolveGlobalPlansDir(config);
|
|
105479
106173
|
}
|
|
105480
106174
|
function resolveTargetFromBase(target, baseDir) {
|
|
105481
|
-
const resolvedTarget = isAbsolute10(target) ?
|
|
106175
|
+
const resolvedTarget = isAbsolute10(target) ? resolve38(target) : resolve38(baseDir, target);
|
|
105482
106176
|
return isWithinDir(resolvedTarget, baseDir) ? resolvedTarget : null;
|
|
105483
106177
|
}
|
|
105484
106178
|
|
|
@@ -105511,9 +106205,9 @@ async function handleParse(target, options2) {
|
|
|
105511
106205
|
console.log(JSON.stringify({ file: relative27(process.cwd(), planFile), frontmatter, phases }, null, 2));
|
|
105512
106206
|
return;
|
|
105513
106207
|
}
|
|
105514
|
-
const title = typeof frontmatter.title === "string" ? frontmatter.title :
|
|
106208
|
+
const title = typeof frontmatter.title === "string" ? frontmatter.title : basename27(dirname40(planFile));
|
|
105515
106209
|
console.log();
|
|
105516
|
-
console.log(
|
|
106210
|
+
console.log(import_picocolors32.default.bold(` Plan: ${title}`));
|
|
105517
106211
|
console.log(` File: ${planFile}`);
|
|
105518
106212
|
console.log(` Phases found: ${phases.length}`);
|
|
105519
106213
|
console.log();
|
|
@@ -105552,7 +106246,7 @@ async function handleValidate(target, options2) {
|
|
|
105552
106246
|
return;
|
|
105553
106247
|
}
|
|
105554
106248
|
console.log();
|
|
105555
|
-
console.log(
|
|
106249
|
+
console.log(import_picocolors32.default.bold(` Validating: ${planFile}`));
|
|
105556
106250
|
console.log();
|
|
105557
106251
|
if (result.issues.length === 0) {
|
|
105558
106252
|
console.log(` [OK] No issues found — ${result.phases.length} phases detected`);
|
|
@@ -105566,7 +106260,7 @@ async function handleValidate(target, options2) {
|
|
|
105566
106260
|
}
|
|
105567
106261
|
}
|
|
105568
106262
|
console.log();
|
|
105569
|
-
const validStr = result.valid ?
|
|
106263
|
+
const validStr = result.valid ? import_picocolors32.default.green("[OK] Valid") : import_picocolors32.default.red("[X] Invalid");
|
|
105570
106264
|
console.log(` ${validStr} — ${result.issues.filter((i) => i.severity === "error").length} errors, ${result.issues.filter((i) => i.severity === "warning").length} warnings`);
|
|
105571
106265
|
console.log();
|
|
105572
106266
|
if (!result.valid)
|
|
@@ -105581,7 +106275,7 @@ async function handleStatus(target, options2) {
|
|
|
105581
106275
|
return;
|
|
105582
106276
|
}
|
|
105583
106277
|
const effectiveTarget = !resolvedTarget && globalBaseDir ? globalBaseDir : resolvedTarget;
|
|
105584
|
-
const t = effectiveTarget ?
|
|
106278
|
+
const t = effectiveTarget ? resolve39(effectiveTarget) : null;
|
|
105585
106279
|
const plansDir = t && existsSync64(t) && statSync10(t).isDirectory() && !existsSync64(join143(t, "plan.md")) ? t : null;
|
|
105586
106280
|
if (plansDir) {
|
|
105587
106281
|
const planFiles = scanPlanDir(plansDir);
|
|
@@ -105614,7 +106308,7 @@ async function handleStatus(target, options2) {
|
|
|
105614
106308
|
return;
|
|
105615
106309
|
}
|
|
105616
106310
|
console.log();
|
|
105617
|
-
console.log(
|
|
106311
|
+
console.log(import_picocolors32.default.bold(` Plans in: ${plansDir}`));
|
|
105618
106312
|
console.log();
|
|
105619
106313
|
for (const pf of planFiles) {
|
|
105620
106314
|
try {
|
|
@@ -105622,8 +106316,8 @@ async function handleStatus(target, options2) {
|
|
|
105622
106316
|
const blockedBy2 = await resolvePlanDependencies(s.blockedBy, pf, { preloadedConfig });
|
|
105623
106317
|
const blocks2 = await resolvePlanDependencies(s.blocks, pf, { preloadedConfig });
|
|
105624
106318
|
const bar = progressBar(s.completed, s.totalPhases);
|
|
105625
|
-
const title2 = s.title ??
|
|
105626
|
-
console.log(` ${
|
|
106319
|
+
const title2 = s.title ?? basename27(dirname40(pf));
|
|
106320
|
+
console.log(` ${import_picocolors32.default.bold(title2)}`);
|
|
105627
106321
|
console.log(` ${bar}`);
|
|
105628
106322
|
if (s.inProgress > 0)
|
|
105629
106323
|
console.log(` [~] ${s.inProgress} in progress`);
|
|
@@ -105641,7 +106335,7 @@ async function handleStatus(target, options2) {
|
|
|
105641
106335
|
}
|
|
105642
106336
|
console.log();
|
|
105643
106337
|
} catch {
|
|
105644
|
-
console.log(` [X] Failed to read: ${
|
|
106338
|
+
console.log(` [X] Failed to read: ${basename27(dirname40(pf))}`);
|
|
105645
106339
|
console.log();
|
|
105646
106340
|
}
|
|
105647
106341
|
}
|
|
@@ -105668,9 +106362,9 @@ async function handleStatus(target, options2) {
|
|
|
105668
106362
|
console.log(JSON.stringify({ ...summary, dependencyStatus: { blockedBy, blocks } }, null, 2));
|
|
105669
106363
|
return;
|
|
105670
106364
|
}
|
|
105671
|
-
const title = summary.title ??
|
|
106365
|
+
const title = summary.title ?? basename27(dirname40(planFile));
|
|
105672
106366
|
console.log();
|
|
105673
|
-
console.log(
|
|
106367
|
+
console.log(import_picocolors32.default.bold(` ${title}`));
|
|
105674
106368
|
if (summary.status)
|
|
105675
106369
|
console.log(` Status: ${summary.status}`);
|
|
105676
106370
|
console.log();
|
|
@@ -105731,22 +106425,22 @@ async function handleKanban(target, options2) {
|
|
|
105731
106425
|
process.exitCode = 1;
|
|
105732
106426
|
return;
|
|
105733
106427
|
}
|
|
105734
|
-
const route = `/plans?dir=${encodeURIComponent(
|
|
106428
|
+
const route = `/plans?dir=${encodeURIComponent(dirname40(dirname40(planFile)))}&view=kanban`;
|
|
105735
106429
|
const url = `http://localhost:${server.port}${route}`;
|
|
105736
106430
|
console.log();
|
|
105737
|
-
console.log(
|
|
105738
|
-
console.log(
|
|
105739
|
-
console.log(` Local: ${
|
|
106431
|
+
console.log(import_picocolors32.default.bold(" ClaudeKit Dashboard — Plans"));
|
|
106432
|
+
console.log(import_picocolors32.default.dim(" ──────────────────────────────"));
|
|
106433
|
+
console.log(` Local: ${import_picocolors32.default.cyan(url)}`);
|
|
105740
106434
|
console.log(` File: ${planFile}`);
|
|
105741
106435
|
console.log();
|
|
105742
|
-
console.log(
|
|
106436
|
+
console.log(import_picocolors32.default.dim(" Press Ctrl+C to stop"));
|
|
105743
106437
|
console.log();
|
|
105744
106438
|
if (!noOpen) {
|
|
105745
106439
|
try {
|
|
105746
106440
|
const { default: open6 } = await Promise.resolve().then(() => (init_open(), exports_open));
|
|
105747
106441
|
await open6(url);
|
|
105748
106442
|
} catch {
|
|
105749
|
-
console.log(
|
|
106443
|
+
console.log(import_picocolors32.default.dim(" [i] Could not open browser automatically"));
|
|
105750
106444
|
}
|
|
105751
106445
|
}
|
|
105752
106446
|
await new Promise((resolvePromise) => {
|
|
@@ -105765,8 +106459,8 @@ async function handleKanban(target, options2) {
|
|
|
105765
106459
|
init_plan_parser();
|
|
105766
106460
|
init_plans_registry();
|
|
105767
106461
|
init_output_manager();
|
|
105768
|
-
var
|
|
105769
|
-
import { basename as
|
|
106462
|
+
var import_picocolors33 = __toESM(require_picocolors(), 1);
|
|
106463
|
+
import { basename as basename28, dirname as dirname41, relative as relative28, resolve as resolve40 } from "node:path";
|
|
105770
106464
|
async function handleCreate(target, options2) {
|
|
105771
106465
|
if (!options2.title) {
|
|
105772
106466
|
output.error("[X] --title is required for create");
|
|
@@ -105798,13 +106492,13 @@ async function handleCreate(target, options2) {
|
|
|
105798
106492
|
return;
|
|
105799
106493
|
}
|
|
105800
106494
|
const globalBaseDir = options2.global ? await getGlobalPlansDirFromCwd() : undefined;
|
|
105801
|
-
const resolvedDir = globalBaseDir ? resolveTargetFromBase(dir, globalBaseDir) :
|
|
106495
|
+
const resolvedDir = globalBaseDir ? resolveTargetFromBase(dir, globalBaseDir) : resolve40(dir);
|
|
105802
106496
|
if (globalBaseDir && !resolvedDir) {
|
|
105803
106497
|
output.error("[X] Target directory must stay within the configured global plans root");
|
|
105804
106498
|
process.exitCode = 1;
|
|
105805
106499
|
return;
|
|
105806
106500
|
}
|
|
105807
|
-
const safeResolvedDir = resolvedDir ??
|
|
106501
|
+
const safeResolvedDir = resolvedDir ?? resolve40(dir);
|
|
105808
106502
|
const result = scaffoldPlan({
|
|
105809
106503
|
title: options2.title,
|
|
105810
106504
|
phases: phaseNames.map((name2) => ({ name: name2 })),
|
|
@@ -105838,11 +106532,11 @@ async function handleCreate(target, options2) {
|
|
|
105838
106532
|
return;
|
|
105839
106533
|
}
|
|
105840
106534
|
console.log();
|
|
105841
|
-
console.log(
|
|
106535
|
+
console.log(import_picocolors33.default.bold(` [OK] Plan created: ${options2.title}`));
|
|
105842
106536
|
console.log(` Directory: ${safeResolvedDir}`);
|
|
105843
106537
|
console.log(` Phases: ${result.phaseFiles.length}`);
|
|
105844
106538
|
for (const f3 of result.phaseFiles) {
|
|
105845
|
-
console.log(` [ ] ${
|
|
106539
|
+
console.log(` [ ] ${basename28(f3)}`);
|
|
105846
106540
|
}
|
|
105847
106541
|
console.log();
|
|
105848
106542
|
}
|
|
@@ -105866,7 +106560,7 @@ async function handleCheck(target, options2) {
|
|
|
105866
106560
|
process.exitCode = 1;
|
|
105867
106561
|
return;
|
|
105868
106562
|
}
|
|
105869
|
-
const planDir =
|
|
106563
|
+
const planDir = dirname41(planFile);
|
|
105870
106564
|
let planStatus = "pending";
|
|
105871
106565
|
try {
|
|
105872
106566
|
const projectRoot = findProjectRoot(planDir);
|
|
@@ -105915,7 +106609,7 @@ async function handleUncheck(target, options2) {
|
|
|
105915
106609
|
process.exitCode = 1;
|
|
105916
106610
|
return;
|
|
105917
106611
|
}
|
|
105918
|
-
const planDir =
|
|
106612
|
+
const planDir = dirname41(planFile);
|
|
105919
106613
|
try {
|
|
105920
106614
|
const projectRoot = findProjectRoot(planDir);
|
|
105921
106615
|
const summary = buildPlanSummary(planFile);
|
|
@@ -105954,7 +106648,7 @@ async function handleAddPhase(target, options2) {
|
|
|
105954
106648
|
try {
|
|
105955
106649
|
const result = addPhase(planFile, target, options2.after);
|
|
105956
106650
|
try {
|
|
105957
|
-
const planDir =
|
|
106651
|
+
const planDir = dirname41(planFile);
|
|
105958
106652
|
const projectRoot = findProjectRoot(planDir);
|
|
105959
106653
|
updateRegistryAddPhase({
|
|
105960
106654
|
planDir,
|
|
@@ -105980,19 +106674,19 @@ async function handleAddPhase(target, options2) {
|
|
|
105980
106674
|
// src/commands/plan/plan-command.ts
|
|
105981
106675
|
function resolveTargetPath(target, baseDir) {
|
|
105982
106676
|
if (!baseDir) {
|
|
105983
|
-
return
|
|
106677
|
+
return resolve41(target);
|
|
105984
106678
|
}
|
|
105985
106679
|
if (isAbsolute11(target)) {
|
|
105986
|
-
return
|
|
106680
|
+
return resolve41(target);
|
|
105987
106681
|
}
|
|
105988
|
-
const cwdCandidate =
|
|
106682
|
+
const cwdCandidate = resolve41(target);
|
|
105989
106683
|
if (existsSync65(cwdCandidate)) {
|
|
105990
106684
|
return cwdCandidate;
|
|
105991
106685
|
}
|
|
105992
|
-
return
|
|
106686
|
+
return resolve41(baseDir, target);
|
|
105993
106687
|
}
|
|
105994
106688
|
function resolvePlanFile(target, baseDir) {
|
|
105995
|
-
const t = target ? resolveTargetPath(target, baseDir) : baseDir ?
|
|
106689
|
+
const t = target ? resolveTargetPath(target, baseDir) : baseDir ? resolve41(baseDir) : process.cwd();
|
|
105996
106690
|
if (existsSync65(t)) {
|
|
105997
106691
|
const stat23 = statSync11(t);
|
|
105998
106692
|
if (stat23.isFile())
|
|
@@ -106008,7 +106702,7 @@ function resolvePlanFile(target, baseDir) {
|
|
|
106008
106702
|
const candidate = join144(dir, "plan.md");
|
|
106009
106703
|
if (existsSync65(candidate))
|
|
106010
106704
|
return candidate;
|
|
106011
|
-
dir =
|
|
106705
|
+
dir = dirname42(dir);
|
|
106012
106706
|
}
|
|
106013
106707
|
}
|
|
106014
106708
|
return null;
|
|
@@ -106056,7 +106750,7 @@ async function planCommand(action, target, options2) {
|
|
|
106056
106750
|
let resolvedTarget = target;
|
|
106057
106751
|
if (resolvedAction && !knownActions.has(resolvedAction)) {
|
|
106058
106752
|
const looksLikePath = resolvedAction.includes("/") || resolvedAction.includes("\\") || resolvedAction.endsWith(".md") || resolvedAction === "." || resolvedAction === "..";
|
|
106059
|
-
const existsOnDisk = !looksLikePath && existsSync65(
|
|
106753
|
+
const existsOnDisk = !looksLikePath && existsSync65(resolve41(resolvedAction));
|
|
106060
106754
|
if (looksLikePath || existsOnDisk) {
|
|
106061
106755
|
resolvedTarget = resolvedAction;
|
|
106062
106756
|
resolvedAction = undefined;
|
|
@@ -106097,13 +106791,13 @@ async function planCommand(action, target, options2) {
|
|
|
106097
106791
|
init_claudekit_data2();
|
|
106098
106792
|
init_logger();
|
|
106099
106793
|
init_safe_prompts();
|
|
106100
|
-
var
|
|
106794
|
+
var import_picocolors34 = __toESM(require_picocolors(), 1);
|
|
106101
106795
|
import { existsSync as existsSync66 } from "node:fs";
|
|
106102
|
-
import { resolve as
|
|
106796
|
+
import { resolve as resolve42 } from "node:path";
|
|
106103
106797
|
async function handleAdd(projectPath, options2) {
|
|
106104
106798
|
logger.debug(`Adding project: ${projectPath}, options: ${JSON.stringify(options2)}`);
|
|
106105
106799
|
intro("Add Project");
|
|
106106
|
-
const absolutePath =
|
|
106800
|
+
const absolutePath = resolve42(projectPath);
|
|
106107
106801
|
if (!existsSync66(absolutePath)) {
|
|
106108
106802
|
log.error(`Path does not exist: ${absolutePath}`);
|
|
106109
106803
|
process.exitCode = 1;
|
|
@@ -106115,10 +106809,10 @@ async function handleAdd(projectPath, options2) {
|
|
|
106115
106809
|
const existing = await ProjectsRegistryManager.getProject(absolutePath);
|
|
106116
106810
|
if (existing) {
|
|
106117
106811
|
console.log();
|
|
106118
|
-
console.log(
|
|
106119
|
-
console.log(
|
|
106120
|
-
console.log(
|
|
106121
|
-
console.log(
|
|
106812
|
+
console.log(import_picocolors34.default.dim(" Existing registration:"));
|
|
106813
|
+
console.log(import_picocolors34.default.dim(` Alias: ${import_picocolors34.default.cyan(existing.alias)}`));
|
|
106814
|
+
console.log(import_picocolors34.default.dim(` Path: ${existing.path}`));
|
|
106815
|
+
console.log(import_picocolors34.default.dim(` ID: ${existing.id}`));
|
|
106122
106816
|
console.log();
|
|
106123
106817
|
}
|
|
106124
106818
|
process.exitCode = 1;
|
|
@@ -106133,15 +106827,15 @@ async function handleAdd(projectPath, options2) {
|
|
|
106133
106827
|
});
|
|
106134
106828
|
log.success("Project registered successfully");
|
|
106135
106829
|
console.log();
|
|
106136
|
-
console.log(
|
|
106137
|
-
console.log(
|
|
106138
|
-
console.log(
|
|
106139
|
-
console.log(
|
|
106830
|
+
console.log(import_picocolors34.default.dim(" Details:"));
|
|
106831
|
+
console.log(import_picocolors34.default.dim(` Alias: ${import_picocolors34.default.cyan(project.alias)}`));
|
|
106832
|
+
console.log(import_picocolors34.default.dim(` Path: ${project.path}`));
|
|
106833
|
+
console.log(import_picocolors34.default.dim(` ID: ${project.id}`));
|
|
106140
106834
|
if (project.pinned) {
|
|
106141
|
-
console.log(
|
|
106835
|
+
console.log(import_picocolors34.default.dim(` Pinned: ${import_picocolors34.default.yellow("Yes")}`));
|
|
106142
106836
|
}
|
|
106143
106837
|
if (project.tags?.length) {
|
|
106144
|
-
console.log(
|
|
106838
|
+
console.log(import_picocolors34.default.dim(` Tags: ${project.tags.join(", ")}`));
|
|
106145
106839
|
}
|
|
106146
106840
|
console.log();
|
|
106147
106841
|
outro("Done!");
|
|
@@ -106154,7 +106848,7 @@ async function handleAdd(projectPath, options2) {
|
|
|
106154
106848
|
// src/commands/projects/list-handler.ts
|
|
106155
106849
|
init_claudekit_data2();
|
|
106156
106850
|
init_logger();
|
|
106157
|
-
var
|
|
106851
|
+
var import_picocolors35 = __toESM(require_picocolors(), 1);
|
|
106158
106852
|
async function handleList(options2) {
|
|
106159
106853
|
logger.debug(`Listing projects: ${JSON.stringify(options2)}`);
|
|
106160
106854
|
const projects = await ProjectsRegistryManager.listProjects({
|
|
@@ -106166,25 +106860,25 @@ async function handleList(options2) {
|
|
|
106166
106860
|
}
|
|
106167
106861
|
if (projects.length === 0) {
|
|
106168
106862
|
console.log();
|
|
106169
|
-
console.log(
|
|
106863
|
+
console.log(import_picocolors35.default.yellow("No projects registered yet."));
|
|
106170
106864
|
console.log();
|
|
106171
|
-
console.log(
|
|
106172
|
-
console.log(
|
|
106865
|
+
console.log(import_picocolors35.default.dim(" Add a project with:"));
|
|
106866
|
+
console.log(import_picocolors35.default.dim(" ck projects add <path>"));
|
|
106173
106867
|
console.log();
|
|
106174
106868
|
return;
|
|
106175
106869
|
}
|
|
106176
106870
|
console.log();
|
|
106177
|
-
console.log(
|
|
106871
|
+
console.log(import_picocolors35.default.bold(`Registered Projects (${projects.length})`));
|
|
106178
106872
|
console.log();
|
|
106179
106873
|
const aliasWidth = Math.max(5, ...projects.map((p) => p.alias.length));
|
|
106180
106874
|
const pathWidth = Math.max(4, ...projects.map((p) => p.path.length));
|
|
106181
|
-
console.log(
|
|
106182
|
-
console.log(
|
|
106875
|
+
console.log(import_picocolors35.default.dim(` ${"ALIAS".padEnd(aliasWidth)} ${"PATH".padEnd(pathWidth)} PINNED TAGS`));
|
|
106876
|
+
console.log(import_picocolors35.default.dim(` ${"-".repeat(aliasWidth + pathWidth + 20)}`));
|
|
106183
106877
|
for (const project of projects) {
|
|
106184
|
-
const alias =
|
|
106185
|
-
const path16 =
|
|
106186
|
-
const pinned = project.pinned ?
|
|
106187
|
-
const tags = project.tags?.length ?
|
|
106878
|
+
const alias = import_picocolors35.default.cyan(project.alias.padEnd(aliasWidth));
|
|
106879
|
+
const path16 = import_picocolors35.default.dim(project.path.padEnd(pathWidth));
|
|
106880
|
+
const pinned = project.pinned ? import_picocolors35.default.yellow("\uD83D\uDCCC") : " ";
|
|
106881
|
+
const tags = project.tags?.length ? import_picocolors35.default.gray(project.tags.join(", ")) : import_picocolors35.default.dim("-");
|
|
106188
106882
|
console.log(` ${alias} ${path16} ${pinned} ${tags}`);
|
|
106189
106883
|
}
|
|
106190
106884
|
console.log();
|
|
@@ -106194,7 +106888,7 @@ async function handleList(options2) {
|
|
|
106194
106888
|
init_claudekit_data2();
|
|
106195
106889
|
init_logger();
|
|
106196
106890
|
init_safe_prompts();
|
|
106197
|
-
var
|
|
106891
|
+
var import_picocolors36 = __toESM(require_picocolors(), 1);
|
|
106198
106892
|
async function handleRemove(aliasOrPath, options2) {
|
|
106199
106893
|
logger.debug(`Removing project: ${aliasOrPath}, options: ${JSON.stringify(options2)}`);
|
|
106200
106894
|
intro("Remove Project");
|
|
@@ -106213,7 +106907,7 @@ async function handleRemove(aliasOrPath, options2) {
|
|
|
106213
106907
|
message: "Select a project to remove",
|
|
106214
106908
|
options: projects.map((p) => ({
|
|
106215
106909
|
value: p.id,
|
|
106216
|
-
label: `${
|
|
106910
|
+
label: `${import_picocolors36.default.cyan(p.alias)} ${import_picocolors36.default.dim(`(${p.path})`)}`
|
|
106217
106911
|
}))
|
|
106218
106912
|
});
|
|
106219
106913
|
if (lD(selected)) {
|
|
@@ -106230,10 +106924,10 @@ async function handleRemove(aliasOrPath, options2) {
|
|
|
106230
106924
|
return;
|
|
106231
106925
|
}
|
|
106232
106926
|
console.log();
|
|
106233
|
-
console.log(
|
|
106234
|
-
console.log(
|
|
106235
|
-
console.log(
|
|
106236
|
-
console.log(
|
|
106927
|
+
console.log(import_picocolors36.default.dim(" Project to remove:"));
|
|
106928
|
+
console.log(import_picocolors36.default.dim(` Alias: ${import_picocolors36.default.cyan(project.alias)}`));
|
|
106929
|
+
console.log(import_picocolors36.default.dim(` Path: ${project.path}`));
|
|
106930
|
+
console.log(import_picocolors36.default.dim(` ID: ${project.id}`));
|
|
106237
106931
|
console.log();
|
|
106238
106932
|
const confirmed = await se({
|
|
106239
106933
|
message: "Are you sure you want to remove this project?",
|
|
@@ -106526,7 +107220,7 @@ init_skills_installer();
|
|
|
106526
107220
|
init_skills_registry();
|
|
106527
107221
|
init_skills_uninstaller();
|
|
106528
107222
|
var import_gray_matter11 = __toESM(require_gray_matter(), 1);
|
|
106529
|
-
var
|
|
107223
|
+
var import_picocolors37 = __toESM(require_picocolors(), 1);
|
|
106530
107224
|
import { readFile as readFile60 } from "node:fs/promises";
|
|
106531
107225
|
import { join as join145 } from "node:path";
|
|
106532
107226
|
|
|
@@ -106596,17 +107290,17 @@ async function handleCatalog(sourcePath, regenerate) {
|
|
|
106596
107290
|
categories.set(cat, (categories.get(cat) ?? 0) + 1);
|
|
106597
107291
|
}
|
|
106598
107292
|
console.log();
|
|
106599
|
-
f2.step(
|
|
107293
|
+
f2.step(import_picocolors37.default.bold("Skill Catalog"));
|
|
106600
107294
|
console.log();
|
|
106601
|
-
console.log(` ${
|
|
106602
|
-
console.log(` ${
|
|
106603
|
-
console.log(` ${
|
|
107295
|
+
console.log(` ${import_picocolors37.default.cyan("Skills:")} ${catalog.skillCount}`);
|
|
107296
|
+
console.log(` ${import_picocolors37.default.cyan("Generated:")} ${new Date(catalog.generated).toLocaleString()}`);
|
|
107297
|
+
console.log(` ${import_picocolors37.default.cyan("Version:")} ${catalog.version}`);
|
|
106604
107298
|
if (categories.size > 0) {
|
|
106605
107299
|
console.log();
|
|
106606
|
-
f2.step(
|
|
107300
|
+
f2.step(import_picocolors37.default.bold("Categories"));
|
|
106607
107301
|
console.log();
|
|
106608
107302
|
for (const [cat, count] of [...categories.entries()].sort((a3, b3) => b3[1] - a3[1])) {
|
|
106609
|
-
console.log(` ${
|
|
107303
|
+
console.log(` ${import_picocolors37.default.dim("•")} ${cat}: ${count}`);
|
|
106610
107304
|
}
|
|
106611
107305
|
}
|
|
106612
107306
|
console.log();
|
|
@@ -106633,13 +107327,13 @@ async function handleSearch(sourcePath, query, options2) {
|
|
|
106633
107327
|
return;
|
|
106634
107328
|
}
|
|
106635
107329
|
console.log();
|
|
106636
|
-
f2.step(
|
|
107330
|
+
f2.step(import_picocolors37.default.bold(`Search: "${safeQuery}"`));
|
|
106637
107331
|
console.log();
|
|
106638
107332
|
for (const r2 of results) {
|
|
106639
107333
|
const score = r2.score.toFixed(3);
|
|
106640
|
-
const cat = r2.category ?
|
|
106641
|
-
console.log(` ${
|
|
106642
|
-
console.log(` ${
|
|
107334
|
+
const cat = r2.category ? import_picocolors37.default.dim(` [${r2.category}]`) : "";
|
|
107335
|
+
console.log(` ${import_picocolors37.default.cyan(r2.name)} ${import_picocolors37.default.dim(`(${score})`)}${cat}`);
|
|
107336
|
+
console.log(` ${import_picocolors37.default.dim(r2.description)}`);
|
|
106643
107337
|
}
|
|
106644
107338
|
console.log();
|
|
106645
107339
|
}
|
|
@@ -106660,11 +107354,11 @@ async function handleValidate2(sourcePath) {
|
|
|
106660
107354
|
if (unknown.length > 0) {
|
|
106661
107355
|
if (!hasIssues)
|
|
106662
107356
|
console.log();
|
|
106663
|
-
f2.warn(`${
|
|
107357
|
+
f2.warn(`${import_picocolors37.default.cyan(skill.name)}: unknown fields: ${unknown.join(", ")}`);
|
|
106664
107358
|
hasIssues = true;
|
|
106665
107359
|
}
|
|
106666
107360
|
} catch {
|
|
106667
|
-
f2.warn(`${
|
|
107361
|
+
f2.warn(`${import_picocolors37.default.cyan(skill.name)}: could not read SKILL.md`);
|
|
106668
107362
|
hasIssues = true;
|
|
106669
107363
|
}
|
|
106670
107364
|
}
|
|
@@ -106692,7 +107386,7 @@ async function listSkills2(showInstalled) {
|
|
|
106692
107386
|
return;
|
|
106693
107387
|
}
|
|
106694
107388
|
console.log();
|
|
106695
|
-
f2.step(
|
|
107389
|
+
f2.step(import_picocolors37.default.bold("Installed Skills"));
|
|
106696
107390
|
console.log();
|
|
106697
107391
|
const bySkill = new Map;
|
|
106698
107392
|
for (const inst of installations) {
|
|
@@ -106701,14 +107395,14 @@ async function listSkills2(showInstalled) {
|
|
|
106701
107395
|
bySkill.set(inst.skill, list3);
|
|
106702
107396
|
}
|
|
106703
107397
|
for (const [skill, installs] of bySkill) {
|
|
106704
|
-
console.log(` ${
|
|
107398
|
+
console.log(` ${import_picocolors37.default.cyan(skill)}`);
|
|
106705
107399
|
for (const inst of installs) {
|
|
106706
107400
|
const scope = inst.global ? "global" : "project";
|
|
106707
|
-
console.log(` ${
|
|
107401
|
+
console.log(` ${import_picocolors37.default.dim("→")} ${inst.agent} (${scope}): ${import_picocolors37.default.dim(inst.path)}`);
|
|
106708
107402
|
}
|
|
106709
107403
|
}
|
|
106710
107404
|
console.log();
|
|
106711
|
-
console.log(
|
|
107405
|
+
console.log(import_picocolors37.default.dim(` ${installations.length} installation(s) across ${bySkill.size} skill(s)`));
|
|
106712
107406
|
console.log();
|
|
106713
107407
|
return;
|
|
106714
107408
|
}
|
|
@@ -106723,15 +107417,15 @@ async function listSkills2(showInstalled) {
|
|
|
106723
107417
|
return;
|
|
106724
107418
|
}
|
|
106725
107419
|
console.log();
|
|
106726
|
-
f2.step(
|
|
107420
|
+
f2.step(import_picocolors37.default.bold("Available Skills"));
|
|
106727
107421
|
console.log();
|
|
106728
107422
|
for (const skill of skills) {
|
|
106729
|
-
console.log(` ${
|
|
106730
|
-
console.log(` ${
|
|
107423
|
+
console.log(` ${import_picocolors37.default.cyan(skill.name)}`);
|
|
107424
|
+
console.log(` ${import_picocolors37.default.dim(skill.description)}`);
|
|
106731
107425
|
}
|
|
106732
107426
|
console.log();
|
|
106733
|
-
console.log(
|
|
106734
|
-
console.log(
|
|
107427
|
+
console.log(import_picocolors37.default.dim(` ${skills.length} skill(s) available`));
|
|
107428
|
+
console.log(import_picocolors37.default.dim(` Source: ${sourcePath}`));
|
|
106735
107429
|
console.log();
|
|
106736
107430
|
}
|
|
106737
107431
|
async function handleUninstall3(options2) {
|
|
@@ -106813,9 +107507,9 @@ async function handleUninstall3(options2) {
|
|
|
106813
107507
|
process.exit(1);
|
|
106814
107508
|
}
|
|
106815
107509
|
console.log();
|
|
106816
|
-
f2.step(
|
|
107510
|
+
f2.step(import_picocolors37.default.bold("Will uninstall:"));
|
|
106817
107511
|
for (const inst of toRemove) {
|
|
106818
|
-
f2.message(` ${
|
|
107512
|
+
f2.message(` ${import_picocolors37.default.red("✗")} ${inst.skill} → ${inst.agent}: ${import_picocolors37.default.dim(inst.path)}`);
|
|
106819
107513
|
}
|
|
106820
107514
|
console.log();
|
|
106821
107515
|
if (!options2.yes) {
|
|
@@ -106838,7 +107532,7 @@ async function handleUninstall3(options2) {
|
|
|
106838
107532
|
}
|
|
106839
107533
|
async function skillsCommand(options2) {
|
|
106840
107534
|
console.log();
|
|
106841
|
-
oe(
|
|
107535
|
+
oe(import_picocolors37.default.bgCyan(import_picocolors37.default.black(" ck skills ")));
|
|
106842
107536
|
try {
|
|
106843
107537
|
const baseOptions = SkillCommandOptionsSchema.parse(options2);
|
|
106844
107538
|
const validOptions = {
|
|
@@ -106869,34 +107563,34 @@ async function skillsCommand(options2) {
|
|
|
106869
107563
|
if (validOptions.search) {
|
|
106870
107564
|
if (!sourcePath) {
|
|
106871
107565
|
f2.error("No skills found. Install ClaudeKit Engineer first.");
|
|
106872
|
-
$e(
|
|
107566
|
+
$e(import_picocolors37.default.red("Search failed"));
|
|
106873
107567
|
process.exit(1);
|
|
106874
107568
|
}
|
|
106875
107569
|
await handleSearch(sourcePath, validOptions.search, {
|
|
106876
107570
|
json: validOptions.json,
|
|
106877
107571
|
limit: validOptions.limit
|
|
106878
107572
|
});
|
|
106879
|
-
$e(
|
|
107573
|
+
$e(import_picocolors37.default.dim("Done"));
|
|
106880
107574
|
return;
|
|
106881
107575
|
}
|
|
106882
107576
|
if (validOptions.catalog) {
|
|
106883
107577
|
if (!sourcePath) {
|
|
106884
107578
|
f2.error("No skills found. Install ClaudeKit Engineer first.");
|
|
106885
|
-
$e(
|
|
107579
|
+
$e(import_picocolors37.default.red("Catalog unavailable"));
|
|
106886
107580
|
process.exit(1);
|
|
106887
107581
|
}
|
|
106888
107582
|
await handleCatalog(sourcePath, validOptions.regenerate ?? false);
|
|
106889
|
-
$e(
|
|
107583
|
+
$e(import_picocolors37.default.dim(validOptions.regenerate ? "Catalog regenerated" : "Done"));
|
|
106890
107584
|
return;
|
|
106891
107585
|
}
|
|
106892
107586
|
if (validOptions.validate) {
|
|
106893
107587
|
if (!sourcePath) {
|
|
106894
107588
|
f2.error("No skills found. Install ClaudeKit Engineer first.");
|
|
106895
|
-
$e(
|
|
107589
|
+
$e(import_picocolors37.default.red("Validation failed"));
|
|
106896
107590
|
process.exit(1);
|
|
106897
107591
|
}
|
|
106898
107592
|
await handleValidate2(sourcePath);
|
|
106899
|
-
$e(
|
|
107593
|
+
$e(import_picocolors37.default.dim("Validation complete"));
|
|
106900
107594
|
return;
|
|
106901
107595
|
}
|
|
106902
107596
|
if (validOptions.sync) {
|
|
@@ -106909,28 +107603,28 @@ async function skillsCommand(options2) {
|
|
|
106909
107603
|
} else {
|
|
106910
107604
|
f2.info("Registry is in sync");
|
|
106911
107605
|
}
|
|
106912
|
-
$e(
|
|
107606
|
+
$e(import_picocolors37.default.green("Done!"));
|
|
106913
107607
|
return;
|
|
106914
107608
|
}
|
|
106915
107609
|
if (validOptions.uninstall) {
|
|
106916
107610
|
await handleUninstall3(validOptions);
|
|
106917
|
-
$e(
|
|
107611
|
+
$e(import_picocolors37.default.green("Done!"));
|
|
106918
107612
|
return;
|
|
106919
107613
|
}
|
|
106920
107614
|
if (validOptions.list) {
|
|
106921
107615
|
await listSkills2(validOptions.installed ?? false);
|
|
106922
|
-
$e(
|
|
107616
|
+
$e(import_picocolors37.default.dim("Use --name <skill> to install a specific skill"));
|
|
106923
107617
|
return;
|
|
106924
107618
|
}
|
|
106925
107619
|
if (!sourcePath) {
|
|
106926
107620
|
f2.error("No skills found. Install ClaudeKit Engineer first.");
|
|
106927
|
-
$e(
|
|
107621
|
+
$e(import_picocolors37.default.red("Installation failed"));
|
|
106928
107622
|
process.exit(1);
|
|
106929
107623
|
}
|
|
106930
107624
|
const availableSkills = await discoverSkills(sourcePath);
|
|
106931
107625
|
if (availableSkills.length === 0) {
|
|
106932
107626
|
f2.error("No valid skills found in source directory.");
|
|
106933
|
-
$e(
|
|
107627
|
+
$e(import_picocolors37.default.red("Installation failed"));
|
|
106934
107628
|
process.exit(1);
|
|
106935
107629
|
}
|
|
106936
107630
|
const ctx = {
|
|
@@ -106946,7 +107640,7 @@ async function skillsCommand(options2) {
|
|
|
106946
107640
|
const trimmedName = validOptions.name.trim();
|
|
106947
107641
|
if (!trimmedName) {
|
|
106948
107642
|
f2.error("Skill name cannot be empty");
|
|
106949
|
-
$e(
|
|
107643
|
+
$e(import_picocolors37.default.red("Installation failed"));
|
|
106950
107644
|
process.exit(1);
|
|
106951
107645
|
}
|
|
106952
107646
|
const skill = await findSkillByName(trimmedName, sourcePath);
|
|
@@ -106956,15 +107650,15 @@ async function skillsCommand(options2) {
|
|
|
106956
107650
|
for (const s of availableSkills) {
|
|
106957
107651
|
f2.message(` - ${s.name}`);
|
|
106958
107652
|
}
|
|
106959
|
-
$e(
|
|
107653
|
+
$e(import_picocolors37.default.red("Installation failed"));
|
|
106960
107654
|
process.exit(1);
|
|
106961
107655
|
}
|
|
106962
107656
|
ctx.selectedSkills = [skill];
|
|
106963
|
-
f2.info(`Skill: ${
|
|
106964
|
-
f2.message(
|
|
107657
|
+
f2.info(`Skill: ${import_picocolors37.default.cyan(skill.name)}`);
|
|
107658
|
+
f2.message(import_picocolors37.default.dim(skill.description));
|
|
106965
107659
|
} else if (availableSkills.length === 1) {
|
|
106966
107660
|
ctx.selectedSkills = [availableSkills[0]];
|
|
106967
|
-
f2.info(`Skill: ${
|
|
107661
|
+
f2.info(`Skill: ${import_picocolors37.default.cyan(ctx.selectedSkills[0].name)}`);
|
|
106968
107662
|
} else if (validOptions.yes) {
|
|
106969
107663
|
f2.error("--name required in non-interactive mode with multiple skills");
|
|
106970
107664
|
process.exit(1);
|
|
@@ -107021,7 +107715,7 @@ async function skillsCommand(options2) {
|
|
|
107021
107715
|
}
|
|
107022
107716
|
} else if (ctx.detectedAgents.length === 1 || validOptions.yes) {
|
|
107023
107717
|
ctx.selectedAgents = ctx.detectedAgents;
|
|
107024
|
-
f2.info(`Installing to: ${ctx.detectedAgents.map((a3) =>
|
|
107718
|
+
f2.info(`Installing to: ${ctx.detectedAgents.map((a3) => import_picocolors37.default.cyan(agents[a3].displayName)).join(", ")}`);
|
|
107025
107719
|
} else {
|
|
107026
107720
|
const agentChoices = ctx.detectedAgents.map((a3) => ({
|
|
107027
107721
|
value: a3,
|
|
@@ -107067,15 +107761,15 @@ async function skillsCommand(options2) {
|
|
|
107067
107761
|
process.exit(1);
|
|
107068
107762
|
}
|
|
107069
107763
|
console.log();
|
|
107070
|
-
f2.step(
|
|
107764
|
+
f2.step(import_picocolors37.default.bold("Installation Summary"));
|
|
107071
107765
|
for (const skill of ctx.selectedSkills) {
|
|
107072
|
-
f2.message(` ${
|
|
107766
|
+
f2.message(` ${import_picocolors37.default.cyan(skill.name)}`);
|
|
107073
107767
|
const preview = getInstallPreview(skill, ctx.selectedAgents, {
|
|
107074
107768
|
global: ctx.installGlobally
|
|
107075
107769
|
});
|
|
107076
107770
|
for (const item of preview) {
|
|
107077
|
-
const status = item.exists ?
|
|
107078
|
-
f2.message(` ${
|
|
107771
|
+
const status = item.exists ? import_picocolors37.default.yellow(" (overwrite)") : "";
|
|
107772
|
+
f2.message(` ${import_picocolors37.default.dim("→")} ${item.displayName}${status}`);
|
|
107079
107773
|
}
|
|
107080
107774
|
}
|
|
107081
107775
|
console.log();
|
|
@@ -107110,29 +107804,29 @@ async function skillsCommand(options2) {
|
|
|
107110
107804
|
const skipped = results.filter((r2) => r2.skipped);
|
|
107111
107805
|
const failed = results.filter((r2) => !r2.success);
|
|
107112
107806
|
if (successful.length > 0) {
|
|
107113
|
-
f2.success(`${
|
|
107807
|
+
f2.success(`${import_picocolors37.default.cyan(skill)} → ${successful.length} agent(s)`);
|
|
107114
107808
|
for (const r2 of successful) {
|
|
107115
|
-
f2.message(` ${
|
|
107809
|
+
f2.message(` ${import_picocolors37.default.green("✓")} ${r2.agentDisplayName}`);
|
|
107116
107810
|
}
|
|
107117
107811
|
}
|
|
107118
107812
|
if (skipped.length > 0) {
|
|
107119
|
-
f2.info(`${
|
|
107813
|
+
f2.info(`${import_picocolors37.default.cyan(skill)} → ${skipped.length} skipped`);
|
|
107120
107814
|
for (const r2 of skipped) {
|
|
107121
|
-
f2.message(` ${
|
|
107815
|
+
f2.message(` ${import_picocolors37.default.yellow("○")} ${r2.agentDisplayName}: ${import_picocolors37.default.dim(r2.skipReason || "Already at source location")}`);
|
|
107122
107816
|
}
|
|
107123
107817
|
}
|
|
107124
107818
|
if (failed.length > 0) {
|
|
107125
|
-
f2.error(`${
|
|
107819
|
+
f2.error(`${import_picocolors37.default.cyan(skill)} failed: ${failed.length} agent(s)`);
|
|
107126
107820
|
for (const r2 of failed) {
|
|
107127
|
-
f2.message(` ${
|
|
107821
|
+
f2.message(` ${import_picocolors37.default.red("✗")} ${r2.agentDisplayName}: ${import_picocolors37.default.dim(r2.error)}`);
|
|
107128
107822
|
}
|
|
107129
107823
|
}
|
|
107130
107824
|
}
|
|
107131
107825
|
console.log();
|
|
107132
107826
|
if (totalSuccessful === 0 && totalFailed === 0 && totalSkipped === 0) {
|
|
107133
|
-
$e(
|
|
107827
|
+
$e(import_picocolors37.default.yellow("No installations performed"));
|
|
107134
107828
|
} else if (totalFailed > 0 && totalSuccessful === 0) {
|
|
107135
|
-
$e(
|
|
107829
|
+
$e(import_picocolors37.default.red("Installation failed"));
|
|
107136
107830
|
process.exit(1);
|
|
107137
107831
|
} else {
|
|
107138
107832
|
const parts = [];
|
|
@@ -107142,11 +107836,11 @@ async function skillsCommand(options2) {
|
|
|
107142
107836
|
parts.push(`${totalSkipped} skipped`);
|
|
107143
107837
|
if (totalFailed > 0)
|
|
107144
107838
|
parts.push(`${totalFailed} failed`);
|
|
107145
|
-
$e(
|
|
107839
|
+
$e(import_picocolors37.default.green(`Done! ${parts.join(", ")}`));
|
|
107146
107840
|
}
|
|
107147
107841
|
} catch (error) {
|
|
107148
107842
|
logger.error(error instanceof Error ? error.message : "Unknown error");
|
|
107149
|
-
$e(
|
|
107843
|
+
$e(import_picocolors37.default.red("Installation failed"));
|
|
107150
107844
|
process.exit(1);
|
|
107151
107845
|
}
|
|
107152
107846
|
}
|
|
@@ -107164,7 +107858,7 @@ init_logger();
|
|
|
107164
107858
|
init_path_resolver();
|
|
107165
107859
|
init_safe_prompts();
|
|
107166
107860
|
init_types3();
|
|
107167
|
-
var
|
|
107861
|
+
var import_picocolors39 = __toESM(require_picocolors(), 1);
|
|
107168
107862
|
|
|
107169
107863
|
// src/commands/uninstall/installation-detector.ts
|
|
107170
107864
|
init_claudekit_scanner();
|
|
@@ -107208,7 +107902,7 @@ async function detectInstallations() {
|
|
|
107208
107902
|
|
|
107209
107903
|
// src/commands/uninstall/removal-handler.ts
|
|
107210
107904
|
import { readdirSync as readdirSync9, rmSync as rmSync6 } from "node:fs";
|
|
107211
|
-
import { basename as
|
|
107905
|
+
import { basename as basename29, join as join147, resolve as resolve43, sep as sep11 } from "node:path";
|
|
107212
107906
|
init_logger();
|
|
107213
107907
|
init_safe_prompts();
|
|
107214
107908
|
init_safe_spinner();
|
|
@@ -107217,11 +107911,11 @@ var import_fs_extra44 = __toESM(require_lib3(), 1);
|
|
|
107217
107911
|
// src/commands/uninstall/analysis-handler.ts
|
|
107218
107912
|
init_metadata_migration();
|
|
107219
107913
|
import { readdirSync as readdirSync8, rmSync as rmSync5 } from "node:fs";
|
|
107220
|
-
import { dirname as
|
|
107914
|
+
import { dirname as dirname43, join as join146 } from "node:path";
|
|
107221
107915
|
init_logger();
|
|
107222
107916
|
init_safe_prompts();
|
|
107223
107917
|
var import_fs_extra43 = __toESM(require_lib3(), 1);
|
|
107224
|
-
var
|
|
107918
|
+
var import_picocolors38 = __toESM(require_picocolors(), 1);
|
|
107225
107919
|
function normalizeTrackedPath(relativePath) {
|
|
107226
107920
|
return relativePath.replace(/\\/g, "/");
|
|
107227
107921
|
}
|
|
@@ -107239,7 +107933,7 @@ function classifyFileByOwnership(ownership, forceOverwrite, deleteReason) {
|
|
|
107239
107933
|
}
|
|
107240
107934
|
async function cleanupEmptyDirectories3(filePath, installationRoot) {
|
|
107241
107935
|
let cleaned = 0;
|
|
107242
|
-
let currentDir =
|
|
107936
|
+
let currentDir = dirname43(filePath);
|
|
107243
107937
|
while (currentDir !== installationRoot && currentDir.startsWith(installationRoot)) {
|
|
107244
107938
|
try {
|
|
107245
107939
|
const entries = readdirSync8(currentDir);
|
|
@@ -107247,7 +107941,7 @@ async function cleanupEmptyDirectories3(filePath, installationRoot) {
|
|
|
107247
107941
|
rmSync5(currentDir, { recursive: true });
|
|
107248
107942
|
cleaned++;
|
|
107249
107943
|
logger.debug(`Removed empty directory: ${currentDir}`);
|
|
107250
|
-
currentDir =
|
|
107944
|
+
currentDir = dirname43(currentDir);
|
|
107251
107945
|
} else {
|
|
107252
107946
|
break;
|
|
107253
107947
|
}
|
|
@@ -107335,27 +108029,27 @@ async function analyzeInstallation(installation, forceOverwrite, kit) {
|
|
|
107335
108029
|
}
|
|
107336
108030
|
function displayDryRunPreview(analysis, installationType) {
|
|
107337
108031
|
console.log("");
|
|
107338
|
-
log.info(
|
|
108032
|
+
log.info(import_picocolors38.default.bold(`DRY RUN - Preview for ${installationType} installation:`));
|
|
107339
108033
|
console.log("");
|
|
107340
108034
|
if (analysis.toDelete.length > 0) {
|
|
107341
|
-
console.log(
|
|
108035
|
+
console.log(import_picocolors38.default.red(import_picocolors38.default.bold(`Files to DELETE (${analysis.toDelete.length}):`)));
|
|
107342
108036
|
const showDelete = analysis.toDelete.slice(0, 10);
|
|
107343
108037
|
for (const item of showDelete) {
|
|
107344
|
-
console.log(` ${
|
|
108038
|
+
console.log(` ${import_picocolors38.default.red("✖")} ${item.path}`);
|
|
107345
108039
|
}
|
|
107346
108040
|
if (analysis.toDelete.length > 10) {
|
|
107347
|
-
console.log(
|
|
108041
|
+
console.log(import_picocolors38.default.gray(` ... and ${analysis.toDelete.length - 10} more`));
|
|
107348
108042
|
}
|
|
107349
108043
|
console.log("");
|
|
107350
108044
|
}
|
|
107351
108045
|
if (analysis.toPreserve.length > 0) {
|
|
107352
|
-
console.log(
|
|
108046
|
+
console.log(import_picocolors38.default.green(import_picocolors38.default.bold(`Files to PRESERVE (${analysis.toPreserve.length}):`)));
|
|
107353
108047
|
const showPreserve = analysis.toPreserve.slice(0, 10);
|
|
107354
108048
|
for (const item of showPreserve) {
|
|
107355
|
-
console.log(` ${
|
|
108049
|
+
console.log(` ${import_picocolors38.default.green("✓")} ${item.path} ${import_picocolors38.default.gray(`(${item.reason})`)}`);
|
|
107356
108050
|
}
|
|
107357
108051
|
if (analysis.toPreserve.length > 10) {
|
|
107358
|
-
console.log(
|
|
108052
|
+
console.log(import_picocolors38.default.gray(` ... and ${analysis.toPreserve.length - 10} more`));
|
|
107359
108053
|
}
|
|
107360
108054
|
console.log("");
|
|
107361
108055
|
}
|
|
@@ -107389,8 +108083,8 @@ async function restoreUninstallBackup(backup) {
|
|
|
107389
108083
|
}
|
|
107390
108084
|
async function isPathSafeToRemove(filePath, baseDir) {
|
|
107391
108085
|
try {
|
|
107392
|
-
const resolvedPath =
|
|
107393
|
-
const resolvedBase =
|
|
108086
|
+
const resolvedPath = resolve43(filePath);
|
|
108087
|
+
const resolvedBase = resolve43(baseDir);
|
|
107394
108088
|
if (!resolvedPath.startsWith(resolvedBase + sep11) && resolvedPath !== resolvedBase) {
|
|
107395
108089
|
logger.debug(`Path outside installation directory: ${filePath}`);
|
|
107396
108090
|
return false;
|
|
@@ -107398,7 +108092,7 @@ async function isPathSafeToRemove(filePath, baseDir) {
|
|
|
107398
108092
|
const stats = await import_fs_extra44.lstat(filePath);
|
|
107399
108093
|
if (stats.isSymbolicLink()) {
|
|
107400
108094
|
const realPath = await import_fs_extra44.realpath(filePath);
|
|
107401
|
-
const resolvedReal =
|
|
108095
|
+
const resolvedReal = resolve43(realPath);
|
|
107402
108096
|
if (!resolvedReal.startsWith(resolvedBase + sep11) && resolvedReal !== resolvedBase) {
|
|
107403
108097
|
logger.debug(`Symlink points outside installation directory: ${filePath} -> ${realPath}`);
|
|
107404
108098
|
return false;
|
|
@@ -107444,7 +108138,7 @@ async function removeInstallations(installations, options2) {
|
|
|
107444
108138
|
scope: installation.type,
|
|
107445
108139
|
kit: options2.kit
|
|
107446
108140
|
});
|
|
107447
|
-
await cleanupOldDestructiveOperationBackups(undefined,
|
|
108141
|
+
await cleanupOldDestructiveOperationBackups(undefined, basename29(backup.backupDir));
|
|
107448
108142
|
backupSpinner.succeed(`Recovery backup saved to ${backup.backupDir}`);
|
|
107449
108143
|
} catch (error) {
|
|
107450
108144
|
backupSpinner.fail("Failed to create recovery backup");
|
|
@@ -107543,15 +108237,15 @@ function displayInstallations(installations, scope) {
|
|
|
107543
108237
|
const hasLegacy = installations.some((i) => !i.hasMetadata);
|
|
107544
108238
|
const lines = installations.map((i) => {
|
|
107545
108239
|
const typeLabel = i.type === "local" ? "Local " : "Global";
|
|
107546
|
-
const legacyTag = !i.hasMetadata ?
|
|
108240
|
+
const legacyTag = !i.hasMetadata ? import_picocolors39.default.yellow(" [legacy]") : "";
|
|
107547
108241
|
const components = formatComponentSummary(i);
|
|
107548
108242
|
return ` ${typeLabel}: ${i.path}${legacyTag}${components}`;
|
|
107549
108243
|
});
|
|
107550
108244
|
prompts.note(lines.join(`
|
|
107551
108245
|
`), `Detected ClaudeKit installations (${scopeLabel})`);
|
|
107552
108246
|
if (hasLegacy) {
|
|
107553
|
-
log.warn(
|
|
107554
|
-
`) +
|
|
108247
|
+
log.warn(import_picocolors39.default.yellow(`[!] Legacy installation(s) detected without metadata.json.
|
|
108248
|
+
`) + import_picocolors39.default.yellow(" These files cannot be selectively removed. Full directory cleanup will be performed."));
|
|
107555
108249
|
}
|
|
107556
108250
|
log.warn("[!] This will permanently delete ClaudeKit files from the above paths.");
|
|
107557
108251
|
}
|
|
@@ -107612,7 +108306,7 @@ async function uninstallCommand(options2) {
|
|
|
107612
108306
|
}
|
|
107613
108307
|
const isAtHome = PathResolver.isLocalSameAsGlobal();
|
|
107614
108308
|
if (validOptions.local && !validOptions.global && isAtHome) {
|
|
107615
|
-
log.warn(
|
|
108309
|
+
log.warn(import_picocolors39.default.yellow("Cannot use --local at HOME directory (local path equals global path)."));
|
|
107616
108310
|
log.info("Use -g/--global or run from a project directory.");
|
|
107617
108311
|
return;
|
|
107618
108312
|
}
|
|
@@ -107624,7 +108318,7 @@ async function uninstallCommand(options2) {
|
|
|
107624
108318
|
} else if (validOptions.global) {
|
|
107625
108319
|
scope = "global";
|
|
107626
108320
|
} else if (isAtHome) {
|
|
107627
|
-
log.info(
|
|
108321
|
+
log.info(import_picocolors39.default.cyan("Running at HOME directory - targeting global installation"));
|
|
107628
108322
|
scope = "global";
|
|
107629
108323
|
} else {
|
|
107630
108324
|
const promptedScope = await promptScope(allInstallations);
|
|
@@ -107646,10 +108340,10 @@ async function uninstallCommand(options2) {
|
|
|
107646
108340
|
}
|
|
107647
108341
|
displayInstallations(installations, scope);
|
|
107648
108342
|
if (validOptions.kit) {
|
|
107649
|
-
log.info(
|
|
108343
|
+
log.info(import_picocolors39.default.cyan(`Kit-scoped uninstall: ${validOptions.kit} kit only`));
|
|
107650
108344
|
}
|
|
107651
108345
|
if (validOptions.dryRun) {
|
|
107652
|
-
log.info(
|
|
108346
|
+
log.info(import_picocolors39.default.yellow("DRY RUN MODE - No files will be deleted"));
|
|
107653
108347
|
await removeInstallations(installations, {
|
|
107654
108348
|
dryRun: true,
|
|
107655
108349
|
forceOverwrite: validOptions.forceOverwrite,
|
|
@@ -107659,8 +108353,8 @@ async function uninstallCommand(options2) {
|
|
|
107659
108353
|
return;
|
|
107660
108354
|
}
|
|
107661
108355
|
if (validOptions.forceOverwrite) {
|
|
107662
|
-
log.warn(`${
|
|
107663
|
-
${
|
|
108356
|
+
log.warn(`${import_picocolors39.default.yellow(import_picocolors39.default.bold("FORCE MODE ENABLED"))}
|
|
108357
|
+
${import_picocolors39.default.yellow("User modifications will be permanently deleted!")}`);
|
|
107664
108358
|
}
|
|
107665
108359
|
if (!validOptions.yes) {
|
|
107666
108360
|
const kitLabel = validOptions.kit ? ` (${validOptions.kit} kit only)` : "";
|
|
@@ -107695,7 +108389,7 @@ init_update_cli();
|
|
|
107695
108389
|
init_github_client();
|
|
107696
108390
|
init_logger();
|
|
107697
108391
|
init_types3();
|
|
107698
|
-
var
|
|
108392
|
+
var import_picocolors40 = __toESM(require_picocolors(), 1);
|
|
107699
108393
|
function formatRelativeTime(dateString) {
|
|
107700
108394
|
if (!dateString)
|
|
107701
108395
|
return "Unknown";
|
|
@@ -107717,30 +108411,30 @@ function formatRelativeTime(dateString) {
|
|
|
107717
108411
|
}
|
|
107718
108412
|
function displayKitReleases(kitName, releases) {
|
|
107719
108413
|
console.log(`
|
|
107720
|
-
${
|
|
108414
|
+
${import_picocolors40.default.bold(import_picocolors40.default.cyan(kitName))} - Available Versions:
|
|
107721
108415
|
`);
|
|
107722
108416
|
if (releases.length === 0) {
|
|
107723
|
-
console.log(
|
|
108417
|
+
console.log(import_picocolors40.default.dim(" No releases found"));
|
|
107724
108418
|
return;
|
|
107725
108419
|
}
|
|
107726
108420
|
for (const release of releases) {
|
|
107727
|
-
const version =
|
|
108421
|
+
const version = import_picocolors40.default.green(release.tag_name);
|
|
107728
108422
|
const name2 = release.name || "No title";
|
|
107729
108423
|
const publishedAt = formatRelativeTime(release.published_at);
|
|
107730
108424
|
const assetCount = release.assets.length;
|
|
107731
108425
|
const badges = [];
|
|
107732
108426
|
if (release.prerelease)
|
|
107733
|
-
badges.push(
|
|
108427
|
+
badges.push(import_picocolors40.default.yellow("[prerelease]"));
|
|
107734
108428
|
if (release.draft)
|
|
107735
|
-
badges.push(
|
|
108429
|
+
badges.push(import_picocolors40.default.gray("[draft]"));
|
|
107736
108430
|
const badgeStr = badges.length > 0 ? ` ${badges.join(" ")}` : "";
|
|
107737
108431
|
const versionPart = version.padEnd(20);
|
|
107738
108432
|
const namePart = name2.length > 40 ? `${name2.slice(0, 37)}...` : name2.padEnd(40);
|
|
107739
|
-
const timePart =
|
|
107740
|
-
const assetPart =
|
|
108433
|
+
const timePart = import_picocolors40.default.dim(publishedAt.padEnd(20));
|
|
108434
|
+
const assetPart = import_picocolors40.default.dim(`(${assetCount} ${assetCount === 1 ? "asset" : "assets"})`);
|
|
107741
108435
|
console.log(` ${versionPart} ${namePart} ${timePart} ${assetPart}${badgeStr}`);
|
|
107742
108436
|
}
|
|
107743
|
-
console.log(
|
|
108437
|
+
console.log(import_picocolors40.default.dim(`
|
|
107744
108438
|
Showing ${releases.length} ${releases.length === 1 ? "release" : "releases"}`));
|
|
107745
108439
|
}
|
|
107746
108440
|
async function versionCommand(options2) {
|
|
@@ -107775,8 +108469,8 @@ async function versionCommand(options2) {
|
|
|
107775
108469
|
for (const result of results) {
|
|
107776
108470
|
if (result.error) {
|
|
107777
108471
|
console.log(`
|
|
107778
|
-
${
|
|
107779
|
-
console.log(
|
|
108472
|
+
${import_picocolors40.default.bold(import_picocolors40.default.cyan(result.kitConfig.name))} - ${import_picocolors40.default.red("Error")}`);
|
|
108473
|
+
console.log(import_picocolors40.default.dim(` ${result.error}`));
|
|
107780
108474
|
} else {
|
|
107781
108475
|
displayKitReleases(result.kitConfig.name, result.releases);
|
|
107782
108476
|
}
|
|
@@ -107793,7 +108487,7 @@ init_logger();
|
|
|
107793
108487
|
import { existsSync as existsSync72 } from "node:fs";
|
|
107794
108488
|
import { rm as rm16 } from "node:fs/promises";
|
|
107795
108489
|
import { join as join154 } from "node:path";
|
|
107796
|
-
var
|
|
108490
|
+
var import_picocolors41 = __toESM(require_picocolors(), 1);
|
|
107797
108491
|
|
|
107798
108492
|
// src/commands/watch/phases/implementation-runner.ts
|
|
107799
108493
|
init_logger();
|
|
@@ -107861,7 +108555,7 @@ function getDisclaimerMarker() {
|
|
|
107861
108555
|
return AI_DISCLAIMER;
|
|
107862
108556
|
}
|
|
107863
108557
|
function spawnAndCollect2(command, args) {
|
|
107864
|
-
return new Promise((
|
|
108558
|
+
return new Promise((resolve44, reject) => {
|
|
107865
108559
|
const child = spawn7(command, args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
107866
108560
|
const chunks = [];
|
|
107867
108561
|
const stderrChunks = [];
|
|
@@ -107874,7 +108568,7 @@ function spawnAndCollect2(command, args) {
|
|
|
107874
108568
|
reject(new Error(`${command} exited with code ${code2}: ${stderr}`));
|
|
107875
108569
|
return;
|
|
107876
108570
|
}
|
|
107877
|
-
|
|
108571
|
+
resolve44(Buffer.concat(chunks).toString("utf-8"));
|
|
107878
108572
|
});
|
|
107879
108573
|
});
|
|
107880
108574
|
}
|
|
@@ -107982,7 +108676,7 @@ function formatResponse(content, showBranding) {
|
|
|
107982
108676
|
return disclaimer + formatted + branding;
|
|
107983
108677
|
}
|
|
107984
108678
|
async function postViaGh(owner, repo, issueNumber, body) {
|
|
107985
|
-
return new Promise((
|
|
108679
|
+
return new Promise((resolve44, reject) => {
|
|
107986
108680
|
const args = [
|
|
107987
108681
|
"issue",
|
|
107988
108682
|
"comment",
|
|
@@ -108004,7 +108698,7 @@ async function postViaGh(owner, repo, issueNumber, body) {
|
|
|
108004
108698
|
reject(new Error(`gh exited with code ${code2}: ${stderr}`));
|
|
108005
108699
|
return;
|
|
108006
108700
|
}
|
|
108007
|
-
|
|
108701
|
+
resolve44();
|
|
108008
108702
|
});
|
|
108009
108703
|
});
|
|
108010
108704
|
}
|
|
@@ -108122,7 +108816,7 @@ After completing the implementation:
|
|
|
108122
108816
|
"--allowedTools",
|
|
108123
108817
|
tools
|
|
108124
108818
|
];
|
|
108125
|
-
await new Promise((
|
|
108819
|
+
await new Promise((resolve44, reject) => {
|
|
108126
108820
|
const child = spawn9("claude", args, { cwd: cwd2, stdio: ["pipe", "pipe", "pipe"], detached: false });
|
|
108127
108821
|
child.stdin.write(prompt);
|
|
108128
108822
|
child.stdin.end();
|
|
@@ -108147,7 +108841,7 @@ After completing the implementation:
|
|
|
108147
108841
|
reject(new Error(`Claude exited ${code2}: ${stderr.slice(0, 500)}`));
|
|
108148
108842
|
return;
|
|
108149
108843
|
}
|
|
108150
|
-
|
|
108844
|
+
resolve44();
|
|
108151
108845
|
});
|
|
108152
108846
|
});
|
|
108153
108847
|
}
|
|
@@ -108291,7 +108985,7 @@ function checkRateLimit2(processedThisHour, maxPerHour) {
|
|
|
108291
108985
|
return processedThisHour < maxPerHour;
|
|
108292
108986
|
}
|
|
108293
108987
|
function spawnAndCollect3(command, args) {
|
|
108294
|
-
return new Promise((
|
|
108988
|
+
return new Promise((resolve44, reject) => {
|
|
108295
108989
|
const child = spawn10(command, args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
108296
108990
|
const chunks = [];
|
|
108297
108991
|
const stderrChunks = [];
|
|
@@ -108304,7 +108998,7 @@ function spawnAndCollect3(command, args) {
|
|
|
108304
108998
|
reject(new Error(`${command} exited with code ${code2}: ${stderr}`));
|
|
108305
108999
|
return;
|
|
108306
109000
|
}
|
|
108307
|
-
|
|
109001
|
+
resolve44(Buffer.concat(chunks).toString("utf-8"));
|
|
108308
109002
|
});
|
|
108309
109003
|
});
|
|
108310
109004
|
}
|
|
@@ -108356,7 +109050,7 @@ async function invokeClaude(options2) {
|
|
|
108356
109050
|
return collectClaudeOutput(child, options2.timeoutSec, verbose);
|
|
108357
109051
|
}
|
|
108358
109052
|
function collectClaudeOutput(child, timeoutSec, verbose = false) {
|
|
108359
|
-
return new Promise((
|
|
109053
|
+
return new Promise((resolve44, reject) => {
|
|
108360
109054
|
const chunks = [];
|
|
108361
109055
|
const stderrChunks = [];
|
|
108362
109056
|
child.stdout?.on("data", (chunk) => {
|
|
@@ -108386,7 +109080,7 @@ function collectClaudeOutput(child, timeoutSec, verbose = false) {
|
|
|
108386
109080
|
reject(new Error(`Claude exited with code ${code2}: ${stderr}`));
|
|
108387
109081
|
return;
|
|
108388
109082
|
}
|
|
108389
|
-
|
|
109083
|
+
resolve44(verbose ? parseStreamJsonOutput(stdout2) : parseClaudeOutput(stdout2));
|
|
108390
109084
|
});
|
|
108391
109085
|
});
|
|
108392
109086
|
}
|
|
@@ -109091,7 +109785,7 @@ init_file_io();
|
|
|
109091
109785
|
init_logger();
|
|
109092
109786
|
import { existsSync as existsSync68 } from "node:fs";
|
|
109093
109787
|
import { mkdir as mkdir34, readFile as readFile62 } from "node:fs/promises";
|
|
109094
|
-
import { dirname as
|
|
109788
|
+
import { dirname as dirname44 } from "node:path";
|
|
109095
109789
|
var PROCESSED_ISSUES_CAP = 500;
|
|
109096
109790
|
async function readCkJson(projectDir) {
|
|
109097
109791
|
const configPath = CkConfigManager.getProjectConfigPath(projectDir);
|
|
@@ -109121,7 +109815,7 @@ async function loadWatchState(projectDir) {
|
|
|
109121
109815
|
}
|
|
109122
109816
|
async function saveWatchState(projectDir, state) {
|
|
109123
109817
|
const configPath = CkConfigManager.getProjectConfigPath(projectDir);
|
|
109124
|
-
const configDir =
|
|
109818
|
+
const configDir = dirname44(configPath);
|
|
109125
109819
|
if (!existsSync68(configDir)) {
|
|
109126
109820
|
await mkdir34(configDir, { recursive: true });
|
|
109127
109821
|
}
|
|
@@ -109288,7 +109982,7 @@ async function scanForRepos(parentDir) {
|
|
|
109288
109982
|
init_logger();
|
|
109289
109983
|
import { spawnSync as spawnSync8 } from "node:child_process";
|
|
109290
109984
|
import { existsSync as existsSync70 } from "node:fs";
|
|
109291
|
-
import { homedir as
|
|
109985
|
+
import { homedir as homedir47 } from "node:os";
|
|
109292
109986
|
import { join as join152 } from "node:path";
|
|
109293
109987
|
async function validateSetup(cwd2) {
|
|
109294
109988
|
const workDir = cwd2 ?? process.cwd();
|
|
@@ -109320,7 +110014,7 @@ Run this command from a directory with a GitHub remote.`);
|
|
|
109320
110014
|
} catch {
|
|
109321
110015
|
throw new Error(`Failed to parse repository info: ${ghRepo.stdout}`);
|
|
109322
110016
|
}
|
|
109323
|
-
const skillsPath = join152(
|
|
110017
|
+
const skillsPath = join152(homedir47(), ".claude", "skills");
|
|
109324
110018
|
const skillsAvailable = existsSync70(skillsPath);
|
|
109325
110019
|
if (!skillsAvailable) {
|
|
109326
110020
|
logger.warning(`ClaudeKit Engineer skills not found at ${skillsPath}`);
|
|
@@ -109619,27 +110313,27 @@ async function forceRemoveLock(watchLog) {
|
|
|
109619
110313
|
}
|
|
109620
110314
|
function printBanner(repos, interval, options2) {
|
|
109621
110315
|
console.log();
|
|
109622
|
-
console.log(
|
|
109623
|
-
console.log(
|
|
110316
|
+
console.log(import_picocolors41.default.bold(" ClaudeKit Watch"));
|
|
110317
|
+
console.log(import_picocolors41.default.dim(" ─────────────────────"));
|
|
109624
110318
|
if (repos.length === 1) {
|
|
109625
110319
|
const r2 = repos[0];
|
|
109626
110320
|
const queueInfo = formatQueueInfo(r2.state);
|
|
109627
|
-
console.log(` ${
|
|
109628
|
-
console.log(` ${
|
|
110321
|
+
console.log(` ${import_picocolors41.default.green("➜")} Repo: ${import_picocolors41.default.cyan(`${r2.setup.repoOwner}/${r2.setup.repoName}`)}`);
|
|
110322
|
+
console.log(` ${import_picocolors41.default.green("➜")} Queue: ${import_picocolors41.default.cyan(queueInfo)}`);
|
|
109629
110323
|
} else {
|
|
109630
|
-
console.log(` ${
|
|
110324
|
+
console.log(` ${import_picocolors41.default.green("➜")} Repos: ${import_picocolors41.default.cyan(String(repos.length))}`);
|
|
109631
110325
|
for (const r2 of repos) {
|
|
109632
110326
|
const queueInfo = formatQueueInfo(r2.state);
|
|
109633
|
-
console.log(` ${
|
|
110327
|
+
console.log(` ${import_picocolors41.default.dim("•")} ${import_picocolors41.default.cyan(`${r2.setup.repoOwner}/${r2.setup.repoName}`)} (${queueInfo})`);
|
|
109634
110328
|
}
|
|
109635
110329
|
}
|
|
109636
|
-
console.log(` ${
|
|
110330
|
+
console.log(` ${import_picocolors41.default.green("➜")} Poll: ${import_picocolors41.default.cyan(`${interval / 1000}s`)}`);
|
|
109637
110331
|
const skillsOk = repos.every((r2) => r2.setup.skillsAvailable);
|
|
109638
|
-
console.log(` ${
|
|
110332
|
+
console.log(` ${import_picocolors41.default.green("➜")} Skills: ${skillsOk ? import_picocolors41.default.green("available") : import_picocolors41.default.yellow("fallback mode")}`);
|
|
109639
110333
|
if (options2.dryRun) {
|
|
109640
|
-
console.log(` ${
|
|
110334
|
+
console.log(` ${import_picocolors41.default.yellow("➜")} Mode: ${import_picocolors41.default.yellow("DRY RUN (no responses posted)")}`);
|
|
109641
110335
|
}
|
|
109642
|
-
console.log(
|
|
110336
|
+
console.log(import_picocolors41.default.dim(" Press Ctrl+C to stop"));
|
|
109643
110337
|
console.log();
|
|
109644
110338
|
}
|
|
109645
110339
|
function formatQueueInfo(state) {
|
|
@@ -109650,7 +110344,7 @@ function formatQueueInfo(state) {
|
|
|
109650
110344
|
return "idle";
|
|
109651
110345
|
}
|
|
109652
110346
|
function sleep(ms) {
|
|
109653
|
-
return new Promise((
|
|
110347
|
+
return new Promise((resolve44) => setTimeout(resolve44, ms));
|
|
109654
110348
|
}
|
|
109655
110349
|
// src/cli/command-registry.ts
|
|
109656
110350
|
init_logger();
|
|
@@ -109974,7 +110668,7 @@ class CliVersionChecker {
|
|
|
109974
110668
|
}
|
|
109975
110669
|
// src/domains/versioning/checking/notification-display.ts
|
|
109976
110670
|
init_version_utils();
|
|
109977
|
-
var
|
|
110671
|
+
var import_picocolors44 = __toESM(require_picocolors(), 1);
|
|
109978
110672
|
function createNotificationBox2(borderColor, boxWidth) {
|
|
109979
110673
|
const contentWidth = boxWidth - 2;
|
|
109980
110674
|
const topBorder = borderColor(`╭${"─".repeat(contentWidth)}╮`);
|
|
@@ -109999,15 +110693,15 @@ function displayKitNotification(result, options2 = {}) {
|
|
|
109999
110693
|
const displayCurrent = normalizeVersion(currentVersion);
|
|
110000
110694
|
const displayLatest = normalizeVersion(latestVersion);
|
|
110001
110695
|
const boxWidth = 52;
|
|
110002
|
-
const { topBorder, bottomBorder, emptyLine, padLine } = createNotificationBox2(
|
|
110003
|
-
const headerText =
|
|
110696
|
+
const { topBorder, bottomBorder, emptyLine, padLine } = createNotificationBox2(import_picocolors44.default.cyan, boxWidth);
|
|
110697
|
+
const headerText = import_picocolors44.default.bold(import_picocolors44.default.yellow("⬆ Kit Update Available"));
|
|
110004
110698
|
const headerLen = "⬆ Kit Update Available".length;
|
|
110005
|
-
const kitText = kitName ? `Kit: ${
|
|
110699
|
+
const kitText = kitName ? `Kit: ${import_picocolors44.default.cyan(import_picocolors44.default.bold(kitName))}` : null;
|
|
110006
110700
|
const kitLen = kitName ? `Kit: ${kitName}`.length : 0;
|
|
110007
|
-
const versionText = `${
|
|
110701
|
+
const versionText = `${import_picocolors44.default.dim(displayCurrent)} ${import_picocolors44.default.white("→")} ${import_picocolors44.default.green(import_picocolors44.default.bold(displayLatest))}`;
|
|
110008
110702
|
const versionLen = displayCurrent.length + 3 + displayLatest.length;
|
|
110009
110703
|
const updateCmd = isGlobal ? "ck init -g" : "ck init";
|
|
110010
|
-
const commandText = `Run: ${
|
|
110704
|
+
const commandText = `Run: ${import_picocolors44.default.cyan(import_picocolors44.default.bold(updateCmd))}`;
|
|
110011
110705
|
const commandLen = `Run: ${updateCmd}`.length;
|
|
110012
110706
|
console.log("");
|
|
110013
110707
|
console.log(topBorder);
|
|
@@ -110028,12 +110722,12 @@ function displayCliNotification(result) {
|
|
|
110028
110722
|
return;
|
|
110029
110723
|
const { currentVersion, latestVersion } = result;
|
|
110030
110724
|
const boxWidth = 52;
|
|
110031
|
-
const { topBorder, bottomBorder, emptyLine, padLine } = createNotificationBox2(
|
|
110032
|
-
const headerText =
|
|
110725
|
+
const { topBorder, bottomBorder, emptyLine, padLine } = createNotificationBox2(import_picocolors44.default.magenta, boxWidth);
|
|
110726
|
+
const headerText = import_picocolors44.default.bold(import_picocolors44.default.yellow("⬆ CLI Update Available"));
|
|
110033
110727
|
const headerLen = "⬆ CLI Update Available".length;
|
|
110034
|
-
const versionText = `${
|
|
110728
|
+
const versionText = `${import_picocolors44.default.dim(currentVersion)} ${import_picocolors44.default.white("→")} ${import_picocolors44.default.green(import_picocolors44.default.bold(latestVersion))}`;
|
|
110035
110729
|
const versionLen = currentVersion.length + 3 + latestVersion.length;
|
|
110036
|
-
const commandText = `Run: ${
|
|
110730
|
+
const commandText = `Run: ${import_picocolors44.default.magenta(import_picocolors44.default.bold("ck update"))}`;
|
|
110037
110731
|
const commandLen = "Run: ck update".length;
|
|
110038
110732
|
console.log("");
|
|
110039
110733
|
console.log(topBorder);
|
|
@@ -110190,7 +110884,7 @@ function getPackageVersion2() {
|
|
|
110190
110884
|
|
|
110191
110885
|
// src/shared/logger.ts
|
|
110192
110886
|
init_output_manager();
|
|
110193
|
-
var
|
|
110887
|
+
var import_picocolors45 = __toESM(require_picocolors(), 1);
|
|
110194
110888
|
import { createWriteStream as createWriteStream5 } from "node:fs";
|
|
110195
110889
|
|
|
110196
110890
|
class Logger2 {
|
|
@@ -110199,23 +110893,23 @@ class Logger2 {
|
|
|
110199
110893
|
exitHandlerRegistered = false;
|
|
110200
110894
|
info(message) {
|
|
110201
110895
|
const symbols = output.getSymbols();
|
|
110202
|
-
console.log(
|
|
110896
|
+
console.log(import_picocolors45.default.blue(symbols.info), message);
|
|
110203
110897
|
}
|
|
110204
110898
|
success(message) {
|
|
110205
110899
|
const symbols = output.getSymbols();
|
|
110206
|
-
console.log(
|
|
110900
|
+
console.log(import_picocolors45.default.green(symbols.success), message);
|
|
110207
110901
|
}
|
|
110208
110902
|
warning(message) {
|
|
110209
110903
|
const symbols = output.getSymbols();
|
|
110210
|
-
console.log(
|
|
110904
|
+
console.log(import_picocolors45.default.yellow(symbols.warning), message);
|
|
110211
110905
|
}
|
|
110212
110906
|
error(message) {
|
|
110213
110907
|
const symbols = output.getSymbols();
|
|
110214
|
-
console.error(
|
|
110908
|
+
console.error(import_picocolors45.default.red(symbols.error), message);
|
|
110215
110909
|
}
|
|
110216
110910
|
debug(message) {
|
|
110217
110911
|
if (process.env.DEBUG) {
|
|
110218
|
-
console.log(
|
|
110912
|
+
console.log(import_picocolors45.default.gray("[DEBUG]"), message);
|
|
110219
110913
|
}
|
|
110220
110914
|
}
|
|
110221
110915
|
verbose(message, context) {
|
|
@@ -110224,7 +110918,7 @@ class Logger2 {
|
|
|
110224
110918
|
const timestamp = this.getTimestamp();
|
|
110225
110919
|
const sanitizedMessage = this.sanitize(message);
|
|
110226
110920
|
const formattedContext = context ? this.formatContext(context) : "";
|
|
110227
|
-
const logLine = `${timestamp} ${
|
|
110921
|
+
const logLine = `${timestamp} ${import_picocolors45.default.gray("[VERBOSE]")} ${sanitizedMessage}${formattedContext}`;
|
|
110228
110922
|
console.error(logLine);
|
|
110229
110923
|
if (this.logFileStream) {
|
|
110230
110924
|
const plainLogLine = `${timestamp} [VERBOSE] ${sanitizedMessage}${formattedContext}`;
|
|
@@ -110327,7 +111021,7 @@ var logger3 = new Logger2;
|
|
|
110327
111021
|
|
|
110328
111022
|
// src/shared/output-manager.ts
|
|
110329
111023
|
init_terminal_utils();
|
|
110330
|
-
var
|
|
111024
|
+
var import_picocolors46 = __toESM(require_picocolors(), 1);
|
|
110331
111025
|
var SYMBOLS2 = {
|
|
110332
111026
|
unicode: {
|
|
110333
111027
|
prompt: "◇",
|
|
@@ -110408,7 +111102,7 @@ class OutputManager2 {
|
|
|
110408
111102
|
if (this.config.quiet)
|
|
110409
111103
|
return;
|
|
110410
111104
|
const symbol = this.getSymbols().success;
|
|
110411
|
-
console.log(
|
|
111105
|
+
console.log(import_picocolors46.default.green(`${symbol} ${message}`));
|
|
110412
111106
|
}
|
|
110413
111107
|
error(message, data) {
|
|
110414
111108
|
if (this.config.json) {
|
|
@@ -110416,7 +111110,7 @@ class OutputManager2 {
|
|
|
110416
111110
|
return;
|
|
110417
111111
|
}
|
|
110418
111112
|
const symbol = this.getSymbols().error;
|
|
110419
|
-
console.error(
|
|
111113
|
+
console.error(import_picocolors46.default.red(`${symbol} ${message}`));
|
|
110420
111114
|
}
|
|
110421
111115
|
warning(message, data) {
|
|
110422
111116
|
if (this.config.json) {
|
|
@@ -110426,7 +111120,7 @@ class OutputManager2 {
|
|
|
110426
111120
|
if (this.config.quiet)
|
|
110427
111121
|
return;
|
|
110428
111122
|
const symbol = this.getSymbols().warning;
|
|
110429
|
-
console.log(
|
|
111123
|
+
console.log(import_picocolors46.default.yellow(`${symbol} ${message}`));
|
|
110430
111124
|
}
|
|
110431
111125
|
info(message, data) {
|
|
110432
111126
|
if (this.config.json) {
|
|
@@ -110436,7 +111130,7 @@ class OutputManager2 {
|
|
|
110436
111130
|
if (this.config.quiet)
|
|
110437
111131
|
return;
|
|
110438
111132
|
const symbol = this.getSymbols().info;
|
|
110439
|
-
console.log(
|
|
111133
|
+
console.log(import_picocolors46.default.blue(`${symbol} ${message}`));
|
|
110440
111134
|
}
|
|
110441
111135
|
verbose(message, data) {
|
|
110442
111136
|
if (!this.config.verbose)
|
|
@@ -110445,7 +111139,7 @@ class OutputManager2 {
|
|
|
110445
111139
|
this.addJsonEntry({ type: "info", message, data });
|
|
110446
111140
|
return;
|
|
110447
111141
|
}
|
|
110448
|
-
console.log(
|
|
111142
|
+
console.log(import_picocolors46.default.dim(` ${message}`));
|
|
110449
111143
|
}
|
|
110450
111144
|
indent(message) {
|
|
110451
111145
|
if (this.config.json)
|
|
@@ -110470,7 +111164,7 @@ class OutputManager2 {
|
|
|
110470
111164
|
return;
|
|
110471
111165
|
const symbols = this.getSymbols();
|
|
110472
111166
|
console.log();
|
|
110473
|
-
console.log(
|
|
111167
|
+
console.log(import_picocolors46.default.bold(import_picocolors46.default.cyan(`${symbols.line} ${title}`)));
|
|
110474
111168
|
}
|
|
110475
111169
|
addJsonEntry(entry) {
|
|
110476
111170
|
this.jsonBuffer.push({
|