client

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient   *http.Client
	StreamClient *http.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(url, authToken string) *Client

func (*Client) BaseURL

func (c *Client) BaseURL() string

func (*Client) ClearMemory

func (c *Client) ClearMemory() (int, error)

func (*Client) Compact

func (c *Client) Compact() (*CompactResult, error)

func (*Client) Connect

func (c *Client) Connect(provider, apiURL, apiKey, model string) error

func (*Client) GetMemorySnapshot

func (c *Client) GetMemorySnapshot() (map[string]any, error)

func (*Client) GetMemoryState

func (c *Client) GetMemoryState() (*MemoryState, error)

func (*Client) GetStatus

func (c *Client) GetStatus() (*StatusResult, error)

func (*Client) Interrupt

func (c *Client) Interrupt() error

func (*Client) ListModels

func (c *Client) ListModels() ([]string, string, error)

func (*Client) ListSkills

func (c *Client) ListSkills() ([]Skill, error)

func (*Client) LoadSkill

func (c *Client) LoadSkill(name string) (string, error)

func (*Client) ResetSession

func (c *Client) ResetSession() error

func (*Client) SendConfirm

func (c *Client) SendConfirm(id string, ok bool) error

func (*Client) SendQuestion

func (c *Client) SendQuestion(id string, answers [][]string) error

func (*Client) SetMemoryState

func (c *Client) SetMemoryState(enabled bool) error

func (*Client) SetMode

func (c *Client) SetMode(auto bool) error

func (*Client) SetModel

func (c *Client) SetModel(model string) error

func (*Client) Shutdown

func (c *Client) Shutdown() error

func (*Client) StreamChat

func (c *Client) StreamChat(payload map[string]string) <-chan Event

StreamChat sends a chat payload and returns a channel of neutral Events.

type CompactResult

type CompactResult struct {
	Summary      string `json:"summary"`
	TokensBefore int    `json:"tokens_before"`
	TokensAfter  int    `json:"tokens_after"`
}

type Event

type Event interface {
	// contains filtered or unexported methods
}

Event is a neutral streaming event emitted by the backend.

type EventConfirm

type EventConfirm struct {
	ID         string
	Tool       string
	Risk       string
	Title      string
	Summary    string
	Details    []string
	Args       string
	Preview    string
	DefaultVal string
}

type EventDone

type EventDone struct {
	TokenCount int
	TokenLimit int
}

type EventError

type EventError struct{ Text string }

type EventQuestion

type EventQuestion struct {
	ID        string
	Questions []QuestionItem
}

type EventThink

type EventThink struct{ Text string }

type EventToken

type EventToken struct{ Text string }

type EventTool

type EventTool struct{ Tool ToolMsg }

type EventToolStart

type EventToolStart struct {
	Name string
	Args string
}

type EventWardenStart

type EventWardenStart struct{}

type MemoryState

type MemoryState struct {
	Enabled   bool `json:"enabled"`
	Entries   int  `json:"entries"`
	Snapshots int  `json:"snapshots"`
	DBSize    int  `json:"db_size"`
}

type QuestionItem

type QuestionItem struct {
	Question string
	Header   string
	Options  []QuestionOption
	Multiple bool
}

type QuestionOption

type QuestionOption struct {
	Label       string
	Description string
}

type Skill

type Skill struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Location    string `json:"location"`
}

type StatusResult

type StatusResult struct {
	Model      string `json:"model"`
	Mode       string `json:"mode"`
	CWD        string `json:"cwd"`
	TokenCount int    `json:"token_count"`
	TokenLimit int    `json:"token_limit"`
}

type TokenMsg

type TokenMsg struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

type ToolMsg

type ToolMsg struct {
	Type   string `json:"type"`
	Name   string `json:"name"`
	Args   string `json:"args"`
	Result string `json:"result"`
	Diff   string `json:"diff"`
}

Jump to

Keyboard shortcuts

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