Documentation
¶
Overview ¶
Package config loads the on-disk Pyrycode configuration file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
RelayURL string `json:"relay_url"`
// DebugCapture once recorded the daemon's interactive session to a .cast
// file (#802). The recorder was removed with the terminal runner in #1348,
// and since #1514 the daemon refuses to start when this is true, so an
// operator's opt-in cannot be silently ignored. It is still decoded here
// because Load stays parse-only; the rejection lives at the composition
// root. An absent field decodes to false and starts normally.
DebugCapture bool `json:"debug_capture"`
// InteractiveRunner selects which interactive runner the daemon builds:
// "" or "pty" → the terminal-driven PTY supervisor (byte-identical to
// today's daemon startup, the #1077 rollback guarantee); "stream-json" →
// the streamsup-backed runner (#1081). Absent/empty is the default via the
// JSON zero value — NO DefaultConfig entry, so a config that omits the field
// keeps the PTY path. Any other value aborts startup (validated at the
// composition root, not here — the accepted set maps to factories the leaf
// config package cannot import). Rollback: set back to "pty" (or remove the
// field) and restart the daemon.
InteractiveRunner string `json:"interactive_runner"`
// StdioPermissionPrompt routes non-bypass interactive permission asks over
// claude's stdio control protocol. The zero value keeps the proven MCP prompt
// tool path, so an absent field is the rollback posture. Read once at daemon
// startup; changing the file takes effect after a restart.
StdioPermissionPrompt bool `json:"stdio_permission_prompt"`
}
Config is the on-disk schema for ~/.pyry/config.json. Fields are added additively over time; consumers reading an older file see missing-field defaults via DefaultConfig + overlay-decode in Load.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the built-in defaults. Used directly when no config file exists, and as the overlay base when a partial file is present so absent fields keep their default values.
func Load ¶
Load reads the config file at path and returns a Config with defaults filled in for absent fields. A missing file returns DefaultConfig() with no error. A malformed file returns a wrapped error (no silent fallback — operator must fix or remove the file). On any error the returned Config is the zero value; callers must check err.