compatbinding

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 13 Imported by: 1 module, 0 packages

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

Documentation

Overview

Package compatbinding mounts the existing binding.Runtime behind one coarse graph element. It is a migration oracle, not a reference architecture: its ports preserve current behavior while the binding internals are decomposed into ordinary perception, interaction, cognition, and action elements.

Index

Constants

View Source
const SessionServiceName = "compat.binding.session"

Variables

This section is empty.

Functions

func Descriptor

func Descriptor() element.Descriptor

Types

type Call

type Call struct {
	Kind       CallKind
	Context    context.Context
	Settings   binding.Settings
	Audio      perception.Frame
	Video      perception.Frame
	Text       binding.TextInput
	ToolResult trajectory.ToolResult
	Reason     string
	Truncate   binding.Truncation
	Done       chan error
}

Call stays in-process and is intentionally absent from descriptor bundles for remote placement. The compatibility element is local-only; decomposed elements use serializable protocol payloads.

type CallKind

type CallKind string
const (
	CallUpdate         CallKind = "update"
	CallAudio          CallKind = "audio"
	CallVideo          CallKind = "video"
	CallText           CallKind = "text"
	CallToolResult     CallKind = "tool_result"
	CallCommitAudio    CallKind = "commit_audio"
	CallCreateResponse CallKind = "create_response"
	CallCancel         CallKind = "cancel"
	CallTruncate       CallKind = "truncate"
)

type Config

type Config struct {
	Name         string               `json:"name"`
	Ownership    binding.Ownership    `json:"ownership"`
	Capabilities binding.Capabilities `json:"capabilities"`
}

type Factory

type Factory struct{}

func (Factory) Descriptor

func (Factory) Descriptor() element.Descriptor

func (Factory) Mount

func (Factory) ValidateConfig

func (Factory) ValidateConfig(source json.RawMessage) error

type Holder

type Holder struct {
	// contains filtered or unexported fields
}

Holder is the management-plane handle published during mount.

func NewHolder

func NewHolder() *Holder

func (*Holder) RequestClose

func (holder *Holder) RequestClose(cause error)

RequestClose records the session-level cause for the lifecycle disposer. The request is separate from graph cancellation so final sink events can be drained and acknowledged before output queues close.

func (*Holder) Status

func (holder *Holder) Status() (binding.Status, error)

Status and Trajectory are management-plane reads and therefore do not compete with realtime observation channels.

func (*Holder) Trajectory

func (holder *Holder) Trajectory() (trajectory.Snapshot, error)

func (*Holder) Wait

func (holder *Holder) Wait(ctx context.Context) error

type SessionService

type SessionService struct {
	Binding binding.Binding
	Options binding.Options
	Holder  *Holder
}

SessionService provides session-scoped coeffects without putting a Binding, Sink, dispatcher function, or secret into Graph IR.

type SinkEvent

type SinkEvent struct {
	Kind SinkEventKind
	// Context and Done are local-only synchronization coeffects. The coarse
	// compatibility element is deliberately not remotely placeable: existing
	// Sink methods are synchronous, so an adapter must return the downstream
	// result to the legacy producer instead of merely acknowledging enqueue.
	Context     context.Context
	Done        chan error
	TurnOutcome binding.TurnOutcome
	Activity    binding.ActivityEvent
	Transcript  binding.TranscriptEvent
	Observation perception.Observation
	Utterance   action.Utterance
	Text        string
	Frame       action.Frame
	SpeechEnd   action.Outcome
	ToolCalls   binding.ToolCallEvent
	Failure     binding.ErrorEvent
	Debug       binding.DebugEvent
}

type SinkEventKind

type SinkEventKind string
const (
	EventTurnBegin             SinkEventKind = "turn_begin"
	EventTurnEnd               SinkEventKind = "turn_end"
	EventActivity              SinkEventKind = "activity"
	EventTranscript            SinkEventKind = "transcript"
	EventObservation           SinkEventKind = "observation"
	EventSpeechReserved        SinkEventKind = "speech_reserved"
	EventSpeechReserveCanceled SinkEventKind = "speech_reservation_cancelled"
	EventSpeechBegin           SinkEventKind = "speech_begin"
	EventSpeechText            SinkEventKind = "speech_text"
	EventSpeechAudio           SinkEventKind = "speech_audio"
	EventSpeechEnd             SinkEventKind = "speech_end"
	EventToolCalls             SinkEventKind = "tool_calls"
	EventFailed                SinkEventKind = "failed"
	EventDebug                 SinkEventKind = "debug"
)

Jump to

Keyboard shortcuts

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