internal/

directory
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT

Directories

Path Synopsis
Package attachcli implements the session commands for a terminal user on the server: `stagent ls` lists the daemon's sessions and `stagent attach` connects the local terminal to a session's holder, like `tmux attach`.
Package attachcli implements the session commands for a terminal user on the server: `stagent ls` lists the daemon's sessions and `stagent attach` connects the local terminal to a session's holder, like `tmux attach`.
Package bootstrap moves stagent's long-lived processes on macOS from the bootstrap namespace of the login session they were started in to the user's per-user one, as tmux does (compat/daemon-darwin.c).
Package bootstrap moves stagent's long-lived processes on macOS from the bootstrap namespace of the login session they were started in to the user's per-user one, as tmux does (compat/daemon-darwin.c).
Package bridge terminates the app protocol (PROTOCOL.md) on the stdin and stdout of `stagent bridge`, which the app runs over an SSH exec channel.
Package bridge terminates the app protocol (PROTOCOL.md) on the stdin and stdout of `stagent bridge`, which the app runs over an SSH exec channel.
Package daemon is `stagent daemon`: the per-user session registry, event log, hook integration (state, notifications, pending approvals), push notifications, transcript access and scrollback retention.
Package daemon is `stagent daemon`: the per-user session registry, event log, hook integration (state, notifications, pending approvals), push notifications, transcript access and scrollback retention.
Package daemonclient connects to the stagent daemon, starting it on demand.
Package daemonclient connects to the stagent daemon, starting it on demand.
Package detect derives a session state from its terminal output alone: desktop-notification escapes (OSC 9, OSC 777;notify, OSC 99) and BEL mean the program wants the user, output means it is working, and silence for IdleAfter means it is idle.
Package detect derives a session state from its terminal output alone: desktop-notification escapes (OSC 9, OSC 777;notify, OSC 99) and BEL mean the program wants the user, output means it is working, and silence for IdleAfter means it is idle.
Package eventlog is the daemon's append-only event log: one JSON event per line in segment files (events.log, events.log.1, … newest first), a monotonically increasing seq that survives restarts, and an in-memory ring of the latest events that answers `since` queries without touching disk.
Package eventlog is the daemon's append-only event log: one JSON event per line in segment files (events.log, events.log.1, … newest first), a monotonically increasing seq that survives restarts, and an in-memory ring of the latest events that answers `since` queries without touching disk.
Package follow is `stagent follow`: it finds the coding agent running in the terminal that shares its SSH connection — in the terminal's shell, or in the tmux / zellij / screen / herdr pane that terminal shows — or, with --session, in a stagent session, and streams the agent's transcript to the app as JSON lines on stdout until stdin closes.
Package follow is `stagent follow`: it finds the coding agent running in the terminal that shares its SSH connection — in the terminal's shell, or in the tmux / zellij / screen / herdr pane that terminal shows — or, with --session, in a stagent session, and streams the agent's transcript to the app as JSON lines on stdout until stdin closes.
Package fsutil holds the file helpers the daemon's state files share.
Package fsutil holds the file helpers the daemon's state files share.
Package github answers the app's GitHub screen on hosts where its POSIX sh scripts cannot run (native Windows, ADR 0007): the working trees the user is in (github.repos), what gh reports for one of them (github.activity) and the state of single issues and pull requests (github.status).
Package github answers the app's GitHub screen on hosts where its POSIX sh scripts cannot run (native Windows, ADR 0007): the working trees the user is in (github.repos), what gh reports for one of them (github.activity) and the state of single issues and pull requests (github.status).
Package gittest leaves, for tests, what only an interrupted git leaves on disk (POSIX only: it kills a process group).
Package gittest leaves, for tests, what only an interrupted git leaves on disk (POSIX only: it kills a process group).
Package harness holds the harness registry (registry.go), recognizes the processes of the coding agents it lists, and connections that come from their process trees (guard.go).
Package harness holds the harness registry (registry.go), recognizes the processes of the coding agents it lists, and connections that come from their process trees (guard.go).
Package holder implements `stagent run`: it starts a program on a PTY and owns everything derived from its output — the VT screen, the on-disk scrollback and the output-based state — while serving attach/input requests from the bridge on its own local IPC endpoint and reporting state changes (never output) to the daemon.
Package holder implements `stagent run`: it starts a program on a PTY and owns everything derived from its output — the VT screen, the on-disk scrollback and the output-based state — while serving attach/input requests from the bridge on its own local IPC endpoint and reporting state changes (never output) to the daemon.
Package hook is `stagent hook <harness> [event] [json]`, the command harness hooks run.
Package hook is `stagent hook <harness> [event] [json]`, the command harness hooks run.
Package hostid keeps the host's random identifier (host_id): 128 random bits as 32 lowercase hex chars, created the first time stagent needs it and never changed afterwards.
Package hostid keeps the host's random identifier (host_id): 128 random bits as 32 lowercase hex chars, created the first time stagent needs it and never changed afterwards.
Package hostscreen serves the host_screen.* methods of one bridge connection (ホストの画面, ADR 0008): it lists what can be shown, runs at most one stream and paces its frames to the app's acks.
Package hostscreen serves the host_screen.* methods of one bridge connection (ホストの画面, ADR 0008): it lists what can be shown, runs at most one stream and paces its frames to the app's acks.
android
Package android is the Android emulator kind of the host screen (ADR 0008): the emulators `adb devices` lists, matched with the files in which they advertise their gRPC port, and one shown through the emulator's gRPC streamScreenshot.
Package android is the Android emulator kind of the host screen (ADR 0008): the emulators `adb devices` lists, matched with the files in which they advertise their gRPC port, and one shown through the emulator's gRPC streamScreenshot.
android/emupb
Package emupb is the Go code of the Android emulator's gRPC service, generated from emulator_controller.proto.
Package emupb is the Go code of the Android emulator's gRPC service, generated from emulator_controller.proto.
browser
Package browser is the browser kind of the host screen (ADR 0008): the Chromium-family browsers of the user that opened a CDP port, and a page target of one shown through Page.startScreencast.
Package browser is the browser kind of the host screen (ADR 0008): the Chromium-family browsers of the user that opened a CDP port, and a page target of one shown through Page.startScreencast.
ios
Package ios is the iOS simulator kind of the host screen (ADR 0008, macOS only): the booted simulators simctl lists, one shown through an idb_companion stagent starts for the stream (#630).
Package ios is the iOS simulator kind of the host screen (ADR 0008, macOS only): the booted simulators simctl lists, one shown through an idb_companion stagent starts for the stream (#630).
ios/idbpb
Package idbpb is the generated client of idb_companion's gRPC API (idb.proto, a subset of facebook/idb v1.6.8).
Package idbpb is the generated client of idb_companion's gRPC API (idb.proto, a subset of facebook/idb v1.6.8).
Package install implements stagent's ledger-based installer: `install` (layout + manifest; after an update, the running daemon and the shell wrapper blocks already in place), `integrate` (harness hooks, shell wrappers, login service; planned as unified diffs before anything is written), `doctor` (state report, orphans) and `uninstall` (stop / unhook / purge).
Package install implements stagent's ledger-based installer: `install` (layout + manifest; after an update, the running daemon and the shell wrapper blocks already in place), `integrate` (harness hooks, shell wrappers, login service; planned as unified diffs before anything is written), `doctor` (state report, orphans) and `uninstall` (stop / unhook / purge).
Package ipc provides the local, same-user-only transport between stagent processes: Unix domain sockets on Linux/macOS and named pipes on Windows.
Package ipc provides the local, same-user-only transport between stagent processes: Unix domain sockets on Linux/macOS and named pipes on Windows.
Package logind asks systemd-logind whether processes a user leaves running survive the end of the login session they were started from, and moves stagent's long-lived processes where they do.
Package logind asks systemd-logind whether processes a user leaves running survive the end of the login session they were started from, and moves stagent's long-lived processes where they do.
Package loginenv learns the environment of the user's login shell, which the sessions stagent starts begin from: the bridge's (session.spawn, task.create) and the daemon's (schedule runs).
Package loginenv learns the environment of the user's login shell, which the sessions stagent starts begin from: the bridge's (session.spawn, task.create) and the daemon's (schedule runs).
Package notify sends notifications to offline push channels: an ntfy topic, a generic webhook and/or a chat destination (Discord, Slack, Telegram).
Package notify sends notifications to offline push channels: an ntfy topic, a generic webhook and/or a chat destination (Discord, Slack, Telegram).
Package paths resolves where stagent keeps its binary, state, sockets and scrollback on the current host.
Package paths resolves where stagent keeps its binary, state, sockets and scrollback on the current host.
Package proc starts stagent processes that must outlive their caller: the daemon (auto-started by whoever needs it first) and detached holders.
Package proc starts stagent processes that must outlive their caller: the daemon (auto-started by whoever needs it first) and detached holders.
Package pscwd holds the PowerShell snippet that keeps a shell's process working directory at its location.
Package pscwd holds the PowerShell snippet that keeps a shell's process working directory at its location.
Package ptable takes snapshots of the host's process table: pid, parent, name, process group and terminal foreground group (unix) and start time of every process.
Package ptable takes snapshots of the host's process table: pid, parent, name, process group and terminal foreground group (unix) and start time of every process.
Package pty runs a program on a pseudo terminal: openpty (creack/pty) on Linux and macOS, ConPTY on Windows 10 1809 and later.
Package pty runs a program on a pseudo terminal: openpty (creack/pty) on Linux and macOS, ConPTY on Windows 10 1809 and later.
Package rpc runs request/response/notification exchanges over a wire.Codec: a Client for the calling side and Serve for the serving side.
Package rpc runs request/response/notification exchanges over a wire.Codec: a Client for the calling side and Serve for the serving side.
Package schedagent runs the agent of an agent schedule (定期実行): the command line the daemon builds for a run (Argv), and `stagent schedule agent`, the wrapper a run's holder starts it under.
Package schedagent runs the agent of an agent schedule (定期実行): the command line the daemon builds for a run (Argv), and `stagent schedule agent`, the wrapper a run's holder starts it under.
Package schedule is what the daemon knows about schedules (定期実行) besides running them: whether one is valid, when it runs, and the record of its runs.
Package schedule is what the daemon knows about schedules (定期実行) besides running them: whether one is valid, when it runs, and the record of its runs.
Package screen keeps the visible terminal screen of a session in a VT emulator (charmbracelet/x/vt) and renders it for attached clients: a full ANSI snapshot to resynchronize a client, and per-client diffs that redraw only the rows changed since that client's previous frame.
Package screen keeps the visible terminal screen of a session in a VT emulator (charmbracelet/x/vt) and renders it for attached clients: a full ANSI snapshot to resynchronize a client, and per-client diffs that redraw only the rows changed since that client's previous frame.
Package scrollback keeps a session's raw PTY output on disk: append-only segment files of SegmentSize bytes under the session's data directory, oldest segments deleted once the per-session cap is reached.
Package scrollback keeps a session's raw PTY output on disk: append-only segment files of SegmentSize bytes under the session's data directory, oldest segments deleted once the per-session cap is reached.
Package seatbelt tells whether a process runs in a macOS sandbox (Seatbelt), as a coding agent's sandboxed commands do (ADR 0004).
Package seatbelt tells whether a process runs in a macOS sandbox (Seatbelt), as a coding agent's sandboxed commands do (ADR 0004).
Package statusline is `stagent statusline claude`, the statusLine command `stagent integrate --statusline` gives Claude Code.
Package statusline is `stagent statusline claude`, the statusLine command `stagent integrate --statusline` gives Claude Code.
Package stubcmd stands in for command-line programs (gh, winget, git) in tests, alike on every OS: Install copies the test binary under the program's name next to a file of rules, and Main, run first by the test binary's TestMain, makes that copy answer by them.
Package stubcmd stands in for command-line programs (gh, winget, git) in tests, alike on every OS: Install copies the test binary under the program's name next to a file of rules, and Main, run first by the test binary's TestMain, makes that copy answer by them.
Package task holds what the daemon, the bridge and `stagent task` share about tasks (タスク): the canonical path of a source checkout (元のチェ ックアウト), which paths lie in a worktree, and running git.
Package task holds what the daemon, the bridge and `stagent task` share about tasks (タスク): the canonical path of a source checkout (元のチェ ックアウト), which paths lie in a worktree, and running git.
Package transcript reads the conversation files coding agents write — a JSONL format per harness — and normalizes them to wire.Message.
Package transcript reads the conversation files coding agents write — a JSONL format per harness — and normalizes them to wire.Message.
Package usage counts the tokens the coding agents spent on this host (使用量) from their transcripts.
Package usage counts the tokens the coding agents spent on this host (使用量) from their transcripts.
Package version holds the stagent release and wire protocol versions.
Package version holds the stagent release and wire protocol versions.
Package wire is the message envelope and codec shared by every stagent connection: app ↔ bridge (over the SSH exec channel) and the local IPC links (holder, daemon, hook, bridge).
Package wire is the message envelope and codec shared by every stagent connection: app ↔ bridge (over the SSH exec channel) and the local IPC links (holder, daemon, hook, bridge).
Package worktree is the host's inventory (目録) of worktrees: every repository stagent can find, each with every linked worktree git knows (who ever made it), and the other folders left in the worktree folder (置き場のほかのフォルダ).
Package worktree is the host's inventory (目録) of worktrees: every repository stagent can find, each with every linked worktree git knows (who ever made it), and the other folders left in the worktree folder (置き場のほかのフォルダ).

Jump to

Keyboard shortcuts

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