internal/

directory
v0.130.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: Apache-2.0

Directories

Path Synopsis
Package agentcat answers "which coding agents can start here, on which models, and what is missing for the rest" — the New agent sheet's and Quick chat's picker (GET /v1/agents/catalog, ADR-046).
Package agentcat answers "which coding agents can start here, on which models, and what is missing for the rest" — the New agent sheet's and Quick chat's picker (GET /v1/agents/catalog, ADR-046).
Package agents spawns and controls Claude Code sessions Caprock owns: a real `claude` process in a PTY, its output buffered for the terminal view and its exit recorded.
Package agents spawns and controls Claude Code sessions Caprock owns: a real `claude` process in a PTY, its output buffered for the terminal view and its exit recorded.
Package alerts decides when the owner's phone hears about a session: at once when it shows a permission dialog, and a minute after it finishes a turn with nothing following.
Package alerts decides when the owner's phone hears about a session: at once when it shows a permission dialog, and a minute after it finishes a turn with nothing following.
A short-lived cache in front of the whole-history aggregates, with single-flight and stale-while-revalidate.
A short-lived cache in front of the whole-history aggregates, with single-flight and stale-while-revalidate.
Package board is the Phase 2 task board: it bridges the hive's task files and mailboxes to the SQLite mirror and the API.
Package board is the Phase 2 task board: it bridges the hive's task files and mailboxes to the SQLite mirror and the API.
Package brain is Second Brain's automatic extraction (ADR-063): it reads the prose of finished sessions and keeps the few memories worth keeping, linked to their projects and topics, by asking the user's own installed `claude` — headless, through the user's own login, the same place the session itself went.
Package brain is Second Brain's automatic extraction (ADR-063): it reads the prose of finished sessions and keeps the few memories worth keeping, linked to their projects and topics, by asking the user's own installed `claude` — headless, through the user's own login, the same place the session itself went.
Package branches lists a repository's branches with what git knows of each for the session deck's Branches view (owner, 2026-10-12, translated: "seeing branches with statistics would also be interesting"): how far each is ahead of and behind the default branch, its last commit's time and author.
Package branches lists a repository's branches with what git knows of each for the session deck's Branches view (owner, 2026-10-12, translated: "seeing branches with statistics would also be interesting"): how far each is ahead of and behind the default branch, its last commit's time and author.
Package browser lists the web browsers installed on this machine and opens a link in the one the user picks: the chooser a ⇧⌘-click (Ctrl+Shift+click off macOS) on a link in a terminal opens (.ai/04-ui.md § Session Detail, .ai/21-app.md).
Package browser lists the web browsers installed on this machine and opens a link in the one the user picks: the chooser a ⇧⌘-click (Ctrl+Shift+click off macOS) on a link in a terminal opens (.ai/04-ui.md § Session Detail, .ai/21-app.md).
Package bus is the in-process fan-out for live frames: every stored event, session change, or alert is published once and delivered to every subscriber (WebSocket clients, the loop detector, tests).
Package bus is the in-process fan-out for live frames: every stored event, session change, or alert is published once and delivered to every subscriber (WebSocket clients, the loop detector, tests).
A daily spend cap that pauses the sessions Caprock started.
A daily spend cap that pauses the sessions Caprock started.
Package chatimport reads the conversation history a user exported from Claude.ai or ChatGPT themselves, and files each conversation as a read-only chat (ADR-074).
Package chatimport reads the conversation history a user exported from Claude.ai or ChatGPT themselves, and files each conversation as a read-only chat (ADR-074).
Package codex reads OpenAI Codex's session transcripts.
Package codex reads OpenAI Codex's session transcripts.
Package config resolves Caprock's data directory and the small on-disk files that live in it: config.json (user settings) and runtime.json (per-run port + token, read by the hook shim).
Package config resolves Caprock's data directory and the small on-disk files that live in it: config.json (user settings) and runtime.json (per-run port + token, read by the hook shim).
Package contexttax prices what a session pays to re-send its own context.
Package contexttax prices what a session pays to re-send its own context.
Package cost turns token usage into dollars using the versioned pricing table, and computes the cache-savings math ported from Caprock-python (_savings.py).
Package cost turns token usage into dollars using the versioned pricing table, and computes the cache-savings math ported from Caprock-python (_savings.py).
Package daemon wires every component into the running `caprock up` process: store, pricing, recorder, hookd, ingest, loop detector, API/WS server, the idle sweeper, and the runtime.json lifecycle.
Package daemon wires every component into the running `caprock up` process: store, pricing, recorder, hookd, ingest, loop detector, API/WS server, the idle sweeper, and the runtime.json lifecycle.
Package deepseek reads DeepSeek Harness (DSH) session transcripts.
Package deepseek reads DeepSeek Harness (DSH) session transcripts.
Package desktop reads the plan-usage history the Claude desktop app keeps on disk, so the dashboard can say whether your plan limits were spent somewhere other than Claude Code.
Package desktop reads the plan-usage history the Claude desktop app keeps on disk, so the dashboard can say whether your plan limits were spent somewhere other than Claude Code.
Package disclaim makes the programs Caprock starts for the user answer for themselves to macOS privacy prompts.
Package disclaim makes the programs Caprock starts for the user answer for themselves to macOS privacy prompts.
Package editor opens a folder, or a file at a line, in the user's own editor — VS Code, Cursor, Zed or a JetBrains IDE (F18, .ai/21-app.md).
Package editor opens a folder, or a file at a line, in the user's own editor — VS Code, Cursor, Zed or a JetBrains IDE (F18, .ai/21-app.md).
Package eta estimates when a queued message starts and finishes, from how long the turns already finished in the same project took.
Package eta estimates when a queued message starts and finishes, from how long the turns already finished in the same project took.
Package event defines the single normalized event type that every part of Caprock consumes — the UI, stats, the loop detector, the orchestrator, and any future avatar skin.
Package event defines the single normalized event type that every part of Caprock consumes — the UI, stats, the loop detector, the orchestrator, and any future avatar skin.
Package export writes Caprock's normalized record out as a flat table.
Package export writes Caprock's normalized record out as a flat table.
Package fgproc names the program a shell is running in its foreground: what a terminal app asks before it closes a tab ("Shell 1 is running claude").
Package fgproc names the program a shell is running in its foreground: what a terminal app asks before it closes a tab ("Shell 1 is running claude").
Package gemini talks to Google's Gemini API on a key the user supplies through the environment.
Package gemini talks to Google's Gemini API on a key the user supplies through the environment.
Package gitdiff produces the live diff for a session's working directory by shelling out to git.
Package gitdiff produces the live diff for a session's working directory by shelling out to git.
Package github is Caprock's GitHub integration (F14, .ai/21-app.md § GitHub): a small REST client in the daemon, the token sources it may use, the OAuth device flow, and the pull-request state each worktree shows.
Package github is Caprock's GitHub integration (F14, .ai/21-app.md § GitHub): a small REST client in the daemon, the token sources it may use, the OAuth device flow, and the pull-request state each worktree shows.
Package gitremote answers "where does this repository live on the web, and which pull requests did a session open", from the machine alone.
Package gitremote answers "where does this repository live on the web, and which pull requests did a session open", from the machine alone.
Package hermes reads sessions from Hermes Agent's SQLite state database.
Package hermes reads sessions from Hermes Agent's SQLite state database.
Package hidewin starts helper processes (git, gh, claude -p, tasklist …) without a console window on Windows.
Package hidewin starts helper processes (git, gh, claude -p, tasklist …) without a console window on Windows.
Package hive owns the on-disk orchestration state (Phase 2): one directory per registered project workspace holding agents, tasks, approvals, mailboxes and an append-only ledger.
Package hive owns the on-disk orchestration state (Phase 2): one directory per registered project workspace holding agents, tasks, approvals, mailboxes and an append-only ledger.
Package hookd receives Claude Code hook payloads from the caprock-hook shim on POST /v1/hook, normalizes them into events, and hands them to the recorder.
Package hookd receives Claude Code hook payloads from the caprock-hook shim on POST /v1/hook, normalizes them into events, and hands them to the recorder.
Package hooks installs and removes the caprock-hook shim in Claude Code's user-level settings.json, non-destructively.
Package hooks installs and removes the caprock-hook shim in Claude Code's user-level settings.json, non-destructively.
Package ingest discovers Claude Code transcript files (~/.claude/projects/**), tails them, and turns their JSONL lines into normalized events.
Package ingest discovers Claude Code transcript files (~/.claude/projects/**), tails them, and turns their JSONL lines into normalized events.
Package keepawake keeps the computer from idle-sleeping while agents work (ADR-049).
Package keepawake keeps the computer from idle-sleeping while agents work (ADR-049).
Package lan finds the address a second device on the same network can reach this machine at.
Package lan finds the address a second device on the same network can reach this machine at.
Package license decides whether paid features are on.
Package license decides whether paid features are on.
Package logcap keeps the daemon's log file from growing without bound.
Package logcap keeps the daemon's log file from growing without bound.
Package loop implements the loop detector: ≥ K tool.pre events with the same tool and normalized-similar input within T minutes ⇒ one alert per episode.
Package loop implements the loop detector: ≥ K tool.pre events with the same tool and normalized-similar input within T minutes ⇒ one alert per episode.
Package mail is Caprock Mail: an IMAP/SMTP client that keeps every inbox the user adds in one local database (mail.db, beside Caprock's own) and serves it to the dashboard under /v1/mail.
Package mail is Caprock Mail: an IMAP/SMTP client that keeps every inbox the user adds in one local database (mail.db, beside Caprock's own) and serves it to the dashboard under /v1/mail.
ai
Package ai is Mail's assistant: a summary of a thread and a draft reply.
Package ai is Mail's assistant: a summary of a thread and a draft reply.
engine
Package engine talks to mail servers: it keeps the local copy in step with IMAP, applies the user's actions there, and sends over SMTP.
Package engine talks to mail servers: it keeps the local copy in step with IMAP, applies the user's actions there, and sends over SMTP.
fakemail
Package fakemail runs an in-memory IMAP and SMTP server on loopback, for tests and for the demo mode that previews the client without a real account.
Package fakemail runs an in-memory IMAP and SMTP server on loopback, for tests and for the demo mode that previews the client without a real account.
importer
Package importer reads the mail accounts a user already has in another client — Thunderbird and (on macOS) Apple Mail — so Caprock Mail can offer to add them instead of making the user retype servers and passwords.
Package importer reads the mail accounts a user already has in another client — Thunderbird and (on macOS) Apple Mail — so Caprock Mail can offer to add them instead of making the user retype servers and passwords.
mailstore
Package store owns the SQLite database.
Package store owns the SQLite database.
oauth
Package oauth signs Caprock Mail into Google and Microsoft accounts the way an installed app should (RFC 8252): the authorization code flow with PKCE (RFC 7636, S256) in the user's own browser, redirected back to the daemon on loopback.
Package oauth signs Caprock Mail into Google and Microsoft accounts the way an installed app should (RFC 8252): the authorization code flow with PKCE (RFC 7636, S256) in the user's own browser, redirected back to the daemon on loopback.
oauth/oauthtest
Package oauthtest is a fake OAuth provider for tests: an authorization step that stands in for the user's browser, and a token endpoint that checks PKCE, issues ID tokens and refreshes.
Package oauthtest is a fake OAuth provider for tests: an authorization step that stands in for the user's browser, and a token endpoint that checks PKCE, issues ID tokens and refreshes.
providers
Package providers knows the server settings of common mail hosts, so adding an account is an address and a password.
Package providers knows the server settings of common mail hosts, so adding an account is an address and a password.
secrets
Package secrets keeps account passwords out of the database: in the OS keychain (macOS login keychain, Windows Credential Manager, Secret Service), else a file only this user can read.
Package secrets keeps account passwords out of the database: in the OS keychain (macOS login keychain, Windows Credential Manager, Secret Service), else a file only this user can read.
spam
Package spam is Caprock Mail's local junk filter: no AI, no network, no account anywhere.
Package spam is Caprock Mail's local junk filter: no AI, no network, no account anywhere.
Package modelclass classifies model ids whose role changes how Caprock should present their usage.
Package modelclass classifies model ids whose role changes how Caprock should present their usage.
Package narrate turns tool events into the human-readable phrases the Now screen shows ("editing main.go", "running go test — 2nd attempt") and derives a session's health badge and plan progress.
Package narrate turns tool events into the human-readable phrases the Now screen shows ("editing main.go", "running go test — 2nd attempt") and derives a session's health badge and plan progress.
Package nativeterm opens a command in the user's own terminal application — Ghostty, iTerm2, Terminal.app, Windows Terminal — rather than in the dashboard's web terminal.
Package nativeterm opens a command in the user's own terminal application — Ghostty, iTerm2, Terminal.app, Windows Terminal — rather than in the dashboard's web terminal.
Package opencode reads sessions from OpenCode's SQLite database.
Package opencode reads sessions from OpenCode's SQLite database.
Package orchestrator manages the Phase 2 orchestrator + worker lifecycle: it spawns Claude Code sessions with the hive-aware system prompt, runs the mailbox router on a tick, and registers agents in the hive.
Package orchestrator manages the Phase 2 orchestrator + worker lifecycle: it spawns Claude Code sessions with the hive-aware system prompt, runs the mailbox router on a tick, and registers agents in the hive.
Package pairing lets a second device — a tablet, a phone — reach a daemon that is otherwise bound to loopback.
Package pairing lets a second device — a tablet, a phone — reach a daemon that is otherwise bound to loopback.
Package peers keeps the other computers this machine reaches, and the channel to each (ADR-067).
Package peers keeps the other computers this machine reaches, and the channel to each (ADR-067).
Package premium holds what the paid plan costs and where to buy it.
Package premium holds what the paid plan costs and where to buy it.
Package procstat reads the machine's process table and what each process costs — CPU and resident memory — on macOS, Linux and Windows.
Package procstat reads the machine's process table and what each process costs — CPU and resident memory — on macOS, Linux and Windows.
Package projcheck finds the commands a repository already uses to check itself: its Makefile targets, its package.json scripts, and the stock commands of the toolchains it declares (go.mod, Cargo.toml, pyproject.toml).
Package projcheck finds the commands a repository already uses to check itself: its Makefile targets, its package.json scripts, and the stock commands of the toolchains it declares (go.mod, Cargo.toml, pyproject.toml).
Package projects keeps the list of projects a person works in — added, created, cloned, or found from the sessions that ran there — with each one's live git state, its worktrees and what its sessions are doing (.ai/21-app.md § Projects, WP-05 and WP-08).
Package projects keeps the list of projects a person works in — added, created, cloned, or found from the sessions that ran there — with each one's live git state, its worktrees and what its sessions are doing (.ai/21-app.md § Projects, WP-05 and WP-08).
Package ptyhost keeps an owned session's terminal alive across daemon restarts (ADR-033).
Package ptyhost keeps an owned session's terminal alive across daemon restarts (ADR-033).
Package ptyman owns pseudo-terminal sessions: spawn a process attached to a PTY (ConPTY on Windows), stream its bytes, write input, resize, signal, kill.
Package ptyman owns pseudo-terminal sessions: spawn a process attached to a PTY (ConPTY on Windows), stream its bytes, write input, resize, signal, kill.
Package qr is a dependency-free QR code encoder.
Package qr is a dependency-free QR code encoder.
Package relay builds the brief that carries a session's work into a new session, possibly in another agent.
Package relay builds the brief that carries a session's work into a new session, possibly in another agent.
Package relplan reads what a repository has merged and not yet released, and how its releases have been spaced, from the machine alone (ADR-064).
Package relplan reads what a repository has merged and not yet released, and how its releases have been spaced, from the machine alone (ADR-064).
Package remote lets a phone reach this daemon from anywhere, through a relay that only ever sees ciphertext (ADR-058).
Package remote lets a phone reach this daemon from anywhere, through a relay that only ever sees ciphertext (ADR-058).
relaysrv
Package relaysrv is a relay a phone and a daemon meet at (ADR-058).
Package relaysrv is a relay a phone and a daemon meet at (ADR-058).
Package rollup is the single write path for events: it stores the event, upserts the session, prices assistant turns, and maintains session_stats / daily_stats / session_files in one transaction, then publishes live frames.
Package rollup is the single write path for events: it stores the event, upserts the session, prices assistant turns, and maintains session_stats / daily_stats / session_files in one transaction, then publishes live frames.
Package secret keeps the few credentials Caprock itself holds — the GitHub token, the DeepSeek API key, the Telegram bot token — out of the database, config.json and every log (ADR-039, ADR-024 amendment).
Package secret keeps the few credentials Caprock itself holds — the GitHub token, the DeepSeek API key, the Telegram bot token — out of the database, config.json and every log (ADR-039, ADR-024 amendment).
Package service registers the Caprock daemon with the operating system's own login-time supervisor, so it comes back after a reboot without the user running `caprock up` by hand.
Package service registers the Caprock daemon with the operating system's own login-time supervisor, so it comes back after a reboot without the user running `caprock up` by hand.
Package sessionlink joins a session Caprock started to the record the agent's own files keep of it.
Package sessionlink joins a session Caprock started to the record the agent's own files keep of it.
Package shim is the hook shim logic shared by the caprock-hook binary and the hidden `caprock hook` fallback command.
Package shim is the hook shim logic shared by the caprock-hook binary and the hidden `caprock hook` fallback command.
Package slashcmd lists the slash commands an agent offers in a folder, for the chat field's `/` picker (ADR-053; contract in 03-contracts.md § Chat field pickers).
Package slashcmd lists the slash commands an agent offers in a folder, for the chat field's `/` picker (ADR-053; contract in 03-contracts.md § Chat field pickers).
Package statusline is the `caprock statusline` command's logic: Claude Code invokes it (statusLine.command in settings.json) on every assistant message, piping a JSON status object on stdin.
Package statusline is the `caprock statusline` command's logic: Claude Code invokes it (statusLine.command in settings.json) on every assistant message, piping a JSON status object on stdin.
Package store owns the SQLite database: opening, migrating, and every query.
Package store owns the SQLite database: opening, migrating, and every query.
Package subs is Settings → Subscriptions (ADR-048): more than one sign-in to Claude Code or Codex on one machine, each in a configuration directory of its own, and a session started on the one the user picks.
Package subs is Settings → Subscriptions (ADR-048): more than one sign-in to Claude Code or Codex on one machine, each in a configuration directory of its own, and a session started on the one the user picks.
Package tcc keeps an isolated Caprock daemon out of the folders macOS guards with a privacy prompt (ADR-040).
Package tcc keeps an isolated Caprock daemon out of the folders macOS guards with a privacy prompt (ADR-040).
Package telegram is Caprock's client for the Telegram Bot API, used with a bot the user created themselves (ADR-047), and the bridge that lets the owner talk to their sessions through it.
Package telegram is Caprock's client for the Telegram Bot API, used with a bot the user created themselves (ADR-047), and the bridge that lets the owner talk to their sessions through it.
telegramtest
Package telegramtest is a stand-in for the Telegram Bot API, for tests and preview stands: nothing in the suite ever talks to api.telegram.org.
Package telegramtest is a stand-in for the Telegram Bot API, for tests and preview stands: nothing in the suite ever talks to api.telegram.org.
Package templates starts a project from a template (ADR-065): a GitHub template repository the person names, or a folder on this machine, copied into a new repository with the person's brief written into it, ready for an agent.
Package templates starts a project from a template (ADR-065): a GitHub template repository the person names, or a folder on this machine, copied into a new repository with the person's brief written into it, ready for an agent.
Package termbuf holds the recent output of a terminal: the last bytes it printed plus the terminal modes that output set, so a terminal that attaches late can be put back into the state the program expects.
Package termbuf holds the recent output of a terminal: the last bytes it printed plus the terminal modes that output set, so a terminal that attaches late can be put back into the state the program expects.
Package toolcmd reads the command a tool call ran out of the input it was stored with, for every place in the daemon that describes a call in one line: the Now screen's phrase, a notification's subject, a loop alert's sample, a subagent's current call.
Package toolcmd reads the command a tool call ran out of the input it was stored with, for every place in the daemon that describes a call in one line: the Now screen's phrase, a notification's subject, a loop alert's sample, a subagent's current call.
Package update checks whether a newer Caprock release exists and works out the command that would install it.
Package update checks whether a newer Caprock release exists and works out the command that would install it.
Package userenv gives the processes Caprock starts the environment the user's own terminal would give them.
Package userenv gives the processes Caprock starts the environment the user's own terminal would give them.
Package version exposes the build-time version string stamped via -ldflags.
Package version exposes the build-time version string stamped via -ldflags.
Package weekly builds the report that says what moved — and, more often, that nothing did.
Package weekly builds the report that says what moved — and, more often, that nothing did.
Package wtsetup makes a new worktree ready to run (ADR-050): it copies the git-ignored files the repository's .worktreeinclude names from the main checkout into the new worktree, and runs the project's setup command in the agent's own terminal before the agent starts.
Package wtsetup makes a new worktree ready to run (ADR-050): it copies the git-ignored files the repository's .worktreeinclude names from the main checkout into the new worktree, and runs the project's setup command in the agent's own terminal before the agent starts.

Jump to

Keyboard shortcuts

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