continuum

module
v0.1.0-alpha.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2026 License: AGPL-3.0

README

Continuum

One Go daemon per machine that owns your terminals and coding agents — durable history, explicit control, a CLI — so work outlives the client that started it. The runtime under Menagerie.

Public alpha, AGPL-3.0. The /v1 API is a versioned contract (continuum/v1, contract 1.0 — negotiate with continuum contract; see docs/v1-contract.md). Runs always-on via continuum service install, or continuum service cutover to replace an installed menagerie-relay in place (adopting its port, token, origins and agents).

What it does

  • Work survives the client. Close the tab, drop the network, kill -9 the daemon — the process keeps running under a per-block holder, and the daemon re-adopts it on restart with the same block ID and PID. Any gap is marked, never hidden.
  • Two doors, one core. The same binary speaks Menagerie's legacy WebSocket (unchanged) and a versioned /v1 contract on a private Unix socket — continuum contract reports the version and capabilities. One process manager, one journal, one lease model.
  • Observe without stealing. Many viewers can watch a block; control is a 60-second lease, explicit and revocable.
  • Durable, honest history. Choose none, a committed visible screen, the last N lines, or full raw output per block; lifecycle records remain durable. Retention limits, purge, and capture failures are explicit. Export retained output as asciicast v3.

Quick start

Requires Go 1.26.8.

go build -o bin/continuum ./cmd/continuum
./bin/continuum serve              # leave this running

In another terminal:

./bin/continuum open -- /bin/sh
./bin/continuum status
./bin/continuum events --block BLOCK_ID --follow --text

Choose retention when opening a block, then manage it explicitly:

./bin/continuum open --recording lines:500 -- /bin/sh
./bin/continuum purge --block BLOCK_ID      # exited blocks; keep lifecycle metadata
./bin/continuum retire --block BLOCK_ID     # exited blocks only
./bin/continuum compact                     # stop the daemon first

serve writes private credentials and a v1.sock under your config dir and opens a loopback port for Menagerie and a read-only /observer doorway. Use --state /abs/path to isolate a workspace; continuum help lists every command. Never put this alpha on a public listener.

To run it always-on (launchd on macOS, systemd --user on Linux) under its own service label, separate from any installed menagerie-relay:

./bin/continuum service install --listen 127.0.0.1:58750   # fixed port so Menagerie can reconnect
./bin/continuum service status
./bin/continuum service uninstall

With Menagerie

Point Menagerie's Add-relay form at the ws:// address serve prints, using operator.token from the state directory. The menagerie-relay entry point and the continuum legacy * subcommands preserve Menagerie's existing configuration and semantics; an installed-service cutover is a separate, validated step.

SSH clients and scoped directory browsing (experimental)

On the owning host, opt into browsing one or more roots when starting a foreground daemon:

continuum serve --state /absolute/state --browse-root /absolute/workspaces
continuum directories --state /absolute/state --path /absolute/workspaces --limit 50

With an existing trusted SSH host/key and Continuum on that host:

continuum directories --host user@host --state /remote/state
continuum open --host user@host --state /remote/state --cwd /remote/workspace -- /bin/sh

--remote-binary /absolute/path/to/continuum selects a non-PATH installation. Daemon bearer tokens remain on the owning host. Browsing is operator-only, defaults off, and does not change execution authority. Browse roots currently require serve (service-unit persistence is not implemented). Remote calls use one SSH process per request. An isolated two-host fault/restart check ran over the existing trusted Studio SSH path; wider network performance remains unmeasured. See the directory/SSH contract.

Compose block streams (experimental)

continuum interleave \
  --source '{"name":"build","state":"/absolute/state","block_id":"LOCAL_BLOCK_ID"}' \
  --source '{"name":"tests","host":"user@host","state":"/remote/state","block_id":"REMOTE_BLOCK_ID"}' \
  --type output

Replace the block IDs with full IDs from open or status. Output is source-labelled NDJSON with original payloads, per-source cursors and asciicast-shaped event triples. Add --follow for ongoing observation and --control for stdin pause/continue/cancel commands. These controls affect the observer only, never the workload. Sources use observer credentials by default. See stream limits, control replies and Nushell usage.

Durable waits and managed workspaces (experimental)

continuum wait coordinates bounded any/all lifecycle conditions across local blocks and explicitly pinned SSH peers. A wait is durable after its initial source observation, can be read with output or attach, and has explicit deadline/cancel results. It never stops or approves a source implicitly. See the coordination contract.

continuum workspace plan previews a fleet spec without shell effects; workspace run requires --trust with its exact source-byte hash before repository-authored shell runs. workspace status, stop and destroy expose supervision and explicit teardown. Managed supervised services require a stop hook and a non-answering declared port before destroy. See the lifecycle limits.

Scoped access and recovery (experimental)

continuum access creates show-once per-block observer/controller/moderator grants, changes block sharing, revokes grants and reads the bounded audit. The browser doorway accepts observer credentials only; the root operator token is never accepted there. continuum backup creates or restores a checked offline state backup. Keep grant files private and run recovery with the daemon stopped. See the access and operations contract.

Status & docs

Public alpha 0.1.0-alpha.2 — see CHANGELOG.md. Gate: python3 scripts/verify.py verify (race detector, CLI/terminal journeys, legacy, schema-upgrade, isolated SSH bridge, stream composition, managed headless cycle and network-free WAN-runner checks). Set CONTINUUM_TEST_NU to a Nushell binary to include its live pipeline check. The opt-in real-acp feature requires an installed ollama/ model and passes no cloud credentials to the agent. The separate real two-host script uses trusted SSH and isolated temporary daemons. The opt-in three-server WAN drill has run once against two remote hosts (below). Still open: structured-session (ACP) process survival across daemon restart, broad provider/platform validation and untrusted multi-user hosting.

Tested on 2026-09-17: macOS/arm64 full isolated gate; Linux/arm64 Docker core race gate and headless managed cycle; two macOS hosts with one dropped SSH bridge request, an outage, coordinator restart and 2-second bridge latency; OMP 18 with local Ollama qwen3.5:0.8b over ACP. On 2026-09-18: the three-server WAN drill from a macOS coordinator to two temporary Linux/amd64 hosts (AWS Mumbai and N. Virginia; ~0.5 s and ~3.5 s per SSH bridge call), all seven cases; and the Menagerie client follow-through (CU1–CU7) against this daemon in a browser. These are bounded checks, not a Linux systemd/service-install test, a lossy-WAN benchmark, an arm64 remote host, or validation of cloud ACP providers. No installed relay was replaced or restarted.

Licensed AGPL-3.0 — see LICENSE and NOTICE for the Menagerie relay lineage.

Directories

Path Synopsis
Package api defines the versioned Continuum local-alpha contract.
Package api defines the versioned Continuum local-alpha contract.
cmd
continuum command
menagerie-relay command
Package fleet is the single ingress for a fleet spec (D6): every path into materialisation parses and validates here first, so no other package needs to re-check the shape of what it was handed.
Package fleet is the single ingress for a fleet spec (D6): every path into materialisation parses and validates here first, so no other package needs to re-check the shape of what it was handed.
checkcli
fleetcheck validates fleet specs from the command line.
fleetcheck validates fleet specs from the command line.
cmd/fleetcheck command
internal
acp
Package acp runs structured-session children that speak the pinned Agent Client Protocol (JSON-RPC 2.0, newline-delimited) over stdio.
Package acp runs structured-session children that speak the pinned Agent Client Protocol (JSON-RPC 2.0, newline-delimited) over stdio.
asciicast
Package asciicast writes an asciicast v3 stream from Continuum's journaled PTY output.
Package asciicast writes an asciicast v3 stream from Continuum's journaled PTY output.
cli
Package cli is the human and machine client of the same authorized host API.
Package cli is the human and machine client of the same authorized host API.
config
Package config loads and writes the relay's TOML configuration.
Package config loads and writes the relay's TOML configuration.
holder
Package holder keeps a PTY block alive across daemon restarts.
Package holder keeps a PTY block alive across daemon restarts.
ipc
Package ipc names and opens the daemon's local API socket.
Package ipc names and opens the daemon's local API socket.
journal
Package journal owns Continuum's single-writer durable metadata and event log.
Package journal owns Continuum's single-writer durable metadata and event log.
jsonwire
Package jsonwire encodes standalone JSON transport/storage documents.
Package jsonwire encodes standalone JSON transport/storage documents.
protocol
Package protocol defines the Menagerie relay protocol message types.
Package protocol defines the Menagerie relay protocol message types.
pty
Package pty manages a single agent attached to a pseudo-terminal.
Package pty manages a single agent attached to a pseudo-terminal.
server
Package server implements the relay's WebSocket server.
Package server implements the relay's WebSocket server.
shims
Package shims adapts specific coding agents to the relay's PTY model.
Package shims adapts specific coding agents to the relay's PTY model.
terminal
Package terminal owns an experimental, headless terminal screen.
Package terminal owns an experimental, headless terminal screen.
tmux
Package tmux backs relay sessions with tmux so an agent survives the relay process restarting: the agent runs inside a detached `menagerie-<id>` tmux session (owned by the persistent tmux server), and the relay merely attaches a PTY to it.
Package tmux backs relay sessions with tmux so an agent survives the relay process restarting: the agent runs inside a detached `menagerie-<id>` tmux session (owned by the persistent tmux server), and the relay merely attaches a PTY to it.
Command menagerie-relay runs a Menagerie relay: it exposes a WebSocket the browser (or a supervisor agent) connects to and, from P3 on, manages PTYs for spawned coding agents.
Command menagerie-relay runs a Menagerie relay: it exposes a WebSocket the browser (or a supervisor agent) connects to and, from P3 on, manages PTYs for spawned coding agents.
Package materialise executes a spec's materialise block against a provisioned workspace, in the one fixed order the handoff specifies:
Package materialise executes a spec's materialise block against a provisioned workspace, in the one fixed order the handoff specifies:
Package workspace provisions one agent's working copy: the git worktree, the ports it may bind, and the variable set every later materialisation stage interpolates against.
Package workspace provisions one agent's working copy: the git worktree, the ports it may bind, and the variable set every later materialisation stage interpolates against.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL