Documentation
¶
Overview ¶
Package realtimecu adapts the stable OpenAI Realtime-compatible session surface to the locked graph-native Realtime-CU authority graph.
It contains no model, ASR, vision, browser, or UI implementation. Those are exact plugin registrations supplied by a launcher. The adapter only translates session operations to typed graph boundaries and renders typed graph outputs back through binding.Sink.
Index ¶
- Constants
- func ActivationDescriptor() element.Descriptor
- func CancellationCoordinatorDescriptor() element.Descriptor
- func ElementFactoryRegistrations() ([]graphruntime.FactoryRegistration, error)
- func NewApplicationRegistration(source ApplicationRegistrationConfig, ...) (launchprofile.Registration, error)
- func ObservationCommitDescriptor() element.Descriptor
- func RegisterElementDescriptors(catalog *resolve.Catalog) error
- func SessionCancellationOutcomeType() element.Type
- func SessionCancellationStateType() element.Type
- func SessionCancellationType() element.Type
- type ActivationConfig
- type ApplicationConfig
- type ApplicationModelSelection
- type ApplicationObserverSelection
- type ApplicationPolicySelection
- type ApplicationRegistrationConfig
- type CancellationCoordinatorConfig
- type ModelFactoryRegistration
- type ModelPlugin
- type Observer
- type ObserverFactoryRegistration
- type ObserverPlugin
- type ObserverResources
- type PerceptionObserverConfig
- type Plugin
- type PluginConfig
- type PolicyFactoryRegistration
- type PolicyPlugin
- type SessionCancellation
- type SessionCancellationOutcome
- type SessionCancellationOutcomeKind
- type SessionCancellationState
- type VisualConsequence
Constants ¶
const ( ActivationReference = "policy.RealtimeComputerUseActivation" ActivationConfigSchema = "schema://openrealtime/realtime-cu/activation-config/v2" )
const ( ApplicationReference = "application.openrealtime.realtime-computer-use.v1" ApplicationFormatVersion = uint64(2) )
const ( CancellationCoordinatorReference = "policy.RealtimeComputerUseCancellationCoordinator" CancellationCoordinatorConfigSchema = "schema://openrealtime/realtime-cu/session-cancellation-coordinator-config/v1" )
const ( AdapterReference = "go://github.com/bojieli/OpenRealtime/graph/binding/realtimecu/session-adapter/v2" ProfileName = "openrealtime.realtime_computer_use" ProfileRevision = uint64(2) ModelReference = "deployment.computer-use" // SettlementPolicyReference is the graph-stable semantic-decider // registration used by an independently connected intent-disposition // producer. The application profile's host inventory reference remains a // separate exact identity and is never interpreted by graph elements. SettlementPolicyReference = "deployment.computer-use.settlement-policy" ToolReference = "deployment.tools" TargetReference = "deployment.browser" LedgerReference = "deployment.ledger" ConfirmReference = "deployment.confirmation" SourceMicrophone = "microphone" SourceScreen = "screen" SourceCamera = "camera" )
const (
ObservationCommitReference = "state.RealtimeComputerUseObservationCommit"
)
Variables ¶
This section is empty.
Functions ¶
func ActivationDescriptor ¶
func ActivationDescriptor() element.Descriptor
ActivationDescriptor keeps the latest committed user task as durable proposal authority while grounding cognition in each newest screen/camera prefix. Exactly one generation may be unsettled: a result with no proposal releases the next changed frame, while a proposed effect remains closed until a screen observation names its exact canonical tool result. The selected user item must be a canonical causal ancestor of the current visual tail; ProposalAdmission independently re-derives and checks that authority, so this element cannot weaken the shared effect contract.
func CancellationCoordinatorDescriptor ¶
func CancellationCoordinatorDescriptor() element.Descriptor
CancellationCoordinatorDescriptor turns one protocol/session cancellation into an inspectable, acknowledgement-driven graph transaction. It does not assume delivery is completion: settlement is serialized first, activation returns the exact generation it actually revoked, model termination is observed separately from canonical result commit, and action cancellation is acknowledged by every graph-selected stage.
func ElementFactoryRegistrations ¶
func ElementFactoryRegistrations() ([]graphruntime.FactoryRegistration, error)
ElementFactoryRegistrations returns exact, resource-free in-process registrations. Mount is still the first operation permitted to touch the session trajectory store.
func NewApplicationRegistration ¶
func NewApplicationRegistration( source ApplicationRegistrationConfig, constructor func(PluginConfig) (graphlaunch.Config, error), ) (launchprofile.Registration, error)
NewApplicationRegistration snapshots a broad host factory inventory and returns the one generic launch-profile registration for Realtime-CU.
func ObservationCommitDescriptor ¶
func ObservationCommitDescriptor() element.Descriptor
ObservationCommitDescriptor is the Realtime-CU-specific canonical ingress contract. Unlike the generic observation commit node, it carries two exact causal edges needed by a multi-step computer-use session:
- every screen/camera observation is a descendant of the latest committed user task; and
- a post-effect screen observation retains the exact canonical tool-result parent supplied by the adapter.
The shared trajectory store still validates every parent. No observed text is promoted to user authority, and camera input is forbidden from naming an effect result.
func RegisterElementDescriptors ¶
RegisterElementDescriptors contributes the Realtime-CU-specific state and policy contracts to a caller-owned graph catalog.
func SessionCancellationType ¶
Types ¶
type ActivationConfig ¶
type ActivationConfig struct {
policyelements.GenerateOnObservationConfig
ExpectedAdmission policyelements.TemporalEvidenceAdmissionConfig `json:"expected_admission"`
ExpectedSettlement *policyelements.IntentSettlementConfig `json:"expected_settlement,omitempty"`
}
ActivationConfig pins cognition parameters and the temporal admission contract expected at the consumer boundary. ExpectedSettlement enables the optional terminal handshake and independently repeats the complete upstream gate contract: typed payloads prove shape, while this expectation prevents a forged or miswired producer from weakening source, candidate, or detector requirements. Its nested admission contract must be semantically identical to ExpectedAdmission, which continues to cover ordinary and released evidence.
type ApplicationConfig ¶
type ApplicationConfig struct {
FormatVersion uint64 `json:"format_version"`
Model ApplicationModelSelection `json:"model"`
SettlementPolicy ApplicationPolicySelection `json:"settlement_policy"`
Observer ApplicationObserverSelection `json:"observer"`
Target computeruse.Target `json:"target"`
}
ApplicationConfig is the complete Realtime-CU-owned portion of a strict graph-launch profile. All eleven computer-use tools, the deny-unrequested confirmer, client dispatcher, ledger, and trajectory store are derived by RealtimeComputerUseLaunchConfig and are deliberately not mutable selectors.
func DecodeApplicationConfig ¶
func DecodeApplicationConfig(source json.RawMessage) (ApplicationConfig, error)
DecodeApplicationConfig rejects duplicate/unknown fields and validates all exact public identities. It performs no environment lookup, secret resolution, factory call, graph mount, or other resource acquisition.
func (ApplicationConfig) Validate ¶
func (config ApplicationConfig) Validate() error
Validate proves the serializable plugin selections without consulting an installed factory registry.
type ApplicationModelSelection ¶
type ApplicationModelSelection struct {
Reference string `json:"reference"`
Artifact inspect.ArtifactIdentity `json:"artifact"`
Descriptor continuation.Descriptor `json:"descriptor"`
}
ApplicationModelSelection is the serializable, exact model plugin identity pinned by a graph-launch profile. Reference is opaque to the graph; the host registry exact-matches it before supplying a factory under the graph's fixed deployment.computer-use service reference.
type ApplicationObserverSelection ¶
type ApplicationObserverSelection struct {
Reference string `json:"reference"`
Name string `json:"name"`
Artifact inspect.ArtifactIdentity `json:"artifact"`
Sources []string `json:"sources"`
}
ApplicationObserverSelection pins the audiovisual observer without placing a factory, device handle, credential, or provider client in profile data.
type ApplicationPolicySelection ¶
type ApplicationPolicySelection struct {
Reference string `json:"reference"`
Artifact inspect.ArtifactIdentity `json:"artifact"`
Descriptor policyelements.SemanticDeciderDescriptor `json:"descriptor"`
Configuration json.RawMessage `json:"configuration,omitempty"`
}
ApplicationPolicySelection is the serializable identity of the separately owned semantic classifier used by the reference intent-disposition producer. Configuration is provider-owned, must contain only non-secret behavior and secret-reference data, and is exact-matched to Descriptor by the selected host registration without opening a client.
type ApplicationRegistrationConfig ¶
type ApplicationRegistrationConfig struct {
ApplicationArtifact inspect.ArtifactIdentity
ProviderArtifact inspect.ArtifactIdentity
RuntimeArtifact inspect.ArtifactIdentity
Models []ModelFactoryRegistration
Policies []PolicyFactoryRegistration
Observers []ObserverFactoryRegistration
}
ApplicationRegistrationConfig installs the Realtime-CU application plugin into the generic strict profile registry. Every artifact is supplied by the host/build; this constructor never synthesizes an executable digest.
type ModelFactoryRegistration ¶
type ModelFactoryRegistration struct {
ApplicationModelSelection
Factory func(context.Context, legacy.Options) (continuation.Provider, error)
Readiness func(context.Context) error
}
ModelFactoryRegistration is one host-installed model factory. Its exact metadata must match ApplicationModelSelection before Factory is retained in a launch config; Factory itself remains unopened until session start.
type ModelPlugin ¶
type ModelPlugin struct {
Reference string
Artifact inspect.ArtifactIdentity
Descriptor continuation.Descriptor
Factory func(context.Context, legacy.Options) (continuation.Provider, error)
}
ModelPlugin is one exact provider registration selected for the graph's cognition.TextModel node. Factory is invoked once per mounted session.
type Observer ¶
type Observer interface {
Audio(context.Context, perception.Frame) ([]perception.Observation, error)
Video(context.Context, perception.Frame) ([]perception.Observation, error)
// Consequence is delivered only after a client effect result reaches the
// graph's canonical ToolResultCommit safe point. Implementations use it to
// force the next screen observation even when visual change detection would
// otherwise collapse an unchanged frame.
Consequence(context.Context, VisualConsequence) error
Close() error
}
Observer converts protocol media frames into typed observations. Audio observations must carry user authority; screen/camera observations must carry observer authority. Returning no observation is the normal cadence or endpoint decision and is not an error.
func NewPerceptionObserver ¶
func NewPerceptionObserver(config PerceptionObserverConfig) (Observer, error)
NewPerceptionObserver composes independently selected perception plug-ins. It does not select an ASR, vision model, credential, or presentation layer; those remain launcher-owned factories.
type ObserverFactoryRegistration ¶
type ObserverFactoryRegistration struct {
ApplicationObserverSelection
Factory func(context.Context, legacy.Options) (Observer, error)
ResourceFactory func(context.Context, legacy.Options, ObserverResources) (Observer, error)
Readiness func(context.Context) error
}
ObserverFactoryRegistration is one host-installed audiovisual observer.
type ObserverPlugin ¶
type ObserverPlugin struct {
Reference string
Name string
Artifact inspect.ArtifactIdentity
Sources []string
Factory func(context.Context, legacy.Options) (Observer, error)
ResourceFactory func(context.Context, legacy.Options, ObserverResources) (Observer, error)
}
ObserverPlugin is one exact audiovisual observer registration. Sources are the complete source vocabulary accepted by the provider. Realtime-CU requires microphone, screen, and camera even though camera is not an action target.
type ObserverResources ¶
type ObserverResources struct {
Retainer perception.Retainer
}
ObserverResources are session-scoped graph services an observer may use. The profile selects only the observer artifact; handles and retained bytes never enter serializable configuration. Retainer is shared with the graph's cognition media resolver, so an attached keyframe is the exact byte payload the selected continuation provider receives.
type PerceptionObserverConfig ¶
type PerceptionObserverConfig struct {
Name string
Audio perception.Observer
Video perception.Observer
}
PerceptionObserverConfig adapts the repository's provider-neutral audio and video observers to the Realtime-CU observer plug-in contract. Both observers deliberately share one registered name: the session adapter binds that identity into every committed observation while Source preserves which sensor produced it.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin is a resource-free, immutable contribution to graph/launch. Its factories acquire session-scoped model state only after exact plan selection and preflight have succeeded.
func NewPlugin ¶
func NewPlugin(source PluginConfig) (*Plugin, error)
NewPlugin validates and snapshots an exact Realtime-CU adapter/dependency contribution. It does not invoke either provider factory.
func (*Plugin) AdapterPlugin ¶
func (plugin *Plugin) AdapterPlugin() graphlaunch.AdapterPlugin
AdapterPlugin contributes the exact profile binder to a broad launch catalog. The returned value closes over the plugin's immutable snapshot.
func (*Plugin) AssemblyDependencies ¶
func (plugin *Plugin) AssemblyDependencies() []graphassembly.Dependency
AssemblyDependencies returns the exact mount-scoped service metadata. The semantic registry exposes the selected policy artifact directly; the other services use the composite identity of the cross-service session bundle.
func (*Plugin) MountDependencies ¶
func (plugin *Plugin) MountDependencies() []graphlaunch.MountDependencyPlugin
MountDependencies returns one exact contribution per selected service, as required by graph/launch's duplicate-proof catalog surface.
func (*Plugin) Selection ¶
func (plugin *Plugin) Selection() graphlaunch.AdapterSelection
Selection is the explicit graph-launch selector for this adapter.
type PluginConfig ¶
type PluginConfig struct {
RuntimeArtifact inspect.ArtifactIdentity
Model ModelPlugin
SettlementPolicy PolicyPlugin
Observer ObserverPlugin
Target computeruse.Target
}
PluginConfig supplies exact runtime/provider identities and the one bounded browser target. RuntimeArtifact identifies the adapter and mount-service executable material; model and observer artifacts remain separately bound into the dependency profile digest.
type PolicyFactoryRegistration ¶
type PolicyFactoryRegistration struct {
ApplicationPolicySelection
Factory func(context.Context, legacy.Options) (policyelements.SemanticDecider, error)
Readiness func(context.Context) error
DescribeConfiguration func(json.RawMessage) (policyelements.SemanticDeciderDescriptor, error)
FactoryConfiguration func(context.Context, legacy.Options, json.RawMessage) (policyelements.SemanticDecider, error)
ReadinessConfiguration func(context.Context, json.RawMessage) error
}
PolicyFactoryRegistration is one host-installed semantic-decider factory. A registration is either a fully described plain factory or an exact parameterized trio. DescribeConfiguration is resource-free; the selected FactoryConfiguration remains unopened until a producer calls registry.Open after graph Run begins.
type PolicyPlugin ¶
type PolicyPlugin struct {
Reference string
Artifact inspect.ArtifactIdentity
Descriptor policyelements.SemanticDeciderDescriptor
Factory func(context.Context, legacy.Options) (policyelements.SemanticDecider, error)
}
PolicyPlugin is the exact, independently owned semantic classifier selected for post-effect intent disposition. It is intentionally distinct from the continuation model even when both factories address the same deployment: each SemanticDeciderRegistry.Open call obtains a fresh client whose caller owns its lifecycle.
type SessionCancellation ¶
type SessionCancellation struct {
SessionID string `json:"session_id"`
Reason string `json:"reason,omitempty"`
}
SessionCancellation is the protocol-neutral request accepted by the graph. The trusted mounted service supplies the store; the repeated session ID prevents a boundary adapter from relabelling a request across sessions.
type SessionCancellationOutcome ¶
type SessionCancellationOutcome struct {
Kind SessionCancellationOutcomeKind `json:"kind"`
Operation string `json:"operation"`
TransactionID string `json:"transaction_id,omitempty"`
RequestItemID string `json:"request_item_id,omitempty"`
SessionID string `json:"session_id,omitempty"`
DurableIntentItemID string `json:"durable_intent_item_id,omitempty"`
GenerationID string `json:"generation_id,omitempty"`
ActionRunID string `json:"action_run_id,omitempty"`
ActionCallID string `json:"action_call_id,omitempty"`
ActionStage string `json:"action_stage,omitempty"`
PendingSettlement bool `json:"pending_settlement,omitempty"`
PendingProducer bool `json:"pending_producer,omitempty"`
PendingActivation bool `json:"pending_activation,omitempty"`
PendingModel bool `json:"pending_model,omitempty"`
PendingModelCommit bool `json:"pending_model_commit,omitempty"`
PendingActionAcks int `json:"pending_action_acks,omitempty"`
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
StateRevisionBefore uint64 `json:"state_revision_before"`
StateRevisionAfter uint64 `json:"state_revision_after"`
FinishedNS uint64 `json:"finished_ns"`
}
SessionCancellationOutcome is a content-free transaction projection. A transaction is completed only after every required typed acknowledgement; an unaddressable model run or already-crossed effect remains incomplete.
func (SessionCancellationOutcome) InspectionCause ¶
func (SessionCancellationOutcome) InspectionCause() element.InspectionCauseKind
type SessionCancellationOutcomeKind ¶
type SessionCancellationOutcomeKind string
const ( SessionCancellationAccepted SessionCancellationOutcomeKind = "accepted" SessionCancellationProgress SessionCancellationOutcomeKind = "progress" SessionCancellationCompleted SessionCancellationOutcomeKind = "completed" SessionCancellationNoCurrentIntent SessionCancellationOutcomeKind = "no_current_intent" SessionCancellationRefused SessionCancellationOutcomeKind = "refused" SessionCancellationIgnored SessionCancellationOutcomeKind = "ignored" SessionCancellationIncomplete SessionCancellationOutcomeKind = "incomplete" )
type SessionCancellationState ¶
type SessionCancellationState struct {
Revision uint64 `json:"revision"`
PendingTransactions int `json:"pending_transactions"`
Tombstones int `json:"tombstones"`
Requests uint64 `json:"requests"`
Completed uint64 `json:"completed"`
NoCurrentIntent uint64 `json:"no_current_intent"`
Refused uint64 `json:"refused"`
Incomplete uint64 `json:"incomplete"`
PendingSettlementAcks int `json:"pending_settlement_acks"`
PendingProducerAcks int `json:"pending_producer_acks"`
PendingActivationAcks int `json:"pending_activation_acks"`
PendingModelAcks int `json:"pending_model_acks"`
PendingModelCommitAcks int `json:"pending_model_commit_acks"`
PendingActionAcks int `json:"pending_action_acks"`
MaxTransactions int `json:"max_transactions"`
TombstoneMemory int `json:"tombstone_memory"`
ConfiguredActionAckKinds int `json:"configured_action_ack_stages"`
Saturated bool `json:"saturated"`
}
func (SessionCancellationState) InspectionCause ¶
func (SessionCancellationState) InspectionCause() element.InspectionCauseKind
type VisualConsequence ¶
type VisualConsequence struct {
CallID string `json:"call_id"`
Name string `json:"name"`
CanonicalResultItemID string `json:"canonical_result_item_id"`
TargetSource string `json:"target_source"`
StoreVersion uint64 `json:"store_version"`
}
VisualConsequence asks the observer to sample the bounded action target after one graph-authorized effect. It deliberately carries no model text or tool output; the canonical trajectory remains the source of that data.