api

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLimit = 50
View Source
const MaxLimit = 200

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Multi       bool   `json:"multi"`
}

Agent represents an agent in the API

type CreateAgentConfigRequest

type CreateAgentConfigRequest struct {
	Filename    string `json:"filename"`
	Model       string `json:"model"`
	Description string `json:"description"`
	Instruction string `json:"instruction"`
}

CreateAgentConfigRequest represents a request to create an agent manually

type CreateAgentConfigResponse

type CreateAgentConfigResponse struct {
	Filepath string `json:"filepath"`
}

CreateAgentConfigResponse represents the response from creating an agent config

type CreateAgentRequest

type CreateAgentRequest struct {
	Prompt string `json:"prompt"`
}

CreateAgentRequest represents a request to create an agent

type CreateAgentResponse

type CreateAgentResponse struct {
	Path string `json:"path"`
	Out  string `json:"out"`
}

CreateAgentResponse represents the response from creating an agent

type DeleteAgentRequest

type DeleteAgentRequest struct {
	FilePath string `json:"file_path"`
}

DeleteAgentRequest represents a request to delete an agent

type DeleteAgentResponse

type DeleteAgentResponse struct {
	FilePath string `json:"filePath"`
}

DeleteAgentResponse represents the response from deleting an agent

type DesktopTokenResponse

type DesktopTokenResponse struct {
	Token string `json:"token"`
}

DesktopTokenResponse represents the response from getting a desktop token

type EditAgentConfigRequest

type EditAgentConfigRequest struct {
	AgentConfig latest.Config `json:"agent_config"`
	Filename    string        `json:"filename"`
}

EditAgentConfigRequest represents a request to edit an agent config

type EditAgentConfigResponse

type EditAgentConfigResponse struct {
	Message string `json:"message"`
	Path    string `json:"path"`
	Config  any    `json:"config"`
}

EditAgentConfigResponse represents the response from editing an agent config

type ExportAgentsResponse

type ExportAgentsResponse struct {
	ZipPath      string `json:"zipPath"`
	ZipFile      string `json:"zipFile"`
	ZipDirectory string `json:"zipDirectory"`
	AgentsDir    string `json:"agentsDir"`
	CreatedAt    string `json:"createdAt"`
}

ExportAgentsResponse represents the response from exporting agents

type ImportAgentRequest

type ImportAgentRequest struct {
	FilePath string `json:"file_path"`
}

ImportAgentRequest represents a request to import an agent

type ImportAgentResponse

type ImportAgentResponse struct {
	OriginalPath string `json:"originalPath"`
	TargetPath   string `json:"targetPath"`
	Description  string `json:"description"`
}

ImportAgentResponse represents the response from importing an agent

type Message

type Message struct {
	Role         chat.MessageRole   `json:"role"`
	Content      string             `json:"content"`
	MultiContent []chat.MessagePart `json:"multi_content,omitempty"`
}

type PaginationMetadata added in v1.9.1

type PaginationMetadata struct {
	TotalMessages int    `json:"total_messages"`        // Total number of messages in session
	Limit         int    `json:"limit"`                 // Number of messages in this response
	PrevCursor    string `json:"prev_cursor,omitempty"` // Cursor for previous page (empty if no more messages)
}

PaginationMetadata contains pagination information

func PaginateMessages added in v1.9.1

func PaginateMessages(messages []session.Message, params PaginationParams) ([]session.Message, *PaginationMetadata, error)

type PaginationParams added in v1.9.1

type PaginationParams struct {
	Limit  int
	Before string
}

type PullAgentRequest

type PullAgentRequest struct {
	Name string `json:"name"`
}

PullAgentRequest represents a request to pull an agent

type PullAgentResponse

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

PullAgentResponse represents the response from pulling an agent

type PushAgentRequest

type PushAgentRequest struct {
	Filepath string `json:"filepath"`
	Tag      string `json:"tag"`
}

PushAgentRequest represents a request to push an agent

type PushAgentResponse

type PushAgentResponse struct {
	Filepath string `json:"filepath"`
	Tag      string `json:"tag"`
	Digest   string `json:"digest"`
}

PushAgentResponse represents the response from pushing an agent

type ResumeElicitationRequest added in v1.7.0

type ResumeElicitationRequest struct {
	Action  string         `json:"action"`  // "accept", "decline", or "cancel"
	Content map[string]any `json:"content"` // The submitted form data (only present when action is "accept")
}

ResumeElicitationRequest represents a request to resume with an elicitation response

type ResumeSessionRequest

type ResumeSessionRequest struct {
	Confirmation string `json:"confirmation"`
}

ResumeSessionRequest represents a request to resume a session

type SessionResponse

type SessionResponse struct {
	ID            string              `json:"id"`
	Title         string              `json:"title"`
	Messages      []session.Message   `json:"messages,omitempty"`
	CreatedAt     time.Time           `json:"created_at"`
	ToolsApproved bool                `json:"tools_approved"`
	InputTokens   int64               `json:"input_tokens"`
	OutputTokens  int64               `json:"output_tokens"`
	WorkingDir    string              `json:"working_dir,omitempty"`
	Pagination    *PaginationMetadata `json:"pagination,omitempty"`
}

SessionResponse represents a detailed session

type SessionsResponse

type SessionsResponse struct {
	ID           string `json:"id"`
	Title        string `json:"title"`
	CreatedAt    string `json:"created_at"`
	NumMessages  int    `json:"num_messages"`
	InputTokens  int64  `json:"input_tokens"`
	OutputTokens int64  `json:"output_tokens"`
	WorkingDir   string `json:"working_dir,omitempty"`
}

SessionsResponse represents a session in the sessions list

Jump to

Keyboard shortcuts

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