model

package
v0.97.8 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package model provides shared data types for UI views and transport.

Package model provides shared data types for UI views and transport.

Package model provides shared data types for UI views and transport.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentChatMessage added in v0.95.0

type AgentChatMessage struct {
	Role               string    `json:"role"`
	Kind               string    `json:"kind"`
	Text               string    `json:"text"`
	HTML               string    `json:"html"`
	ToolName           string    `json:"tool_name"`
	ToolStatus         string    `json:"tool_status"`
	ToolStdout         string    `json:"tool_stdout"`
	ToolStderr         string    `json:"tool_stderr"`
	DurationMs         int64     `json:"duration_ms,omitempty"`
	TurnDurationMs     int64     `json:"turn_duration_ms,omitempty"`
	ThinkingDurationMs int64     `json:"thinking_duration_ms,omitempty"`
	RunDurationMs      int64     `json:"run_duration_ms,omitempty"`
	CreatedAt          time.Time `json:"created_at"`
}

AgentChatMessage is one user or assistant turn for chat UI display.

type AgentPlan added in v0.94.0

type AgentPlan struct {
	PlanID    string    `json:"plan_id"`
	URI       string    `json:"uri"`
	Title     string    `json:"title"`
	CreatedAt time.Time `json:"created_at"`
}

AgentPlan represents a persisted plan document for UI display.

type AgentScheduledTask added in v0.95.0

type AgentScheduledTask struct {
	TaskID          string     `json:"task_id"`
	Name            string     `json:"name"`
	ScheduleKind    string     `json:"schedule_kind"`
	Cron            string     `json:"cron"`
	RunAt           *time.Time `json:"run_at"`
	Prompt          string     `json:"prompt"`
	State           string     `json:"state"`
	SourceSessionID string     `json:"source_session_id"`
	LastRunAt       *time.Time `json:"last_run_at"`
	NextRunAt       *time.Time `json:"next_run_at"`
	CreatedAt       time.Time  `json:"created_at"`
	UpdatedAt       time.Time  `json:"updated_at"`
}

AgentScheduledTask represents one scheduled task for UI display and transport.

type AgentScheduledTaskRun added in v0.95.0

type AgentScheduledTaskRun struct {
	RunID        string     `json:"run_id"`
	TaskID       string     `json:"task_id"`
	RunSessionID string     `json:"run_session_id"`
	State        string     `json:"state"`
	Reply        string     `json:"reply"`
	Error        string     `json:"error"`
	StartedAt    time.Time  `json:"started_at"`
	FinishedAt   *time.Time `json:"finished_at"`
}

AgentScheduledTaskRun represents one scheduled task execution for UI display.

type AgentSession added in v0.93.0

type AgentSession struct {
	Flag            string    `json:"flag"`
	Title           string    `json:"title"`
	UID             string    `json:"uid"`
	LeafID          string    `json:"leaf_id"`
	State           string    `json:"state"`
	TotalDurationMs int64     `json:"total_duration_ms,omitempty"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
}

AgentSession represents a chat agent session for UI display and transport.

type AgentSessionEntry added in v0.93.0

type AgentSessionEntry struct {
	Flag        string    `json:"flag"`
	SessionID   string    `json:"session_id"`
	ParentID    string    `json:"parent_id"`
	EntryType   string    `json:"entry_type"`
	PayloadJSON string    `json:"payload_json"`
	CreatedAt   time.Time `json:"created_at"`
}

AgentSessionEntry represents one append-only node in a chat session tree for UI display.

type AgentSkill added in v0.93.0

type AgentSkill struct {
	Flag                   string           `json:"flag"`
	Name                   string           `json:"name"`
	Description            string           `json:"description"`
	Content                string           `json:"content"`
	BaseDir                string           `json:"base_dir"`
	Source                 string           `json:"source"`
	Enabled                bool             `json:"enabled"`
	DisableModelInvocation bool             `json:"disable_model_invocation"`
	Files                  []AgentSkillFile `json:"files,omitempty"`
	CreatedAt              time.Time        `json:"created_at"`
	UpdatedAt              time.Time        `json:"updated_at"`
}

AgentSkill represents an agent skill definition for UI display and transport.

type AgentSkillFile added in v0.94.0

type AgentSkillFile struct {
	SkillFlag string    `json:"skill_flag"`
	Path      string    `json:"path"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

AgentSkillFile represents one auxiliary file in an agent skill directory.

type AgentSubagent added in v0.93.0

type AgentSubagent struct {
	Flag         string    `json:"flag"`
	Name         string    `json:"name"`
	Description  string    `json:"description"`
	SystemPrompt string    `json:"system_prompt"`
	Tools        []string  `json:"tools"`
	Skills       []string  `json:"skills"`
	Model        string    `json:"model"`
	Source       string    `json:"source"`
	Enabled      bool      `json:"enabled"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

AgentSubagent represents a chat assistant subagent definition for UI display and transport.

type AgentSubagentFormParams added in v0.94.0

type AgentSubagentFormParams struct {
	Item            AgentSubagent              `json:"item"`
	IsNew           bool                       `json:"is_new"`
	Errors          map[string]string          `json:"errors,omitempty"`
	AvailableTools  []string                   `json:"available_tools"`
	AvailableSkills []AgentSubagentSkillOption `json:"available_skills"`
}

AgentSubagentFormParams carries data for rendering the subagent create/edit form.

type AgentSubagentSkillOption added in v0.94.0

type AgentSubagentSkillOption struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

AgentSubagentSkillOption is one selectable skill in the subagent form.

type AgentSubagentTask added in v0.94.0

type AgentSubagentTask struct {
	ID           int64      `json:"id"`
	SessionID    string     `json:"session_id"`
	SubagentName string     `json:"subagent_name"`
	Description  string     `json:"description"`
	Prompt       string     `json:"prompt"`
	Status       string     `json:"status"`
	Result       string     `json:"result"`
	ErrorText    string     `json:"error_text"`
	Depth        int        `json:"depth"`
	StartedAt    time.Time  `json:"started_at"`
	FinishedAt   *time.Time `json:"finished_at,omitempty"`
	CreatedAt    time.Time  `json:"created_at"`
	UpdatedAt    time.Time  `json:"updated_at"`
}

AgentSubagentTask represents one delegated subagent task for UI display and transport.

type ConfigItem

type ConfigItem struct {
	ID        int64     `json:"id"`
	UID       string    `json:"uid"`
	Topic     string    `json:"topic"`
	Key       string    `json:"key"`
	Value     types.KV  `json:"value"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

ConfigItem represents a row from the configs database table.

type NotifyChannel

type NotifyChannel struct {
	ID        int64     `json:"id"`
	Name      string    `json:"name"`
	Protocol  string    `json:"protocol"`
	URI       string    `json:"uri"` // masked for display
	Enabled   bool      `json:"enabled"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

NotifyChannel represents a configured notification channel for UI display. The URI is masked for display; raw URI is never exposed to the client.

type NotifyRule

type NotifyRule struct {
	ID             int64     `json:"id"`
	RuleID         string    `json:"rule_id"`
	Name           string    `json:"name"`
	Action         string    `json:"action"`
	EventPattern   string    `json:"event_pattern"`
	ChannelPattern string    `json:"channel_pattern"`
	Condition      string    `json:"condition"`
	Priority       int       `json:"priority"`
	ParamsJSON     string    `json:"params_json"` // JSON string for form display
	Enabled        bool      `json:"enabled"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}

NotifyRule represents a notification routing rule for UI display.

type NotifyTemplate added in v0.97.8

type NotifyTemplate struct {
	ID              int64     `json:"id"`
	TemplateID      string    `json:"template_id"`
	Name            string    `json:"name"`
	Description     string    `json:"description"`
	DefaultFormat   string    `json:"default_format"`
	DefaultTemplate string    `json:"default_template"`
	OverridesJSON   string    `json:"overrides_json"` // JSON array string for form display
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
}

NotifyTemplate represents a notification message template for UI display and forms.

type TokenItem

type TokenItem struct {
	Token      string     `json:"token"`
	UID        types.Uid  `json:"uid"`
	Scopes     []string   `json:"scopes"`
	CreatedAt  time.Time  `json:"created_at"`
	LastUsedAt *time.Time `json:"last_used_at,omitempty"`
	ExpiredAt  time.Time  `json:"expired_at"`
}

TokenItem represents a token row displayed in the token management UI.

Jump to

Keyboard shortcuts

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