Help us shape the future of Go! Take the 2026 Go Developer Survey

bridge

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package bridge adapts an existing Orb runtime to Bridge without owning its lifetime.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Attachment

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

func Attach

func Attach(lifetime context.Context, host Host, options Options) (*Attachment, error)

func (*Attachment) Close

func (a *Attachment) Close() error

func (*Attachment) Invoke

func (a *Attachment) Invoke(ctx context.Context, method string, params json.RawMessage) (json.RawMessage, error)

func (*Attachment) SetGeneration

func (a *Attachment) SetGeneration(generation string) error

type Command added in v0.15.0

type Command struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

Command is a slash command the instance runs: an extension's, a prompt template or a skill.

type Completion added in v0.19.1

type Completion struct {
	Text   string `json:"text"`
	Label  string `json:"label"`
	Detail string `json:"detail,omitempty"`
}

Completion is one `@` completion: the text that replaces the token, and how to show it.

type Descriptor added in v0.14.0

type Descriptor struct {
	Status     string                `json:"status,omitempty"`
	Model      string                `json:"model,omitempty"`
	Provider   string                `json:"provider,omitempty"` // the model's: two providers may offer one name
	Thinking   string                `json:"thinking,omitempty"`
	Stats      *runtime.SessionStats `json:"stats,omitempty"`
	Usage      *usage.Snapshot       `json:"usage,omitempty"`
	Commands   []Command             `json:"commands,omitempty"`
	Catalog    string                `json:"catalog,omitempty"` // digest of models and commands, which a describe sending it omits
	Waits      bool                  `json:"waits"`             // events.subscribe takes wait: a follower long-polls
	State      string                `json:"state,omitempty"`   // the pulse this describes, read first: a follower waits for a change since
	Models     []bridge.Model        `json:"models,omitempty"`
	Name       string                `json:"name,omitempty"`
	CWD        string                `json:"cwd,omitempty"`
	InstanceID string                `json:"instance_id"`
	Service    string                `json:"service"`
	Generation string                `json:"registration_generation"`
	Target     runtime.ControlTarget `json:"target"`
	Methods    []string              `json:"methods"`
	Input      *runtime.InputRequest `json:"input,omitempty"`
}

Descriptor is what instances.describe reports about the attached runtime.

type Host

Host is the local non-owning attachment boundary shared by the SDK runtime and Orb's existing interactive host. It intentionally has no Dispose method.

type Options

type Options struct {
	Status func(*runtime.AgentSession) string
	// Usage is the plan limits of the session's provider account; nil when it reports none. A new
	// reading moves the pulse, so followers describe again. It is called often and must not block.
	Usage func(*runtime.AgentSession) *usage.Snapshot
	// Complete is what `@query` completes to in a message, as the TUI offers it.
	Complete    func(context.Context, *runtime.AgentSession, string) []Completion
	InstanceID  string
	Store       document.Document
	Authorize   func(bridge.Request) bool
	LedgerQuota int
}

Directories

Path Synopsis
Package tool exposes independently opt-in, source-attributed bridge tools.
Package tool exposes independently opt-in, source-attributed bridge tools.

Jump to

Keyboard shortcuts

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