demobite 1.18.0 → 1.18.2
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
CHANGED
|
@@ -85,7 +85,9 @@ const killListener = () => {
|
|
|
85
85
|
const printStatus = () => {
|
|
86
86
|
const lock = readJson(LOCK);
|
|
87
87
|
const live = !!(lock?.pid && pidAlive(lock.pid));
|
|
88
|
-
|
|
88
|
+
// the facts come from the last check-in; before the first one, from the key's own config
|
|
89
|
+
const cfgThere = lock?.cwd ? readJson(path.join(lock.cwd, ".recorder", "config.json")) : null;
|
|
90
|
+
const st = { base: cfgThere?.base ?? null, workspace: cfgThere?.workspace?.name ?? null, ...(readJson(STATE) ?? {}) };
|
|
89
91
|
if (live) {
|
|
90
92
|
console.log(` ● Listening as "${st?.name ?? os.hostname()}" since ${new Date(lock.since).toLocaleTimeString(undefined, { hour: "2-digit", minute: "2-digit" })} · for ${st?.workspace ?? "your workspace"} on ${(st?.base ?? "").replace(/^https?:\/\//, "") || "app.demobites.com"} (pid ${lock.pid}${lock.service ? ", login service" : ", a Terminal window"})`);
|
|
91
93
|
if (st?.at) console.log(` last check-in ${ago(st.at)} · ${st.busy ? `recording: ${st.job ?? ""}` : "idle"}${st.last_error ? ` · last error: ${st.last_error}` : ""}`);
|
|
@@ -478,6 +480,8 @@ if (arg === "listen") {
|
|
|
478
480
|
console.log(`\n ${isLook ? "◉ Looking at" : "⚿ Sign-in at"} ${job.url}`);
|
|
479
481
|
noteState({ busy: true, job: job.id });
|
|
480
482
|
await event(job.id, "started", { machine: name });
|
|
483
|
+
// Alive while the person signs in (a window can wait minutes): the heartbeat, or the rail calls this machine offline.
|
|
484
|
+
const heartbeat = setInterval(() => { void api({ action: "checkin", machine_id: listen.machine_id, name, readiness: readiness(), busy: true }); }, 5000);
|
|
481
485
|
const { spawn } = await import("node:child_process");
|
|
482
486
|
const child = spawn(process.execPath, [script, job.url], { cwd: process.cwd(), env: { ...process.env, RECORDER_JOB: job.id, RECORDER_BASE: base, RECORDER_LISTEN: "1" }, stdio: ["ignore", "pipe", "pipe"], detached: process.platform !== "win32" });
|
|
483
487
|
track(child);
|
|
@@ -496,6 +500,7 @@ if (arg === "listen") {
|
|
|
496
500
|
});
|
|
497
501
|
child.stderr.on("data", (d) => { const t = d.toString().trim(); if (t) console.log(` ! ${t.split("\n")[0].slice(0, 160)}`); });
|
|
498
502
|
const code = await new Promise((r) => child.on("close", r));
|
|
503
|
+
clearInterval(heartbeat);
|
|
499
504
|
if (isLook) {
|
|
500
505
|
if (verdict) await event(job.id, "looked", verdict);
|
|
501
506
|
else await event(job.id, "failed", { message: "The look did not finish" });
|
package/package.json
CHANGED
package/scripts/record.mjs
CHANGED
|
@@ -207,7 +207,7 @@ const launchOpts = {
|
|
|
207
207
|
viewport: VIEW,
|
|
208
208
|
recordVideo: { dir: DIR, size: VIEW },
|
|
209
209
|
deviceScaleFactor: 1,
|
|
210
|
-
args: ["--force-color-profile=srgb", "--disable-blink-features=AutomationControlled"],
|
|
210
|
+
args: ["--force-color-profile=srgb", "--disable-blink-features=AutomationControlled", "--disable-features=MediaRouter,DialMediaRouteProvider", "--disable-component-update", "--no-default-browser-check"],
|
|
211
211
|
};
|
|
212
212
|
|
|
213
213
|
// THREE ways to get a browser. ONE script serves both lanes — the cloud
|
|
@@ -29,7 +29,7 @@ const DANGER = /\b(delete|remove|pay|purchase|buy|subscribe|upgrade|publish|send
|
|
|
29
29
|
|
|
30
30
|
const { chromium } = await import("playwright");
|
|
31
31
|
const profileDir = process.env.RECORDER_PROFILE || path.resolve(process.cwd(), ".recorder", "profile");
|
|
32
|
-
const launchOpts = { headless: true, viewport: { width: 1440, height: 900 }, args: ["--force-color-profile=srgb", "--disable-blink-features=AutomationControlled"], ignoreDefaultArgs: ["--enable-automation"] };
|
|
32
|
+
const launchOpts = { headless: true, viewport: { width: 1440, height: 900 }, args: ["--force-color-profile=srgb", "--disable-blink-features=AutomationControlled", "--disable-features=MediaRouter,DialMediaRouteProvider", "--disable-component-update", "--no-default-browser-check"], ignoreDefaultArgs: ["--enable-automation"] };
|
|
33
33
|
let ctx;
|
|
34
34
|
try { ctx = await chromium.launchPersistentContext(profileDir, { ...launchOpts, channel: "chrome" }); }
|
|
35
35
|
catch { ctx = await chromium.launchPersistentContext(profileDir, launchOpts); }
|
package/skill/scripts/look.mjs
CHANGED
|
@@ -27,7 +27,7 @@ const profileDir = process.env.RECORDER_PROFILE || path.resolve(process.cwd(), "
|
|
|
27
27
|
const launchOpts = {
|
|
28
28
|
headless: true,
|
|
29
29
|
viewport: { width: 1440, height: 900 },
|
|
30
|
-
args: ["--force-color-profile=srgb", "--disable-blink-features=AutomationControlled"],
|
|
30
|
+
args: ["--force-color-profile=srgb", "--disable-blink-features=AutomationControlled", "--disable-features=MediaRouter,DialMediaRouteProvider", "--disable-component-update", "--no-default-browser-check"],
|
|
31
31
|
ignoreDefaultArgs: ["--enable-automation"],
|
|
32
32
|
};
|
|
33
33
|
let ctx;
|
package/skill/scripts/signin.mjs
CHANGED
|
@@ -49,7 +49,7 @@ const launchOpts = {
|
|
|
49
49
|
headless: false,
|
|
50
50
|
viewport: { width: 1440, height: 900 },
|
|
51
51
|
deviceScaleFactor: 1,
|
|
52
|
-
args: ["--force-color-profile=srgb", "--disable-blink-features=AutomationControlled"],
|
|
52
|
+
args: ["--force-color-profile=srgb", "--disable-blink-features=AutomationControlled", "--disable-features=MediaRouter,DialMediaRouteProvider", "--disable-component-update", "--no-default-browser-check"],
|
|
53
53
|
ignoreDefaultArgs: ["--enable-automation"],
|
|
54
54
|
};
|
|
55
55
|
let ctx;
|