Skip to content

Development

Instructions for coding agents working on the repository are in AGENTS.md.

One command, from any shell (it enters nix develop by itself):

Terminal window
./dev demo # start the daemon, run a few echo threads, stop it
./dev # qccd in the foreground, data in ./.dev
./dev qcc thread spawn --provider echo --prompt 'hello' --follow # the CLI against this daemon
./dev qcc thread spawn --provider claude-code --permission-mode ask --prompt 'what is in this directory?' --follow
./dev qcc thread send <thread-id> 'and one more thing' --steer
./dev desktop # the desktop app (nix develop .#desktop)
./dev check # fmt, clippy -D warnings, all tests
./dev clean # delete ./.dev

Every ./dev command that builds the project also restarts the dev daemon if it was left over from a previous build: otherwise the app and the CLI would be talking to old code. If agents are working in it, the script lists them and asks (without a terminal it only warns and leaves the daemon alone).

Inside nix develop the same is available as make run|demo|check|test|clean.

Every qcc command has --json. Outside ./dev the data lives in ~/.local/share/qcc (QCC_DATA_DIR), and the socket is $XDG_RUNTIME_DIR/qcc/qccd.sock (QCC_SOCKET).

How ./dev desktop differs from ./dev app is described in Desktop app.

wit/plugin.wit plugin contract (qcc:plugin@0.7.0)
crates/qcc-domain types without IO: the delta grammar and the canonical timeline
crates/qcc-runtime delta assembler, thread state machine, recovery after restart
crates/qcc-store SQLite: event journal and projections
crates/qcc-plugin-host wasmtime, permissions, plugin actor
crates/qcc-plugin-sdk guest side of the contract
crates/qcc-plugin-testkit runs a plugin without the daemon: conformance of bridges
against recordings, and a bench for other plugins
crates/qcc-plugins-bundle builds plugins/ into wasm components when the daemon is built
crates/qcc-protocol daemon API (JSON-RPC over a unix socket)
crates/qcc-client Rust client of the API
crates/qcc-daemon qccd
crates/qcc-cli qcc
apps/desktop control panel: src-tauri (proxy to qccd) + React
plugins/provider-echo example provider
plugins/provider-claude-code, provider-acp, provider-codex bridges to real agents
plugins/env-git-worktree environment: a git worktree per thread
plugins/orchestration skill for agents, handoff and review commands
plugins/notify desktop notifications when an agent finishes, fails or asks
plugins/reviewers reviewer agents that look at a thread's changes and comment
plugins/gitlab merge requests of a thread's branch, beside the thread

The main rule: the bridge knows the dialect, the core knows the timeline. A provider plugin translates the agent's output into a narrow set of deltas; the ids, order and lifecycle of turns and items belong to the assembler in qcc-runtime. The core never branches on a provider id, and built-in plugins take the same path as third-party ones.

No host import blocks, so work that waits for a process answers later: handle returns deferred(token), and the result arrives through completions.complete. This is how env-git-worktree is built: each operation is a state machine over finished git commands (src/jobs.rs, tested without wasm).

Agent protocol formats are not written from memory: plugins/provider-*/fixtures/*.ndjson holds traffic recorded from the installed CLIs, and next to it is *.timeline.jsonl, the timeline it must assemble into. The tests plugins/provider-*/tests/conformance.rs replay the recording in place of the agent process, through the real wasm host and assembler.

When an agent has been updated and its behavior changed:

Terminal window
# record the scenario again (the scripts run the real CLI)
python3 scripts/fixtures/record-claude.py RAW.ndjson allow '[{"send": …}, {"wait": "result"}]'
python3 scripts/fixtures/record-jsonrpc.py RAW.ndjson '[…]' -- opencode acp
# remove paths, credentials and anything extra; the script checks that nothing personal is left
python3 scripts/fixtures/redact.py claude RAW.ndjson plugins/provider-claude-code/fixtures/NAME.ndjson --work "$PWD"
# rewrite the golden timelines and look at the diff
QCC_UPDATE_GOLDEN=1 cargo test -p provider-claude-code --test conformance

qcc.quantick.dev is built from this repository: site/ is an Astro Starlight project, and its pages are the files of docs/. They are not copied: site/src/content/docs is a link to docs/, and site/src/lib/docs.mjs takes each page's title from its # heading, its description from the first paragraph, and turns links between the files (agents.md#permission-mode) into links between pages. A link to a file outside docs/ goes to the file on GitHub. So write docs/ for GitHub as before, without frontmatter; a new page also needs its place in the sidebar, in site/astro.config.mjs. docs/README.md is GitHub's index of the folder and is not a page; the landing page is site/src/pages/index.astro. docs/cli.md is generated from the CLI's definitions (see the top of the file); a test fails while it is out of date.

Terminal window
./dev site # dev server with hot reload at http://localhost:4321 (nix develop .#site)
./dev site build # the site in site/dist, as CI builds it
./dev site preview # serve site/dist

The build fails on a link to a page or a heading that does not exist (starlight-links-validator). Search is Pagefind's index, made by the build, so it works in build + preview, not in dev.

.github/workflows/site.yml builds the site on pull requests and pushes to main that touch docs/, site/ or the workflow, and publishes main to GitHub Pages. site/public/CNAME holds the domain.