Files
local-mcp/go-server/internal/models/models.go
2026-03-27 18:32:25 +08:00

46 lines
1.5 KiB
Go

// Package models defines the core data types shared across all packages.
package models
import "time"
// InstructionStatus represents the lifecycle state of a queue item.
type InstructionStatus string
const (
StatusPending InstructionStatus = "pending"
StatusConsumed InstructionStatus = "consumed"
)
// Instruction is a single item in the queue.
type Instruction struct {
ID string `json:"id"`
Content string `json:"content"`
Status InstructionStatus `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ConsumedAt *time.Time `json:"consumed_at"`
ConsumedByAgentID *string `json:"consumed_by_agent_id"`
Position int `json:"position"`
}
// Settings holds user-configurable runtime parameters.
type Settings struct {
DefaultWaitSeconds int `json:"default_wait_seconds"`
DefaultEmptyResponse string `json:"default_empty_response"`
}
// AgentActivity tracks the last time an agent called get_user_request.
type AgentActivity struct {
AgentID string `json:"agent_id"`
LastSeenAt time.Time `json:"last_seen_at"`
LastFetchAt time.Time `json:"last_fetch_at"`
LastResultType string `json:"last_result_type"`
}
// QueueCounts summarises the number of items in each state.
type QueueCounts struct {
PendingCount int `json:"pending_count"`
ConsumedCount int `json:"consumed_count"`
}