Documentation
¶
Index ¶
- Variables
- func DefaultAgentPrompt() string
- func DefaultTOML() []byte
- func Expand(s string, vars TemplateVars) (string, error)
- func ExpandPath(p string) string
- func ExpandSlice(ss []string, vars TemplateVars) ([]string, error)
- func IncludeEnvVarName(repoBasename string) string
- func LegacyRuntimeDirs() []string
- func ParseDurationWithDays(s string) (time.Duration, error)
- func ResolvePath(p string) string
- func ResolveProfile() (profile string, appName string, err error)
- type Agent
- type Approvals
- type Config
- type GitPullConfig
- type Keybindings
- type MCPServerConfig
- type Messages
- type Notifications
- type OrchestratorConfig
- type OrchestratorSandboxConfig
- type Overlay
- type PRWatchConfig
- type Paths
- type RepoConfig
- type SandboxConfig
- type SandboxNetworkConfig
- type StatusBar
- type StatusConfig
- type TemplateVars
- type Watcher
Constants ¶
This section is empty.
Variables ¶
var SandboxSignalModes = []string{"isolated", "allow_same_sandbox", "allow_all"}
SandboxSignalModes are the accepted values for [sandbox] signal_mode. They mirror nono v0.66.0's security.signal_mode enum. Empty is also valid (inherit nono's base-profile default).
Functions ¶
func DefaultAgentPrompt ¶ added in v0.35.0
func DefaultAgentPrompt() string
func DefaultTOML ¶ added in v0.19.0
func DefaultTOML() []byte
func ExpandPath ¶ added in v0.11.0
func ExpandSlice ¶
func ExpandSlice(ss []string, vars TemplateVars) ([]string, error)
func IncludeEnvVarName ¶ added in v0.19.0
func LegacyRuntimeDirs ¶ added in v0.11.0
func LegacyRuntimeDirs() []string
LegacyRuntimeDirs returns paths where older versions stored the socket and PID file (TMPDIR or /tmp fallbacks). Used during startup to detect and clean up an orphaned daemon after the socket location changed.
func ParseDurationWithDays ¶ added in v0.3.0
func ResolvePath ¶ added in v0.16.5
func ResolveProfile ¶ added in v0.18.0
Types ¶
type Agent ¶
type Agent struct {
Command string `json:"command" toml:"command"`
Args []string `json:"args,omitempty" toml:"args"`
ResumeArgs []string `json:"resume_args,omitempty" toml:"resume_args"`
ForkArgs []string `json:"fork_args,omitempty" toml:"fork_args"`
Env map[string]string `json:"env,omitempty" toml:"env"`
IdleTimeout string `json:"idle_timeout,omitempty" toml:"idle_timeout"`
InjectPrompt *bool `json:"inject_prompt,omitempty" toml:"inject_prompt"`
PreTrustWorkspace *bool `json:"pre_trust_workspace,omitempty" toml:"pre_trust_workspace"`
Sandbox SandboxConfig `json:"sandbox" toml:"sandbox"`
MCPServers map[string]MCPServerConfig `json:"mcp_servers,omitempty" toml:"mcp_servers"`
ValidateModel string `json:"validate_model,omitempty" toml:"validate_model"`
}
func (Agent) IdleTimeoutDuration ¶
func (Agent) PreTrustWorkspaceEnabled ¶ added in v0.48.0
func (Agent) PromptInjectionEnabled ¶ added in v0.32.0
type Approvals ¶ added in v0.13.0
type Approvals struct {
Mode string `toml:"mode"`
AutoPop bool `toml:"auto_pop"`
Timeout string `toml:"timeout"`
Command string `toml:"command"`
}
func (Approvals) TimeoutDuration ¶ added in v0.13.0
type Config ¶
type Config struct {
DefaultAgent string `toml:"default_agent"`
GitHubUsername string `toml:"github_username"`
BranchPrefix string `toml:"branch_prefix"`
DataDir string `toml:"data_dir"`
FetchOnCreate bool `toml:"fetch_on_create"`
AgentPrompt string `toml:"agent_prompt"`
AllowedRepoPaths []string `toml:"allowed_repo_paths"`
Repos []RepoConfig `toml:"repos"`
StatusBar StatusBar `toml:"status_bar"`
Keybindings Keybindings `toml:"keybindings"`
Notifications Notifications `toml:"notifications"`
Messages Messages `toml:"messages"`
Sandbox SandboxConfig `toml:"sandbox"`
Approvals Approvals `toml:"approvals"`
Status StatusConfig `toml:"status"`
GitPull GitPullConfig `toml:"git_pull"`
PRWatch PRWatchConfig `toml:"pr_watch"`
MCPServers []MCPServerConfig `toml:"mcp_servers"`
Overlay Overlay `toml:"overlay"`
Orchestrator OrchestratorConfig `toml:"orchestrator"`
Agents map[string]Agent `toml:"agents"`
}
func LoadOrDefault ¶
func (*Config) FindRepo ¶ added in v0.18.0
func (c *Config) FindRepo(repoPath string) (RepoConfig, bool)
func (*Config) OrchestratorSandboxMerged ¶ added in v0.46.0
func (c *Config) OrchestratorSandboxMerged(agentName string) SandboxConfig
func (*Config) RepoPathAllowed ¶ added in v0.11.0
type GitPullConfig ¶ added in v0.42.0
func (GitPullConfig) IntervalDuration ¶ added in v0.42.0
func (g GitPullConfig) IntervalDuration() time.Duration
type Keybindings ¶
type Keybindings struct {
Prefix string `toml:"prefix"`
NewSession string `toml:"new_session"`
ForkSession string `toml:"fork_session"`
DeleteSession string `toml:"delete_session"`
Detach string `toml:"detach"`
SessionList string `toml:"session_list"`
NextSession string `toml:"next_session"`
PrevSession string `toml:"prev_session"`
LastSession string `toml:"last_session"`
ResumeSession string `toml:"resume_session"`
RenameSession string `toml:"rename_session"`
Search string `toml:"search"`
ScrollMode string `toml:"scroll_mode"`
Shell string `toml:"shell"`
OrchestratorSession string `toml:"orchestrator_session"`
}
type MCPServerConfig ¶ added in v0.22.0
type MCPServerConfig struct {
Name string `json:"-" toml:"name"`
Command string `json:"command" toml:"command"`
Args []string `json:"args,omitempty" toml:"args,omitempty"`
Env map[string]string `json:"env,omitempty" toml:"env,omitempty"`
Disabled bool `json:"-" toml:"disabled,omitempty"`
Sandbox *bool `json:"-" toml:"sandbox,omitempty"`
SandboxConfig *SandboxConfig `json:"-" toml:"sandbox_config,omitempty"`
}
func MergeMCPServers ¶ added in v0.22.0
func MergeMCPServers(global []MCPServerConfig, overrides map[string]MCPServerConfig) []MCPServerConfig
type Messages ¶ added in v0.3.0
func (Messages) MaxAgeDuration ¶ added in v0.3.0
type Notifications ¶ added in v0.2.0
type OrchestratorConfig ¶ added in v0.42.0
type OrchestratorConfig struct {
Enabled bool `toml:"enabled"`
Agent string `toml:"agent"`
Model string `toml:"model"`
IdleTimeout string `toml:"idle_timeout"`
Prompt string `toml:"prompt"`
PromptFile string `toml:"prompt_file"`
Sandbox OrchestratorSandboxConfig `toml:"sandbox"`
}
func (OrchestratorConfig) AgentName ¶ added in v0.42.0
func (o OrchestratorConfig) AgentName() string
func (OrchestratorConfig) IdleTimeoutDuration ¶ added in v0.42.0
func (o OrchestratorConfig) IdleTimeoutDuration() time.Duration
type OrchestratorSandboxConfig ¶ added in v0.46.0
type PRWatchConfig ¶ added in v0.59.0
type PRWatchConfig struct {
Enabled bool `toml:"enabled"`
NotifyCIFailures bool `toml:"notify_ci_failures"`
NotifyMergeConflicts bool `toml:"notify_merge_conflicts"`
NotifyReviewComments bool `toml:"notify_review_comments"`
NotifyReviewDecisions bool `toml:"notify_review_decisions"`
NotifyPRLifecycle bool `toml:"notify_pr_lifecycle"`
NotifyCIRecovery bool `toml:"notify_ci_recovery"`
PollPending string `toml:"poll_pending"`
PollTerminal string `toml:"poll_terminal"`
PollMerged string `toml:"poll_merged"`
MaxNotificationsPerPR int `toml:"max_notifications_per_pr"`
Debounce string `toml:"debounce"`
}
PRWatchConfig controls the PR & CI awareness loop, which resolves each session's GitHub PR via the gh CLI, polls its CI checks and review comments, and notifies the owning session's inbox on meaningful transitions.
CI failures and review feedback are gated separately because they carry different authority: a CI failure is a machine verdict (safe to act on, default on); a review comment or decision is human intent that may not be actionable (default off).
func (PRWatchConfig) DebounceDuration ¶ added in v0.59.0
func (p PRWatchConfig) DebounceDuration() time.Duration
DebounceDuration is the minimum cooldown between notifications to one session.
func (PRWatchConfig) MaxNotifications ¶ added in v0.59.0
func (p PRWatchConfig) MaxNotifications() int
MaxNotifications returns the per-head-SHA notification cap, defaulting to 10.
func (PRWatchConfig) PollMergedDuration ¶ added in v0.59.0
func (p PRWatchConfig) PollMergedDuration() time.Duration
PollMergedDuration is the sweep interval for merged/closed PRs.
func (PRWatchConfig) PollPendingDuration ¶ added in v0.59.0
func (p PRWatchConfig) PollPendingDuration() time.Duration
PollPendingDuration is the poll interval while a PR has pending/in-progress checks.
func (PRWatchConfig) PollTerminalDuration ¶ added in v0.59.0
func (p PRWatchConfig) PollTerminalDuration() time.Duration
PollTerminalDuration is the poll interval once all checks are terminal (PR still open).
type Paths ¶
type Paths struct {
Profile string
AppName string
ConfigFile string
DataDir string
RuntimeDir string
SocketPath string
PIDFile string
StateFile string
LogDir string
DaemonLog string
MessagesDB string
TmpDir string
}
func ResolvePaths ¶
func (Paths) EnsureDirs ¶
func (Paths) WithDataDir ¶ added in v0.21.0
type RepoConfig ¶ added in v0.18.0
type RepoConfig struct {
Path string `toml:"path"`
AllowConcurrent bool `toml:"allow_concurrent"`
Singleton bool `toml:"singleton"`
Includes []string `toml:"includes"`
}
func (RepoConfig) Validate ¶ added in v0.19.0
func (rc RepoConfig) Validate() error
type SandboxConfig ¶ added in v0.11.0
type SandboxConfig struct {
Enabled bool `json:"enabled" toml:"enabled"`
Disabled *bool `json:"disabled,omitempty" toml:"disabled,omitempty"`
// Backend selects the sandbox backend: "safehouse" (macOS only) or "nono"
// (Linux + macOS). It has NO default — when the sandbox is enabled and
// Backend is unset the daemon fails closed with an actionable error. This
// is a deliberate pre-1.0 behaviour change (see the nono sandbox design doc).
Backend string `json:"backend,omitempty" toml:"backend"`
Command string `json:"command,omitempty" toml:"command"`
Features []string `json:"features,omitempty" toml:"features"`
ReadDirs []string `json:"read_dirs,omitempty" toml:"read_dirs"`
WriteDirs []string `json:"write_dirs,omitempty" toml:"write_dirs"`
// ReadFiles / WriteFiles grant access to individual files rather than whole
// directories. They exist for paths that can't be expressed as a directory
// grant without over-sharing — most importantly single files that live
// directly in $HOME (e.g. an agent's ~/.claude.json login file), where
// granting the parent directory would expose unrelated secrets (.env, ssh
// keys, tfvars). ReadFiles is read-only; WriteFiles is read+write, mirroring
// the read_dirs / write_dirs convention (where "write" means read+write, not
// nono's write-only mode). They map to the nono profile's
// filesystem.read_file / filesystem.allow_file; the safehouse backend folds
// them into its read-only / read-write path lists.
ReadFiles []string `json:"read_files,omitempty" toml:"read_files"`
WriteFiles []string `json:"write_files,omitempty" toml:"write_files"`
// SignalMode controls whether the sandboxed process may signal other
// processes. It maps to nono's security.signal_mode ("isolated",
// "allow_same_sandbox", "allow_all"). Empty inherits nono's base-profile
// default (allow_same_sandbox). safehouse ignores it. Setting "isolated"
// makes graith's `process-control` semantics meaningful under nono (Phase 1
// left it a no-op). See the nono sandbox design doc §C5.
SignalMode string `json:"signal_mode,omitempty" toml:"signal_mode"`
// Network is an optional egress policy. It maps to the nono profile's
// network section (network.block / network.allow_domain). safehouse has no
// network primitive and only warns. A network policy also raises the
// enforcement floor: nono needs Landlock ABI v4 (kernel 6.7+) to filter
// network, so a requested policy on an older kernel fails closed.
Network *SandboxNetworkConfig `json:"network,omitempty" toml:"network"`
}
func (SandboxConfig) Merge ¶ added in v0.11.0
func (s SandboxConfig) Merge(agent SandboxConfig) SandboxConfig
type SandboxNetworkConfig ¶ added in v0.64.0
type SandboxNetworkConfig struct {
// Block denies all outbound network access (nono is network-allowed by
// default). Maps to network.block = true.
Block bool `json:"block,omitempty" toml:"block"`
// AllowDomains is the proxy allowlist. Maps to network.allow_domain. When
// set, nono runs its L7 filtering proxy and only these domains are
// reachable. Entries are plain hostnames or URL globs.
AllowDomains []string `json:"allow_domains,omitempty" toml:"allow_domains"`
}
SandboxNetworkConfig is graith's egress policy. It maps directly onto nono v0.66.0's profile network section: Block -> network.block, AllowDomains -> network.allow_domain (an L7 proxy allowlist; a plain hostname allows the host, a URL glob restricts to matching endpoints).
func (*SandboxNetworkConfig) IsSet ¶ added in v0.64.0
func (n *SandboxNetworkConfig) IsSet() bool
IsSet reports whether this network policy requests any egress restriction. A nil or empty config requests nothing (matches nono's allow-by-default).
type StatusConfig ¶ added in v0.32.0
type StatusConfig struct {
TTL string `toml:"ttl"`
}
func (StatusConfig) TTLDuration ¶ added in v0.32.0
func (s StatusConfig) TTLDuration() time.Duration