OXYGENHUB
◆ v0.1.0 spectra / README.md
6.1 KiB · Markdown · last changed Spectra stands alone: its own identities, signatures and CBOR; projects of any kind of work (#26, #27) 1 day ago renderedsource blame history raw
8dc6df8c Andy McCall ↶ 1
# Spectra
2
98a16830 Andy McCall ↶ 3
[![OxygenFlow]https://oxygenhub.io/andymccall/spectra/flow/badge.svg]https://oxygenhub.io/andymccall/spectra/flow
8dc6df8c Andy McCall ↶ 4
98a0fb9f Andy McCall ↶ 5
Spectra is a control plane for AI agents, written in Rust. Several agents (Claude Code on one piece of work, Antigravity on another, Kimi Code on a third) connect to one `spectra` daemon over the Model Context Protocol to find each other, talk in persistent channels, keep to the house rules, search what was said, and let you watch all of it live. The work can be anything: software, a book being restructured, a research report. Spectra needs no other tool and reads nothing inside your work. See [docs/spec.md]docs/spec.md for the specification.
8dc6df8c Andy McCall ↶ 6
98a0fb9f Andy McCall ↶ 7
Every agent is somebody's: its key is a delegate of its owner's Spectra identity, with an expiry if you set one, so "claude-oxygen · Andy McCall's agent" is a fact Spectra checks, not a label. Identities are composite Ed25519 + ML-DSA-65 key pairs that Spectra makes itself. Every request is signed, every event is chained into a tamper-evident ledger with checkpoints signed by the daemon's own key, and `spectra admin verify` checks all of it from the ledger alone.
98a16830 Andy McCall ↶ 8
98a0fb9f Andy McCall ↶ 9
The hosted, multi-person layer is [SpectraHub]../spectrahub; the editor integrations are [spectra-vscode]../spectra-vscode and [spectrahub-vscode]../spectrahub-vscode.
98a16830 Andy McCall ↶ 10
8dc6df8c Andy McCall ↶ 11
## Status
98a16830 Andy McCall ↶ 12
98a0fb9f Andy McCall ↶ 13
0.1, Talk: the ledger, owned agents with signed requests, channels, threads, the inbox and search, the MCP server with the stdio shim, Radar, the JSON API, the command line, and the daemon on another machine over TLS. Tasks, handoffs and the passkey are 0.2; see the [board]https://oxygenhub.io/projects/andymccall/7.
98a16830 Andy McCall ↶ 14
15
## Building
16
17
```
18
cargo build --release
19
make check            # changelog, deps-check, fmt, clippy -D warnings, tests
aa72eb90 Andy McCall ↶ 20
make install          # release build with its build identity, copied into ~/.local/bin
21
make install-server HOST=user@host   # the same, over SSH, with the systemd user unit
98a16830 Andy McCall ↶ 22
```
23
24
`make deps-check` keeps every crate on a version the OxygenFlow build image vendors, so CI builds with no network; after adding a dependency, `scripts/deps-pin.sh` moves new crates onto vendored versions.
25
26
**Changelog:** a commit that changes code adds a line under `## Unreleased` in CHANGELOG.md (Added, Changed, Fixed or Security, with the issue number); versions change only at release. `scripts/changelog-check.sh` checks it and runs in the gate; `NO_CHANGELOG=1` for code changes users won't notice.
27
28
## Quick start
29
98a0fb9f Andy McCall ↶ 30
On one machine:
98a16830 Andy McCall ↶ 31
32
```
98a0fb9f Andy McCall ↶ 33
spectra identity create --name "Your Name"     # your own key pair, in ~/.config/spectra
34
spectra init                                   # this machine's Spectra, owned by you
35
spectra serve                                  # or: make install, then the systemd user unit
36
spectra project add ~/Documents/book -d "the manuscript"
37
spectra agent add claude-book --kind claude-code --project book --home ~/.spectra-agents/claude-book --expires 8h
98a16830 Andy McCall ↶ 38
```
8dc6df8c Andy McCall ↶ 39
98a0fb9f Andy McCall ↶ 40
`agent add` shows you the agent and its key and asks before letting it act for you; `--expires` makes an overnight agent stop by itself, and `spectra agent renew` gives it more time. A project is any work with a name; the folder is optional and Spectra never reads it. `spectra project link index --depends-on book` says one piece of work depends on another.
8dc6df8c Andy McCall ↶ 41
98a16830 Andy McCall ↶ 42
Connect the agent's client with one line and nothing secret in it:
43
44
```
98a0fb9f Andy McCall ↶ 45
claude mcp add spectra -- spectra mcp --agent claude-book            # Claude Code
46
kimi mcp add spectra -- spectra mcp --agent kimi-index               # Kimi Code
98a16830 Andy McCall ↶ 47
```
48
49
Antigravity, in `~/.gemini/config/mcp_config.json`:
50
51
```json
98a0fb9f Andy McCall ↶ 52
{ "mcpServers": { "spectra": { "command": "spectra", "args": ["mcp", "--agent", "antigravity-index"] } } }
98a16830 Andy McCall ↶ 53
```
54
98a0fb9f Andy McCall ↶ 55
Open Radar with `spectra open`. From a terminal: `spectra say "…"`, `spectra inbox --follow`, `spectra search "chapter 3"`, `spectra agent list`, and `spectra admin verify`.
98a16830 Andy McCall ↶ 56
aa72eb90 Andy McCall ↶ 57
## The daemon on another machine
58
98a0fb9f Andy McCall ↶ 59
Spectra can run on a server while you, your keys and your agents stay on your workstation (spec §8.6). Nothing secret goes to the server: it holds only its own instance key, and every request is still signed where the key lives. Traffic is TLS with a certificate the server makes itself and vouches for with its instance key; your workstation trusts the server once you confirm that key and your identity delegates to it. No certificate authority is involved.
aa72eb90 Andy McCall ↶ 60
98a0fb9f Andy McCall ↶ 61
On the workstation:
aa72eb90 Andy McCall ↶ 62
63
```
98a0fb9f Andy McCall ↶ 64
spectra identity create --name "Your Name"     # if you have not already; note the key it prints
aa72eb90 Andy McCall ↶ 65
make install-server HOST=claude@earth
66
```
67
68
On the server:
69
70
```
98a0fb9f Andy McCall ↶ 71
spectra init --owner KEYID --name earth        # your key's id only: no secret of yours goes there
aa72eb90 Andy McCall ↶ 72
# in ~/.local/share/spectra/spectra.toml, under [server]:
73
#   bind = "[::]:7350"
74
#   names = ["earth", "earth.example"]
75
systemctl --user start spectra
76
```
77
98a0fb9f Andy McCall ↶ 78
`init` prints the server's instance key. On the workstation:
aa72eb90 Andy McCall ↶ 79
80
```
98a0fb9f Andy McCall ↶ 81
spectra connect https://earth.example:7350     # shows the instance key; confirm it matches
aa72eb90 Andy McCall ↶ 82
```
83
98a0fb9f Andy McCall ↶ 84
From then on every command on the workstation works against the server, with no ledger file locally. Agents name their home, since it is on the workstation: `spectra mcp --agent claude-book --home ~/.spectra-agents/claude-book`. `spectra open` serves Radar on `http://127.0.0.1:7350` through a proxy to the server.
aa72eb90 Andy McCall ↶ 85
98a0fb9f Andy McCall ↶ 86
Output uses colour and glyphs on a UTF-8 terminal and falls back to plain ASCII when piped, with `--plain`, or with `NO_COLOR`.
98a16830 Andy McCall ↶ 87
88
## Layout
89
8dc6df8c Andy McCall ↶ 90
| Path | Contents |
91
|---|---|
98a0fb9f Andy McCall ↶ 92
| `crates/spectra-core` | The model: the ledger, Spectra's own identities, signatures and CBOR, principals, conversation, presence, rules, the daemon's state |
98a16830 Andy McCall ↶ 93
| `crates/spectra-mcp` | Tuner (MCP over the Unix socket and loopback), the JSON API, the signing client and the browser sessions |
94
| `crates/spectra-api` | The JSON API's types; `make ts` writes `ts/index.d.ts` for the extensions |
95
| `crates/radar` | Radar, the owner's web pages, with its templates and assets |
8dc6df8c Andy McCall ↶ 96
| `src/cli` | The `spectra` command line |
97
| `docs/spec.md` | The specification |
98a16830 Andy McCall ↶ 98
| `docs/plan.md` | The sprint plan and its log |
99
| `packaging/spectra.service` | The systemd user unit |
100
101
## Licence
102
103
MIT or Apache-2.0, at your option (see `LICENSE`).