Documentation
¶
Index ¶
- Constants
- Variables
- func CheckHistorical(legacy LegacyContext, read func(string, int) (Snapshot, error)) error
- func ConsumerContext(pluginRoot string) (AssetContext, LegacyContext)
- func GetStableConfigDir() (string, error)
- func GetStableConfigPath() (string, error)
- func InspectGlobalConfig(ctx context.Context, paths ...string) ([]byte, error)
- func OpenCodeWebhookLookup(lookup func(string) (string, bool)) func(string) (string, bool)
- func PrepareGlobalConfigParent(path string) error
- func ReadDocument(r ReadRequest) (Document, *Config, error)
- func ReadDocumentSelection(r ReadRequest) (Document, *Config, Selection, error)
- func ValidateGlobalDesktop(raw []byte) (enabled, sound, clickToFocus bool, err error)
- type AgentID
- type AssetContext
- type CircuitBreakerConfig
- type Code
- type Config
- func DefaultConfig() *Config
- func Load(path string) (*Config, error)
- func LoadForAgent(pluginRoot string, agent AgentID) (*Config, error)
- func LoadForAgentQuiet(pluginRoot string, agent AgentID) (*Config, error)
- func LoadFromPluginRoot(pluginRoot string) (*Config, error)
- func LoadFromPluginRootQuiet(pluginRoot string) (*Config, error)
- func (c *Config) ApplyDefaults()
- func (c *Config) GetDoNotDisturbMode() string
- func (c *Config) GetNotifyDelaySeconds() int
- func (c *Config) GetStatusInfo(status string) (StatusInfo, bool)
- func (c *Config) GetSuppressQuestionAfterAnyNotificationSeconds() int
- func (c *Config) GetSuppressQuestionAfterTaskCompleteSeconds() int
- func (c *Config) GetTeamMode() string
- func (c *Config) IsAnyNotificationEnabled() bool
- func (c *Config) IsBenchmarkEnabled() bool
- func (c *Config) IsDesktopEnabled() bool
- func (c *Config) IsSessionLabelEnabled() bool
- func (c *Config) IsStatusDesktopEnabled(status string) bool
- func (c *Config) IsStatusEnabled(status string) bool
- func (c *Config) IsStatusWebhookEnabled(status string) bool
- func (c *Config) IsTerminalBellEnabled() bool
- func (c *Config) IsWebhookEnabled() bool
- func (c *Config) ShouldFilter(status, gitBranch, folder string) bool
- func (c *Config) ShouldNotifyOnTextResponse() bool
- func (c *Config) ShouldNotifyOnlyWhenUnfocused() bool
- func (c *Config) ShouldReplaceNotificationsPerSession() bool
- func (c *Config) ShouldRespectDisplaySleep() bool
- func (c *Config) ShouldRespectJudgeMode() bool
- func (c *Config) ShouldSuppressForSubagents() bool
- func (c *Config) Validate() error
- type DebugConfig
- type DesktopConfig
- type Diagnostic
- type Document
- type EditRequest
- type Edits
- type EnvSnapshot
- type Error
- type HistoricalCandidate
- type InitRequest
- type Inspection
- type LegacyContext
- type ManagedOpenCodeDocument
- type NotificationsConfig
- type PrepareGlobalResult
- type RateLimitConfig
- type ReadRequest
- type Result
- type RetryConfig
- type SafeSettings
- type SafeStatus
- type Selection
- type Snapshot
- type StatusChannelConfig
- type StatusInfo
- type SuppressFilter
- type UpdatePreflightRequest
- type UpdatePreflightResult
- type WebhookConfig
Constants ¶
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.
const FreshNeutral = true
FreshNeutral is the shared rollout build policy; bridge artifacts set false.
const MaxDocumentBytes = 4 << 20
const MaxDocumentDepth = 128
const MutationTimeout = 5 * time.Second
const OpenCodeWebhookURLEnv = "AGENT_NOTIFICATIONS_WEBHOOK_URL"
const OverrideEnv = "AGENT_NOTIFICATIONS_CONFIG"
Variables ¶
var ConsumerVersion = "1.48.4"
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 ¶
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 ¶
GetStableConfigDir returns the stable config directory outside the plugin cache. This directory survives plugin updates (bootstrap.sh rm -rf of cache).
func GetStableConfigPath ¶
GetStableConfigPath returns the stable config file path outside the plugin cache.
func InspectGlobalConfig ¶ added in v1.44.0
InspectGlobalConfig returns the exact strict preparation candidate without creating parents or locks. PrepareGlobalConfig rechecks the sources on commit.
func OpenCodeWebhookLookup ¶ added in v1.48.0
OpenCodeWebhookLookup excludes all ambient values except the event-only URL.
func PrepareGlobalConfigParent ¶ added in v1.45.3
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
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" AgentGemini AgentID = "gemini" AgentCopilotVSCode AgentID = "copilot-vscode" AgentCursor AgentID = "cursor" AssetRootPlaceholder = "AGENT_NOTIFICATIONS_ROOT" LegacyAssetRootPlaceholder = "CLAUDE_PLUGIN_ROOT" )
type AssetContext ¶
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" 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" )
const ConfigOpenCodeWebhookEnvUnsupported Code = "ConfigOpenCodeWebhookEnvUnsupported"
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 LoadFromPluginRoot ¶
LoadFromPluginRoot reads the shared canonical Store. Bundle paths are resources and historical evidence only; selected errors never fall back.
func LoadFromPluginRootQuiet ¶
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
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 ¶
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 ¶
GetSuppressQuestionAfterAnyNotificationSeconds returns the cooldown in seconds after any notification before question notifications are allowed (default: 7).
func (*Config) GetSuppressQuestionAfterTaskCompleteSeconds ¶
GetSuppressQuestionAfterTaskCompleteSeconds returns the cooldown in seconds after task completion before question notifications are allowed (default: 12)
func (*Config) GetTeamMode ¶
GetTeamMode returns the team notification mode: "always" (default), "wait-all", or "never"
func (*Config) IsAnyNotificationEnabled ¶
IsAnyNotificationEnabled returns true if at least one notification method is enabled
func (*Config) IsBenchmarkEnabled ¶
IsBenchmarkEnabled returns true if benchmark timing is enabled via config
func (*Config) IsDesktopEnabled ¶
IsDesktopEnabled returns true if desktop notifications are enabled
func (*Config) IsSessionLabelEnabled ¶
IsSessionLabelEnabled returns true if the session label should be appended to the notification title (default: true)
func (*Config) IsStatusDesktopEnabled ¶
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 ¶
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 ¶
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 ¶
IsTerminalBellEnabled returns true if terminal bell (BEL) should be sent (default: true)
func (*Config) IsWebhookEnabled ¶
IsWebhookEnabled returns true if webhook notifications are enabled
func (*Config) ShouldFilter ¶
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 ¶
ShouldNotifyOnTextResponse returns true if notifications should be sent for text-only responses (default: true)
func (*Config) ShouldNotifyOnlyWhenUnfocused ¶
ShouldNotifyOnlyWhenUnfocused returns true if desktop notifications should be suppressed while the terminal window running Claude Code currently has OS focus (default: false).
func (*Config) ShouldReplaceNotificationsPerSession ¶ added in v1.48.4
ShouldReplaceNotificationsPerSession returns true if a newer desktop notification from the same session should replace that session's previous banner instead of stacking a new one (default: false). macOS only; other delivery paths always stack.
func (*Config) ShouldRespectDisplaySleep ¶ added in v1.45.17
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 ¶
ShouldRespectJudgeMode returns true if CLAUDE_HOOK_JUDGE_MODE=true env var should suppress notifications (default: true)
func (*Config) ShouldSuppressForSubagents ¶
ShouldSuppressForSubagents returns true if notifications should be suppressed when transcript_path contains /subagents/ (default: true)
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 ¶
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 ¶
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 ¶
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) 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) SchemaVersion ¶
func (Document) ValidateEditable ¶
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.
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 ManagedOpenCodeDocument ¶ added in v1.48.0
type ManagedOpenCodeDocument struct {
Selection Selection
Document Document
Revision string
// contains filtered or unexported fields
}
ManagedOpenCodeDocument is an observation of the installed route, never a config path override. The opaque revision binds bytes, installation identity, generation and origin; updates require a new observation after setup changes.
func ReadManagedOpenCode ¶ added in v1.48.0
func ReadManagedOpenCode(ctx context.Context, root string, assets AssetContext) (ManagedOpenCodeDocument, error)
ReadManagedOpenCode uses the normal control location unless an operator selects an existing control root. Neither notification config nor event environment overrides are consulted. The installed, origin-bound registration must prove the exact executable/control-root route before a policy is exposed.
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
ReplaceNotificationsPerSession *bool `json:"replaceNotificationsPerSession"` // macOS: replace a session's previous banner with its newest desktop notification instead of stacking, default: false
}
NotificationsConfig represents notification settings
type PrepareGlobalResult ¶ added in v1.44.0
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 ApplyManagedOpenCodeEdits ¶ added in v1.48.0
func ApplyManagedOpenCodeEdits(ctx context.Context, root string, assets AssetContext, expect string, edits Edits) (Result, error)
ApplyManagedOpenCodeEdits is a Store-facing adapter: the existing raw editor validates supported config leaves; the existing managed transaction publishes the exact policy file, policy generation and ledger under its standard locks. Setup consent, origin and all unedited raw fields remain immutable here.
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 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 ¶
Snapshot is a single regular-file read and its physical identity. Adapters must enforce limit before allocation and reject nonregular/dangling entries.
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 ¶
func PreflightUpdate(r UpdatePreflightRequest) (UpdatePreflightResult, error)
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