config

package
v0.40.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config loads the on-disk Pyrycode configuration file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateMemory added in v0.39.0

func UpdateMemory(path string, settings MemorySettings) error

UpdateMemory atomically replaces known memory settings at path, preserving unrelated and unknown JSON values. Empty optional path/reference and nil roots clear their old keys. It creates missing configs and parents privately, performs no semantic validation, and touches no vault or credential storage. Callers must serialize updates to the same config path, including updates from other processes.

Types

type Config

type Config struct {
	RelayURL              string                 `json:"relay_url"`
	MemorySearchProviders []MemorySearchProvider `json:"memory_search_providers"`

	// Memory is nil when managed memory is unconfigured. Search declarations
	// remain independent; consumers validate these settings before using them.
	Memory *MemorySettings `json:"memory,omitempty"`

	// RelayAdmissionTokens binds private admission credentials to exact identities.
	// Nil means absent; a present map requires private effective-user storage.
	RelayAdmissionTokens map[string]string `json:"relay_admission_tokens,omitempty"`

	// 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

func Load(path string) (Config, error)

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. Malformed JSON and admission configuration return value-free errors without parser causes. On any error the returned Config is the zero value; callers must check err.

type MemoryCapture added in v0.39.0

type MemoryCapture struct {
	Agent string `json:"agent"`
	Model string `json:"model"`
}

MemoryCapture selects the agent and model used for capture.

type MemoryEmbedding added in v0.39.0

type MemoryEmbedding struct {
	Provider            string `json:"provider"`
	Model               string `json:"model"`
	CredentialReference string `json:"credential_reference,omitempty"`
}

MemoryEmbedding selects embedding independently of the capture agent. CredentialReference is opaque non-secret metadata, never a credential token.

type MemorySearchProvider added in v0.29.0

type MemorySearchProvider struct {
	ID          string `json:"id"`
	DisplayName string `json:"display_name"`
	Agent       string `json:"agent"`
	Workspace   string `json:"workspace"`
	Enabled     *bool  `json:"enabled"`
}

MemorySearchProvider declares search access for one agent and canonical workspace. Enabled is a pointer so a missing value cannot silently assert a disabled install.

type MemorySettings added in v0.39.0

type MemorySettings struct {
	Vault           MemoryVault     `json:"vault"`
	AdditionalRoots []string        `json:"additional_roots,omitempty"`
	Embedding       MemoryEmbedding `json:"embedding"`
	Capture         MemoryCapture   `json:"capture"`
}

MemorySettings describes managed memory. Choices, paths and credential references are parsed verbatim; their semantic validation belongs to callers.

type MemoryVault added in v0.39.0

type MemoryVault struct {
	Mode string `json:"mode"`
	Path string `json:"path,omitempty"`
}

MemoryVault selects the default vault or a separate caller-resolved path.

Jump to

Keyboard shortcuts

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