model

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaVersionEventV1 = "agent-hub.event.v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cursor

type Cursor struct {
	Partition string `json:"partition"`
	Offset    int64  `json:"offset"`
}

func (Cursor) Validate

func (c Cursor) Validate() error

type Envelope

type Envelope struct {
	SchemaVersion string          `json:"schema_version"`
	EventID       string          `json:"event_id"`
	Partition     string          `json:"partition"`
	Offset        int64           `json:"offset"`
	ReceivedAt    time.Time       `json:"received_at"`
	Producer      Producer        `json:"producer,omitempty"`
	Event         NormalizedEvent `json:"event"`
}

func (Envelope) Validate

func (e Envelope) Validate() error

type EventType

type EventType string
const (
	EventSessionStarted    EventType = "agent.session.started"
	EventPromptSubmitted   EventType = "agent.prompt.submitted"
	EventSessionUpdated    EventType = "agent.session.updated"
	EventSessionFinished   EventType = "agent.session.finished"
	EventSessionFailed     EventType = "agent.session.failed"
	EventToolStarted       EventType = "agent.tool.started"
	EventToolFinished      EventType = "agent.tool.finished"
	EventPermissionAsked   EventType = "agent.permission.requested"
	EventPermissionReplied EventType = "agent.permission.replied"
)

type FetchResponse

type FetchResponse struct {
	ConsumerID     string     `json:"consumer_id"`
	Events         []Envelope `json:"events"`
	PreviousCursor Cursor     `json:"previous_cursor"`
	NextCursor     Cursor     `json:"next_cursor"`
	HasMore        bool       `json:"has_more"`
}

type Message added in v0.0.18

type Message struct {
	ID        string    `json:"id"`
	Text      string    `json:"text"`
	SessionID string    `json:"session_id,omitempty"`
	CreatedAt time.Time `json:"created_at"`
}

type MockConfig

type MockConfig struct {
	Version          string          `json:"version"`
	Runner           string          `json:"runner"`
	SessionID        string          `json:"session_id,omitempty"`
	Model            string          `json:"model,omitempty"`
	DelayMS          int             `json:"delay_ms,omitempty"`
	ExitCode         int             `json:"exit_code,omitempty"`
	Stderr           string          `json:"stderr,omitempty"`
	IgnoreHookErrors bool            `json:"ignore_hook_errors,omitempty"`
	HookCommand      string          `json:"hook_command,omitempty"`
	StdoutEvents     json.RawMessage `json:"stdout_events,omitempty"` // Deprecated: use LLMEvents
	LLMEvents        json.RawMessage `json:"llm_events,omitempty"`
	Hooks            []MockHook      `json:"hooks,omitempty"`
}

type MockHook

type MockHook struct {
	At      string          `json:"at"`
	Event   string          `json:"event"`
	Payload json.RawMessage `json:"payload,omitempty"`
}

type NormalizedEvent

type NormalizedEvent struct {
	EventType       EventType       `json:"event_type"`
	Runner          string          `json:"runner"`
	RunnerSessionID string          `json:"runner_session_id,omitempty"`
	Workspace       string          `json:"workspace,omitempty"`
	Model           string          `json:"model,omitempty"`
	Prompt          string          `json:"prompt,omitempty"`
	OccurredAt      time.Time       `json:"occurred_at,omitempty"`
	Payload         json.RawMessage `json:"payload,omitempty"`
}

func (NormalizedEvent) Validate

func (e NormalizedEvent) Validate() error

type Producer

type Producer struct {
	CLIVersion string `json:"cli_version,omitempty"`
	Hostname   string `json:"hostname,omitempty"`
	PID        int    `json:"pid,omitempty"`
}

type SessionData added in v0.0.18

type SessionData struct {
	Runner          string  `json:"runner"`
	RunnerSessionID string  `json:"runner_session_id"`
	Status          string  `json:"status"`
	LastEvent       *Cursor `json:"last_event,omitempty"`
}

Jump to

Keyboard shortcuts

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