daemon

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: GPL-3.0 Imports: 29 Imported by: 0 modules, 0 packages

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

Documentation

Overview

Package daemon composes observation state, core attention, and device output.

Index

Constants

View Source
const ConfigDurabilityUncertainCode = "config_durability_uncertain"
View Source
const SessionEndFailedCode = "end_session_failed"

Variables

View Source
var (
	ErrObservationNotFound           = errors.New("observation was not found")
	ErrObservationNotAcknowledgeable = errors.New("observation does not require acknowledgement")
)
View Source
var ErrAppAlreadyExists = errors.New("app instance already exists")
View Source
var ErrAppNotEnabled = errors.New("app is not enabled")
View Source
var ErrAppNotFound = errors.New("app instance was not found")
View Source
var ErrAppNotReady = errors.New("app generation is not ready")
View Source
var ErrForegroundUnavailable = errors.New("interactive foreground is unavailable")
View Source
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 AssetController interface {
	Reconcile(context.Context, []assets.Package)
	CollectGarbage(context.Context, []assets.Package)
	ReadyFor(assets.Package) bool
	Status() []assets.State
}

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

func (a *ConfigStoreActivator) DesiredPlugin(ctx context.Context, pluginID string) (*config.Plugin, error)

type ConfigurationStore

type ConfigurationStore interface {
	Load() (config.Document, error)
	Update(uint64, func(*config.Document) error) (config.Document, localstate.CommitOutcome, error)
}

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 DesiredStateValidator func(config.Document) error

type DocumentSource

type DocumentSource interface {
	Document() (config.Document, bool)
}

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 (e *Engine) Acknowledge(id string) error

func (*Engine) AcknowledgeAttention

func (e *Engine) AcknowledgeAttention(id string) error

func (*Engine) AttentionExplain

func (e *Engine) AttentionExplain(id string) (attention.Evaluation, bool)

func (*Engine) AttentionHistory

func (e *Engine) AttentionHistory(limit int, since time.Time) []attention.Trace

func (*Engine) AttentionSnapshot

func (e *Engine) AttentionSnapshot() (attention.Trace, bool)

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

func (e *Engine) NextDeadline(now time.Time) time.Time

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

func (e *Engine) Reconcile(ctx context.Context) error

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 (e *Engine) RemoveInstance(pluginID, instanceID string, throughGeneration uint64)

func (*Engine) Run

func (e *Engine) Run(ctx context.Context) error

Run drains coalesced candidate changes and exact state-transition deadlines.

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.

func (*Engine) Step

func (e *Engine) Step(ctx context.Context, now time.Time) error

Step computes and applies one deterministic decision at now.

func (*Engine) Wake

func (e *Engine) Wake()

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.

func (Generations) Lookup

func (g Generations) Lookup(pluginID, instanceID string) (uint64, bool)

type InstanceCleaner

type InstanceCleaner interface {
	RemoveInstance(pluginID, instanceID string, throughGeneration uint64)
}

type LaunchableApp

type LaunchableApp struct {
	ID       string
	PluginID string
	Action   string
}

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

func (*LiveState) Document

func (s *LiveState) Document() (config.Document, bool)

func (*LiveState) Generation

func (s *LiveState) Generation(pluginID, instanceID string) (uint64, bool)

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

func (p *PackageOps) CatalogStatus(ctx context.Context, pluginID string) (installer.Snapshot, 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 (s *Reconciler) AttentionHistory(limit int, since time.Time) []attention.Trace

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) Close

func (s *Reconciler) Close(ctx context.Context) error

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

func (s *Reconciler) DesiredPlugin(_ context.Context, pluginID string) (*config.Plugin, error)

DesiredPlugin returns the exact current verified package configuration.

func (*Reconciler) Document

func (s *Reconciler) Document() (config.Document, bool)

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) Load

func (s *Reconciler) Load(ctx context.Context) error

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) Reconcile

func (s *Reconciler) Reconcile(ctx context.Context) error

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) Document

func (s *RuntimeStatus) Document() (config.Document, bool)

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

type SecretResolver interface {
	Resolve(context.Context, string) (string, error)
}

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) Detach

func (r *SessionRuntime) Detach(ctx context.Context, app config.App) 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()

Jump to

Keyboard shortcuts

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