demobite 1.10.1 → 1.11.0
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 +34 -5
- package/package.json +1 -1
package/launcher/index.mjs
CHANGED
|
@@ -247,11 +247,39 @@ if (arg === "listen") {
|
|
|
247
247
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
248
248
|
|
|
249
249
|
console.log(`\n Listening as "${name}" for ${cfg.workspace?.name ?? "your workspace"} on ${base.replace(/^https?:\/\//, "")}.`);
|
|
250
|
-
console.log(` Ask for a demo in the app (Create → Agentic Capture). ${agentBin ? `Claude Code${agentInfo.agent_version ? " " + agentInfo.agent_version : ""} found; demos film on ${JOB_MODEL}.` : "! Claude Code was not found on this machine — install it and sign in, it does the thinking."}`);
|
|
251
|
-
|
|
250
|
+
console.log(` Ask for a demo in the app (Create → Agentic Capture). ${agentBin ? `Claude Code${agentInfo.agent_version ? " " + agentInfo.agent_version : ""} found; demos film on ${JOB_MODEL} unless you pick another model in the app.` : "! Claude Code was not found on this machine — install it and sign in, it does the thinking."}`);
|
|
251
|
+
// The one thing the person must know, boxed (founder 2026-10-15): this
|
|
252
|
+
// window is the machine's side of every recording.
|
|
253
|
+
console.log(`
|
|
254
|
+
┌──────────────────────────────────────────────────────────┐
|
|
255
|
+
│ │
|
|
256
|
+
│ LEAVE THIS WINDOW OPEN │
|
|
257
|
+
│ │
|
|
258
|
+
│ It is your machine's side of every recording: │
|
|
259
|
+
│ the camera, the sign-ins, the coding agent run here. │
|
|
260
|
+
│ Closing it, or Ctrl-C, stops the listening. │
|
|
261
|
+
│ │
|
|
262
|
+
└──────────────────────────────────────────────────────────┘
|
|
263
|
+
`);
|
|
264
|
+
// A line that visibly lives (founder: "look at the terminal, it's stuck"):
|
|
265
|
+
// a heartbeat with a clock while we wait, cleared while a job prints.
|
|
266
|
+
const startedAt = Date.now();
|
|
267
|
+
const tty = !!process.stdout.isTTY;
|
|
268
|
+
let ticker = null;
|
|
269
|
+
const tick = () => {
|
|
270
|
+
const s = Math.floor((Date.now() - startedAt) / 1000);
|
|
271
|
+
const clock = `${Math.floor(s / 60)}:${String(s % 60).padStart(2, "0")}`;
|
|
272
|
+
const dot = s % 2 ? "●" : "○";
|
|
273
|
+
process.stdout.write(`\r\x1b[2K ${dot} Listening · ${clock} · waiting for a demo from the app`);
|
|
274
|
+
};
|
|
275
|
+
const waitOn = () => { if (tty && !ticker) { tick(); ticker = setInterval(tick, 1000); } };
|
|
276
|
+
const waitOff = () => { if (ticker) { clearInterval(ticker); ticker = null; process.stdout.write("\r\x1b[2K"); } };
|
|
277
|
+
waitOn();
|
|
252
278
|
|
|
253
279
|
const runJob = async (job) => {
|
|
254
|
-
|
|
280
|
+
waitOff();
|
|
281
|
+
const model = typeof job.model === "string" && job.model ? job.model : JOB_MODEL;
|
|
282
|
+
console.log(`\n ▶ Job ${job.id}: ${job.brief.slice(0, 100)}${job.brief.length > 100 ? "…" : ""} (filming on ${model})`);
|
|
255
283
|
if (!agentBin) { await event(job.id, "failed", { message: "Claude Code is not installed on this machine" }); return; }
|
|
256
284
|
await event(job.id, "started", { machine: name });
|
|
257
285
|
const prompt = [
|
|
@@ -260,7 +288,7 @@ if (arg === "listen") {
|
|
|
260
288
|
job.url ? `Address to start from: ${job.url}` : "Address: work it out from this project (the saved config, the codebase).",
|
|
261
289
|
`Show the storyboard before filming: ${job.review_storyboard ? "yes — run storyboard.mjs await and obey its answer" : "no — storyboard.mjs await returns film at once"}.`,
|
|
262
290
|
].join("\n");
|
|
263
|
-
const child = (await import("node:child_process")).spawn(agentBin, ["-p", prompt, "--model",
|
|
291
|
+
const child = (await import("node:child_process")).spawn(agentBin, ["-p", prompt, "--model", model, "--output-format", "stream-json", "--verbose", "--dangerously-skip-permissions"], {
|
|
264
292
|
cwd: process.cwd(),
|
|
265
293
|
env: { ...process.env, RECORDER_JOB: job.id, RECORDER_BASE: base, RECORDER_LISTEN: "1" },
|
|
266
294
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -289,7 +317,8 @@ if (arg === "listen") {
|
|
|
289
317
|
if (code === 0) await event(job.id, "note", { text: "The agent finished without a ready signal." });
|
|
290
318
|
await event(job.id, "failed", { message: code === 0 ? "The demo did not come through — try again" : `The agent stopped (exit ${code})` });
|
|
291
319
|
}
|
|
292
|
-
console.log(` ■ Job ${job.id} ${st?.status ?? "ended"}
|
|
320
|
+
console.log(` ■ Job ${job.id} ${st?.status ?? "ended"}.\n`);
|
|
321
|
+
waitOn();
|
|
293
322
|
};
|
|
294
323
|
|
|
295
324
|
for (;;) {
|
package/package.json
CHANGED