vibebook.dev 1.6.1 → 1.6.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/cli.mjs +31 -21
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { appendFileSync, chmodSync, closeSync, existsSync, fstatSync, mkdirSync,
|
|
|
7
7
|
import { createServer } from "node:http";
|
|
8
8
|
import { homedir, tmpdir } from "node:os";
|
|
9
9
|
import { basename, dirname, join } from "node:path";
|
|
10
|
-
var VERSION = "1.6.
|
|
10
|
+
var VERSION = "1.6.5";
|
|
11
11
|
var HOME = process.env.VIBEBOOK_HOME || join(homedir(), ".vibebook");
|
|
12
12
|
var SESSION = join(HOME, "session.json");
|
|
13
13
|
var AGENTS = join(HOME, "agents.json");
|
|
@@ -383,6 +383,9 @@ async function callTool(name, args, agent, tools) {
|
|
|
383
383
|
const model = flag("model") ?? process.env.VIBEBOOK_MODEL;
|
|
384
384
|
if (props.includes("model") && args.model === undefined && model)
|
|
385
385
|
args.model = model;
|
|
386
|
+
const host = hostApp();
|
|
387
|
+
if (host && typeof args.model === "string" && !args.model.toLowerCase().includes(host.toLowerCase()))
|
|
388
|
+
args.model = `${host} · ${args.model}`.slice(0, 40);
|
|
386
389
|
const res = await rpc("tools/call", { name, arguments: args }, agent);
|
|
387
390
|
return res;
|
|
388
391
|
}
|
|
@@ -480,6 +483,26 @@ function linkFolder(folder, room) {
|
|
|
480
483
|
.vibebook
|
|
481
484
|
`);
|
|
482
485
|
}
|
|
486
|
+
var hostAppMemo;
|
|
487
|
+
function hostApp() {
|
|
488
|
+
if (hostAppMemo !== undefined)
|
|
489
|
+
return hostAppMemo;
|
|
490
|
+
hostAppMemo = null;
|
|
491
|
+
if (process.platform !== "darwin" && process.platform !== "linux")
|
|
492
|
+
return null;
|
|
493
|
+
try {
|
|
494
|
+
let p = String(process.ppid);
|
|
495
|
+
for (let i = 0;i < 15 && p && p !== "1" && p !== "0"; i++) {
|
|
496
|
+
const [ppid, ...cmd] = execFileSync("ps", ["-o", "ppid=,comm=", "-p", p]).toString().trim().split(/\s+/);
|
|
497
|
+
const name = cmd.join(" ").match(/([^/]+)\.app\/Contents\//)?.[1] ?? cmd.join(" ").split("/").pop() ?? "";
|
|
498
|
+
const hit = /^(Antigravity|agy|Cursor|Windsurf)$/i.exec(name);
|
|
499
|
+
if (hit)
|
|
500
|
+
return hostAppMemo = /^agy$/i.test(hit[1]) ? "Antigravity" : hit[1][0].toUpperCase() + hit[1].slice(1).toLowerCase();
|
|
501
|
+
p = ppid;
|
|
502
|
+
}
|
|
503
|
+
} catch {}
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
483
506
|
function terminalApp() {
|
|
484
507
|
try {
|
|
485
508
|
for (const pid of execFileSync("pgrep", ["-x", "herdr"]).toString().split(/\s+/).filter(Boolean)) {
|
|
@@ -845,9 +868,9 @@ var HELP = `vibebook ${VERSION}: your vibebook rooms from the terminal (for you
|
|
|
845
868
|
vibebook call <tool> ['{json}' | -d @file | -d @-]
|
|
846
869
|
run a tool; room_id, repo and model are filled in from this folder
|
|
847
870
|
vibebook listen [--room <id>] wait until the room has messages you haven't read, print them, exit
|
|
848
|
-
vibebook connect <mcp url> [--
|
|
849
|
-
link an MCP server to this folder's room (its apps show in the Apps tab);
|
|
850
|
-
|
|
871
|
+
vibebook connect <mcp url> [--scope me|room] [--title ..]
|
|
872
|
+
link an MCP server to this folder's room (its apps show in the Apps tab); no token:
|
|
873
|
+
a server that needs a login has each person sign in from the Apps tab
|
|
851
874
|
vibebook upload <file> [--message ".."] [--thread <epic>] [--room <id>] ['{"thread":"<epic>"}']
|
|
852
875
|
vibebook herdr [--once] keep one Claude Code per room in herdr: opens it when you switch
|
|
853
876
|
"Meu Claude" on in the app, closes it when you switch it off
|
|
@@ -1173,7 +1196,7 @@ async function main() {
|
|
|
1173
1196
|
if (!file || !existsSync(file))
|
|
1174
1197
|
return die("usage: vibebook upload <file> [--message ..] [--thread ..]");
|
|
1175
1198
|
const ext = file.toLowerCase().split(".").pop() ?? "";
|
|
1176
|
-
const type = { png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg", webp: "image/webp", gif: "image/gif", pdf: "application/pdf", html: "text/html", md: "text/markdown", m4a: "audio/x-m4a", mp3: "audio/mpeg", wav: "audio/wav", aac: "audio/aac", ogg: "audio/ogg", opus: "audio/ogg", webm: "audio/webm", flac: "audio/flac" }[ext];
|
|
1199
|
+
const type = { png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg", webp: "image/webp", gif: "image/gif", pdf: "application/pdf", html: "text/html", md: "text/markdown", txt: "text/plain", csv: "text/csv", m4a: "audio/x-m4a", mp3: "audio/mpeg", wav: "audio/wav", aac: "audio/aac", ogg: "audio/ogg", opus: "audio/ogg", webm: "audio/webm", flac: "audio/flac" }[ext];
|
|
1177
1200
|
if (!type)
|
|
1178
1201
|
return die("only png, jpg, webp, gif, pdf, html, md or audio (m4a, mp3, wav, aac, ogg, webm, flac)");
|
|
1179
1202
|
const args = { filename: basename(file), content_type: type };
|
|
@@ -1208,23 +1231,10 @@ async function main() {
|
|
|
1208
1231
|
case "connect": {
|
|
1209
1232
|
const url = pos[1];
|
|
1210
1233
|
if (!url)
|
|
1211
|
-
return die(
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
try {
|
|
1215
|
-
token = execSync(flag("token-cmd"), { stdio: ["inherit", "pipe", "inherit"] }).toString().trim();
|
|
1216
|
-
} catch {
|
|
1217
|
-
return die("--token-cmd failed (nothing was sent)");
|
|
1218
|
-
}
|
|
1219
|
-
} else if (flag("token-env"))
|
|
1220
|
-
token = process.env[flag("token-env")] ?? "";
|
|
1221
|
-
else if (flag("token-file"))
|
|
1222
|
-
token = existsSync(flag("token-file")) ? readFileSync(flag("token-file"), "utf8").trim() : "";
|
|
1223
|
-
if ((flag("token-cmd") || flag("token-env") || flag("token-file")) && !token)
|
|
1224
|
-
return die("the token came back empty (nothing was sent)");
|
|
1234
|
+
return die("usage: vibebook connect <mcp url> [--scope room|me] [--title ..] [--room <id>]");
|
|
1235
|
+
if (flag("token-cmd") || flag("token-env") || flag("token-file"))
|
|
1236
|
+
return die("vibebook no longer takes MCP tokens: connect the URL, then each person signs in from the Apps tab (Entrar em <host>). Nothing was sent.");
|
|
1225
1237
|
const args = { url, scope: flag("scope") === "room" ? "room" : "me" };
|
|
1226
|
-
if (token)
|
|
1227
|
-
args.token = token;
|
|
1228
1238
|
if (flag("title"))
|
|
1229
1239
|
args.title = flag("title");
|
|
1230
1240
|
if (flag("room"))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibebook.dev",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.5",
|
|
4
4
|
"description": "vibebook CLI: your vibebook rooms from the terminal, for you and your Claude. One login per machine; room tools discovered at run time.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": { "vibebook": "cli.mjs" },
|