demobite 1.10.0 → 1.10.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 -3
- package/package.json +1 -1
package/launcher/index.mjs
CHANGED
|
@@ -210,6 +210,19 @@ if (arg === "listen") {
|
|
|
210
210
|
}
|
|
211
211
|
const name = (argvRest[argvRest.indexOf("--name") + 1] && argvRest.includes("--name")) ? argvRest[argvRest.indexOf("--name") + 1] : os.hostname().replace(/\.local$/, "");
|
|
212
212
|
const agentBin = (() => { const r = spawnSync(process.platform === "win32" ? "where" : "which", ["claude"], { encoding: "utf8" }); return r.status === 0 ? r.stdout.trim().split("\n")[0] : null; })();
|
|
213
|
+
// What the agent is (version) and how it is set (the person's model and
|
|
214
|
+
// effort in ~/.claude/settings.json) — the rail shows it, the chat agent can
|
|
215
|
+
// speak to it. The model that FILMS is ours (JOB_MODEL), passed per job: the
|
|
216
|
+
// output quality is DemoBites' to defend, never a hidden knob on the machine.
|
|
217
|
+
const JOB_MODEL = process.env.DEMOBITES_JOB_MODEL || "sonnet";
|
|
218
|
+
const agentInfo = (() => {
|
|
219
|
+
if (!agentBin) return { agent: null, agent_version: null, model: null, effort: null, job_model: null };
|
|
220
|
+
const v = spawnSync(agentBin, ["--version"], { encoding: "utf8", timeout: 8000 });
|
|
221
|
+
const version = v.status === 0 ? (v.stdout.trim().match(/\d+\.\d+(?:\.\d+)?/) || [null])[0] : null;
|
|
222
|
+
let settings = {};
|
|
223
|
+
try { settings = JSON.parse(fs.readFileSync(path.join(os.homedir(), ".claude", "settings.json"), "utf8")); } catch { /* defaults */ }
|
|
224
|
+
return { agent: "Claude Code", agent_version: version, model: typeof settings.model === "string" ? settings.model : null, effort: typeof settings.effortLevel === "string" ? settings.effortLevel : (typeof settings.effort === "string" ? settings.effort : null), job_model: JOB_MODEL };
|
|
225
|
+
})();
|
|
213
226
|
// The repo this listener was started in (the Code signal on the rail): the
|
|
214
227
|
// git remote's owner/name, or null when the folder is not a repo.
|
|
215
228
|
const repo = (() => {
|
|
@@ -221,7 +234,7 @@ if (arg === "listen") {
|
|
|
221
234
|
const readiness = () => {
|
|
222
235
|
let signins = [];
|
|
223
236
|
try { signins = Object.keys(JSON.parse(fs.readFileSync(path.join(process.cwd(), ".recorder", "signins.json"), "utf8")).origins || {}); } catch { /* none */ }
|
|
224
|
-
return {
|
|
237
|
+
return { ...agentInfo, chrome: haveChrome, recorder: pkg.version, signins, cwd: process.cwd(), platform: process.platform, repo };
|
|
225
238
|
};
|
|
226
239
|
const api = async (body) => {
|
|
227
240
|
try {
|
|
@@ -234,7 +247,7 @@ if (arg === "listen") {
|
|
|
234
247
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
235
248
|
|
|
236
249
|
console.log(`\n Listening as "${name}" for ${cfg.workspace?.name ?? "your workspace"} on ${base.replace(/^https?:\/\//, "")}.`);
|
|
237
|
-
console.log(` Ask for a demo in the app (Create → Agentic Capture). ${agentBin ?
|
|
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."}`);
|
|
238
251
|
console.log(" Leave this terminal open; closing it stops the listening.\n");
|
|
239
252
|
|
|
240
253
|
const runJob = async (job) => {
|
|
@@ -247,7 +260,7 @@ if (arg === "listen") {
|
|
|
247
260
|
job.url ? `Address to start from: ${job.url}` : "Address: work it out from this project (the saved config, the codebase).",
|
|
248
261
|
`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"}.`,
|
|
249
262
|
].join("\n");
|
|
250
|
-
const child = (await import("node:child_process")).spawn(agentBin, ["-p", prompt, "--output-format", "stream-json", "--verbose", "--dangerously-skip-permissions"], {
|
|
263
|
+
const child = (await import("node:child_process")).spawn(agentBin, ["-p", prompt, "--model", JOB_MODEL, "--output-format", "stream-json", "--verbose", "--dangerously-skip-permissions"], {
|
|
251
264
|
cwd: process.cwd(),
|
|
252
265
|
env: { ...process.env, RECORDER_JOB: job.id, RECORDER_BASE: base, RECORDER_LISTEN: "1" },
|
|
253
266
|
stdio: ["ignore", "pipe", "pipe"],
|
package/package.json
CHANGED