Documentation
¶
Overview ¶
Package binding adapts one existing binding.Binding into a coarse graph element. It lets the current gateway and benchmark oracle run through the graph kernel while finer elements replace the compatibility node.
Index ¶
- Constants
- func SessionAdapterContract() plugin.Contract
- type AdapterBoundary
- type AdapterFactory
- type AdapterOperation
- type AdapterRegistration
- type Binding
- type Config
- type MountDependencyFactory
- type NativeBinding
- type NativeConfig
- type NativeRuntime
- func (runtime *NativeRuntime) Audio(ctx context.Context, frame perception.Frame) error
- func (runtime *NativeRuntime) Cancel(ctx context.Context, reason string) error
- func (runtime *NativeRuntime) Close(ctx context.Context, cause error) error
- func (runtime *NativeRuntime) CommitAudio(ctx context.Context) error
- func (runtime *NativeRuntime) CreateResponse(ctx context.Context) error
- func (runtime *NativeRuntime) Done() <-chan struct{}
- func (runtime *NativeRuntime) Graph() ir.Graph
- func (runtime *NativeRuntime) Live() inspect.Live
- func (runtime *NativeRuntime) RecordedTrace() (inspect.LiveTrace, error)
- func (runtime *NativeRuntime) Status() legacy.Status
- func (runtime *NativeRuntime) Text(ctx context.Context, input legacy.TextInput) error
- func (runtime *NativeRuntime) ToolResult(ctx context.Context, result trajectory.ToolResult) error
- func (runtime *NativeRuntime) Trajectory() trajectory.Snapshot
- func (runtime *NativeRuntime) Truncate(ctx context.Context, truncation legacy.Truncation) error
- func (runtime *NativeRuntime) Update(ctx context.Context, settings legacy.Settings) error
- func (runtime *NativeRuntime) Video(ctx context.Context, frame perception.Frame) error
- type Runtime
- func (runtime *Runtime) Audio(ctx context.Context, frame perception.Frame) error
- func (runtime *Runtime) Cancel(ctx context.Context, reason string) error
- func (runtime *Runtime) Close(ctx context.Context, cause error) error
- func (runtime *Runtime) CommitAudio(ctx context.Context) error
- func (runtime *Runtime) CreateResponse(ctx context.Context) error
- func (runtime *Runtime) Graph() ir.Graph
- func (runtime *Runtime) Live() inspect.Live
- func (runtime *Runtime) RecordedTrace() (inspect.LiveTrace, error)
- func (runtime *Runtime) Status() legacy.Status
- func (runtime *Runtime) Text(ctx context.Context, input legacy.TextInput) error
- func (runtime *Runtime) ToolResult(ctx context.Context, result trajectory.ToolResult) error
- func (runtime *Runtime) Trajectory() trajectory.Snapshot
- func (runtime *Runtime) Truncate(ctx context.Context, truncation legacy.Truncation) error
- func (runtime *Runtime) Update(ctx context.Context, settings legacy.Settings) error
- func (runtime *Runtime) Video(ctx context.Context, frame perception.Frame) error
- type SessionAdapter
- type SessionAdapterProfile
- type TraceRecordingConfig
Constants ¶
const SessionAdapterProfileFormatVersion uint64 = 1
Variables ¶
This section is empty.
Functions ¶
func SessionAdapterContract ¶
Types ¶
type AdapterBoundary ¶
type AdapterBoundary struct {
Operation AdapterOperation `json:"operation"`
Boundary string `json:"boundary"`
Direction ir.BoundaryDirection `json:"direction"`
Type element.Type `json:"type"`
}
AdapterBoundary maps one stable gateway operation to one exact Graph IR boundary. Direction and Type are duplicated intentionally: they make the adapter contract reviewable without loading topology, then ValidateGraph proves that declaration is not stale.
type AdapterFactory ¶
type AdapterFactory func( context.Context, *graphruntime.Mounted, legacy.Options, SessionAdapterProfile, ) (SessionAdapter, error)
AdapterFactory binds one mounted graph to one client session. It must acquire graph ports synchronously and return only after the adapter is ready for Run; this lets NativeBinding start the output drainer before graph nodes can publish readiness or response events.
type AdapterOperation ¶
type AdapterOperation string
AdapterOperation is one direction of the stable gateway/session boundary. A profile lists only operations it supports; absence is the exact, inspectable representation of ErrUnsupported.
const ( AdapterInputUpdate AdapterOperation = "gateway.input.update" AdapterInputAudio AdapterOperation = "gateway.input.audio" AdapterInputVideo AdapterOperation = "gateway.input.video" AdapterInputText AdapterOperation = "gateway.input.text" AdapterInputToolResult AdapterOperation = "gateway.input.tool_result" AdapterInputCommitAudio AdapterOperation = "gateway.input.commit_audio" AdapterInputCreateResponse AdapterOperation = "gateway.input.create_response" AdapterInputCancel AdapterOperation = "gateway.input.cancel" AdapterInputTruncate AdapterOperation = "gateway.input.truncate" AdapterOutputTurnBegin AdapterOperation = "gateway.output.turn_begin" AdapterOutputTurnEnd AdapterOperation = "gateway.output.turn_end" AdapterOutputActivity AdapterOperation = "gateway.output.activity" AdapterOutputTranscript AdapterOperation = "gateway.output.transcript" AdapterOutputObservation AdapterOperation = "gateway.output.observation" AdapterOutputSpeechBegin AdapterOperation = "gateway.output.speech_begin" AdapterOutputSpeechText AdapterOperation = "gateway.output.speech_text" AdapterOutputSpeechAudio AdapterOperation = "gateway.output.speech_audio" AdapterOutputSpeechEnd AdapterOperation = "gateway.output.speech_end" AdapterOutputToolCalls AdapterOperation = "gateway.output.tool_calls" AdapterOutputFailed AdapterOperation = "gateway.output.failed" AdapterOutputDebug AdapterOperation = "gateway.output.debug" )
type AdapterRegistration ¶
type AdapterRegistration struct {
Reference string
Artifact inspect.ArtifactIdentity
Factory AdapterFactory
}
AdapterRegistration selects the exact executable that realizes a frozen adapter profile. Factory is process-private; Reference and Artifact are the complete public deployment evidence.
func (AdapterRegistration) Validate ¶
func (registration AdapterRegistration) Validate() error
Validate verifies the complete resource-free identity and executable registration. It does not invoke Factory. Catalogs use this method to reject malformed adapter contributions before selecting a graph-specific adapter.
type Binding ¶
type Binding struct {
// contains filtered or unexported fields
}
Binding preserves the existing external session interface while mounting every session through immutable Graph IR.
func (*Binding) Capabilities ¶
func (binding *Binding) Capabilities() legacy.Capabilities
type Config ¶
type Config struct {
Inspection graphruntime.InspectionConfig
// ImplementationArtifact is the immutable deployment identity of the
// compatibility adapter/factory in this process. Trace recording requires
// this trusted registration evidence; a descriptor digest alone identifies
// an interface, not the executable material implementing it.
ImplementationArtifact *inspect.ArtifactIdentity
TraceRecording *TraceRecordingConfig
}
Config keeps live-inspection retention and trace recording explicit. A nil TraceRecording disables the recorder and its capture/allocation overhead.
type MountDependencyFactory ¶
type MountDependencyFactory func( context.Context, legacy.Options, ) ([]graphruntime.PreparedMountDependency, error)
MountDependencyFactory supplies only per-session service objects whose names, artifacts, and mount scope were already frozen into the prepared graph plan. It cannot replace process services, implementations, secret providers, or dependency identities.
type NativeBinding ¶
type NativeBinding struct {
// contains filtered or unexported fields
}
NativeBinding creates one independently mounted graph per Realtime session. It is the inverse of Binding: Binding places a legacy runtime behind a coarse compatibility node, while NativeBinding presents a fine-grained graph to the unchanged protocol gateway.
func NewNative ¶
func NewNative(config NativeConfig) (*NativeBinding, error)
NewNative validates and freezes the process-level graph session contract. It performs no provider discovery, secret resolution, or resource mounting; those operations remain behind Start and graph/assembly's exact preflight.
func (*NativeBinding) Graph ¶
func (binding *NativeBinding) Graph() ir.Graph
func (*NativeBinding) Name ¶
func (binding *NativeBinding) Name() string
func (*NativeBinding) SessionAdapterProfile ¶
func (binding *NativeBinding) SessionAdapterProfile() SessionAdapterProfile
SessionAdapterProfile is the graph-native protocol contract consumed by the gateway. Returning a defensive clone keeps the binding's mounted boundary selection immutable without recreating legacy Ownership/Capabilities methods.
type NativeConfig ¶
type NativeConfig struct {
Plan *graphconfig.Plan
// Catalog and SecretCatalog are the complete resource-free process
// inventory validated when the binding is constructed, before a listener
// can accept traffic.
Catalog graphassembly.Catalog
SecretCatalog *graphsecret.Document
MountDependencies MountDependencyFactory
AdapterProfile SessionAdapterProfile
Adapter AdapterRegistration
Inspection graphruntime.InspectionConfig
ShutdownTimeout time.Duration
TraceRecording *TraceRecordingConfig
}
NativeConfig describes a graph-native binding. Plan and AdapterProfile are immutable and shared by sessions; Catalog is selected and preflighted once; MountDependencies may supply only the exact session-scoped service values that preflight deliberately left unacquired.
type NativeRuntime ¶
type NativeRuntime struct {
// contains filtered or unexported fields
}
NativeRuntime supervises one adapter and one mounted graph as a single session. The management plane observes the mounted graph directly; protocol calls remain delegated to the boundary adapter.
func (*NativeRuntime) Audio ¶
func (runtime *NativeRuntime) Audio(ctx context.Context, frame perception.Frame) error
func (*NativeRuntime) Cancel ¶
func (runtime *NativeRuntime) Cancel(ctx context.Context, reason string) error
func (*NativeRuntime) Close ¶
func (runtime *NativeRuntime) Close(ctx context.Context, cause error) error
func (*NativeRuntime) CommitAudio ¶
func (runtime *NativeRuntime) CommitAudio(ctx context.Context) error
func (*NativeRuntime) CreateResponse ¶
func (runtime *NativeRuntime) CreateResponse(ctx context.Context) error
func (*NativeRuntime) Done ¶
func (runtime *NativeRuntime) Done() <-chan struct{}
func (*NativeRuntime) Graph ¶
func (runtime *NativeRuntime) Graph() ir.Graph
func (*NativeRuntime) Live ¶
func (runtime *NativeRuntime) Live() inspect.Live
func (*NativeRuntime) RecordedTrace ¶
func (runtime *NativeRuntime) RecordedTrace() (inspect.LiveTrace, error)
func (*NativeRuntime) Status ¶
func (runtime *NativeRuntime) Status() legacy.Status
func (*NativeRuntime) ToolResult ¶
func (runtime *NativeRuntime) ToolResult(ctx context.Context, result trajectory.ToolResult) error
func (*NativeRuntime) Trajectory ¶
func (runtime *NativeRuntime) Trajectory() trajectory.Snapshot
func (*NativeRuntime) Truncate ¶
func (runtime *NativeRuntime) Truncate(ctx context.Context, truncation legacy.Truncation) error
func (*NativeRuntime) Video ¶
func (runtime *NativeRuntime) Video(ctx context.Context, frame perception.Frame) error
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime is the current management-plane session interface backed by graph observation/action channels.
func (*Runtime) RecordedTrace ¶
RecordedTrace exposes the graph runtime's bounded payload-free recorder. It fails closed when the binding was created without explicit recording.
func (*Runtime) ToolResult ¶
func (runtime *Runtime) ToolResult(ctx context.Context, result trajectory.ToolResult) error
func (*Runtime) Trajectory ¶
func (runtime *Runtime) Trajectory() trajectory.Snapshot
type SessionAdapter ¶
type SessionAdapter interface {
Run(context.Context) error
Update(context.Context, legacy.Settings) error
Audio(context.Context, perception.Frame) error
Video(context.Context, perception.Frame) error
Text(context.Context, legacy.TextInput) error
ToolResult(context.Context, trajectory.ToolResult) error
CommitAudio(context.Context) error
CreateResponse(context.Context) error
Cancel(context.Context, string) error
Truncate(context.Context, legacy.Truncation) error
Trajectory() trajectory.Snapshot
Close(context.Context, error) error
}
SessionAdapter is the deliberately small seam between the stable Realtime session API and a graph's exported typed boundaries. Implementations contain protocol-to-boundary translation only; conversation policy belongs in graph elements. Run drains graph outputs until its context is cancelled.
NativeRuntime keeps the gateway's legacy.Runtime surface stable. The adapter deliberately excludes Status: graph identity comes from the immutable plan, while live node, capability, deployment, and adapter evidence comes from the mounted graph's authenticated inspection snapshot. An adapter must not manufacture a competing topology/role projection or mount a second graph.
type SessionAdapterProfile ¶
type SessionAdapterProfile struct {
FormatVersion uint64 `json:"format_version"`
Name string `json:"name"`
Revision uint64 `json:"revision"`
GraphFingerprint string `json:"graph_fingerprint"`
Contract plugin.Contract `json:"contract"`
Ownership legacy.Ownership `json:"ownership"`
Capabilities legacy.Capabilities `json:"capabilities"`
Boundaries []AdapterBoundary `json:"boundaries"`
BoundaryMapDigest string `json:"boundary_map_digest"`
ProjectionDigest string `json:"projection_digest"`
Fingerprint string `json:"fingerprint"`
}
SessionAdapterProfile is the immutable protocol-to-graph projection. Name, ownership, and capabilities are derived from this fingerprinted artifact; NativeConfig cannot assert independent values that drift from it.
func FreezeSessionAdapterProfile ¶
func FreezeSessionAdapterProfile(source SessionAdapterProfile) (SessionAdapterProfile, error)
func (SessionAdapterProfile) Clone ¶
func (profile SessionAdapterProfile) Clone() SessionAdapterProfile
func (SessionAdapterProfile) Validate ¶
func (profile SessionAdapterProfile) Validate() error
func (SessionAdapterProfile) ValidateGraph ¶
func (profile SessionAdapterProfile) ValidateGraph(graph ir.Graph) error
type TraceRecordingConfig ¶
type TraceRecordingConfig struct {
Limits inspect.TraceLimits
MaxRetainedBytes int
CaptureInterval time.Duration
}
TraceRecordingConfig contains only reusable bounds. Start generates a fresh per-session correlation key; callers cannot accidentally reuse one session's pseudonymization authority in another.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package adaptivevideo adapts the stable Realtime video and observation operations to the typed boundaries exported by a graph-native adaptive video composition.
|
Package adaptivevideo adapts the stable Realtime video and observation operations to the typed boundaries exported by a graph-native adaptive video composition. |
|
Package realtimecu adapts the stable OpenAI Realtime-compatible session surface to the locked graph-native Realtime-CU authority graph.
|
Package realtimecu adapts the stable OpenAI Realtime-compatible session surface to the locked graph-native Realtime-CU authority graph. |
|
Package scenarioconversation adapts the stable OpenAI Realtime-compatible session surface to a locked, fine-grained conversational graph.
|
Package scenarioconversation adapts the stable OpenAI Realtime-compatible session surface to a locked, fine-grained conversational graph. |