Documentation
¶
Overview ¶
Package nativeapps prepares a private native graphical stack without changing system packages. Callers own user consent, authorization, and application launch.
Index ¶
- Constants
- Variables
- func CursorClientSource() []byte
- func DesktopFramesClientSource() []byte
- func DesktopSelfTest(ctx context.Context, root, architecture string) error
- func DialDesktop(ctx context.Context, endpoint DesktopEndpoint) (*DesktopConnection, DesktopState, error)
- func HostDesktopClientResource(name string) ([]byte, error)
- func HostDesktopSelfTest(parent context.Context, root, architecture string) error
- func PrepareInputClient(source, destination string) error
- func PrepareLoginScreenMedia(ctx context.Context, cache, output string, progress func(Status)) (string, error)
- func RunLoginScreenService(ctx context.Context, config LoginServiceConfig) error
- func SelfTest(parent context.Context, root string) (result error)
- func SystemClientInputPython(ctx context.Context, xpra string, environment []string) (string, error)
- func VerifyLoginServiceAdmission(ctx context.Context, path string, proof LoginServiceAdmissionProof) (string, error)
- func WriteApplicationLauncher(directory string) (string, error)
- func WriteBundle(ctx context.Context, pkg Package, cacheRoot string, output io.Writer, ...) error
- func WriteBundleWithOptions(ctx context.Context, pkg Package, cacheRoot string, output io.Writer, ...) error
- func WriteDesktopLauncher(directory, component, architecture string) (string, error)
- func WriteHostDesktopCommand(writer io.Writer, command HostDesktopCommand) error
- func WriteHostDesktopMessage(writer io.Writer, message HostDesktopMessage) error
- func WriteTransferBundle(ctx context.Context, pkg Package, plan TransferPlan, cacheRoot string, ...) error
- func WriteTransferBundleWithOptions(ctx context.Context, pkg Package, plan TransferPlan, cacheRoot string, ...) error
- func XpraApplicationLifetimeArgs() []string
- func XpraNoAudioArgs() []string
- type ApplicationLaunchPlan
- type ApplicationPackage
- type ApplicationPlanDescription
- type ApplicationPlanOptions
- type Artifact
- type BackendCapability
- type BundleOptions
- type BundleProgress
- type ClientAssets
- type ClientInput
- type ClientInputCapability
- type DesktopClipboard
- type DesktopConnection
- func (c *DesktopConnection) Close() error
- func (c *DesktopConnection) Connection() uint64
- func (c *DesktopConnection) Read(ctx context.Context) (DesktopEvent, error)
- func (c *DesktopConnection) Send(ctx context.Context, request DesktopRequest) (uint64, error)
- func (c *DesktopConnection) StreamVersion() int
- type DesktopCursor
- type DesktopEndpoint
- type DesktopEvent
- type DesktopFrame
- type DesktopRequest
- type DesktopSessionOptions
- type DesktopState
- type DesktopTools
- type DesktopWindow
- type HostDesktopCapabilities
- type HostDesktopCommand
- type HostDesktopCursorPosition
- type HostDesktopDisplay
- type HostDesktopInput
- type HostDesktopMessage
- type HostDesktopPicture
- type HostDesktopServiceKit
- type HostDesktopServiceStatus
- type HostDesktopTools
- type Installation
- type LaunchUnavailable
- type LoginScreenConnection
- type LoginServiceAdmissionProof
- type LoginServiceConfig
- type LoginServiceDeploymentCommand
- type LoginServiceDeploymentControl
- type LoginServiceDeploymentEvent
- type LoginServiceDeploymentRequest
- type LoginServiceManager
- func (m *LoginServiceManager) Install(ctx context.Context) (ServiceStatus, error)
- func (m *LoginServiceManager) OpenLoginSession(ctx context.Context) (string, ServiceStatus, error)deprecated
- func (*LoginServiceManager) Status(ctx context.Context) (ServiceStatus, error)
- func (m *LoginServiceManager) Uninstall(ctx context.Context) (ServiceStatus, error)
- type Manager
- func (m *Manager) Cancel(owner, id string) (Status, error)
- func (m *Manager) Close()
- func (m *Manager) CompleteUpload(owner, id string) (Status, error)
- func (m *Manager) DesktopBackend() (BackendCapability, error)
- func (m *Manager) Directory() (string, error)
- func (m *Manager) DirectoryFor(digest string) (string, error)
- func (m *Manager) HostDesktopTools() (HostDesktopTools, error)
- func (m *Manager) InstallationForProcess(process ProcessIdentity) (*Installation, error)
- func (m *Manager) Package() Package
- func (m *Manager) Plan(ctx context.Context) (TransferPlan, error)
- func (m *Manager) PlanDesktop(ctx context.Context, desktopFile string, environment []string) (ApplicationLaunchPlan, error)
- func (m *Manager) PrepareDesktopSession(ctx context.Context, options DesktopSessionOptions) (PreparedDesktopSession, error)
- func (m *Manager) Snapshot(owner string) Status
- func (m *Manager) Start(owner, requestID, source string, uploadSize int64) (Status, error)
- func (m *Manager) Watch() (<-chan struct{}, func())
- func (m *Manager) WriteChunk(owner, id string, offset int64, data []byte) (Status, error)
- type Package
- type Preparation
- type PreparedDesktopSession
- type PreparedViewer
- type ProcessIdentity
- type ServiceStatus
- type Status
- type Tools
- type TransferPlan
- type ViewerDocumentOptions
Examples ¶
Constants ¶
const ( ServiceUnsupported = hostdesktop.ServiceUnsupported ServiceNotInstalled = hostdesktop.ServiceNotInstalled ServiceAuthorization = hostdesktop.ServiceAuthorization ServiceInstalling = hostdesktop.ServiceInstalling ServiceActive = hostdesktop.ServiceActive ServiceStopped = hostdesktop.ServiceStopped ServiceFailed = hostdesktop.ServiceFailed ServiceUninstalling = hostdesktop.ServiceUninstalling )
const ClientInputTextLimit = 16000
ClientInputTextLimit bounds one atomic text commit in UTF-8 bytes. Applications must report rejected commits; truncation and automatic retry are forbidden.
const ClientInputVersion = 1
ClientInputVersion is the confirmed-text protocol advertised on Xpra's authenticated connection. Consumers must reject sessions without this version.
const HostDesktopDefaultFrameWindow = hostdesktop.HostDesktopDefaultFrameWindow
const HostDesktopMaxFrameWindow = hostdesktop.HostDesktopMaxFrameWindow
const HostDesktopProtocolVersion = hostdesktop.HostDesktopProtocolVersion
hostdesktop owns the physical-desktop wire and privileged service boundary. Root aliases preserve the published SDK API; the standalone service imports only hostdesktop and cannot recursively embed distribution artifacts.
const LoginScreenService = hostdesktop.LoginScreenService
const LoginServiceManagementVersion = hostdesktop.LoginServiceManagementVersion
const LoginServiceSocket = hostdesktop.LoginServiceSocket
Variables ¶
var ( ErrServiceUnsupported = hostdesktop.ErrServiceUnsupported ErrServiceAuthorization = hostdesktop.ErrServiceAuthorization ErrServiceNotInstalled = hostdesktop.ErrServiceNotInstalled ErrServiceUpdateRequired = hostdesktop.ErrServiceUpdateRequired )
var ErrBusy = errors.New("native preparation is already running")
var ErrDesktopProtocol = errors.New("invalid native desktop helper protocol")
ErrDesktopProtocol reports invalid helper framing or metadata, without including application content, input text, or authentication material.
var ErrForbidden = errors.New("native preparation belongs to another caller")
var ErrHostDesktopProtocol = hostdesktop.ErrHostDesktopProtocol
var ErrInvalid = errors.New("invalid native preparation request")
var ErrUnsupported = errors.New("native graphical components are unavailable for this platform")
Functions ¶
func CursorClientSource ¶ added in v0.12.4
func CursorClientSource() []byte
CursorClientSource returns the shared standalone JavaScript cursor owner. Consumers build this released asset into their viewer instead of duplicating normalization. FloeRemoteCursor accepts an apply callback and PNG metadata. Its receive, hide, reset and dispose methods own decode/DPR resource lifetime.
func DesktopFramesClientSource ¶ added in v0.21.0
func DesktopFramesClientSource() []byte
DesktopFramesClientSource supplies the browser decoder for the released native frame contract. It owns ordered damage composition and bounded decode work; hosts own presentation, transport, target validity, and paint acknowledgements.
func DesktopSelfTest ¶ added in v0.14.0
DesktopSelfTest executes only an installation-owned GTK fixture. It requires decoded pixels, actual Unicode/Enter document bytes, reconnect and normal exit. It does not establish Snap/Flatpak or desktop-environment support by itself.
func DialDesktop ¶ added in v0.12.4
func DialDesktop(ctx context.Context, endpoint DesktopEndpoint) (*DesktopConnection, DesktopState, error)
DialDesktop authenticates to an already running Linux helper and returns its initial observed state. It neither prepares nor launches an application. The endpoint is a 0600 Unix socket in an owner-only 0700 directory; kernel peer credentials must match this user before any token is sent. Close detaches only this viewer. The caller owns authorization, lifetime context, and recovery UI.
func HostDesktopClientResource ¶ added in v0.22.0
HostDesktopClientResource returns a known immutable module. The host owns authenticated asset routing, session control, browser input, and product UI.
func HostDesktopSelfTest ¶ added in v0.22.0
HostDesktopSelfTest proves the installed codec round trip using synthetic pixels and audio. Interactive current-desktop authorization and qualification remain separate and are never requested as a side effect of installation.
func PrepareInputClient ¶ added in v0.5.0
PrepareInputClient prepares an Xpra HTML5 v20/v21 distribution with exactly one external keyboard owner and one external pointer owner. It retains the graphics, clipboard and pointer transport. The destination must not exist. Neither a failed preparation nor an unsupported source is usable as a client. Consumers serve this directory through the same authenticated Xpra endpoint.
func PrepareLoginScreenMedia ¶ added in v0.22.28
func PrepareLoginScreenMedia(ctx context.Context, cache, output string, progress func(Status)) (string, error)
PrepareLoginScreenMedia acquires and checks the released media closure on the target as an ordinary SSH user. No service, driver or authority is changed.
func RunLoginScreenService ¶ added in v0.22.23
func RunLoginScreenService(ctx context.Context, config LoginServiceConfig) error
func SelfTest ¶
SelfTest creates only its own virtual display and transient GTK fixture. A successful check proves actual window discovery, rendered pixels, and input; importing a module or starting a process alone is not readiness evidence.
func SystemClientInputPython ¶ added in v0.5.0
func SystemClientInputPython(ctx context.Context, xpra string, environment []string) (string, error)
SystemClientInputPython resolves the interpreter selected by an installed Xpra script, then probes that exact interpreter. It never substitutes the host's unrelated desktop Python or installs missing system dependencies.
func VerifyLoginServiceAdmission ¶ added in v0.23.0
func WriteApplicationLauncher ¶ added in v0.3.0
WriteApplicationLauncher installs the Linux GIO launcher in a consumer-owned private directory. Invoke it with the tools' Python, an absolute .desktop file and an absolute receipt path. The atomic receipt reports running, exited or failed. A running receipt confirms process launch, not window/pixel readiness. Spawn failures include phase and a stable error_code. Final receipts include the actual direct-launcher exit_code (negative for a signal), per-launcher statuses and termination_requested. These are process observations; the graphical backend determines whether launch or established execution ended. The supervisor retains a nonzero launcher result after reaping descendants. The launcher restores the host application environment and reaps descendants; closing a window or losing a viewer never terminates the application. A verified Snap plan additionally requires FLOE_NATIVE_HOST_BUS to identify the real user bus, separate from DBUS_SESSION_BUS_ADDRESS. Only the supervisor receives that handoff; it is removed from the final application's environment. The supervisor exposes only its admitted direct launcher's scope operation.
func WriteBundle ¶
func WriteBundle(ctx context.Context, pkg Package, cacheRoot string, output io.Writer, progress func(int64)) error
WriteBundle acquires the exact catalog archives for an offline host. It neither extracts nor executes them; the destination host verifies every original byte. Callers must publish the output only after this function returns successfully.
func WriteBundleWithOptions ¶ added in v0.9.0
func WriteBundleWithOptions(ctx context.Context, pkg Package, cacheRoot string, output io.Writer, options BundleOptions) error
WriteBundleWithOptions keeps the cache lease through the final ZIP read and applies optional maintenance afterwards, including on cancellation or failure.
func WriteDesktopLauncher ¶ added in v0.14.0
WriteDesktopLauncher installs one immutable first-party Linux helper source snapshot in a new private directory. Invoke the returned executable with an owner-only version-1 launch configuration. Component must be the caller-verified native package for architecture; its private Python/GIO runs the helper. The helper owns native preparation and the existing application supervisor; a viewer or Runtime must not tie its lifetime to their attachment context.
This installs source only. It does not authorize launch, resolve components, qualify a platform, or activate the combined display distribution. The trusted host must supply verified native resources matching its launch plan. Never rewrite a running instance's snapshot when updating installed support.
func WriteHostDesktopCommand ¶ added in v0.22.0
func WriteHostDesktopCommand(writer io.Writer, command HostDesktopCommand) error
func WriteHostDesktopMessage ¶ added in v0.22.0
func WriteHostDesktopMessage(writer io.Writer, message HostDesktopMessage) error
func WriteTransferBundle ¶ added in v0.4.0
func WriteTransferBundle(ctx context.Context, pkg Package, plan TransferPlan, cacheRoot string, output io.Writer, progress func(int64)) error
WriteTransferBundle accepts only a subset of the supplied trusted recipe. Consumer adapters must resolve pkg from their compiled catalog, not a client. An empty plan needs no bundle: use Manager.Start with source "cache" instead.
func WriteTransferBundleWithOptions ¶ added in v0.9.0
func WriteTransferBundleWithOptions(ctx context.Context, pkg Package, plan TransferPlan, cacheRoot string, output io.Writer, options BundleOptions) error
WriteTransferBundleWithOptions validates receiver identities before any cache access, then uses the same leased acquisition path as a complete bundle.
func XpraApplicationLifetimeArgs ¶ added in v0.3.0
func XpraApplicationLifetimeArgs() []string
XpraApplicationLifetimeArgs binds an Xpra server to a monitored application child, independently of its viewers and windows. Use a --start-child command that remains alive until the application and its descendants have exited. Consumers still own application authorization, persistence and session policy.
func XpraNoAudioArgs ¶ added in v0.2.1
func XpraNoAudioArgs() []string
XpraNoAudioArgs disables audio support for a silent Xpra 6.x graphics session. Muting the speaker and microphone with "off" still initializes audio codecs; a missing audio backend can then delay every server inventory request. Session ownership, transport, and all other feature choices remain with the host.
Types ¶
type ApplicationLaunchPlan ¶ added in v0.11.0
type ApplicationLaunchPlan struct {
// contains filtered or unexported fields
}
ApplicationLaunchPlan is an immutable, short-lived snapshot. It is not an authorization token, a persistent application record, or a backend fallback. Package updates require a fresh plan before executing the application.
func PlanApplication ¶ added in v0.11.0
func PlanApplication(ctx context.Context, options ApplicationPlanOptions) (ApplicationLaunchPlan, error)
PlanApplication observes the desktop entry and installed package metadata without starting an application. Unknown protocol metadata selects the combined Wayland/Xwayland backend; its absence is explicit, never an Xpra retry.
func (ApplicationLaunchPlan) Description ¶ added in v0.11.0
func (p ApplicationLaunchPlan) Description() ApplicationPlanDescription
func (ApplicationLaunchPlan) Revalidate ¶ added in v0.11.0
func (p ApplicationLaunchPlan) Revalidate(ctx context.Context, options ApplicationPlanOptions) error
Revalidate rereads the same desktop entry, executable and package revision. The supervisor must also revalidate at its execution boundary. Calling this method alone cannot authorize a later unchecked launch.
func (ApplicationLaunchPlan) Write ¶ added in v0.11.0
func (p ApplicationLaunchPlan) Write(directory string) (string, error)
Write places this plan in the new application's private directory. Invoke the installed application launcher as --plan PATH RECEIPT. It revalidates before GIO creates a child; graphical resources must already match Backend.Component. Do not overwrite a running instance's plan or change its backend identity.
type ApplicationPackage ¶ added in v0.11.0
type ApplicationPackage struct {
Kind string `json:"kind"`
ID string `json:"id"`
Revision string `json:"revision"`
Version string `json:"version,omitempty"`
Confinement string `json:"confinement,omitempty"`
Application string `json:"application,omitempty"`
SecurityTag string `json:"security_tag,omitempty"`
Ref string `json:"ref,omitempty"`
Deployment string `json:"deployment,omitempty"`
Format int `json:"format,omitempty"`
}
type ApplicationPlanDescription ¶ added in v0.11.0
type ApplicationPlanDescription struct {
Version int `json:"version"`
SHA256 string `json:"sha256"`
Backend BackendCapability `json:"backend"`
Package ApplicationPackage `json:"package"`
Services []string `json:"services"`
Desktop string `json:"desktop"`
DesktopSHA256 string `json:"desktop_sha256"`
}
ApplicationPlanDescription describes identity and required resources without granting readiness or input permission. Each call returns independent values.
type ApplicationPlanOptions ¶ added in v0.11.0
type ApplicationPlanOptions struct {
Python string
Environment []string
DesktopFile string
// BrowserProfileDirectory opts supported native browsers into a persistent,
// private profile. The host chooses its owner/application-scoped location.
// Existing explicit profile arguments and sandboxed packages retain their
// own launch contract; no personal profile is read, copied, or unlocked.
BrowserProfileDirectory string
Backends []BackendCapability
}
ApplicationPlanOptions contains the already authorized host desktop entry. Python must provide GIO. Environment is the original host environment, or a Tools.Environment result whose saved overrides the planner restores.
type BackendCapability ¶ added in v0.11.0
type BackendCapability struct {
ID string `json:"id"`
Component string `json:"component"`
Protocols []string `json:"protocols"`
Services []string `json:"services,omitempty"`
}
BackendCapability describes one prepared backend. The trusted host obtains these values from its installed backend, never from a browser request. A capability describes available resources, not application readiness.
type BundleOptions ¶ added in v0.9.0
type BundleOptions struct {
CachePolicy artifactcache.Policy
OnProgress func(BundleProgress) error
OnMaintenance func(artifactcache.Maintenance, error)
// Client is a trusted network policy/test hook, never a renderer input.
Client *http.Client
}
type BundleProgress ¶ added in v0.9.0
type BundleProgress struct {
Phase string `json:"phase"`
ComponentBytes int64 `json:"component_bytes"`
CachedBytes *int64 `json:"cached_bytes,omitempty"`
DownloadBytes *int64 `json:"download_bytes,omitempty"`
DownloadedBytes int64 `json:"downloaded_bytes"`
}
BundleProgress distinguishes verified cache bytes from actual network bytes. Totals remain absent until every requested archive has been checked.
type ClientAssets ¶ added in v0.6.0
type ClientAssets struct {
// contains filtered or unexported fields
}
ClientAssets is an immutable snapshot of public resources from a directory produced by PrepareInputClient. It excludes HTML, configuration and session files. Hosts own authorization, route placement and snapshot lifetime.
func OpenClientAssets ¶ added in v0.6.0
func OpenClientAssets(directory string) (*ClientAssets, error)
OpenClientAssets snapshots and precompresses a prepared Xpra HTML5 v20/v21 client. Worker URLs follow the script's resource directory, independently of the session document URL. The source and installed vendor files are unchanged. The digest covers the exact prepared resource names and bytes, including the input adapter and worker transformation, rather than only the native recipe.
func (*ClientAssets) Digest ¶ added in v0.6.0
func (a *ClientAssets) Digest() string
Digest is the content version to include in the host's resource route.
func (*ClientAssets) RewriteHTML ¶ added in v0.6.0
func (a *ClientAssets) RewriteHTML(document []byte, basePath string) ([]byte, error)
RewriteHTML relocates only references to resources in this snapshot. basePath must be an absolute same-origin directory path containing the content version. It leaves WebSocket addresses, session settings and inline startup code alone. The resulting session document must remain authenticated and uncached.
func (*ClientAssets) ServeHTTP ¶ added in v0.6.0
func (a *ClientAssets) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves a resource path (for example /js/Client.js). The host must first select this snapshot by its exact digest and strip the versioned prefix. Authorization belongs before this handler. Cached scripts never authorize a connection: hosts must continue authenticating session documents and traffic.
type ClientInput ¶ added in v0.5.0
type ClientInput struct {
Launcher, GTKModules, QtPlugins string
// GTKPath is a private module root. Only GTK4 scans its 4.0.0 ABI directory;
// GTK3 uses GTKModules and must never load the GTK4 shared object.
GTKPath string
}
ClientInput is prepared support for one private X11 application session. Launch Launcher with the probed Xpra Python interpreter, normal Xpra arguments and XpraArgs. Start a private session bus first and pass its address explicitly to the application's start environment. These paths contain first-party adapters, never a copied host toolkit or a second input method engine.
func PrepareClientInput ¶ added in v0.5.0
func PrepareClientInput(directory, architecture string) (ClientInput, error)
PrepareClientInput installs the complete input contract into a new absolute private directory. The architecture is the application host's Go architecture.
func (ClientInput) XpraArgs ¶ added in v0.5.0
func (input ClientInput) XpraArgs(baseEnvironment []string) []string
XpraArgs selects client-owned composition in the private application environment. No host desktop input configuration is inherited or modified.
type ClientInputCapability ¶ added in v0.5.0
type ClientInputCapability struct {
Version int `json:"version"`
XpraVersion string `json:"xpra_version"`
}
func ProbeClientInput ¶ added in v0.5.0
func ProbeClientInput(ctx context.Context, python string, environment []string) (ClientInputCapability, error)
ProbeClientInput checks the interpreter and original XIM library before any application is launched. It does not acquire components or require a display. A successful probe does not assert that a particular application has a focused editable input context; that boundary is checked for every submitted commit.
type DesktopClipboard ¶ added in v0.14.0
type DesktopClipboard struct {
Connection uint64 `json:"connection"`
Window uint64 `json:"window"`
Generation uint64 `json:"generation"`
Text *string `json:"text,omitempty"`
Error string `json:"error,omitempty"`
}
DesktopClipboard is the private application's current UTF-8 selection. Text may be empty; Error instead reports an unavailable or unsupported offer. It is independent of confirmed-text input and never authorizes a target.
type DesktopConnection ¶ added in v0.12.4
type DesktopConnection struct {
// contains filtered or unexported fields
}
DesktopConnection owns one authenticated helper attachment. It has no process owner, reconnect loop, frame queue, input scheduler, or implicit frame ack. One goroutine reads events while writers may send requests concurrently. Native validation and ordering remain authoritative in the helper.
func (*DesktopConnection) Close ¶ added in v0.12.4
func (c *DesktopConnection) Close() error
Close revokes this sharing attachment. It never terminates the helper, display or application. The helper releases input owned by the detached attachment.
func (*DesktopConnection) Connection ¶ added in v0.12.4
func (c *DesktopConnection) Connection() uint64
Connection returns the immutable attachment generation assigned by the helper. Reattachment creates another DesktopConnection and another generation.
func (*DesktopConnection) Read ¶ added in v0.12.4
func (c *DesktopConnection) Read(ctx context.Context) (DesktopEvent, error)
Read returns one complete event without buffering subsequent frames or acknowledging pixels. Only one reader may call Read at a time. Cancellation closes the attachment rather than retaining a partially consumed packet.
func (*DesktopConnection) Send ¶ added in v0.12.4
func (c *DesktopConnection) Send(ctx context.Context, request DesktopRequest) (uint64, error)
Send writes one bounded request and returns its sequence. The reply is read by Read. Cancellation during I/O closes this attachment; no request is replayed. A caller should use a separate continuous reader so frame delivery cannot prevent it from consuming replies. Input ordering belongs to the helper.
func (*DesktopConnection) StreamVersion ¶ added in v0.21.0
func (c *DesktopConnection) StreamVersion() int
StreamVersion is the negotiated helper capability. Zero denotes a surviving legacy PNG session; hosts must not send configure_stream to that session.
type DesktopCursor ¶ added in v0.12.4
type DesktopCursor struct {
Mode string `json:"mode"`
Sequence uint64 `json:"sequence"`
Connection uint64 `json:"connection"`
Window uint64 `json:"window"`
Generation uint64 `json:"generation"`
Encoding string `json:"encoding,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
LogicalWidth int `json:"logical_width,omitempty"`
LogicalHeight int `json:"logical_height,omitempty"`
XHot float64 `json:"xhot,omitempty"`
YHot float64 `json:"yhot,omitempty"`
}
DesktopCursor carries the current native pointer shape. Image dimensions describe PNG pixels; LogicalWidth/Height and the hotspot are surface units. The shared cursor client caps CSS size without applying buffer scale twice. Hidden and default modes contain no pixel payload. Sequence is compositor-wide.
type DesktopEndpoint ¶ added in v0.12.4
DesktopEndpoint identifies an existing private helper. A trusted application instance supplies these values; they are never taken from viewer input.
type DesktopEvent ¶ added in v0.12.4
type DesktopEvent struct {
StreamVersion int `json:"stream_version,omitempty"`
Event string `json:"event,omitempty"`
ID uint64 `json:"id,omitempty"`
Version int `json:"version,omitempty"`
Connection uint64 `json:"connection,omitempty"`
State *DesktopState `json:"state,omitempty"`
Frame *DesktopFrame `json:"frame,omitempty"`
Cursor *DesktopCursor `json:"cursor,omitempty"`
Clipboard *DesktopClipboard `json:"clipboard,omitempty"`
Bytes int `json:"bytes,omitempty"`
Code string `json:"code,omitempty"`
Error string `json:"error,omitempty"`
Result json.RawMessage `json:"result,omitempty"`
Pixels []byte `json:"-"`
}
DesktopEvent contains one complete helper event or request result. A frame event includes its bounded PNG payload. The caller owns those returned bytes. Result and Error preserve helper semantics: submitted is not a widget receipt.
type DesktopFrame ¶ added in v0.12.4
type DesktopFrame struct {
X int `json:"x,omitempty"`
Y int `json:"y,omitempty"`
RegionWidth int `json:"region_width,omitempty"`
RegionHeight int `json:"region_height,omitempty"`
Base uint64 `json:"base,omitempty"`
Encoding string `json:"encoding"`
Width int `json:"width"`
Height int `json:"height"`
Sequence uint64 `json:"sequence"`
Connection uint64 `json:"connection"`
Window uint64 `json:"window"`
Generation uint64 `json:"generation"`
}
DesktopFrame binds pixels to the native connection, window and geometry generation. Receiving or parsing it does not grant input permission: the viewer must decode and paint it before sending frame_ack for Sequence.
type DesktopRequest ¶ added in v0.12.4
type DesktopRequest struct {
Mode string `json:"mode,omitempty"`
Method string `json:"method"`
Connection uint64 `json:"connection,omitempty"`
Window uint64 `json:"window,omitempty"`
Generation uint64 `json:"generation,omitempty"`
Frame uint64 `json:"frame,omitempty"`
Operation json.RawMessage `json:"operation,omitempty"`
}
DesktopRequest names a version-1 helper operation. Operation is the native input object for input requests; the helper validates it against the current acknowledged target. Other methods have no Operation. Target fields remain explicit so a stale callback cannot borrow the connection's current target. terminate_application is reserved for authorized explicit force-quit intent: the installed session signals its own supervisor. It takes no PID, signal or target and remains available after capture failure. Closing this connection never invokes it; the subsequent process receipt establishes the real exit. release_input cancels pending input and releases held keys/buttons only for the named, already-painted target. It preserves that frame's input authority.
type DesktopSessionOptions ¶ added in v0.14.0
type DesktopSessionOptions struct {
Directory, Runtime, Instance string
Plan ApplicationLaunchPlan
Environment []string
HostBus string
InitialDocuments []string
}
DesktopSessionOptions is an authorized new instance, never a renderer payload. Directory must not exist; Runtime is an existing owner-only socket directory. Environment is the original host environment, not a support-tool environment.
type DesktopState ¶ added in v0.12.4
type DesktopState struct {
State string `json:"state"`
Window uint64 `json:"window"`
Generation uint64 `json:"generation"`
Windows []DesktopWindow `json:"windows"`
}
DesktopState is native observation, not application lifetime. In particular, waiting or unavailable must never be interpreted as application exit.
type DesktopTools ¶ added in v0.14.0
type DesktopTools struct {
Root, Python, Shell, Capture, Library, Xwayland, IBusDaemon, IBusPortal, QtPlugins, GTKModules string
}
DesktopTools is the single verified layout used by planning and launch. It does not discover a host compositor or substitute a system input service.
func ResolveDesktopTools ¶ added in v0.14.0
func ResolveDesktopTools(root, architecture string) (DesktopTools, error)
ResolveDesktopTools verifies installed derivations and the original executable closure without starting processes. Manager additionally checks recipe identity.
func (DesktopTools) Environment ¶ added in v0.14.0
func (t DesktopTools) Environment(base []string) []string
Environment isolates the planning interpreter while retaining the exact host resolution environment in the existing supervisor handoff.
type DesktopWindow ¶ added in v0.12.4
type DesktopWindow struct {
Window uint64 `json:"window"`
Parent uint64 `json:"parent"`
Protocol string `json:"protocol"`
Width int `json:"width"`
Height int `json:"height"`
Title string `json:"title"`
Maximized bool `json:"maximized"`
Fullscreen bool `json:"fullscreen"`
Minimized bool `json:"minimized"`
Interacting bool `json:"interacting"`
}
type HostDesktopCapabilities ¶ added in v0.22.0
type HostDesktopCapabilities = hostdesktop.HostDesktopCapabilities
type HostDesktopCommand ¶ added in v0.22.0
type HostDesktopCommand = hostdesktop.HostDesktopCommand
func ParseHostDesktopCommand ¶ added in v0.22.0
func ParseHostDesktopCommand(data []byte) (HostDesktopCommand, error)
type HostDesktopCursorPosition ¶ added in v0.22.28
type HostDesktopCursorPosition = hostdesktop.HostDesktopCursorPosition
type HostDesktopDisplay ¶ added in v0.22.0
type HostDesktopDisplay = hostdesktop.HostDesktopDisplay
type HostDesktopInput ¶ added in v0.22.0
type HostDesktopInput = hostdesktop.HostDesktopInput
type HostDesktopMessage ¶ added in v0.22.0
type HostDesktopMessage = hostdesktop.HostDesktopMessage
func ReadHostDesktopMessage ¶ added in v0.22.0
func ReadHostDesktopMessage(reader io.Reader) (HostDesktopMessage, error)
type HostDesktopPicture ¶ added in v0.22.0
type HostDesktopPicture = hostdesktop.HostDesktopPicture
type HostDesktopServiceKit ¶ added in v0.22.23
type HostDesktopServiceKit struct {
ServiceSHA256 string `json:"service_sha256"`
WorkerSHA256 string `json:"worker_sha256"`
Files map[string][]byte `json:"-"`
}
HostDesktopServiceKit is the reviewed release's SSH deployment closure. A host adapter selects architecture from the SSH host, never from renderer paths or URLs. Extracting this kit never requests authority or installs a service.
func LoginScreenServiceKit ¶ added in v0.22.23
func LoginScreenServiceKit(architecture string) (HostDesktopServiceKit, error)
type HostDesktopServiceStatus ¶ added in v0.22.17
type HostDesktopServiceStatus = hostdesktop.HostDesktopServiceStatus
type HostDesktopTools ¶ added in v0.22.0
type HostDesktopTools struct{ Root, Python, Helper string }
HostDesktopTools holds only the verified helper paths. The consumer passes a private persistent --state directory, --media-fd, and framed commands on stdin; stdout is control only. The media descriptor is a separate inherited pipe.
func ResolveHostDesktopTools ¶ added in v0.22.0
func ResolveHostDesktopTools(root, architecture string) (HostDesktopTools, error)
type Installation ¶ added in v0.4.0
type Installation struct {
ID string `json:"id"`
Digest string `json:"digest"`
Architecture string `json:"architecture"`
Contract string `json:"contract"`
Ready bool `json:"ready"`
}
Installation identifies an installed recipe independently of the SDK release. Ready is a lightweight check of its private marker and required tool layout.
type LaunchUnavailable ¶ added in v0.11.0
type LaunchUnavailable struct {
}
LaunchUnavailable is safe for production diagnostics. It contains no child output, input text, environment values, or desktop file contents.
func (*LaunchUnavailable) Error ¶ added in v0.11.0
func (e *LaunchUnavailable) Error() string
type LoginScreenConnection ¶ added in v0.22.23
type LoginScreenConnection = hostdesktop.LoginScreenConnection
func OpenLoginScreenSession ¶ added in v0.22.23
func OpenLoginScreenSession(ctx context.Context, path string) (*LoginScreenConnection, error)
type LoginServiceAdmissionProof ¶ added in v0.23.2
type LoginServiceAdmissionProof = hostdesktop.LoginServiceAdmissionProof
type LoginServiceConfig ¶ added in v0.22.23
type LoginServiceConfig = hostdesktop.LoginServiceConfig
type LoginServiceDeploymentCommand ¶ added in v0.23.0
type LoginServiceDeploymentCommand = hostdesktop.LoginServiceDeploymentCommand
type LoginServiceDeploymentControl ¶ added in v0.23.0
type LoginServiceDeploymentControl = hostdesktop.LoginServiceDeploymentControl
type LoginServiceDeploymentEvent ¶ added in v0.22.23
type LoginServiceDeploymentEvent = hostdesktop.LoginServiceDeploymentEvent
type LoginServiceDeploymentRequest ¶ added in v0.22.23
type LoginServiceDeploymentRequest = hostdesktop.LoginServiceDeploymentRequest
type LoginServiceManager ¶ added in v0.22.17
type LoginServiceManager struct{}
LoginServiceManager observes installed state. It never simulates installation in memory and never elevates Runtime. Administrator-authorized SSH deployment uses ManageLoginScreenServiceControlled in a separate management process.
func NewLoginServiceManager ¶ added in v0.22.17
func NewLoginServiceManager() *LoginServiceManager
func (*LoginServiceManager) Install ¶ added in v0.22.17
func (m *LoginServiceManager) Install(ctx context.Context) (ServiceStatus, error)
func (*LoginServiceManager) OpenLoginSession
deprecated
added in
v0.22.17
func (m *LoginServiceManager) OpenLoginSession(ctx context.Context) (string, ServiceStatus, error)
Deprecated: use OpenLoginScreenSession, which consumes its one-time ticket and owns the private attachment lifecycle rather than exposing an unbound token.
func (*LoginServiceManager) Status ¶ added in v0.22.17
func (*LoginServiceManager) Status(ctx context.Context) (ServiceStatus, error)
func (*LoginServiceManager) Uninstall ¶ added in v0.22.17
func (m *LoginServiceManager) Uninstall(ctx context.Context) (ServiceStatus, error)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func New ¶
New requires a private state root. Creating a manager never downloads or starts native processes. The optional validator is useful for host-owned qualification; production callers use the built-in graphical self-check by passing nil.
Example ¶
This example compiles in source checks but performs no network operations in tests. A service should retain its manager for the service's entire lifetime.
package main
import (
"context"
"fmt"
"log"
"os"
"path/filepath"
"time"
nativeapps "github.com/floegence/floe-native-apps"
)
func main() {
prepare := func(ctx context.Context, stateRoot, owner, requestID string) (nativeapps.Tools, error) {
pkg, err := nativeapps.NativePackage()
if err != nil {
return nativeapps.Tools{}, err
}
manager, err := nativeapps.New(stateRoot, pkg, nil)
if err != nil {
return nativeapps.Tools{}, err
}
defer manager.Close()
changes, stop := manager.Watch()
defer stop()
if _, err := manager.Start(owner, requestID, "download", 0); err != nil {
return nativeapps.Tools{}, err
}
for {
status := manager.Snapshot(owner)
if status.State == "ready" {
root, err := manager.Directory()
if err != nil {
return nativeapps.Tools{}, err
}
return nativeapps.ResolveTools(root)
}
if !status.Active() {
return nativeapps.Tools{}, fmt.Errorf("preparation %s: %s", status.State, status.ErrorCode)
}
select {
case <-ctx.Done():
return nativeapps.Tools{}, ctx.Err()
case <-changes:
}
}
}
cache, err := os.UserCacheDir()
if err != nil {
log.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Minute)
defer cancel()
// A real product supplies an authenticated owner and a stable request ID.
tools, err := prepare(ctx, filepath.Join(cache, "floe-native-apps"), "local-user", "prepare-1")
if err != nil {
log.Fatal(err)
}
fmt.Println(tools.Xpra)
}
Output:
func (*Manager) DesktopBackend ¶ added in v0.14.0
func (m *Manager) DesktopBackend() (BackendCapability, error)
DesktopBackend returns the installed combined display capability. A surviving selection remains usable by surviving sessions; new launches require the current private capture ABI after preparation explicitly activates its update.
func (*Manager) DirectoryFor ¶ added in v0.4.0
DirectoryFor resolves an exact supported installation for a surviving process. It never changes the current installation or prepares another version.
func (*Manager) HostDesktopTools ¶ added in v0.22.0
func (m *Manager) HostDesktopTools() (HostDesktopTools, error)
func (*Manager) InstallationForProcess ¶ added in v0.4.0
func (m *Manager) InstallationForProcess(process ProcessIdentity) (*Installation, error)
InstallationForProcess identifies a legacy backend's private loader using kernel evidence. Nil means a system installation outside this manager's root. The caller still owns application authorization and backend identity checks.
func (*Manager) Plan ¶ added in v0.4.0
func (m *Manager) Plan(ctx context.Context) (TransferPlan, error)
Plan verifies archives only on explicit preparation/inspection, never on the normal application-open or status path. It performs no network requests.
func (*Manager) PlanDesktop ¶ added in v0.14.0
func (m *Manager) PlanDesktop(ctx context.Context, desktopFile string, environment []string) (ApplicationLaunchPlan, error)
PlanDesktop observes an authorized desktop entry against the verified installed component. Missing package/host services remain structured planning failures.
func (*Manager) PrepareDesktopSession ¶ added in v0.14.0
func (m *Manager) PrepareDesktopSession(ctx context.Context, options DesktopSessionOptions) (PreparedDesktopSession, error)
PrepareDesktopSession binds a plan to a known installed component, generates authentication and writes a new immutable source/configuration snapshot. It neither launches applications nor rewrites surviving session resources.
type Package ¶
type Package struct {
ID string `json:"id"`
Architecture string `json:"architecture"`
SizeBytes int64 `json:"size_bytes"`
InstalledBytes int64 `json:"installed_bytes"`
Artifacts []Artifact `json:"artifacts"`
Preparation *Preparation `json:"preparation,omitempty"`
}
func DesktopForPlatform ¶ added in v0.14.0
DesktopForPlatform returns the combined display recipe. ForPlatform continues to return the published Xpra recipe for consumers of that existing contract. Installation alone never certifies an arbitrary application's compatibility.
func ForPlatform ¶
func HostDesktopForPlatform ¶ added in v0.22.0
HostDesktopForPlatform returns the current-user desktop media closure. It does not grant desktop access or select an application-private graphical session.
func NativePackage ¶
type Preparation ¶ added in v0.14.0
type Preparation struct {
Contract string `json:"contract"`
NativeSHA256 string `json:"native_sha256"`
}
Preparation identifies reviewed native derivations in addition to the original archives. Omission preserves the exact encoding of published Xpra recipes.
type PreparedDesktopSession ¶ added in v0.14.0
type PreparedDesktopSession struct {
Executable, Configuration, Component string
Endpoint DesktopEndpoint
}
PreparedDesktopSession contains immutable launch resources. Launch Executable with Configuration as its sole argument using a persistent process owner. Cancelling a viewer or Runtime attachment must never terminate this process.
type PreparedViewer ¶ added in v0.12.0
type PreparedViewer struct {
// contains filtered or unexported fields
}
PreparedViewer is an immutable, matching document and resource snapshot made by this SDK from an original reviewed HTML5 distribution. It owns no backend, input module or application process. A host pins it for one sharing session.
func PrepareViewer ¶ added in v0.12.0
func PrepareViewer(source string) (*PreparedViewer, error)
PrepareViewer uses the same preparation as PrepareInputClient, independently of any application's old prepared directory. Failure never yields an older viewer. The source must be a trusted installed original v20/v21 distribution.
func (*PreparedViewer) Assets ¶ added in v0.12.0
func (v *PreparedViewer) Assets() *ClientAssets
Assets returns the immutable public resources. Hosts must authorize each request by owner, active sharing origin and exact content digest.
func (*PreparedViewer) Document ¶ added in v0.12.0
func (v *PreparedViewer) Document(basePath string) ([]byte, error)
Document returns this snapshot's entry point with versioned public references. The document, settings, credentials and transport must never be cached.
func (*PreparedViewer) DocumentWithOptions ¶ added in v0.22.8
func (v *PreparedViewer) DocumentWithOptions(basePath string, options ViewerDocumentOptions) ([]byte, error)
type ProcessIdentity ¶ added in v0.3.0
type ProcessIdentity struct {
PID int `json:"pid"`
Boot string `json:"boot"`
Started string `json:"started"`
}
ProcessIdentity is an observation of one Linux process generation. Persisting it allows a host to distinguish a surviving native backend from a reused PID after restart. It grants no authorization and must never be used alone to select an application or issue a signal.
func ObserveProcess ¶ added in v0.3.0
func ObserveProcess(pid int) (ProcessIdentity, error)
ObserveProcess reads the kernel's boot and start identity for a live process.
func (ProcessIdentity) Alive ¶ added in v0.3.0
func (p ProcessIdentity) Alive() bool
type ServiceStatus ¶ added in v0.22.17
type ServiceStatus = HostDesktopServiceStatus
func InstalledLoginServiceStatus ¶ added in v0.22.23
func InstalledLoginServiceStatus(ctx context.Context, path string) (ServiceStatus, error)
func ManageLoginScreenServiceControlled ¶ added in v0.23.0
func ManageLoginScreenServiceControlled(ctx context.Context, request LoginServiceDeploymentRequest, report func(LoginServiceDeploymentEvent), control LoginServiceDeploymentControl) (ServiceStatus, error)
type Status ¶
type Status struct {
State string `json:"state"`
OperationID string `json:"operation_id,omitempty"`
ReceivedBytes int64 `json:"received_bytes"`
ExpectedBytes int64 `json:"expected_bytes"`
ErrorCode string `json:"error_code,omitempty"`
CanCancel bool `json:"can_cancel"`
Installed *Installation `json:"installed,omitempty"`
UpdateAvailable bool `json:"update_available"`
InstallationErrorCode string `json:"installation_error_code,omitempty"`
}
type Tools ¶
type Tools struct{ Root, Xpra, Python, Xvfb, Xauth, DBus, HTML string }
func ResolveTools ¶
func (Tools) Environment ¶
Environment scopes support-tool overrides. The GIO launcher must restore this small saved map on its AppLaunchContext before starting the user's program. Display and D-Bus addresses are deliberately not restored: those belong to the caller's private graphical session.
type TransferPlan ¶ added in v0.4.0
type TransferPlan struct {
PackageDigest string `json:"package_digest"`
Architecture string `json:"architecture"`
MissingArtifacts []string `json:"missing_artifacts"`
MissingBytes int64 `json:"missing_bytes"`
}
TransferPlan contains only identities from the receiver's trusted catalog. It is a cache observation, not an authorization or a reservation of cache files.
type ViewerDocumentOptions ¶ added in v0.22.8
type ViewerDocumentOptions struct {
TransportScriptURL string
}
ViewerDocumentOptions binds a prepared client to a host-owned transport. The same-origin script must synchronously publish floeHostTransport.WebSocket, a WebSocket-compatible constructor. Missing transport fails closed. Protocol processing stays in this realm; independent graphics decode workers remain enabled. The host owns authorization, carrier lifetime and script CSP permission.
Source Files
¶
- application.go
- bundle.go
- catalog.go
- client_assets.go
- cursor.go
- desktop_client.go
- desktop_client_linux.go
- desktop_distribution.go
- desktop_frames.go
- desktop_launcher.go
- desktop_permissions_unix.go
- desktop_prepare.go
- desktop_selftest_linux.go
- display.go
- extract.go
- host_desktop_assets.go
- host_desktop_distribution.go
- host_desktop_login_service.go
- host_desktop_protocol.go
- host_desktop_service.go
- host_desktop_service_kit.go
- host_desktop_service_media.go
- input.go
- input_html.go
- installation.go
- launch_plan.go
- layout.go
- lock_unix.go
- manager.go
- pointer.go
- prepared_viewer.go
- process.go
- process_linux.go
- selftest.go
- tools.go
- transfer.go
- websocket.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package artifactcache acquires pinned publisher archives into a private, content-addressed cache.
|
Package artifactcache acquires pinned publisher archives into a private, content-addressed cache. |
|
cmd
|
|
|
floe-host-desktop-service
command
floe-host-desktop-service is installed as a root-owned executable only after the host product has obtained administrator authorization.
|
floe-host-desktop-service is installed as a root-owned executable only after the host product has obtained administrator authorization. |
|
floe-native-apps
command
floe-native-apps is an explicit qualification and offline acquisition tool.
|
floe-native-apps is an explicit qualification and offline acquisition tool. |
|
internal
|
|
|
qualification
|
|
|
desktop_launch
command
desktop_launch is a private native fixture for the public installed launch API.
|
desktop_launch is a private native fixture for the public installed launch API. |