proto.go

 1package proto
 2
 3import (
 4	"github.com/charmbracelet/catwalk/pkg/catwalk"
 5	"github.com/charmbracelet/crush/internal/message"
 6)
 7
 8// Instance represents a running app.App instance with its associated resources
 9// and state.
10type Instance struct {
11	ID      string `json:"id"`
12	Path    string `json:"path"`
13	YOLO    bool   `json:"yolo,omitempty"`
14	Debug   bool   `json:"debug,omitempty"`
15	DataDir string `json:"data_dir,omitempty"`
16}
17
18// Error represents an error response.
19type Error struct {
20	Message string `json:"message"`
21}
22
23// AgentInfo represents information about the agent.
24type AgentInfo struct {
25	IsBusy bool          `json:"is_busy"`
26	Model  catwalk.Model `json:"model"`
27}
28
29// IsZero checks if the AgentInfo is zero-valued.
30func (a AgentInfo) IsZero() bool {
31	return a == AgentInfo{}
32}
33
34// AgentMessage represents a message sent to the agent.
35type AgentMessage struct {
36	SessionID   string               `json:"session_id"`
37	Prompt      string               `json:"prompt"`
38	Attachments []message.Attachment `json:"attachments,omitempty"`
39}