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 ¶
const ( EventAccepted = "accepted" EventRuntime = "runtime" EventError = "error" )
Variables ¶
var ( ErrTurnIDReused = errors.New("M_TURN_ID_REUSED") ErrTurnNotFound = errors.New("M_TURN_NOT_FOUND") )
Functions ¶
func ConversationID ¶
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.
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 ¶
RuntimeEvent is retained as a neutral callback shape for adapters that translate an external operation stream into StreamEvent values.
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 SSE 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 HTTP/SSE facade. Digest and credential fields are retained for wire compatibility but are never populated by message-server's external runner.