agentstream

package
v1.1.41 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0 modules, 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 agentstream contains the transport-neutral Native Agent stream contract. Runtime execution and durable turn storage live in dirextalk-agent; message-server keeps only these DTOs at its realtime/action boundary.

Index

Constants

View Source
const (
	EventAccepted = "accepted"
	EventRuntime  = "runtime"
	EventError    = "error"
)

Variables

View Source
var (
	ErrTurnIDReused = errors.New("M_TURN_ID_REUSED")
	ErrTurnNotFound = errors.New("M_TURN_NOT_FOUND")
)

Functions

func ConversationID

func ConversationID(params map[string]any) string

ConversationID returns the canonical conversation key accepted by the public stream facade. The external runner validates ownership and format; this helper only provides deterministic alias selection for error frames.

func ValidID

func ValidID(value string) bool

ValidID reports whether an owner/turn/conversation identifier is safe for the external durable stream boundary.

Types

type Event

type Event struct {
	Event string
	// Seq is the positive remote-operation cursor for a durable stream. It is
	// zero for non-durable streams and for malformed upstream cursor values.
	Seq  int64
	Data map[string]any
}

Event is one Native Agent runner stream event.

type EventRecord

type EventRecord struct {
	OwnerID        string
	TurnID         string
	ConversationID string
	Seq            int64
	Kind           string
	Event          string
	Data           map[string]any
	CreatedAt      time.Time
}

EventRecord is one persisted remote-turn event projected by the external runner. It is intentionally separate from Event, which is the simple stream callback DTO.

type RuntimeEvent

type RuntimeEvent struct {
	Event string
	Data  map[string]any
}

RuntimeEvent is retained as a neutral callback shape for adapters that translate an external operation stream into StreamEvent values.

type State

type State string

State is the remote durable-turn state projected on the websocket facade.

const (
	StateAccepted    State = "accepted"
	StateRunning     State = "running"
	StateSucceeded   State = "succeeded"
	StateFailed      State = "failed"
	StateStopped     State = "stopped"
	StateInterrupted State = "interrupted"
)

func (State) Terminal

func (s State) Terminal() bool

type StreamEvent

type StreamEvent struct {
	Kind           string
	Turn           Turn
	TurnID         string
	IdempotencyKey string
	ConversationID string
	Revision       int64
	Seq            int64
	Event          string
	Data           map[string]any
}

StreamEvent is the callback DTO consumed by the realtime websocket facade.

type Turn

type Turn struct {
	OwnerID              string
	TurnID               string
	IdempotencyKey       string
	ConversationID       string
	Action               string
	ModelProfileID       string
	ModelProfileRevision int64
	CredentialVersion    int64
	Digest               [32]byte
	State                State
	Revision             int64
	Error                string
	CreatedAt            time.Time
	UpdatedAt            time.Time
}

Turn is the redacted remote-turn projection used by the public websocket facade. Digest and credential fields are retained for wire compatibility but are never populated by message-server's external runner.

Jump to

Keyboard shortcuts

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