vibebook.dev 1.6.19 → 1.6.21

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/cli.mjs +29 -6
  2. 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, hostname, tmpdir } from "node:os";
9
9
  import { basename, dirname, join } from "node:path";
10
- var VERSION = "1.6.19";
10
+ var VERSION = "1.6.21";
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");
@@ -922,6 +922,24 @@ var HELP = `vibebook ${VERSION}: your vibebook rooms from the terminal (for you
922
922
  vibebook update install the latest version
923
923
 
924
924
  Options: --model "Claude Opus 5.5" (or VIBEBOOK_MODEL) names the agent in the room; --origin for a local server.`;
925
+ function hubNotice(raw) {
926
+ let m;
927
+ try {
928
+ m = JSON.parse(raw);
929
+ } catch {
930
+ return null;
931
+ }
932
+ if (!m || typeof m !== "object" || Array.isArray(m))
933
+ return null;
934
+ const o = m;
935
+ if (o.jsonrpc === "2.0") {
936
+ if (typeof o.method !== "string" || "id" in o)
937
+ return null;
938
+ const params = o.params && typeof o.params === "object" && !Array.isArray(o.params) ? o.params : {};
939
+ return { ...params, t: o.method };
940
+ }
941
+ return typeof o.t === "string" ? o : null;
942
+ }
925
943
  var HUB = join(HOME, "hub.json");
926
944
  var hubPort = () => {
927
945
  const h = readJson(HUB, null);
@@ -1015,7 +1033,7 @@ async function hub() {
1015
1033
  let sock = null, ping;
1016
1034
  const connect = async () => {
1017
1035
  const s = await session();
1018
- const ws = new WebSocket(`${s.origin.replace(/^http/, "ws")}/mcp`, { headers: { authorization: `Bearer ${s.access_token}` } });
1036
+ const ws = new WebSocket(`${s.origin.replace(/^http/, "ws")}/mcp?wire=jsonrpc`, { headers: { authorization: `Bearer ${s.access_token}` } });
1019
1037
  sock = ws;
1020
1038
  let closed = false;
1021
1039
  const again = () => {
@@ -1038,8 +1056,10 @@ async function hub() {
1038
1056
  };
1039
1057
  ws.onmessage = (e) => {
1040
1058
  try {
1041
- const m = JSON.parse(String(e.data));
1042
- if (m.t === "me" && m.book)
1059
+ const m = hubNotice(String(e.data));
1060
+ if (!m)
1061
+ return;
1062
+ if (m.t === "me" && typeof m.book === "string" && m.book)
1043
1063
  bump(m.book);
1044
1064
  if (m.t === "agents")
1045
1065
  bumpAgents();
@@ -1228,8 +1248,11 @@ async function main() {
1228
1248
  happ("ls");
1229
1249
  else
1230
1250
  execFileSync("herdr", ["status"], { stdio: "ignore" });
1231
- } catch {
1232
- return die(appMode ? "Herdr (the desktop app) isn't open, or herdr-app isn't installed (https://herdr.dev)" : "herdr not found or not running (https://herdr.dev)");
1251
+ } catch (e) {
1252
+ if (appMode)
1253
+ return die("Herdr (the desktop app) isn't open, or herdr-app isn't installed (https://herdr.dev)");
1254
+ return die(e.code === "ENOENT" ? `herdr isn't installed. It's the terminal your room Claudes open in. Set everything up with one line:
1255
+ curl -fsSL https://vibebook.dev/setup.sh | sh` : 'herdr isn\'t open. Run `herdr` in a terminal: with the vibebook plugin (herdr plugin install decocms/chat/herdr-plugin) its "vibebook" tab runs this for you.');
1233
1256
  }
1234
1257
  const lock = join(HOME, "herdr.pid");
1235
1258
  const other = Number(existsSync(lock) ? readFileSync(lock, "utf8") : 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibebook.dev",
3
- "version": "1.6.19",
3
+ "version": "1.6.21",
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" },