prjct-cli 0.60.2 → 0.61.0
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 +36 -0
- package/core/services/local-state-generator.ts +158 -0
- package/core/services/sync-service.ts +11 -0
- package/core/storage/state-storage.ts +3 -0
- package/dist/bin/prjct.mjs +428 -304
- package/package.json +1 -1
package/dist/bin/prjct.mjs
CHANGED
|
@@ -16,10 +16,10 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
16
16
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
17
17
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
18
18
|
});
|
|
19
|
-
var __glob = (map) => (
|
|
20
|
-
var fn = map[
|
|
19
|
+
var __glob = (map) => (path59) => {
|
|
20
|
+
var fn = map[path59];
|
|
21
21
|
if (fn) return fn();
|
|
22
|
-
throw new Error("Module not found in bundle: " +
|
|
22
|
+
throw new Error("Module not found in bundle: " + path59);
|
|
23
23
|
};
|
|
24
24
|
var __esm = (fn, res) => function __init() {
|
|
25
25
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
@@ -4019,8 +4019,8 @@ function tryResolve(basePath, projectPath) {
|
|
|
4019
4019
|
for (const ext of extensions) {
|
|
4020
4020
|
const fullPath = basePath + ext;
|
|
4021
4021
|
try {
|
|
4022
|
-
const
|
|
4023
|
-
if (
|
|
4022
|
+
const fs50 = __require("node:fs");
|
|
4023
|
+
if (fs50.existsSync(fullPath) && fs50.statSync(fullPath).isFile()) {
|
|
4024
4024
|
return path12.relative(projectPath, fullPath);
|
|
4025
4025
|
}
|
|
4026
4026
|
} catch {
|
|
@@ -5203,11 +5203,11 @@ async function runSignaturesTool(args2, projectPath) {
|
|
|
5203
5203
|
}
|
|
5204
5204
|
};
|
|
5205
5205
|
}
|
|
5206
|
-
const
|
|
5207
|
-
const
|
|
5208
|
-
const fullPath =
|
|
5206
|
+
const fs50 = await import("node:fs/promises");
|
|
5207
|
+
const path59 = await import("node:path");
|
|
5208
|
+
const fullPath = path59.isAbsolute(filePath) ? filePath : path59.join(projectPath, filePath);
|
|
5209
5209
|
try {
|
|
5210
|
-
const stat = await
|
|
5210
|
+
const stat = await fs50.stat(fullPath);
|
|
5211
5211
|
if (stat.isDirectory()) {
|
|
5212
5212
|
const results = await extractDirectorySignatures(filePath, projectPath, {
|
|
5213
5213
|
recursive: args2.includes("--recursive") || args2.includes("-r")
|
|
@@ -5274,11 +5274,11 @@ async function runSummaryTool(args2, projectPath) {
|
|
|
5274
5274
|
}
|
|
5275
5275
|
};
|
|
5276
5276
|
}
|
|
5277
|
-
const
|
|
5278
|
-
const
|
|
5279
|
-
const fullPath =
|
|
5277
|
+
const fs50 = await import("node:fs/promises");
|
|
5278
|
+
const path59 = await import("node:path");
|
|
5279
|
+
const fullPath = path59.isAbsolute(targetPath) ? targetPath : path59.join(projectPath, targetPath);
|
|
5280
5280
|
try {
|
|
5281
|
-
const stat = await
|
|
5281
|
+
const stat = await fs50.stat(fullPath);
|
|
5282
5282
|
if (stat.isDirectory()) {
|
|
5283
5283
|
const results = await summarizeDirectory(targetPath, projectPath, {
|
|
5284
5284
|
recursive: args2.includes("--recursive") || args2.includes("-r")
|
|
@@ -16758,16 +16758,16 @@ var init_onboarding = __esm({
|
|
|
16758
16758
|
* Detect project type from file system
|
|
16759
16759
|
*/
|
|
16760
16760
|
async detectProjectType() {
|
|
16761
|
-
const
|
|
16762
|
-
const
|
|
16761
|
+
const fs50 = await import("node:fs/promises");
|
|
16762
|
+
const path59 = await import("node:path");
|
|
16763
16763
|
try {
|
|
16764
|
-
const files = await
|
|
16764
|
+
const files = await fs50.readdir(this.projectPath);
|
|
16765
16765
|
if (files.includes("turbo.json") || files.includes("lerna.json") || files.includes("nx.json")) {
|
|
16766
16766
|
return "monorepo";
|
|
16767
16767
|
}
|
|
16768
16768
|
if (files.includes("package.json")) {
|
|
16769
|
-
const pkgPath =
|
|
16770
|
-
const pkgContent = await
|
|
16769
|
+
const pkgPath = path59.join(this.projectPath, "package.json");
|
|
16770
|
+
const pkgContent = await fs50.readFile(pkgPath, "utf-8");
|
|
16771
16771
|
const pkg = JSON.parse(pkgContent);
|
|
16772
16772
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
16773
16773
|
if (pkg.bin) return "cli-tool";
|
|
@@ -16803,32 +16803,32 @@ var init_onboarding = __esm({
|
|
|
16803
16803
|
* Detect installed AI agents from config files
|
|
16804
16804
|
*/
|
|
16805
16805
|
async detectInstalledAgents() {
|
|
16806
|
-
const
|
|
16807
|
-
const
|
|
16806
|
+
const fs50 = await import("node:fs/promises");
|
|
16807
|
+
const path59 = await import("node:path");
|
|
16808
16808
|
const os17 = await import("node:os");
|
|
16809
16809
|
const agents = [];
|
|
16810
16810
|
try {
|
|
16811
|
-
await
|
|
16811
|
+
await fs50.access(path59.join(os17.homedir(), ".claude"));
|
|
16812
16812
|
agents.push("claude");
|
|
16813
16813
|
} catch {
|
|
16814
16814
|
}
|
|
16815
16815
|
try {
|
|
16816
|
-
await
|
|
16816
|
+
await fs50.access(path59.join(this.projectPath, ".cursorrules"));
|
|
16817
16817
|
agents.push("cursor");
|
|
16818
16818
|
} catch {
|
|
16819
16819
|
}
|
|
16820
16820
|
try {
|
|
16821
|
-
await
|
|
16821
|
+
await fs50.access(path59.join(this.projectPath, ".windsurfrules"));
|
|
16822
16822
|
agents.push("windsurf");
|
|
16823
16823
|
} catch {
|
|
16824
16824
|
}
|
|
16825
16825
|
try {
|
|
16826
|
-
await
|
|
16826
|
+
await fs50.access(path59.join(this.projectPath, ".github", "copilot-instructions.md"));
|
|
16827
16827
|
agents.push("copilot");
|
|
16828
16828
|
} catch {
|
|
16829
16829
|
}
|
|
16830
16830
|
try {
|
|
16831
|
-
await
|
|
16831
|
+
await fs50.access(path59.join(os17.homedir(), ".gemini"));
|
|
16832
16832
|
agents.push("gemini");
|
|
16833
16833
|
} catch {
|
|
16834
16834
|
}
|
|
@@ -16838,17 +16838,17 @@ var init_onboarding = __esm({
|
|
|
16838
16838
|
* Detect tech stack from project files
|
|
16839
16839
|
*/
|
|
16840
16840
|
async detectStack() {
|
|
16841
|
-
const
|
|
16842
|
-
const
|
|
16841
|
+
const fs50 = await import("node:fs/promises");
|
|
16842
|
+
const path59 = await import("node:path");
|
|
16843
16843
|
const stack = {
|
|
16844
16844
|
language: "Unknown",
|
|
16845
16845
|
technologies: []
|
|
16846
16846
|
};
|
|
16847
16847
|
try {
|
|
16848
|
-
const files = await
|
|
16848
|
+
const files = await fs50.readdir(this.projectPath);
|
|
16849
16849
|
if (files.includes("package.json")) {
|
|
16850
|
-
const pkgPath =
|
|
16851
|
-
const pkgContent = await
|
|
16850
|
+
const pkgPath = path59.join(this.projectPath, "package.json");
|
|
16851
|
+
const pkgContent = await fs50.readFile(pkgPath, "utf-8");
|
|
16852
16852
|
const pkg = JSON.parse(pkgContent);
|
|
16853
16853
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
16854
16854
|
stack.language = deps.typescript ? "TypeScript" : "JavaScript";
|
|
@@ -18944,8 +18944,8 @@ Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}
|
|
|
18944
18944
|
const globalPath2 = path_manager_default.getGlobalProjectPath(projectId);
|
|
18945
18945
|
const specsPath2 = path37.join(globalPath2, "planning", "specs");
|
|
18946
18946
|
try {
|
|
18947
|
-
const
|
|
18948
|
-
const files = await
|
|
18947
|
+
const fs50 = await import("node:fs/promises");
|
|
18948
|
+
const files = await fs50.readdir(specsPath2);
|
|
18949
18949
|
const specs = files.filter((f) => f.endsWith(".md") && f !== ".gitkeep");
|
|
18950
18950
|
if (specs.length === 0) {
|
|
18951
18951
|
output_default.warn("no specs yet");
|
|
@@ -20088,9 +20088,125 @@ Load from \`~/.prjct-cli/projects/${this.config.projectId}/agents/\`:
|
|
|
20088
20088
|
}
|
|
20089
20089
|
});
|
|
20090
20090
|
|
|
20091
|
-
// core/services/
|
|
20091
|
+
// core/services/local-state-generator.ts
|
|
20092
20092
|
import fs40 from "node:fs/promises";
|
|
20093
20093
|
import path42 from "node:path";
|
|
20094
|
+
var LOCAL_STATE_FILENAME, LocalStateGenerator, localStateGenerator;
|
|
20095
|
+
var init_local_state_generator = __esm({
|
|
20096
|
+
"core/services/local-state-generator.ts"() {
|
|
20097
|
+
"use strict";
|
|
20098
|
+
init_fs();
|
|
20099
|
+
LOCAL_STATE_FILENAME = ".prjct-state.md";
|
|
20100
|
+
LocalStateGenerator = class {
|
|
20101
|
+
static {
|
|
20102
|
+
__name(this, "LocalStateGenerator");
|
|
20103
|
+
}
|
|
20104
|
+
/**
|
|
20105
|
+
* Generate .prjct-state.md in the project root
|
|
20106
|
+
*/
|
|
20107
|
+
async generate(projectPath, state) {
|
|
20108
|
+
const filePath = path42.join(projectPath, LOCAL_STATE_FILENAME);
|
|
20109
|
+
const content = this.toMarkdown(state);
|
|
20110
|
+
await fs40.writeFile(filePath, content, "utf-8");
|
|
20111
|
+
}
|
|
20112
|
+
/**
|
|
20113
|
+
* Remove local state file
|
|
20114
|
+
*/
|
|
20115
|
+
async remove(projectPath) {
|
|
20116
|
+
const filePath = path42.join(projectPath, LOCAL_STATE_FILENAME);
|
|
20117
|
+
try {
|
|
20118
|
+
await fs40.unlink(filePath);
|
|
20119
|
+
} catch (error) {
|
|
20120
|
+
if (!isNotFoundError(error)) throw error;
|
|
20121
|
+
}
|
|
20122
|
+
}
|
|
20123
|
+
/**
|
|
20124
|
+
* Check if local state file exists
|
|
20125
|
+
*/
|
|
20126
|
+
async exists(projectPath) {
|
|
20127
|
+
const filePath = path42.join(projectPath, LOCAL_STATE_FILENAME);
|
|
20128
|
+
try {
|
|
20129
|
+
await fs40.access(filePath);
|
|
20130
|
+
return true;
|
|
20131
|
+
} catch {
|
|
20132
|
+
return false;
|
|
20133
|
+
}
|
|
20134
|
+
}
|
|
20135
|
+
/**
|
|
20136
|
+
* Convert state to markdown format
|
|
20137
|
+
* Note: Uses runtime types since state.json has fields not in strict Zod schema
|
|
20138
|
+
*/
|
|
20139
|
+
toMarkdown(state) {
|
|
20140
|
+
const lines = [
|
|
20141
|
+
"<!-- Auto-generated by prjct - DO NOT EDIT -->",
|
|
20142
|
+
"<!-- This file provides local state persistence for AI tools -->",
|
|
20143
|
+
"",
|
|
20144
|
+
"# prjct State",
|
|
20145
|
+
""
|
|
20146
|
+
];
|
|
20147
|
+
if (state.currentTask) {
|
|
20148
|
+
const task = state.currentTask;
|
|
20149
|
+
lines.push("## Current Task");
|
|
20150
|
+
lines.push("");
|
|
20151
|
+
lines.push(`**${task.description}**`);
|
|
20152
|
+
lines.push("");
|
|
20153
|
+
lines.push(`- Started: ${task.startedAt}`);
|
|
20154
|
+
if (task.linearId) {
|
|
20155
|
+
lines.push(`- Linear: ${task.linearId}`);
|
|
20156
|
+
}
|
|
20157
|
+
if (task.branch) {
|
|
20158
|
+
lines.push(`- Branch: ${task.branch}`);
|
|
20159
|
+
}
|
|
20160
|
+
lines.push(`- Status: ${task.status || "active"}`);
|
|
20161
|
+
lines.push("");
|
|
20162
|
+
if (task.subtasks && task.subtasks.length > 0) {
|
|
20163
|
+
lines.push("### Subtasks");
|
|
20164
|
+
lines.push("");
|
|
20165
|
+
task.subtasks.forEach((subtask, index) => {
|
|
20166
|
+
const statusIcon = subtask.status === "completed" ? "\u2705" : subtask.status === "in_progress" ? "\u25B6\uFE0F" : "\u23F3";
|
|
20167
|
+
const isActive = index === task.currentSubtaskIndex ? " \u2190 **Active**" : "";
|
|
20168
|
+
lines.push(`${index + 1}. ${statusIcon} ${subtask.description}${isActive}`);
|
|
20169
|
+
});
|
|
20170
|
+
lines.push("");
|
|
20171
|
+
const completed = task.subtasks.filter((s) => s.status === "completed").length;
|
|
20172
|
+
const total = task.subtasks.length;
|
|
20173
|
+
const percentage = Math.round(completed / total * 100);
|
|
20174
|
+
lines.push(`**Progress**: ${completed}/${total} (${percentage}%)`);
|
|
20175
|
+
lines.push("");
|
|
20176
|
+
}
|
|
20177
|
+
} else {
|
|
20178
|
+
lines.push("*No active task*");
|
|
20179
|
+
lines.push("");
|
|
20180
|
+
lines.push('Start a task with `p. task "description"`');
|
|
20181
|
+
lines.push("");
|
|
20182
|
+
}
|
|
20183
|
+
if (state.previousTask) {
|
|
20184
|
+
const prevTask = state.previousTask;
|
|
20185
|
+
lines.push("---");
|
|
20186
|
+
lines.push("");
|
|
20187
|
+
lines.push("## Previous Task");
|
|
20188
|
+
lines.push("");
|
|
20189
|
+
lines.push(`**${prevTask.description}**`);
|
|
20190
|
+
lines.push("");
|
|
20191
|
+
lines.push(`- Status: ${prevTask.status}`);
|
|
20192
|
+
if (prevTask.prUrl) {
|
|
20193
|
+
lines.push(`- PR: ${prevTask.prUrl}`);
|
|
20194
|
+
}
|
|
20195
|
+
lines.push("");
|
|
20196
|
+
}
|
|
20197
|
+
lines.push("---");
|
|
20198
|
+
lines.push(`*Last updated: ${state.lastUpdated || (/* @__PURE__ */ new Date()).toISOString()}*`);
|
|
20199
|
+
lines.push("");
|
|
20200
|
+
return lines.join("\n");
|
|
20201
|
+
}
|
|
20202
|
+
};
|
|
20203
|
+
localStateGenerator = new LocalStateGenerator();
|
|
20204
|
+
}
|
|
20205
|
+
});
|
|
20206
|
+
|
|
20207
|
+
// core/services/stack-detector.ts
|
|
20208
|
+
import fs41 from "node:fs/promises";
|
|
20209
|
+
import path43 from "node:path";
|
|
20094
20210
|
var StackDetector;
|
|
20095
20211
|
var init_stack_detector = __esm({
|
|
20096
20212
|
"core/services/stack-detector.ts"() {
|
|
@@ -20249,8 +20365,8 @@ var init_stack_detector = __esm({
|
|
|
20249
20365
|
*/
|
|
20250
20366
|
async readPackageJson() {
|
|
20251
20367
|
try {
|
|
20252
|
-
const pkgPath =
|
|
20253
|
-
const content = await
|
|
20368
|
+
const pkgPath = path43.join(this.projectPath, "package.json");
|
|
20369
|
+
const content = await fs41.readFile(pkgPath, "utf-8");
|
|
20254
20370
|
return JSON.parse(content);
|
|
20255
20371
|
} catch {
|
|
20256
20372
|
return null;
|
|
@@ -20261,7 +20377,7 @@ var init_stack_detector = __esm({
|
|
|
20261
20377
|
*/
|
|
20262
20378
|
async fileExists(filename) {
|
|
20263
20379
|
try {
|
|
20264
|
-
await
|
|
20380
|
+
await fs41.access(path43.join(this.projectPath, filename));
|
|
20265
20381
|
return true;
|
|
20266
20382
|
} catch {
|
|
20267
20383
|
return false;
|
|
@@ -20273,8 +20389,8 @@ var init_stack_detector = __esm({
|
|
|
20273
20389
|
|
|
20274
20390
|
// core/services/sync-service.ts
|
|
20275
20391
|
import { exec as exec11 } from "node:child_process";
|
|
20276
|
-
import
|
|
20277
|
-
import
|
|
20392
|
+
import fs42 from "node:fs/promises";
|
|
20393
|
+
import path44 from "node:path";
|
|
20278
20394
|
import { promisify as promisify11 } from "node:util";
|
|
20279
20395
|
var execAsync6, SyncService, syncService;
|
|
20280
20396
|
var init_sync_service = __esm({
|
|
@@ -20287,6 +20403,7 @@ var init_sync_service = __esm({
|
|
|
20287
20403
|
init_metrics_storage();
|
|
20288
20404
|
init_date_helper();
|
|
20289
20405
|
init_context_generator();
|
|
20406
|
+
init_local_state_generator();
|
|
20290
20407
|
init_stack_detector();
|
|
20291
20408
|
execAsync6 = promisify11(exec11);
|
|
20292
20409
|
SyncService = class {
|
|
@@ -20423,7 +20540,7 @@ var init_sync_service = __esm({
|
|
|
20423
20540
|
async ensureDirectories() {
|
|
20424
20541
|
const dirs = ["storage", "context", "agents", "memory", "analysis", "config", "sync"];
|
|
20425
20542
|
await Promise.all(
|
|
20426
|
-
dirs.map((dir) =>
|
|
20543
|
+
dirs.map((dir) => fs42.mkdir(path44.join(this.globalPath, dir), { recursive: true }))
|
|
20427
20544
|
);
|
|
20428
20545
|
}
|
|
20429
20546
|
// ==========================================================================
|
|
@@ -20493,7 +20610,7 @@ var init_sync_service = __esm({
|
|
|
20493
20610
|
const stats = {
|
|
20494
20611
|
fileCount: 0,
|
|
20495
20612
|
version: "0.0.0",
|
|
20496
|
-
name:
|
|
20613
|
+
name: path44.basename(this.projectPath),
|
|
20497
20614
|
ecosystem: "unknown",
|
|
20498
20615
|
projectType: "simple",
|
|
20499
20616
|
languages: [],
|
|
@@ -20509,8 +20626,8 @@ var init_sync_service = __esm({
|
|
|
20509
20626
|
stats.fileCount = 0;
|
|
20510
20627
|
}
|
|
20511
20628
|
try {
|
|
20512
|
-
const pkgPath =
|
|
20513
|
-
const pkg = JSON.parse(await
|
|
20629
|
+
const pkgPath = path44.join(this.projectPath, "package.json");
|
|
20630
|
+
const pkg = JSON.parse(await fs42.readFile(pkgPath, "utf-8"));
|
|
20514
20631
|
stats.version = pkg.version || "0.0.0";
|
|
20515
20632
|
stats.name = pkg.name || stats.name;
|
|
20516
20633
|
stats.ecosystem = "JavaScript";
|
|
@@ -20618,12 +20735,12 @@ var init_sync_service = __esm({
|
|
|
20618
20735
|
// ==========================================================================
|
|
20619
20736
|
async generateAgents(stack, stats) {
|
|
20620
20737
|
const agents = [];
|
|
20621
|
-
const agentsPath =
|
|
20738
|
+
const agentsPath = path44.join(this.globalPath, "agents");
|
|
20622
20739
|
try {
|
|
20623
|
-
const files = await
|
|
20740
|
+
const files = await fs42.readdir(agentsPath);
|
|
20624
20741
|
for (const file of files) {
|
|
20625
20742
|
if (file.endsWith(".md")) {
|
|
20626
|
-
await
|
|
20743
|
+
await fs42.unlink(path44.join(agentsPath, file));
|
|
20627
20744
|
}
|
|
20628
20745
|
}
|
|
20629
20746
|
} catch {
|
|
@@ -20663,7 +20780,7 @@ var init_sync_service = __esm({
|
|
|
20663
20780
|
async generateWorkflowAgent(name, agentsPath) {
|
|
20664
20781
|
let content = "";
|
|
20665
20782
|
try {
|
|
20666
|
-
const templatePath =
|
|
20783
|
+
const templatePath = path44.join(
|
|
20667
20784
|
__dirname,
|
|
20668
20785
|
"..",
|
|
20669
20786
|
"..",
|
|
@@ -20672,16 +20789,16 @@ var init_sync_service = __esm({
|
|
|
20672
20789
|
"workflow",
|
|
20673
20790
|
`${name}.md`
|
|
20674
20791
|
);
|
|
20675
|
-
content = await
|
|
20792
|
+
content = await fs42.readFile(templatePath, "utf-8");
|
|
20676
20793
|
} catch {
|
|
20677
20794
|
content = this.generateMinimalWorkflowAgent(name);
|
|
20678
20795
|
}
|
|
20679
|
-
await
|
|
20796
|
+
await fs42.writeFile(path44.join(agentsPath, `${name}.md`), content, "utf-8");
|
|
20680
20797
|
}
|
|
20681
20798
|
async generateDomainAgent(name, agentsPath, stats, stack) {
|
|
20682
20799
|
let content = "";
|
|
20683
20800
|
try {
|
|
20684
|
-
const templatePath =
|
|
20801
|
+
const templatePath = path44.join(
|
|
20685
20802
|
__dirname,
|
|
20686
20803
|
"..",
|
|
20687
20804
|
"..",
|
|
@@ -20690,14 +20807,14 @@ var init_sync_service = __esm({
|
|
|
20690
20807
|
"domain",
|
|
20691
20808
|
`${name}.md`
|
|
20692
20809
|
);
|
|
20693
|
-
content = await
|
|
20810
|
+
content = await fs42.readFile(templatePath, "utf-8");
|
|
20694
20811
|
content = content.replace("{projectName}", stats.name);
|
|
20695
20812
|
content = content.replace("{frameworks}", stack.frameworks.join(", ") || "None detected");
|
|
20696
20813
|
content = content.replace("{ecosystem}", stats.ecosystem);
|
|
20697
20814
|
} catch {
|
|
20698
20815
|
content = this.generateMinimalDomainAgent(name, stats, stack);
|
|
20699
20816
|
}
|
|
20700
|
-
await
|
|
20817
|
+
await fs42.writeFile(path44.join(agentsPath, `${name}.md`), content, "utf-8");
|
|
20701
20818
|
}
|
|
20702
20819
|
generateMinimalWorkflowAgent(name) {
|
|
20703
20820
|
const descriptions = {
|
|
@@ -20765,8 +20882,8 @@ You are the ${name} expert for this project. Apply best practices for the detect
|
|
|
20765
20882
|
})),
|
|
20766
20883
|
agentSkillMap: Object.fromEntries(skills.map((s) => [s.agent, s.skill]))
|
|
20767
20884
|
};
|
|
20768
|
-
|
|
20769
|
-
|
|
20885
|
+
fs42.writeFile(
|
|
20886
|
+
path44.join(this.globalPath, "config", "skills.json"),
|
|
20770
20887
|
JSON.stringify(skillsConfig, null, 2),
|
|
20771
20888
|
"utf-8"
|
|
20772
20889
|
).catch(() => {
|
|
@@ -20788,10 +20905,10 @@ You are the ${name} expert for this project. Apply best practices for the detect
|
|
|
20788
20905
|
// PROJECT.JSON UPDATE
|
|
20789
20906
|
// ==========================================================================
|
|
20790
20907
|
async updateProjectJson(git, stats) {
|
|
20791
|
-
const projectJsonPath =
|
|
20908
|
+
const projectJsonPath = path44.join(this.globalPath, "project.json");
|
|
20792
20909
|
let existing = {};
|
|
20793
20910
|
try {
|
|
20794
|
-
existing = JSON.parse(await
|
|
20911
|
+
existing = JSON.parse(await fs42.readFile(projectJsonPath, "utf-8"));
|
|
20795
20912
|
} catch {
|
|
20796
20913
|
}
|
|
20797
20914
|
const updated = {
|
|
@@ -20813,16 +20930,16 @@ You are the ${name} expert for this project. Apply best practices for the detect
|
|
|
20813
20930
|
lastSyncCommit: git.recentCommits[0]?.hash || null,
|
|
20814
20931
|
lastSyncBranch: git.branch
|
|
20815
20932
|
};
|
|
20816
|
-
await
|
|
20933
|
+
await fs42.writeFile(projectJsonPath, JSON.stringify(updated, null, 2), "utf-8");
|
|
20817
20934
|
}
|
|
20818
20935
|
// ==========================================================================
|
|
20819
20936
|
// STATE.JSON UPDATE
|
|
20820
20937
|
// ==========================================================================
|
|
20821
20938
|
async updateStateJson(stats, stack) {
|
|
20822
|
-
const statePath =
|
|
20939
|
+
const statePath = path44.join(this.globalPath, "storage", "state.json");
|
|
20823
20940
|
let state = {};
|
|
20824
20941
|
try {
|
|
20825
|
-
state = JSON.parse(await
|
|
20942
|
+
state = JSON.parse(await fs42.readFile(statePath, "utf-8"));
|
|
20826
20943
|
} catch {
|
|
20827
20944
|
}
|
|
20828
20945
|
state.projectId = this.projectId;
|
|
@@ -20849,13 +20966,20 @@ You are the ${name} expert for this project. Apply best practices for the detect
|
|
|
20849
20966
|
lastAction: "Synced project",
|
|
20850
20967
|
nextAction: 'Run `p. task "description"` to start working'
|
|
20851
20968
|
};
|
|
20852
|
-
await
|
|
20969
|
+
await fs42.writeFile(statePath, JSON.stringify(state, null, 2), "utf-8");
|
|
20970
|
+
try {
|
|
20971
|
+
await localStateGenerator.generate(
|
|
20972
|
+
this.projectPath,
|
|
20973
|
+
state
|
|
20974
|
+
);
|
|
20975
|
+
} catch {
|
|
20976
|
+
}
|
|
20853
20977
|
}
|
|
20854
20978
|
// ==========================================================================
|
|
20855
20979
|
// MEMORY LOGGING
|
|
20856
20980
|
// ==========================================================================
|
|
20857
20981
|
async logToMemory(git, stats) {
|
|
20858
|
-
const memoryPath =
|
|
20982
|
+
const memoryPath = path44.join(this.globalPath, "memory", "events.jsonl");
|
|
20859
20983
|
const event = {
|
|
20860
20984
|
ts: date_helper_default.getTimestamp(),
|
|
20861
20985
|
action: "sync",
|
|
@@ -20864,7 +20988,7 @@ You are the ${name} expert for this project. Apply best practices for the detect
|
|
|
20864
20988
|
fileCount: stats.fileCount,
|
|
20865
20989
|
commitCount: git.commits
|
|
20866
20990
|
};
|
|
20867
|
-
await
|
|
20991
|
+
await fs42.appendFile(memoryPath, `${JSON.stringify(event)}
|
|
20868
20992
|
`, "utf-8");
|
|
20869
20993
|
}
|
|
20870
20994
|
// ==========================================================================
|
|
@@ -20884,16 +21008,16 @@ You are the ${name} expert for this project. Apply best practices for the detect
|
|
|
20884
21008
|
let filteredChars = 0;
|
|
20885
21009
|
for (const file of contextFiles) {
|
|
20886
21010
|
try {
|
|
20887
|
-
const filePath =
|
|
20888
|
-
const content = await
|
|
21011
|
+
const filePath = path44.join(this.globalPath, file);
|
|
21012
|
+
const content = await fs42.readFile(filePath, "utf-8");
|
|
20889
21013
|
filteredChars += content.length;
|
|
20890
21014
|
} catch {
|
|
20891
21015
|
}
|
|
20892
21016
|
}
|
|
20893
21017
|
for (const agent of agents) {
|
|
20894
21018
|
try {
|
|
20895
|
-
const agentPath =
|
|
20896
|
-
const content = await
|
|
21019
|
+
const agentPath = path44.join(this.globalPath, "agents", `${agent.name}.md`);
|
|
21020
|
+
const content = await fs42.readFile(agentPath, "utf-8");
|
|
20897
21021
|
filteredChars += content.length;
|
|
20898
21022
|
} catch {
|
|
20899
21023
|
}
|
|
@@ -20925,7 +21049,7 @@ You are the ${name} expert for this project. Apply best practices for the detect
|
|
|
20925
21049
|
// ==========================================================================
|
|
20926
21050
|
async fileExists(filename) {
|
|
20927
21051
|
try {
|
|
20928
|
-
await
|
|
21052
|
+
await fs42.access(path44.join(this.projectPath, filename));
|
|
20929
21053
|
return true;
|
|
20930
21054
|
} catch {
|
|
20931
21055
|
return false;
|
|
@@ -20933,8 +21057,8 @@ You are the ${name} expert for this project. Apply best practices for the detect
|
|
|
20933
21057
|
}
|
|
20934
21058
|
async getCliVersion() {
|
|
20935
21059
|
try {
|
|
20936
|
-
const pkgPath =
|
|
20937
|
-
const pkg = JSON.parse(await
|
|
21060
|
+
const pkgPath = path44.join(__dirname, "..", "..", "package.json");
|
|
21061
|
+
const pkg = JSON.parse(await fs42.readFile(pkgPath, "utf-8"));
|
|
20938
21062
|
return pkg.version || "0.0.0";
|
|
20939
21063
|
} catch {
|
|
20940
21064
|
return "0.0.0";
|
|
@@ -21095,22 +21219,22 @@ __export(uninstall_exports, {
|
|
|
21095
21219
|
});
|
|
21096
21220
|
import { execSync as execSync5 } from "node:child_process";
|
|
21097
21221
|
import fsSync2 from "node:fs";
|
|
21098
|
-
import
|
|
21222
|
+
import fs43 from "node:fs/promises";
|
|
21099
21223
|
import os12 from "node:os";
|
|
21100
|
-
import
|
|
21224
|
+
import path45 from "node:path";
|
|
21101
21225
|
import readline2 from "node:readline";
|
|
21102
21226
|
import chalk9 from "chalk";
|
|
21103
21227
|
async function getDirectorySize(dirPath) {
|
|
21104
21228
|
let totalSize = 0;
|
|
21105
21229
|
try {
|
|
21106
|
-
const entries = await
|
|
21230
|
+
const entries = await fs43.readdir(dirPath, { withFileTypes: true });
|
|
21107
21231
|
for (const entry of entries) {
|
|
21108
|
-
const entryPath =
|
|
21232
|
+
const entryPath = path45.join(dirPath, entry.name);
|
|
21109
21233
|
if (entry.isDirectory()) {
|
|
21110
21234
|
totalSize += await getDirectorySize(entryPath);
|
|
21111
21235
|
} else {
|
|
21112
21236
|
try {
|
|
21113
|
-
const stats = await
|
|
21237
|
+
const stats = await fs43.stat(entryPath);
|
|
21114
21238
|
totalSize += stats.size;
|
|
21115
21239
|
} catch {
|
|
21116
21240
|
}
|
|
@@ -21129,7 +21253,7 @@ function formatSize(bytes) {
|
|
|
21129
21253
|
}
|
|
21130
21254
|
async function countDirectoryItems(dirPath) {
|
|
21131
21255
|
try {
|
|
21132
|
-
const entries = await
|
|
21256
|
+
const entries = await fs43.readdir(dirPath, { withFileTypes: true });
|
|
21133
21257
|
return entries.filter((e) => e.isDirectory()).length;
|
|
21134
21258
|
} catch {
|
|
21135
21259
|
return 0;
|
|
@@ -21162,7 +21286,7 @@ async function gatherUninstallItems() {
|
|
|
21162
21286
|
const providerPaths = getProviderPaths();
|
|
21163
21287
|
const prjctCliPath = path_manager_default.getGlobalBasePath();
|
|
21164
21288
|
const prjctCliExists = fsSync2.existsSync(prjctCliPath);
|
|
21165
|
-
const projectCount = prjctCliExists ? await countDirectoryItems(
|
|
21289
|
+
const projectCount = prjctCliExists ? await countDirectoryItems(path45.join(prjctCliPath, "projects")) : 0;
|
|
21166
21290
|
const prjctCliSize = prjctCliExists ? await getDirectorySize(prjctCliPath) : 0;
|
|
21167
21291
|
items.push({
|
|
21168
21292
|
path: prjctCliPath,
|
|
@@ -21172,7 +21296,7 @@ async function gatherUninstallItems() {
|
|
|
21172
21296
|
count: projectCount,
|
|
21173
21297
|
exists: prjctCliExists
|
|
21174
21298
|
});
|
|
21175
|
-
const claudeMdPath =
|
|
21299
|
+
const claudeMdPath = path45.join(providerPaths.claude.config, "CLAUDE.md");
|
|
21176
21300
|
const claudeMdExists = fsSync2.existsSync(claudeMdPath);
|
|
21177
21301
|
let hasPrjctSection = false;
|
|
21178
21302
|
if (claudeMdExists) {
|
|
@@ -21206,7 +21330,7 @@ async function gatherUninstallItems() {
|
|
|
21206
21330
|
description: "Claude router",
|
|
21207
21331
|
exists: claudeRouterExists
|
|
21208
21332
|
});
|
|
21209
|
-
const statusLinePath =
|
|
21333
|
+
const statusLinePath = path45.join(providerPaths.claude.config, "prjct-statusline.sh");
|
|
21210
21334
|
const statusLineExists = fsSync2.existsSync(statusLinePath);
|
|
21211
21335
|
items.push({
|
|
21212
21336
|
path: statusLinePath,
|
|
@@ -21222,7 +21346,7 @@ async function gatherUninstallItems() {
|
|
|
21222
21346
|
description: "Gemini router",
|
|
21223
21347
|
exists: geminiRouterExists
|
|
21224
21348
|
});
|
|
21225
|
-
const geminiMdPath =
|
|
21349
|
+
const geminiMdPath = path45.join(providerPaths.gemini.config, "GEMINI.md");
|
|
21226
21350
|
const geminiMdExists = fsSync2.existsSync(geminiMdPath);
|
|
21227
21351
|
let hasGeminiPrjctSection = false;
|
|
21228
21352
|
if (geminiMdExists) {
|
|
@@ -21244,7 +21368,7 @@ async function gatherUninstallItems() {
|
|
|
21244
21368
|
}
|
|
21245
21369
|
async function removePrjctSection(filePath) {
|
|
21246
21370
|
try {
|
|
21247
|
-
const content = await
|
|
21371
|
+
const content = await fs43.readFile(filePath, "utf-8");
|
|
21248
21372
|
if (!content.includes(PRJCT_START_MARKER) || !content.includes(PRJCT_END_MARKER)) {
|
|
21249
21373
|
return false;
|
|
21250
21374
|
}
|
|
@@ -21253,9 +21377,9 @@ async function removePrjctSection(filePath) {
|
|
|
21253
21377
|
let newContent = content.substring(0, startIndex) + content.substring(endIndex);
|
|
21254
21378
|
newContent = newContent.replace(/\n{3,}/g, "\n\n").trim();
|
|
21255
21379
|
if (!newContent || newContent.trim().length === 0) {
|
|
21256
|
-
await
|
|
21380
|
+
await fs43.unlink(filePath);
|
|
21257
21381
|
} else {
|
|
21258
|
-
await
|
|
21382
|
+
await fs43.writeFile(filePath, `${newContent}
|
|
21259
21383
|
`, "utf-8");
|
|
21260
21384
|
}
|
|
21261
21385
|
return true;
|
|
@@ -21266,12 +21390,12 @@ async function removePrjctSection(filePath) {
|
|
|
21266
21390
|
async function createBackup() {
|
|
21267
21391
|
const homeDir = os12.homedir();
|
|
21268
21392
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").substring(0, 19);
|
|
21269
|
-
const backupDir =
|
|
21393
|
+
const backupDir = path45.join(homeDir, `.prjct-backup-${timestamp}`);
|
|
21270
21394
|
try {
|
|
21271
|
-
await
|
|
21395
|
+
await fs43.mkdir(backupDir, { recursive: true });
|
|
21272
21396
|
const prjctCliPath = path_manager_default.getGlobalBasePath();
|
|
21273
21397
|
if (fsSync2.existsSync(prjctCliPath)) {
|
|
21274
|
-
await copyDirectory(prjctCliPath,
|
|
21398
|
+
await copyDirectory(prjctCliPath, path45.join(backupDir, ".prjct-cli"));
|
|
21275
21399
|
}
|
|
21276
21400
|
return backupDir;
|
|
21277
21401
|
} catch {
|
|
@@ -21279,15 +21403,15 @@ async function createBackup() {
|
|
|
21279
21403
|
}
|
|
21280
21404
|
}
|
|
21281
21405
|
async function copyDirectory(src, dest) {
|
|
21282
|
-
await
|
|
21283
|
-
const entries = await
|
|
21406
|
+
await fs43.mkdir(dest, { recursive: true });
|
|
21407
|
+
const entries = await fs43.readdir(src, { withFileTypes: true });
|
|
21284
21408
|
for (const entry of entries) {
|
|
21285
|
-
const srcPath =
|
|
21286
|
-
const destPath =
|
|
21409
|
+
const srcPath = path45.join(src, entry.name);
|
|
21410
|
+
const destPath = path45.join(dest, entry.name);
|
|
21287
21411
|
if (entry.isDirectory()) {
|
|
21288
21412
|
await copyDirectory(srcPath, destPath);
|
|
21289
21413
|
} else {
|
|
21290
|
-
await
|
|
21414
|
+
await fs43.copyFile(srcPath, destPath);
|
|
21291
21415
|
}
|
|
21292
21416
|
}
|
|
21293
21417
|
}
|
|
@@ -21303,10 +21427,10 @@ async function performUninstall(items, installation, options) {
|
|
|
21303
21427
|
deleted.push(item.path);
|
|
21304
21428
|
}
|
|
21305
21429
|
} else if (item.type === "directory") {
|
|
21306
|
-
await
|
|
21430
|
+
await fs43.rm(item.path, { recursive: true, force: true });
|
|
21307
21431
|
deleted.push(item.path);
|
|
21308
21432
|
} else if (item.type === "file") {
|
|
21309
|
-
await
|
|
21433
|
+
await fs43.unlink(item.path);
|
|
21310
21434
|
deleted.push(item.path);
|
|
21311
21435
|
}
|
|
21312
21436
|
} catch (error) {
|
|
@@ -21481,7 +21605,7 @@ __export(watch_service_exports, {
|
|
|
21481
21605
|
WatchService: () => WatchService,
|
|
21482
21606
|
watchService: () => watchService
|
|
21483
21607
|
});
|
|
21484
|
-
import
|
|
21608
|
+
import path46 from "node:path";
|
|
21485
21609
|
import chalk10 from "chalk";
|
|
21486
21610
|
import chokidar from "chokidar";
|
|
21487
21611
|
var TRIGGER_PATTERNS, IGNORE_PATTERNS2, WatchService, watchService;
|
|
@@ -21686,7 +21810,7 @@ ${chalk10.dim(`[${timestamp}]`)} ${chalk10.cyan("\u27F3")} ${filesSummary} chang
|
|
|
21686
21810
|
printStartup() {
|
|
21687
21811
|
console.log("");
|
|
21688
21812
|
console.log(chalk10.cyan("\u{1F441}\uFE0F Watching for changes..."));
|
|
21689
|
-
console.log(chalk10.dim(` Project: ${
|
|
21813
|
+
console.log(chalk10.dim(` Project: ${path46.basename(this.projectPath)}`));
|
|
21690
21814
|
console.log(chalk10.dim(` Debounce: ${this.options.debounceMs}ms`));
|
|
21691
21815
|
console.log(chalk10.dim(` Min interval: ${this.options.minIntervalMs / 1e3}s`));
|
|
21692
21816
|
console.log("");
|
|
@@ -22359,9 +22483,9 @@ __export(setup_exports, {
|
|
|
22359
22483
|
run: () => run
|
|
22360
22484
|
});
|
|
22361
22485
|
import { execSync as execSync6 } from "node:child_process";
|
|
22362
|
-
import
|
|
22486
|
+
import fs44 from "node:fs";
|
|
22363
22487
|
import os13 from "node:os";
|
|
22364
|
-
import
|
|
22488
|
+
import path47 from "node:path";
|
|
22365
22489
|
async function installAICLI(provider) {
|
|
22366
22490
|
const packageName = provider.name === "claude" ? "@anthropic-ai/claude-code" : "@google/gemini-cli";
|
|
22367
22491
|
try {
|
|
@@ -22467,12 +22591,12 @@ async function run() {
|
|
|
22467
22591
|
}
|
|
22468
22592
|
async function installGeminiRouter() {
|
|
22469
22593
|
try {
|
|
22470
|
-
const geminiCommandsDir =
|
|
22471
|
-
const routerSource =
|
|
22472
|
-
const routerDest =
|
|
22473
|
-
|
|
22474
|
-
if (
|
|
22475
|
-
|
|
22594
|
+
const geminiCommandsDir = path47.join(os13.homedir(), ".gemini", "commands");
|
|
22595
|
+
const routerSource = path47.join(getPackageRoot(), "templates", "commands", "p.toml");
|
|
22596
|
+
const routerDest = path47.join(geminiCommandsDir, "p.toml");
|
|
22597
|
+
fs44.mkdirSync(geminiCommandsDir, { recursive: true });
|
|
22598
|
+
if (fs44.existsSync(routerSource)) {
|
|
22599
|
+
fs44.copyFileSync(routerSource, routerDest);
|
|
22476
22600
|
return true;
|
|
22477
22601
|
}
|
|
22478
22602
|
return false;
|
|
@@ -22483,15 +22607,15 @@ async function installGeminiRouter() {
|
|
|
22483
22607
|
}
|
|
22484
22608
|
async function installGeminiGlobalConfig() {
|
|
22485
22609
|
try {
|
|
22486
|
-
const geminiDir =
|
|
22487
|
-
const globalConfigPath =
|
|
22488
|
-
const templatePath =
|
|
22489
|
-
|
|
22490
|
-
const templateContent =
|
|
22610
|
+
const geminiDir = path47.join(os13.homedir(), ".gemini");
|
|
22611
|
+
const globalConfigPath = path47.join(geminiDir, "GEMINI.md");
|
|
22612
|
+
const templatePath = path47.join(getPackageRoot(), "templates", "global", "GEMINI.md");
|
|
22613
|
+
fs44.mkdirSync(geminiDir, { recursive: true });
|
|
22614
|
+
const templateContent = fs44.readFileSync(templatePath, "utf-8");
|
|
22491
22615
|
let existingContent = "";
|
|
22492
22616
|
let fileExists2 = false;
|
|
22493
22617
|
try {
|
|
22494
|
-
existingContent =
|
|
22618
|
+
existingContent = fs44.readFileSync(globalConfigPath, "utf-8");
|
|
22495
22619
|
fileExists2 = true;
|
|
22496
22620
|
} catch (error) {
|
|
22497
22621
|
if (isNotFoundError(error)) {
|
|
@@ -22501,7 +22625,7 @@ async function installGeminiGlobalConfig() {
|
|
|
22501
22625
|
}
|
|
22502
22626
|
}
|
|
22503
22627
|
if (!fileExists2) {
|
|
22504
|
-
|
|
22628
|
+
fs44.writeFileSync(globalConfigPath, templateContent, "utf-8");
|
|
22505
22629
|
return { success: true, action: "created" };
|
|
22506
22630
|
}
|
|
22507
22631
|
const startMarker = "<!-- prjct:start - DO NOT REMOVE THIS MARKER -->";
|
|
@@ -22511,7 +22635,7 @@ async function installGeminiGlobalConfig() {
|
|
|
22511
22635
|
const updatedContent2 = `${existingContent}
|
|
22512
22636
|
|
|
22513
22637
|
${templateContent}`;
|
|
22514
|
-
|
|
22638
|
+
fs44.writeFileSync(globalConfigPath, updatedContent2, "utf-8");
|
|
22515
22639
|
return { success: true, action: "appended" };
|
|
22516
22640
|
}
|
|
22517
22641
|
const beforeMarker = existingContent.substring(0, existingContent.indexOf(startMarker));
|
|
@@ -22523,7 +22647,7 @@ ${templateContent}`;
|
|
|
22523
22647
|
templateContent.indexOf(endMarker) + endMarker.length
|
|
22524
22648
|
);
|
|
22525
22649
|
const updatedContent = beforeMarker + prjctSection + afterMarker;
|
|
22526
|
-
|
|
22650
|
+
fs44.writeFileSync(globalConfigPath, updatedContent, "utf-8");
|
|
22527
22651
|
return { success: true, action: "updated" };
|
|
22528
22652
|
} catch (error) {
|
|
22529
22653
|
console.error(`Gemini config warning: ${error.message}`);
|
|
@@ -22532,18 +22656,18 @@ ${templateContent}`;
|
|
|
22532
22656
|
}
|
|
22533
22657
|
async function installAntigravitySkill() {
|
|
22534
22658
|
try {
|
|
22535
|
-
const antigravitySkillsDir =
|
|
22536
|
-
const prjctSkillDir =
|
|
22537
|
-
const skillMdPath =
|
|
22538
|
-
const templatePath =
|
|
22539
|
-
|
|
22540
|
-
const fileExists2 =
|
|
22541
|
-
if (!
|
|
22659
|
+
const antigravitySkillsDir = path47.join(os13.homedir(), ".gemini", "antigravity", "skills");
|
|
22660
|
+
const prjctSkillDir = path47.join(antigravitySkillsDir, "prjct");
|
|
22661
|
+
const skillMdPath = path47.join(prjctSkillDir, "SKILL.md");
|
|
22662
|
+
const templatePath = path47.join(getPackageRoot(), "templates", "antigravity", "SKILL.md");
|
|
22663
|
+
fs44.mkdirSync(prjctSkillDir, { recursive: true });
|
|
22664
|
+
const fileExists2 = fs44.existsSync(skillMdPath);
|
|
22665
|
+
if (!fs44.existsSync(templatePath)) {
|
|
22542
22666
|
console.error("Antigravity SKILL.md template not found");
|
|
22543
22667
|
return { success: false, action: null };
|
|
22544
22668
|
}
|
|
22545
|
-
const templateContent =
|
|
22546
|
-
|
|
22669
|
+
const templateContent = fs44.readFileSync(templatePath, "utf-8");
|
|
22670
|
+
fs44.writeFileSync(skillMdPath, templateContent, "utf-8");
|
|
22547
22671
|
return { success: true, action: fileExists2 ? "updated" : "created" };
|
|
22548
22672
|
} catch (error) {
|
|
22549
22673
|
console.error(`Antigravity skill warning: ${error.message}`);
|
|
@@ -22562,24 +22686,24 @@ async function installCursorProject(projectRoot) {
|
|
|
22562
22686
|
gitignoreUpdated: false
|
|
22563
22687
|
};
|
|
22564
22688
|
try {
|
|
22565
|
-
const cursorDir =
|
|
22566
|
-
const rulesDir =
|
|
22567
|
-
const commandsDir =
|
|
22568
|
-
const routerMdcDest =
|
|
22569
|
-
const routerMdcSource =
|
|
22570
|
-
const cursorCommandsSource =
|
|
22571
|
-
|
|
22572
|
-
|
|
22573
|
-
if (
|
|
22574
|
-
|
|
22689
|
+
const cursorDir = path47.join(projectRoot, ".cursor");
|
|
22690
|
+
const rulesDir = path47.join(cursorDir, "rules");
|
|
22691
|
+
const commandsDir = path47.join(cursorDir, "commands");
|
|
22692
|
+
const routerMdcDest = path47.join(rulesDir, "prjct.mdc");
|
|
22693
|
+
const routerMdcSource = path47.join(getPackageRoot(), "templates", "cursor", "router.mdc");
|
|
22694
|
+
const cursorCommandsSource = path47.join(getPackageRoot(), "templates", "cursor", "commands");
|
|
22695
|
+
fs44.mkdirSync(rulesDir, { recursive: true });
|
|
22696
|
+
fs44.mkdirSync(commandsDir, { recursive: true });
|
|
22697
|
+
if (fs44.existsSync(routerMdcSource)) {
|
|
22698
|
+
fs44.copyFileSync(routerMdcSource, routerMdcDest);
|
|
22575
22699
|
result.rulesCreated = true;
|
|
22576
22700
|
}
|
|
22577
|
-
if (
|
|
22578
|
-
const commandFiles =
|
|
22701
|
+
if (fs44.existsSync(cursorCommandsSource)) {
|
|
22702
|
+
const commandFiles = fs44.readdirSync(cursorCommandsSource).filter((f) => f.endsWith(".md"));
|
|
22579
22703
|
for (const file of commandFiles) {
|
|
22580
|
-
const src =
|
|
22581
|
-
const dest =
|
|
22582
|
-
|
|
22704
|
+
const src = path47.join(cursorCommandsSource, file);
|
|
22705
|
+
const dest = path47.join(commandsDir, file);
|
|
22706
|
+
fs44.copyFileSync(src, dest);
|
|
22583
22707
|
}
|
|
22584
22708
|
result.commandsCreated = commandFiles.length > 0;
|
|
22585
22709
|
}
|
|
@@ -22593,7 +22717,7 @@ async function installCursorProject(projectRoot) {
|
|
|
22593
22717
|
}
|
|
22594
22718
|
async function addCursorToGitignore(projectRoot) {
|
|
22595
22719
|
try {
|
|
22596
|
-
const gitignorePath =
|
|
22720
|
+
const gitignorePath = path47.join(projectRoot, ".gitignore");
|
|
22597
22721
|
const entriesToAdd = [
|
|
22598
22722
|
"# prjct Cursor routers (regenerated per-developer)",
|
|
22599
22723
|
".cursor/rules/prjct.mdc",
|
|
@@ -22608,7 +22732,7 @@ async function addCursorToGitignore(projectRoot) {
|
|
|
22608
22732
|
let content = "";
|
|
22609
22733
|
let fileExists2 = false;
|
|
22610
22734
|
try {
|
|
22611
|
-
content =
|
|
22735
|
+
content = fs44.readFileSync(gitignorePath, "utf-8");
|
|
22612
22736
|
fileExists2 = true;
|
|
22613
22737
|
} catch (error) {
|
|
22614
22738
|
if (!isNotFoundError(error)) {
|
|
@@ -22623,7 +22747,7 @@ async function addCursorToGitignore(projectRoot) {
|
|
|
22623
22747
|
${entriesToAdd.join("\n")}
|
|
22624
22748
|
` : `${entriesToAdd.join("\n")}
|
|
22625
22749
|
`;
|
|
22626
|
-
|
|
22750
|
+
fs44.writeFileSync(gitignorePath, newContent, "utf-8");
|
|
22627
22751
|
return true;
|
|
22628
22752
|
} catch (error) {
|
|
22629
22753
|
console.error(`Gitignore update warning: ${error.message}`);
|
|
@@ -22631,12 +22755,12 @@ ${entriesToAdd.join("\n")}
|
|
|
22631
22755
|
}
|
|
22632
22756
|
}
|
|
22633
22757
|
function hasCursorProject(projectRoot) {
|
|
22634
|
-
return
|
|
22758
|
+
return fs44.existsSync(path47.join(projectRoot, ".cursor"));
|
|
22635
22759
|
}
|
|
22636
22760
|
function needsCursorRegeneration(projectRoot) {
|
|
22637
|
-
const cursorDir =
|
|
22638
|
-
const routerPath =
|
|
22639
|
-
return
|
|
22761
|
+
const cursorDir = path47.join(projectRoot, ".cursor");
|
|
22762
|
+
const routerPath = path47.join(cursorDir, "rules", "prjct.mdc");
|
|
22763
|
+
return fs44.existsSync(cursorDir) && !fs44.existsSync(routerPath);
|
|
22640
22764
|
}
|
|
22641
22765
|
async function installWindsurfProject(projectRoot) {
|
|
22642
22766
|
const result = {
|
|
@@ -22646,29 +22770,29 @@ async function installWindsurfProject(projectRoot) {
|
|
|
22646
22770
|
gitignoreUpdated: false
|
|
22647
22771
|
};
|
|
22648
22772
|
try {
|
|
22649
|
-
const windsurfDir =
|
|
22650
|
-
const rulesDir =
|
|
22651
|
-
const workflowsDir =
|
|
22652
|
-
const routerDest =
|
|
22653
|
-
const routerSource =
|
|
22654
|
-
const windsurfWorkflowsSource =
|
|
22773
|
+
const windsurfDir = path47.join(projectRoot, ".windsurf");
|
|
22774
|
+
const rulesDir = path47.join(windsurfDir, "rules");
|
|
22775
|
+
const workflowsDir = path47.join(windsurfDir, "workflows");
|
|
22776
|
+
const routerDest = path47.join(rulesDir, "prjct.md");
|
|
22777
|
+
const routerSource = path47.join(getPackageRoot(), "templates", "windsurf", "router.md");
|
|
22778
|
+
const windsurfWorkflowsSource = path47.join(
|
|
22655
22779
|
getPackageRoot(),
|
|
22656
22780
|
"templates",
|
|
22657
22781
|
"windsurf",
|
|
22658
22782
|
"workflows"
|
|
22659
22783
|
);
|
|
22660
|
-
|
|
22661
|
-
|
|
22662
|
-
if (
|
|
22663
|
-
|
|
22784
|
+
fs44.mkdirSync(rulesDir, { recursive: true });
|
|
22785
|
+
fs44.mkdirSync(workflowsDir, { recursive: true });
|
|
22786
|
+
if (fs44.existsSync(routerSource)) {
|
|
22787
|
+
fs44.copyFileSync(routerSource, routerDest);
|
|
22664
22788
|
result.rulesCreated = true;
|
|
22665
22789
|
}
|
|
22666
|
-
if (
|
|
22667
|
-
const workflowFiles =
|
|
22790
|
+
if (fs44.existsSync(windsurfWorkflowsSource)) {
|
|
22791
|
+
const workflowFiles = fs44.readdirSync(windsurfWorkflowsSource).filter((f) => f.endsWith(".md"));
|
|
22668
22792
|
for (const file of workflowFiles) {
|
|
22669
|
-
const src =
|
|
22670
|
-
const dest =
|
|
22671
|
-
|
|
22793
|
+
const src = path47.join(windsurfWorkflowsSource, file);
|
|
22794
|
+
const dest = path47.join(workflowsDir, file);
|
|
22795
|
+
fs44.copyFileSync(src, dest);
|
|
22672
22796
|
}
|
|
22673
22797
|
result.workflowsCreated = workflowFiles.length > 0;
|
|
22674
22798
|
}
|
|
@@ -22682,7 +22806,7 @@ async function installWindsurfProject(projectRoot) {
|
|
|
22682
22806
|
}
|
|
22683
22807
|
async function addWindsurfToGitignore(projectRoot) {
|
|
22684
22808
|
try {
|
|
22685
|
-
const gitignorePath =
|
|
22809
|
+
const gitignorePath = path47.join(projectRoot, ".gitignore");
|
|
22686
22810
|
const entriesToAdd = [
|
|
22687
22811
|
"# prjct Windsurf routers (regenerated per-developer)",
|
|
22688
22812
|
".windsurf/rules/prjct.md",
|
|
@@ -22697,7 +22821,7 @@ async function addWindsurfToGitignore(projectRoot) {
|
|
|
22697
22821
|
let content = "";
|
|
22698
22822
|
let fileExists2 = false;
|
|
22699
22823
|
try {
|
|
22700
|
-
content =
|
|
22824
|
+
content = fs44.readFileSync(gitignorePath, "utf-8");
|
|
22701
22825
|
fileExists2 = true;
|
|
22702
22826
|
} catch (error) {
|
|
22703
22827
|
if (!isNotFoundError(error)) {
|
|
@@ -22712,7 +22836,7 @@ async function addWindsurfToGitignore(projectRoot) {
|
|
|
22712
22836
|
${entriesToAdd.join("\n")}
|
|
22713
22837
|
` : `${entriesToAdd.join("\n")}
|
|
22714
22838
|
`;
|
|
22715
|
-
|
|
22839
|
+
fs44.writeFileSync(gitignorePath, newContent, "utf-8");
|
|
22716
22840
|
return true;
|
|
22717
22841
|
} catch (error) {
|
|
22718
22842
|
console.error(`Gitignore update warning: ${error.message}`);
|
|
@@ -22720,32 +22844,32 @@ ${entriesToAdd.join("\n")}
|
|
|
22720
22844
|
}
|
|
22721
22845
|
}
|
|
22722
22846
|
function hasWindsurfProject(projectRoot) {
|
|
22723
|
-
return
|
|
22847
|
+
return fs44.existsSync(path47.join(projectRoot, ".windsurf"));
|
|
22724
22848
|
}
|
|
22725
22849
|
function needsWindsurfRegeneration(projectRoot) {
|
|
22726
|
-
const windsurfDir =
|
|
22727
|
-
const routerPath =
|
|
22728
|
-
return
|
|
22850
|
+
const windsurfDir = path47.join(projectRoot, ".windsurf");
|
|
22851
|
+
const routerPath = path47.join(windsurfDir, "rules", "prjct.md");
|
|
22852
|
+
return fs44.existsSync(windsurfDir) && !fs44.existsSync(routerPath);
|
|
22729
22853
|
}
|
|
22730
22854
|
async function migrateProjectsCliVersion() {
|
|
22731
22855
|
try {
|
|
22732
|
-
const projectsDir =
|
|
22733
|
-
if (!
|
|
22856
|
+
const projectsDir = path47.join(os13.homedir(), ".prjct-cli", "projects");
|
|
22857
|
+
if (!fs44.existsSync(projectsDir)) {
|
|
22734
22858
|
return;
|
|
22735
22859
|
}
|
|
22736
|
-
const projectDirs =
|
|
22860
|
+
const projectDirs = fs44.readdirSync(projectsDir, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name);
|
|
22737
22861
|
let migrated = 0;
|
|
22738
22862
|
for (const projectId of projectDirs) {
|
|
22739
|
-
const projectJsonPath =
|
|
22740
|
-
if (!
|
|
22863
|
+
const projectJsonPath = path47.join(projectsDir, projectId, "project.json");
|
|
22864
|
+
if (!fs44.existsSync(projectJsonPath)) {
|
|
22741
22865
|
continue;
|
|
22742
22866
|
}
|
|
22743
22867
|
try {
|
|
22744
|
-
const content =
|
|
22868
|
+
const content = fs44.readFileSync(projectJsonPath, "utf8");
|
|
22745
22869
|
const project = JSON.parse(content);
|
|
22746
22870
|
if (project.cliVersion !== VERSION) {
|
|
22747
22871
|
project.cliVersion = VERSION;
|
|
22748
|
-
|
|
22872
|
+
fs44.writeFileSync(projectJsonPath, JSON.stringify(project, null, 2));
|
|
22749
22873
|
migrated++;
|
|
22750
22874
|
}
|
|
22751
22875
|
} catch (error) {
|
|
@@ -22765,9 +22889,9 @@ async function migrateProjectsCliVersion() {
|
|
|
22765
22889
|
}
|
|
22766
22890
|
function ensureStatusLineSettings(settingsPath, statusLinePath) {
|
|
22767
22891
|
let settings = {};
|
|
22768
|
-
if (
|
|
22892
|
+
if (fs44.existsSync(settingsPath)) {
|
|
22769
22893
|
try {
|
|
22770
|
-
settings = JSON.parse(
|
|
22894
|
+
settings = JSON.parse(fs44.readFileSync(settingsPath, "utf8"));
|
|
22771
22895
|
} catch (error) {
|
|
22772
22896
|
if (!(error instanceof SyntaxError)) {
|
|
22773
22897
|
throw error;
|
|
@@ -22775,42 +22899,42 @@ function ensureStatusLineSettings(settingsPath, statusLinePath) {
|
|
|
22775
22899
|
}
|
|
22776
22900
|
}
|
|
22777
22901
|
settings.statusLine = { type: "command", command: statusLinePath };
|
|
22778
|
-
|
|
22902
|
+
fs44.writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
|
|
22779
22903
|
}
|
|
22780
22904
|
async function installStatusLine() {
|
|
22781
22905
|
try {
|
|
22782
|
-
const claudeDir =
|
|
22783
|
-
const settingsPath =
|
|
22784
|
-
const claudeStatusLinePath =
|
|
22785
|
-
const prjctStatusLineDir =
|
|
22786
|
-
const prjctStatusLinePath =
|
|
22787
|
-
const prjctThemesDir =
|
|
22788
|
-
const prjctLibDir =
|
|
22789
|
-
const prjctComponentsDir =
|
|
22790
|
-
const prjctConfigPath =
|
|
22791
|
-
const assetsDir =
|
|
22792
|
-
const sourceScript =
|
|
22793
|
-
const sourceThemeDir =
|
|
22794
|
-
const sourceLibDir =
|
|
22795
|
-
const sourceComponentsDir =
|
|
22796
|
-
const sourceConfigPath =
|
|
22797
|
-
if (!
|
|
22798
|
-
|
|
22906
|
+
const claudeDir = path47.join(os13.homedir(), ".claude");
|
|
22907
|
+
const settingsPath = path47.join(claudeDir, "settings.json");
|
|
22908
|
+
const claudeStatusLinePath = path47.join(claudeDir, "prjct-statusline.sh");
|
|
22909
|
+
const prjctStatusLineDir = path47.join(os13.homedir(), ".prjct-cli", "statusline");
|
|
22910
|
+
const prjctStatusLinePath = path47.join(prjctStatusLineDir, "statusline.sh");
|
|
22911
|
+
const prjctThemesDir = path47.join(prjctStatusLineDir, "themes");
|
|
22912
|
+
const prjctLibDir = path47.join(prjctStatusLineDir, "lib");
|
|
22913
|
+
const prjctComponentsDir = path47.join(prjctStatusLineDir, "components");
|
|
22914
|
+
const prjctConfigPath = path47.join(prjctStatusLineDir, "config.json");
|
|
22915
|
+
const assetsDir = path47.join(getPackageRoot(), "assets", "statusline");
|
|
22916
|
+
const sourceScript = path47.join(assetsDir, "statusline.sh");
|
|
22917
|
+
const sourceThemeDir = path47.join(assetsDir, "themes");
|
|
22918
|
+
const sourceLibDir = path47.join(assetsDir, "lib");
|
|
22919
|
+
const sourceComponentsDir = path47.join(assetsDir, "components");
|
|
22920
|
+
const sourceConfigPath = path47.join(assetsDir, "default-config.json");
|
|
22921
|
+
if (!fs44.existsSync(claudeDir)) {
|
|
22922
|
+
fs44.mkdirSync(claudeDir, { recursive: true });
|
|
22799
22923
|
}
|
|
22800
|
-
if (!
|
|
22801
|
-
|
|
22924
|
+
if (!fs44.existsSync(prjctStatusLineDir)) {
|
|
22925
|
+
fs44.mkdirSync(prjctStatusLineDir, { recursive: true });
|
|
22802
22926
|
}
|
|
22803
|
-
if (!
|
|
22804
|
-
|
|
22927
|
+
if (!fs44.existsSync(prjctThemesDir)) {
|
|
22928
|
+
fs44.mkdirSync(prjctThemesDir, { recursive: true });
|
|
22805
22929
|
}
|
|
22806
|
-
if (!
|
|
22807
|
-
|
|
22930
|
+
if (!fs44.existsSync(prjctLibDir)) {
|
|
22931
|
+
fs44.mkdirSync(prjctLibDir, { recursive: true });
|
|
22808
22932
|
}
|
|
22809
|
-
if (!
|
|
22810
|
-
|
|
22933
|
+
if (!fs44.existsSync(prjctComponentsDir)) {
|
|
22934
|
+
fs44.mkdirSync(prjctComponentsDir, { recursive: true });
|
|
22811
22935
|
}
|
|
22812
|
-
if (
|
|
22813
|
-
const existingContent =
|
|
22936
|
+
if (fs44.existsSync(prjctStatusLinePath)) {
|
|
22937
|
+
const existingContent = fs44.readFileSync(prjctStatusLinePath, "utf8");
|
|
22814
22938
|
if (existingContent.includes("CLI_VERSION=")) {
|
|
22815
22939
|
const versionMatch = existingContent.match(/CLI_VERSION="([^"]*)"/);
|
|
22816
22940
|
if (versionMatch && versionMatch[1] !== VERSION) {
|
|
@@ -22818,7 +22942,7 @@ async function installStatusLine() {
|
|
|
22818
22942
|
/CLI_VERSION="[^"]*"/,
|
|
22819
22943
|
`CLI_VERSION="${VERSION}"`
|
|
22820
22944
|
);
|
|
22821
|
-
|
|
22945
|
+
fs44.writeFileSync(prjctStatusLinePath, updatedContent, { mode: 493 });
|
|
22822
22946
|
}
|
|
22823
22947
|
installStatusLineModules(sourceLibDir, prjctLibDir);
|
|
22824
22948
|
installStatusLineModules(sourceComponentsDir, prjctComponentsDir);
|
|
@@ -22827,22 +22951,22 @@ async function installStatusLine() {
|
|
|
22827
22951
|
return;
|
|
22828
22952
|
}
|
|
22829
22953
|
}
|
|
22830
|
-
if (
|
|
22831
|
-
let scriptContent =
|
|
22954
|
+
if (fs44.existsSync(sourceScript)) {
|
|
22955
|
+
let scriptContent = fs44.readFileSync(sourceScript, "utf8");
|
|
22832
22956
|
scriptContent = scriptContent.replace(/CLI_VERSION="[^"]*"/, `CLI_VERSION="${VERSION}"`);
|
|
22833
|
-
|
|
22957
|
+
fs44.writeFileSync(prjctStatusLinePath, scriptContent, { mode: 493 });
|
|
22834
22958
|
installStatusLineModules(sourceLibDir, prjctLibDir);
|
|
22835
22959
|
installStatusLineModules(sourceComponentsDir, prjctComponentsDir);
|
|
22836
|
-
if (
|
|
22837
|
-
const themes =
|
|
22960
|
+
if (fs44.existsSync(sourceThemeDir)) {
|
|
22961
|
+
const themes = fs44.readdirSync(sourceThemeDir);
|
|
22838
22962
|
for (const theme of themes) {
|
|
22839
|
-
const src =
|
|
22840
|
-
const dest =
|
|
22841
|
-
|
|
22963
|
+
const src = path47.join(sourceThemeDir, theme);
|
|
22964
|
+
const dest = path47.join(prjctThemesDir, theme);
|
|
22965
|
+
fs44.copyFileSync(src, dest);
|
|
22842
22966
|
}
|
|
22843
22967
|
}
|
|
22844
|
-
if (!
|
|
22845
|
-
|
|
22968
|
+
if (!fs44.existsSync(prjctConfigPath) && fs44.existsSync(sourceConfigPath)) {
|
|
22969
|
+
fs44.copyFileSync(sourceConfigPath, prjctConfigPath);
|
|
22846
22970
|
}
|
|
22847
22971
|
} else {
|
|
22848
22972
|
const scriptContent = `#!/bin/bash
|
|
@@ -22877,7 +23001,7 @@ if [ -f "$CONFIG" ]; then
|
|
|
22877
23001
|
fi
|
|
22878
23002
|
echo "prjct"
|
|
22879
23003
|
`;
|
|
22880
|
-
|
|
23004
|
+
fs44.writeFileSync(prjctStatusLinePath, scriptContent, { mode: 493 });
|
|
22881
23005
|
}
|
|
22882
23006
|
ensureStatusLineSymlink(claudeStatusLinePath, prjctStatusLinePath);
|
|
22883
23007
|
ensureStatusLineSettings(settingsPath, claudeStatusLinePath);
|
|
@@ -22889,10 +23013,10 @@ echo "prjct"
|
|
|
22889
23013
|
}
|
|
22890
23014
|
async function installContext7MCP() {
|
|
22891
23015
|
try {
|
|
22892
|
-
const claudeDir =
|
|
22893
|
-
const mcpConfigPath =
|
|
22894
|
-
if (!
|
|
22895
|
-
|
|
23016
|
+
const claudeDir = path47.join(os13.homedir(), ".claude");
|
|
23017
|
+
const mcpConfigPath = path47.join(claudeDir, "mcp.json");
|
|
23018
|
+
if (!fs44.existsSync(claudeDir)) {
|
|
23019
|
+
fs44.mkdirSync(claudeDir, { recursive: true });
|
|
22896
23020
|
}
|
|
22897
23021
|
const context7Config = {
|
|
22898
23022
|
mcpServers: {
|
|
@@ -22902,54 +23026,54 @@ async function installContext7MCP() {
|
|
|
22902
23026
|
}
|
|
22903
23027
|
}
|
|
22904
23028
|
};
|
|
22905
|
-
if (
|
|
22906
|
-
const existingContent =
|
|
23029
|
+
if (fs44.existsSync(mcpConfigPath)) {
|
|
23030
|
+
const existingContent = fs44.readFileSync(mcpConfigPath, "utf-8");
|
|
22907
23031
|
const existingConfig = JSON.parse(existingContent);
|
|
22908
23032
|
if (existingConfig.mcpServers?.context7) {
|
|
22909
23033
|
return;
|
|
22910
23034
|
}
|
|
22911
23035
|
existingConfig.mcpServers = existingConfig.mcpServers || {};
|
|
22912
23036
|
existingConfig.mcpServers.context7 = context7Config.mcpServers.context7;
|
|
22913
|
-
|
|
23037
|
+
fs44.writeFileSync(mcpConfigPath, JSON.stringify(existingConfig, null, 2), "utf-8");
|
|
22914
23038
|
} else {
|
|
22915
|
-
|
|
23039
|
+
fs44.writeFileSync(mcpConfigPath, JSON.stringify(context7Config, null, 2), "utf-8");
|
|
22916
23040
|
}
|
|
22917
23041
|
} catch (error) {
|
|
22918
23042
|
console.error(`Context7 MCP setup warning: ${error.message}`);
|
|
22919
23043
|
}
|
|
22920
23044
|
}
|
|
22921
23045
|
function installStatusLineModules(sourceDir, destDir) {
|
|
22922
|
-
if (!
|
|
23046
|
+
if (!fs44.existsSync(sourceDir)) {
|
|
22923
23047
|
return;
|
|
22924
23048
|
}
|
|
22925
|
-
const files =
|
|
23049
|
+
const files = fs44.readdirSync(sourceDir);
|
|
22926
23050
|
for (const file of files) {
|
|
22927
23051
|
if (file.endsWith(".sh")) {
|
|
22928
|
-
const src =
|
|
22929
|
-
const dest =
|
|
22930
|
-
|
|
22931
|
-
|
|
23052
|
+
const src = path47.join(sourceDir, file);
|
|
23053
|
+
const dest = path47.join(destDir, file);
|
|
23054
|
+
fs44.copyFileSync(src, dest);
|
|
23055
|
+
fs44.chmodSync(dest, 493);
|
|
22932
23056
|
}
|
|
22933
23057
|
}
|
|
22934
23058
|
}
|
|
22935
23059
|
function ensureStatusLineSymlink(linkPath, targetPath) {
|
|
22936
23060
|
try {
|
|
22937
|
-
if (
|
|
22938
|
-
const stats =
|
|
23061
|
+
if (fs44.existsSync(linkPath)) {
|
|
23062
|
+
const stats = fs44.lstatSync(linkPath);
|
|
22939
23063
|
if (stats.isSymbolicLink()) {
|
|
22940
|
-
const existingTarget =
|
|
23064
|
+
const existingTarget = fs44.readlinkSync(linkPath);
|
|
22941
23065
|
if (existingTarget === targetPath) {
|
|
22942
23066
|
return;
|
|
22943
23067
|
}
|
|
22944
23068
|
}
|
|
22945
|
-
|
|
23069
|
+
fs44.unlinkSync(linkPath);
|
|
22946
23070
|
}
|
|
22947
|
-
|
|
23071
|
+
fs44.symlinkSync(targetPath, linkPath);
|
|
22948
23072
|
} catch (_error) {
|
|
22949
23073
|
try {
|
|
22950
|
-
if (
|
|
22951
|
-
|
|
22952
|
-
|
|
23074
|
+
if (fs44.existsSync(targetPath)) {
|
|
23075
|
+
fs44.copyFileSync(targetPath, linkPath);
|
|
23076
|
+
fs44.chmodSync(linkPath, 493);
|
|
22953
23077
|
}
|
|
22954
23078
|
} catch (copyError) {
|
|
22955
23079
|
if (!isNotFoundError(copyError)) {
|
|
@@ -23364,7 +23488,7 @@ var init_registry2 = __esm({
|
|
|
23364
23488
|
});
|
|
23365
23489
|
|
|
23366
23490
|
// core/commands/analytics.ts
|
|
23367
|
-
import
|
|
23491
|
+
import path48 from "node:path";
|
|
23368
23492
|
var AnalyticsCommands;
|
|
23369
23493
|
var init_analytics = __esm({
|
|
23370
23494
|
"core/commands/analytics.ts"() {
|
|
@@ -23390,7 +23514,7 @@ var init_analytics = __esm({
|
|
|
23390
23514
|
output_default.failWithHint("NO_PROJECT_ID");
|
|
23391
23515
|
return { success: false, error: "No project ID found" };
|
|
23392
23516
|
}
|
|
23393
|
-
const projectName =
|
|
23517
|
+
const projectName = path48.basename(projectPath);
|
|
23394
23518
|
const currentTask = await stateStorage.getCurrentTask(projectId);
|
|
23395
23519
|
const queueTasks = await queueStorage.getActiveTasks(projectId);
|
|
23396
23520
|
const shipped = await shippedStorage.getRecent(projectId, 5);
|
|
@@ -23642,8 +23766,8 @@ ${"\u2550".repeat(50)}
|
|
|
23642
23766
|
});
|
|
23643
23767
|
|
|
23644
23768
|
// core/commands/context.ts
|
|
23645
|
-
import
|
|
23646
|
-
import
|
|
23769
|
+
import fs45 from "node:fs/promises";
|
|
23770
|
+
import path49 from "node:path";
|
|
23647
23771
|
var ContextCommands, contextCommands;
|
|
23648
23772
|
var init_context = __esm({
|
|
23649
23773
|
"core/commands/context.ts"() {
|
|
@@ -23769,8 +23893,8 @@ var init_context = __esm({
|
|
|
23769
23893
|
*/
|
|
23770
23894
|
async loadRepoAnalysis(globalPath) {
|
|
23771
23895
|
try {
|
|
23772
|
-
const analysisPath =
|
|
23773
|
-
const content = await
|
|
23896
|
+
const analysisPath = path49.join(globalPath, "analysis", "repo-analysis.json");
|
|
23897
|
+
const content = await fs45.readFile(analysisPath, "utf-8");
|
|
23774
23898
|
const data = JSON.parse(content);
|
|
23775
23899
|
return {
|
|
23776
23900
|
ecosystem: data.ecosystem || "unknown",
|
|
@@ -23789,7 +23913,7 @@ var init_context = __esm({
|
|
|
23789
23913
|
});
|
|
23790
23914
|
|
|
23791
23915
|
// core/commands/cleanup.ts
|
|
23792
|
-
import
|
|
23916
|
+
import path50 from "node:path";
|
|
23793
23917
|
async function cleanupMemory(projectPath) {
|
|
23794
23918
|
const projectId = await config_manager_default.getProjectId(projectPath);
|
|
23795
23919
|
const results = { rotated: [], totalSize: 0, freedSpace: 0 };
|
|
@@ -23805,7 +23929,7 @@ async function cleanupMemory(projectPath) {
|
|
|
23805
23929
|
results.totalSize += sizeMB;
|
|
23806
23930
|
const rotated = await jsonl_helper_default.rotateJsonLinesIfNeeded(filePath, 10);
|
|
23807
23931
|
if (rotated) {
|
|
23808
|
-
results.rotated.push(
|
|
23932
|
+
results.rotated.push(path50.basename(filePath));
|
|
23809
23933
|
results.freedSpace += sizeMB;
|
|
23810
23934
|
}
|
|
23811
23935
|
}
|
|
@@ -23912,7 +24036,7 @@ var init_cleanup = __esm({
|
|
|
23912
24036
|
});
|
|
23913
24037
|
|
|
23914
24038
|
// core/commands/design.ts
|
|
23915
|
-
import
|
|
24039
|
+
import path51 from "node:path";
|
|
23916
24040
|
async function design(target = null, options = {}, projectPath = process.cwd()) {
|
|
23917
24041
|
try {
|
|
23918
24042
|
const designType = options.type || "architecture";
|
|
@@ -23924,7 +24048,7 @@ async function design(target = null, options = {}, projectPath = process.cwd())
|
|
|
23924
24048
|
const designTarget = target || "system";
|
|
23925
24049
|
output_default.spin(`designing ${designType}...`);
|
|
23926
24050
|
const projectId = await config_manager_default.getProjectId(projectPath);
|
|
23927
|
-
const designsPath =
|
|
24051
|
+
const designsPath = path51.join(
|
|
23928
24052
|
path_manager_default.getGlobalProjectPath(projectId),
|
|
23929
24053
|
"planning",
|
|
23930
24054
|
"designs"
|
|
@@ -23964,7 +24088,7 @@ async function design(target = null, options = {}, projectPath = process.cwd())
|
|
|
23964
24088
|
break;
|
|
23965
24089
|
}
|
|
23966
24090
|
const designFileName = `${designType}-${designTarget.toLowerCase().replace(/\s+/g, "-")}.md`;
|
|
23967
|
-
const designFilePath =
|
|
24091
|
+
const designFilePath = path51.join(designsPath, designFileName);
|
|
23968
24092
|
await file_helper_exports.writeFile(designFilePath, designContent);
|
|
23969
24093
|
await memoryService.log(projectPath, "design_created", {
|
|
23970
24094
|
type: designType,
|
|
@@ -23988,7 +24112,7 @@ var init_design = __esm({
|
|
|
23988
24112
|
});
|
|
23989
24113
|
|
|
23990
24114
|
// core/commands/snapshots.ts
|
|
23991
|
-
import
|
|
24115
|
+
import path52 from "node:path";
|
|
23992
24116
|
async function recover(projectPath = process.cwd()) {
|
|
23993
24117
|
try {
|
|
23994
24118
|
const projectId = await config_manager_default.getProjectId(projectPath);
|
|
@@ -24040,7 +24164,7 @@ async function undo(projectPath = process.cwd()) {
|
|
|
24040
24164
|
output_default.failWithHint("NO_PROJECT_ID");
|
|
24041
24165
|
return { success: false, error: "No project ID found" };
|
|
24042
24166
|
}
|
|
24043
|
-
const snapshotsPath =
|
|
24167
|
+
const snapshotsPath = path52.join(path_manager_default.getGlobalProjectPath(projectId), "snapshots");
|
|
24044
24168
|
await file_helper_exports.ensureDir(snapshotsPath);
|
|
24045
24169
|
const { execSync: execSync7 } = await import("node:child_process");
|
|
24046
24170
|
try {
|
|
@@ -24058,7 +24182,7 @@ async function undo(projectPath = process.cwd()) {
|
|
|
24058
24182
|
cwd: projectPath,
|
|
24059
24183
|
encoding: "utf-8"
|
|
24060
24184
|
});
|
|
24061
|
-
const snapshotFile =
|
|
24185
|
+
const snapshotFile = path52.join(snapshotsPath, "history.json");
|
|
24062
24186
|
let history2 = { snapshots: [], current: -1 };
|
|
24063
24187
|
try {
|
|
24064
24188
|
const content = await file_helper_exports.readFile(snapshotFile);
|
|
@@ -24098,8 +24222,8 @@ async function redo(projectPath = process.cwd()) {
|
|
|
24098
24222
|
output_default.failWithHint("NO_PROJECT_ID");
|
|
24099
24223
|
return { success: false, error: "No project ID found" };
|
|
24100
24224
|
}
|
|
24101
|
-
const snapshotsPath =
|
|
24102
|
-
const snapshotFile =
|
|
24225
|
+
const snapshotsPath = path52.join(path_manager_default.getGlobalProjectPath(projectId), "snapshots");
|
|
24226
|
+
const snapshotFile = path52.join(snapshotsPath, "history.json");
|
|
24103
24227
|
let history2;
|
|
24104
24228
|
try {
|
|
24105
24229
|
const content = await file_helper_exports.readFile(snapshotFile);
|
|
@@ -24158,8 +24282,8 @@ async function history(projectPath = process.cwd()) {
|
|
|
24158
24282
|
output_default.failWithHint("NO_PROJECT_ID");
|
|
24159
24283
|
return { success: false, error: "No project ID found" };
|
|
24160
24284
|
}
|
|
24161
|
-
const snapshotsPath =
|
|
24162
|
-
const snapshotFile =
|
|
24285
|
+
const snapshotsPath = path52.join(path_manager_default.getGlobalProjectPath(projectId), "snapshots");
|
|
24286
|
+
const snapshotFile = path52.join(snapshotsPath, "history.json");
|
|
24163
24287
|
let snapshotHistory;
|
|
24164
24288
|
try {
|
|
24165
24289
|
const content = await file_helper_exports.readFile(snapshotFile);
|
|
@@ -24266,8 +24390,8 @@ var init_maintenance = __esm({
|
|
|
24266
24390
|
});
|
|
24267
24391
|
|
|
24268
24392
|
// core/commands/setup.ts
|
|
24269
|
-
import
|
|
24270
|
-
import
|
|
24393
|
+
import fs46 from "node:fs";
|
|
24394
|
+
import path53 from "node:path";
|
|
24271
24395
|
import chalk11 from "chalk";
|
|
24272
24396
|
var SetupCommands;
|
|
24273
24397
|
var init_setup2 = __esm({
|
|
@@ -24394,7 +24518,7 @@ Please install it first:
|
|
|
24394
24518
|
try {
|
|
24395
24519
|
const claudeDir = path_manager_default.getClaudeDir();
|
|
24396
24520
|
const settingsPath = path_manager_default.getClaudeSettingsPath();
|
|
24397
|
-
const statusLinePath =
|
|
24521
|
+
const statusLinePath = path53.join(claudeDir, "prjct-statusline.sh");
|
|
24398
24522
|
const scriptContent = `#!/bin/bash
|
|
24399
24523
|
# prjct Status Line for Claude Code
|
|
24400
24524
|
# Shows version update notifications and current task
|
|
@@ -24452,11 +24576,11 @@ fi
|
|
|
24452
24576
|
# Default: show prjct branding
|
|
24453
24577
|
echo "\u26A1 prjct"
|
|
24454
24578
|
`;
|
|
24455
|
-
|
|
24579
|
+
fs46.writeFileSync(statusLinePath, scriptContent, { mode: 493 });
|
|
24456
24580
|
let settings = {};
|
|
24457
|
-
if (
|
|
24581
|
+
if (fs46.existsSync(settingsPath)) {
|
|
24458
24582
|
try {
|
|
24459
|
-
settings = JSON.parse(
|
|
24583
|
+
settings = JSON.parse(fs46.readFileSync(settingsPath, "utf8"));
|
|
24460
24584
|
} catch (_error) {
|
|
24461
24585
|
}
|
|
24462
24586
|
}
|
|
@@ -24464,7 +24588,7 @@ echo "\u26A1 prjct"
|
|
|
24464
24588
|
type: "command",
|
|
24465
24589
|
command: statusLinePath
|
|
24466
24590
|
};
|
|
24467
|
-
|
|
24591
|
+
fs46.writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
|
|
24468
24592
|
return { success: true };
|
|
24469
24593
|
} catch (error) {
|
|
24470
24594
|
return { success: false, error: error.message };
|
|
@@ -24520,18 +24644,18 @@ echo "\u26A1 prjct"
|
|
|
24520
24644
|
});
|
|
24521
24645
|
|
|
24522
24646
|
// core/utils/project-commands.ts
|
|
24523
|
-
import
|
|
24647
|
+
import path54 from "node:path";
|
|
24524
24648
|
async function detectPackageManager(projectPath, pkg) {
|
|
24525
24649
|
const declared = pkg?.packageManager?.trim().toLowerCase();
|
|
24526
24650
|
if (declared?.startsWith("pnpm@")) return "pnpm";
|
|
24527
24651
|
if (declared?.startsWith("yarn@")) return "yarn";
|
|
24528
24652
|
if (declared?.startsWith("bun@")) return "bun";
|
|
24529
24653
|
if (declared?.startsWith("npm@")) return "npm";
|
|
24530
|
-
if (await fileExists(
|
|
24531
|
-
if (await fileExists(
|
|
24532
|
-
if (await fileExists(
|
|
24533
|
-
if (await fileExists(
|
|
24534
|
-
if (await fileExists(
|
|
24654
|
+
if (await fileExists(path54.join(projectPath, "pnpm-lock.yaml"))) return "pnpm";
|
|
24655
|
+
if (await fileExists(path54.join(projectPath, "yarn.lock"))) return "yarn";
|
|
24656
|
+
if (await fileExists(path54.join(projectPath, "bun.lockb"))) return "bun";
|
|
24657
|
+
if (await fileExists(path54.join(projectPath, "bun.lock"))) return "bun";
|
|
24658
|
+
if (await fileExists(path54.join(projectPath, "package-lock.json"))) return "npm";
|
|
24535
24659
|
return "npm";
|
|
24536
24660
|
}
|
|
24537
24661
|
function pmRun(pm, scriptName) {
|
|
@@ -24547,7 +24671,7 @@ function pmTest(pm) {
|
|
|
24547
24671
|
return "npm test";
|
|
24548
24672
|
}
|
|
24549
24673
|
async function detectProjectCommands(projectPath) {
|
|
24550
|
-
const pkgPath =
|
|
24674
|
+
const pkgPath = path54.join(projectPath, "package.json");
|
|
24551
24675
|
const pkg = await readJson(pkgPath, null);
|
|
24552
24676
|
if (pkg) {
|
|
24553
24677
|
const pm = await detectPackageManager(projectPath, pkg);
|
|
@@ -24564,27 +24688,27 @@ async function detectProjectCommands(projectPath) {
|
|
|
24564
24688
|
}
|
|
24565
24689
|
return result;
|
|
24566
24690
|
}
|
|
24567
|
-
if (await fileExists(
|
|
24691
|
+
if (await fileExists(path54.join(projectPath, "pytest.ini"))) {
|
|
24568
24692
|
return { stack: "python", test: { tool: "pytest", command: "pytest" } };
|
|
24569
24693
|
}
|
|
24570
|
-
const pyproject = await readFile(
|
|
24694
|
+
const pyproject = await readFile(path54.join(projectPath, "pyproject.toml"), "");
|
|
24571
24695
|
if (pyproject.includes("[tool.pytest") || pyproject.includes("pytest")) {
|
|
24572
24696
|
return { stack: "python", test: { tool: "pytest", command: "pytest" } };
|
|
24573
24697
|
}
|
|
24574
|
-
if (await fileExists(
|
|
24698
|
+
if (await fileExists(path54.join(projectPath, "Cargo.toml"))) {
|
|
24575
24699
|
return { stack: "rust", test: { tool: "cargo", command: "cargo test" } };
|
|
24576
24700
|
}
|
|
24577
|
-
if (await fileExists(
|
|
24701
|
+
if (await fileExists(path54.join(projectPath, "go.mod"))) {
|
|
24578
24702
|
return { stack: "go", test: { tool: "go", command: "go test ./..." } };
|
|
24579
24703
|
}
|
|
24580
24704
|
const files = await listFiles(projectPath);
|
|
24581
24705
|
if (files.some((f) => f.endsWith(".sln") || f.endsWith(".csproj") || f.endsWith(".fsproj"))) {
|
|
24582
24706
|
return { stack: "dotnet", test: { tool: "dotnet", command: "dotnet test" } };
|
|
24583
24707
|
}
|
|
24584
|
-
if (await fileExists(
|
|
24708
|
+
if (await fileExists(path54.join(projectPath, "pom.xml"))) {
|
|
24585
24709
|
return { stack: "java", test: { tool: "maven", command: "mvn test" } };
|
|
24586
24710
|
}
|
|
24587
|
-
if (await fileExists(
|
|
24711
|
+
if (await fileExists(path54.join(projectPath, "gradlew")) && (await fileExists(path54.join(projectPath, "build.gradle")) || await fileExists(path54.join(projectPath, "build.gradle.kts")))) {
|
|
24588
24712
|
return { stack: "java", test: { tool: "gradle", command: "./gradlew test" } };
|
|
24589
24713
|
}
|
|
24590
24714
|
return { stack: "unknown" };
|
|
@@ -24761,7 +24885,7 @@ var init_workflow_preferences = __esm({
|
|
|
24761
24885
|
});
|
|
24762
24886
|
|
|
24763
24887
|
// core/commands/shipping.ts
|
|
24764
|
-
import
|
|
24888
|
+
import path55 from "node:path";
|
|
24765
24889
|
var ShippingCommands;
|
|
24766
24890
|
var init_shipping = __esm({
|
|
24767
24891
|
"core/commands/shipping.ts"() {
|
|
@@ -24907,7 +25031,7 @@ ${result.stderr}`.trim();
|
|
|
24907
25031
|
*/
|
|
24908
25032
|
async _bumpVersion(projectPath) {
|
|
24909
25033
|
try {
|
|
24910
|
-
const pkgPath =
|
|
25034
|
+
const pkgPath = path55.join(projectPath, "package.json");
|
|
24911
25035
|
const pkg = await file_helper_exports.readJson(pkgPath, { version: "0.0.0" });
|
|
24912
25036
|
const oldVersion = pkg?.version || "0.0.0";
|
|
24913
25037
|
const [major, minor, patch] = oldVersion.split(".").map(Number);
|
|
@@ -24929,7 +25053,7 @@ ${result.stderr}`.trim();
|
|
|
24929
25053
|
*/
|
|
24930
25054
|
async _updateChangelog(feature, version, projectPath) {
|
|
24931
25055
|
try {
|
|
24932
|
-
const changelogPath =
|
|
25056
|
+
const changelogPath = path55.join(projectPath, "CHANGELOG.md");
|
|
24933
25057
|
const changelog = await file_helper_exports.readFile(changelogPath, "# Changelog\n\n");
|
|
24934
25058
|
const entry = `## [${version}] - ${date_helper_default.formatDate(/* @__PURE__ */ new Date())}
|
|
24935
25059
|
|
|
@@ -25821,19 +25945,19 @@ var init_linear = __esm({
|
|
|
25821
25945
|
});
|
|
25822
25946
|
|
|
25823
25947
|
// core/utils/project-credentials.ts
|
|
25824
|
-
import
|
|
25948
|
+
import fs47 from "node:fs";
|
|
25825
25949
|
import os14 from "node:os";
|
|
25826
|
-
import
|
|
25950
|
+
import path56 from "node:path";
|
|
25827
25951
|
function getCredentialsPath(projectId) {
|
|
25828
|
-
return
|
|
25952
|
+
return path56.join(os14.homedir(), ".prjct-cli", "projects", projectId, "config", "credentials.json");
|
|
25829
25953
|
}
|
|
25830
25954
|
async function getProjectCredentials(projectId) {
|
|
25831
25955
|
const credPath = getCredentialsPath(projectId);
|
|
25832
|
-
if (!
|
|
25956
|
+
if (!fs47.existsSync(credPath)) {
|
|
25833
25957
|
return {};
|
|
25834
25958
|
}
|
|
25835
25959
|
try {
|
|
25836
|
-
return JSON.parse(
|
|
25960
|
+
return JSON.parse(fs47.readFileSync(credPath, "utf-8"));
|
|
25837
25961
|
} catch (error) {
|
|
25838
25962
|
console.error("[project-credentials] Failed to read credentials:", error.message);
|
|
25839
25963
|
return {};
|
|
@@ -26410,7 +26534,7 @@ var require_package = __commonJS({
|
|
|
26410
26534
|
"package.json"(exports, module) {
|
|
26411
26535
|
module.exports = {
|
|
26412
26536
|
name: "prjct-cli",
|
|
26413
|
-
version: "0.
|
|
26537
|
+
version: "0.61.0",
|
|
26414
26538
|
description: "Context layer for AI agents. Project context for Claude Code, Gemini CLI, and more.",
|
|
26415
26539
|
main: "core/index.ts",
|
|
26416
26540
|
bin: {
|
|
@@ -26517,9 +26641,9 @@ var require_package = __commonJS({
|
|
|
26517
26641
|
|
|
26518
26642
|
// core/index.ts
|
|
26519
26643
|
var core_exports = {};
|
|
26520
|
-
import
|
|
26644
|
+
import fs48 from "node:fs";
|
|
26521
26645
|
import os15 from "node:os";
|
|
26522
|
-
import
|
|
26646
|
+
import path57 from "node:path";
|
|
26523
26647
|
async function main() {
|
|
26524
26648
|
const [commandName, ...rawArgs] = process.argv.slice(2);
|
|
26525
26649
|
if (["-v", "--version", "version"].includes(commandName)) {
|
|
@@ -26651,12 +26775,12 @@ function parseCommandArgs(_cmd, rawArgs) {
|
|
|
26651
26775
|
}
|
|
26652
26776
|
function displayVersion(version) {
|
|
26653
26777
|
const detection = detectAllProviders();
|
|
26654
|
-
const claudeCommandPath =
|
|
26655
|
-
const geminiCommandPath =
|
|
26656
|
-
const claudeConfigured =
|
|
26657
|
-
const geminiConfigured =
|
|
26658
|
-
const cursorConfigured =
|
|
26659
|
-
const cursorExists =
|
|
26778
|
+
const claudeCommandPath = path57.join(os15.homedir(), ".claude", "commands", "p.md");
|
|
26779
|
+
const geminiCommandPath = path57.join(os15.homedir(), ".gemini", "commands", "p.toml");
|
|
26780
|
+
const claudeConfigured = fs48.existsSync(claudeCommandPath);
|
|
26781
|
+
const geminiConfigured = fs48.existsSync(geminiCommandPath);
|
|
26782
|
+
const cursorConfigured = fs48.existsSync(path57.join(process.cwd(), ".cursor", "commands", "sync.md"));
|
|
26783
|
+
const cursorExists = fs48.existsSync(path57.join(process.cwd(), ".cursor"));
|
|
26660
26784
|
console.log(`
|
|
26661
26785
|
${CYAN3}p/${RESET5} prjct v${version}
|
|
26662
26786
|
${DIM6}Context layer for AI coding agents${RESET5}
|
|
@@ -26789,9 +26913,9 @@ var init_core = __esm({
|
|
|
26789
26913
|
init_ai_provider();
|
|
26790
26914
|
init_config_manager();
|
|
26791
26915
|
init_editors_config();
|
|
26792
|
-
import
|
|
26916
|
+
import fs49 from "node:fs";
|
|
26793
26917
|
import os16 from "node:os";
|
|
26794
|
-
import
|
|
26918
|
+
import path58 from "node:path";
|
|
26795
26919
|
|
|
26796
26920
|
// core/server/server.ts
|
|
26797
26921
|
import { Hono as Hono3 } from "hono";
|
|
@@ -27533,14 +27657,14 @@ function checkRoutersInstalled() {
|
|
|
27533
27657
|
const home = os16.homedir();
|
|
27534
27658
|
const detection = detectAllProviders();
|
|
27535
27659
|
if (detection.claude.installed) {
|
|
27536
|
-
const claudeRouter =
|
|
27537
|
-
if (!
|
|
27660
|
+
const claudeRouter = path58.join(home, ".claude", "commands", "p.md");
|
|
27661
|
+
if (!fs49.existsSync(claudeRouter)) {
|
|
27538
27662
|
return false;
|
|
27539
27663
|
}
|
|
27540
27664
|
}
|
|
27541
27665
|
if (detection.gemini.installed) {
|
|
27542
|
-
const geminiRouter =
|
|
27543
|
-
if (!
|
|
27666
|
+
const geminiRouter = path58.join(home, ".gemini", "commands", "p.toml");
|
|
27667
|
+
if (!fs49.existsSync(geminiRouter)) {
|
|
27544
27668
|
return false;
|
|
27545
27669
|
}
|
|
27546
27670
|
}
|
|
@@ -27641,7 +27765,7 @@ if (args[0] === "start" || args[0] === "setup") {
|
|
|
27641
27765
|
console.error('No prjct project found. Run "prjct init" first.');
|
|
27642
27766
|
process.exitCode = 1;
|
|
27643
27767
|
} else {
|
|
27644
|
-
const linearCliPath =
|
|
27768
|
+
const linearCliPath = path58.join(__dirname, "..", "core", "cli", "linear.ts");
|
|
27645
27769
|
const linearArgs = ["--project", projectId, ...args.slice(1)];
|
|
27646
27770
|
const child = spawn("bun", [linearCliPath, ...linearArgs], {
|
|
27647
27771
|
stdio: "inherit",
|
|
@@ -27660,12 +27784,12 @@ if (args[0] === "start" || args[0] === "setup") {
|
|
|
27660
27784
|
const detection = detectAllProviders();
|
|
27661
27785
|
const home = os16.homedir();
|
|
27662
27786
|
const cwd = process.cwd();
|
|
27663
|
-
const claudeConfigured =
|
|
27664
|
-
const geminiConfigured =
|
|
27665
|
-
const cursorDetected =
|
|
27666
|
-
const cursorConfigured =
|
|
27667
|
-
const windsurfDetected =
|
|
27668
|
-
const windsurfConfigured =
|
|
27787
|
+
const claudeConfigured = fs49.existsSync(path58.join(home, ".claude", "commands", "p.md"));
|
|
27788
|
+
const geminiConfigured = fs49.existsSync(path58.join(home, ".gemini", "commands", "p.toml"));
|
|
27789
|
+
const cursorDetected = fs49.existsSync(path58.join(cwd, ".cursor"));
|
|
27790
|
+
const cursorConfigured = fs49.existsSync(path58.join(cwd, ".cursor", "rules", "prjct.mdc"));
|
|
27791
|
+
const windsurfDetected = fs49.existsSync(path58.join(cwd, ".windsurf"));
|
|
27792
|
+
const windsurfConfigured = fs49.existsSync(path58.join(cwd, ".windsurf", "rules", "prjct.md"));
|
|
27669
27793
|
const GREEN7 = "\x1B[32m";
|
|
27670
27794
|
console.log(`
|
|
27671
27795
|
${CYAN4}p/${RESET6} prjct v${VERSION}
|
|
@@ -27704,9 +27828,9 @@ ${DIM7}Run 'prjct init' to configure (Cursor/Windsurf IDE)${RESET6}
|
|
|
27704
27828
|
${CYAN4}https://prjct.app${RESET6}
|
|
27705
27829
|
`);
|
|
27706
27830
|
} else {
|
|
27707
|
-
const configPath =
|
|
27831
|
+
const configPath = path58.join(os16.homedir(), ".prjct-cli", "config", "installed-editors.json");
|
|
27708
27832
|
const routersInstalled = checkRoutersInstalled();
|
|
27709
|
-
if (!
|
|
27833
|
+
if (!fs49.existsSync(configPath) || !routersInstalled) {
|
|
27710
27834
|
console.log(`
|
|
27711
27835
|
${CYAN4}${BOLD4} Welcome to prjct!${RESET6}
|
|
27712
27836
|
|