protovibe 1.1.6 → 1.1.8

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.
Files changed (2) hide show
  1. package/dist/index.mjs +32 -23
  2. package/package.json +2 -1
package/dist/index.mjs CHANGED
@@ -76,20 +76,23 @@ function InfoBox({ version }) {
76
76
  import { existsSync, readFileSync } from "fs";
77
77
  import { join } from "path";
78
78
  import { homedir } from "os";
79
- function getClaudeCredentialsPath() {
80
- return join(homedir(), ".claude", ".credentials.json");
81
- }
79
+ var CREDENTIAL_PATHS = [
80
+ join(homedir(), ".claude", ".credentials.json"),
81
+ join(homedir(), ".claude", "auth.json")
82
+ ];
82
83
  function isAuthenticated() {
83
- const credPath = getClaudeCredentialsPath();
84
- if (!existsSync(credPath)) return false;
85
- try {
86
- const content = readFileSync(credPath, "utf-8").trim();
87
- if (!content) return false;
88
- const parsed = JSON.parse(content);
89
- return Object.keys(parsed).length > 0;
90
- } catch {
91
- return false;
84
+ for (const credPath of CREDENTIAL_PATHS) {
85
+ if (!existsSync(credPath)) continue;
86
+ try {
87
+ const content = readFileSync(credPath, "utf-8").trim();
88
+ if (!content) continue;
89
+ const parsed = JSON.parse(content);
90
+ if (Object.keys(parsed).length > 0) return true;
91
+ } catch {
92
+ continue;
93
+ }
92
94
  }
95
+ return existsSync(join(homedir(), ".claude", "settings.json"));
93
96
  }
94
97
 
95
98
  // src/spawn.ts
@@ -637,10 +640,14 @@ function App({ terminalWidth, version }) {
637
640
  process.stdout.write("\nLogin cancelled. Run protovibe again when ready.\n");
638
641
  process.exit(0);
639
642
  }
640
- process.stdout.write(
641
- "\nOpening Claude Code to log you in.\nOnce logged in, type /exit to return to ProtoVibe.\n\n"
642
- );
643
- spawnSync("claude", [], { stdio: "inherit", shell: true });
643
+ process.stdout.write("\n Opening browser to log you in to Claude Code...\n\n");
644
+ const loginResult = spawnSync("claude", ["auth", "login"], { stdio: "inherit", shell: true });
645
+ if (loginResult.status !== 0 && loginResult.status !== null) {
646
+ process.stdout.write(
647
+ "\n Opening Claude Code to log you in.\n Once logged in, type /exit to return to ProtoVibe.\n\n"
648
+ );
649
+ spawnSync("claude", [], { stdio: "inherit", shell: true });
650
+ }
644
651
  if (!isAuthenticated()) {
645
652
  process.stderr.write("\n\u2717 Not logged in. Run protovibe again after logging in.\n");
646
653
  process.exit(1);
@@ -676,14 +683,10 @@ function App({ terminalWidth, version }) {
676
683
 
677
684
  // src/index.tsx
678
685
  import { execSync as execSync2, spawnSync as spawnSync2 } from "child_process";
679
- import { readFileSync as readFileSync2 } from "fs";
680
- import { fileURLToPath } from "url";
681
- import { dirname as dirname2, join as join3 } from "path";
686
+ import { createRequire } from "module";
682
687
  import { get } from "https";
683
- var __dirname = dirname2(fileURLToPath(import.meta.url));
684
- var pkg = JSON.parse(
685
- readFileSync2(join3(__dirname, "..", "package.json"), "utf-8")
686
- );
688
+ var require2 = createRequire(import.meta.url);
689
+ var pkg = require2("../package.json");
687
690
  function isNewerVersion(current, latest) {
688
691
  const parse = (v) => v.split(".").map(Number);
689
692
  const [cMaj, cMin, cPatch] = parse(current);
@@ -717,6 +720,12 @@ function fetchLatestVersion() {
717
720
  });
718
721
  }
719
722
  async function main() {
723
+ if (process.argv[1]?.includes("node_modules")) {
724
+ process.stderr.write(
725
+ "\n \u2717 protovibe was installed locally.\n\n Option 1 \u2014 run it right now:\n npx protovibe\n\n Option 2 \u2014 install globally (recommended):\n npm install -g protovibe\n\n"
726
+ );
727
+ process.exit(1);
728
+ }
720
729
  if (process.env.PROTOVIBE_UPDATED !== "1") {
721
730
  const latest = await fetchLatestVersion();
722
731
  if (latest && isNewerVersion(pkg.version, latest)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protovibe",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "A branded CLI platform layer on top of Claude Code",
5
5
  "author": "razorgojo",
6
6
  "license": "MIT",
@@ -40,6 +40,7 @@
40
40
  "@clack/prompts": "^1.1.0",
41
41
  "chalk": "^5.6.2",
42
42
  "ink": "^6.8.0",
43
+ "protovibe": "^1.1.7",
43
44
  "react": "^19.2.4"
44
45
  },
45
46
  "devDependencies": {