start-vibing 3.0.3 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +68 -15
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -311,7 +311,7 @@ function getUpdateCommand() {
|
|
|
311
311
|
|
|
312
312
|
// src/claude.ts
|
|
313
313
|
import { spawn, execSync as execSync2, spawnSync } from "child_process";
|
|
314
|
-
import { existsSync as existsSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
314
|
+
import { existsSync as existsSync3, readFileSync as readFileSync3, readdirSync as readdirSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
315
315
|
import { join as join3 } from "path";
|
|
316
316
|
import { homedir } from "os";
|
|
317
317
|
function isClaudeInstalled() {
|
|
@@ -418,14 +418,41 @@ async function installClaudeUnix() {
|
|
|
418
418
|
};
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
+
function encodeProjectPath(absolutePath) {
|
|
422
|
+
return absolutePath.replace(/\\/g, "/").replace(/\//g, "-");
|
|
423
|
+
}
|
|
424
|
+
function hasExistingSession(projectDir) {
|
|
425
|
+
const encodedPath = encodeProjectPath(projectDir);
|
|
426
|
+
const sessionDir = join3(homedir(), ".claude", "projects", encodedPath);
|
|
427
|
+
const indexFile = join3(sessionDir, "sessions-index.json");
|
|
428
|
+
if (existsSync3(indexFile)) {
|
|
429
|
+
try {
|
|
430
|
+
const raw = readFileSync3(indexFile, "utf-8");
|
|
431
|
+
const index = JSON.parse(raw);
|
|
432
|
+
if (Array.isArray(index.entries)) {
|
|
433
|
+
const mainSessions = index.entries.filter((e) => !e.isSidechain);
|
|
434
|
+
if (mainSessions.length > 0)
|
|
435
|
+
return true;
|
|
436
|
+
}
|
|
437
|
+
} catch {
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
if (existsSync3(sessionDir)) {
|
|
441
|
+
try {
|
|
442
|
+
const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.jsonl$/;
|
|
443
|
+
return readdirSync2(sessionDir).some((f) => uuidPattern.test(f));
|
|
444
|
+
} catch {
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
return false;
|
|
448
|
+
}
|
|
421
449
|
function launchClaude(cwd, options = {}) {
|
|
422
450
|
const { isWindows } = getPlatformInfo();
|
|
423
|
-
const
|
|
451
|
+
const canResume = !options.newSession && hasExistingSession(cwd);
|
|
424
452
|
const args = ["--dangerously-skip-permissions"];
|
|
425
|
-
if (
|
|
453
|
+
if (canResume) {
|
|
426
454
|
args.unshift("-c");
|
|
427
455
|
}
|
|
428
|
-
const startTime = Date.now();
|
|
429
456
|
const claude = spawn("claude", args, {
|
|
430
457
|
cwd,
|
|
431
458
|
stdio: "inherit",
|
|
@@ -447,13 +474,6 @@ function launchClaude(cwd, options = {}) {
|
|
|
447
474
|
process.exit(1);
|
|
448
475
|
});
|
|
449
476
|
claude.on("exit", (code) => {
|
|
450
|
-
if (code !== 0 && resumeSession && Date.now() - startTime < 5000) {
|
|
451
|
-
console.log("");
|
|
452
|
-
console.log(" No conversation found to continue. Starting new session...");
|
|
453
|
-
console.log("");
|
|
454
|
-
launchClaude(cwd, { newSession: true });
|
|
455
|
-
return;
|
|
456
|
-
}
|
|
457
477
|
process.exit(code || 0);
|
|
458
478
|
});
|
|
459
479
|
}
|
|
@@ -511,6 +531,36 @@ var CORE_MCPS = [
|
|
|
511
531
|
description: "browser automation",
|
|
512
532
|
command: "npx",
|
|
513
533
|
args: ["-y", "@playwright/mcp@latest", "--user-data-dir", "./.playwright-data"]
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
name: "nextjs-devtools",
|
|
537
|
+
description: "Next.js dev tools",
|
|
538
|
+
command: "npx",
|
|
539
|
+
args: ["-y", "next-devtools-mcp@latest"]
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
name: "mongodb",
|
|
543
|
+
description: "database operations",
|
|
544
|
+
command: "npx",
|
|
545
|
+
args: ["-y", "@mongodb-js/mongodb-mcp-server"]
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
name: "jira",
|
|
549
|
+
description: "issue tracking",
|
|
550
|
+
command: "npx",
|
|
551
|
+
args: ["-y", "@aashari/mcp-server-atlassian-jira"]
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
name: "git",
|
|
555
|
+
description: "git operations",
|
|
556
|
+
command: "uvx",
|
|
557
|
+
args: ["mcp-server-git"]
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
name: "fetch",
|
|
561
|
+
description: "web page reading",
|
|
562
|
+
command: "uvx",
|
|
563
|
+
args: ["mcp-server-fetch"]
|
|
514
564
|
}
|
|
515
565
|
];
|
|
516
566
|
function isClaudeMcpReady() {
|
|
@@ -834,11 +884,12 @@ function formatElapsed(startMs) {
|
|
|
834
884
|
function printOptionalMcps() {
|
|
835
885
|
console.log("");
|
|
836
886
|
console.log(` ${c.dim}Optional MCPs (install manually):${c.reset}`);
|
|
837
|
-
console.log(` ${c.cyan}nextjs-devtools${c.reset} ${c.dim}\xB7${c.reset} claude mcp add -s user nextjs-devtools -- npx -y next-devtools-mcp@latest`);
|
|
838
|
-
console.log(` ${c.cyan}mongodb${c.reset} ${c.dim}\xB7${c.reset} claude mcp add -s user mongodb -- npx -y @mongodb-js/mongodb-mcp-server`);
|
|
839
887
|
console.log(` ${c.cyan}github${c.reset} ${c.dim}\xB7${c.reset} claude mcp add --transport http -s user github https://api.githubcopilot.com/mcp/`);
|
|
840
888
|
console.log(` ${c.cyan}sentry${c.reset} ${c.dim}\xB7${c.reset} claude mcp add --transport http -s user sentry https://mcp.sentry.dev/mcp`);
|
|
841
889
|
console.log(` ${c.cyan}figma${c.reset} ${c.dim}\xB7${c.reset} claude mcp add --transport http -s user figma https://mcp.figma.com/mcp`);
|
|
890
|
+
console.log(` ${c.cyan}linear${c.reset} ${c.dim}\xB7${c.reset} claude mcp add --transport http -s user linear https://mcp.linear.app/sse`);
|
|
891
|
+
console.log(` ${c.cyan}stripe${c.reset} ${c.dim}\xB7${c.reset} claude mcp add --transport http -s user stripe https://mcp.stripe.com`);
|
|
892
|
+
console.log(` ${c.cyan}vercel${c.reset} ${c.dim}\xB7${c.reset} claude mcp add --transport http -s user vercel https://mcp.vercel.com`);
|
|
842
893
|
}
|
|
843
894
|
|
|
844
895
|
// src/cli.ts
|
|
@@ -1023,12 +1074,14 @@ async function main() {
|
|
|
1023
1074
|
const spinner4 = createSpinner(phaseHeader(4, TOTAL_PHASES, "Installing plugins..."));
|
|
1024
1075
|
spinner4.succeed(phaseHeader(4, TOTAL_PHASES, `Plugins ${c.dim}${"\xB7".repeat(21)}${c.reset} ${c.dim}deferred (will auto-prompt)${c.reset}`));
|
|
1025
1076
|
}
|
|
1026
|
-
const
|
|
1077
|
+
const sessionExists = hasExistingSession(targetDir);
|
|
1078
|
+
const willResume = !newSession && sessionExists;
|
|
1079
|
+
const launchMode = newSession ? "new session" : willResume ? "resuming last session" : "new session";
|
|
1027
1080
|
console.log(` ${c.green}\u2713${c.reset} ${phaseHeader(5, TOTAL_PHASES, `Launching Claude Code ${c.dim}${"\xB7".repeat(7)}${c.reset} ${launchMode}`)}`);
|
|
1028
1081
|
printOptionalMcps();
|
|
1029
1082
|
console.log("");
|
|
1030
1083
|
console.log(` ${c.green}Setup complete${c.reset} in ${formatElapsed(globalStart)}`);
|
|
1031
1084
|
console.log("");
|
|
1032
|
-
launchClaude(targetDir, { newSession });
|
|
1085
|
+
launchClaude(targetDir, { newSession: newSession || !sessionExists });
|
|
1033
1086
|
}
|
|
1034
1087
|
main();
|
package/package.json
CHANGED