demobite 1.21.0 → 1.21.1
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/launcher/index.mjs +16 -5
- package/package.json +1 -1
package/launcher/index.mjs
CHANGED
|
@@ -284,9 +284,15 @@ if (arg === "on") {
|
|
|
284
284
|
const cfgAt = () => readJson(path.join(cwd, ".recorder", "config.json"));
|
|
285
285
|
const base = (flag("--base") || cfgAt()?.base || "https://app.demobites.com").replace(/\/+$/, "");
|
|
286
286
|
const code = flag("--connect");
|
|
287
|
-
|
|
287
|
+
// No key and no code: the one door is the line in the app (1.21.1, after a pairing page opened in the
|
|
288
|
+
// wrong browser on 2026-10-16). Nothing here ever opens a browser on its own; `demobite login` is explicit.
|
|
289
|
+
if (!code && (!cfgAt()?.api_key || (flag("--base") && cfgAt()?.base && cfgAt().base.replace(/\/+$/, "") !== base))) {
|
|
290
|
+
warn("Not connected. In the app, open Create → Agentic Capture and run the line in the banner on this machine.");
|
|
291
|
+
process.exit(1);
|
|
292
|
+
}
|
|
293
|
+
if (code) {
|
|
288
294
|
console.log("");
|
|
289
|
-
const r = spawnSync(process.execPath, [path.join(dest, "scripts", "login.mjs"), base,
|
|
295
|
+
const r = spawnSync(process.execPath, [path.join(dest, "scripts", "login.mjs"), base, "--connect", code], { stdio: "inherit", cwd });
|
|
290
296
|
if (r.status !== 0) process.exit(r.status ?? 1);
|
|
291
297
|
}
|
|
292
298
|
if (!cfgAt()?.api_key) { warn("Not connected. Run the line from the app again."); process.exit(1); }
|
|
@@ -393,9 +399,14 @@ if (arg === "listen") {
|
|
|
393
399
|
// --connect <code>: the line the Agentic Capture chat gave — already approved
|
|
394
400
|
// for the signed-in person; connects this machine without a page or a click.
|
|
395
401
|
const connectCode = argvRest.includes("--connect") ? (argvRest[argvRest.indexOf("--connect") + 1] || "") : "";
|
|
396
|
-
if (connectCode
|
|
397
|
-
|
|
398
|
-
|
|
402
|
+
if (!connectCode && (!cfg?.api_key || (argvRest.includes("--base") && cfg?.base && cfg.base.replace(/\/+$/, "") !== base))) {
|
|
403
|
+
// Never a browser of its own (1.21.1): the line in the app, or `demobite login` by hand.
|
|
404
|
+
warn("Not connected. In the app, open Create → Agentic Capture and run the line in the banner on this machine, or run: demobite login");
|
|
405
|
+
process.exit(1);
|
|
406
|
+
}
|
|
407
|
+
if (connectCode) {
|
|
408
|
+
console.log(`\n Connecting this machine to your DemoBites account first…\n`);
|
|
409
|
+
const r = spawnSync(process.execPath, [path.join(dest, "scripts", "login.mjs"), base, "--connect", connectCode], { stdio: "inherit", cwd: process.cwd() });
|
|
399
410
|
if (r.status !== 0) process.exit(r.status ?? 1);
|
|
400
411
|
cfg = readCfg();
|
|
401
412
|
}
|
package/package.json
CHANGED