Mission control: session/turn tool-call counters in a Pane, an AbovePrompt band and a status entry

Coding-agent harness for Claude Code (and friends): inject skills, commands, agents, hooks, and an MCP surface into any project, and watch what the agent does from a local dashboard.
npm install -g @weavecode/weave
weave init # scaffold a project
weave dashboard # start the daemon (if it is not running) and open the UI
weave init — writes the harness files a project needs (.claude/ helpers, hooks, settings, .mcp.json), merging into user files instead of overwriting them. Multi-harness: Claude Code and Codex.weave daemon — a local daemon (HTTP + SQLite) that ingests hook events, stores sessions, and serves the dashboard. Hooks never call it over HTTP: events append to <configDir>/weave/hooks/inbox/ (a daemon worker thread claims and ingests them, then deletes the file), so collection and rule-driven injection keep working while the daemon is down. Upgrade note: a project's .claude/helpers/hook-handler.cjs is only refreshed by weave init, so re-run it in projects initialized before this change (older scripts post to a removed endpoint and would report nothing).weave dashboard — a web UI for projects, sessions, hooks, plugins, and installs. Served by the daemon itself.weave scan / weave status — project discovery and harness status.weave chpass).Everything weave ships — the weave init commands and agents, the built-in skills/hooks/rules plugin packs, and the rule packs loaded into the engine — lives in one marketplace-shaped directory:
packages/weave-templates/src/resources/weave-market/
├── .claude-plugin/marketplace.json # the repo's own manifest
├── plugins/<scope>/<pack>/ # toolkit packages (skills, hooks, mods)
├── rules/<pack>/ # rule packs loaded by the weave engine
└── init/{commands,agents}/ # what `weave init` copies in
On daemon start it is materialized at <configDir>/weave/market/weave/ as a link to that directory (a copy where links are unavailable), and it is the single source for scanning, listing and installing:
src/resources/…, so content edits are live for the next scan/restart; pnpm build copies it to dist/resources/… for the published package;External repos are separate: import them through the dashboard's resource market (<configDir>/weave/market/<id>/), and their packages show up as their own namespace block next to the built-in weave one.
| Command | What it does | ||
|---|---|---|---|
weave init | Scaffold harness files into a project | ||
weave scan | Discover and register projects | ||
weave status | Show harness status for a project | ||
weave doctor | Diagnose local wiring (registration, token, daemon) | ||
| `weave daemon start\ | stop\ | status` | Manage the local daemon |
weave dashboard | Open the dashboard in a browser (starting the daemon if needed) | ||
weave chpass <new password> | Change the dashboard login password (locally, no old password needed) | ||
weave uninstall | Remove weave's init outputs from a project (rolls back the init commit when it is HEAD, otherwise commits the removal) |
One artifact is published — @weavecode/weave, a self-contained bundle: the compiled CLI, daemon, dashboard and built-in resources, with every runtime dependency packed inside the tarball, so a global install needs nothing else from the registry. The repo's layers below are private and are never published on their own.
| Package | Role |
|---|---|
packages/weave (@weavecode/weave) | The published bundle: CLI + daemon + dashboard + resources |
packages/weave-cli (@weavecode/cli) | CLI entry point (weave command) |
packages/weave-server (@weavecode/server) | Daemon: HTTP, SQLite, hook ingestion, dashboard host |
packages/weave-harness (@weavecode/harness) | Harness drivers and the init pipeline |
packages/weave-templates (@weavecode/templates) | Built-in market (skills, commands, agents, rules) |
packages/weave-core (@weavecode/core) | Shared types and tables |
node:sqlite).PATH — weave drives them, it does not bundle them.pnpm install
pnpm build # tsc -b + template/preset copy
pnpm build:web # dashboard bundle → packages/weave-server/web/dist
pnpm test
pnpm dev # CLI from source
pnpm dev:server # daemon from source
pnpm dev:web # dashboard on :9527
Requires Node.js >= 22.5 (uses node:sqlite).
node scripts/release.mjs <version> # bump every package, build, publish components with pnpm, then publish the umbrella tgz
Packages publish under the @weavecode scope to the public npm registry. workspace: dependencies are rewritten by pnpm publish — do not use npm publish directly.
Apache-2.0. See LICENSE and THIRD_PARTY_NOTICES.md.
hooks/register.tsx 56 lines1import type { Register } from 'claude-code'
2
3const PANE = 'mission-control'
4
5// 模块级计数:热重载后归零(会话仪表可接受)——精简版只做
6// 「state 计数 + Pane/AbovePrompt/status」,不引入 $.state 契约文件。
7let sessionCalls = 0
8let turnCalls = 0
9let lastTool = '-'
10
11export const register: Register = on => {
12 on('session.start', async ($, e, next) => {
13 await $.ui.open({ id: PANE, title: 'Mission control' })
14 return next(e)
15 })
16
17 on('prompt.submit', ($, e, next) => {
18 turnCalls = 0
19 $.ui.invalidate()
20 return next(e)
21 })
22
23 on('tool.call', ($, e, next) => {
24 sessionCalls += 1
25 turnCalls += 1
26 lastTool = String(e.tool)
27 $.ui.status(`mc ${sessionCalls}/${turnCalls}`)
28 $.ui.invalidate()
29 return next(e)
30 })
31
32 on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
33 const { Box, Text } = $.ui.resolve(e)
34 return (
35 <Box flexDirection="column">
36 <Text bold>Mission control</Text>
37 <Text>session calls: {sessionCalls}</Text>
38 <Text>turn calls: {turnCalls}</Text>
39 <Text dimColor>last tool: {lastTool}</Text>
40 </Box>
41 )
42 })
43
44 on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
45 if (e.props.hasSurvey) return next(e)
46 const { Box, Text } = $.ui.resolve(e)
47 return (
48 <Box>
49 <Text dimColor>
50 mission-control · session {sessionCalls} · turn {turnCalls} · last {lastTool}
51 </Text>
52 </Box>
53 )
54 })
55}
56