#!/usr/bin/env moshscript // Check that desktop control is on // Exported from W3BS Training episode ep_5deee37d50020db5 on 2026-10-19 (w3bs-training 0.2.6). // The task below is an OpenTask 0.1 document: https://logicsrc.com/docs/opentask // // moshcode run check-that-desktop-control-is-on-6i8ymp.mosh opens claude with this task // moshcode run check-that-desktop-control-is-on-6i8ymp.mosh codex or another engine // moshcode run check-that-desktop-control-is-on-6i8ymp.mosh --dry-run shows what it would do // // The recording holds semantic steps (app, control, shortcut): no coordinates, and typed text only as placeholders. // Nothing here is replayed. The engine does the task through // the W3BS Agentic Desktop Layer (MCP server "w3bs-desktop"), looking at the screen // before every action and asking you before anything it cannot undo. One-time setup: // w3bs desktop agents add claude-code --preset broad // w3bs desktop setup claude-code --agent claude-code // Enable the layer from the tray before running. const task = { "type": "logicsrc.opentask", "version": "0.1", "id": "check-that-desktop-control-is-on-6i8ymp", "title": "Check that desktop control is on", "goal": "Make sure the W3BS desktop control page says Enabled, so an agent can use this computer.", "explanation": "Open the Desktop Control page in the browser and look at the status.", "apps": [ { "name": "TronBrowser", "kind": "browser" } ], "steps": [ { "n": 1, "action": "focus", "app": "TronBrowser", "target": { "role": "page", "name": "Desktop Control" }, "evidence": "observed" }, { "n": 2, "action": "observe", "app": "TronBrowser", "target": { "role": "status", "name": "Enabled" }, "evidence": "observed" } ], "capture": { "profile": "visual-review", "window_titles": "removed", "gaps": [] }, "stop_conditions": [ "a target cannot be found on the current screen", "an unexpected dialog appears", "a credential or payment prompt appears" ], "approvals": [], "success": { "check": "The Desktop Control page shows Enabled.", "evidence": "screen" }, "source": { "kind": "demonstration", "recorder": "w3bs-training 0.2.6", "episode": "ep_5deee37d50020db5", "reviewed": true, "outcome": "success" }, "status": "untested" }; const engine = (argv[0] || "claude").toLowerCase(); const apps = task.apps.map((a) => a.name); const gaps = (task.capture && task.capture.gaps) || []; say(`🎸 ${task.goal}`); say(` ${task.steps.length} step(s) across ${apps.join(", ") || "the desktop"}`); const describe = (s) => [ s.action, s.app, s.window && `(window: ${s.window})`, s.target && `[${[s.target.role, s.target.name].filter(Boolean).join(" ")}]`, s.keys && `keys ${s.keys.join("+")}`, s.text && `text ${s.text}`, s.note && `(${s.note})`, ] .filter(Boolean) .join(" "); for (const s of task.steps) say(` ${s.n}. ${describe(s)}`); const prompt = [ `Do this task on my desktop: ${task.goal}`, task.explanation ? `In my words: ${task.explanation}` : "", "", `I recorded it once with W3BS Training. The recording holds semantic steps (app, control, shortcut): no coordinates, and typed text only as placeholders,`, "so work out each action from what is on screen. The steps I took:", ...task.steps.map((s) => `${s.n}. ${describe(s)}`), (task.parameters || []).length ? `Text in {{braces}} is a value you must ask me for: ${task.parameters.map((p) => p.name).join(", ")}.` : "", gaps.length ? `Parts were not captured (${gaps.join(", ")}); do not guess what happened there, ask me.` : "", "", "Use the w3bs-desktop MCP tools. Observe the screen before every action and never reuse old", "coordinates.", task.source && task.source.episode ? `If the w3bs-training MCP is connected, training_get_frames with episode_id ${task.source.episode} shows the screenshots I recorded.` : "", `Stop and tell me if: ${task.stop_conditions.join("; ")}.`, task.approvals.length ? `Ask me ${task.approvals.join("; ")}.` : "", `It worked when: ${task.success.check}`, "When you finish or stop, say what you did and what is left, and report it with", "training_report_run if that tool is available.", ] .filter((l, i, all) => l !== "" || all[i - 1] !== "") .join("\n"); const quote = (s) => `'${String(s).replace(/'/g, `'\\''`)}'`; if (!shell("command -v w3bs >/dev/null 2>&1").ok) { say("w3bs is not installed: curl -fsSL https://w3bs.org/install.sh | sh, then the setup lines at the top of this file."); } else if (engine === "claude" || engine === "codex") { // Interactive, so you see and approve each desktop action as it happens. shell(`${engine} ${quote(prompt)}`); } else { say(await ai(prompt, { engine })); }