config

package
v1.46.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: GPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DNDModeOff never consults the desktop's DND state (default).
	DNDModeOff = "off"
	// DNDModeSilent delivers the banner but skips the plugin's own sound, so
	// the notification still reaches the notification centre.
	DNDModeSilent = "silent"
	// DNDModeSuppress skips the desktop notification entirely.
	DNDModeSuppress = "suppress"
)

Do Not Disturb handling modes for notifications.respectDoNotDisturb.

View Source
const FreshNeutral = true

FreshNeutral is the shared rollout build policy; bridge artifacts set false.

View Source
const MaxDocumentBytes = 4 << 20
View Source
const MaxDocumentDepth = 128
View Source
const MutationTimeout = 5 * time.Second
View Source
const OverrideEnv = "AGENT_NOTIFICATIONS_CONFIG"

Variables

View Source
var ConsumerVersion = "1.46.0"

ConsumerVersion identifies the template compiled into this binary. The CLI reports this same build value; a bundle with another version has no baseline.

Functions

func CheckHistorical

func CheckHistorical(legacy LegacyContext, read func(string, int) (Snapshot, error)) error

CheckHistorical is the shared read-only guard for automatic missing defaults and initialization. It never imports a candidate or guesses its version.

func ConsumerContext

func ConsumerContext(pluginRoot string) (AssetContext, LegacyContext)

ConsumerContext keeps resource discovery separate from canonical selection. A bundle is historical evidence, never a runtime fallback. Without verified exact-version provenance its baseline remains unknown.

func GetStableConfigDir

func GetStableConfigDir() (string, error)

GetStableConfigDir returns the stable config directory outside the plugin cache. This directory survives plugin updates (bootstrap.sh rm -rf of cache).

func GetStableConfigPath

func GetStableConfigPath() (string, error)

GetStableConfigPath returns the stable config file path outside the plugin cache.

func InspectGlobalConfig added in v1.44.0

func InspectGlobalConfig(ctx context.Context, paths ...string) ([]byte, error)

InspectGlobalConfig returns the exact strict preparation candidate without creating parents or locks. PrepareGlobalConfig rechecks the sources on commit.

func PrepareGlobalConfigParent added in v1.45.3

func PrepareGlobalConfigParent(path string) error

PrepareGlobalConfigParent creates only the destination parent using the confined setup path walk. Portable setup needs the parent before publishing a locator; runtime launch remains read-only and the config file is untouched.

func ReadDocument

func ReadDocument(r ReadRequest) (Document, *Config, error)

ReadDocument is the transitional internal read API (Load(string) remains the legacy production API). It performs no writes, migration, or runtime effects. Managed Windows snapshots acquire existing shared locks without creating them.

func ReadDocumentSelection

func ReadDocumentSelection(r ReadRequest) (Document, *Config, Selection, error)

ReadDocumentSelection returns the selection which was revalidated around the returned bytes. Consumers that display a path and revision must use this value instead of resolving separately.

func ValidateGlobalDesktop added in v1.44.0

func ValidateGlobalDesktop(raw []byte) (enabled, sound, clickToFocus bool, err error)

ValidateGlobalDesktop is the shared strict runtime/setup parser. All three fields must be explicit booleans, including when desktop is disabled.

Types

type AgentID

type AgentID string

AgentID is selected by the composition root, never inferred from paths or env.

const (
	AgentClaude                AgentID = "claude"
	AgentCodex                 AgentID = "codex"
	AgentOpenCode              AgentID = "opencode"
	AssetRootPlaceholder               = "AGENT_NOTIFICATIONS_ROOT"
	LegacyAssetRootPlaceholder         = "CLAUDE_PLUGIN_ROOT"
)

type AssetContext

type AssetContext struct {
	Agent      AgentID
	PluginRoot string
	LookupEnv  func(string) (string, bool)
}

AssetContext is separate from resolver inputs. LookupEnv must be injected; no ambient environment is read when constructing an effective Config.

func ValidationAssets

func ValidationAssets(pluginRoot string) AssetContext

ValidationAssets validates storage structure without requiring the invoking shell to possess runtime credentials. The effective value is discarded; raw placeholders stay in the document. Hook reads still use ConsumerContext.

type CircuitBreakerConfig

type CircuitBreakerConfig struct {
	Enabled          bool   `json:"enabled"`
	FailureThreshold int    `json:"failureThreshold"` // failures before opening
	Timeout          string `json:"timeout"`          // time to wait in open state, e.g. "30s"
	SuccessThreshold int    `json:"successThreshold"` // successes needed in half-open
}

CircuitBreakerConfig represents circuit breaker settings

type Code

type Code string

Code is a stable, content-free diagnostic category.

const (
	ConfigUnsafeTarget         Code = "ConfigUnsafeTarget"
	ConfigConflict             Code = "ConfigConflict"
	ConfigLockTimeout          Code = "ConfigLockTimeout"
	ConfigCommitUncertain      Code = "ConfigCommitUncertain"
	ConfigLegacyImportRequired Code = "ConfigLegacyImportRequired"
	ConfigOverrideInvalid      Code = "ConfigOverrideInvalid"
	ConfigHomeUnavailable      Code = "ConfigHomeUnavailable"
	ConfigBaseUnavailable      Code = "ConfigBaseUnavailable"
	ConfigInvalid              Code = "ConfigInvalid"
	ConfigUnsupportedSchema    Code = "ConfigUnsupportedSchema"
	ConfigPermissionDenied     Code = "ConfigPermissionDenied"
	ConfigRecoveryRequired     Code = "ConfigRecoveryRequired"
	ConfigMultipleCandidates   Code = "ConfigMultipleCandidates"
	ConfigLinkedPath           Code = "ConfigLinkedPath"
	ConfigPublicReadable       Code = "ConfigPublicReadable"
	ConfigChanged              Code = "ConfigChanged"
	ConfigMissing              Code = "ConfigMissing"
	ConfigEnvConflict          Code = "ConfigEnvConflict"
)

type Config

type Config struct {
	Notifications NotificationsConfig   `json:"notifications"`
	Statuses      map[string]StatusInfo `json:"statuses"`
	Debug         DebugConfig           `json:"debug,omitempty"`
}

Config represents the plugin configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a config with sensible defaults

func Load

func Load(path string) (*Config, error)

Load loads configuration from a file If the file doesn't exist, returns default config

func LoadForAgent

func LoadForAgent(pluginRoot string, agent AgentID) (*Config, error)

func LoadForAgentQuiet

func LoadForAgentQuiet(pluginRoot string, agent AgentID) (*Config, error)

func LoadFromPluginRoot

func LoadFromPluginRoot(pluginRoot string) (*Config, error)

LoadFromPluginRoot reads the shared canonical Store. Bundle paths are resources and historical evidence only; selected errors never fall back.

func LoadFromPluginRootQuiet

func LoadFromPluginRootQuiet(pluginRoot string) (*Config, error)

LoadFromPluginRootQuiet behaves like LoadFromPluginRoot but keeps warnings in the file log only. Observation hook routes (Codex) must never write to the process stderr.

func (*Config) ApplyDefaults

func (c *Config) ApplyDefaults()

ApplyDefaults fills in missing fields with default values

func (*Config) GetDoNotDisturbMode added in v1.45.17

func (c *Config) GetDoNotDisturbMode() string

GetDoNotDisturbMode returns how the desktop's Do Not Disturb state should be treated: DNDModeOff (default), DNDModeSilent, or DNDModeSuppress.

Unknown values fall back to DNDModeOff with a warning. Rejecting them in Validate would abort config loading and therefore silence every notification over a typo in one optional field, which is the exact failure this feature is meant to avoid.

func (*Config) GetNotifyDelaySeconds

func (c *Config) GetNotifyDelaySeconds() int

GetNotifyDelaySeconds returns how many seconds to wait before delivering a desktop notification (default: 0). Negative values are treated as 0.

func (*Config) GetStatusInfo

func (c *Config) GetStatusInfo(status string) (StatusInfo, bool)

GetStatusInfo returns status information for a given status

func (*Config) GetSuppressQuestionAfterAnyNotificationSeconds

func (c *Config) GetSuppressQuestionAfterAnyNotificationSeconds() int

GetSuppressQuestionAfterAnyNotificationSeconds returns the cooldown in seconds after any notification before question notifications are allowed (default: 7).

func (*Config) GetSuppressQuestionAfterTaskCompleteSeconds

func (c *Config) GetSuppressQuestionAfterTaskCompleteSeconds() int

GetSuppressQuestionAfterTaskCompleteSeconds returns the cooldown in seconds after task completion before question notifications are allowed (default: 12)

func (*Config) GetTeamMode

func (c *Config) GetTeamMode() string

GetTeamMode returns the team notification mode: "always" (default), "wait-all", or "never"

func (*Config) IsAnyNotificationEnabled

func (c *Config) IsAnyNotificationEnabled() bool

IsAnyNotificationEnabled returns true if at least one notification method is enabled

func (*Config) IsBenchmarkEnabled

func (c *Config) IsBenchmarkEnabled() bool

IsBenchmarkEnabled returns true if benchmark timing is enabled via config

func (*Config) IsDesktopEnabled

func (c *Config) IsDesktopEnabled() bool

IsDesktopEnabled returns true if desktop notifications are enabled

func (*Config) IsSessionLabelEnabled

func (c *Config) IsSessionLabelEnabled() bool

IsSessionLabelEnabled returns true if the session label should be appended to the notification title (default: true)

func (*Config) IsStatusDesktopEnabled

func (c *Config) IsStatusDesktopEnabled(status string) bool

IsStatusDesktopEnabled returns true if desktop notifications for this status are enabled Considers global desktop.enabled, per-status enabled, and per-channel desktop override.

func (*Config) IsStatusEnabled

func (c *Config) IsStatusEnabled(status string) bool

IsStatusEnabled returns true if notifications for this status are enabled Returns true by default (if Enabled is nil or not specified) for backward compatibility

func (*Config) IsStatusWebhookEnabled

func (c *Config) IsStatusWebhookEnabled(status string) bool

IsStatusWebhookEnabled returns true if webhook notifications for this status are enabled Considers global webhook.enabled, per-status enabled, and per-channel webhook override.

func (*Config) IsTerminalBellEnabled

func (c *Config) IsTerminalBellEnabled() bool

IsTerminalBellEnabled returns true if terminal bell (BEL) should be sent (default: true)

func (*Config) IsWebhookEnabled

func (c *Config) IsWebhookEnabled() bool

IsWebhookEnabled returns true if webhook notifications are enabled

func (*Config) ShouldFilter

func (c *Config) ShouldFilter(status, gitBranch, folder string) bool

ShouldFilter returns true if any suppress-filter rule matches the given context. When true, the notification should be suppressed entirely (both desktop and webhook).

func (*Config) ShouldNotifyOnTextResponse

func (c *Config) ShouldNotifyOnTextResponse() bool

ShouldNotifyOnTextResponse returns true if notifications should be sent for text-only responses (default: true)

func (*Config) ShouldNotifyOnlyWhenUnfocused

func (c *Config) ShouldNotifyOnlyWhenUnfocused() bool

ShouldNotifyOnlyWhenUnfocused returns true if desktop notifications should be suppressed while the terminal window running Claude Code currently has OS focus (default: false).

func (*Config) ShouldRespectDisplaySleep added in v1.45.17

func (c *Config) ShouldRespectDisplaySleep() bool

ShouldRespectDisplaySleep returns true if the plugin's own sound should be skipped while every display is asleep (default: false). It has no effect on platforms with no display-sleep detector; see docs/DO_NOT_DISTURB.md.

func (*Config) ShouldRespectJudgeMode

func (c *Config) ShouldRespectJudgeMode() bool

ShouldRespectJudgeMode returns true if CLAUDE_HOOK_JUDGE_MODE=true env var should suppress notifications (default: true)

func (*Config) ShouldSuppressForSubagents

func (c *Config) ShouldSuppressForSubagents() bool

ShouldSuppressForSubagents returns true if notifications should be suppressed when transcript_path contains /subagents/ (default: true)

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration

type DebugConfig

type DebugConfig struct {
	Benchmark bool `json:"benchmark"` // Enable benchmark timing output to log file
}

DebugConfig represents debug/diagnostic settings

type DesktopConfig

type DesktopConfig struct {
	Enabled          bool    `json:"enabled"`
	Sound            bool    `json:"sound"`
	TerminalBell     *bool   `json:"terminalBell"`          // Send BEL to /dev/tty for terminal tab indicators (default: true)
	Volume           float64 `json:"volume"`                // Volume level 0.0-1.0, default 1.0 (full volume)
	AudioDevice      string  `json:"audioDevice"`           // Audio output device name (empty = system default)
	AppIcon          string  `json:"appIcon"`               // Path to app icon
	ClickToFocus     bool    `json:"clickToFocus"`          // macOS/Linux/Windows: activate the originating terminal window on notification click (default: true)
	ShowSessionLabel *bool   `json:"showSessionLabel"`      // Include the "[name id]" session label in the notification title (default: true)
	TerminalBundleID string  `json:"terminalBundleId"`      // macOS: override auto-detected terminal bundle ID (empty = auto)
	ZellijFocus      string  `json:"zellijFocus,omitempty"` // Linux: "auto" (default), "pane" (zellij 0.44.1+), "tab" (legacy), "off"
}

DesktopConfig represents desktop notification settings

type Diagnostic

type Diagnostic struct {
	Code Code   `json:"code"`
	Path string `json:"path,omitempty"`
}

func ConsumerDiagnostics

func ConsumerDiagnostics() []Diagnostic

ConsumerDiagnostics reports legacy metadata conflicts by names only.

type Document

type Document struct {
	// contains filtered or unexported fields
}

Document owns immutable original bytes. Accessors return independent copies. Runtime expansion must never be persisted as a Document.

func ApplyRawEdits

func ApplyRawEdits(d Document, edits Edits, assets AssetContext) (Document, error)

ApplyRawEdits is pure: it validates the complete resulting runtime view but returns only raw storage bytes. A semantic no-op returns the original bytes.

func ParseDocument

func ParseDocument(data []byte, physicalPath string, exists bool) (Document, error)

ParseDocument performs bounded strict parsing without converting numbers to float64. physicalPath/existence form part of the opaque revision used by future CAS writers.

func SeedDocument

func SeedDocument(physicalPath string) (Document, error)

SeedDocument adds schema metadata to an independent copy of the exact shipped template. It is an internal capability only, not a runtime fallback cutover.

func (Document) Bytes

func (d Document) Bytes() []byte

func (Document) Effective

func (d Document) Effective(assets AssetContext) (*Config, error)

Effective constructs an independent, expanded runtime value using historical defaults and tri-state semantics. Never marshal its result back to storage.

func (Document) Raw

func (d Document) Raw() map[string]json.RawMessage

func (Document) Revision

func (d Document) Revision() string

func (Document) SchemaVersion

func (d Document) SchemaVersion() int

func (Document) ValidateEditable

func (d Document) ValidateEditable() error

ValidateEditable rejects ambiguous known-field casing while preserving historical unambiguous case-insensitive reads. It also validates known settings structurally, treating environment placeholders as nonempty.

type EditRequest

type EditRequest struct {
	Env            EnvSnapshot
	Assets         AssetContext
	ExpectRevision string
	Edits          Edits
}

type Edits

type Edits struct {
	Set    map[string]json.RawMessage `json:"set,omitempty"`
	Remove []string                   `json:"remove,omitempty"`
}

Edits contains supported leaf JSON pointers. Values remain raw JSON; null is a value, and removal is requested only through Remove.

type EnvSnapshot

type EnvSnapshot struct {
	GOOS    string
	Vars    map[string]string
	Lstat   func(string) (fs.FileInfo, error)
	ReadDir func(string) ([]fs.DirEntry, error)
	// Canonicalize resolves existing ancestors while preserving the final entry.
	Canonicalize func(string) (string, error)
	// contains filtered or unexported fields
}

EnvSnapshot contains only path-policy inputs; no product, cwd or asset root. Lstat and ReadDir are required injected read-only dependencies. Tests must not supply host filesystem functions for synthetic paths.

func SnapshotEnv

func SnapshotEnv() EnvSnapshot

SnapshotEnv captures path-policy environment once per invocation.

type Error

type Error struct {
	Code    Code
	Path    string
	Pointer string `json:"-"`
	Offset  int64
	// contains filtered or unexported fields
}

Error deliberately excludes underlying parser/OS messages and document values. Pointer is a JSON pointer; diagnostics intended for external use should omit it because unknown field names can themselves contain secrets.

func (*Error) Error

func (e *Error) Error() string

type HistoricalCandidate

type HistoricalCandidate struct {
	Path            string `json:"path"`
	BaselinePath    string `json:"baselinePath,omitempty"`
	BaselineSHA256  string `json:"baselineSHA256,omitempty"`
	TrustedBaseline []byte `json:"-"`
}

HistoricalCandidate is supplied by the composition root, never discovered by Resolve. TrustedBaseline must be from the candidate's verified exact version; nil means unknown and cannot authorize ignoring historical user settings.

type InitRequest

type InitRequest struct {
	Env    EnvSnapshot
	Assets AssetContext
	Legacy LegacyContext
	// From is an explicit raw import source, used only for an absent target.
	From string
}

type Inspection

type Inspection struct {
	Selection     Selection     `json:"selection"`
	Revision      string        `json:"revision,omitempty"`
	SchemaVersion int           `json:"schemaVersion,omitempty"`
	Valid         bool          `json:"valid"`
	ErrorCode     Code          `json:"errorCode,omitempty"`
	Settings      *SafeSettings `json:"settings,omitempty"`
}

Inspection is a deliberately restrictive diagnostic artifact. It never includes raw values, URLs, headers, payload fields or unknown property names. A failed parse is represented by its stable code, never its underlying text.

func InspectDocument

func InspectDocument(selection Selection, physicalPath string, data []byte) Inspection

InspectDocument validates a supplied snapshot without reading or writing files. Environment placeholders are treated as nonempty for structural validation; this diagnostic does not assert that runtime secrets are configured. physicalPath must be the canonical snapshot identity supplied by the FS adapter.

type LegacyContext

type LegacyContext struct{ Candidates []HistoricalCandidate }

type NotificationsConfig

type NotificationsConfig struct {
	Desktop                                     DesktopConfig    `json:"desktop"`
	Webhook                                     WebhookConfig    `json:"webhook"`
	SuppressQuestionAfterTaskCompleteSeconds    *int             `json:"suppressQuestionAfterTaskCompleteSeconds"`
	SuppressQuestionAfterAnyNotificationSeconds *int             `json:"suppressQuestionAfterAnyNotificationSeconds"`
	NotifyOnSubagentStop                        bool             `json:"notifyOnSubagentStop"`          // Send notifications when subagents (Task tool) complete, default: false. Requires suppressForSubagents=false to take effect.
	SuppressForSubagents                        *bool            `json:"suppressForSubagents"`          // Suppress subagent (SubagentStop) notifications, and Stop notifications whose transcript_path is a subagent/teammate transcript; default: true. Overrides notifyOnSubagentStop.
	NotifyOnTextResponse                        *bool            `json:"notifyOnTextResponse"`          // Send notifications for text-only responses (no tools), default: true
	RespectJudgeMode                            *bool            `json:"respectJudgeMode"`              // Honor CLAUDE_HOOK_JUDGE_MODE=true env var to suppress notifications, default: true
	SuppressFilters                             []SuppressFilter `json:"suppressFilters,omitempty"`     // Rules for suppressing notifications by status/branch/folder
	TeamMode                                    string           `json:"teamMode,omitempty"`            // Team mode: "always" (no suppression, default), "wait-all" (suppress lead, notify when all idle), "never" (silent in team mode)
	NotifyOnlyWhenUnfocused                     *bool            `json:"notifyOnlyWhenUnfocused"`       // Suppress desktop notifications while the terminal window running Claude Code has OS focus, default: false
	NotifyDelaySeconds                          *int             `json:"notifyDelaySeconds"`            // Wait N seconds before delivering a desktop notification (paired with notifyOnlyWhenUnfocused, it re-checks focus after the wait), default: 0
	RespectDoNotDisturb                         *string          `json:"respectDoNotDisturb,omitempty"` // How to treat the desktop's Do Not Disturb state: "off" (default), "silent" (deliver the banner, skip the sound), "suppress" (skip the notification entirely)
	RespectDisplaySleep                         *bool            `json:"respectDisplaySleep"`           // Skip the plugin's own sound while every display is asleep (macOS only), default: false
}

NotificationsConfig represents notification settings

type PrepareGlobalResult added in v1.44.0

type PrepareGlobalResult struct {
	Source         string
	Changed, Ready bool
}

PrepareGlobalResult contains provenance, never configuration contents. Source is canonical, legacy, or defaults. Ready requires persisted validation.

func PrepareGlobalConfig added in v1.44.0

func PrepareGlobalConfig(ctx context.Context, canonicalPath, legacyPath, defaultsPath string) (result PrepareGlobalResult, err error)

PrepareGlobalConfig explicitly prepares mutable user configuration, outside component/journal transactions and asset ledgers. Changed JSON may be reformatted; complete canonical bytes are never rewritten. Cooperating writers use canonicalPath+".lock", a permanent config-only lock. The final preimage check cannot fence a noncooperating writer after that check.

type RateLimitConfig

type RateLimitConfig struct {
	Enabled           bool `json:"enabled"`
	RequestsPerMinute int  `json:"requestsPerMinute"`
}

RateLimitConfig represents rate limiting settings

type ReadRequest

type ReadRequest struct {
	Env          EnvSnapshot
	Assets       AssetContext
	Legacy       LegacyContext
	ReadSnapshot func(path string, limit int) (Snapshot, error)
}

type Result

type Result struct {
	Selection  Selection `json:"selection"`
	Revision   string    `json:"revision,omitempty"`
	Changed    bool      `json:"changed"`
	BackupPath string    `json:"backupPath,omitempty"`
}

Result contains only safe metadata. Changed with ConfigCommitUncertain means a commit may be visible; inspect before deciding whether to retry.

func ApplyEdits

func ApplyEdits(ctx context.Context, r EditRequest) (Result, error)

func EnsureInitialized

func EnsureInitialized(ctx context.Context, r InitRequest) (Result, error)

type RetryConfig

type RetryConfig struct {
	Enabled        bool   `json:"enabled"`
	MaxAttempts    int    `json:"maxAttempts"`
	InitialBackoff string `json:"initialBackoff"` // e.g. "1s"
	MaxBackoff     string `json:"maxBackoff"`     // e.g. "10s"
}

RetryConfig represents retry settings

type SafeSettings

type SafeSettings struct {
	DesktopEnabled bool                  `json:"desktopEnabled"`
	DesktopSound   bool                  `json:"desktopSound"`
	Volume         float64               `json:"volume"`
	Statuses       map[string]SafeStatus `json:"statuses"`
}

SafeSettings is a numeric/boolean allowlist for a future wizard. Free-form strings and unknown status names are intentionally excluded from diagnostics.

type SafeStatus

type SafeStatus struct {
	Enabled        *bool `json:"enabled"`
	DesktopEnabled *bool `json:"desktopEnabled"`
	WebhookEnabled *bool `json:"webhookEnabled"`
}

type Selection

type Selection struct {
	Path        string       `json:"path"`
	Source      string       `json:"source"`
	Exists      bool         `json:"exists"`
	Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
}

func Resolve

func Resolve(e EnvSnapshot) (Selection, error)

Resolve selects exactly one entry without reading contents or creating files. FreshNeutral selects the creation policy; existing L/N and explicit E use the same shared selection contract in the bridge and final builds.

type Snapshot

type Snapshot struct {
	Bytes        []byte
	PhysicalPath string
}

Snapshot is a single regular-file read and its physical identity. Adapters must enforce limit before allocation and reject nonregular/dangling entries.

func ReadFileSnapshot

func ReadFileSnapshot(path string, limit int) (Snapshot, error)

ReadFileSnapshot reads a single regular-file inode. Atomic POSIX publication means cooperating writers cannot expose partially written JSON.

type StatusChannelConfig

type StatusChannelConfig struct {
	Enabled *bool `json:"enabled,omitempty"` // nil = inherit default enabled behavior
}

StatusChannelConfig represents per-channel status overrides.

type StatusInfo

type StatusInfo struct {
	Enabled *bool                `json:"enabled,omitempty"` // nil = true (default for backward compatibility)
	Desktop *StatusChannelConfig `json:"desktop,omitempty"`
	Webhook *StatusChannelConfig `json:"webhook,omitempty"`
	Title   string               `json:"title"`
	Sound   string               `json:"sound"`
}

StatusInfo represents configuration for a specific status

type SuppressFilter

type SuppressFilter struct {
	Name      string  `json:"name,omitempty"`
	Status    *string `json:"status,omitempty"`
	GitBranch *string `json:"gitBranch"` // no omitempty — nil means "any", "" means "no branch"
	Folder    *string `json:"folder,omitempty"`
}

SuppressFilter defines conditions for suppressing notifications. All specified (non-nil) fields must match for the filter to suppress. Omitted fields act as wildcards (match any value).

func (*SuppressFilter) HasConditions

func (f *SuppressFilter) HasConditions() bool

HasConditions returns true if the filter has at least one condition field set.

func (*SuppressFilter) Matches

func (f *SuppressFilter) Matches(status, gitBranch, folder string) bool

Matches returns true if all specified fields match the given values.

type UpdatePreflightRequest

type UpdatePreflightRequest struct {
	Env                  EnvSnapshot           `json:"-"`
	Assets               AssetContext          `json:"-"`
	ActiveBundleRoots    []string              `json:"activeBundleRoots"`
	RefreshDirs          []string              `json:"refreshDirs"`
	ProtectedPaths       []string              `json:"protectedPaths"`
	HistoricalCandidates []HistoricalCandidate `json:"historicalCandidates"`
}

UpdatePreflightRequest contains adapter-supplied history, never resolver inputs. Baselines must come from release artifacts verified by the caller.

type UpdatePreflightResult

type UpdatePreflightResult struct {
	Status      string       `json:"status"`
	Selection   Selection    `json:"selection"`
	Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
}

func PreflightUpdate

PreflightUpdate is a snapshot, not a durable authorization for later deletion. The caller must repeat it immediately before destructive refresh.

type WebhookConfig

type WebhookConfig struct {
	Enabled        bool                   `json:"enabled"`
	Preset         string                 `json:"preset"`
	URL            string                 `json:"url"`
	ChatID         string                 `json:"chat_id"`
	Format         string                 `json:"format"`
	Headers        map[string]string      `json:"headers"`
	PayloadFields  map[string]interface{} `json:"payloadFields,omitempty"`
	Retry          RetryConfig            `json:"retry"`
	CircuitBreaker CircuitBreakerConfig   `json:"circuitBreaker"`
	RateLimit      RateLimitConfig        `json:"rateLimit"`
}

WebhookConfig represents webhook settings

Jump to

Keyboard shortcuts

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