stagent

module
v0.23.0 Latest Latest
Warning

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

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

README

stagent

Server-side companion of the SSH Term app. This repository holds its source code and its release binaries, so you can read exactly what the app installs on your server and check that the binaries were built from this code.

What it does

SSH Term's chat view shows the conversation of the coding agent (Claude Code, Codex, Oh My Pi, Pi, Copilot CLI, Qwen Code, OpenCode, Grok Build, Antigravity CLI) running in a terminal tab, also when it runs inside tmux, zellij, screen or herdr. For that the app runs stagent follow over an SSH exec channel on the terminal's own connection. It:

  • finds the tab's shell through the per-connection SSH server process, or among the user's terminal sessions below tailscaled (Tailscale SSH), or by the shell's SSH_CONNECTION, and the pane a multiplexer client in it shows,
  • finds the agent process in that shell or pane and the conversation file it writes (~/.claude, ~/.codex, ~/.omp, ~/.pi, ~/.copilot, ~/.qwen; for OpenCode, which keeps its sessions in a database, the record stagent keeps of each session under ~/.ssh-term/agent/state/opencode, read from opencode session export; ~/.grok/sessions for Grok Build; ~/.gemini/antigravity-cli/brain for Antigravity CLI),
  • streams new messages of that file as JSON lines until the app closes the channel.

It only reads the process list, on macOS the login records (/var/run/utmpx), and those conversation files, and asks the multiplexer which pane its client shows (tmux list-clients, …, run as the client's own binary). It only considers processes of the user it runs as: another user's processes are never taken for the tab, an agent or a multiplexer, so it never runs their binaries or passes on their environment. On Linux the owner is the uid the kernel reports in /proc, for stagent itself too, so under proot's fake root (proot -0) every process of the guest counts as the user's. It opens no network port, starts no background process and changes no configuration. Input typed in the chat view goes to the terminal itself, not through stagent. The wire format and these rules are documented in PROTOCOL.md ("stagent follow").

The same binary also contains commands for an upcoming Agent Mode (run, daemon, bridge, hook, integrate); the chat view does not use them.

Persistent terminal sessions

When the app's persistent sessions are enabled, a terminal tab can run its shell inside stagent instead of directly on the SSH connection, so the shell (and whatever runs in it) survives a dropped connection, a sleeping phone or closing the app — without tmux. On the server this runs:

  • stagent bridge, started by the app over an SSH exec channel; it ends with the connection.
  • one stagent run --detached process per session (the holder): it owns the session's pseudo terminal, keeps an emulated copy of the screen and the session's recent output on disk (~/.ssh-term/agent/state/sessions/<id>/, 8 MiB per session by default), and serves the app over a socket only your user can open. It runs your login shell ($SHELL -l) and exits when the shell exits.
  • stagent daemon, the session list, started on demand. While a coding agent started inside a shell session runs, it reads that session's process tree every 2 s to notice when the agent quits, so the list shows the session as a plain shell again.

When the app reconnects it re-attaches the tab and receives only the output it missed (or a redraw of the screen when that is not possible). Sessions can be listed, re-opened and ended from the app, and from any terminal on the server:

  • stagent ls [--json] lists the sessions with their state, last activity and when someone last typed in a passthrough session's own terminal.
  • stagent attach [ID | --last] [--detach-key ctrl-]] attaches your terminal to a session; Ctrl-] detaches (press it twice to send it).
  • stagent run --handoff -- <command> runs a command in your terminal as a session that survives that terminal: when the terminal closes, the session continues detached and the app can pick it up. Before the command starts, stagent run tells you in one line how many agent sessions are held on the host (see stagent ls), if any.
  • Shell wrappers installed with stagent integrate --shell-wrapper make claude, codex, omp, pi, copilot, qwen, opencode, grok and agy typed in an interactive terminal run as stagent run --handoff=auto -- …, so they survive the terminal by default. Non-interactive runs (claude -p, codex exec, omp -p, omp --mode json, qwen -p, qwen "a prompt" without -i, opencode run and OpenCode's other commands, grok -p and Grok Build's commands but dashboard, agy -p and Antigravity CLI's commands) are left alone. OpenCode 2 is started with --standalone, a server of its own, so its plugin reports to this session. To have the agent end with the terminal instead, set STAGENT_HANDOFF=0 in that shell, or turn on disable_handoff in config.json (what the app's switch sets); STAGENT_HANDOFF=1 overrides the config.
  • An app that starts the agent in a shell reading its profile goes through the wrapper too (Orca runs it in such a PowerShell on Windows). stagent integrate puts Codex's hooks into ~/.codex: a codex started with its own CODEX_HOME, as Orca's is, runs none of them. Started through the wrapper it is listed without what the hooks report (waiting for approval); otherwise it is neither listed nor counted among the agents the list cannot show.

Coding agents cannot drive the sessions. On Linux and macOS a holder refuses every connection from a process that a coding agent (any harness of the registry, internal/harness) started (stagent walks the connecting process's parents), and the daemon refuses them config.set, presence.set, notify.test and daemon.shutdown; hooks and the statusLine relay still report, and the session list can still be read (the relay's usage.report is taken only for a Claude configuration directory integrate --statusline put it in, within bounds, so an agent can at most send false limit windows for that one account). An agent whose sandboxed commands run without asking could otherwise type into its own session — answering its own approval menus — or into another session, outside its sandbox (ADR 0004). So stagent attach run by an agent fails with that reason, and stagent install / stagent integrate run by an agent cannot replace the daemon: run them in your own terminal. A connection whose process has already exited, or whose parents cannot be followed, is refused as well. The check follows parents: a process that leaves them (a double fork, such as setsid -f, reparents it to init or launchd) escapes that walk. That holds an agent sandboxed in its own PID namespace (bubblewrap, as Claude Code's Linux sandbox uses), not an agent without a sandbox, which can do whatever you can anyway. On macOS, where the sandbox (Seatbelt) has no PID namespace, stagent also refuses any process inside a sandbox, wherever its parents lead; so stagent run from a terminal app that is itself sandboxed is refused too. Locations set with STAGENT_HOME (tests, development) are not checked, nor is Windows, where a process keeps the pid of a parent that exited, so its parents cannot be told.

Another user cannot stand in for your daemon or sessions. Every stagent command checks that the socket or named pipe it connects to belongs to you (on Windows, one owned by BUILTIN\Administrators — your daemon started elevated — counts as yours) and never talks to another user's. If another user created /tmp/stagent-<uid>, a socket or \\.\pipe\stagent-<SID> first, kept shells and agent sessions cannot work on that host until they or an administrator remove it: the app shows the location and its owner, stagent doctor reports them under blocked, and commands fail with an error naming them. Plain SSH terminals keep working.

Sessions also survive logging out. On Linux their sockets live in /tmp/stagent-<uid> (mode 0700), not in $XDG_RUNTIME_DIR, which is removed at logout. On systems where logind kills a user's processes at logout (KillUserProcesses=yes), or where lingering is on, stagent run and stagent daemon first move themselves into a new scope of your systemd user manager (the D-Bus call systemd-run --user --scope makes), so they and the agent leave the login session. That scope still ends with your last logout unless lingering is enabled (loginctl enable-linger, or stagent integrate --linger), and so do agents started from a terminal of a graphical (GNOME etc.) session. stagent doctor reports whether lingering is needed under persistence.linger_needed.

On macOS, sessions started from a terminal survive logging out of the GUI as they are, but the GUI session's Mach bootstrap port they inherit stops working then, and the tools an agent starts afterwards (curl, git, MCP servers) could no longer resolve host names. So stagent run and stagent daemon first switch to your per-user bootstrap port, as tmux does; the keychain stays usable while you are logged in. If that fails they start anyway and stagent doctor says why (shell_wrapper.last_run_bootstrap_error, daemon.bootstrap_error). The login keychain is unlocked only inside the GUI login session, not in SSH sessions, so while you are logged in to the GUI the app's sessions start through a one-off launchd job in that session (gui/<uid>), and claude uses the login it has there. Without a GUI login they start from the SSH session and claude asks you to /login; that login is kept in ~/.claude/.credentials.json. stagent integrate --terminal keeps Terminal.app from asking before it closes a window running an agent, or at logout (stagent in each profile's noWarnProcesses; removing it takes out only that entry).

Schedules (定期実行) start their runs the same way, so while nobody is logged in to a Mac's desktop, a claude schedule there fails asking for /login unless ~/.claude/.credentials.json is there: start claude once over SSH (outside the GUI) and /login in it. The run's record says it started outside the GUI login session and could not log in (outside_gui, auth_failed), and creating a claude schedule on a Mac without that file warns of it (claude_gui_login). claude also logs in without the keychain from two environment variables, which the app does not suggest: CLAUDE_CODE_OAUTH_TOKEN (the one-year token of claude setup-token) makes model requests only — no Remote Control, no claude.ai connectors — and once it is in your login shell's environment, which every session stagent starts inherits, your interactive sessions lose Remote Control too; ANTHROPIC_API_KEY is billed per token to the API key's account, not to your subscription. The warning looks at the file only, so it stays when you use one of them.

On Windows the wrapper goes into the profiles of Windows PowerShell 5.1 and PowerShell 7 (cmd has none), and wraps only in a console of the desktop: an SSH session is not interactive for PowerShell, and an agent started there ends with the connection (start it in a kept shell instead). PowerShell runs the profile only under an execution policy other than Restricted / AllSigned; stagent doctor reports each one's policy (powershell[]) and stagent integrate --execution-policy sets RemoteSigned for your user where needed. Processes started over SSH, kept shells included, run with Windows' RedirectionGuard (redirection_guard in doctor): tools reached through a junction you created, such as scoop's shims, do not start there.

In WSL, logging out is not what ends sessions: WSL shuts a distribution down some 15–40 s after the last Windows terminal tab or SSH connection using it closes (processes inside WSL do not keep it running), and the sessions end with it. stagent integrate --wsl-keep-running sets [general] instanceIdleTimeout=-1 in your Windows .wslconfig, which applies to all your distributions once WSL restarts (stagent wsl-shutdown, or restarting the PC); WSL, Windows restarts and signing out of Windows still end them. stagent doctor reports it under persistence.wsl; lingering is never needed in WSL.

A restart of the host ends every session. On Linux and macOS the daemon keeps a note of the coding agent running in each session (harness, conversation, directory, title, task; ~/.ssh-term/agent/state/agents.json, mode 0600) together with the boot it was written in. When it starts after a reboot, those agents are listed in the app as stopped agents (止まった agent), and so is an agent whose session vanished otherwise — its holder killed, listed at once or when the daemon next starts — but not one that ended on its own. Nothing restarts by itself — an agent costs API usage — but from the app each one can be resumed: a new kept shell opens in the same directory, tied to the same task, running the harness's resume command (claude --resume <id>, codex resume <id>, copilot --resume=<id>, omp --resume <id>, pi --session <id>, qwen --resume <id>, opencode --standalone --session <id>, grok --resume <id>, agy --conversation <id>), and your login shell when the agent exits. A stopped agent stays listed until it is resumed, removed, continued some other way, or for 7 days. Coding agents cannot resume or remove them.

Usage and limit windows

With the agent features on, the app shows the tokens the coding agents spent on the host (使用量) and the limit windows of their subscriptions (上限の枠: Claude's and Codex's 5 hours and week). For that:

  • stagent daemon reads, every 10 s and when the app asks, what is new in the conversation files of claude ($CLAUDE_CONFIG_DIR or ~/.claude, projects/, sub-agents included), codex ($CODEX_HOME or ~/.codex, sessions/), omp, pi and Qwen Code ($QWEN_RUNTIME_DIR, $QWEN_HOME or ~/.qwen, projects/*/chats/), Grok Build ($GROK_HOME or ~/.grok, sessions/*/*/updates.jsonl, by turn), Antigravity CLI (~/.gemini/antigravity-cli, brain/*/.system_generated/logs/transcript_full.jsonl, by reply of the model) and stagent's records of OpenCode's sessions — only the token counts, models, times and working directories, and the rate_limits Codex writes in its rollouts. It keeps what it counted in ~/.ssh-term/agent/state/usage-index.json, the last value of each limit window in state/usage-limits.json and what it notified of them (80%, 100%, reset) in state/usage-alerts.json. Deleting them only costs a rescan.
  • stagent integrate --statusline (offered by the app's host setup) sets the statusLine of Claude Code's settings.json (~/.claude, and $CLAUDE_CONFIG_DIR when set) to stagent statusline claude, keeping the statusLine you had in the manifest. unhook / uninstall put yours back as it was, and a statusLine you set afterwards is never overwritten (stagent doctor reports it under statusline).
  • stagent statusline claude is that command: it runs your own statusLine with the same input and returns its output and exit code, and sends the input's rate_limits to the daemon at most every 15 s per session (a mark file in state/statusline/), spending at most 100 ms connecting and never starting a daemon.
  • The private API (非公開 API) is off by default. Only when you turn it on for claude or codex on the app's usage screen (usage.private_api in config.json), the daemon reads that harness's login token — .credentials.json in Claude's configuration directory, or on macOS its Keychain item through /usr/bin/security find-generic-password; Codex's auth.json — and calls the undocumented usage endpoint over HTTPS (api.anthropic.com, chatgpt.com), only while the app is in front or its usage screen opens, at most every 15 minutes. The tokens are only read: never refreshed, never written, never logged or put in an error, a file or doctor.
  • When omp (oh-my-pi) is installed, the daemon runs omp usage --history --json every 2 minutes and omp usage --json on the private API's schedule (app in front, at most every 15 minutes) for the limit windows of the Claude and Codex logins omp holds. omp makes the calls with its own login; stagent reads no omp token.

Coding agents can read the usage too; of what writes, they can send only the relay's report, and only within the bounds told above for agents (ADR 0004). The wire format is in PROTOCOL.md ("Usage", "Limit windows", "Private API", "omp usage").

Screen rules

A session's holder watches the screen for the coding agent's approval menus and question UIs, to tell when one was answered on the host and to keep a chat message from landing on a menu. How each agent draws them — its cursor, the wording of its key hints and headers, how many rows to look at — is in rules files, one per harness and common.json for all. They are built into stagent (internal/screenrules/builtin); when an agent's screen changes before a stagent release follows it, put a file of the same name in ~/.ssh-term/agent/screen-rules/ with just what to change, e.g. a new header of Codex's question UI in ~/.ssh-term/agent/screen-rules/codex.json:

{"question": {"header": "^\\s+Frage \\d+/\\d+"}}

Sessions started afterwards use it; running ones keep the rules they started with. A file stagent cannot use (unreadable, not JSON, an unknown member, a pattern that is no regular expression) is ignored in favour of the built-in rules, and stagent doctor names it with the reason (screen_rules, problems).

To see which rule matched a screen — and whether it is built in or your override:

stagent explain --session <id>               # a live session (stagent ls)
tmux capture-pane -p | stagent explain --file - --harness codex
stagent explain --session <id> --json

The file format, the rules and the output are in PROTOCOL.md ("Screen rules").

Installation and removal

The app installs the binary to ~/.ssh-term/agent/bin/stagent the first time the chat view is opened: the server downloads the asset for its OS/arch from this repository's Releases page (or the app downloads and uploads it over SFTP) and it is verified against the SHA-256 pinned inside the app.

An app that pins a newer release updates the binary the same way: silently on a host prepared for it (shell wrapper in place), otherwise when you tap the host's button in the app. stagent install, which the app runs after placing the binary, then rewrites the shell wrapper blocks already in place and replaces a running daemon of the old version; the sessions keep running and stay listed.

Remove it from the chat view's menu (Remove stagent from the server), or on the server:

~/.ssh-term/agent/bin/stagent uninstall --level purge

Release assets

asset platform
stagent-linux-amd64 / stagent-linux-arm64 Linux
stagent-darwin-amd64 / stagent-darwin-arm64 macOS
stagent-windows-amd64.exe / stagent-windows-arm64.exe Windows 10 1809+

Each release also contains SHA256SUMS. The macOS assets (v0.18.1 and later) are signed with Developer ID, identifier com.obutora.stagent, so a privacy permission macOS gives stagent (Full Disk Access, files on a removable volume) stays through updates.

Building and verifying a release

Builds are reproducible (v0.2.0 and later; earlier releases predate the published source): CGO_ENABLED=0, -trimpath, no VCS stamp and an empty build id, so the same source and Go toolchain always produce the same bytes. To check a release, build the tag's source with the Go version named in its release notes and compare:

scripts/release.sh          # writes dist/ and dist/SHA256SUMS
diff dist/SHA256SUMS <(curl -sL https://github.com/obutora/stagent/releases/download/v0.3.0/SHA256SUMS)

From v0.18.1 the two macOS lines differ there: the release's binaries carry the Developer ID signature, yours the Go linker's ad-hoc one. On macOS, replace both signatures with the same ad-hoc one and compare:

v=v0.18.1
for a in stagent-darwin-amd64 stagent-darwin-arm64; do
  curl -sLo "/tmp/$a" "https://github.com/obutora/stagent/releases/download/$v/$a"
  cp "dist/$a" "/tmp/$a.built"
  for f in "/tmp/$a" "/tmp/$a.built"; do
    codesign --remove-signature "$f" && codesign -s - -i com.obutora.stagent "$f"
  done
  cmp "/tmp/$a" "/tmp/$a.built" && echo "$a ok"
done

Releases that ship stagent-windows-*.exe.sig carry an Authenticode signature in their Windows binaries, so those two lines differ as well. The .sig file is that signature on its own: attach it to your build with jsign (brew install jsign; no key needed) and the result must equal the release's exe byte for byte:

v=vX.Y.Z   # the release you are checking
for a in stagent-windows-amd64.exe stagent-windows-arm64.exe; do
  base="https://github.com/obutora/stagent/releases/download/$v"
  curl -sLo "/tmp/$a" "$base/$a"
  cp "dist/$a" "/tmp/$a.built"
  curl -sLo "/tmp/$a.built.sig" "$base/$a.sig"
  jsign --detached "/tmp/$a.built"
  cmp "/tmp/$a" "/tmp/$a.built" && echo "$a ok"
done

On Windows, Get-AuthenticodeSignature .\stagent-windows-amd64.exe shows Valid with the signer and a timestamp.

Releases are published with scripts/release.sh --publish, which commits the exact source it built to this repository, rebuilds that commit and checks it gives the same bytes, and tags that commit — so a release's tag is always the source of its binaries.

Tests: go test ./... (the e2e tests use tmux, zellij and herdr when they are on PATH).

License

MIT

Directories

Path Synopsis
cmd
stagent command
Command stagent is the server-side half of SSH Term's agent features: the terminal chat view's transcript follower, and Agent Mode's PTY holders, daemon, app bridge, harness hooks and its own installer.
Command stagent is the server-side half of SSH Term's agent features: the terminal chat view's transcript follower, and Agent Mode's PTY holders, daemon, app bridge, harness hooks and its own installer.
stagent-bench command
Command stagent-bench is the load benchmark for stagent (not shipped).
Command stagent-bench is the load benchmark for stagent (not shipped).
internal
attachcli
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`.
bootid
Package bootid reads the identifier the kernel gives the current boot: it changes with every start of the host, so a value stored before and read again tells whether the host restarted in between.
Package bootid reads the identifier the kernel gives the current boot: it changes with every start of the host, so a value stored before and read again tells whether the host restarted in between.
bootstrap
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).
bridge
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.
daemon
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.
daemonclient
Package daemonclient connects to the stagent daemon, starting it on demand.
Package daemonclient connects to the stagent daemon, starting it on demand.
detect
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.
eventlog
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.
follow
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.
fsutil
Package fsutil holds the file helpers the daemon's state files share.
Package fsutil holds the file helpers the daemon's state files share.
github
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).
gittest
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).
harness
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).
holder
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.
hook
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.
hostid
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.
hostscreen
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.
hostscreen/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.
hostscreen/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.
hostscreen/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.
hostscreen/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).
hostscreen/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).
install
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).
ipc
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.
logind
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.
loginenv
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).
notify
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).
paths
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.
pathstest
Package pathstest isolates a stagent installation for tests.
Package pathstest isolates a stagent installation for tests.
proc
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.
pscwd
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.
ptable
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.
pty
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.
rpc
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.
schedagent
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.
schedule
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.
screen
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.
screenrules
Package screenrules holds the rules the holder reads coding agents' screens with (internal/holder/prompt.go): how each harness draws its menus and question UIs — its cursor, the patterns of its key hints and headers, how many rows to look at, and which of the holder's ways of finding a dialog's top edge, frame or question UI applies.
Package screenrules holds the rules the holder reads coding agents' screens with (internal/holder/prompt.go): how each harness draws its menus and question UIs — its cursor, the patterns of its key hints and headers, how many rows to look at, and which of the holder's ways of finding a dialog's top edge, frame or question UI applies.
scrollback
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.
seatbelt
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).
statusline
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.
stubcmd
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.
task
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.
transcript
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.
usage
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.
version
Package version holds the stagent release and wire protocol versions.
Package version holds the stagent release and wire protocol versions.
wire
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).
worktree
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