Documentation
¶
Overview ¶
Package presentation defines language-neutral contracts shared by the optional presentation host, browser clients, native clients, and headless conformance drivers. None of these contracts grants access to a realtime server implementation; cross-realm access always uses a versioned wire API.
Index ¶
Constants ¶
const ( ProtocolRealtimeWebSocket = "openai.realtime.websocket.v1" ProtocolRealtimeWebRTC = "openai.realtime.webrtc.v1" ProtocolManagement = "openrealtime.management.v1" ProtocolClientEffects = "openrealtime.client-effects.v1" ProtocolHostArtifacts = "openrealtime.host-artifacts.v1" ProtocolHostDownloads = "openrealtime.host-downloads.v1" )
Endpoint protocols are identities, not descriptive labels. A consumer asks for both a closed endpoint name and the exact protocol it implements.
const DefaultLoopbackHostAddress = "127.0.0.1:8767"
DefaultLoopbackHostAddress is the operator-overridable local address used by the standalone presentation host and bundled native endpoint directories. The clean Realtime server remains a separate process on its own public API; this address belongs only to the optional presentation layer.
const (
EndpointDirectoryFormatVersion uint64 = 1
)
const ManifestFormatVersion = 1
Variables ¶
var ( HTTPRoutesContract = semanticContract( "presentation.host.http_routes", "openrealtime/presentation/host/http-routes/v1:Register(owner,routes)->dispose", ) HTTPHandlerContract = semanticContract( "presentation.host.http_handler", "openrealtime/presentation/host/http-handler/v1:http.Handler", ) ModuleCatalogContract = semanticContract( "presentation.host.module_catalog", "openrealtime/presentation/host/module-catalog/v1:content-addressed-assets", ) ClientManifestContract = semanticContract( "presentation.host.client_manifest", "openrealtime/presentation/client-manifest/v1:immutable-profile-lock-implementations-assets-endpoints", ) ArtifactStoreContract = semanticContract( "presentation.host.artifact_store", "openrealtime/presentation/host/artifact-store/v1:bounded-publish-lookup-list-stats-sandboxed-resource", ) ArtifactStoreStateContract = semanticContract( "presentation.host.artifact_store.state", "openrealtime/presentation/host/artifact-store-state/v1:bounded-ordered-versioned-html-entries-evictions", ) DownloadStoreContract = semanticContract( "presentation.host.download_store", "openrealtime/presentation/host/download-store/v1:bounded-publish-lookup-list-stats-attachment-resource", ) DownloadStoreStateContract = semanticContract( "presentation.host.download_store.state", "openrealtime/presentation/host/download-store-state/v1:bounded-ordered-versioned-base64-entries-evictions", ) EffectsContract = semanticContract( "presentation.host.effects", "openrealtime/presentation/host/effects/v1:descriptor-locked-declarations-scoped-websocket-admission-authority-confirmation-target-idempotency-audit", ) EffectsStateContract = semanticContract( "presentation.host.effects.state", "openrealtime/presentation/host/effects-state/v1:bounded-terminal-call-idempotency-results-audit-counters-no-authority-arguments-confirmation-nonces", ) EffectAuthorityContract = semanticContract( "presentation.host.effect_authority", "openrealtime/presentation/host/effect-authority/v1:verify-opaque-receipt-exact-session-call-declaration-arguments-target", ) ListenerContract = semanticContract( "presentation.host.listener", "openrealtime/presentation/host/listener/v1:network-address", ) EndpointDirectoryContract = semanticContract( "presentation.host.endpoint_directory", "openrealtime/presentation/host/endpoint-directory/v1:immutable-fingerprinted-closed-named-endpoints-model-timeout-limit", ) CredentialContract = semanticContract( "presentation.host.realtime_credential", "openrealtime/presentation/host/realtime-credential/v1:authorization-header-provider", ) EndpointDirectoryConfigContract = semanticContract( "presentation.host.endpoint_directory.config", "openrealtime/presentation/host/endpoint-directory-config/v1:closed-explicit-endpoints-model-timeout-limit", ) ListenerConfigContract = semanticContract( "presentation.host.listener.config", "openrealtime/presentation/host/listener-config/v1:loopback-address-timeouts", ) ArtifactStoreConfigContract = semanticContract( "presentation.host.artifact_store.config", "openrealtime/presentation/host/artifact-store-config/v1:max-entries-item-bytes-total-bytes", ) DownloadStoreConfigContract = semanticContract( "presentation.host.download_store.config", "openrealtime/presentation/host/download-store-config/v1:max-entries-item-bytes-total-bytes", ) EffectsConfigContract = semanticContract( "presentation.host.effects.config", "openrealtime/presentation/host/effects-config/v1:max-sessions-message-result-inflight-calls-audit-confirmation-execution-timeouts", ) ClientConnectionContract = semanticContract( "presentation.client.connection", "openrealtime/presentation/client/connection/v1:connect-send-subscribe-close-state", ) ClientTransportDiagnosticsContract = semanticContract( "presentation.client.transport_diagnostics", "openrealtime/presentation/client/transport-diagnostics/v1:payload-free-media-data-channel-queue-stats-snapshot", ) ClientProtocolEventsContract = semanticContract( "presentation.client.protocol_events", "openrealtime/presentation/client/protocol-events/v1:bounded-validated-inbound-subscribe-no-send-or-effect-authority", ) ClientSessionConfigurationContract = semanticContract( "presentation.client.session_configuration", "openrealtime/presentation/client/session-configuration/v1:scoped-declarative-contributions-merged-session-update", ) ClientStateContract = semanticContract( "presentation.client.session_state", "openrealtime/presentation/client/session-state/v1:canonical-snapshot-subscribe-connect-send-text-end-turn-cancel-playout-tool-result", ) ClientReducerStateContract = semanticContract( "presentation.client.reducer.state", "openrealtime/presentation/client/reducer-state/v1:bounded-safe-point-machine-outbound-cursor-local-item-private-inspection-access", ) ClientCodecContract = semanticContract( "presentation.client.strict_json", "openrealtime/presentation/client/strict-json/v1:duplicate-key-depth-finite-number-parse-stable-encode", ) ClientSlotsContract = semanticContract( "presentation.client.slots", "openrealtime/presentation/client/slots/v1:register-dispose", ) ClientMediaContract = semanticContract( "presentation.client.media", "openrealtime/presentation/client/media/v1:native-audio-video-capture-playout-lifecycle", ) ClientVideoContract = semanticContract( "presentation.client.video", "openrealtime/presentation/client/video/v1:negotiated-camera-screen-capture-start-stop-snapshot-bounded-frame-publication", ) ClientEffectsContract = semanticContract( "presentation.client.tools_effects", "openrealtime/presentation/client/tools-effects/v1:bounded-tools-confirmation-declared-targets", ) ClientArtifactsContract = semanticContract( "presentation.client.artifacts", "openrealtime/presentation/client/artifacts/v1:bounded-immutable-artifact-download-references-view-export", ) ClientInspectionAccessContract = semanticContract( "presentation.client.inspection_access", "openrealtime/presentation/client/inspection-access/v1:scoped-ephemeral-capability-subscribe", ) ClientInspectionContract = semanticContract( "presentation.client.inspection", "openrealtime/presentation/client/inspection/v1:live-static-model-delta-trace-redacted-projections", ) ClientManagementOperatorAccessContract = semanticContract( "presentation.client.management_operator_access", "openrealtime/presentation/client/management-operator-access/v1:private-lease-operation-resource-generation-abort-no-serialization", ) ClientManagementOperatorControlContract = semanticContract( "presentation.client.management_operator_control", "openrealtime/presentation/client/management-operator-control/v1:replace-clear-redacted-status-subscribe", ) ClientManagementOperatorStateContract = semanticContract( "presentation.client.management_operator.state", "openrealtime/presentation/client/management-operator-state/v1:private-canonical-capability-expiry-generation-restoration-no-serialized-projection", ) ClientManagementTransportContract = semanticContractRevision( "presentation.client.management_transport", 4, "openrealtime/presentation/client/management-transport/v4:whitelisted-static-authoring-reconciliation-edge-removal-creation-header-capability-strict-bounded-no-redirect", ) ClientManagementStaticContract = semanticContract( "presentation.client.management_static", "openrealtime/presentation/client/management-static/v1:exact-graph-element-plugin-values-schema-by-immutable-identity", ) ClientManagementAuthoringContract = semanticContract( "presentation.client.management_authoring", "openrealtime/presentation/client/management-authoring/v1:analyze-compile-render-exact-document-graph-identity", ) ClientManagementEditingContract = semanticContractRevision( "presentation.client.management_editing", 4, "openrealtime/presentation/client/management-editing/v4:canonical-ortg-yaml-json-exact-node-rename-edge-removal-creation-validated-local-edit-application", ) ClientSourceReadingContract = semanticContract( "presentation.client.source_reading", "openrealtime/presentation/client/source-reading/v1:explicit-root-path-exact-utf8-source-result-revalidation", ) ClientSourcePublicationContract = semanticContract( "presentation.client.source_publication", "openrealtime/presentation/client/source-publication/v1:explicit-root-create-stale-update-receipt-revalidation", ) ClientAuthoringWorkspaceContract = semanticContractRevision( "presentation.client.authoring_workspace", 4, "openrealtime/presentation/client/authoring-workspace/v4:bounded-ortg-yaml-json-document-optional-rooted-read-analysis-compile-render-graph-node-rename-edge-removal-creation-cas-optional-publication-immutable-snapshot-subscribe", ) ClientAuthoringWorkspaceStateContract = semanticContract( "presentation.client.authoring_workspace.state", "openrealtime/presentation/client/authoring-workspace-state/v1:bounded-durable-document-path-source-revision-derived-state-invalidated", ) ClientViewContract = semanticContract( "presentation.client.view", "openrealtime/presentation/client/view/v1:native-slots-state-media-effects-inspection-authoring", ) )
Functions ¶
func MarshalManifest ¶
func MarshalManifest(manifest ClientManifest) ([]byte, error)
MarshalManifest returns deterministic, newline-terminated strict JSON.
Types ¶
type ClientManifest ¶
type ClientManifest struct {
FormatVersion uint64 `json:"format_version"`
Platform string `json:"platform"`
Fingerprint string `json:"fingerprint"`
Plan plugin.Plan `json:"plan"`
Implementations []ManifestImplementation `json:"implementations"`
Assets []ManifestAsset `json:"assets,omitempty"`
Endpoints []ManifestEndpoint `json:"endpoints,omitempty"`
Grants []ManifestGrant `json:"grants,omitempty"`
}
ClientManifest is the immutable browser/native boot input. Configuration values, secrets, tokens, and session payloads are deliberately absent.
func FreezeManifest ¶
func FreezeManifest(manifest ClientManifest) (ClientManifest, error)
FreezeManifest canonicalizes declaration-order-insensitive rows and binds a digest to the complete client composition.
func ParseManifest ¶
func ParseManifest(source []byte) (ClientManifest, error)
ParseManifest rejects duplicate/unknown fields and verifies all identities.
func (ClientManifest) Clone ¶
func (manifest ClientManifest) Clone() ClientManifest
func (ClientManifest) Validate ¶
func (manifest ClientManifest) Validate() error
Validate checks structure, exact plan/asset coverage, and fingerprint.
type Endpoint ¶
type Endpoint struct {
Name EndpointName `json:"name"`
Protocol string `json:"protocol"`
URL string `json:"url"`
}
Endpoint is one exact, credential-free public-wire destination. URL may be on a different origin from every other entry; consumers may not infer a missing entry by rewriting a present URL.
type EndpointDirectory ¶
type EndpointDirectory struct {
FormatVersion uint64 `json:"format_version"`
Fingerprint string `json:"fingerprint"`
Endpoints []Endpoint `json:"endpoints"`
}
EndpointDirectory is an immutable, canonical endpoint set. Endpoints are ordered by Name and Fingerprint covers the complete versioned directory.
func FreezeEndpointDirectory ¶
func FreezeEndpointDirectory(source []Endpoint) (EndpointDirectory, error)
FreezeEndpointDirectory validates, sorts, snapshots, and fingerprints an exact endpoint set. Empty is valid for a profile with no public-wire target; individual consumers still require their selected endpoint at mount.
func (EndpointDirectory) Clone ¶
func (directory EndpointDirectory) Clone() EndpointDirectory
Clone returns a recursively independent immutable snapshot.
func (EndpointDirectory) Lookup ¶
func (directory EndpointDirectory) Lookup(name EndpointName) (Endpoint, bool)
Lookup returns a copy of one declared endpoint. Absence is not an invitation to infer a URL from another entry.
func (EndpointDirectory) Require ¶
func (directory EndpointDirectory) Require(name EndpointName, protocol string) (Endpoint, error)
Require resolves one endpoint only when both its name and exact protocol match the consumer's frozen contract.
func (EndpointDirectory) Validate ¶
func (directory EndpointDirectory) Validate() error
Validate checks structure, canonical order, and the stored fingerprint.
type EndpointName ¶
type EndpointName string
EndpointName is the closed vocabulary of public-wire destinations a presentation deployment may publish. Endpoint presence is capability: an omitted effect or resource endpoint must not be reconstructed from another endpoint's origin.
const ( EndpointRealtimeWebSocket EndpointName = "realtime.websocket" EndpointRealtimeWebRTC EndpointName = "realtime.webrtc" EndpointManagement EndpointName = "management.canonical" EndpointEffects EndpointName = "effects.local" EndpointArtifacts EndpointName = "resources.artifacts" EndpointDownloads EndpointName = "resources.downloads" )
type ManifestAsset ¶
type ManifestAsset struct {
Entry string `json:"entry"`
Name string `json:"name"`
MediaType string `json:"media_type"`
Digest string `json:"digest"`
Path string `json:"path"`
}
ManifestAsset maps one descriptor-owned asset to its content-addressed host path. Paths carry no credential and are always same-origin relative URLs.
type ManifestEndpoint ¶
type ManifestEndpoint struct {
Name string `json:"name"`
Method string `json:"method"`
Path string `json:"path"`
Protocol string `json:"protocol,omitempty"`
CatalogDigest string `json:"catalog_digest,omitempty"`
}
ManifestEndpoint declares a host capability that actually exists in the selected host profile. Client code does not infer endpoints from UI names.
type ManifestGrant ¶
type ManifestGrant struct {
Entry string `json:"entry"`
Permissions []plugin.Permission `json:"permissions"`
}
ManifestGrant is the deployment-selected permission subset for one client entry. Descriptor permissions are ceilings and never become grants merely by appearing in the plan.
type ManifestImplementation ¶
type ManifestImplementation struct {
Entry string `json:"entry"`
Implementation string `json:"implementation"`
Artifact inspect.ArtifactIdentity `json:"artifact"`
Entrypoint string `json:"entrypoint,omitempty"`
}
ManifestImplementation attests the platform implementation selected for a client-plan entry. Artifact identity describes installed code, not the descriptor, whose exact identity is already in Plan.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package browser supplies optional browser implementations of the shared client-plugin contracts.
|
Package browser supplies optional browser implementations of the shared client-plugin contracts. |
|
Package host implements presentation-host plugins.
|
Package host implements presentation-host plugins. |