internal/

directory
v0.196.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT

Directories

Path Synopsis
acp
Package acp implements a minimal Agent Client Protocol (ACP) client: gofer spawns an ACP agent as a child process and drives one prompt turn over its stdio (JSON-RPC 2.0, one message per line).
Package acp implements a minimal Agent Client Protocol (ACP) client: gofer spawns an ACP agent as a child process and drives one prompt turn over its stdio (JSON-RPC 2.0, one message per line).
acptest
Package acptest provides an in-repo fake ACP agent: a scripted JSON-RPC 2.0 stdio server used as a test double for internal/acp and internal/runner/acp.
Package acptest provides an in-repo fake ACP agent: a scripted JSON-RPC 2.0 stdio server used as a test double for internal/acp and internal/runner/acp.
Package agent provides the agent registry, command-template rendering, the adapter that turns a job request into an executable argv, and a detect probe.
Package agent provides the agent registry, command-template rendering, the adapter that turns a job request into an executable argv, and a detect probe.
Package attachment stores the images a user uploads before sending them with a workbench message (design 2026-10-19-workbench-image-attachments-design.md 「附件存储(server)」).
Package attachment stores the images a user uploads before sending them with a workbench message (design 2026-10-19-workbench-image-attachments-design.md 「附件存储(server)」).
Package authz is the permission catalog and the pattern rules that turn a grant pattern into the set of permissions the grant means — design §1「权限目录(40 项)」 and §2「授权模型与判定」of docs/design/2026-10-14-db-capabilities-and-session-grants-design.md.
Package authz is the permission catalog and the pattern rules that turn a grant pattern into the set of permissions the grant means — design §1「权限目录(40 项)」 and §2「授权模型与判定」of docs/design/2026-10-14-db-capabilities-and-session-grants-design.md.
Package bdmigrate moves a repository from bd (beads) to the gofer tracker: issues and memories, the managed instruction blocks, the agent hooks and core.hooksPath.
Package bdmigrate moves a repository from bd (beads) to the gofer tracker: issues and memories, the managed instruction blocks, the agent hooks and core.hooksPath.
Package brief assembles the handoff brief (接手包, design 2026-10-10-handoff-brief-and-knowledge-loop §一): everything a fresh agent session needs to take over an issue or a plan, in one bounded text.
Package brief assembles the handoff brief (接手包, design 2026-10-10-handoff-brief-and-knowledge-loop §一): everything a fresh agent session needs to take over an issue or a plan, in one bounded text.
Package castrec records a pty relay's output stream as an asciinema v2 "cast" file, optionally wrapped in a framed AES-256-GCM envelope (D-P3-4).
Package castrec records a pty relay's output stream as an asciinema v2 "cast" file, optionally wrapped in a framed AES-256-GCM envelope (D-P3-4).
Package certutil creates the local CA and server certificate used by gofer's optional HTTPS listener.
Package certutil creates the local CA and server certificate used by gofer's optional HTTPS listener.
Package changelog merges a Keep a Changelog style CHANGELOG.md as a git merge driver: the entries of the "unreleased" section (grouped by its `### ` subsections) are unioned, everything else goes through git's own line merge.
Package changelog merges a Keep a Changelog style CHANGELOG.md as a git merge driver: the entries of the "unreleased" section (grouped by its `### ` subsections) are unioned, everything else goes through git's own line merge.
Package client is a thin HTTP client for the gofer control plane.
Package client is a thin HTTP client for the gofer control plane.
Caller scope ceilings (上限): the operator-declared upper bound of what ONE caller (one token) may reach, and the load-time checks that keep a ceiling honest.
Caller scope ceilings (上限): the operator-declared upper bound of what ONE caller (one token) may reach, and the load-time checks that keep a ceiling honest.
Package configlint finds config keys that can be deleted without changing what gofer actually runs with (`gofer config lint`, gofer-arsj).
Package configlint finds config keys that can be deleted without changing what gofer actually runs with (`gofer config lint`, gofer-arsj).
Package daemon turns a foreground gofer process (serve / worker) into a detached background process.
Package daemon turns a foreground gofer process (serve / worker) into a detached background process.
Package delivery hands a worktree job's branch over (GIT-02, design 2026-10-12-delivery-and-cost-estimate-design.md): merge it into the base branch, push it to a remote, or push it and open a pull / merge request on GitHub, GitLab or Gitea / Forgejo.
Package delivery hands a worktree job's branch over (GIT-02, design 2026-10-12-delivery-and-cost-estimate-design.md): merge it into the base branch, push it to a remote, or push it and open a pull / merge request on GitHub, GitLab or Gitea / Forgejo.
Package desktop shows a notification on the machine's OWN desktop — the channel a server uses to reach a person who is neither watching the console nor a chat client (an approval parked for hours, a session waiting for a reply).
Package desktop shows a notification on the machine's OWN desktop — the channel a server uses to reach a person who is neither watching the console nor a chat client (an approval parked for hours, a session waiting for a reply).
Package focusremote gathers the server-side part of the tracker prime 「当前重点」 section (the server version, the workers serving this project and its open plans).
Package focusremote gathers the server-side part of the tracker prime 「当前重点」 section (the server version, the workers serving this project and its open plans).
Package hookrelay is the agent-CLI hook executor behind `gofer hook <agent>` (session relay, SESS-01 D1/D5).
Package hookrelay is the agent-CLI hook executor behind `gofer hook <agent>` (session relay, SESS-01 D1/D5).
授权管理接口(设计 docs/design/2026-10-14-db-capabilities-and-session-grants-design.md 「接口」一节、§2「授权模型与判定」与 §4「会话授权」,计划 T2.1)。
授权管理接口(设计 docs/design/2026-10-14-db-capabilities-and-session-grants-design.md 「接口」一节、§2「授权模型与判定」与 §4「会话授权」,计划 T2.1)。
authzgen command
Command authzgen writes the generated permission reference (docs/reference/permissions.md) from the running code: the permission catalog and the route declaration table.
Command authzgen writes the generated permission reference (docs/reference/permissions.md) from the running code: the permission catalog and the route declaration table.
job
Caller ceilings on the JOB side (design 2026-10-18, 上限所有者 / 准入).
Caller ceilings on the JOB side (design 2026-10-18, 上限所有者 / 准入).
Package jobstore is the SQLite-backed metadata/index store for gofer jobs.
Package jobstore is the SQLite-backed metadata/index store for gofer jobs.
Package logx configures the process-wide structured logger (slog) for gofer.
Package logx configures the process-wide structured logger (slog) for gofer.
Package mail is the gofer 信箱's business layer (design 2026-10-16-session-topics-mailbox-and-inbox-design.md 「二、gofer 信箱」): sending a letter to an address, resolving that address to the ONE session / job / caller it names, stamping where the letter came from, and parking what cannot be delivered in the capture box.
Package mail is the gofer 信箱's business layer (design 2026-10-16-session-topics-mailbox-and-inbox-design.md 「二、gofer 信箱」): sending a letter to an address, resolving that address to the ONE session / job / caller it names, stamping where the letter came from, and parking what cannot be delivered in the capture box.
Package mcpprobe checks that a registry MCP server (MCP-06) can be reached from this machine: it starts (stdio) or connects to (http) the server with the declaration's environment and headers, performs the MCP handshake and lists the tools.
Package mcpprobe checks that a registry MCP server (MCP-06) can be reached from this machine: it starts (stdio) or connects to (http) the server with the declaration's environment and headers, performs the MCP handshake and lists the tools.
Package mcpserver exposes the gofer control plane as a stdio MCP server (plan P8).
Package mcpserver exposes the gofer control plane as a stdio MCP server (plan P8).
Package mcptools is the single registry of gofer's OWN MCP tools (the gofer_* tools internal/mcpserver exposes) and of what each one does to state.
Package mcptools is the single registry of gofer's OWN MCP tools (the gofer_* tools internal/mcpserver exposes) and of what each one does to state.
Package messenger owns the stream-json process bridge used to deliver a message to an agent session.
Package messenger owns the stream-json process bridge used to deliver a message to an agent session.
Package metrics is the gofer Prometheus instrumentation (E16, design §6).
Package metrics is the gofer Prometheus instrumentation (E16, design §6).
Package msgprefix is the ONE table of the prefixes gofer puts in front of the text it delivers into an agent session (design 2026-10-22-message-prefixes, D1):
Package msgprefix is the ONE table of the prefixes gofer puts in front of the text it delivers into an agent session (design 2026-10-22-message-prefixes, D1):
Package netproxy routes the server's outbound HTTP through the configured http_proxy for the allowed sites (gofer-29gi).
Package netproxy routes the server's outbound HTTP through the configured http_proxy for the allowed sites (gofer-29gi).
Package notify implements the E14 webhook outbound side (design §5.5–5.7): it validates a webhook URL against the outbound allowlist + SSRF rules, signs and POSTs the delivery body, and matches an event to its subscribed webhooks.
Package notify implements the E14 webhook outbound side (design §5.5–5.7): it validates a webhook URL against the outbound allowlist + SSRF rules, signs and POSTs the delivery body, and matches an event to its subscribed webhooks.
Package overview builds the dashboard statistics wall (gofer-yelm, design docs/design/2026-10-09-dashboard-redesign-design.md): GET /v1/stats/overview folds the jobs that ENDED inside a range (plus their job_metrics rows), the reviews, the plans and the terminal-session usage into one payload, and caches it per (range, tz).
Package overview builds the dashboard statistics wall (gofer-yelm, design docs/design/2026-10-09-dashboard-redesign-design.md): GET /v1/stats/overview folds the jobs that ENDED inside a range (plus their job_metrics rows), the reviews, the plans and the terminal-session usage into one payload, and caches it per (range, tz).
Package procattr holds the one platform-specific tweak every NON-interactive child process needs: on Windows a process without a console (a `gofer worker -d` / `serve -d` daemon runs detached) that starts a console program (git, claude.cmd, npx ...) makes Windows open a fresh console window for EVERY such child.
Package procattr holds the one platform-specific tweak every NON-interactive child process needs: on Windows a process without a console (a `gofer worker -d` / `serve -d` daemon runs detached) that starts a console program (git, claude.cmd, npx ...) makes Windows open a fresh console window for EVERY such child.
Package proctree holds one spawned process and the descendants it spawns, so a caller can kill the WHOLE tree instead of only the direct child.
Package proctree holds one spawned process and the descendants it spawns, so a caller can kill the WHOLE tree instead of only the direct child.
Package ptyrelay is the serve-side per-session pty relay (WEB-03 design §6, K2/K6): it consumes a PtySource (the raw byte stream from a worker's pty over the dedicated pty ws, or a serve-local ptmx) and drives TWO independent backpressure layers:
Package ptyrelay is the serve-side per-session pty relay (WEB-03 design §6, K2/K6): it consumes a PtySource (the raw byte stream from a worker's pty over the dedicated pty ws, or a serve-local ptmx) and drives TWO independent backpressure layers:
Package pushhub is the in-process fan-out behind the browser's single /v1/ws connection (Q2).
Package pushhub is the in-process fan-out behind the browser's single /v1/ws connection (Q2).
Package rule is the gofer RULE library (JOB-06①, design §一.1): a rule is a short, MANDATORY piece of discipline the server owns and injects at the TOP of every job prompt that binds it ("改文件只用 apply_patch", "测试先写先提交").
Package rule is the gofer RULE library (JOB-06①, design §一.1): a rule is a short, MANDATORY piece of discipline the server owns and injects at the TOP of every job prompt that binds it ("改文件只用 apply_patch", "测试先写先提交").
Package runner abstracts where a job's process executes.
Package runner abstracts where a job's process executes.
acp
Package acp runs an `acp-agent` job: it starts the agent's ACP server over stdio, drives exactly one prompt turn (initialize → session/new → session/prompt) and maps the protocol's events onto the job's outputs.
Package acp runs an `acp-agent` job: it starts the agent's ACP server over stdio, drives exactly one prompt turn (initialize → session/new → session/prompt) and maps the protocol's events onto the job's outputs.
local
Package local implements the in-process (local host) runner.
Package local implements the in-process (local host) runner.
ndjsonfilter
Package ndjsonfilter turns a structured (NDJSON / JSON-Lines) agent output stream into the two streams gofer captures (bd h-aii-rpky, bd h-aii-525u).
Package ndjsonfilter turns a structured (NDJSON / JSON-Lines) agent output stream into the two streams gofer captures (bd h-aii-rpky, bd h-aii-525u).
peerhttp
Package peerhttp implements a remote runner that forwards a job to a peer gofer over HTTP (plan §11.1, P7).
Package peerhttp implements a remote runner that forwards a job to a peer gofer over HTTP (plan §11.1, P7).
pty
Package ptyrunner is the worker-side runner variant for interactive (pty-attached) jobs (WEB-03 design §5/§6, D1).
Package ptyrunner is the worker-side runner variant for interactive (pty-attached) jobs (WEB-03 design §5/§6, D1).
worker
Package worker implements the ws-worker host-side runner (main plan §4, internal/runner/worker).
Package worker implements the ws-worker host-side runner (main plan §4, internal/runner/worker).
Package secret holds credential-redaction primitives shared by the workflow export path and the job request-redact path.
Package secret holds credential-redaction primitives shared by the workflow export path and the job request-redact path.
Package serve holds the serve process orchestration (BP2): it builds the runtime Core, starts the periodic sweepers / health probe / SIGHUP reload loops, wires the httpapi server and blocks until the server stops.
Package serve holds the serve process orchestration (BP2): it builds the runtime Core, starts the periodic sweepers / health probe / SIGHUP reload loops, wires the httpapi server and blocks until the server stops.
Package servicemgr owns the local metadata and coordination primitives used by the native Windows and Linux service backends.
Package servicemgr owns the local metadata and coordination primitives used by the native Windows and Linux service backends.
Package sessionrelay is the session-relay domain service (SESS-01): terminal agent-CLI sessions (Claude Code / Codex) register themselves through their hooks, the web observes them, and while a session's relay switch is on the Stop hook posts the agent's last message as a "turn" and blocks until a human answers it on the web — the answer is injected back into the SAME terminal session via the hook's `decision: block` continuation.
Package sessionrelay is the session-relay domain service (SESS-01): terminal agent-CLI sessions (Claude Code / Codex) register themselves through their hooks, the web observes them, and while a session's relay switch is on the Stop hook posts the agent's last message as a "turn" and blocks until a human answers it on the web — the answer is injected back into the SAME terminal session via the hook's `decision: block` continuation.
Package settings is the extension-settings registry and service: runtime-adjustable knobs (prompts, thresholds, exclusion lists) stored in the database instead of config.yaml, so a change applies immediately without restarting the server.
Package settings is the extension-settings registry and service: runtime-adjustable knobs (prompts, thresholds, exclusion lists) stored in the database instead of config.yaml, so a change applies immediately without restarting the server.
Package skill is the gofer-side skill library (JOB-10, design docs/design/2026-09-23-skills-binding-and-comment-routing-design.md §一): a skill is a directory of "working method" knowledge — a required SKILL.md plus attachments — that lives WITH THE SERVER, not in the project tree, so a job can be handed it without a concurrent job seeing it and without git ever tracking it.
Package skill is the gofer-side skill library (JOB-10, design docs/design/2026-09-23-skills-binding-and-comment-routing-design.md §一): a skill is a directory of "working method" knowledge — a required SKILL.md plus attachments — that lives WITH THE SERVER, not in the project tree, so a job can be handed it without a concurrent job seeing it and without git ever tracking it.
Package steward is the W2b steward (design 2026-10-05 §9 / §14.4): a resident ACP session that only schedules and tidies the work items — it reads, notes, reminds, suggests merges and asks sessions to report, but never decides (no done / dropped, no job submit, no config).
Package steward is the W2b steward (design 2026-10-05 §9 / §14.4): a resident ACP session that only schedules and tidies the work items — it reads, notes, reminds, suggests merges and asks sessions to report, but never decides (no done / dropped, no job submit, no config).
Package store persists per-job log artifacts under a single result directory (<result_dir>/<job_id>/): the live stdout/stderr logs streamed by the local runner.
Package store persists per-job log artifacts under a single result directory (<result_dir>/<job_id>/): the live stdout/stderr logs streamed by the local runner.
Package streaming holds the job log/event/interaction SSE streaming orchestration.
Package streaming holds the job log/event/interaction SSE streaming orchestration.
Package template implements gofer task-book templates (SUP-01 P5, design §六): a markdown file with an optional YAML frontmatter, living in <project>/.gofer/templates/ or <config-dir>/templates/, that a submit renders into a job prompt.
Package template implements gofer task-book templates (SUP-01 P5, design §六): a markdown file with an optional YAML frontmatter, living in <project>/.gofer/templates/ or <config-dir>/templates/, that a submit renders into a job prompt.
testutil
gitenv
Package gitenv quiets git for tests that create repositories in a TempDir.
Package gitenv quiets git for tests that create repositories in a TempDir.
testcmd/testcmd command
wait
Package wait gives tests load-tolerant waits (gofer-r7am, design docs/design/2026-10-10-flaky-tests-root-cause.md §2.4).
Package wait gives tests load-tolerant waits (gofer-r7am, design docs/design/2026-10-10-flaky-tests-root-cause.md §2.4).
Package today is the N3 「今天」 decision home (design docs/design/2026-10-09-n3-today-decision-home-design.md §1/§2): it folds every "a person must decide" signal — pending interactions, OPEN decisions, relay turns, needs_review jobs, jobs held for approval, work items that wait for the person, the status / goal tidy-up suggestions, merge suggestions and blocked plans — into one ordered card queue, plus the one-line digest and the status bar.
Package today is the N3 「今天」 decision home (design docs/design/2026-10-09-n3-today-decision-home-design.md §1/§2): it folds every "a person must decide" signal — pending interactions, OPEN decisions, relay turns, needs_review jobs, jobs held for approval, work items that wait for the person, the status / goal tidy-up suggestions, merge suggestions and blocked plans — into one ordered card queue, plus the one-line digest and the status bar.
Package tracker owns the repository-local issue and memory JSONL truth.
Package tracker owns the repository-local issue and memory JSONL truth.
Package tunnel is a leaf implementation of TCP tunnel protocols and data forwarding.
Package tunnel is a leaf implementation of TCP tunnel protocols and data forwarding.
Package updatecheck looks for a newer gofer release (gofer-6x2n, docs/design/2026-10-13-update-check-design.md): the latest GitHub release by default, or a mirror's latest.yaml.
Package updatecheck looks for a newer gofer release (gofer-6x2n, docs/design/2026-10-13-update-check-design.md): the latest GitHub release by default, or a mirror's latest.yaml.
Package util contains the file-only part of Gofer binary upgrades.
Package util contains the file-only part of Gofer binary upgrades.
Package webpush owns browser Web Push encryption, VAPID identity, subscriptions, one-time notification actions and asynchronous event dispatch.
Package webpush owns browser Web Push encryption, VAPID identity, subscriptions, one-time notification actions and asynchronous event dispatch.
Package webui embeds the gofer web console static assets into the binary so `serve` can mount the SPA without any external files.
Package webui embeds the gofer web console static assets into the binary so `serve` can mount the SPA without any external files.
Package work is the work-item domain service (W1, design 2026-10-05): the layer above terminal sessions that records "what the human is doing", derives its status from the sessions, tracks reminders and produces the daily digest.
Package work is the work-item domain service (W1, design 2026-10-05): the layer above terminal sessions that records "what the human is doing", derives its status from the sessions, tracks reminders and produces the daily digest.
transcript
Package transcript turns an agent CLI's own session file into a short list of conversation turns for the work-item summarizer (W2a, design §14.2).
Package transcript turns an agent CLI's own session file into a short list of conversation turns for the work-item summarizer (W2a, design §14.2).
Package workbench projects persisted jobs and relay sessions into the conversation-first WEB-11 model.
Package workbench projects persisted jobs and relay sessions into the conversation-first WEB-11 model.
Package worker is the ws-worker client (main plan §4, §6): a `gofer worker` process dials the central hub over a single WebSocket, registers, and then receives job dispatches which it runs LOCALLY with its own job.Service / local runner (review #8: the worker re-validates project/agent/exec with its own config).
Package worker is the ws-worker client (main plan §4, §6): a `gofer worker` process dials the central hub over a single WebSocket, registers, and then receives job dispatches which it runs LOCALLY with its own job.Service / local runner (review #8: the worker re-validates project/agent/exec with its own config).
Package workerenroll is the business layer of worker self-enrollment (design 2026-10-17-worker-self-enrollment): the request state machine (pending -> accepting -> accepted -> collected, or rejected / expired / superseded / cancelled), the pairing code and enroll-secret checks, and the audit trail.
Package workerenroll is the business layer of worker self-enrollment (design 2026-10-17-worker-self-enrollment): the request state machine (pending -> accepting -> accepted -> collected, or rejected / expired / superseded / cancelled), the pairing code and enroll-secret checks, and the audit trail.
Package workerupgrade is the server-side bookkeeping of remote worker binary upgrades (design 2026-10-03-worker-remote-upgrade, U1): it stages the binary a worker will download (one file per worker id under <run>/upgrade/) and records the outcome of the latest upgrade per worker.
Package workerupgrade is the server-side bookkeeping of remote worker binary upgrades (design 2026-10-03-worker-remote-upgrade, U1): it stages the binary a worker will download (one file per worker id under <run>/upgrade/) and records the outcome of the latest upgrade per worker.
Package workflowstep is the registry of gofer's built-in workflow steps — the steps a workflow names with `uses: gofer/<name>` and parametrises with `with:` (design 2026-10-21 §一·5).
Package workflowstep is the registry of gofer's built-in workflow steps — the steps a workflow names with `uses: gofer/<name>` and parametrises with `with:` (design 2026-10-21 §一·5).
Package wsproto defines the WebSocket message protocol shared by the hub (internal/wshub, serve-side) and the worker client (internal/worker).
Package wsproto defines the WebSocket message protocol shared by the hub (internal/wshub, serve-side) and the worker client (internal/worker).
Package xfer implements XFER-01's transfer staging area and journal: the on-disk staging directory a transfer's payload passes through (<root>/xfer/<id>/data) and the business operations recorded against it (stage a put/get, dispatch it to the executing machine, settle it done/failed, expire it).
Package xfer implements XFER-01's transfer staging area and journal: the on-disk staging directory a transfer's payload passes through (<root>/xfer/<id>/data) and the business operations recorded against it (stage a put/get, dispatch it to the executing machine, settle it done/failed, expire it).

Jump to

Keyboard shortcuts

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