claudecode

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TitleFromMessage

func TitleFromMessage(text, fallback string) string

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements Backend by running the `claude` CLI in headless streaming mode (one process per turn, conversations resumed by session ID).

func NewClient

func NewClient() *Client

func (*Client) BaseURL

func (c *Client) BaseURL() string

func (*Client) CreateSession

func (c *Client) CreateSession(ctx context.Context, directory string) (*Session, error)

func (*Client) GetSession

func (c *Client) GetSession(ctx context.Context, sessionID string) (*Session, error)

func (*Client) Health

func (c *Client) Health(ctx context.Context) error

func (*Client) ListMessages

func (c *Client) ListMessages(ctx context.Context, sessionID string) ([]MessageResponse, error)

func (*Client) ListProviders

func (c *Client) ListProviders(ctx context.Context) ([]Provider, []string, error)

func (*Client) ListSessions

func (c *Client) ListSessions(ctx context.Context) ([]Session, error)

func (*Client) ReplyQuestion

func (c *Client) ReplyQuestion(ctx context.Context, requestID string, answers [][]string) error

func (*Client) SendMessageEvents

func (c *Client) SendMessageEvents(ctx context.Context, sessionID, text, _ string, modelID, _ string) <-chan StreamEvent

type MessageInfo

type MessageInfo struct {
	ID   string `json:"id"`
	Role string `json:"role"`
}

type MessageResponse

type MessageResponse struct {
	Info  MessageInfo `json:"info"`
	Parts []Part      `json:"parts"`
}

type Model

type Model struct {
	ID         string `json:"id"`
	ProviderID string `json:"providerID"`
	Name       string `json:"name"`
	Status     string `json:"status"`
}

type ModelRef

type ModelRef struct {
	ID         string `json:"id"`
	ProviderID string `json:"providerID"`
	Variant    string `json:"variant"`
}

type Part

type Part struct {
	Type string     `json:"type"`
	Text string     `json:"text,omitempty"`
	Tool *ToolEvent `json:"tool,omitempty"`
}

type Provider

type Provider struct {
	ID     string           `json:"id"`
	Name   string           `json:"name"`
	Models map[string]Model `json:"models"`
}

type Session

type Session struct {
	ID        string      `json:"id"`
	Title     string      `json:"title"`
	Directory string      `json:"directory"`
	Model     *ModelRef   `json:"model"`
	Time      SessionTime `json:"time"`
}

type SessionTime

type SessionTime struct {
	Created int64 `json:"created"`
	Updated int64 `json:"updated"`
}

type StreamEvent

type StreamEvent struct {
	Text string
	Tool *ToolEvent
}

type ToolEvent

type ToolEvent struct {
	ID     string
	Name   string
	Input  string
	Output string
	Error  string
}

Jump to

Keyboard shortcuts

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