anywhere-ai 0.0.24 → 0.0.26
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 +30 -1
- package/dist/server.js +5 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -10,8 +10,37 @@ import { spawn, spawnSync, execSync } from "child_process";
|
|
|
10
10
|
import readline from "readline";
|
|
11
11
|
import qrcode from "qrcode";
|
|
12
12
|
var args = process.argv.slice(2);
|
|
13
|
+
var command = args.find((a) => !a.startsWith("-"));
|
|
13
14
|
if (args.includes("--version") || args.includes("-v")) {
|
|
14
|
-
console.log(`anywhere-ai v${"0.0.
|
|
15
|
+
console.log(`anywhere-ai v${"0.0.26"}`);
|
|
16
|
+
process.exit(0);
|
|
17
|
+
}
|
|
18
|
+
if (args.includes("--help") || args.includes("-h") || command === "help") {
|
|
19
|
+
console.log(`anywhere-ai v${"0.0.26"} \u2014 Mobile coding agent
|
|
20
|
+
|
|
21
|
+
Usage: anywhere-ai [command] [options]
|
|
22
|
+
|
|
23
|
+
Commands:
|
|
24
|
+
regenerate-token Generate a new auth token
|
|
25
|
+
|
|
26
|
+
Options:
|
|
27
|
+
--help, -h Show this help message
|
|
28
|
+
--version, -v Show version
|
|
29
|
+
--no-tunnel Skip Cloudflare tunnel`);
|
|
30
|
+
process.exit(0);
|
|
31
|
+
}
|
|
32
|
+
if (command === "regenerate-token") {
|
|
33
|
+
const configPath = path.join(os.homedir(), ".anywhere", "config.json");
|
|
34
|
+
try {
|
|
35
|
+
await fs.access(configPath);
|
|
36
|
+
} catch {
|
|
37
|
+
console.error("No config found. Run `anywhere-ai` first to set up.");
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
const config2 = JSON.parse(await fs.readFile(configPath, "utf-8"));
|
|
41
|
+
config2.authToken = crypto.randomBytes(16).toString("hex");
|
|
42
|
+
await fs.writeFile(configPath, JSON.stringify(config2, null, 2));
|
|
43
|
+
console.log("New auth token: " + config2.authToken);
|
|
15
44
|
process.exit(0);
|
|
16
45
|
}
|
|
17
46
|
function ask(question, preserveCase = false) {
|
package/dist/server.js
CHANGED
|
@@ -842,15 +842,19 @@ gh.get("/repos", async (c) => {
|
|
|
842
842
|
gh.get("/pr", async (c) => {
|
|
843
843
|
try {
|
|
844
844
|
const cwd = c.req.query("cwd");
|
|
845
|
+
console.log("[gh/pr GET] cwd:", cwd);
|
|
845
846
|
const root = await getRepoRoot(cwd);
|
|
847
|
+
console.log("[gh/pr GET] resolved root:", root);
|
|
846
848
|
if (!root) return c.json({ exists: false });
|
|
847
849
|
const { stdout } = await execAsync2(
|
|
848
850
|
"gh pr view --json number,title,url",
|
|
849
851
|
{ cwd: root }
|
|
850
852
|
);
|
|
851
853
|
const pr = JSON.parse(stdout);
|
|
854
|
+
console.log("[gh/pr GET] found PR:", pr);
|
|
852
855
|
return c.json({ exists: true, pr });
|
|
853
|
-
} catch {
|
|
856
|
+
} catch (err) {
|
|
857
|
+
console.log("[gh/pr GET] no PR found:", err?.stderr?.trim() || err?.message);
|
|
854
858
|
return c.json({ exists: false });
|
|
855
859
|
}
|
|
856
860
|
});
|