blender-motion-state-inspection
AFaffaan-m/ECC315k近 7 天新增 4,381 个 star
Run the Lathe worker loop so the web UI's Ask / Verify / Add-a-part buttons drive work directly in this session instead of handing back a command to paste. Use when the user invokes /lathe-work (start it once per session while `lathe serve` is running). Works in any coding agent.
Start a long-running loop that lets the lathe serve web UI drive Ask, Verify, Add-a-part, and Check my work directly in this session. With this loop running, the browser buttons enqueue a job and you pick it up here — no copy-paste of a /lathe-* command. Triggered by /lathe-work.
This is just long-poll → do the model work → report → repeat, so it works in any supported coding agent. The strict boundary still holds: the binary never drives a model. All model work runs here, in your normal interactive session — never via -p / headless. Verify runs the tutorial's code under exactly the same trust model as /lathe-verify does today (a fresh mktemp -d, your normal permissions).
When this loop is not running, the buttons fall back to today's copy-paste handoff — so starting it is purely additive.
If lathe serve was started with --agent <cmd>, it hosts that agent over ACP and Ask / Verify / Add-a-part run there first; this loop is the fallback for agents without ACP support and for anyone who prefers to watch the work in their own terminal. Jobs only reach this loop when the hosted agent isn't configured or couldn't start.
lathe serve must be running (the loop talks to it via ~/.lathe/serve.json). If lathe work next reports "no lathe server is running", tell the user to start lathe serve in another terminal, then start the loop.
Repeat until the user stops you (Ctrl-C, "stop the worker", or closing the session):
Claim the next job:
lathe work next
This long-polls (~50s) and prints either no task or a single JSON object like:
{"id":"7","type":"verify","slug":"digital-synth-zig","part":"part-02.md","question":"…","guidance":"…","path":"…","state":"claimed"}
no task, loop back to step 1 immediately — that's just an idle long-poll, not an error.id, type, slug, and (depending on type) part/question/guidance/path/command.Dispatch on type, applying the existing protocol as the source of truth — don't duplicate or paraphrase it, apply it:
verify → apply the /lathe-verify protocol against slug exactly as written (it marks the tutorial verifying, follows it in a fresh scratch dir, and records the outcome via lathe verify-result). When it finishes, close the job:
lathe work done <id>
extend → apply the /lathe-extend protocol against slug, passing guidance (when present) as the guidance for where the new part should go. It does the full reserve → write → lathe extend-commit handshake. When it finishes, close the job:
lathe work done <id>
check → apply the /lathe-check protocol against slug / part, with path as the learner's workspace (copy it to a scratch dir; never change it). It records the hint ladder via lathe check-result, which the browser picks up. When it finishes, close the job:
lathe work done <id>
new → the reader asked for a new tutorial from the web UI. Its command field is the full /lathe <topic> … invocation, with the reader's pre-answered inputs as flags (--level, --voice, --workspace, --tool, --repo); slug is empty. Apply the /lathe protocol to command exactly as if the user had typed it (its "Pre-answered inputs" section says which questions the flags answer — ask the rest here, in this session). It picks the slug, writes Part 1, and stores it with lathe store. When it finishes, close the job:
lathe work done <id>
shelf → the reader asked your agent to file the library from the web UI ("Sort my shelves…" in Settings, or a shelf's split banner). Its command field is /lathe-shelf sort or /lathe-shelf split <shelf-id>. Apply the /lathe-shelf protocol to it: it only records proposals (lathe shelf propose / propose-split) for the reader to review; it moves nothing. When it finishes, close the job:
lathe work done <id>
ask → apply the /lathe-ask protocol against slug / part / question. The one difference from the chat flow: the reader is in the browser, not here, so return the answer through the CLI instead of only replying in chat. Pipe your full markdown answer to:
lathe work answer <id> --answer -
(--answer - reads the answer from stdin, the same stdin pattern lathe voice add --file - uses.) The browser is polling for it and will render it in the reader's Ask drawer. work answer closes the job for you — don't also call work done for an ask.
Briefly note in chat what you just handled (e.g. "Verified digital-synth-zig — clean" or "Answered a question on part-02"), then loop back to step 1.
This loop is long-running and each job is independent — nothing carries over from one job to the next — so keep the dispatcher thin and don't let it block or accumulate full job transcripts.
/lathe-* protocol and closes the job itself (lathe work done / lathe work answer). Two payoffs: the dispatcher's context grows by a sentence per job instead of a whole verify/extend transcript, and — crucially — if your agent can run the sub-task in the background (e.g. run_in_background), do that and immediately go back to lathe work next instead of waiting on it. The sub-task self-reports, so the loop never needs its return value; meanwhile your continued polling keeps worker presence fresh during a long verify/extend (a foreground/blocking dispatch would stop polling and let presence lapse, so a mid-job button click would fall back to copy-paste). Keep the outer loop to just: claim → fire the job into a background sub-context → poll again./lathe-work to reset. This is safe and lossless: the queue lives in the server, so any unclaimed job stays queued and a mid-flight claimed job is re-queued after the reclaim timeout. Nothing is lost by restarting./lathe-* skill, then report." All the real rules (read-only verify, the extend handshake, grounded ask answers) live in those skills and win on any conflict.verify/extend/check/new/shelf → lathe work done <id>; ask → lathe work answer <id> --answer - (which closes it). A job left open ties up the browser until the server's reclaim timeout.-p / headless to do the work — that's the metered path this whole design avoids.slug, and ask jobs are read-only.Stop the loop when the user asks (or close the session). Stopping is safe: the buttons revert to the copy-paste handoff, and any job already claimed but not closed is re-queued by the server after its reclaim timeout.
AFaffaan-m/ECC315k近 7 天新增 4,381 个 star
ANanthropics/skills203k近 7 天新增 3,265 个 star
HAharry0703/MoneyPrinterTurbo147k近 7 天新增 1,608 个 star
SHShubhamsaboo/awesome-llm-apps147k近 7 天新增 907 个 star
GAgarrytan/gstack143k近 7 天新增 598 个 star