daemon

module
v0.1.60 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0

README

Mindwire daemon (mindwired)

The Go core of mindwire: a small static binary that owns the agent CLIs (Claude Code today), drives turns, and serves the unified HTTP + SSE API. One daemon hosts every registered adapter; a request selects one with ?agent=<type>.

The mindwire SDK bundles this binary and runs it for you by default — most users never invoke it directly. Run it standalone when you want a shared/remote runtime or the plain REST API.

Run it

The daemon also hosts signed messaging webhooks for Slack, Microsoft Teams, Discord, and Telegram. Configure connections through /integrations, either SDK, or a bot's Integrations settings. Connections reuse native bot execution and can also serve as app notification destinations. See the setup and delivery guide.

Requires Go (see go.mod) and the agent CLI you want to drive (Claude Code: Node.js + npm i -g @anthropic-ai/claude-code).

# Dev run (binds 127.0.0.1:8790):
export DAEMON_TOKEN="$(openssl rand -hex 32)"
DEV_CORS=1 AGENT_CWD="$PWD/.." go run ./cmd/daemon

curl -s -H "Authorization: Bearer $DAEMON_TOKEN" http://127.0.0.1:8790/healthz

./build.sh   # → dist/latest/mindwired-<os>-<arch> + catalog.json
Env var Default Purpose
ADDR 127.0.0.1:8790 Listen address.
AGENT_TYPE claude-code Default agent when a request omits ?agent=.
AGENT_CWD daemon cwd Project directory turns run in.
STATE_PATH agent-state.json Local JSON state file.
WORKSPACE_DB_PATH workspace.db beside STATE_PATH Authoritative SQLite registry for agent profiles, projects and chat links.
DAEMON_TOKEN (required) Bearer token, also saved privately beside the state file for authorized workspace clients.
MINDWIRE_ISOLATION direct Trusted launch setting: direct uses the host account's normal access; container uses the enclosing container as its boundary. Codex adds no inner sandbox by default. Explicit sandbox settings and approvals are preserved. Reported by /healthz as workspaceIsolation with workspaceIsolationVersion: 1.
DEV_CORS off 1 allows a cross-origin browser client (e.g. the preview app's dev server).

The Apple app and SDK's Docker/SSH-container launchers set MINDWIRE_ISOLATION=container. Direct host launchers leave it unset. Commands run as the account that started Mindwire, with its normal filesystem, tools and network access (including root when started as root). Codex defaults to danger-full-access in both placements; Docker still supplies the container boundary. This also avoids requiring privileged nested Linux namespaces. Explicit Codex sandbox settings and approval policies remain effective. See Codex sandboxing for the native controls and container guidance. Mount only the workspace data you intend to expose to its agents. This contract requires service 0.1.17 or later; older services do not advertise workspaceIsolationVersion.

Setup and update status

Harness installs and updates use exact versions approved by the daemon's compatibility catalog. See HARNESSES.md for independent catalog publication, supported daemon ranges, cached fallback, managed executable selection, and the app/SDK contract.

POST /setup?agent=<type> and POST /update?agent=<type> share one background job per harness. Concurrent requests attach to that job, even across clients; disconnecting does not cancel it. Poll GET /setup?agent=<type> for running, current, steps, ok, and operation (setup or update). The operation stays attached to the job that actually started, so a setup request joining an update still reports update. Older daemons omit operation; clients should tolerate its absence. A completed or failed job releases its lock and can be explicitly retried.

Design & API reference

The full design — the capabilities switch, drivers, the unified event protocol, the turn lifecycle, the HTTP surface, and how to add an adapter — is documented once, on the docs site:

  • Architecture — how the pieces fit together.
  • Daemon internals — the core contracts, drivers, event protocol, HTTP endpoints, and turn lifecycle.
  • NOTIFICATIONS.md — the provider-agnostic notification webhook contract.
  • INTERACTIONS.md — shared question forms, command approvals, permission settings and client lifecycle.
  • AUTHENTICATION.md — native subscription sign-in, device codes, browser code handoff, and shared auth lifecycle.
  • SETTINGS.md — model/effort discovery, native defaults, atomic settings patches and connection tuning.
  • NATIVE_SESSIONS.md — native conversation discovery, project associations, cache refresh and CLI resume interoperability.
  • PROJECT_SYNC.md — preserved workspace copies, native chat/memory portability, conflict handling and recovery.
  • WORKSPACES.md — workspace ownership, project operations, registry API, cache migration, deletion and sync.
  • COMPUTERS.md — npm setup, phone pairing, persistent terminals and private SSH port forwards.
  • GIT_ACCESS.md — independent GitHub connections, operation/run credentials, saved workspace access, and Git endpoints.
  • DESKTOP.md — shared desktop control protocol, native VNC transports, SDKs and verification.

Directories

Path Synopsis
cmd
daemon command
Command daemon is the mindwire daemon (mindwired): it hosts every registered agent adapter, drives turns, and relays a unified structured event stream to the client.
Command daemon is the mindwire daemon (mindwired): it hosts every registered agent adapter, drives turns, and relays a unified structured event stream to the client.
internal
acp
Package acp implements the Agent Client Protocol transport shared by native harnesses.
Package acp implements the Agent Client Protocol transport shared by native harnesses.
agent
Package agent is the daemon CORE: the generic, agent-agnostic contracts every agent adapter implements (capabilities, dynamic settings/auth, unified events) plus the registry.
Package agent is the daemon CORE: the generic, agent-agnostic contracts every agent adapter implements (capabilities, dynamic settings/auth, unified events) plus the registry.
agent/antigravity
Package antigravity drives Google's official ACP runtime and companion harness.
Package antigravity drives Google's official ACP runtime and companion harness.
agent/claude
Package claude is the Claude Code adapter.
Package claude is the Claude Code adapter.
agent/codex
Package codex is the OpenAI Codex CLI adapter — mindwire's second agent, proving the architecture's promise that adding an agent is one new adapter with zero core or client changes.
Package codex is the OpenAI Codex CLI adapter — mindwire's second agent, proving the architecture's promise that adding an agent is one new adapter with zero core or client changes.
agent/cursor
Package cursor drives Cursor's official ACP CLI, independently of its IDE.
Package cursor drives Cursor's official ACP CLI, independently of its IDE.
agent/grok
Package grok drives xAI's open-source Grok Build CLI in its documented headless mode.
Package grok drives xAI's open-source Grok Build CLI in its documented headless mode.
agent/opencode
Package opencode is the SST opencode adapter — mindwire's third agent, and the first driven over a native HTTP + SSE API rather than a one-shot CLI.
Package opencode is the SST opencode adapter — mindwire's third agent, and the first driven over a native HTTP + SSE API rather than a one-shot CLI.
api
Package api is the daemon's unified HTTP surface — the one protocol the app speaks regardless of which agent runs.
Package api is the daemon's unified HTTP surface — the one protocol the app speaks regardless of which agent runs.
artifact
Package artifact stores durable chat attachments and tool images beside the workspace registry.
Package artifact stores durable chat attachments and tool images beside the workspace registry.
authtest
Package authtest supplies isolated native-process fixtures for auth tests.
Package authtest supplies isolated native-process fixtures for auth tests.
bots
Package bots binds saved profiles and scoped runtime tools to an actual chat.
Package bots binds saved profiles and scoped runtime tools to an actual chat.
computer
Package computer adds authenticated transports to the existing workspace API.
Package computer adds authenticated transports to the existing workspace API.
conversations
Package conversations projects native harness session inventories into the existing workspace metadata protocol.
Package conversations projects native harness session inventories into the existing workspace metadata protocol.
driver
Package driver is how the daemon DRIVES an agent for a turn — the control channel between the daemon and the agent, orthogonal to the agent's output format.
Package driver is how the daemon DRIVES an agent for a turn — the control channel between the daemon and the agent, orthogonal to the agent's output format.
gitaccess
Package gitaccess supplies repository authentication to Git without putting credentials in project metadata, command arguments, or Git configuration.
Package gitaccess supplies repository authentication to Git without putting credentials in project metadata, command arguments, or Git configuration.
gitauthor
Package gitauthor saves attribution independently of committing.
Package gitauthor saves attribution independently of committing.
gitops
Package gitops owns durable workspace Git writes.
Package gitops owns durable workspace Git writes.
handoffs
Package handoffs transfers reviewed context into a fresh agent session.
Package handoffs transfers reviewed context into a fresh agent session.
integrations
Package integrations connects external messaging transports to the existing bot runtime.
Package integrations connects external messaging transports to the existing bot runtime.
inventory
Package inventory discovers workspace software without starting a harness or owning its native state.
Package inventory discovers workspace software without starting a harness or owning its native state.
nativeauth
Package nativeauth adapts native login processes to the product's existing flow-scoped auth API.
Package nativeauth adapts native login processes to the product's existing flow-scoped auth API.
nativesessions
Package nativesessions shares on-demand native attachments between viewers.
Package nativesessions shares on-demand native attachments between viewers.
notify
Package notify is the delivery layer for agent notifications.
Package notify is the delivery layer for agent notifications.
notify/exec
Package exec is a notification channel that runs a local command (named by NOTIFY_EXEC) with the notification JSON on stdin — a true local hook (desktop toast, log shipper, pager, …).
Package exec is a notification channel that runs a local command (named by NOTIFY_EXEC) with the notification JSON on stdin — a true local hook (desktop toast, log shipper, pager, …).
notify/file
Package file is a notification channel that appends each notification as one JSON line (JSONL) to a local file named by NOTIFY_FILE.
Package file is a notification channel that appends each notification as one JSON line (JSONL) to a local file named by NOTIFY_FILE.
orchestrator
Package orchestrator is the daemon's per-sandbox SUPERVISOR.
Package orchestrator is the daemon's per-sandbox SUPERVISOR.
proc
Package proc configures spawned commands so that cancelling their context tears down the WHOLE process tree, not just the shell that Go directly forked.
Package proc configures spawned commands so that cancelling their context tears down the WHOLE process tree, not just the shell that Go directly forked.
procmon
Package procmon samples live CPU/memory for the daemon's per-turn process groups, on demand.
Package procmon samples live CPU/memory for the daemon's per-turn process groups, on demand.
projecticon
Package projecticon stores and reads small images through a confined project root.
Package projecticon stores and reads small images through a confined project root.
projects
Package projects owns project workflows independently of any client connection.
Package projects owns project workflows independently of any client connection.
projectsync
Package projectsync synchronizes preserved project replicas.
Package projectsync synchronizes preserved project replicas.
registry
Package registry owns the workspace's saved agent profiles, projects and chat links.
Package registry owns the workspace's saved agent profiles, projects and chat links.
runner
Package runner drives a single turn: it builds the TurnInput (session id for resume, the agent's own settings, auth env), invokes the adapter's streaming run, publishes the unified events to the SSE hub, and persists the agent's session id.
Package runner drives a single turn: it builds the TurnInput (session id for resume, the agent's own settings, auth env), invokes the adapter's streaming run, publishes the unified events to the SSE hub, and persists the agent's session id.
session
Package session is the daemon's local state, persisted to a JSON file on the sandbox disk.
Package session is the daemon's local state, persisted to a JSON file on the sandbox disk.
setup
Package setup runs an agent's install toolchain inside the sandbox.
Package setup runs an agent's install toolchain inside the sandbox.
shortcuts
Package shortcuts opens saved app links using the existing workspace executor.
Package shortcuts opens saved app links using the existing workspace executor.
skills
Package skills validates portable SKILL.md documents and prepares a private, turn-scoped bundle.
Package skills validates portable SKILL.md documents and prepares a private, turn-scoped bundle.
stream
Package stream is the daemon's per-run event hub: the runner publishes unified events for a run; the SSE endpoint replays the buffer to a late subscriber and then streams live events until the run completes (or the client disconnects).
Package stream is the daemon's per-run event hub: the runner publishes unified events for a run; the SSE endpoint replays the buffer to a late subscriber and then streams live events until the run completes (or the client disconnects).
surface
Package surface is the workspace's shared desktop control service.
Package surface is the workspace's shared desktop control service.
toolchain
Package toolchain owns harness compatibility and managed CLI installations.
Package toolchain owns harness compatibility and managed CLI installations.
workspaceexec
Package workspaceexec implements the native execution surface of a workspace.
Package workspaceexec implements the native execution surface of a workspace.
workspacepath
Package workspacepath resolves project identities on the machine that owns the files.
Package workspacepath resolves project identities on the machine that owns the files.
Package mindwire is the native, in-process Go SDK for the mindwire engine — one API across every coding-agent harness (Claude Code, Codex, …), the same surface the TypeScript SDK exposes, but running the daemon's own orchestrator directly in your process.
Package mindwire is the native, in-process Go SDK for the mindwire engine — one API across every coding-agent harness (Claude Code, Codex, …), the same surface the TypeScript SDK exposes, but running the daemon's own orchestrator directly in your process.

Jump to

Keyboard shortcuts

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