prjct-cli 1.2.0 → 1.2.2
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/CHANGELOG.md +81 -0
- package/bin/prjct.ts +25 -31
- package/core/agentic/ground-truth.ts +5 -3
- package/core/cli/start.ts +45 -59
- package/core/index.ts +20 -24
- package/core/infrastructure/setup.ts +29 -32
- package/core/schemas/ideas.ts +1 -1
- package/core/services/hooks-service.ts +3 -4
- package/core/utils/help.ts +42 -45
- package/core/utils/subtask-table.ts +27 -34
- package/core/workflow/workflow-preferences.ts +11 -17
- package/dist/bin/prjct.mjs +408 -439
- package/dist/core/infrastructure/setup.js +29 -30
- package/package.json +1 -1
package/dist/bin/prjct.mjs
CHANGED
|
@@ -2550,6 +2550,7 @@ __export(start_exports, {
|
|
|
2550
2550
|
import fs9 from "node:fs";
|
|
2551
2551
|
import os4 from "node:os";
|
|
2552
2552
|
import path9 from "node:path";
|
|
2553
|
+
import chalk3 from "chalk";
|
|
2553
2554
|
function showBanner() {
|
|
2554
2555
|
console.clear();
|
|
2555
2556
|
console.log(BANNER);
|
|
@@ -2557,15 +2558,15 @@ function showBanner() {
|
|
|
2557
2558
|
}
|
|
2558
2559
|
function showProviderSelection(options, currentIndex) {
|
|
2559
2560
|
console.log(`
|
|
2560
|
-
${
|
|
2561
|
+
${chalk3.bold(" Select AI providers to configure:")}
|
|
2561
2562
|
`);
|
|
2562
|
-
console.log(` ${
|
|
2563
|
+
console.log(` ${chalk3.dim("(Use arrow keys to navigate, space to toggle, enter to confirm)")}
|
|
2563
2564
|
`);
|
|
2564
2565
|
options.forEach((option, index) => {
|
|
2565
|
-
const cursor = index === currentIndex ?
|
|
2566
|
-
const checkbox = option.selected ?
|
|
2567
|
-
const status = option.installed ?
|
|
2568
|
-
const name = index === currentIndex ?
|
|
2566
|
+
const cursor = index === currentIndex ? chalk3.cyan("\u276F") : " ";
|
|
2567
|
+
const checkbox = option.selected ? chalk3.green("[\u2713]") : chalk3.dim("[ ]");
|
|
2568
|
+
const status = option.installed ? chalk3.green("(installed)") : chalk3.yellow("(will install)");
|
|
2569
|
+
const name = index === currentIndex ? chalk3.bold(option.displayName) : option.displayName;
|
|
2569
2570
|
console.log(` ${cursor} ${checkbox} ${name} ${status}`);
|
|
2570
2571
|
});
|
|
2571
2572
|
console.log("");
|
|
@@ -2591,11 +2592,11 @@ async function selectProviders() {
|
|
|
2591
2592
|
}
|
|
2592
2593
|
if (!process.stdin.isTTY) {
|
|
2593
2594
|
console.log(`
|
|
2594
|
-
${
|
|
2595
|
+
${chalk3.bold(" Detected providers:")}
|
|
2595
2596
|
`);
|
|
2596
2597
|
options.forEach((option) => {
|
|
2597
2598
|
if (option.installed) {
|
|
2598
|
-
console.log(` ${
|
|
2599
|
+
console.log(` ${chalk3.green("\u2713")} ${option.displayName}`);
|
|
2599
2600
|
}
|
|
2600
2601
|
});
|
|
2601
2602
|
console.log("");
|
|
@@ -2665,7 +2666,7 @@ async function installRouter(provider) {
|
|
|
2665
2666
|
return false;
|
|
2666
2667
|
} catch (error) {
|
|
2667
2668
|
console.error(
|
|
2668
|
-
` ${
|
|
2669
|
+
` ${chalk3.yellow("\u26A0")} Failed to install ${provider} router: ${error.message}`
|
|
2669
2670
|
);
|
|
2670
2671
|
return false;
|
|
2671
2672
|
}
|
|
@@ -2709,7 +2710,7 @@ ${content}`);
|
|
|
2709
2710
|
return false;
|
|
2710
2711
|
} catch (error) {
|
|
2711
2712
|
console.error(
|
|
2712
|
-
` ${
|
|
2713
|
+
` ${chalk3.yellow("\u26A0")} Failed to install ${provider} config: ${error.message}`
|
|
2713
2714
|
);
|
|
2714
2715
|
return false;
|
|
2715
2716
|
}
|
|
@@ -2731,26 +2732,26 @@ async function saveSetupConfig(providers) {
|
|
|
2731
2732
|
}
|
|
2732
2733
|
function showCompletion(providers) {
|
|
2733
2734
|
console.log(`
|
|
2734
|
-
${
|
|
2735
|
+
${chalk3.green.bold(" \u2713 Setup complete!")}
|
|
2735
2736
|
`);
|
|
2736
|
-
console.log(` ${
|
|
2737
|
+
console.log(` ${chalk3.dim("Configured providers:")}`);
|
|
2737
2738
|
providers.forEach((p) => {
|
|
2738
2739
|
const config = Providers[p];
|
|
2739
|
-
console.log(` ${
|
|
2740
|
+
console.log(` ${chalk3.green("\u2713")} ${config.displayName}`);
|
|
2740
2741
|
});
|
|
2741
2742
|
console.log(`
|
|
2742
|
-
${
|
|
2743
|
+
${chalk3.bold("Next steps:")}
|
|
2743
2744
|
|
|
2744
|
-
${
|
|
2745
|
-
${
|
|
2746
|
-
${
|
|
2745
|
+
${chalk3.cyan("1.")} Navigate to your project directory
|
|
2746
|
+
${chalk3.cyan("2.")} Run ${chalk3.bold("p. init")} to initialize prjct for that project
|
|
2747
|
+
${chalk3.cyan("3.")} Start tracking with ${chalk3.bold('p. task "your task"')}
|
|
2747
2748
|
|
|
2748
|
-
${
|
|
2749
|
-
${
|
|
2750
|
-
${
|
|
2751
|
-
${
|
|
2749
|
+
${chalk3.dim("Tips:")}
|
|
2750
|
+
${chalk3.dim("\u2022")} Use ${chalk3.bold("p. sync")} to analyze your codebase
|
|
2751
|
+
${chalk3.dim("\u2022")} Use ${chalk3.bold("p. done")} to complete tasks
|
|
2752
|
+
${chalk3.dim("\u2022")} Use ${chalk3.bold("p. ship")} to create PRs
|
|
2752
2753
|
|
|
2753
|
-
${
|
|
2754
|
+
${chalk3.dim("Learn more: https://prjct.app/docs")}
|
|
2754
2755
|
`);
|
|
2755
2756
|
}
|
|
2756
2757
|
async function runStart() {
|
|
@@ -2759,8 +2760,8 @@ async function runStart() {
|
|
|
2759
2760
|
if (fs9.existsSync(configPath)) {
|
|
2760
2761
|
const existing = JSON.parse(fs9.readFileSync(configPath, "utf-8"));
|
|
2761
2762
|
if (existing.version === VERSION) {
|
|
2762
|
-
console.log(` ${
|
|
2763
|
-
console.log(` ${
|
|
2763
|
+
console.log(` ${chalk3.yellow("\u2139")} Already configured for v${VERSION}`);
|
|
2764
|
+
console.log(` ${chalk3.dim("Run with --force to reconfigure")}
|
|
2764
2765
|
`);
|
|
2765
2766
|
if (!process.argv.includes("--force")) {
|
|
2766
2767
|
return;
|
|
@@ -2769,57 +2770,50 @@ async function runStart() {
|
|
|
2769
2770
|
}
|
|
2770
2771
|
const selectedProviders = await selectProviders();
|
|
2771
2772
|
console.log(`
|
|
2772
|
-
${
|
|
2773
|
+
${chalk3.cyan("Setting up...")}
|
|
2773
2774
|
`);
|
|
2774
2775
|
for (const provider of selectedProviders) {
|
|
2775
2776
|
const config = Providers[provider];
|
|
2776
|
-
process.stdout.write(` ${
|
|
2777
|
+
process.stdout.write(` ${chalk3.dim("\u2022")} ${config.displayName}... `);
|
|
2777
2778
|
const routerOk = await installRouter(provider);
|
|
2778
2779
|
const configOk = await installGlobalConfig(provider);
|
|
2779
2780
|
if (routerOk && configOk) {
|
|
2780
|
-
console.log(
|
|
2781
|
+
console.log(chalk3.green("\u2713"));
|
|
2781
2782
|
} else if (routerOk || configOk) {
|
|
2782
|
-
console.log(
|
|
2783
|
+
console.log(chalk3.yellow("partial"));
|
|
2783
2784
|
} else {
|
|
2784
|
-
console.log(
|
|
2785
|
+
console.log(chalk3.yellow("skipped"));
|
|
2785
2786
|
}
|
|
2786
2787
|
}
|
|
2787
2788
|
await saveSetupConfig(selectedProviders);
|
|
2788
2789
|
showCompletion(selectedProviders);
|
|
2789
2790
|
}
|
|
2790
|
-
var
|
|
2791
|
+
var G1, G2, G3, G4, G5, BANNER, WELCOME_BOX, start_default;
|
|
2791
2792
|
var init_start = __esm({
|
|
2792
2793
|
"core/cli/start.ts"() {
|
|
2793
2794
|
"use strict";
|
|
2794
2795
|
init_ai_provider();
|
|
2795
2796
|
init_version();
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
CYAN = "\x1B[36m";
|
|
2802
|
-
WHITE = "\x1B[37m";
|
|
2803
|
-
G1 = "\x1B[38;2;0;255;255m";
|
|
2804
|
-
G2 = "\x1B[38;2;80;180;255m";
|
|
2805
|
-
G3 = "\x1B[38;2;140;120;255m";
|
|
2806
|
-
G4 = "\x1B[38;2;200;80;220m";
|
|
2807
|
-
G5 = "\x1B[38;2;255;80;180m";
|
|
2797
|
+
G1 = chalk3.rgb(0, 255, 255);
|
|
2798
|
+
G2 = chalk3.rgb(80, 180, 255);
|
|
2799
|
+
G3 = chalk3.rgb(140, 120, 255);
|
|
2800
|
+
G4 = chalk3.rgb(200, 80, 220);
|
|
2801
|
+
G5 = chalk3.rgb(255, 80, 180);
|
|
2808
2802
|
BANNER = `
|
|
2809
2803
|
|
|
2810
|
-
${G1
|
|
2811
|
-
${G1
|
|
2812
|
-
${G1
|
|
2813
|
-
${G1
|
|
2814
|
-
${G1
|
|
2815
|
-
${G1
|
|
2804
|
+
${G1(" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ")}${G2(" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ")}${G3(" \u2588\u2588\u2557")}${G4(" \u2588\u2588\u2588\u2588\u2588\u2588\u2557")}${G5("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}
|
|
2805
|
+
${G1(" \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557")}${G2(" \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557")}${G3(" \u2588\u2588\u2551")}${G4("\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D")}${G5("\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D")}
|
|
2806
|
+
${G1(" \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D")}${G2(" \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D")}${G3(" \u2588\u2588\u2551")}${G4("\u2588\u2588\u2551 ")}${G5(" \u2588\u2588\u2551 ")}
|
|
2807
|
+
${G1(" \u2588\u2588\u2554\u2550\u2550\u2550\u255D ")}${G2(" \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557")}${G3("\u2588\u2588 \u2588\u2588\u2551")}${G4("\u2588\u2588\u2551 ")}${G5(" \u2588\u2588\u2551 ")}
|
|
2808
|
+
${G1(" \u2588\u2588\u2551 ")}${G2(" \u2588\u2588\u2551 \u2588\u2588\u2551")}${G3("\u255A\u2588\u2588\u2588\u2588\u2588\u2554\u255D")}${G4("\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}${G5(" \u2588\u2588\u2551 ")}
|
|
2809
|
+
${G1(" \u255A\u2550\u255D ")}${G2(" \u255A\u2550\u255D \u255A\u2550\u255D")}${G3(" \u255A\u2550\u2550\u2550\u2550\u255D ")}${G4(" \u255A\u2550\u2550\u2550\u2550\u2550\u255D")}${G5(" \u255A\u2550\u255D ")}
|
|
2816
2810
|
|
|
2817
2811
|
`;
|
|
2818
|
-
WELCOME_BOX = ` ${
|
|
2812
|
+
WELCOME_BOX = ` ${chalk3.white("Context Layer for AI Agents")} ${chalk3.dim(`v${VERSION}`)}
|
|
2819
2813
|
|
|
2820
|
-
${
|
|
2821
|
-
Works with Claude Code, Gemini CLI, and more
|
|
2822
|
-
${
|
|
2814
|
+
${chalk3.dim(`Project context layer for AI coding agents.
|
|
2815
|
+
Works with Claude Code, Gemini CLI, and more.`)}
|
|
2816
|
+
${chalk3.cyan("https://prjct.app")}
|
|
2823
2817
|
`;
|
|
2824
2818
|
__name(showBanner, "showBanner");
|
|
2825
2819
|
__name(showProviderSelection, "showProviderSelection");
|
|
@@ -5449,7 +5443,7 @@ __export(hooks_service_exports, {
|
|
|
5449
5443
|
});
|
|
5450
5444
|
import fs15 from "node:fs";
|
|
5451
5445
|
import path15 from "node:path";
|
|
5452
|
-
import
|
|
5446
|
+
import chalk4 from "chalk";
|
|
5453
5447
|
function getPostCommitScript() {
|
|
5454
5448
|
return `#!/bin/sh
|
|
5455
5449
|
# prjct auto-sync hook (post-commit)
|
|
@@ -5555,7 +5549,8 @@ ${sectionName}:
|
|
|
5555
5549
|
fail_text: "prjct sync failed (non-blocking)"`
|
|
5556
5550
|
);
|
|
5557
5551
|
} else {
|
|
5558
|
-
content = content.trimEnd()
|
|
5552
|
+
content = `${content.trimEnd()}
|
|
5553
|
+
${hookBlock}`;
|
|
5559
5554
|
}
|
|
5560
5555
|
}
|
|
5561
5556
|
fs15.writeFileSync(configPath, content, "utf-8");
|
|
@@ -5591,7 +5586,9 @@ function installDirect(projectPath, hooks) {
|
|
|
5591
5586
|
if (existing.includes("prjct sync")) {
|
|
5592
5587
|
continue;
|
|
5593
5588
|
}
|
|
5594
|
-
fs15.appendFileSync(hookPath,
|
|
5589
|
+
fs15.appendFileSync(hookPath, `
|
|
5590
|
+
# prjct auto-sync
|
|
5591
|
+
${script.split("\n").slice(1).join("\n")}`);
|
|
5595
5592
|
} else {
|
|
5596
5593
|
fs15.writeFileSync(hookPath, script, { mode: 493 });
|
|
5597
5594
|
}
|
|
@@ -5605,7 +5602,8 @@ function uninstallLefthook(projectPath) {
|
|
|
5605
5602
|
let content = fs15.readFileSync(configPath, "utf-8");
|
|
5606
5603
|
content = content.replace(/\s*prjct-sync-[\w-]+:[\s\S]*?(?=\n\S|\n*$)/g, "");
|
|
5607
5604
|
content = content.replace(/^(post-commit|post-checkout):\s*commands:\s*$/gm, "");
|
|
5608
|
-
fs15.writeFileSync(configPath, content.trimEnd()
|
|
5605
|
+
fs15.writeFileSync(configPath, `${content.trimEnd()}
|
|
5606
|
+
`, "utf-8");
|
|
5609
5607
|
return true;
|
|
5610
5608
|
}
|
|
5611
5609
|
function uninstallHusky(projectPath) {
|
|
@@ -5788,19 +5786,19 @@ var init_hooks_service = __esm({
|
|
|
5788
5786
|
output_default.section("Git Hooks Installation");
|
|
5789
5787
|
const detected = detectHookManagers(projectPath);
|
|
5790
5788
|
const strategy = selectStrategy(detected);
|
|
5791
|
-
console.log(` Strategy: ${
|
|
5792
|
-
console.log(` Hooks: ${
|
|
5789
|
+
console.log(` Strategy: ${chalk4.cyan(strategy)}`);
|
|
5790
|
+
console.log(` Hooks: ${chalk4.dim("post-commit, post-checkout")}`);
|
|
5793
5791
|
console.log("");
|
|
5794
5792
|
const result = await this.install(projectPath, { strategy });
|
|
5795
5793
|
if (result.success) {
|
|
5796
5794
|
output_default.done(`Hooks installed via ${result.strategy}`);
|
|
5797
5795
|
console.log("");
|
|
5798
5796
|
for (const hook of result.hooksInstalled) {
|
|
5799
|
-
console.log(` ${
|
|
5797
|
+
console.log(` ${chalk4.green("\u2713")} ${hook}`);
|
|
5800
5798
|
}
|
|
5801
5799
|
console.log("");
|
|
5802
|
-
console.log(
|
|
5803
|
-
console.log(
|
|
5800
|
+
console.log(chalk4.dim(" Context will auto-sync on commit and branch switch."));
|
|
5801
|
+
console.log(chalk4.dim(" Remove with: prjct hooks uninstall"));
|
|
5804
5802
|
} else {
|
|
5805
5803
|
output_default.fail(result.error || "Failed to install hooks");
|
|
5806
5804
|
}
|
|
@@ -5826,24 +5824,24 @@ var init_hooks_service = __esm({
|
|
|
5826
5824
|
output_default.section("Git Hooks Status");
|
|
5827
5825
|
const status = await this.status(projectPath);
|
|
5828
5826
|
if (status.installed) {
|
|
5829
|
-
console.log(` Status: ${
|
|
5830
|
-
console.log(` Strategy: ${
|
|
5827
|
+
console.log(` Status: ${chalk4.green("Active")}`);
|
|
5828
|
+
console.log(` Strategy: ${chalk4.cyan(status.strategy)}`);
|
|
5831
5829
|
} else {
|
|
5832
|
-
console.log(` Status: ${
|
|
5830
|
+
console.log(` Status: ${chalk4.dim("Not installed")}`);
|
|
5833
5831
|
}
|
|
5834
5832
|
console.log("");
|
|
5835
5833
|
for (const hook of status.hooks) {
|
|
5836
|
-
const icon = hook.installed ?
|
|
5837
|
-
const label = hook.installed ? hook.name :
|
|
5834
|
+
const icon = hook.installed ? chalk4.green("\u2713") : chalk4.dim("\u25CB");
|
|
5835
|
+
const label = hook.installed ? hook.name : chalk4.dim(hook.name);
|
|
5838
5836
|
console.log(` ${icon} ${label}`);
|
|
5839
5837
|
}
|
|
5840
5838
|
if (status.detectedManagers.length > 0) {
|
|
5841
5839
|
console.log("");
|
|
5842
|
-
console.log(` ${
|
|
5840
|
+
console.log(` ${chalk4.dim("Available managers:")} ${status.detectedManagers.join(", ")}`);
|
|
5843
5841
|
}
|
|
5844
5842
|
if (!status.installed) {
|
|
5845
5843
|
console.log("");
|
|
5846
|
-
console.log(
|
|
5844
|
+
console.log(chalk4.dim(" Install with: prjct hooks install"));
|
|
5847
5845
|
}
|
|
5848
5846
|
console.log("");
|
|
5849
5847
|
output_default.end();
|
|
@@ -5929,7 +5927,7 @@ __export(doctor_service_exports, {
|
|
|
5929
5927
|
import { execSync as execSync2 } from "node:child_process";
|
|
5930
5928
|
import fs16 from "node:fs/promises";
|
|
5931
5929
|
import path16 from "node:path";
|
|
5932
|
-
import
|
|
5930
|
+
import chalk5 from "chalk";
|
|
5933
5931
|
var DoctorService, doctorService;
|
|
5934
5932
|
var init_doctor_service = __esm({
|
|
5935
5933
|
"core/services/doctor-service.ts"() {
|
|
@@ -6199,8 +6197,8 @@ var init_doctor_service = __esm({
|
|
|
6199
6197
|
const icon = this.getStatusIcon(check.status, check.optional);
|
|
6200
6198
|
const name = check.name.padEnd(14);
|
|
6201
6199
|
const detail = check.version || check.message || "";
|
|
6202
|
-
const optionalTag = check.optional && check.status === "error" ?
|
|
6203
|
-
return `${icon} ${name} ${
|
|
6200
|
+
const optionalTag = check.optional && check.status === "error" ? chalk5.dim(" (optional)") : "";
|
|
6201
|
+
return `${icon} ${name} ${chalk5.dim(detail)}${optionalTag}`;
|
|
6204
6202
|
});
|
|
6205
6203
|
for (const item of items) {
|
|
6206
6204
|
console.log(` ${item}`);
|
|
@@ -6208,11 +6206,11 @@ var init_doctor_service = __esm({
|
|
|
6208
6206
|
}
|
|
6209
6207
|
printRecommendations(recommendations) {
|
|
6210
6208
|
output_default.section("Recommendations");
|
|
6211
|
-
output_default.list(recommendations, { bullet:
|
|
6209
|
+
output_default.list(recommendations, { bullet: chalk5.yellow("\u2022") });
|
|
6212
6210
|
}
|
|
6213
6211
|
printSummary(result) {
|
|
6214
6212
|
console.log("");
|
|
6215
|
-
console.log(
|
|
6213
|
+
console.log(chalk5.dim("\u2500".repeat(40)));
|
|
6216
6214
|
if (result.hasErrors) {
|
|
6217
6215
|
output_default.fail("Some required checks failed");
|
|
6218
6216
|
} else if (result.hasWarnings) {
|
|
@@ -6225,11 +6223,11 @@ var init_doctor_service = __esm({
|
|
|
6225
6223
|
getStatusIcon(status, optional) {
|
|
6226
6224
|
switch (status) {
|
|
6227
6225
|
case "ok":
|
|
6228
|
-
return
|
|
6226
|
+
return chalk5.green("\u2713");
|
|
6229
6227
|
case "warn":
|
|
6230
|
-
return
|
|
6228
|
+
return chalk5.yellow("\u26A0");
|
|
6231
6229
|
case "error":
|
|
6232
|
-
return optional ?
|
|
6230
|
+
return optional ? chalk5.dim("\u25CB") : chalk5.red("\u2717");
|
|
6233
6231
|
}
|
|
6234
6232
|
}
|
|
6235
6233
|
};
|
|
@@ -6775,7 +6773,7 @@ var init_command_installer = __esm({
|
|
|
6775
6773
|
});
|
|
6776
6774
|
|
|
6777
6775
|
// core/utils/agent-stream.ts
|
|
6778
|
-
import
|
|
6776
|
+
import chalk6 from "chalk";
|
|
6779
6777
|
function getIcon(domain) {
|
|
6780
6778
|
return DOMAIN_ICONS[domain.toLowerCase()] || DOMAIN_ICONS.default;
|
|
6781
6779
|
}
|
|
@@ -6814,7 +6812,7 @@ var init_agent_stream = __esm({
|
|
|
6814
6812
|
*/
|
|
6815
6813
|
orchestrate(domains) {
|
|
6816
6814
|
if (this.quiet) return;
|
|
6817
|
-
console.log(
|
|
6815
|
+
console.log(chalk6.cyan(`
|
|
6818
6816
|
\u{1F3AF} Orchestrating: ${domains.join(", ")} domains detected
|
|
6819
6817
|
`));
|
|
6820
6818
|
}
|
|
@@ -6826,9 +6824,9 @@ var init_agent_stream = __esm({
|
|
|
6826
6824
|
this.currentAgent = name;
|
|
6827
6825
|
this.startTime = Date.now();
|
|
6828
6826
|
const icon = getIcon(domain);
|
|
6829
|
-
console.log(
|
|
6827
|
+
console.log(chalk6.cyan(`\u250C\u2500 ${icon} ${name} (${domain})`));
|
|
6830
6828
|
if (description) {
|
|
6831
|
-
console.log(
|
|
6829
|
+
console.log(chalk6.dim(`\u2502 ${description}`));
|
|
6832
6830
|
}
|
|
6833
6831
|
}
|
|
6834
6832
|
/**
|
|
@@ -6836,7 +6834,7 @@ var init_agent_stream = __esm({
|
|
|
6836
6834
|
*/
|
|
6837
6835
|
progress(message) {
|
|
6838
6836
|
if (this.quiet || !this.currentAgent) return;
|
|
6839
|
-
console.log(
|
|
6837
|
+
console.log(chalk6.dim(`\u2502 \u2514\u2500\u2500 ${message}`));
|
|
6840
6838
|
}
|
|
6841
6839
|
/**
|
|
6842
6840
|
* Show multiple progress items
|
|
@@ -6844,7 +6842,7 @@ var init_agent_stream = __esm({
|
|
|
6844
6842
|
progressList(items) {
|
|
6845
6843
|
if (this.quiet || !this.currentAgent) return;
|
|
6846
6844
|
for (const item of items) {
|
|
6847
|
-
console.log(
|
|
6845
|
+
console.log(chalk6.dim(`\u2502 \u2514\u2500\u2500 ${item}`));
|
|
6848
6846
|
}
|
|
6849
6847
|
}
|
|
6850
6848
|
/**
|
|
@@ -6854,9 +6852,9 @@ var init_agent_stream = __esm({
|
|
|
6854
6852
|
if (this.quiet || !this.currentAgent) return;
|
|
6855
6853
|
const duration = Date.now() - this.startTime;
|
|
6856
6854
|
const durationStr = this.formatDuration(duration);
|
|
6857
|
-
const icon = success ?
|
|
6855
|
+
const icon = success ? chalk6.green("\u2713") : chalk6.red("\u2717");
|
|
6858
6856
|
const status = success ? "Complete" : "Failed";
|
|
6859
|
-
console.log(`\u2514\u2500 ${icon} ${status} ${
|
|
6857
|
+
console.log(`\u2514\u2500 ${icon} ${status} ${chalk6.dim(`(${durationStr})`)}
|
|
6860
6858
|
`);
|
|
6861
6859
|
this.currentAgent = null;
|
|
6862
6860
|
}
|
|
@@ -6872,8 +6870,8 @@ var init_agent_stream = __esm({
|
|
|
6872
6870
|
*/
|
|
6873
6871
|
complete(taskName, totalDuration) {
|
|
6874
6872
|
if (this.quiet) return;
|
|
6875
|
-
const durationStr = totalDuration ? ` ${
|
|
6876
|
-
console.log(
|
|
6873
|
+
const durationStr = totalDuration ? ` ${chalk6.dim(`[${this.formatDuration(totalDuration)}]`)}` : "";
|
|
6874
|
+
console.log(chalk6.green(`\u2705 ${taskName}${durationStr}`));
|
|
6877
6875
|
}
|
|
6878
6876
|
/**
|
|
6879
6877
|
* Format duration in human-readable form
|
|
@@ -6889,6 +6887,7 @@ var init_agent_stream = __esm({
|
|
|
6889
6887
|
});
|
|
6890
6888
|
|
|
6891
6889
|
// core/utils/subtask-table.ts
|
|
6890
|
+
import chalk7 from "chalk";
|
|
6892
6891
|
function getDomainColor(domain) {
|
|
6893
6892
|
let hash = 0;
|
|
6894
6893
|
for (const char of domain) {
|
|
@@ -6899,29 +6898,29 @@ function getDomainColor(domain) {
|
|
|
6899
6898
|
return DOMAIN_COLOR_PALETTE[index];
|
|
6900
6899
|
}
|
|
6901
6900
|
function formatSubtaskLine(index, subtask, spinnerFrame = "\u25B6") {
|
|
6902
|
-
const num =
|
|
6903
|
-
const
|
|
6904
|
-
const domain =
|
|
6901
|
+
const num = chalk7.dim(String(index + 1).padStart(2));
|
|
6902
|
+
const domainColorFn = getDomainColor(subtask.domain);
|
|
6903
|
+
const domain = domainColorFn(subtask.domain.padEnd(10));
|
|
6905
6904
|
const desc = subtask.description.length > 32 ? `${subtask.description.slice(0, 29)}...` : subtask.description.padEnd(32);
|
|
6906
6905
|
let status;
|
|
6907
6906
|
switch (subtask.status) {
|
|
6908
6907
|
case "completed":
|
|
6909
|
-
status =
|
|
6908
|
+
status = chalk7.green("\u2713 Complete");
|
|
6910
6909
|
break;
|
|
6911
6910
|
case "in_progress":
|
|
6912
|
-
status = `${
|
|
6911
|
+
status = chalk7.yellow(`${spinnerFrame} Working...`);
|
|
6913
6912
|
break;
|
|
6914
6913
|
case "pending":
|
|
6915
|
-
status =
|
|
6914
|
+
status = chalk7.gray("\u25CB Pending");
|
|
6916
6915
|
break;
|
|
6917
6916
|
case "failed":
|
|
6918
|
-
status =
|
|
6917
|
+
status = chalk7.red("\u2717 Failed");
|
|
6919
6918
|
break;
|
|
6920
6919
|
case "blocked":
|
|
6921
|
-
status =
|
|
6920
|
+
status = chalk7.gray("\u2298 Blocked");
|
|
6922
6921
|
break;
|
|
6923
6922
|
default:
|
|
6924
|
-
status =
|
|
6923
|
+
status = chalk7.gray(`\u25CB ${subtask.status}`);
|
|
6925
6924
|
}
|
|
6926
6925
|
return ` ${num} ${domain} ${desc} ${status}`;
|
|
6927
6926
|
}
|
|
@@ -6929,8 +6928,8 @@ function renderSubtaskProgress(subtasks) {
|
|
|
6929
6928
|
if (subtasks.length === 0) return "";
|
|
6930
6929
|
const lines = [];
|
|
6931
6930
|
lines.push("");
|
|
6932
|
-
lines.push(` ${
|
|
6933
|
-
lines.push(` ${
|
|
6931
|
+
lines.push(` ${chalk7.bold.white("SUBTASK PROGRESS")}`);
|
|
6932
|
+
lines.push(` ${chalk7.dim("\u2500".repeat(58))}`);
|
|
6934
6933
|
for (let i = 0; i < subtasks.length; i++) {
|
|
6935
6934
|
lines.push(formatSubtaskLine(i, subtasks[i]));
|
|
6936
6935
|
}
|
|
@@ -6940,34 +6939,19 @@ function renderSubtaskProgress(subtasks) {
|
|
|
6940
6939
|
function printSubtaskProgress(subtasks) {
|
|
6941
6940
|
console.log(renderSubtaskProgress(subtasks));
|
|
6942
6941
|
}
|
|
6943
|
-
var
|
|
6942
|
+
var DOMAIN_COLOR_PALETTE;
|
|
6944
6943
|
var init_subtask_table = __esm({
|
|
6945
6944
|
"core/utils/subtask-table.ts"() {
|
|
6946
6945
|
"use strict";
|
|
6947
|
-
RESET2 = "\x1B[0m";
|
|
6948
|
-
BOLD2 = "\x1B[1m";
|
|
6949
|
-
DIM2 = "\x1B[2m";
|
|
6950
|
-
GREEN2 = "\x1B[32m";
|
|
6951
|
-
YELLOW2 = "\x1B[33m";
|
|
6952
|
-
WHITE2 = "\x1B[37m";
|
|
6953
|
-
GRAY = "\x1B[90m";
|
|
6954
6946
|
DOMAIN_COLOR_PALETTE = [
|
|
6955
|
-
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
"\x1B[32m",
|
|
6964
|
-
// Green
|
|
6965
|
-
"\x1B[91m",
|
|
6966
|
-
// Light Red
|
|
6967
|
-
"\x1B[95m",
|
|
6968
|
-
// Light Magenta
|
|
6969
|
-
"\x1B[96m"
|
|
6970
|
-
// Light Cyan
|
|
6947
|
+
chalk7.cyan,
|
|
6948
|
+
chalk7.magenta,
|
|
6949
|
+
chalk7.yellow,
|
|
6950
|
+
chalk7.blue,
|
|
6951
|
+
chalk7.green,
|
|
6952
|
+
chalk7.redBright,
|
|
6953
|
+
chalk7.magentaBright,
|
|
6954
|
+
chalk7.cyanBright
|
|
6971
6955
|
];
|
|
6972
6956
|
__name(getDomainColor, "getDomainColor");
|
|
6973
6957
|
__name(formatSubtaskLine, "formatSubtaskLine");
|
|
@@ -7372,10 +7356,11 @@ var init_context_builder = __esm({
|
|
|
7372
7356
|
});
|
|
7373
7357
|
|
|
7374
7358
|
// core/agentic/ground-truth.ts
|
|
7375
|
-
import {
|
|
7359
|
+
import { exec as exec5 } from "node:child_process";
|
|
7376
7360
|
import fs19 from "node:fs/promises";
|
|
7377
7361
|
import os6 from "node:os";
|
|
7378
7362
|
import path18 from "node:path";
|
|
7363
|
+
import { promisify as promisify5 } from "node:util";
|
|
7379
7364
|
function formatDuration2(ms) {
|
|
7380
7365
|
const hours = Math.floor(ms / (1e3 * 60 * 60));
|
|
7381
7366
|
const minutes = Math.floor(ms % (1e3 * 60 * 60) / (1e3 * 60));
|
|
@@ -7475,9 +7460,8 @@ async function verifyShip(context2) {
|
|
|
7475
7460
|
const recommendations = [];
|
|
7476
7461
|
const actual = {};
|
|
7477
7462
|
try {
|
|
7478
|
-
const gitStatus =
|
|
7479
|
-
cwd: context2.projectPath
|
|
7480
|
-
encoding: "utf-8"
|
|
7463
|
+
const { stdout: gitStatus } = await execAsync("git status --porcelain", {
|
|
7464
|
+
cwd: context2.projectPath
|
|
7481
7465
|
});
|
|
7482
7466
|
actual.hasUncommittedChanges = gitStatus.trim().length > 0;
|
|
7483
7467
|
actual.uncommittedFiles = gitStatus.trim().split("\n").filter(Boolean).length;
|
|
@@ -7859,11 +7843,12 @@ async function prepareCommand(commandName, context2, state) {
|
|
|
7859
7843
|
function requiresVerification(commandName) {
|
|
7860
7844
|
return ["done", "ship", "feature", "spec", "now", "init", "sync", "analyze"].includes(commandName);
|
|
7861
7845
|
}
|
|
7862
|
-
var verifiers, ground_truth_default;
|
|
7846
|
+
var execAsync, verifiers, ground_truth_default;
|
|
7863
7847
|
var init_ground_truth = __esm({
|
|
7864
7848
|
"core/agentic/ground-truth.ts"() {
|
|
7865
7849
|
"use strict";
|
|
7866
7850
|
init_fs();
|
|
7851
|
+
execAsync = promisify5(exec5);
|
|
7867
7852
|
__name(formatDuration2, "formatDuration");
|
|
7868
7853
|
__name(escapeRegex, "escapeRegex");
|
|
7869
7854
|
__name(formatWarnings, "formatWarnings");
|
|
@@ -8270,7 +8255,7 @@ var init_ideas = __esm({
|
|
|
8270
8255
|
name: z3.string(),
|
|
8271
8256
|
// "Multi-tenant"
|
|
8272
8257
|
description: z3.string()
|
|
8273
|
-
// "
|
|
8258
|
+
// "Strict RLS for organizations"
|
|
8274
8259
|
});
|
|
8275
8260
|
IdeaRoleSchema = z3.object({
|
|
8276
8261
|
name: z3.string(),
|
|
@@ -14163,14 +14148,14 @@ When fragmenting tasks:
|
|
|
14163
14148
|
});
|
|
14164
14149
|
|
|
14165
14150
|
// core/agentic/tool-registry.ts
|
|
14166
|
-
import { exec as
|
|
14151
|
+
import { exec as exec6 } from "node:child_process";
|
|
14167
14152
|
import fs28 from "node:fs/promises";
|
|
14168
|
-
import { promisify as
|
|
14169
|
-
var
|
|
14153
|
+
import { promisify as promisify6 } from "node:util";
|
|
14154
|
+
var execAsync2, toolRegistry, tool_registry_default;
|
|
14170
14155
|
var init_tool_registry = __esm({
|
|
14171
14156
|
"core/agentic/tool-registry.ts"() {
|
|
14172
14157
|
"use strict";
|
|
14173
|
-
|
|
14158
|
+
execAsync2 = promisify6(exec6);
|
|
14174
14159
|
toolRegistry = {
|
|
14175
14160
|
tools: /* @__PURE__ */ new Map(),
|
|
14176
14161
|
/**
|
|
@@ -14225,7 +14210,7 @@ var init_tool_registry = __esm({
|
|
|
14225
14210
|
"Bash",
|
|
14226
14211
|
async (command) => {
|
|
14227
14212
|
try {
|
|
14228
|
-
const { stdout, stderr } = await
|
|
14213
|
+
const { stdout, stderr } = await execAsync2(command);
|
|
14229
14214
|
return { stdout, stderr };
|
|
14230
14215
|
} catch (error) {
|
|
14231
14216
|
const err = error;
|
|
@@ -14601,7 +14586,7 @@ import fs30 from "node:fs";
|
|
|
14601
14586
|
import https from "node:https";
|
|
14602
14587
|
import os10 from "node:os";
|
|
14603
14588
|
import path29 from "node:path";
|
|
14604
|
-
import
|
|
14589
|
+
import chalk8 from "chalk";
|
|
14605
14590
|
var UpdateChecker, update_checker_default;
|
|
14606
14591
|
var init_update_checker = __esm({
|
|
14607
14592
|
"core/infrastructure/update-checker.ts"() {
|
|
@@ -14764,7 +14749,7 @@ var init_update_checker = __esm({
|
|
|
14764
14749
|
if (!result || !result.updateAvailable) {
|
|
14765
14750
|
return null;
|
|
14766
14751
|
}
|
|
14767
|
-
return "\n" +
|
|
14752
|
+
return "\n" + chalk8.yellow("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510") + "\n" + chalk8.yellow("\u2502") + " " + chalk8.bold("Update available!") + " " + chalk8.dim(`${result.currentVersion} \u2192 ${result.latestVersion}`) + " " + chalk8.yellow("\u2502") + "\n" + chalk8.yellow("\u2502") + " " + chalk8.yellow("\u2502") + "\n" + chalk8.yellow("\u2502") + " Run: " + chalk8.cyan("npm update -g prjct-cli") + " " + chalk8.yellow("\u2502") + "\n" + chalk8.yellow("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518") + "\n";
|
|
14768
14753
|
}
|
|
14769
14754
|
};
|
|
14770
14755
|
update_checker_default = UpdateChecker;
|
|
@@ -16115,7 +16100,7 @@ var init_file_scorer = __esm({
|
|
|
16115
16100
|
});
|
|
16116
16101
|
|
|
16117
16102
|
// core/services/dependency-validator.ts
|
|
16118
|
-
import { execSync as
|
|
16103
|
+
import { execSync as execSync3 } from "node:child_process";
|
|
16119
16104
|
var TOOLS, DependencyValidator, DependencyError, dependencyValidator;
|
|
16120
16105
|
var init_dependency_validator = __esm({
|
|
16121
16106
|
"core/services/dependency-validator.ts"() {
|
|
@@ -16275,7 +16260,7 @@ ${hints}`
|
|
|
16275
16260
|
// ==========================================================================
|
|
16276
16261
|
executeCheck(definition) {
|
|
16277
16262
|
try {
|
|
16278
|
-
const output =
|
|
16263
|
+
const output = execSync3(definition.command, {
|
|
16279
16264
|
encoding: "utf-8",
|
|
16280
16265
|
stdio: ["pipe", "pipe", "pipe"],
|
|
16281
16266
|
timeout: 5e3
|
|
@@ -16300,7 +16285,7 @@ ${hints}`
|
|
|
16300
16285
|
}
|
|
16301
16286
|
checkUnknownTool(toolName) {
|
|
16302
16287
|
try {
|
|
16303
|
-
|
|
16288
|
+
execSync3(`${toolName} --version`, {
|
|
16304
16289
|
encoding: "utf-8",
|
|
16305
16290
|
stdio: ["pipe", "pipe", "pipe"],
|
|
16306
16291
|
timeout: 5e3
|
|
@@ -16308,7 +16293,7 @@ ${hints}`
|
|
|
16308
16293
|
return { available: true };
|
|
16309
16294
|
} catch {
|
|
16310
16295
|
try {
|
|
16311
|
-
|
|
16296
|
+
execSync3(`${toolName} -v`, {
|
|
16312
16297
|
encoding: "utf-8",
|
|
16313
16298
|
stdio: ["pipe", "pipe", "pipe"],
|
|
16314
16299
|
timeout: 5e3
|
|
@@ -16358,15 +16343,15 @@ ${hints}`
|
|
|
16358
16343
|
});
|
|
16359
16344
|
|
|
16360
16345
|
// core/services/git-analyzer.ts
|
|
16361
|
-
import { exec as
|
|
16362
|
-
import { promisify as
|
|
16363
|
-
var
|
|
16346
|
+
import { exec as exec7 } from "node:child_process";
|
|
16347
|
+
import { promisify as promisify7 } from "node:util";
|
|
16348
|
+
var execAsync3;
|
|
16364
16349
|
var init_git_analyzer = __esm({
|
|
16365
16350
|
"core/services/git-analyzer.ts"() {
|
|
16366
16351
|
"use strict";
|
|
16367
16352
|
init_constants();
|
|
16368
16353
|
init_dependency_validator();
|
|
16369
|
-
|
|
16354
|
+
execAsync3 = promisify7(exec7);
|
|
16370
16355
|
}
|
|
16371
16356
|
});
|
|
16372
16357
|
|
|
@@ -17041,16 +17026,16 @@ ${agent.description}`;
|
|
|
17041
17026
|
});
|
|
17042
17027
|
|
|
17043
17028
|
// core/services/project-index.ts
|
|
17044
|
-
import { exec as
|
|
17045
|
-
import { promisify as
|
|
17046
|
-
var
|
|
17029
|
+
import { exec as exec8 } from "node:child_process";
|
|
17030
|
+
import { promisify as promisify8 } from "node:util";
|
|
17031
|
+
var execAsync4;
|
|
17047
17032
|
var init_project_index = __esm({
|
|
17048
17033
|
"core/services/project-index.ts"() {
|
|
17049
17034
|
"use strict";
|
|
17050
17035
|
init_index_storage();
|
|
17051
17036
|
init_date_helper();
|
|
17052
17037
|
init_file_scorer();
|
|
17053
|
-
|
|
17038
|
+
execAsync4 = promisify8(exec8);
|
|
17054
17039
|
}
|
|
17055
17040
|
});
|
|
17056
17041
|
|
|
@@ -17199,7 +17184,7 @@ var init_state_machine = __esm({
|
|
|
17199
17184
|
});
|
|
17200
17185
|
|
|
17201
17186
|
// core/utils/next-steps.ts
|
|
17202
|
-
import
|
|
17187
|
+
import chalk9 from "chalk";
|
|
17203
17188
|
function showNextSteps(command, options = {}) {
|
|
17204
17189
|
if (options.quiet) return;
|
|
17205
17190
|
const resultingState = COMMAND_TO_STATE[command] || "idle";
|
|
@@ -17209,15 +17194,15 @@ function showNextSteps(command, options = {}) {
|
|
|
17209
17194
|
cmd: `p. ${cmd}`,
|
|
17210
17195
|
desc: CMD_DESCRIPTIONS[cmd] || cmd
|
|
17211
17196
|
}));
|
|
17212
|
-
console.log(
|
|
17197
|
+
console.log(chalk9.dim("\nNext:"));
|
|
17213
17198
|
for (const step of steps) {
|
|
17214
|
-
const cmd =
|
|
17215
|
-
console.log(
|
|
17199
|
+
const cmd = chalk9.cyan(step.cmd.padEnd(12));
|
|
17200
|
+
console.log(chalk9.dim(` ${cmd} \u2192 ${step.desc}`));
|
|
17216
17201
|
}
|
|
17217
17202
|
}
|
|
17218
17203
|
function showStateInfo(state) {
|
|
17219
17204
|
const info = workflowStateMachine.getStateInfo(state);
|
|
17220
|
-
console.log(
|
|
17205
|
+
console.log(chalk9.dim(`\u{1F4CD} State: ${chalk9.white(state.toUpperCase())} - ${info.description}`));
|
|
17221
17206
|
}
|
|
17222
17207
|
var CMD_DESCRIPTIONS, COMMAND_TO_STATE;
|
|
17223
17208
|
var init_next_steps = __esm({
|
|
@@ -17255,7 +17240,7 @@ var init_next_steps = __esm({
|
|
|
17255
17240
|
});
|
|
17256
17241
|
|
|
17257
17242
|
// core/wizard/onboarding.ts
|
|
17258
|
-
import
|
|
17243
|
+
import chalk10 from "chalk";
|
|
17259
17244
|
import prompts from "prompts";
|
|
17260
17245
|
var PROJECT_TYPES, AI_AGENTS, OnboardingWizard;
|
|
17261
17246
|
var init_onboarding = __esm({
|
|
@@ -17410,7 +17395,7 @@ var init_onboarding = __esm({
|
|
|
17410
17395
|
async stepStack() {
|
|
17411
17396
|
this.detectedStack = await this.detectStack();
|
|
17412
17397
|
const stackDisplay = this.formatStackDisplay(this.detectedStack);
|
|
17413
|
-
console.log(
|
|
17398
|
+
console.log(chalk10.dim(`
|
|
17414
17399
|
Detected: ${stackDisplay}
|
|
17415
17400
|
`));
|
|
17416
17401
|
const response = await prompts(
|
|
@@ -17492,15 +17477,15 @@ var init_onboarding = __esm({
|
|
|
17492
17477
|
*/
|
|
17493
17478
|
async stepSummary() {
|
|
17494
17479
|
console.log("");
|
|
17495
|
-
console.log(
|
|
17496
|
-
console.log(
|
|
17497
|
-
console.log(` ${
|
|
17480
|
+
console.log(chalk10.bold(" Configuration Summary"));
|
|
17481
|
+
console.log(chalk10.dim(` ${"\u2500".repeat(40)}`));
|
|
17482
|
+
console.log(` ${chalk10.cyan("Project Type:")} ${this.getProjectTypeLabel(this.confirmedType)}`);
|
|
17498
17483
|
console.log(
|
|
17499
|
-
` ${
|
|
17484
|
+
` ${chalk10.cyan("AI Agents:")} ${this.selectedAgents.map((a) => this.getAgentLabel(a)).join(", ")}`
|
|
17500
17485
|
);
|
|
17501
|
-
console.log(` ${
|
|
17502
|
-
console.log(` ${
|
|
17503
|
-
console.log(` ${
|
|
17486
|
+
console.log(` ${chalk10.cyan("Stack:")} ${this.formatStackDisplay(this.confirmedStack)}`);
|
|
17487
|
+
console.log(` ${chalk10.cyan("Verbosity:")} ${this.preferences.verbosity}`);
|
|
17488
|
+
console.log(` ${chalk10.cyan("Auto-sync:")} ${this.preferences.autoSync ? "Yes" : "No"}`);
|
|
17504
17489
|
console.log("");
|
|
17505
17490
|
const response = await prompts(
|
|
17506
17491
|
{
|
|
@@ -17657,18 +17642,18 @@ var init_onboarding = __esm({
|
|
|
17657
17642
|
// ==========================================================================
|
|
17658
17643
|
printWelcome() {
|
|
17659
17644
|
console.log("");
|
|
17660
|
-
console.log(
|
|
17661
|
-
console.log(
|
|
17645
|
+
console.log(chalk10.bold.cyan(" Welcome to prjct-cli!"));
|
|
17646
|
+
console.log(chalk10.dim(" Let's set up your project in 60 seconds."));
|
|
17662
17647
|
console.log("");
|
|
17663
17648
|
}
|
|
17664
17649
|
printStepHeader(title) {
|
|
17665
17650
|
console.log("");
|
|
17666
|
-
console.log(
|
|
17651
|
+
console.log(chalk10.dim(` Step ${this.currentStep}/${this.totalSteps}: ${title}`));
|
|
17667
17652
|
console.log("");
|
|
17668
17653
|
}
|
|
17669
17654
|
handleCancel() {
|
|
17670
17655
|
this.aborted = true;
|
|
17671
|
-
console.log(
|
|
17656
|
+
console.log(chalk10.yellow("\n Setup cancelled. Run again anytime.\n"));
|
|
17672
17657
|
}
|
|
17673
17658
|
getProjectTypeLabel(type) {
|
|
17674
17659
|
return PROJECT_TYPES.find((pt) => pt.value === type)?.title || "Unknown";
|
|
@@ -17719,10 +17704,10 @@ var init_wizard = __esm({
|
|
|
17719
17704
|
});
|
|
17720
17705
|
|
|
17721
17706
|
// core/context/generator.ts
|
|
17722
|
-
import { exec as
|
|
17707
|
+
import { exec as exec9 } from "node:child_process";
|
|
17723
17708
|
import fs34 from "node:fs/promises";
|
|
17724
17709
|
import path35 from "node:path";
|
|
17725
|
-
import { promisify as
|
|
17710
|
+
import { promisify as promisify9 } from "node:util";
|
|
17726
17711
|
async function generateContext(projectId, repoPath) {
|
|
17727
17712
|
const _globalPath = path_manager_default.getGlobalProjectPath(projectId);
|
|
17728
17713
|
const contextPath = path_manager_default.getContextPath(projectId);
|
|
@@ -17780,17 +17765,17 @@ async function getGitData(repoPath) {
|
|
|
17780
17765
|
recentCommits: []
|
|
17781
17766
|
};
|
|
17782
17767
|
try {
|
|
17783
|
-
const { stdout: branch } = await
|
|
17768
|
+
const { stdout: branch } = await execAsync5("git branch --show-current", { cwd: repoPath });
|
|
17784
17769
|
data.branch = branch.trim() || "main";
|
|
17785
|
-
const { stdout: commits } = await
|
|
17770
|
+
const { stdout: commits } = await execAsync5("git rev-list --count HEAD", { cwd: repoPath });
|
|
17786
17771
|
data.commits = parseInt(commits.trim(), 10) || 0;
|
|
17787
|
-
const { stdout: contributors } = await
|
|
17772
|
+
const { stdout: contributors } = await execAsync5("git shortlog -sn --all | wc -l", {
|
|
17788
17773
|
cwd: repoPath
|
|
17789
17774
|
});
|
|
17790
17775
|
data.contributors = parseInt(contributors.trim(), 10) || 0;
|
|
17791
|
-
const { stdout: status } = await
|
|
17776
|
+
const { stdout: status } = await execAsync5("git status --porcelain", { cwd: repoPath });
|
|
17792
17777
|
data.hasChanges = status.trim().length > 0;
|
|
17793
|
-
const { stdout: log } = await
|
|
17778
|
+
const { stdout: log } = await execAsync5(
|
|
17794
17779
|
'git log --oneline -10 --pretty=format:"%h|%s|%ad" --date=short',
|
|
17795
17780
|
{ cwd: repoPath }
|
|
17796
17781
|
);
|
|
@@ -17939,13 +17924,13 @@ async function generateSummaryMd(contextPath, project, gitData, pkgData) {
|
|
|
17939
17924
|
`;
|
|
17940
17925
|
await fs34.writeFile(path35.join(contextPath, "summary.md"), content, "utf-8");
|
|
17941
17926
|
}
|
|
17942
|
-
var
|
|
17927
|
+
var execAsync5;
|
|
17943
17928
|
var init_generator = __esm({
|
|
17944
17929
|
"core/context/generator.ts"() {
|
|
17945
17930
|
"use strict";
|
|
17946
17931
|
init_path_manager();
|
|
17947
17932
|
init_storage2();
|
|
17948
|
-
|
|
17933
|
+
execAsync5 = promisify9(exec9);
|
|
17949
17934
|
__name(generateContext, "generateContext");
|
|
17950
17935
|
__name(getGitData, "getGitData");
|
|
17951
17936
|
__name(getPackageData, "getPackageData");
|
|
@@ -17960,13 +17945,13 @@ var init_generator = __esm({
|
|
|
17960
17945
|
import { exec as execCallback5 } from "node:child_process";
|
|
17961
17946
|
import fs35 from "node:fs/promises";
|
|
17962
17947
|
import path36 from "node:path";
|
|
17963
|
-
import { promisify as
|
|
17964
|
-
var
|
|
17948
|
+
import { promisify as promisify10 } from "node:util";
|
|
17949
|
+
var exec10, CodebaseAnalyzer, analyzer, analyzer_default2;
|
|
17965
17950
|
var init_analyzer2 = __esm({
|
|
17966
17951
|
"core/domain/analyzer.ts"() {
|
|
17967
17952
|
"use strict";
|
|
17968
17953
|
init_fs();
|
|
17969
|
-
|
|
17954
|
+
exec10 = promisify10(execCallback5);
|
|
17970
17955
|
CodebaseAnalyzer = class {
|
|
17971
17956
|
static {
|
|
17972
17957
|
__name(this, "CodebaseAnalyzer");
|
|
@@ -18112,7 +18097,7 @@ var init_analyzer2 = __esm({
|
|
|
18112
18097
|
*/
|
|
18113
18098
|
async getFileExtensions() {
|
|
18114
18099
|
try {
|
|
18115
|
-
const { stdout } = await
|
|
18100
|
+
const { stdout } = await exec10(
|
|
18116
18101
|
'find . -type f ! -path "*/node_modules/*" ! -path "*/.git/*" ! -path "*/dist/*" ! -path "*/.next/*" | sed "s/.*\\./\\./" | sort | uniq -c | sort -rn',
|
|
18117
18102
|
{ cwd: this.projectPath }
|
|
18118
18103
|
);
|
|
@@ -18178,7 +18163,7 @@ var init_analyzer2 = __esm({
|
|
|
18178
18163
|
*/
|
|
18179
18164
|
async getGitLog(limit = 50) {
|
|
18180
18165
|
try {
|
|
18181
|
-
const { stdout } = await
|
|
18166
|
+
const { stdout } = await exec10(`git log -n ${limit} --pretty=format:"%h|%an|%ar|%s"`, {
|
|
18182
18167
|
cwd: this.projectPath
|
|
18183
18168
|
});
|
|
18184
18169
|
return stdout;
|
|
@@ -18191,13 +18176,13 @@ var init_analyzer2 = __esm({
|
|
|
18191
18176
|
*/
|
|
18192
18177
|
async getGitStats() {
|
|
18193
18178
|
try {
|
|
18194
|
-
const { stdout: totalCommits } = await
|
|
18179
|
+
const { stdout: totalCommits } = await exec10("git rev-list --count HEAD", {
|
|
18195
18180
|
cwd: this.projectPath
|
|
18196
18181
|
});
|
|
18197
|
-
const { stdout: contributors } = await
|
|
18182
|
+
const { stdout: contributors } = await exec10('git log --format="%an" | sort -u | wc -l', {
|
|
18198
18183
|
cwd: this.projectPath
|
|
18199
18184
|
});
|
|
18200
|
-
const { stdout: firstCommit } = await
|
|
18185
|
+
const { stdout: firstCommit } = await exec10(
|
|
18201
18186
|
'git log --reverse --pretty=format:"%ar" | head -1',
|
|
18202
18187
|
{
|
|
18203
18188
|
cwd: this.projectPath
|
|
@@ -18221,7 +18206,7 @@ var init_analyzer2 = __esm({
|
|
|
18221
18206
|
*/
|
|
18222
18207
|
async countFiles() {
|
|
18223
18208
|
try {
|
|
18224
|
-
const { stdout } = await
|
|
18209
|
+
const { stdout } = await exec10(
|
|
18225
18210
|
'find . -type f ! -path "*/node_modules/*" ! -path "*/.git/*" ! -path "*/dist/*" | wc -l',
|
|
18226
18211
|
{ cwd: this.projectPath }
|
|
18227
18212
|
);
|
|
@@ -18263,7 +18248,7 @@ var init_analyzer2 = __esm({
|
|
|
18263
18248
|
*/
|
|
18264
18249
|
async findFiles(pattern) {
|
|
18265
18250
|
try {
|
|
18266
|
-
const { stdout } = await
|
|
18251
|
+
const { stdout } = await exec10(
|
|
18267
18252
|
`find . -type f -name "${pattern}" ! -path "*/node_modules/*" ! -path "*/.git/*"`,
|
|
18268
18253
|
{ cwd: this.projectPath }
|
|
18269
18254
|
);
|
|
@@ -18279,7 +18264,7 @@ var init_analyzer2 = __esm({
|
|
|
18279
18264
|
});
|
|
18280
18265
|
|
|
18281
18266
|
// core/services/diff-generator.ts
|
|
18282
|
-
import
|
|
18267
|
+
import chalk11 from "chalk";
|
|
18283
18268
|
function estimateTokens(content) {
|
|
18284
18269
|
return Math.ceil(content.length / CHARS_PER_TOKEN2);
|
|
18285
18270
|
}
|
|
@@ -18380,11 +18365,11 @@ function generateSyncDiff(oldContent, newContent) {
|
|
|
18380
18365
|
function formatDiffPreview(diff, options = {}) {
|
|
18381
18366
|
const { colorize = true } = options;
|
|
18382
18367
|
const lines = [];
|
|
18383
|
-
const green = colorize ?
|
|
18384
|
-
const red = colorize ?
|
|
18385
|
-
const yellow = colorize ?
|
|
18386
|
-
const dim = colorize ?
|
|
18387
|
-
const bold = colorize ?
|
|
18368
|
+
const green = colorize ? chalk11.green : (s) => s;
|
|
18369
|
+
const red = colorize ? chalk11.red : (s) => s;
|
|
18370
|
+
const yellow = colorize ? chalk11.yellow : (s) => s;
|
|
18371
|
+
const dim = colorize ? chalk11.dim : (s) => s;
|
|
18372
|
+
const bold = colorize ? chalk11.bold : (s) => s;
|
|
18388
18373
|
if (!diff.hasChanges) {
|
|
18389
18374
|
lines.push(dim("No changes detected (context is up to date)"));
|
|
18390
18375
|
return lines.join("\n");
|
|
@@ -18432,10 +18417,10 @@ function formatDiffPreview(diff, options = {}) {
|
|
|
18432
18417
|
function formatFullDiff(diff, options = {}) {
|
|
18433
18418
|
const { colorize = true } = options;
|
|
18434
18419
|
const lines = [];
|
|
18435
|
-
const green = colorize ?
|
|
18436
|
-
const red = colorize ?
|
|
18437
|
-
const cyan = colorize ?
|
|
18438
|
-
const dim = colorize ?
|
|
18420
|
+
const green = colorize ? chalk11.green : (s) => s;
|
|
18421
|
+
const red = colorize ? chalk11.red : (s) => s;
|
|
18422
|
+
const cyan = colorize ? chalk11.cyan : (s) => s;
|
|
18423
|
+
const dim = colorize ? chalk11.dim : (s) => s;
|
|
18439
18424
|
for (const section of diff.added) {
|
|
18440
18425
|
lines.push(cyan(`@@ +${section.name} @@`));
|
|
18441
18426
|
if (section.after) {
|
|
@@ -19923,16 +19908,16 @@ var init_project_service = __esm({
|
|
|
19923
19908
|
});
|
|
19924
19909
|
|
|
19925
19910
|
// core/services/staleness-checker.ts
|
|
19926
|
-
import { exec as
|
|
19911
|
+
import { exec as exec11 } from "node:child_process";
|
|
19927
19912
|
import fs37 from "node:fs/promises";
|
|
19928
19913
|
import path39 from "node:path";
|
|
19929
|
-
import { promisify as
|
|
19930
|
-
var
|
|
19914
|
+
import { promisify as promisify11 } from "node:util";
|
|
19915
|
+
var execAsync6, DEFAULT_CONFIG, StalenessChecker, createStalenessChecker;
|
|
19931
19916
|
var init_staleness_checker = __esm({
|
|
19932
19917
|
"core/services/staleness-checker.ts"() {
|
|
19933
19918
|
"use strict";
|
|
19934
19919
|
init_path_manager();
|
|
19935
|
-
|
|
19920
|
+
execAsync6 = promisify11(exec11);
|
|
19936
19921
|
DEFAULT_CONFIG = {
|
|
19937
19922
|
commitThreshold: 10,
|
|
19938
19923
|
dayThreshold: 3,
|
|
@@ -19985,7 +19970,7 @@ var init_staleness_checker = __esm({
|
|
|
19985
19970
|
status.lastSyncCommit = projectJson.lastSyncCommit || null;
|
|
19986
19971
|
const lastSync = projectJson.lastSync;
|
|
19987
19972
|
try {
|
|
19988
|
-
const { stdout } = await
|
|
19973
|
+
const { stdout } = await execAsync6("git rev-parse --short HEAD", {
|
|
19989
19974
|
cwd: this.projectPath
|
|
19990
19975
|
});
|
|
19991
19976
|
status.currentCommit = stdout.trim();
|
|
@@ -20003,7 +19988,7 @@ var init_staleness_checker = __esm({
|
|
|
20003
19988
|
return status;
|
|
20004
19989
|
}
|
|
20005
19990
|
try {
|
|
20006
|
-
const { stdout } = await
|
|
19991
|
+
const { stdout } = await execAsync6(`git rev-list --count ${status.lastSyncCommit}..HEAD`, {
|
|
20007
19992
|
cwd: this.projectPath
|
|
20008
19993
|
});
|
|
20009
19994
|
status.commitsSinceSync = parseInt(stdout.trim(), 10) || 0;
|
|
@@ -20020,7 +20005,7 @@ var init_staleness_checker = __esm({
|
|
|
20020
20005
|
);
|
|
20021
20006
|
}
|
|
20022
20007
|
try {
|
|
20023
|
-
const { stdout } = await
|
|
20008
|
+
const { stdout } = await execAsync6(`git diff --name-only ${status.lastSyncCommit}..HEAD`, {
|
|
20024
20009
|
cwd: this.projectPath
|
|
20025
20010
|
});
|
|
20026
20011
|
status.changedFiles = stdout.trim().split("\n").filter(Boolean);
|
|
@@ -20352,7 +20337,7 @@ var init_formatters = __esm({
|
|
|
20352
20337
|
});
|
|
20353
20338
|
|
|
20354
20339
|
// core/ai-tools/registry.ts
|
|
20355
|
-
import { execSync as
|
|
20340
|
+
import { execSync as execSync4 } from "node:child_process";
|
|
20356
20341
|
import fs38 from "node:fs";
|
|
20357
20342
|
import os11 from "node:os";
|
|
20358
20343
|
import path40 from "node:path";
|
|
@@ -20361,7 +20346,7 @@ function getAIToolConfig(id) {
|
|
|
20361
20346
|
}
|
|
20362
20347
|
function commandExists(cmd) {
|
|
20363
20348
|
try {
|
|
20364
|
-
|
|
20349
|
+
execSync4(`which ${cmd}`, { stdio: "ignore" });
|
|
20365
20350
|
return true;
|
|
20366
20351
|
} catch {
|
|
20367
20352
|
return false;
|
|
@@ -21173,11 +21158,11 @@ var init_stack_detector = __esm({
|
|
|
21173
21158
|
});
|
|
21174
21159
|
|
|
21175
21160
|
// core/services/sync-service.ts
|
|
21176
|
-
import { exec as
|
|
21161
|
+
import { exec as exec12 } from "node:child_process";
|
|
21177
21162
|
import fs43 from "node:fs/promises";
|
|
21178
21163
|
import path45 from "node:path";
|
|
21179
|
-
import { promisify as
|
|
21180
|
-
var
|
|
21164
|
+
import { promisify as promisify12 } from "node:util";
|
|
21165
|
+
var execAsync7, SyncService, syncService;
|
|
21181
21166
|
var init_sync_service = __esm({
|
|
21182
21167
|
"core/services/sync-service.ts"() {
|
|
21183
21168
|
"use strict";
|
|
@@ -21190,7 +21175,7 @@ var init_sync_service = __esm({
|
|
|
21190
21175
|
init_context_generator();
|
|
21191
21176
|
init_local_state_generator();
|
|
21192
21177
|
init_stack_detector();
|
|
21193
|
-
|
|
21178
|
+
execAsync7 = promisify12(exec12);
|
|
21194
21179
|
SyncService = class {
|
|
21195
21180
|
static {
|
|
21196
21181
|
__name(this, "SyncService");
|
|
@@ -21347,19 +21332,19 @@ var init_sync_service = __esm({
|
|
|
21347
21332
|
weeklyCommits: 0
|
|
21348
21333
|
};
|
|
21349
21334
|
try {
|
|
21350
|
-
const { stdout: branch } = await
|
|
21335
|
+
const { stdout: branch } = await execAsync7("git branch --show-current", {
|
|
21351
21336
|
cwd: this.projectPath
|
|
21352
21337
|
});
|
|
21353
21338
|
data.branch = branch.trim() || "main";
|
|
21354
|
-
const { stdout: commits } = await
|
|
21339
|
+
const { stdout: commits } = await execAsync7("git rev-list --count HEAD", {
|
|
21355
21340
|
cwd: this.projectPath
|
|
21356
21341
|
});
|
|
21357
21342
|
data.commits = parseInt(commits.trim(), 10) || 0;
|
|
21358
|
-
const { stdout: contributors } = await
|
|
21343
|
+
const { stdout: contributors } = await execAsync7("git shortlog -sn --all | wc -l", {
|
|
21359
21344
|
cwd: this.projectPath
|
|
21360
21345
|
});
|
|
21361
21346
|
data.contributors = parseInt(contributors.trim(), 10) || 0;
|
|
21362
|
-
const { stdout: status } = await
|
|
21347
|
+
const { stdout: status } = await execAsync7("git status --porcelain", {
|
|
21363
21348
|
cwd: this.projectPath
|
|
21364
21349
|
});
|
|
21365
21350
|
const lines = status.trim().split("\n").filter(Boolean);
|
|
@@ -21375,7 +21360,7 @@ var init_sync_service = __esm({
|
|
|
21375
21360
|
data.untrackedFiles.push(file);
|
|
21376
21361
|
}
|
|
21377
21362
|
}
|
|
21378
|
-
const { stdout: log } = await
|
|
21363
|
+
const { stdout: log } = await execAsync7(
|
|
21379
21364
|
'git log --oneline -20 --pretty=format:"%h|%s|%ad" --date=short',
|
|
21380
21365
|
{ cwd: this.projectPath }
|
|
21381
21366
|
);
|
|
@@ -21383,7 +21368,7 @@ var init_sync_service = __esm({
|
|
|
21383
21368
|
const [hash, message, date] = line.split("|");
|
|
21384
21369
|
return { hash, message, date };
|
|
21385
21370
|
});
|
|
21386
|
-
const { stdout: weekly } = await
|
|
21371
|
+
const { stdout: weekly } = await execAsync7('git log --oneline --since="1 week ago" | wc -l', {
|
|
21387
21372
|
cwd: this.projectPath
|
|
21388
21373
|
});
|
|
21389
21374
|
data.weeklyCommits = parseInt(weekly.trim(), 10) || 0;
|
|
@@ -21405,7 +21390,7 @@ var init_sync_service = __esm({
|
|
|
21405
21390
|
frameworks: []
|
|
21406
21391
|
};
|
|
21407
21392
|
try {
|
|
21408
|
-
const { stdout } = await
|
|
21393
|
+
const { stdout } = await execAsync7(
|
|
21409
21394
|
'find . -type f \\( -name "*.js" -o -name "*.ts" -o -name "*.tsx" -o -name "*.py" -o -name "*.go" -o -name "*.rs" \\) -not -path "./node_modules/*" -not -path "./.git/*" | wc -l',
|
|
21410
21395
|
{ cwd: this.projectPath }
|
|
21411
21396
|
);
|
|
@@ -22005,13 +21990,13 @@ __export(uninstall_exports, {
|
|
|
22005
21990
|
UninstallCommands: () => UninstallCommands,
|
|
22006
21991
|
uninstall: () => uninstall
|
|
22007
21992
|
});
|
|
22008
|
-
import { execSync as
|
|
21993
|
+
import { execSync as execSync5 } from "node:child_process";
|
|
22009
21994
|
import fsSync2 from "node:fs";
|
|
22010
21995
|
import fs44 from "node:fs/promises";
|
|
22011
21996
|
import os12 from "node:os";
|
|
22012
21997
|
import path46 from "node:path";
|
|
22013
21998
|
import readline2 from "node:readline";
|
|
22014
|
-
import
|
|
21999
|
+
import chalk12 from "chalk";
|
|
22015
22000
|
async function getDirectorySize(dirPath) {
|
|
22016
22001
|
let totalSize = 0;
|
|
22017
22002
|
try {
|
|
@@ -22053,7 +22038,7 @@ function detectInstallation() {
|
|
|
22053
22038
|
npm: false
|
|
22054
22039
|
};
|
|
22055
22040
|
try {
|
|
22056
|
-
const result =
|
|
22041
|
+
const result = execSync5("brew list prjct-cli 2>/dev/null", { encoding: "utf-8" });
|
|
22057
22042
|
if (result) {
|
|
22058
22043
|
info.homebrew = true;
|
|
22059
22044
|
info.homebrewFormula = "prjct-cli";
|
|
@@ -22061,7 +22046,7 @@ function detectInstallation() {
|
|
|
22061
22046
|
} catch {
|
|
22062
22047
|
}
|
|
22063
22048
|
try {
|
|
22064
|
-
const result =
|
|
22049
|
+
const result = execSync5("npm list -g prjct-cli --depth=0 2>/dev/null", { encoding: "utf-8" });
|
|
22065
22050
|
if (result.includes("prjct-cli")) {
|
|
22066
22051
|
info.npm = true;
|
|
22067
22052
|
}
|
|
@@ -22229,7 +22214,7 @@ async function performUninstall(items, installation, options) {
|
|
|
22229
22214
|
if (installation.homebrew && installation.homebrewFormula) {
|
|
22230
22215
|
try {
|
|
22231
22216
|
if (!options.dryRun) {
|
|
22232
|
-
|
|
22217
|
+
execSync5(`brew uninstall ${installation.homebrewFormula}`, { stdio: "pipe" });
|
|
22233
22218
|
}
|
|
22234
22219
|
deleted.push("Homebrew: prjct-cli");
|
|
22235
22220
|
} catch (error) {
|
|
@@ -22239,7 +22224,7 @@ async function performUninstall(items, installation, options) {
|
|
|
22239
22224
|
if (installation.npm) {
|
|
22240
22225
|
try {
|
|
22241
22226
|
if (!options.dryRun) {
|
|
22242
|
-
|
|
22227
|
+
execSync5("npm uninstall -g prjct-cli", { stdio: "pipe" });
|
|
22243
22228
|
}
|
|
22244
22229
|
deleted.push("npm: prjct-cli");
|
|
22245
22230
|
} catch (error) {
|
|
@@ -22266,7 +22251,7 @@ async function uninstall(options = {}, _projectPath = process.cwd()) {
|
|
|
22266
22251
|
const installation = detectInstallation();
|
|
22267
22252
|
const existingItems = items.filter((i) => i.exists);
|
|
22268
22253
|
if (existingItems.length === 0 && !installation.homebrew && !installation.npm) {
|
|
22269
|
-
console.log(
|
|
22254
|
+
console.log(chalk12.yellow("\nNo prjct installation found."));
|
|
22270
22255
|
return {
|
|
22271
22256
|
success: true,
|
|
22272
22257
|
message: "Nothing to uninstall"
|
|
@@ -22274,36 +22259,36 @@ async function uninstall(options = {}, _projectPath = process.cwd()) {
|
|
|
22274
22259
|
}
|
|
22275
22260
|
const totalSize = existingItems.reduce((sum, item) => sum + (item.size || 0), 0);
|
|
22276
22261
|
console.log("");
|
|
22277
|
-
console.log(
|
|
22262
|
+
console.log(chalk12.red.bold(" WARNING: This action is DANGEROUS and IRREVERSIBLE"));
|
|
22278
22263
|
console.log("");
|
|
22279
|
-
console.log(
|
|
22264
|
+
console.log(chalk12.white("The following will be permanently deleted:"));
|
|
22280
22265
|
console.log("");
|
|
22281
22266
|
for (const item of existingItems) {
|
|
22282
22267
|
const displayPath = path_manager_default.getDisplayPath(item.path);
|
|
22283
22268
|
let info = "";
|
|
22284
22269
|
if (item.type === "section") {
|
|
22285
|
-
info =
|
|
22270
|
+
info = chalk12.dim("(section only)");
|
|
22286
22271
|
} else if (item.size) {
|
|
22287
|
-
info =
|
|
22272
|
+
info = chalk12.dim(`(${formatSize(item.size)})`);
|
|
22288
22273
|
}
|
|
22289
|
-
console.log(` ${
|
|
22290
|
-
console.log(` ${
|
|
22274
|
+
console.log(` ${chalk12.cyan(displayPath.padEnd(35))} ${info}`);
|
|
22275
|
+
console.log(` ${chalk12.dim(item.description)}`);
|
|
22291
22276
|
console.log("");
|
|
22292
22277
|
}
|
|
22293
22278
|
if (installation.homebrew) {
|
|
22294
|
-
console.log(` ${
|
|
22279
|
+
console.log(` ${chalk12.cyan("Homebrew".padEnd(35))} ${chalk12.dim("prjct-cli formula")}`);
|
|
22295
22280
|
console.log("");
|
|
22296
22281
|
}
|
|
22297
22282
|
if (installation.npm) {
|
|
22298
|
-
console.log(` ${
|
|
22283
|
+
console.log(` ${chalk12.cyan("npm global".padEnd(35))} ${chalk12.dim("prjct-cli package")}`);
|
|
22299
22284
|
console.log("");
|
|
22300
22285
|
}
|
|
22301
22286
|
if (totalSize > 0) {
|
|
22302
|
-
console.log(
|
|
22287
|
+
console.log(chalk12.dim(` Total size: ${formatSize(totalSize)}`));
|
|
22303
22288
|
console.log("");
|
|
22304
22289
|
}
|
|
22305
22290
|
if (options.dryRun) {
|
|
22306
|
-
console.log(
|
|
22291
|
+
console.log(chalk12.yellow("Dry run - no changes made"));
|
|
22307
22292
|
return {
|
|
22308
22293
|
success: true,
|
|
22309
22294
|
message: "Dry run complete",
|
|
@@ -22311,20 +22296,20 @@ async function uninstall(options = {}, _projectPath = process.cwd()) {
|
|
|
22311
22296
|
};
|
|
22312
22297
|
}
|
|
22313
22298
|
if (options.backup) {
|
|
22314
|
-
console.log(
|
|
22299
|
+
console.log(chalk12.blue("Creating backup..."));
|
|
22315
22300
|
const backupPath = await createBackup();
|
|
22316
22301
|
if (backupPath) {
|
|
22317
|
-
console.log(
|
|
22302
|
+
console.log(chalk12.green(`Backup created: ${path_manager_default.getDisplayPath(backupPath)}`));
|
|
22318
22303
|
console.log("");
|
|
22319
22304
|
} else {
|
|
22320
|
-
console.log(
|
|
22305
|
+
console.log(chalk12.yellow("Failed to create backup, continuing..."));
|
|
22321
22306
|
}
|
|
22322
22307
|
}
|
|
22323
22308
|
if (!options.force) {
|
|
22324
|
-
console.log(
|
|
22309
|
+
console.log(chalk12.yellow('Type "uninstall" to confirm:'));
|
|
22325
22310
|
const confirmed = await promptConfirmation("> ");
|
|
22326
22311
|
if (!confirmed) {
|
|
22327
|
-
console.log(
|
|
22312
|
+
console.log(chalk12.yellow("\nUninstall cancelled."));
|
|
22328
22313
|
return {
|
|
22329
22314
|
success: false,
|
|
22330
22315
|
message: "Uninstall cancelled by user"
|
|
@@ -22332,22 +22317,22 @@ async function uninstall(options = {}, _projectPath = process.cwd()) {
|
|
|
22332
22317
|
}
|
|
22333
22318
|
}
|
|
22334
22319
|
console.log("");
|
|
22335
|
-
console.log(
|
|
22320
|
+
console.log(chalk12.blue("Removing prjct..."));
|
|
22336
22321
|
const { deleted, errors } = await performUninstall(items, installation, options);
|
|
22337
22322
|
console.log("");
|
|
22338
22323
|
if (deleted.length > 0) {
|
|
22339
|
-
console.log(
|
|
22324
|
+
console.log(chalk12.green(`Removed ${deleted.length} items`));
|
|
22340
22325
|
}
|
|
22341
22326
|
if (errors.length > 0) {
|
|
22342
|
-
console.log(
|
|
22327
|
+
console.log(chalk12.yellow(`
|
|
22343
22328
|
${errors.length} errors:`));
|
|
22344
22329
|
for (const error of errors) {
|
|
22345
|
-
console.log(
|
|
22330
|
+
console.log(chalk12.red(` - ${error}`));
|
|
22346
22331
|
}
|
|
22347
22332
|
}
|
|
22348
22333
|
console.log("");
|
|
22349
|
-
console.log(
|
|
22350
|
-
console.log(
|
|
22334
|
+
console.log(chalk12.green("prjct has been uninstalled."));
|
|
22335
|
+
console.log(chalk12.dim("Thanks for using prjct! We hope to see you again."));
|
|
22351
22336
|
console.log("");
|
|
22352
22337
|
return {
|
|
22353
22338
|
success: errors.length === 0,
|
|
@@ -22394,7 +22379,7 @@ __export(watch_service_exports, {
|
|
|
22394
22379
|
watchService: () => watchService
|
|
22395
22380
|
});
|
|
22396
22381
|
import path47 from "node:path";
|
|
22397
|
-
import
|
|
22382
|
+
import chalk13 from "chalk";
|
|
22398
22383
|
import chokidar from "chokidar";
|
|
22399
22384
|
var TRIGGER_PATTERNS, IGNORE_PATTERNS2, WatchService, watchService;
|
|
22400
22385
|
var init_watch_service = __esm({
|
|
@@ -22504,7 +22489,7 @@ var init_watch_service = __esm({
|
|
|
22504
22489
|
async stop() {
|
|
22505
22490
|
if (!this.options.quiet) {
|
|
22506
22491
|
console.log("");
|
|
22507
|
-
console.log(
|
|
22492
|
+
console.log(chalk13.dim(`
|
|
22508
22493
|
\u{1F44B} Stopped watching (${this.syncCount} syncs performed)`));
|
|
22509
22494
|
}
|
|
22510
22495
|
if (this.debounceTimer) {
|
|
@@ -22525,7 +22510,7 @@ var init_watch_service = __esm({
|
|
|
22525
22510
|
this.pendingChanges.add(filePath);
|
|
22526
22511
|
if (this.options.verbose && !this.options.quiet) {
|
|
22527
22512
|
const eventIcon = event === "add" ? "\u2795" : event === "unlink" ? "\u2796" : "\u{1F4DD}";
|
|
22528
|
-
console.log(
|
|
22513
|
+
console.log(chalk13.dim(` ${eventIcon} ${filePath}`));
|
|
22529
22514
|
}
|
|
22530
22515
|
this.scheduleSyncIfNeeded();
|
|
22531
22516
|
}
|
|
@@ -22542,7 +22527,7 @@ var init_watch_service = __esm({
|
|
|
22542
22527
|
if (timeSinceLastSync < this.options.minIntervalMs && this.lastSyncTime > 0) {
|
|
22543
22528
|
const waitTime = this.options.minIntervalMs - timeSinceLastSync;
|
|
22544
22529
|
if (this.options.verbose && !this.options.quiet) {
|
|
22545
|
-
console.log(
|
|
22530
|
+
console.log(chalk13.dim(` \u23F3 Rate limited, waiting ${Math.round(waitTime / 1e3)}s...`));
|
|
22546
22531
|
}
|
|
22547
22532
|
this.debounceTimer = setTimeout(() => this.performSync(), waitTime);
|
|
22548
22533
|
return;
|
|
@@ -22562,7 +22547,7 @@ var init_watch_service = __esm({
|
|
|
22562
22547
|
const filesSummary = changedFiles.length === 1 ? changedFiles[0] : `${changedFiles.length} files`;
|
|
22563
22548
|
console.log(
|
|
22564
22549
|
`
|
|
22565
|
-
${
|
|
22550
|
+
${chalk13.dim(`[${timestamp}]`)} ${chalk13.cyan("\u27F3")} ${filesSummary} changed \u2192 syncing...`
|
|
22566
22551
|
);
|
|
22567
22552
|
}
|
|
22568
22553
|
try {
|
|
@@ -22573,16 +22558,16 @@ ${chalk11.dim(`[${timestamp}]`)} ${chalk11.cyan("\u27F3")} ${filesSummary} chang
|
|
|
22573
22558
|
if (!this.options.quiet) {
|
|
22574
22559
|
const agents = result.agents.filter((a) => a.type === "domain").map((a) => a.name);
|
|
22575
22560
|
const agentStr = agents.length > 0 ? ` [${agents.join(", ")}]` : "";
|
|
22576
|
-
console.log(`${
|
|
22561
|
+
console.log(`${chalk13.dim(`[${timestamp}]`)} ${chalk13.green("\u2713")} Synced${agentStr}`);
|
|
22577
22562
|
}
|
|
22578
22563
|
} else {
|
|
22579
22564
|
console.error(
|
|
22580
|
-
`${
|
|
22565
|
+
`${chalk13.dim(`[${timestamp}]`)} ${chalk13.red("\u2717")} Sync failed: ${result.error}`
|
|
22581
22566
|
);
|
|
22582
22567
|
}
|
|
22583
22568
|
} catch (error) {
|
|
22584
22569
|
console.error(
|
|
22585
|
-
`${
|
|
22570
|
+
`${chalk13.dim(`[${timestamp}]`)} ${chalk13.red("\u2717")} Error: ${error.message}`
|
|
22586
22571
|
);
|
|
22587
22572
|
}
|
|
22588
22573
|
}
|
|
@@ -22590,19 +22575,19 @@ ${chalk11.dim(`[${timestamp}]`)} ${chalk11.cyan("\u27F3")} ${filesSummary} chang
|
|
|
22590
22575
|
* Handle watcher errors
|
|
22591
22576
|
*/
|
|
22592
22577
|
handleError(error) {
|
|
22593
|
-
console.error(
|
|
22578
|
+
console.error(chalk13.red(`Watch error: ${error.message}`));
|
|
22594
22579
|
}
|
|
22595
22580
|
/**
|
|
22596
22581
|
* Print startup message
|
|
22597
22582
|
*/
|
|
22598
22583
|
printStartup() {
|
|
22599
22584
|
console.log("");
|
|
22600
|
-
console.log(
|
|
22601
|
-
console.log(
|
|
22602
|
-
console.log(
|
|
22603
|
-
console.log(
|
|
22585
|
+
console.log(chalk13.cyan("\u{1F441}\uFE0F Watching for changes..."));
|
|
22586
|
+
console.log(chalk13.dim(` Project: ${path47.basename(this.projectPath)}`));
|
|
22587
|
+
console.log(chalk13.dim(` Debounce: ${this.options.debounceMs}ms`));
|
|
22588
|
+
console.log(chalk13.dim(` Min interval: ${this.options.minIntervalMs / 1e3}s`));
|
|
22604
22589
|
console.log("");
|
|
22605
|
-
console.log(
|
|
22590
|
+
console.log(chalk13.dim(" Press Ctrl+C to stop"));
|
|
22606
22591
|
console.log("");
|
|
22607
22592
|
}
|
|
22608
22593
|
};
|
|
@@ -23013,47 +22998,52 @@ __export(help_exports, {
|
|
|
23013
22998
|
formatTerminalCommandHelp: () => formatTerminalCommandHelp,
|
|
23014
22999
|
getHelp: () => getHelp
|
|
23015
23000
|
});
|
|
23001
|
+
import chalk14 from "chalk";
|
|
23016
23002
|
function formatMainHelp() {
|
|
23017
23003
|
const lines = [];
|
|
23018
23004
|
lines.push("");
|
|
23019
|
-
lines.push(`${
|
|
23020
|
-
lines.push(
|
|
23005
|
+
lines.push(`${chalk14.cyan.bold("prjct")} v${VERSION} - Context layer for AI coding agents`);
|
|
23006
|
+
lines.push(chalk14.dim("Works with Claude Code, Gemini CLI, Cursor, Windsurf, and more."));
|
|
23021
23007
|
lines.push("");
|
|
23022
|
-
lines.push(
|
|
23023
|
-
lines.push(
|
|
23024
|
-
lines.push(
|
|
23025
|
-
|
|
23026
|
-
|
|
23027
|
-
lines.push(` ${
|
|
23008
|
+
lines.push(chalk14.bold("QUICK START"));
|
|
23009
|
+
lines.push(chalk14.dim("\u2500".repeat(60)));
|
|
23010
|
+
lines.push(
|
|
23011
|
+
` ${chalk14.green("1.")} prjct start ${chalk14.dim("# Configure AI providers")}`
|
|
23012
|
+
);
|
|
23013
|
+
lines.push(` ${chalk14.green("2.")} cd my-project && prjct init`);
|
|
23014
|
+
lines.push(` ${chalk14.green("3.")} Open in Claude Code / Gemini CLI / Cursor`);
|
|
23015
|
+
lines.push(` ${chalk14.green("4.")} p. sync ${chalk14.dim("# Analyze project")}`);
|
|
23028
23016
|
lines.push("");
|
|
23029
|
-
lines.push(
|
|
23030
|
-
lines.push(
|
|
23017
|
+
lines.push(chalk14.bold("TERMINAL COMMANDS"));
|
|
23018
|
+
lines.push(chalk14.dim("\u2500".repeat(60)));
|
|
23031
23019
|
for (const cmd of TERMINAL_COMMANDS) {
|
|
23032
23020
|
const name = `prjct ${cmd.name}`.padEnd(22);
|
|
23033
23021
|
lines.push(` ${name} ${cmd.description}`);
|
|
23034
23022
|
}
|
|
23035
23023
|
lines.push("");
|
|
23036
|
-
lines.push(`${
|
|
23037
|
-
lines.push(
|
|
23024
|
+
lines.push(`${chalk14.bold("AI AGENT COMMANDS")} ${chalk14.dim("(inside Claude/Gemini/Cursor)")}`);
|
|
23025
|
+
lines.push(chalk14.dim("\u2500".repeat(60)));
|
|
23038
23026
|
lines.push(` ${"Command".padEnd(22)} Description`);
|
|
23039
|
-
lines.push(` ${
|
|
23027
|
+
lines.push(` ${chalk14.dim("\u2500".repeat(56))}`);
|
|
23040
23028
|
const coreCommands = COMMANDS.filter((c) => c.group === "core" && c.usage?.claude);
|
|
23041
23029
|
for (const cmd of coreCommands.slice(0, 10)) {
|
|
23042
23030
|
const usage = `p. ${cmd.name}`.padEnd(22);
|
|
23043
23031
|
lines.push(` ${usage} ${cmd.description}`);
|
|
23044
23032
|
}
|
|
23045
|
-
lines.push(
|
|
23033
|
+
lines.push(
|
|
23034
|
+
` ${chalk14.dim(`... and ${coreCommands.length - 10} more (run 'prjct help commands')`)}`
|
|
23035
|
+
);
|
|
23046
23036
|
lines.push("");
|
|
23047
|
-
lines.push(
|
|
23048
|
-
lines.push(
|
|
23037
|
+
lines.push(chalk14.bold("FLAGS"));
|
|
23038
|
+
lines.push(chalk14.dim("\u2500".repeat(60)));
|
|
23049
23039
|
for (const flag of GLOBAL_FLAGS) {
|
|
23050
23040
|
lines.push(` ${flag.flag.padEnd(22)} ${flag.description}`);
|
|
23051
23041
|
}
|
|
23052
23042
|
lines.push("");
|
|
23053
|
-
lines.push(
|
|
23054
|
-
lines.push(
|
|
23055
|
-
lines.push(` Documentation: ${
|
|
23056
|
-
lines.push(` GitHub: ${
|
|
23043
|
+
lines.push(chalk14.bold("MORE INFO"));
|
|
23044
|
+
lines.push(chalk14.dim("\u2500".repeat(60)));
|
|
23045
|
+
lines.push(` Documentation: ${chalk14.cyan("https://prjct.app")}`);
|
|
23046
|
+
lines.push(` GitHub: ${chalk14.cyan("https://github.com/jlopezlira/prjct-cli")}`);
|
|
23057
23047
|
lines.push(` Per-command: prjct help <command>`);
|
|
23058
23048
|
lines.push("");
|
|
23059
23049
|
return lines.join("\n");
|
|
@@ -23063,20 +23053,20 @@ function formatTerminalCommandHelp(commandName) {
|
|
|
23063
23053
|
if (!cmd) return null;
|
|
23064
23054
|
const lines = [];
|
|
23065
23055
|
lines.push("");
|
|
23066
|
-
lines.push(`${
|
|
23056
|
+
lines.push(`${chalk14.cyan.bold(`prjct ${cmd.name}`)} - ${cmd.description}`);
|
|
23067
23057
|
lines.push("");
|
|
23068
|
-
lines.push(
|
|
23058
|
+
lines.push(chalk14.bold("USAGE"));
|
|
23069
23059
|
lines.push(` ${cmd.example}`);
|
|
23070
23060
|
lines.push("");
|
|
23071
23061
|
if (cmd.options) {
|
|
23072
|
-
lines.push(
|
|
23062
|
+
lines.push(chalk14.bold("OPTIONS"));
|
|
23073
23063
|
for (const opt of cmd.options) {
|
|
23074
23064
|
lines.push(` ${opt}`);
|
|
23075
23065
|
}
|
|
23076
23066
|
lines.push("");
|
|
23077
23067
|
}
|
|
23078
23068
|
if (cmd.subcommands) {
|
|
23079
|
-
lines.push(
|
|
23069
|
+
lines.push(chalk14.bold("SUBCOMMANDS"));
|
|
23080
23070
|
for (const sub of cmd.subcommands) {
|
|
23081
23071
|
lines.push(` ${sub}`);
|
|
23082
23072
|
}
|
|
@@ -23089,9 +23079,9 @@ function formatAgentCommandHelp(commandName) {
|
|
|
23089
23079
|
if (!cmd) return null;
|
|
23090
23080
|
const lines = [];
|
|
23091
23081
|
lines.push("");
|
|
23092
|
-
lines.push(`${
|
|
23082
|
+
lines.push(`${chalk14.cyan.bold(`p. ${cmd.name}`)} - ${cmd.description}`);
|
|
23093
23083
|
lines.push("");
|
|
23094
|
-
lines.push(
|
|
23084
|
+
lines.push(chalk14.bold("USAGE"));
|
|
23095
23085
|
if (cmd.usage?.claude) {
|
|
23096
23086
|
lines.push(` Claude/Gemini: ${cmd.usage.claude.replace("/p:", "p. ")}`);
|
|
23097
23087
|
}
|
|
@@ -23100,27 +23090,27 @@ function formatAgentCommandHelp(commandName) {
|
|
|
23100
23090
|
}
|
|
23101
23091
|
lines.push("");
|
|
23102
23092
|
if (cmd.params) {
|
|
23103
|
-
lines.push(
|
|
23093
|
+
lines.push(chalk14.bold("PARAMETERS"));
|
|
23104
23094
|
lines.push(` ${cmd.params}`);
|
|
23105
23095
|
lines.push("");
|
|
23106
23096
|
}
|
|
23107
23097
|
if (cmd.features && cmd.features.length > 0) {
|
|
23108
|
-
lines.push(
|
|
23098
|
+
lines.push(chalk14.bold("FEATURES"));
|
|
23109
23099
|
for (const feature of cmd.features) {
|
|
23110
23100
|
lines.push(` \u2022 ${feature}`);
|
|
23111
23101
|
}
|
|
23112
23102
|
lines.push("");
|
|
23113
23103
|
}
|
|
23114
23104
|
if (cmd.blockingRules) {
|
|
23115
|
-
lines.push(
|
|
23116
|
-
lines.push(` ${
|
|
23105
|
+
lines.push(chalk14.bold("REQUIREMENTS"));
|
|
23106
|
+
lines.push(` ${chalk14.yellow("\u26A0")} ${cmd.blockingRules.check}`);
|
|
23117
23107
|
lines.push("");
|
|
23118
23108
|
}
|
|
23119
23109
|
const category = CATEGORIES[cmd.group];
|
|
23120
23110
|
if (category) {
|
|
23121
|
-
lines.push(
|
|
23111
|
+
lines.push(chalk14.dim(`Category: ${category.title}`));
|
|
23122
23112
|
if (cmd.isOptional) {
|
|
23123
|
-
lines.push(
|
|
23113
|
+
lines.push(chalk14.dim("This is an optional command."));
|
|
23124
23114
|
}
|
|
23125
23115
|
lines.push("");
|
|
23126
23116
|
}
|
|
@@ -23132,7 +23122,7 @@ function formatCommandHelp(commandName) {
|
|
|
23132
23122
|
const agentHelp = formatAgentCommandHelp(commandName);
|
|
23133
23123
|
if (agentHelp) return agentHelp;
|
|
23134
23124
|
return `
|
|
23135
|
-
${
|
|
23125
|
+
${chalk14.yellow(`Command '${commandName}' not found.`)}
|
|
23136
23126
|
|
|
23137
23127
|
Run 'prjct help' to see all available commands.
|
|
23138
23128
|
`;
|
|
@@ -23140,16 +23130,16 @@ Run 'prjct help' to see all available commands.
|
|
|
23140
23130
|
function formatCommandList() {
|
|
23141
23131
|
const lines = [];
|
|
23142
23132
|
lines.push("");
|
|
23143
|
-
lines.push(
|
|
23133
|
+
lines.push(chalk14.cyan.bold("All Commands"));
|
|
23144
23134
|
lines.push("");
|
|
23145
23135
|
const categories = Object.entries(CATEGORIES).sort((a, b) => a[1].order - b[1].order);
|
|
23146
23136
|
for (const [categoryKey, category] of categories) {
|
|
23147
23137
|
const categoryCommands = COMMANDS.filter((c) => c.group === categoryKey);
|
|
23148
23138
|
if (categoryCommands.length === 0) continue;
|
|
23149
23139
|
lines.push(
|
|
23150
|
-
`${
|
|
23140
|
+
`${chalk14.bold(category.title)} ${chalk14.dim(`(${categoryCommands.length} commands)`)}`
|
|
23151
23141
|
);
|
|
23152
|
-
lines.push(
|
|
23142
|
+
lines.push(chalk14.dim(category.description));
|
|
23153
23143
|
lines.push("");
|
|
23154
23144
|
for (const cmd of categoryCommands) {
|
|
23155
23145
|
const name = `p. ${cmd.name}`.padEnd(18);
|
|
@@ -23158,7 +23148,7 @@ function formatCommandList() {
|
|
|
23158
23148
|
}
|
|
23159
23149
|
lines.push("");
|
|
23160
23150
|
}
|
|
23161
|
-
lines.push(
|
|
23151
|
+
lines.push(chalk14.dim("Run 'prjct help <command>' for detailed help on a specific command."));
|
|
23162
23152
|
lines.push("");
|
|
23163
23153
|
return lines.join("\n");
|
|
23164
23154
|
}
|
|
@@ -23171,18 +23161,12 @@ function getHelp(topic) {
|
|
|
23171
23161
|
}
|
|
23172
23162
|
return formatCommandHelp(topic);
|
|
23173
23163
|
}
|
|
23174
|
-
var
|
|
23164
|
+
var TERMINAL_COMMANDS, GLOBAL_FLAGS, help_default;
|
|
23175
23165
|
var init_help = __esm({
|
|
23176
23166
|
"core/utils/help.ts"() {
|
|
23177
23167
|
"use strict";
|
|
23178
23168
|
init_command_data();
|
|
23179
23169
|
init_version();
|
|
23180
|
-
CYAN2 = "\x1B[36m";
|
|
23181
|
-
DIM3 = "\x1B[2m";
|
|
23182
|
-
BOLD3 = "\x1B[1m";
|
|
23183
|
-
RESET3 = "\x1B[0m";
|
|
23184
|
-
GREEN3 = "\x1B[32m";
|
|
23185
|
-
YELLOW3 = "\x1B[33m";
|
|
23186
23170
|
TERMINAL_COMMANDS = [
|
|
23187
23171
|
{
|
|
23188
23172
|
name: "start",
|
|
@@ -23276,54 +23260,57 @@ __export(setup_exports, {
|
|
|
23276
23260
|
needsWindsurfRegeneration: () => needsWindsurfRegeneration,
|
|
23277
23261
|
run: () => run
|
|
23278
23262
|
});
|
|
23279
|
-
import { execSync as
|
|
23263
|
+
import { execSync as execSync6 } from "node:child_process";
|
|
23280
23264
|
import fs45 from "node:fs";
|
|
23281
23265
|
import os13 from "node:os";
|
|
23282
23266
|
import path48 from "node:path";
|
|
23267
|
+
import chalk15 from "chalk";
|
|
23283
23268
|
async function installAICLI(provider) {
|
|
23284
23269
|
const packageName = provider.name === "claude" ? "@anthropic-ai/claude-code" : "@google/gemini-cli";
|
|
23285
23270
|
if (!dependencyValidator.isAvailable("npm")) {
|
|
23286
|
-
console.log(`${
|
|
23271
|
+
console.log(`${chalk15.yellow("\u26A0\uFE0F npm is not available")}`);
|
|
23287
23272
|
console.log("");
|
|
23288
|
-
console.log(`${
|
|
23289
|
-
console.log(
|
|
23273
|
+
console.log(`${chalk15.dim(`Install ${provider.displayName} using one of:`)}`);
|
|
23274
|
+
console.log(chalk15.dim(" \u2022 Install Node.js: https://nodejs.org"));
|
|
23290
23275
|
console.log(
|
|
23291
|
-
|
|
23276
|
+
chalk15.dim(
|
|
23277
|
+
` \u2022 Use Homebrew: brew install ${provider.name === "claude" ? "claude" : "gemini"}`
|
|
23278
|
+
)
|
|
23292
23279
|
);
|
|
23293
|
-
console.log(
|
|
23280
|
+
console.log(chalk15.dim(` \u2022 Use npx directly: npx ${packageName}`));
|
|
23294
23281
|
console.log("");
|
|
23295
23282
|
return false;
|
|
23296
23283
|
}
|
|
23297
23284
|
try {
|
|
23298
|
-
console.log(
|
|
23285
|
+
console.log(chalk15.yellow(`\u{1F4E6} ${provider.displayName} not found. Installing...`));
|
|
23299
23286
|
console.log("");
|
|
23300
|
-
|
|
23287
|
+
execSync6(`npm install -g ${packageName}`, {
|
|
23301
23288
|
stdio: "inherit",
|
|
23302
23289
|
timeout: getTimeout("NPM_INSTALL")
|
|
23303
23290
|
});
|
|
23304
23291
|
console.log("");
|
|
23305
|
-
console.log(`${
|
|
23292
|
+
console.log(`${chalk15.green("\u2713")} ${provider.displayName} installed successfully`);
|
|
23306
23293
|
console.log("");
|
|
23307
23294
|
return true;
|
|
23308
23295
|
} catch (error) {
|
|
23309
23296
|
const err = error;
|
|
23310
23297
|
const isTimeout = err.killed && err.signal === "SIGTERM";
|
|
23311
23298
|
if (isTimeout) {
|
|
23312
|
-
console.log(
|
|
23299
|
+
console.log(chalk15.yellow(`\u26A0\uFE0F Installation timed out for ${provider.displayName}`));
|
|
23313
23300
|
console.log("");
|
|
23314
|
-
console.log(
|
|
23315
|
-
console.log(
|
|
23316
|
-
console.log(
|
|
23301
|
+
console.log(chalk15.dim("The npm install took too long. Try:"));
|
|
23302
|
+
console.log(chalk15.dim(" \u2022 Set PRJCT_TIMEOUT_NPM_INSTALL=300000 for 5 minutes"));
|
|
23303
|
+
console.log(chalk15.dim(` \u2022 Run manually: npm install -g ${packageName}`));
|
|
23317
23304
|
} else {
|
|
23318
|
-
console.log(
|
|
23305
|
+
console.log(chalk15.yellow(`\u26A0\uFE0F Failed to install ${provider.displayName}: ${err.message}`));
|
|
23319
23306
|
}
|
|
23320
23307
|
console.log("");
|
|
23321
|
-
console.log(
|
|
23322
|
-
console.log(
|
|
23323
|
-
console.log(
|
|
23324
|
-
console.log(
|
|
23308
|
+
console.log(chalk15.dim("Alternative installation methods:"));
|
|
23309
|
+
console.log(chalk15.dim(` \u2022 npm: npm install -g ${packageName}`));
|
|
23310
|
+
console.log(chalk15.dim(` \u2022 yarn: yarn global add ${packageName}`));
|
|
23311
|
+
console.log(chalk15.dim(` \u2022 pnpm: pnpm add -g ${packageName}`));
|
|
23325
23312
|
console.log(
|
|
23326
|
-
|
|
23313
|
+
chalk15.dim(` \u2022 brew: brew install ${provider.name === "claude" ? "claude" : "gemini"}`)
|
|
23327
23314
|
);
|
|
23328
23315
|
console.log("");
|
|
23329
23316
|
return false;
|
|
@@ -23403,7 +23390,7 @@ async function run() {
|
|
|
23403
23390
|
if (antigravityDetection.installed) {
|
|
23404
23391
|
const antigravityResult = await installAntigravitySkill();
|
|
23405
23392
|
if (antigravityResult.success) {
|
|
23406
|
-
console.log(` ${
|
|
23393
|
+
console.log(` ${chalk15.green("\u2713")} Antigravity skill installed`);
|
|
23407
23394
|
}
|
|
23408
23395
|
}
|
|
23409
23396
|
await editors_config_default.saveConfig(VERSION, command_installer_default.getInstallPath(), selection.provider);
|
|
@@ -23703,7 +23690,7 @@ async function migrateProjectsCliVersion() {
|
|
|
23703
23690
|
}
|
|
23704
23691
|
}
|
|
23705
23692
|
if (migrated > 0) {
|
|
23706
|
-
console.log(` ${
|
|
23693
|
+
console.log(` ${chalk15.green("\u2713")} Updated ${migrated} project(s) to v${VERSION}`);
|
|
23707
23694
|
}
|
|
23708
23695
|
} catch (error) {
|
|
23709
23696
|
if (!isNotFoundError(error)) {
|
|
@@ -23909,29 +23896,29 @@ function ensureStatusLineSymlink(linkPath, targetPath) {
|
|
|
23909
23896
|
function showResults(results, provider) {
|
|
23910
23897
|
console.log("");
|
|
23911
23898
|
if (results.cliInstalled) {
|
|
23912
|
-
console.log(` ${
|
|
23899
|
+
console.log(` ${chalk15.green("\u2713")} ${provider.displayName} CLI installed`);
|
|
23913
23900
|
} else {
|
|
23914
|
-
console.log(` ${
|
|
23901
|
+
console.log(` ${chalk15.green("\u2713")} ${provider.displayName} CLI found`);
|
|
23915
23902
|
}
|
|
23916
23903
|
const totalCommands = results.commandsAdded + results.commandsUpdated;
|
|
23917
23904
|
if (totalCommands > 0) {
|
|
23918
23905
|
const parts = [];
|
|
23919
23906
|
if (results.commandsAdded > 0) parts.push(`${results.commandsAdded} new`);
|
|
23920
23907
|
if (results.commandsUpdated > 0) parts.push(`${results.commandsUpdated} updated`);
|
|
23921
|
-
console.log(` ${
|
|
23908
|
+
console.log(` ${chalk15.green("\u2713")} Commands synced (${parts.join(", ")})`);
|
|
23922
23909
|
} else {
|
|
23923
|
-
console.log(` ${
|
|
23910
|
+
console.log(` ${chalk15.green("\u2713")} Commands up to date`);
|
|
23924
23911
|
}
|
|
23925
23912
|
if (results.configAction === "created") {
|
|
23926
|
-
console.log(` ${
|
|
23913
|
+
console.log(` ${chalk15.green("\u2713")} Global config created (${provider.contextFile})`);
|
|
23927
23914
|
} else if (results.configAction === "updated") {
|
|
23928
|
-
console.log(` ${
|
|
23915
|
+
console.log(` ${chalk15.green("\u2713")} Global config updated (${provider.contextFile})`);
|
|
23929
23916
|
} else if (results.configAction === "appended") {
|
|
23930
|
-
console.log(` ${
|
|
23917
|
+
console.log(` ${chalk15.green("\u2713")} Global config merged (${provider.contextFile})`);
|
|
23931
23918
|
}
|
|
23932
23919
|
console.log("");
|
|
23933
23920
|
}
|
|
23934
|
-
var
|
|
23921
|
+
var setup_default, isDirectRun;
|
|
23935
23922
|
var init_setup = __esm({
|
|
23936
23923
|
"core/infrastructure/setup.ts"() {
|
|
23937
23924
|
"use strict";
|
|
@@ -23942,10 +23929,6 @@ var init_setup = __esm({
|
|
|
23942
23929
|
init_ai_provider();
|
|
23943
23930
|
init_command_installer();
|
|
23944
23931
|
init_editors_config();
|
|
23945
|
-
GREEN4 = "\x1B[32m";
|
|
23946
|
-
YELLOW4 = "\x1B[33m";
|
|
23947
|
-
DIM4 = "\x1B[2m";
|
|
23948
|
-
NC = "\x1B[0m";
|
|
23949
23932
|
__name(installAICLI, "installAICLI");
|
|
23950
23933
|
__name(run, "run");
|
|
23951
23934
|
setup_default = { run };
|
|
@@ -24992,9 +24975,9 @@ async function undo(projectPath = process.cwd()) {
|
|
|
24992
24975
|
}
|
|
24993
24976
|
const snapshotsPath = path53.join(path_manager_default.getGlobalProjectPath(projectId), "snapshots");
|
|
24994
24977
|
await file_helper_exports.ensureDir(snapshotsPath);
|
|
24995
|
-
const { execSync:
|
|
24978
|
+
const { execSync: execSync7 } = await import("node:child_process");
|
|
24996
24979
|
try {
|
|
24997
|
-
const status =
|
|
24980
|
+
const status = execSync7("git status --porcelain", {
|
|
24998
24981
|
cwd: projectPath,
|
|
24999
24982
|
encoding: "utf-8"
|
|
25000
24983
|
}).trim();
|
|
@@ -25004,7 +24987,7 @@ async function undo(projectPath = process.cwd()) {
|
|
|
25004
24987
|
}
|
|
25005
24988
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
25006
24989
|
const stashMessage = `prjct-undo-${timestamp}`;
|
|
25007
|
-
|
|
24990
|
+
execSync7(`git stash push -m "${stashMessage}"`, {
|
|
25008
24991
|
cwd: projectPath,
|
|
25009
24992
|
encoding: "utf-8"
|
|
25010
24993
|
});
|
|
@@ -25065,9 +25048,9 @@ async function redo(projectPath = process.cwd()) {
|
|
|
25065
25048
|
output_default.warn("nothing to redo");
|
|
25066
25049
|
return { success: false, message: "Nothing to redo" };
|
|
25067
25050
|
}
|
|
25068
|
-
const { execSync:
|
|
25051
|
+
const { execSync: execSync7 } = await import("node:child_process");
|
|
25069
25052
|
try {
|
|
25070
|
-
const stashList =
|
|
25053
|
+
const stashList = execSync7("git stash list", {
|
|
25071
25054
|
cwd: projectPath,
|
|
25072
25055
|
encoding: "utf-8"
|
|
25073
25056
|
}).trim();
|
|
@@ -25080,7 +25063,7 @@ async function redo(projectPath = process.cwd()) {
|
|
|
25080
25063
|
output_default.warn("no prjct undo point found");
|
|
25081
25064
|
return { success: false, message: "No prjct undo point found" };
|
|
25082
25065
|
}
|
|
25083
|
-
|
|
25066
|
+
execSync7("git stash pop", {
|
|
25084
25067
|
cwd: projectPath,
|
|
25085
25068
|
encoding: "utf-8"
|
|
25086
25069
|
});
|
|
@@ -25218,7 +25201,7 @@ var init_maintenance = __esm({
|
|
|
25218
25201
|
// core/commands/setup.ts
|
|
25219
25202
|
import fs47 from "node:fs";
|
|
25220
25203
|
import path54 from "node:path";
|
|
25221
|
-
import
|
|
25204
|
+
import chalk16 from "chalk";
|
|
25222
25205
|
var SetupCommands;
|
|
25223
25206
|
var init_setup2 = __esm({
|
|
25224
25207
|
"core/commands/setup.ts"() {
|
|
@@ -25424,45 +25407,45 @@ echo "\u26A1 prjct"
|
|
|
25424
25407
|
* Show beautiful ASCII art with quick start
|
|
25425
25408
|
*/
|
|
25426
25409
|
showAsciiArt() {
|
|
25427
|
-
console.log(
|
|
25410
|
+
console.log(chalk16.cyan("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"));
|
|
25428
25411
|
console.log("");
|
|
25429
|
-
console.log(
|
|
25430
|
-
console.log(
|
|
25431
|
-
console.log(
|
|
25432
|
-
console.log(
|
|
25433
|
-
console.log(
|
|
25434
|
-
console.log(
|
|
25412
|
+
console.log(chalk16.bold.cyan(" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557"));
|
|
25413
|
+
console.log(chalk16.bold.cyan(" \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D"));
|
|
25414
|
+
console.log(chalk16.bold.cyan(" \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551"));
|
|
25415
|
+
console.log(chalk16.bold.cyan(" \u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551"));
|
|
25416
|
+
console.log(chalk16.bold.cyan(" \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551"));
|
|
25417
|
+
console.log(chalk16.bold.cyan(" \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D"));
|
|
25435
25418
|
console.log("");
|
|
25436
25419
|
console.log(
|
|
25437
|
-
` ${
|
|
25420
|
+
` ${chalk16.bold.cyan("prjct")}${chalk16.magenta("/")}${chalk16.green("cli")} ${chalk16.dim.white(`v${VERSION} installed`)}`
|
|
25438
25421
|
);
|
|
25439
25422
|
console.log("");
|
|
25440
|
-
console.log(` ${
|
|
25441
|
-
console.log(` ${
|
|
25442
|
-
console.log(` ${
|
|
25423
|
+
console.log(` ${chalk16.yellow("\u26A1")} Ship faster with zero friction`);
|
|
25424
|
+
console.log(` ${chalk16.green("\u{1F4DD}")} From idea to technical tasks in minutes`);
|
|
25425
|
+
console.log(` ${chalk16.cyan("\u{1F916}")} Perfect context for AI agents`);
|
|
25443
25426
|
console.log("");
|
|
25444
|
-
console.log(
|
|
25427
|
+
console.log(chalk16.cyan("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"));
|
|
25445
25428
|
console.log("");
|
|
25446
|
-
console.log(
|
|
25447
|
-
console.log(
|
|
25429
|
+
console.log(chalk16.bold.cyan("\u{1F680} Quick Start"));
|
|
25430
|
+
console.log(chalk16.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
25448
25431
|
console.log("");
|
|
25449
|
-
console.log(` ${
|
|
25450
|
-
console.log(` ${
|
|
25432
|
+
console.log(` ${chalk16.bold("1.")} Initialize your project:`);
|
|
25433
|
+
console.log(` ${chalk16.green("cd your-project && prjct init")}`);
|
|
25451
25434
|
console.log("");
|
|
25452
|
-
console.log(` ${
|
|
25453
|
-
console.log(` ${
|
|
25435
|
+
console.log(` ${chalk16.bold("2.")} Start your first task:`);
|
|
25436
|
+
console.log(` ${chalk16.green('prjct task "build auth"')}`);
|
|
25454
25437
|
console.log("");
|
|
25455
|
-
console.log(` ${
|
|
25456
|
-
console.log(` ${
|
|
25438
|
+
console.log(` ${chalk16.bold("3.")} Ship & celebrate:`);
|
|
25439
|
+
console.log(` ${chalk16.green('prjct ship "user login"')}`);
|
|
25457
25440
|
console.log("");
|
|
25458
|
-
console.log(
|
|
25441
|
+
console.log(chalk16.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
25459
25442
|
console.log("");
|
|
25460
|
-
console.log(` ${
|
|
25443
|
+
console.log(` ${chalk16.dim("Documentation:")} ${chalk16.cyan("https://prjct.app")}`);
|
|
25461
25444
|
console.log(
|
|
25462
|
-
` ${
|
|
25445
|
+
` ${chalk16.dim("Report issues:")} ${chalk16.cyan("https://github.com/jlopezlira/prjct-cli/issues")}`
|
|
25463
25446
|
);
|
|
25464
25447
|
console.log("");
|
|
25465
|
-
console.log(
|
|
25448
|
+
console.log(chalk16.bold.magenta("Happy shipping! \u{1F680}"));
|
|
25466
25449
|
console.log("");
|
|
25467
25450
|
}
|
|
25468
25451
|
};
|
|
@@ -25551,8 +25534,9 @@ var init_project_commands = __esm({
|
|
|
25551
25534
|
});
|
|
25552
25535
|
|
|
25553
25536
|
// core/workflow/workflow-preferences.ts
|
|
25554
|
-
import { exec as
|
|
25555
|
-
import { promisify as
|
|
25537
|
+
import { exec as exec13 } from "node:child_process";
|
|
25538
|
+
import { promisify as promisify13 } from "node:util";
|
|
25539
|
+
import chalk17 from "chalk";
|
|
25556
25540
|
function prefKey(hook, command) {
|
|
25557
25541
|
return `workflow:${hook}_${command}`;
|
|
25558
25542
|
}
|
|
@@ -25620,22 +25604,22 @@ async function runWorkflowHooks(projectId, phase, command, options = {}) {
|
|
|
25620
25604
|
oncePreferences.delete(key);
|
|
25621
25605
|
}
|
|
25622
25606
|
console.log(`
|
|
25623
|
-
${
|
|
25607
|
+
${chalk17.dim(`Running ${phase}-${command}: ${action}`)}`);
|
|
25624
25608
|
try {
|
|
25625
25609
|
const startTime = Date.now();
|
|
25626
|
-
await
|
|
25610
|
+
await execAsync8(action, {
|
|
25627
25611
|
timeout: 6e4,
|
|
25628
25612
|
cwd: options.projectPath || process.cwd(),
|
|
25629
25613
|
env: { ...process.env }
|
|
25630
25614
|
});
|
|
25631
25615
|
const elapsed = Date.now() - startTime;
|
|
25632
25616
|
const timeStr = elapsed > 1e3 ? `${(elapsed / 1e3).toFixed(1)}s` : `${elapsed}ms`;
|
|
25633
|
-
console.log(`${
|
|
25617
|
+
console.log(`${chalk17.green("\u2713")} ${chalk17.dim(`(${timeStr})`)}`);
|
|
25634
25618
|
return { success: true };
|
|
25635
25619
|
} catch (error) {
|
|
25636
|
-
console.log(
|
|
25620
|
+
console.log(chalk17.red("\u2717 failed"));
|
|
25637
25621
|
const errorMessage = error.message || "Unknown error";
|
|
25638
|
-
console.log(
|
|
25622
|
+
console.log(chalk17.dim(errorMessage.split("\n")[0]));
|
|
25639
25623
|
return { success: false, failed: action, output: errorMessage };
|
|
25640
25624
|
}
|
|
25641
25625
|
}
|
|
@@ -25673,31 +25657,26 @@ async function removeWorkflowPreference(projectId, hook, command) {
|
|
|
25673
25657
|
}
|
|
25674
25658
|
function formatWorkflowPreferences(preferences) {
|
|
25675
25659
|
if (preferences.length === 0) {
|
|
25676
|
-
return `${
|
|
25660
|
+
return `${chalk17.dim("No workflow preferences configured.")}
|
|
25677
25661
|
|
|
25678
25662
|
Set one: "p. workflow antes de ship corre los tests"`;
|
|
25679
25663
|
}
|
|
25680
25664
|
const lines = ["", "WORKFLOW PREFERENCES", "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"];
|
|
25681
25665
|
for (const pref of preferences) {
|
|
25682
|
-
const scopeBadge = pref.scope === "permanent" ?
|
|
25666
|
+
const scopeBadge = pref.scope === "permanent" ? chalk17.green("permanent") : pref.scope === "session" ? chalk17.yellow("session") : chalk17.dim("once");
|
|
25683
25667
|
lines.push(` [${scopeBadge}] ${pref.key.padEnd(15)} \u2192 ${pref.action}`);
|
|
25684
25668
|
}
|
|
25685
25669
|
lines.push("");
|
|
25686
|
-
lines.push(
|
|
25687
|
-
lines.push(
|
|
25670
|
+
lines.push(chalk17.dim('Modify: "p. workflow antes de ship corre npm test"'));
|
|
25671
|
+
lines.push(chalk17.dim('Remove: "p. workflow quita el hook de ship"'));
|
|
25688
25672
|
return lines.join("\n");
|
|
25689
25673
|
}
|
|
25690
|
-
var
|
|
25674
|
+
var execAsync8, sessionPreferences, oncePreferences;
|
|
25691
25675
|
var init_workflow_preferences = __esm({
|
|
25692
25676
|
"core/workflow/workflow-preferences.ts"() {
|
|
25693
25677
|
"use strict";
|
|
25694
25678
|
init_memory_system();
|
|
25695
|
-
|
|
25696
|
-
DIM5 = "\x1B[2m";
|
|
25697
|
-
GREEN5 = "\x1B[32m";
|
|
25698
|
-
RED = "\x1B[31m";
|
|
25699
|
-
YELLOW5 = "\x1B[33m";
|
|
25700
|
-
RESET4 = "\x1B[0m";
|
|
25679
|
+
execAsync8 = promisify13(exec13);
|
|
25701
25680
|
sessionPreferences = /* @__PURE__ */ new Map();
|
|
25702
25681
|
oncePreferences = /* @__PURE__ */ new Map();
|
|
25703
25682
|
__name(prefKey, "prefKey");
|
|
@@ -25978,14 +25957,14 @@ var init_cache2 = __esm({
|
|
|
25978
25957
|
});
|
|
25979
25958
|
|
|
25980
25959
|
// core/utils/keychain.ts
|
|
25981
|
-
import { exec as
|
|
25982
|
-
import { promisify as
|
|
25960
|
+
import { exec as exec14 } from "node:child_process";
|
|
25961
|
+
import { promisify as promisify14 } from "node:util";
|
|
25983
25962
|
async function getCredential(key) {
|
|
25984
25963
|
if (process.platform !== "darwin") {
|
|
25985
25964
|
return getEnvFallback(key);
|
|
25986
25965
|
}
|
|
25987
25966
|
try {
|
|
25988
|
-
const { stdout } = await
|
|
25967
|
+
const { stdout } = await execAsync9(
|
|
25989
25968
|
`security find-generic-password -s "${SERVICE_NAME}" -a "${key}" -w 2>/dev/null`
|
|
25990
25969
|
);
|
|
25991
25970
|
return stdout.trim() || null;
|
|
@@ -26001,11 +25980,11 @@ function getEnvFallback(key) {
|
|
|
26001
25980
|
const envVar = envMap[key];
|
|
26002
25981
|
return process.env[envVar] || null;
|
|
26003
25982
|
}
|
|
26004
|
-
var
|
|
25983
|
+
var execAsync9, SERVICE_NAME;
|
|
26005
25984
|
var init_keychain = __esm({
|
|
26006
25985
|
"core/utils/keychain.ts"() {
|
|
26007
25986
|
"use strict";
|
|
26008
|
-
|
|
25987
|
+
execAsync9 = promisify14(exec14);
|
|
26009
25988
|
SERVICE_NAME = "prjct-cli";
|
|
26010
25989
|
__name(getCredential, "getCredential");
|
|
26011
25990
|
__name(getEnvFallback, "getEnvFallback");
|
|
@@ -27360,7 +27339,7 @@ var require_package = __commonJS({
|
|
|
27360
27339
|
"package.json"(exports, module) {
|
|
27361
27340
|
module.exports = {
|
|
27362
27341
|
name: "prjct-cli",
|
|
27363
|
-
version: "1.2.
|
|
27342
|
+
version: "1.2.2",
|
|
27364
27343
|
description: "Context layer for AI agents. Project context for Claude Code, Gemini CLI, and more.",
|
|
27365
27344
|
main: "core/index.ts",
|
|
27366
27345
|
bin: {
|
|
@@ -27470,6 +27449,7 @@ var core_exports = {};
|
|
|
27470
27449
|
import fs49 from "node:fs";
|
|
27471
27450
|
import os15 from "node:os";
|
|
27472
27451
|
import path58 from "node:path";
|
|
27452
|
+
import chalk18 from "chalk";
|
|
27473
27453
|
async function main() {
|
|
27474
27454
|
const [commandName, ...rawArgs] = process.argv.slice(2);
|
|
27475
27455
|
if (["-v", "--version", "version"].includes(commandName)) {
|
|
@@ -27608,42 +27588,42 @@ function displayVersion(version) {
|
|
|
27608
27588
|
const cursorConfigured = fs49.existsSync(path58.join(process.cwd(), ".cursor", "commands", "sync.md"));
|
|
27609
27589
|
const cursorExists = fs49.existsSync(path58.join(process.cwd(), ".cursor"));
|
|
27610
27590
|
console.log(`
|
|
27611
|
-
${
|
|
27612
|
-
${
|
|
27591
|
+
${chalk18.cyan("p/")} prjct v${version}
|
|
27592
|
+
${chalk18.dim("Context layer for AI coding agents")}
|
|
27613
27593
|
|
|
27614
|
-
${
|
|
27594
|
+
${chalk18.dim("Providers:")}`);
|
|
27615
27595
|
if (detection.claude.installed) {
|
|
27616
|
-
const status = claudeConfigured ?
|
|
27596
|
+
const status = claudeConfigured ? chalk18.green("\u2713 ready") : chalk18.yellow("\u25CF installed");
|
|
27617
27597
|
const ver = detection.claude.version ? ` (v${detection.claude.version})` : "";
|
|
27618
|
-
console.log(` Claude Code ${status}${
|
|
27598
|
+
console.log(` Claude Code ${status}${chalk18.dim(ver)}`);
|
|
27619
27599
|
} else {
|
|
27620
|
-
console.log(` Claude Code ${
|
|
27600
|
+
console.log(` Claude Code ${chalk18.dim("\u25CB not installed")}`);
|
|
27621
27601
|
}
|
|
27622
27602
|
if (detection.gemini.installed) {
|
|
27623
|
-
const status = geminiConfigured ?
|
|
27603
|
+
const status = geminiConfigured ? chalk18.green("\u2713 ready") : chalk18.yellow("\u25CF installed");
|
|
27624
27604
|
const ver = detection.gemini.version ? ` (v${detection.gemini.version})` : "";
|
|
27625
|
-
console.log(` Gemini CLI ${status}${
|
|
27605
|
+
console.log(` Gemini CLI ${status}${chalk18.dim(ver)}`);
|
|
27626
27606
|
} else {
|
|
27627
|
-
console.log(` Gemini CLI ${
|
|
27607
|
+
console.log(` Gemini CLI ${chalk18.dim("\u25CB not installed")}`);
|
|
27628
27608
|
}
|
|
27629
27609
|
const antigravityDetection = detectAntigravity();
|
|
27630
27610
|
if (antigravityDetection.installed) {
|
|
27631
|
-
const status = antigravityDetection.skillInstalled ?
|
|
27632
|
-
const hint = antigravityDetection.skillInstalled ? "" : ` ${
|
|
27611
|
+
const status = antigravityDetection.skillInstalled ? chalk18.green("\u2713 ready") : chalk18.yellow("\u25CF detected");
|
|
27612
|
+
const hint = antigravityDetection.skillInstalled ? "" : ` ${chalk18.dim("(run prjct start)")}`;
|
|
27633
27613
|
console.log(` Antigravity ${status}${hint}`);
|
|
27634
27614
|
} else {
|
|
27635
|
-
console.log(` Antigravity ${
|
|
27615
|
+
console.log(` Antigravity ${chalk18.dim("\u25CB not installed")}`);
|
|
27636
27616
|
}
|
|
27637
27617
|
if (cursorConfigured) {
|
|
27638
|
-
console.log(` Cursor IDE ${
|
|
27618
|
+
console.log(` Cursor IDE ${chalk18.green("\u2713 ready")} ${chalk18.dim("(use /sync, /task)")}`);
|
|
27639
27619
|
} else if (cursorExists) {
|
|
27640
|
-
console.log(` Cursor IDE ${
|
|
27620
|
+
console.log(` Cursor IDE ${chalk18.yellow("\u25CF detected")} ${chalk18.dim("(run prjct init)")}`);
|
|
27641
27621
|
} else {
|
|
27642
|
-
console.log(` Cursor IDE ${
|
|
27622
|
+
console.log(` Cursor IDE ${chalk18.dim("\u25CB no .cursor/ folder")}`);
|
|
27643
27623
|
}
|
|
27644
27624
|
console.log(`
|
|
27645
|
-
${
|
|
27646
|
-
${
|
|
27625
|
+
${chalk18.dim("Run 'prjct start' for Claude/Gemini, 'prjct init' for Cursor")}
|
|
27626
|
+
${chalk18.cyan("https://prjct.app")}
|
|
27647
27627
|
`);
|
|
27648
27628
|
}
|
|
27649
27629
|
function displayHelp() {
|
|
@@ -27708,7 +27688,6 @@ MORE INFO
|
|
|
27708
27688
|
GitHub: https://github.com/jlopezlira/prjct-cli
|
|
27709
27689
|
`);
|
|
27710
27690
|
}
|
|
27711
|
-
var CYAN3, GREEN6, YELLOW6, DIM6, RESET5;
|
|
27712
27691
|
var init_core = __esm({
|
|
27713
27692
|
"core/index.ts"() {
|
|
27714
27693
|
"use strict";
|
|
@@ -27719,11 +27698,6 @@ var init_core = __esm({
|
|
|
27719
27698
|
init_output();
|
|
27720
27699
|
__name(main, "main");
|
|
27721
27700
|
__name(parseCommandArgs, "parseCommandArgs");
|
|
27722
|
-
CYAN3 = "\x1B[36m";
|
|
27723
|
-
GREEN6 = "\x1B[32m";
|
|
27724
|
-
YELLOW6 = "\x1B[33m";
|
|
27725
|
-
DIM6 = "\x1B[2m";
|
|
27726
|
-
RESET5 = "\x1B[0m";
|
|
27727
27701
|
__name(displayVersion, "displayVersion");
|
|
27728
27702
|
__name(displayHelp, "displayHelp");
|
|
27729
27703
|
main().catch((error) => {
|
|
@@ -27743,6 +27717,7 @@ init_editors_config();
|
|
|
27743
27717
|
import fs50 from "node:fs";
|
|
27744
27718
|
import os16 from "node:os";
|
|
27745
27719
|
import path59 from "node:path";
|
|
27720
|
+
import chalk19 from "chalk";
|
|
27746
27721
|
|
|
27747
27722
|
// core/server/server.ts
|
|
27748
27723
|
import { Hono as Hono3 } from "hono";
|
|
@@ -28509,11 +28484,6 @@ if (isQuietMode2) {
|
|
|
28509
28484
|
const { setQuietMode: setQuietMode2 } = await Promise.resolve().then(() => (init_output(), output_exports));
|
|
28510
28485
|
setQuietMode2(true);
|
|
28511
28486
|
}
|
|
28512
|
-
var CYAN4 = "\x1B[36m";
|
|
28513
|
-
var YELLOW7 = "\x1B[33m";
|
|
28514
|
-
var DIM7 = "\x1B[2m";
|
|
28515
|
-
var BOLD4 = "\x1B[1m";
|
|
28516
|
-
var RESET6 = "\x1B[0m";
|
|
28517
28487
|
if (args[0] === "start" || args[0] === "setup") {
|
|
28518
28488
|
const { runStart: runStart2 } = await Promise.resolve().then(() => (init_start(), start_exports));
|
|
28519
28489
|
await runStart2();
|
|
@@ -28622,54 +28592,53 @@ if (args[0] === "start" || args[0] === "setup") {
|
|
|
28622
28592
|
const cursorConfigured = fs50.existsSync(path59.join(cwd, ".cursor", "rules", "prjct.mdc"));
|
|
28623
28593
|
const windsurfDetected = fs50.existsSync(path59.join(cwd, ".windsurf"));
|
|
28624
28594
|
const windsurfConfigured = fs50.existsSync(path59.join(cwd, ".windsurf", "rules", "prjct.md"));
|
|
28625
|
-
const GREEN7 = "\x1B[32m";
|
|
28626
28595
|
console.log(`
|
|
28627
|
-
${
|
|
28628
|
-
${
|
|
28596
|
+
${chalk19.cyan("p/")} prjct v${VERSION}
|
|
28597
|
+
${chalk19.dim("Context layer for AI coding agents")}
|
|
28629
28598
|
|
|
28630
|
-
${
|
|
28599
|
+
${chalk19.dim("Providers:")}`);
|
|
28631
28600
|
if (detection.claude.installed) {
|
|
28632
|
-
const status = claudeConfigured ?
|
|
28601
|
+
const status = claudeConfigured ? chalk19.green("\u2713 ready") : chalk19.yellow("\u25CF installed");
|
|
28633
28602
|
const ver = detection.claude.version ? ` (v${detection.claude.version})` : "";
|
|
28634
|
-
console.log(` Claude Code ${status}${
|
|
28603
|
+
console.log(` Claude Code ${status}${chalk19.dim(ver)}`);
|
|
28635
28604
|
} else {
|
|
28636
|
-
console.log(` Claude Code ${
|
|
28605
|
+
console.log(` Claude Code ${chalk19.dim("\u25CB not installed")}`);
|
|
28637
28606
|
}
|
|
28638
28607
|
if (detection.gemini.installed) {
|
|
28639
|
-
const status = geminiConfigured ?
|
|
28608
|
+
const status = geminiConfigured ? chalk19.green("\u2713 ready") : chalk19.yellow("\u25CF installed");
|
|
28640
28609
|
const ver = detection.gemini.version ? ` (v${detection.gemini.version})` : "";
|
|
28641
|
-
console.log(` Gemini CLI ${status}${
|
|
28610
|
+
console.log(` Gemini CLI ${status}${chalk19.dim(ver)}`);
|
|
28642
28611
|
} else {
|
|
28643
|
-
console.log(` Gemini CLI ${
|
|
28612
|
+
console.log(` Gemini CLI ${chalk19.dim("\u25CB not installed")}`);
|
|
28644
28613
|
}
|
|
28645
28614
|
if (cursorDetected) {
|
|
28646
|
-
const status = cursorConfigured ?
|
|
28647
|
-
console.log(` Cursor IDE ${status}${
|
|
28615
|
+
const status = cursorConfigured ? chalk19.green("\u2713 ready") : chalk19.yellow("\u25CF detected");
|
|
28616
|
+
console.log(` Cursor IDE ${status}${chalk19.dim(" (project)")}`);
|
|
28648
28617
|
} else {
|
|
28649
|
-
console.log(` Cursor IDE ${
|
|
28618
|
+
console.log(` Cursor IDE ${chalk19.dim("\u25CB not detected")}`);
|
|
28650
28619
|
}
|
|
28651
28620
|
if (windsurfDetected) {
|
|
28652
|
-
const status = windsurfConfigured ?
|
|
28653
|
-
console.log(` Windsurf IDE ${status}${
|
|
28621
|
+
const status = windsurfConfigured ? chalk19.green("\u2713 ready") : chalk19.yellow("\u25CF detected");
|
|
28622
|
+
console.log(` Windsurf IDE ${status}${chalk19.dim(" (project)")}`);
|
|
28654
28623
|
} else {
|
|
28655
|
-
console.log(` Windsurf IDE ${
|
|
28624
|
+
console.log(` Windsurf IDE ${chalk19.dim("\u25CB not detected")}`);
|
|
28656
28625
|
}
|
|
28657
28626
|
console.log(`
|
|
28658
|
-
${
|
|
28659
|
-
${
|
|
28660
|
-
${
|
|
28627
|
+
${chalk19.dim("Run 'prjct start' to configure (CLI providers)")}
|
|
28628
|
+
${chalk19.dim("Run 'prjct init' to configure (Cursor/Windsurf IDE)")}
|
|
28629
|
+
${chalk19.cyan("https://prjct.app")}
|
|
28661
28630
|
`);
|
|
28662
28631
|
} else {
|
|
28663
28632
|
const configPath = path59.join(os16.homedir(), ".prjct-cli", "config", "installed-editors.json");
|
|
28664
28633
|
const routersInstalled = checkRoutersInstalled();
|
|
28665
28634
|
if (!fs50.existsSync(configPath) || !routersInstalled) {
|
|
28666
28635
|
console.log(`
|
|
28667
|
-
${
|
|
28636
|
+
${chalk19.cyan.bold(" Welcome to prjct!")}
|
|
28668
28637
|
|
|
28669
|
-
Run ${
|
|
28638
|
+
Run ${chalk19.bold("prjct start")} to configure your AI providers.
|
|
28670
28639
|
|
|
28671
|
-
${
|
|
28672
|
-
Claude Code, Gemini CLI, or both
|
|
28640
|
+
${chalk19.dim(`This is a one-time setup that lets you choose between
|
|
28641
|
+
Claude Code, Gemini CLI, or both.`)}
|
|
28673
28642
|
`);
|
|
28674
28643
|
process.exitCode = 0;
|
|
28675
28644
|
} else {
|
|
@@ -28677,7 +28646,7 @@ ${CYAN4}${BOLD4} Welcome to prjct!${RESET6}
|
|
|
28677
28646
|
const lastVersion = await editors_config_default.getLastVersion();
|
|
28678
28647
|
if (lastVersion && lastVersion !== VERSION) {
|
|
28679
28648
|
console.log(`
|
|
28680
|
-
${
|
|
28649
|
+
${chalk19.yellow("\u2139")} Updating prjct v${lastVersion} \u2192 v${VERSION}...
|
|
28681
28650
|
`);
|
|
28682
28651
|
const { default: setup2 } = await Promise.resolve().then(() => (init_setup(), setup_exports));
|
|
28683
28652
|
await setup2.run();
|