@appchy/jarvis 0.1.12 → 0.1.13
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/bin.js +12 -16
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
// src/bin.ts
|
|
2
|
-
import dotenv from "dotenv";
|
|
3
|
-
import fs8 from "fs";
|
|
4
|
-
import path8 from "path";
|
|
5
|
-
|
|
6
1
|
// src/cli.ts
|
|
7
2
|
import { Command } from "commander";
|
|
8
3
|
import { spawn as spawn2, execSync } from "child_process";
|
|
@@ -4915,7 +4910,18 @@ async function ensureSetup() {
|
|
|
4915
4910
|
if (config?.token || config?.anthropicApiKey || config?.useSubscription) {
|
|
4916
4911
|
return true;
|
|
4917
4912
|
}
|
|
4918
|
-
|
|
4913
|
+
const ok = await browserAuth(APP_URL);
|
|
4914
|
+
if (!ok) return false;
|
|
4915
|
+
const pid = readPid();
|
|
4916
|
+
if (pid) {
|
|
4917
|
+
try {
|
|
4918
|
+
process.kill(pid, "SIGTERM");
|
|
4919
|
+
} catch {
|
|
4920
|
+
}
|
|
4921
|
+
clearPid();
|
|
4922
|
+
await new Promise((r) => setTimeout(r, 1e3));
|
|
4923
|
+
}
|
|
4924
|
+
return true;
|
|
4919
4925
|
}
|
|
4920
4926
|
function createCli() {
|
|
4921
4927
|
const program = new Command().name("jarvis").description("Jarvis local agent \u2014 runs Claude Code on your machine").version(PKG_VERSION);
|
|
@@ -5127,15 +5133,5 @@ function createCli() {
|
|
|
5127
5133
|
}
|
|
5128
5134
|
|
|
5129
5135
|
// src/bin.ts
|
|
5130
|
-
function findEnv() {
|
|
5131
|
-
let dir = process.cwd();
|
|
5132
|
-
while (dir !== path8.dirname(dir)) {
|
|
5133
|
-
const envPath = path8.join(dir, ".env");
|
|
5134
|
-
if (fs8.existsSync(envPath)) return envPath;
|
|
5135
|
-
dir = path8.dirname(dir);
|
|
5136
|
-
}
|
|
5137
|
-
return void 0;
|
|
5138
|
-
}
|
|
5139
|
-
dotenv.config({ path: findEnv() });
|
|
5140
5136
|
createCli().parse();
|
|
5141
5137
|
//# sourceMappingURL=bin.js.map
|