Documentation
¶
Overview ¶
Package daemon composes observation state, core attention, and device output.
Index ¶
- Constants
- Variables
- type AppConfiguration
- type AppInstanceResult
- type AppReadiness
- type AppReadinessPhase
- type AssetController
- type AttentionController
- type AttentionStateDiagnostics
- type BackPresentation
- type CheckpointStore
- type Checkpoints
- type ConfigPersistenceStatus
- type ConfigStoreActivator
- type ConfigurationStore
- type DesiredState
- type DesiredStateValidator
- type DocumentSource
- type EnableResult
- type Engine
- func (e *Engine) Acknowledge(id string) error
- func (e *Engine) AcknowledgeAttention(id string) error
- func (e *Engine) AttentionExplain(id string) (attention.Evaluation, bool)
- func (e *Engine) AttentionHistory(limit int, since time.Time) []attention.Trace
- func (e *Engine) AttentionSnapshot() (attention.Trace, bool)
- func (e *Engine) AttentionStateStatus() AttentionStateDiagnostics
- func (e *Engine) CaptureBackPresentation() BackPresentation
- func (e *Engine) DismissForBack(ctx context.Context, captured BackPresentation, reason string) error
- func (e *Engine) InvalidateRenderedSelection()
- func (e *Engine) NextDeadline(now time.Time) time.Time
- func (e *Engine) ObservationDiagnostics() observation.StoreDiagnostics
- func (e *Engine) PresentationCooldownStatus() PresentationCooldownDiagnostics
- func (e *Engine) Reconcile(ctx context.Context) error
- func (e *Engine) ReconcileConsumedBack(ctx context.Context, captured BackPresentation, invalidate func()) error
- func (e *Engine) RecorderStatus() attention.RecorderStatus
- func (e *Engine) RemoveInstance(pluginID, instanceID string, throughGeneration uint64)
- func (e *Engine) Run(ctx context.Context) error
- func (e *Engine) SelectedObservation() (observation.Record, bool)
- func (e *Engine) Step(ctx context.Context, now time.Time) error
- func (e *Engine) Wake()
- type EngineOptions
- type ForegroundCoordinator
- type Generations
- type InstallerController
- type InstanceCleaner
- type LaunchableApp
- type LiveState
- type PackageOps
- func (p *PackageOps) CatalogInstall(ctx context.Context, request installer.InstallRequest, update bool) (installer.Result, error)
- func (p *PackageOps) CatalogRollback(ctx context.Context, request installer.RollbackRequest) (installer.Result, error)
- func (p *PackageOps) CatalogStatus(ctx context.Context, pluginID string) (installer.Snapshot, error)
- type PluginController
- type PolicyResolver
- type PresentationCooldownDiagnostics
- type Reconciler
- func (s *Reconciler) AcknowledgeAttention(id string) error
- func (s *Reconciler) AcquireCritical(ctx context.Context, candidate presentation.Candidate) bool
- func (s *Reconciler) ActivatePlugin(ctx context.Context, plugin config.Plugin) (localstate.CommitOutcome, error)
- func (s *Reconciler) ActivateSelected(ctx context.Context) (bool, error)
- func (s *Reconciler) AppReadiness() []AppReadiness
- func (s *Reconciler) AssetStatus() []assets.State
- func (s *Reconciler) AttentionConfigured() bool
- func (s *Reconciler) AttentionExplain(id string) (attention.Evaluation, bool)
- func (s *Reconciler) AttentionHistory(limit int, since time.Time) []attention.Trace
- func (s *Reconciler) AttentionRule(record observation.Record) (attention.Rule, bool)
- func (s *Reconciler) AttentionSnapshot() (attention.Trace, bool)
- func (s *Reconciler) AttentionStateStatus() AttentionStateDiagnostics
- func (s *Reconciler) BeginLauncherAdmission() (uint64, bool)
- func (s *Reconciler) ClearForeground(expected string)
- func (s *Reconciler) ClearForegroundContext(ctx context.Context, expected string)
- func (s *Reconciler) ClearForegroundSessionContext(ctx context.Context, expected, token string)
- func (s *Reconciler) Close(ctx context.Context) error
- func (s *Reconciler) CreateAppInstance(ctx context.Context, app config.App) (AppInstanceResult, error)
- func (s *Reconciler) CriticalPresentationOwned() bool
- func (s *Reconciler) DeleteAppInstance(ctx context.Context, appID string) (AppInstanceResult, error)
- func (s *Reconciler) DesiredPlugin(_ context.Context, pluginID string) (*config.Plugin, error)
- func (s *Reconciler) Document() (config.Document, bool)
- func (s *Reconciler) Foreground() string
- func (s *Reconciler) ForegroundSession() (string, string)
- func (s *Reconciler) ForegroundSessionRef() (protocol.InstanceRef, string)
- func (s *Reconciler) Generation(pluginID, instanceID string) (uint64, bool)
- func (s *Reconciler) Launch(ctx context.Context, appID, action string, payload json.RawMessage) error
- func (s *Reconciler) LaunchableApps() []LaunchableApp
- func (s *Reconciler) LauncherAdmissionCurrent(sequence uint64) bool
- func (s *Reconciler) Load(ctx context.Context) error
- func (s *Reconciler) ObservationDiagnostics() observation.StoreDiagnostics
- func (s *Reconciler) ObservationStatus() observation.StoreDiagnostics
- func (s *Reconciler) PluginOperation(ctx context.Context, appID string, kind protocol.OperationKind, ...) (protocol.OperationResult, error)
- func (s *Reconciler) PresentationCooldownStatus() PresentationCooldownDiagnostics
- func (s *Reconciler) Reconcile(ctx context.Context) error
- func (s *Reconciler) ReconcileAssets(ctx context.Context) error
- func (s *Reconciler) RecorderStatus() attention.RecorderStatus
- func (s *Reconciler) ReleaseCritical()
- func (s *Reconciler) ReplaceAppConfiguration(ctx context.Context, appID string, replacement AppConfiguration) (config.Document, localstate.CommitOutcome, error)
- func (s *Reconciler) SessionInputStatus() []eventbus.Status
- func (s *Reconciler) SetEnabled(ctx context.Context, appID string, enabled bool) (EnableResult, error)
- func (s *Reconciler) Status() []pluginhost.PluginStatus
- func (s *Reconciler) Wake()
- type ReconcilerOptions
- type ReconciliationPlan
- type Renderer
- type RuntimeDiagnostics
- type RuntimeStatus
- type RuntimeStatusOptions
- type SecretResolver
- type SessionChange
- type SessionCoordinator
- func (o *SessionCoordinator) BeginExecution(ctx context.Context, live *LiveState, pluginID string, ...) error
- func (o *SessionCoordinator) Diagnostics() SessionDiagnostics
- func (o *SessionCoordinator) PluginSessionCleanup(value pluginhost.SessionCleanup)
- func (o *SessionCoordinator) PluginSessionCompleted(live *LiveState, pluginID string, request protocol.CompleteSessionRequest)
- func (o *SessionCoordinator) PluginSessionInvalidated(value pluginhost.SessionInvalidation)
- type SessionDiagnostics
- type SessionInputController
- type SessionRuntime
- func (r *SessionRuntime) AcquireCritical(ctx context.Context, candidate presentation.Candidate) bool
- func (r *SessionRuntime) ApplyConfiguration(document config.Document)
- func (r *SessionRuntime) BeginLauncherAdmission() (uint64, bool)
- func (r *SessionRuntime) ClearForeground(ctx context.Context, expected string, expectedToken pluginhost.SessionToken) bool
- func (r *SessionRuntime) ClearForegroundContext(ctx context.Context, expected string)
- func (r *SessionRuntime) ClearForegroundSessionContext(ctx context.Context, expected, token string)
- func (r *SessionRuntime) CriticalPresentationOwned() bool
- func (r *SessionRuntime) Detach(ctx context.Context, app config.App) bool
- func (r *SessionRuntime) Diagnostics() SessionDiagnostics
- func (r *SessionRuntime) EndSession(ctx context.Context, termination sessionTermination) error
- func (r *SessionRuntime) Foreground() string
- func (r *SessionRuntime) ForegroundSession() (string, string)
- func (r *SessionRuntime) ForegroundSessionRef() (protocol.InstanceRef, string)
- func (r *SessionRuntime) InputStatus() []eventbus.Status
- func (r *SessionRuntime) LauncherAdmissionCurrent(sequence uint64) bool
- func (r *SessionRuntime) ReleaseCritical()
Constants ¶
const ConfigDurabilityUncertainCode = "config_durability_uncertain"
const SessionEndFailedCode = "end_session_failed"
Variables ¶
var ( ErrObservationNotFound = errors.New("observation was not found") ErrObservationNotAcknowledgeable = errors.New("observation does not require acknowledgement") )
var ErrAppAlreadyExists = errors.New("app instance already exists")
var ErrAppNotEnabled = errors.New("app is not enabled")
var ErrAppNotFound = errors.New("app instance was not found")
var ErrAppNotReady = errors.New("app generation is not ready")
var ErrInvalidAppConfiguration = errors.New("app configuration is invalid")
Functions ¶
This section is empty.
Types ¶
type AppConfiguration ¶
type AppConfiguration struct {
Config json.RawMessage
Secrets map[string]string
Policies map[string]presentation.PolicyConfig
LaunchAction string
}
AppConfiguration is the complete caller-supplied replacement for one app instance's configurable fields. Package identity and enablement remain daemon-owned.
type AppInstanceResult ¶
type AppInstanceResult struct {
config.Document
AppID string
PluginID string
Enabled bool
Outcome localstate.CommitOutcome
ReconciliationError error
}
AppInstanceResult reports the durable desired-state transaction separately from any live reconciliation work that remains daemon-owned.
type AppReadiness ¶
type AppReadiness struct {
AppID string `json:"app_id"`
PluginID string `json:"plugin_id"`
Phase AppReadinessPhase `json:"phase"`
Attempt int `json:"attempt"`
RetryAt time.Time `json:"retry_at,omitempty"`
LastErrorCode string `json:"last_error_code,omitempty"`
}
AppReadiness is safe to expose through the local control API. It deliberately omits secret references, values, resolver errors, accounts, and domains.
type AppReadinessPhase ¶
type AppReadinessPhase string
const ( AppDisabled AppReadinessPhase = "disabled" AppSecretPending AppReadinessPhase = "secret_pending" AppReconcilePending AppReadinessPhase = "reconcile_pending" AppReady AppReadinessPhase = "ready" )
type AssetController ¶
type AttentionController ¶
type AttentionController interface {
SelectedObservation() (observation.Record, bool)
AttentionSnapshot() (attention.Trace, bool)
AttentionExplain(string) (attention.Evaluation, bool)
AttentionHistory(int, time.Time) []attention.Trace
AcknowledgeAttention(string) error
Wake()
Reconcile(context.Context) error
RecorderStatus() attention.RecorderStatus
ObservationDiagnostics() observation.StoreDiagnostics
AttentionStateStatus() AttentionStateDiagnostics
PresentationCooldownStatus() PresentationCooldownDiagnostics
}
type AttentionStateDiagnostics ¶
type AttentionStateDiagnostics struct {
Phase string `json:"phase"`
LastErrorCode string `json:"last_error_code,omitempty"`
LastReadAt time.Time `json:"last_read_at,omitempty"`
LastWriteAt time.Time `json:"last_write_at,omitempty"`
Failures uint64 `json:"failures"`
RestoredEntries uint64 `json:"restored_entries"`
DiscardedEntries uint64 `json:"discarded_entries"`
PrunedEntries uint64 `json:"pruned_entries"`
LastShownEntries int `json:"last_shown_entries"`
AcknowledgementEntries int `json:"acknowledgement_entries"`
LastShownTTLPruned uint64 `json:"last_shown_ttl_pruned"`
LastShownCapacityEvictions uint64 `json:"last_shown_capacity_evictions"`
AcknowledgementTTLPruned uint64 `json:"acknowledgement_ttl_pruned"`
AcknowledgementCapacityEvictions uint64 `json:"acknowledgement_capacity_evictions"`
SupersededAcknowledgementsPruned uint64 `json:"superseded_acknowledgements_pruned"`
LastPrunedAt time.Time `json:"last_pruned_at,omitempty"`
}
AttentionStateDiagnostics exposes bounded identity-churn counters without observation content or identifiers.
type BackPresentation ¶
type BackPresentation struct {
// contains filtered or unexported fields
}
BackPresentation is an opaque lease for the exact presentation visible when a physical Back press was accepted. Callers may only return it to Engine.
type CheckpointStore ¶
type CheckpointStore interface {
Save(checkpoint.Key, json.RawMessage) (localstate.CommitOutcome, error)
Load(checkpoint.Key) (json.RawMessage, bool, error)
Reconcile([]checkpoint.Key) error
Status() checkpoint.Status
}
type Checkpoints ¶
type Checkpoints struct {
// contains filtered or unexported fields
}
Checkpoints serializes non-secret plugin checkpoint persistence. Admission always uses the exact active generation from LiveState.
func NewCheckpoints ¶
func NewCheckpoints(store CheckpointStore, live *LiveState) (*Checkpoints, error)
func (*Checkpoints) SaveCheckpoint ¶
func (c *Checkpoints) SaveCheckpoint(pluginID string, request protocol.CheckpointRequest) error
func (*Checkpoints) Status ¶
func (c *Checkpoints) Status() checkpoint.Status
type ConfigPersistenceStatus ¶
type ConfigPersistenceStatus struct {
LastErrorCode string `json:"last_error_code,omitempty"`
}
type ConfigStoreActivator ¶
type ConfigStoreActivator struct {
// contains filtered or unexported fields
}
ConfigStoreActivator is used only during installer recovery before the runtime Reconciler (and therefore any plugin child) is constructed.
func NewConfigStoreActivator ¶
func NewConfigStoreActivator(store ConfigurationStore) *ConfigStoreActivator
func (*ConfigStoreActivator) ActivatePlugin ¶
func (a *ConfigStoreActivator) ActivatePlugin(ctx context.Context, plugin config.Plugin) (localstate.CommitOutcome, error)
func (*ConfigStoreActivator) DesiredPlugin ¶
type ConfigurationStore ¶
type DesiredState ¶
type DesiredState struct {
// contains filtered or unexported fields
}
DesiredState owns durable configuration transactions, schema validation, and persistence health. It never starts plugins or performs device I/O.
func NewDesiredState ¶
func NewDesiredState(store ConfigurationStore, validator DesiredStateValidator) (*DesiredState, error)
func (*DesiredState) PersistenceStatus ¶
func (d *DesiredState) PersistenceStatus() ConfigPersistenceStatus
type DesiredStateValidator ¶
type DocumentSource ¶
type EnableResult ¶
type EnableResult struct {
config.Document
Changed bool
Outcome localstate.CommitOutcome
ReconciliationError error
}
EnableResult contains only facts from one enablement operation. Error is reserved for failures before commit; ReconciliationError reports work that remains daemon-owned after the returned document committed.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the small state machine between observations, core attention, and output.
func NewEngine ¶
func NewEngine(options EngineOptions) (*Engine, error)
func (*Engine) Acknowledge ¶
func (*Engine) AcknowledgeAttention ¶
func (*Engine) AttentionExplain ¶
func (e *Engine) AttentionExplain(id string) (attention.Evaluation, bool)
func (*Engine) AttentionHistory ¶
func (*Engine) AttentionStateStatus ¶
func (e *Engine) AttentionStateStatus() AttentionStateDiagnostics
func (*Engine) CaptureBackPresentation ¶
func (e *Engine) CaptureBackPresentation() BackPresentation
CaptureBackPresentation binds a Back callback to the exact physical-delivery claim that existed before the plugin callback began.
func (*Engine) DismissForBack ¶
func (e *Engine) DismissForBack(ctx context.Context, captured BackPresentation, reason string) error
DismissForBack starts the process-local presentation gate and tombstones the captured revision. It never clears a presentation that took ownership while the plugin callback was pending.
func (*Engine) InvalidateRenderedSelection ¶
func (e *Engine) InvalidateRenderedSelection()
InvalidateRenderedSelection forgets only the physical-delivery claim. The selected identity and attention history remain intact so reconciliation can redraw the same revision after firmware closes the HTTP canvas.
func (*Engine) NextDeadline ¶
NextDeadline returns the earliest known time at which eligibility or a hold can change without a new publication.
func (*Engine) ObservationDiagnostics ¶
func (e *Engine) ObservationDiagnostics() observation.StoreDiagnostics
func (*Engine) PresentationCooldownStatus ¶
func (e *Engine) PresentationCooldownStatus() PresentationCooldownDiagnostics
func (*Engine) Reconcile ¶
Reconcile synchronously applies the latest attention decision. Lifecycle transactions use it to establish display ordering before removing assets.
func (*Engine) ReconcileConsumedBack ¶
func (e *Engine) ReconcileConsumedBack(ctx context.Context, captured BackPresentation, invalidate func()) error
ReconcileConsumedBack invalidates and redraws only when the captured presentation still owns the canvas. A newer presentation is left untouched.
func (*Engine) RecorderStatus ¶
func (e *Engine) RecorderStatus() attention.RecorderStatus
func (*Engine) RemoveInstance ¶
func (*Engine) SelectedObservation ¶
func (e *Engine) SelectedObservation() (observation.Record, bool)
SelectedObservation returns only the exact observation revision that was successfully rendered. A newer unpublished revision fails closed until the renderer applies it.
type EngineOptions ¶
type EngineOptions struct {
Store *observation.Store
Resolve attention.Resolver
Renderer Renderer
Foreground ForegroundCoordinator
StateStore attentionStatePersistence
Generation observation.Generation
Recorder *attention.Recorder
Retry time.Duration
}
type ForegroundCoordinator ¶
type ForegroundCoordinator interface {
AcquireCritical(context.Context, presentation.Candidate) bool
ReleaseCritical()
}
type Generations ¶
type Generations struct {
// contains filtered or unexported fields
}
Generations is an immutable lookup used to reject publications from stale app configurations.
type InstallerController ¶
type InstallerController interface {
InstallFirst(context.Context, installer.InstallRequest) (installer.Result, error)
Update(context.Context, installer.InstallRequest) (installer.Result, error)
Rollback(context.Context, installer.RollbackRequest) (installer.Result, error)
Snapshot(context.Context, string) (installer.Snapshot, error)
}
type InstanceCleaner ¶
type LaunchableApp ¶
type LiveState ¶
type LiveState struct {
// contains filtered or unexported fields
}
LiveState owns the in-memory snapshot accepted by reconciliation and the revision metadata that makes stale asynchronous work unable to win. It does not perform persistence, plugin, asset, or device I/O.
func NewLiveState ¶
func NewLiveState() *LiveState
func (*LiveState) AppReadiness ¶
func (s *LiveState) AppReadiness() []AppReadiness
type PackageOps ¶
type PackageOps struct {
// contains filtered or unexported fields
}
PackageOps serializes catalog mutations and enriches installer state with the current desired configuration. It owns no plugin runtime state.
func NewPackageOps ¶
func NewPackageOps(installerController InstallerController, documents DocumentSource) (*PackageOps, error)
func (*PackageOps) CatalogInstall ¶
func (p *PackageOps) CatalogInstall(ctx context.Context, request installer.InstallRequest, update bool) (installer.Result, error)
func (*PackageOps) CatalogRollback ¶
func (p *PackageOps) CatalogRollback(ctx context.Context, request installer.RollbackRequest) (installer.Result, error)
func (*PackageOps) CatalogStatus ¶
type PluginController ¶
type PluginController interface {
Apply(context.Context, []pluginhost.Spec) error
Operation(context.Context, string, protocol.OperationRequest) (protocol.OperationResult, error)
Invoke(context.Context, string, pluginhost.InvokeRequest, pluginhost.InvocationKind, pluginhost.SessionToken) error
EndSession(context.Context, string, protocol.InstanceRef, pluginhost.SessionToken) error
Status() []pluginhost.PluginStatus
Close(context.Context) error
}
type PolicyResolver ¶
type PolicyResolver struct {
// contains filtered or unexported fields
}
PolicyResolver translates authenticated observations and current daemon state into core-owned attention policy.
func NewPolicyResolver ¶
func NewPolicyResolver(live *LiveState, sessions *SessionCoordinator, assets assetReadiness) (*PolicyResolver, error)
func (*PolicyResolver) Resolve ¶
func (r *PolicyResolver) Resolve(record observation.Record) (attention.Rule, bool)
type PresentationCooldownDiagnostics ¶
type PresentationCooldownDiagnostics struct {
Active bool `json:"active"`
Until time.Time `json:"until,omitzero"`
RemainingMS int64 `json:"remaining_ms,omitzero"`
Reason string `json:"reason,omitempty"`
}
PresentationCooldownDiagnostics reports only the process-local suppression gate and a stable reason. It never includes observation or provider content.
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler moves durable desired state toward live plugin state.
func NewReconciler ¶
func NewReconciler(options ReconcilerOptions) (*Reconciler, error)
func (*Reconciler) AcknowledgeAttention ¶
func (s *Reconciler) AcknowledgeAttention(id string) error
func (*Reconciler) AcquireCritical ¶
func (s *Reconciler) AcquireCritical(ctx context.Context, candidate presentation.Candidate) bool
AcquireCritical revokes non-atomic foreground ownership before a critical actionable observation reaches the physical renderer.
func (*Reconciler) ActivatePlugin ¶
func (s *Reconciler) ActivatePlugin(ctx context.Context, plugin config.Plugin) (localstate.CommitOutcome, error)
ActivatePlugin atomically changes only one verified package and reconciles app instances against the committed desired state.
func (*Reconciler) ActivateSelected ¶
func (s *Reconciler) ActivateSelected(ctx context.Context) (bool, error)
ActivateSelected launches only the exact observation revision that the attention engine successfully rendered and only when its channel declares a generic activation action.
func (*Reconciler) AppReadiness ¶
func (s *Reconciler) AppReadiness() []AppReadiness
func (*Reconciler) AssetStatus ¶
func (s *Reconciler) AssetStatus() []assets.State
func (*Reconciler) AttentionConfigured ¶
func (s *Reconciler) AttentionConfigured() bool
func (*Reconciler) AttentionExplain ¶
func (s *Reconciler) AttentionExplain(id string) (attention.Evaluation, bool)
func (*Reconciler) AttentionHistory ¶
func (*Reconciler) AttentionRule ¶
func (s *Reconciler) AttentionRule(record observation.Record) (attention.Rule, bool)
func (*Reconciler) AttentionSnapshot ¶
func (s *Reconciler) AttentionSnapshot() (attention.Trace, bool)
func (*Reconciler) AttentionStateStatus ¶
func (s *Reconciler) AttentionStateStatus() AttentionStateDiagnostics
func (*Reconciler) BeginLauncherAdmission ¶
func (s *Reconciler) BeginLauncherAdmission() (uint64, bool)
func (*Reconciler) ClearForeground ¶
func (s *Reconciler) ClearForeground(expected string)
ClearForeground cancels the active session. When expected is non-empty it only clears that exact instance, which makes broker-overrun handling race-safe.
func (*Reconciler) ClearForegroundContext ¶
func (s *Reconciler) ClearForegroundContext(ctx context.Context, expected string)
func (*Reconciler) ClearForegroundSessionContext ¶
func (s *Reconciler) ClearForegroundSessionContext(ctx context.Context, expected, token string)
ClearForegroundSessionContext invalidates only the exact foreground token.
func (*Reconciler) CreateAppInstance ¶
func (s *Reconciler) CreateAppInstance(ctx context.Context, app config.App) (AppInstanceResult, error)
CreateAppInstance atomically adds one complete app definition and reconciles the exact committed generation. Plugin package metadata remains immutable.
func (*Reconciler) CriticalPresentationOwned ¶
func (s *Reconciler) CriticalPresentationOwned() bool
func (*Reconciler) DeleteAppInstance ¶
func (s *Reconciler) DeleteAppInstance(ctx context.Context, appID string) (AppInstanceResult, error)
DeleteAppInstance atomically removes one app definition, reconciles child configuration, and drops retained per-instance runtime state.
func (*Reconciler) DesiredPlugin ¶
DesiredPlugin returns the exact current verified package configuration.
func (*Reconciler) Foreground ¶
func (s *Reconciler) Foreground() string
func (*Reconciler) ForegroundSession ¶
func (s *Reconciler) ForegroundSession() (string, string)
func (*Reconciler) ForegroundSessionRef ¶
func (s *Reconciler) ForegroundSessionRef() (protocol.InstanceRef, string)
func (*Reconciler) Generation ¶
func (s *Reconciler) Generation(pluginID, instanceID string) (uint64, bool)
func (*Reconciler) Launch ¶
func (s *Reconciler) Launch(ctx context.Context, appID, action string, payload json.RawMessage) error
func (*Reconciler) LaunchableApps ¶
func (s *Reconciler) LaunchableApps() []LaunchableApp
LaunchableApps returns ready interactive app instances with an explicit launcher action.
func (*Reconciler) LauncherAdmissionCurrent ¶
func (s *Reconciler) LauncherAdmissionCurrent(sequence uint64) bool
func (*Reconciler) ObservationDiagnostics ¶
func (s *Reconciler) ObservationDiagnostics() observation.StoreDiagnostics
func (*Reconciler) ObservationStatus ¶
func (s *Reconciler) ObservationStatus() observation.StoreDiagnostics
func (*Reconciler) PluginOperation ¶
func (s *Reconciler) PluginOperation(ctx context.Context, appID string, kind protocol.OperationKind, operation string, payload json.RawMessage) (protocol.OperationResult, error)
func (*Reconciler) PresentationCooldownStatus ¶
func (s *Reconciler) PresentationCooldownStatus() PresentationCooldownDiagnostics
func (*Reconciler) ReconcileAssets ¶
func (s *Reconciler) ReconcileAssets(ctx context.Context) error
ReconcileAssets retries desired asset state and starts newly ready children.
func (*Reconciler) RecorderStatus ¶
func (s *Reconciler) RecorderStatus() attention.RecorderStatus
func (*Reconciler) ReleaseCritical ¶
func (s *Reconciler) ReleaseCritical()
func (*Reconciler) ReplaceAppConfiguration ¶
func (s *Reconciler) ReplaceAppConfiguration(ctx context.Context, appID string, replacement AppConfiguration) (config.Document, localstate.CommitOutcome, error)
ReplaceAppConfiguration atomically replaces all configurable fields for one app and reconciles the exact committed generation.
func (*Reconciler) SessionInputStatus ¶
func (s *Reconciler) SessionInputStatus() []eventbus.Status
func (*Reconciler) SetEnabled ¶
func (s *Reconciler) SetEnabled(ctx context.Context, appID string, enabled bool) (EnableResult, error)
func (*Reconciler) Status ¶
func (s *Reconciler) Status() []pluginhost.PluginStatus
func (*Reconciler) Wake ¶
func (s *Reconciler) Wake()
type ReconcilerOptions ¶
type ReconcilerOptions struct {
Desired *DesiredState
Live *LiveState
Sessions *SessionRuntime
Policy *PolicyResolver
Checkpoints *Checkpoints
Resolver SecretResolver
Plugins PluginController
Attention AttentionController
Assets AssetController
RetryDelay func(int) time.Duration
}
type ReconciliationPlan ¶
type ReconciliationPlan struct {
Specs []pluginhost.Spec
Generations Generations
Readiness []AppReadiness
}
ReconciliationPlan is the structurally valid, currently runnable subset of desired state. Enabled apps whose secrets are unavailable are represented in Readiness but intentionally absent from Specs and Generations.
type Renderer ¶
type Renderer interface {
Render(context.Context, *presentation.Candidate) (attention.DeliveryOutcome, error)
}
Renderer owns the serialized physical display boundary. Successful candidate renders return drawn, unchanged, or firmware suppression; successful clears return cleared or unchanged. Failure outcomes always accompany an error.
type RuntimeDiagnostics ¶
type RuntimeDiagnostics struct {
Assets []assets.State
SessionInput []eventbus.Status
Input busyinput.DispatcherStatus
Readiness []AppReadiness
Device device.RuntimeStatus
Output device.OutputStatus
Audio device.AudioStatus
AttentionRecorder attention.RecorderStatus
AttentionState AttentionStateDiagnostics
PresentationCooldown PresentationCooldownDiagnostics
PluginLogs pluginlog.Status
Observations observation.StoreDiagnostics
Configuration ConfigPersistenceStatus
Checkpoints checkpoint.Status
Session SessionDiagnostics
}
RuntimeDiagnostics is the redacted health snapshot exposed to the local control plane. RuntimeStatus assembles it without owning mutable runtime truth.
type RuntimeStatus ¶
type RuntimeStatus struct {
// contains filtered or unexported fields
}
RuntimeStatus is a read-only control adapter over the runtime owners.
func NewRuntimeStatus ¶
func NewRuntimeStatus(options RuntimeStatusOptions) (*RuntimeStatus, error)
func (*RuntimeStatus) RuntimeDiagnostics ¶
func (s *RuntimeStatus) RuntimeDiagnostics() RuntimeDiagnostics
func (*RuntimeStatus) Status ¶
func (s *RuntimeStatus) Status() []pluginhost.PluginStatus
type RuntimeStatusOptions ¶
type RuntimeStatusOptions struct {
Live liveDiagnostics
Plugins pluginDiagnostics
Assets assetDiagnostics
Sessions sessionDiagnostics
Attention attentionDiagnostics
Configuration configurationDiagnostics
Checkpoints checkpointDiagnostics
Input inputDiagnostics
Device deviceDiagnostics
Output outputDiagnostics
Audio audioDiagnostics
Logs logDiagnostics
}
RuntimeStatusOptions names the read-only view of each runtime owner.
type SecretResolver ¶
SecretResolver turns a durable opaque reference into a value delivered only over the private inherited plugin socket.
type SessionChange ¶
type SessionChange struct {
// contains filtered or unexported fields
}
SessionChange transfers one admitted lifecycle transition to the session input broker without coupling plugin callbacks to broker construction.
func (SessionChange) Apply ¶
func (c SessionChange) Apply(inputs SessionInputController)
type SessionCoordinator ¶
type SessionCoordinator struct {
// contains filtered or unexported fields
}
func NewSessionCoordinator ¶
func NewSessionCoordinator(change func(SessionChange)) *SessionCoordinator
func (*SessionCoordinator) BeginExecution ¶
func (o *SessionCoordinator) BeginExecution(ctx context.Context, live *LiveState, pluginID string, request protocol.SessionExecutionRequest) error
func (*SessionCoordinator) Diagnostics ¶
func (o *SessionCoordinator) Diagnostics() SessionDiagnostics
func (*SessionCoordinator) PluginSessionCleanup ¶
func (o *SessionCoordinator) PluginSessionCleanup(value pluginhost.SessionCleanup)
PluginSessionCleanup records authenticated supervisor cleanup state.
func (*SessionCoordinator) PluginSessionCompleted ¶
func (o *SessionCoordinator) PluginSessionCompleted(live *LiveState, pluginID string, request protocol.CompleteSessionRequest)
func (*SessionCoordinator) PluginSessionInvalidated ¶
func (o *SessionCoordinator) PluginSessionInvalidated(value pluginhost.SessionInvalidation)
type SessionDiagnostics ¶
type SessionDiagnostics struct {
ActiveInstanceID string `json:"active_instance_id,omitempty"`
State string `json:"state"`
LastLifecycleErrorCode string `json:"last_lifecycle_error_code,omitempty"`
LastLifecycleErrorAt time.Time `json:"last_lifecycle_error_at,omitempty"`
}
func (SessionDiagnostics) MarshalJSON ¶
func (s SessionDiagnostics) MarshalJSON() ([]byte, error)
type SessionInputController ¶
type SessionInputController interface {
Apply([]eventbus.TargetSet)
Cancel(string, protocol.InstanceRef, string)
Complete(string, protocol.InstanceRef, string)
Status() []eventbus.Status
}
SessionInputController owns the exact instance-to-plugin input routing plan for the currently accepted configuration generation.
type SessionRuntime ¶
type SessionRuntime struct {
// contains filtered or unexported fields
}
SessionRuntime couples session state to the two effects required by terminal transitions: retiring queued input and ending the exact plugin session.
func NewSessionRuntime ¶
func NewSessionRuntime(state *SessionCoordinator, plugins sessionPluginController, inputs SessionInputController, invalidate sessionContextInvalidator) (*SessionRuntime, error)
func (*SessionRuntime) AcquireCritical ¶
func (r *SessionRuntime) AcquireCritical(ctx context.Context, candidate presentation.Candidate) bool
func (*SessionRuntime) ApplyConfiguration ¶
func (r *SessionRuntime) ApplyConfiguration(document config.Document)
func (*SessionRuntime) BeginLauncherAdmission ¶
func (r *SessionRuntime) BeginLauncherAdmission() (uint64, bool)
func (*SessionRuntime) ClearForeground ¶
func (r *SessionRuntime) ClearForeground(ctx context.Context, expected string, expectedToken pluginhost.SessionToken) bool
func (*SessionRuntime) ClearForegroundContext ¶
func (r *SessionRuntime) ClearForegroundContext(ctx context.Context, expected string)
func (*SessionRuntime) ClearForegroundSessionContext ¶
func (r *SessionRuntime) ClearForegroundSessionContext(ctx context.Context, expected, token string)
func (*SessionRuntime) CriticalPresentationOwned ¶
func (r *SessionRuntime) CriticalPresentationOwned() bool
func (*SessionRuntime) Diagnostics ¶
func (r *SessionRuntime) Diagnostics() SessionDiagnostics
func (*SessionRuntime) EndSession ¶
func (r *SessionRuntime) EndSession(ctx context.Context, termination sessionTermination) error
func (*SessionRuntime) Foreground ¶
func (r *SessionRuntime) Foreground() string
func (*SessionRuntime) ForegroundSession ¶
func (r *SessionRuntime) ForegroundSession() (string, string)
func (*SessionRuntime) ForegroundSessionRef ¶
func (r *SessionRuntime) ForegroundSessionRef() (protocol.InstanceRef, string)
func (*SessionRuntime) InputStatus ¶
func (r *SessionRuntime) InputStatus() []eventbus.Status
func (*SessionRuntime) LauncherAdmissionCurrent ¶
func (r *SessionRuntime) LauncherAdmissionCurrent(sequence uint64) bool
func (*SessionRuntime) ReleaseCritical ¶
func (r *SessionRuntime) ReleaseCritical()
Source Files
¶
- activator.go
- app_retirements.go
- attention_state.go
- checkpoints.go
- config.go
- desired_state.go
- engine.go
- live_state.go
- package_ops.go
- policy_resolver.go
- reconciler.go
- reconciler_apply.go
- reconciler_assets.go
- reconciler_close.go
- reconciler_desired.go
- reconciler_helpers.go
- reconciler_operations.go
- reconciler_retry.go
- reconciler_sessions.go
- reconciler_status.go
- runtime_status.go
- session_owner.go
- session_runtime.go