tarsclient

package
v0.14.3 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultServerURL = "http://127.0.0.1:43180"

DefaultServerURL is the fallback API base URL when Config.ServerURL is empty.

Variables

This section is empty.

Functions

func ScanSSELines

func ScanSSELines(r io.Reader, onData func([]byte) error) error

Types

type APIError

type APIError struct {
	Method   string
	Endpoint string
	Status   int
	Code     string
	Message  string
	Body     string
}

func (*APIError) Error

func (e *APIError) Error() string

type AgentDescriptor

type AgentDescriptor struct {
	Name               string   `json:"name"`
	Description        string   `json:"description,omitempty"`
	Enabled            bool     `json:"enabled,omitempty"`
	Kind               string   `json:"kind,omitempty"`
	Source             string   `json:"source,omitempty"`
	Entry              string   `json:"entry,omitempty"`
	Default            bool     `json:"default,omitempty"`
	PolicyMode         string   `json:"policy_mode,omitempty"`
	ToolsAllow         []string `json:"tools_allow,omitempty"`
	ToolsAllowCount    int      `json:"tools_allow_count,omitempty"`
	ToolsDeny          []string `json:"tools_deny,omitempty"`
	ToolsDenyCount     int      `json:"tools_deny_count,omitempty"`
	ToolsRiskMax       string   `json:"tools_risk_max,omitempty"`
	ToolsAllowGroups   []string `json:"tools_allow_groups,omitempty"`
	ToolsAllowPatterns []string `json:"tools_allow_patterns,omitempty"`
	SessionRoutingMode string   `json:"session_routing_mode,omitempty"`
	SessionFixedID     string   `json:"session_fixed_id,omitempty"`
}

type AgentRun

type AgentRun struct {
	RunID              string   `json:"run_id"`
	SessionID          string   `json:"session_id,omitempty"`
	ProjectID          string   `json:"project_id,omitempty"`
	Agent              string   `json:"agent,omitempty"`
	Status             string   `json:"status"`
	Accepted           bool     `json:"accepted"`
	Response           string   `json:"response,omitempty"`
	Error              string   `json:"error,omitempty"`
	DiagnosticCode     string   `json:"diagnostic_code,omitempty"`
	DiagnosticReason   string   `json:"diagnostic_reason,omitempty"`
	PolicyBlockedTool  string   `json:"policy_blocked_tool,omitempty"`
	PolicyAllowedTools []string `json:"policy_allowed_tools,omitempty"`
	PolicyDeniedTools  []string `json:"policy_denied_tools,omitempty"`
	PolicyRiskMax      string   `json:"policy_risk_max,omitempty"`
	CreatedAt          string   `json:"created_at,omitempty"`
	StartedAt          string   `json:"started_at,omitempty"`
	CompletedAt        string   `json:"completed_at,omitempty"`
}

type Approval

type Approval struct {
	ID          string      `json:"id"`
	Type        string      `json:"type"`
	Status      string      `json:"status"`
	RequestedAt string      `json:"requested_at,omitempty"`
	UpdatedAt   string      `json:"updated_at,omitempty"`
	ReviewedAt  string      `json:"reviewed_at,omitempty"`
	Plan        CleanupPlan `json:"plan"`
	Note        string      `json:"note,omitempty"`
}

type BrowserCheckResult

type BrowserCheckResult struct {
	SiteID     string `json:"site_id"`
	Profile    string `json:"profile,omitempty"`
	CheckCount int    `json:"check_count"`
	Passed     bool   `json:"passed"`
	Message    string `json:"message,omitempty"`
}

type BrowserLoginResult

type BrowserLoginResult struct {
	SiteID  string `json:"site_id"`
	Profile string `json:"profile,omitempty"`
	Mode    string `json:"mode,omitempty"`
	Success bool   `json:"success"`
	Message string `json:"message,omitempty"`
}

type BrowserProfile

type BrowserProfile struct {
	Name               string `json:"name"`
	Driver             string `json:"driver,omitempty"`
	Default            bool   `json:"default,omitempty"`
	Running            bool   `json:"running,omitempty"`
	ExtensionConnected bool   `json:"extension_connected,omitempty"`
}

type BrowserRunResult

type BrowserRunResult struct {
	SiteID    string `json:"site_id"`
	Profile   string `json:"profile,omitempty"`
	Action    string `json:"action,omitempty"`
	StepCount int    `json:"step_count"`
	Success   bool   `json:"success"`
	Message   string `json:"message,omitempty"`
}

type BrowserState

type BrowserState struct {
	Running            bool   `json:"running"`
	Profile            string `json:"profile,omitempty"`
	Driver             string `json:"driver,omitempty"`
	CurrentURL         string `json:"current_url,omitempty"`
	LastSnapshot       string `json:"last_snapshot,omitempty"`
	LastAction         string `json:"last_action,omitempty"`
	LastScreenshot     string `json:"last_screenshot,omitempty"`
	ExtensionConnected bool   `json:"extension_connected,omitempty"`
	AttachedTabs       int    `json:"attached_tabs,omitempty"`
	LastError          string `json:"last_error,omitempty"`
}

type ChannelReportMessage

type ChannelReportMessage struct {
	ID        string `json:"id"`
	ChannelID string `json:"channel_id"`
	Source    string `json:"source"`
	Direction string `json:"direction"`
	Text      string `json:"text"`
	Timestamp string `json:"timestamp"`
}

type ChatEvent

type ChatEvent struct {
	Type              string `json:"type"`
	Text              string `json:"text"`
	Error             string `json:"error"`
	SessionID         string `json:"session_id"`
	Message           string `json:"message"`
	Phase             string `json:"phase"`
	ToolName          string `json:"tool_name"`
	ToolCallID        string `json:"tool_call_id"`
	ToolArgsPreview   string `json:"tool_args_preview"`
	ToolResultPreview string `json:"tool_result_preview"`
	SkillName         string `json:"skill_name"`
	SkillReason       string `json:"skill_reason"`
}

type ChatRequest

type ChatRequest struct {
	Message   string `json:"message"`
	SessionID string `json:"session_id,omitempty"`
	ProjectID string `json:"project_id,omitempty"`
}

type ChatResult

type ChatResult struct {
	SessionID string
	Assistant string
}

type CleanupApplyResult

type CleanupApplyResult struct {
	ApprovalID   string   `json:"approval_id"`
	DeletedCount int      `json:"deleted_count"`
	DeletedBytes int64    `json:"deleted_bytes"`
	Errors       []string `json:"errors,omitempty"`
}

type CleanupCandidate

type CleanupCandidate struct {
	Path      string `json:"path"`
	SizeBytes int64  `json:"size_bytes"`
	Reason    string `json:"reason,omitempty"`
}

type CleanupPlan

type CleanupPlan struct {
	ApprovalID string             `json:"approval_id"`
	CreatedAt  string             `json:"created_at,omitempty"`
	TotalBytes int64              `json:"total_bytes"`
	Candidates []CleanupCandidate `json:"candidates"`
}

type Client

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

func New

func New(cfg Config) *Client

func (*Client) ActivateProject

func (c *Client) ActivateProject(ctx context.Context, projectID string, sessionID string) error

func (*Client) AdvanceProjectAutopilot added in v0.12.0

func (c *Client) AdvanceProjectAutopilot(ctx context.Context, projectID string) (ProjectPhaseSnapshot, error)

func (*Client) ApplyCleanup

func (c *Client) ApplyCleanup(ctx context.Context, approvalID string) (CleanupApplyResult, error)

func (*Client) ApproveCleanup

func (c *Client) ApproveCleanup(ctx context.Context, approvalID string) error

func (*Client) ApproveTelegramPairing

func (c *Client) ApproveTelegramPairing(ctx context.Context, code string) (TelegramPairingAllowed, error)

func (*Client) BrowserCheck

func (c *Client) BrowserCheck(ctx context.Context, siteID string, profile string) (BrowserCheckResult, error)

func (*Client) BrowserLogin

func (c *Client) BrowserLogin(ctx context.Context, siteID string, profile string) (BrowserLoginResult, error)

func (*Client) BrowserProfiles

func (c *Client) BrowserProfiles(ctx context.Context) ([]BrowserProfile, error)

func (*Client) BrowserRun

func (c *Client) BrowserRun(ctx context.Context, siteID string, flowAction string, profile string) (BrowserRunResult, error)

func (*Client) BrowserStatus

func (c *Client) BrowserStatus(ctx context.Context) (BrowserState, error)

func (*Client) CancelRun

func (c *Client) CancelRun(ctx context.Context, runID string) (AgentRun, error)

func (*Client) Compact

func (c *Client) Compact(ctx context.Context, sessionID string) (CompactInfo, error)

func (*Client) CompactWithOptions added in v0.10.2

func (c *Client) CompactWithOptions(ctx context.Context, req CompactRequest) (CompactInfo, error)

func (*Client) CreateCleanupPlan

func (c *Client) CreateCleanupPlan(ctx context.Context) (CleanupPlan, error)

func (*Client) CreateCronJob

func (c *Client) CreateCronJob(ctx context.Context, schedule, prompt string) (CronJob, error)

func (*Client) CreateProject

func (c *Client) CreateProject(ctx context.Context, req ProjectCreateRequest) (Project, error)

func (*Client) CreateSchedule

func (c *Client) CreateSchedule(ctx context.Context, req ScheduleCreateRequest) (ScheduleItem, error)

func (*Client) CreateSession

func (c *Client) CreateSession(ctx context.Context, title string) (SessionSummary, error)

func (*Client) DeleteCronJob

func (c *Client) DeleteCronJob(ctx context.Context, jobID string) error

func (*Client) DeleteProject

func (c *Client) DeleteProject(ctx context.Context, projectID string) error

func (*Client) DeleteSchedule

func (c *Client) DeleteSchedule(ctx context.Context, id string) error

func (*Client) DispatchProject added in v0.5.1

func (c *Client) DispatchProject(ctx context.Context, projectID string, stage string) (ProjectDispatchReport, error)

func (*Client) Do

func (c *Client) Do(ctx context.Context, method, path string, body any, out any) error

func (*Client) ExportSession

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

func (*Client) GatewayReload

func (c *Client) GatewayReload(ctx context.Context) (GatewayStatus, error)

func (*Client) GatewayReportChannels

func (c *Client) GatewayReportChannels(ctx context.Context, limit int) (GatewayReportChannels, error)

func (*Client) GatewayReportRuns

func (c *Client) GatewayReportRuns(ctx context.Context, limit int) (GatewayReportRuns, error)

func (*Client) GatewayReportSummary

func (c *Client) GatewayReportSummary(ctx context.Context) (GatewayReportSummary, error)

func (*Client) GatewayRestart

func (c *Client) GatewayRestart(ctx context.Context) (GatewayStatus, error)

func (*Client) GatewayStatus

func (c *Client) GatewayStatus(ctx context.Context) (GatewayStatus, error)

func (*Client) GetCronJob

func (c *Client) GetCronJob(ctx context.Context, jobID string) (CronJob, error)

func (*Client) GetEventHistory

func (c *Client) GetEventHistory(ctx context.Context, limit int) (EventsHistoryInfo, error)

func (*Client) GetHistory

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

func (*Client) GetProject

func (c *Client) GetProject(ctx context.Context, projectID string) (Project, error)

func (*Client) GetProjectAutopilot added in v0.5.1

func (c *Client) GetProjectAutopilot(ctx context.Context, projectID string) (ProjectAutopilotRun, error)

func (*Client) GetProjectBoard added in v0.5.1

func (c *Client) GetProjectBoard(ctx context.Context, projectID string) (ProjectBoard, error)

func (*Client) GetRun

func (c *Client) GetRun(ctx context.Context, runID string) (AgentRun, error)

func (*Client) GetUsageLimits

func (c *Client) GetUsageLimits(ctx context.Context) (UsageLimits, error)

func (*Client) GetUsageSummary

func (c *Client) GetUsageSummary(ctx context.Context, period string, groupBy string) (UsageSummary, UsageLimits, UsageLimitStatus, error)

func (*Client) Healthz

func (c *Client) Healthz(ctx context.Context) (HealthInfo, error)

func (*Client) HeartbeatRunOnce

func (c *Client) HeartbeatRunOnce(ctx context.Context) (HeartbeatInfo, error)

func (*Client) ListAgents

func (c *Client) ListAgents(ctx context.Context) ([]AgentDescriptor, error)

func (*Client) ListApprovals

func (c *Client) ListApprovals(ctx context.Context) ([]Approval, error)

func (*Client) ListCronJobs

func (c *Client) ListCronJobs(ctx context.Context) ([]CronJob, error)

func (*Client) ListCronRuns

func (c *Client) ListCronRuns(ctx context.Context, jobID string, limit int) ([]CronRunRecord, error)

func (*Client) ListMCPServers

func (c *Client) ListMCPServers(ctx context.Context) ([]MCPServerInfo, error)

func (*Client) ListMCPTools

func (c *Client) ListMCPTools(ctx context.Context) ([]MCPToolInfo, error)

func (*Client) ListPlugins

func (c *Client) ListPlugins(ctx context.Context) ([]PluginDef, error)

func (*Client) ListProjectActivity added in v0.5.1

func (c *Client) ListProjectActivity(ctx context.Context, projectID string, limit int) ([]ProjectActivity, error)

func (*Client) ListProjects

func (c *Client) ListProjects(ctx context.Context) ([]Project, error)

func (*Client) ListRuns

func (c *Client) ListRuns(ctx context.Context, limit int) ([]AgentRun, error)

func (*Client) ListSchedules

func (c *Client) ListSchedules(ctx context.Context) ([]ScheduleItem, error)

func (*Client) ListSessions

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

func (*Client) ListSkills

func (c *Client) ListSkills(ctx context.Context) ([]SkillDef, error)

func (*Client) MarkEventsRead

func (c *Client) MarkEventsRead(ctx context.Context, lastID int64) (EventsReadInfo, error)

func (*Client) Models

func (c *Client) Models(ctx context.Context) (ModelsInfo, error)

func (*Client) OpsStatus

func (c *Client) OpsStatus(ctx context.Context) (OpsStatus, error)

func (*Client) Providers

func (c *Client) Providers(ctx context.Context) (ProvidersInfo, error)

func (*Client) RejectCleanup

func (c *Client) RejectCleanup(ctx context.Context, approvalID string) error

func (*Client) ReloadExtensions

func (c *Client) ReloadExtensions(ctx context.Context) (ExtensionsReloadInfo, error)

func (*Client) RunCronJob

func (c *Client) RunCronJob(ctx context.Context, jobID string) (string, error)

func (*Client) SearchSessions

func (c *Client) SearchSessions(ctx context.Context, keyword string) ([]SessionSummary, error)

func (*Client) SpawnRun

func (c *Client) SpawnRun(ctx context.Context, req SpawnRequest) (AgentRun, error)

func (*Client) StartProjectAutopilot added in v0.5.1

func (c *Client) StartProjectAutopilot(ctx context.Context, projectID string) (ProjectAutopilotRun, error)

func (*Client) Status

func (c *Client) Status(ctx context.Context) (StatusInfo, error)

func (*Client) StreamChat

func (c *Client) StreamChat(ctx context.Context, req ChatRequest, onStatus func(ChatEvent), onDelta func(string)) (ChatResult, error)

func (*Client) StreamEvents

func (c *Client) StreamEvents(ctx context.Context, onEvent func(NotificationMessage), onError func(error))

func (*Client) StreamSSE

func (c *Client) StreamSSE(ctx context.Context, method, path string, body any, onData func([]byte) error) error

func (*Client) TelegramPairings

func (c *Client) TelegramPairings(ctx context.Context) (TelegramPairingsInfo, error)

func (*Client) UpdateCronJobEnabled

func (c *Client) UpdateCronJobEnabled(ctx context.Context, jobID string, enabled bool) (CronJob, error)

func (*Client) UpdateProject

func (c *Client) UpdateProject(ctx context.Context, projectID string, req ProjectUpdateRequest) (Project, error)

func (*Client) UpdateSchedule

func (c *Client) UpdateSchedule(ctx context.Context, id string, req ScheduleUpdateRequest) (ScheduleItem, error)

func (*Client) UpdateUsageLimits

func (c *Client) UpdateUsageLimits(ctx context.Context, req UsageLimits) (UsageLimits, error)

func (*Client) VaultStatus

func (c *Client) VaultStatus(ctx context.Context) (VaultStatusInfo, error)

func (*Client) Whoami

func (c *Client) Whoami(ctx context.Context) (WhoamiInfo, error)

type CompactInfo

type CompactInfo struct {
	Message string `json:"message"`
}

type CompactRequest added in v0.10.2

type CompactRequest struct {
	SessionID        string `json:"session_id"`
	KeepRecent       int    `json:"keep_recent,omitempty"`
	KeepRecentTokens int    `json:"keep_recent_tokens,omitempty"`
	Instructions     string `json:"instructions,omitempty"`
}

type Config

type Config struct {
	ServerURL     string
	APIToken      string
	AdminAPIToken string
	HTTPClient    *http.Client
}

type CronJob

type CronJob struct {
	ID             string `json:"id"`
	Name           string `json:"name"`
	Prompt         string `json:"prompt"`
	Schedule       string `json:"schedule"`
	Enabled        bool   `json:"enabled"`
	DeleteAfterRun bool   `json:"delete_after_run,omitempty"`
	SessionTarget  string `json:"session_target,omitempty"`
	ProjectID      string `json:"project_id,omitempty"`
	WakeMode       string `json:"wake_mode,omitempty"`
	DeliveryMode   string `json:"delivery_mode,omitempty"`
	LastRunAt      string `json:"last_run_at,omitempty"`
	LastRunError   string `json:"last_run_error,omitempty"`
}

type CronRunRecord

type CronRunRecord struct {
	JobID    string `json:"job_id"`
	RanAt    string `json:"ran_at"`
	Response string `json:"response,omitempty"`
	Error    string `json:"error,omitempty"`
}

type EventsHistoryInfo

type EventsHistoryInfo struct {
	Items []NotificationMessage `json:"items"`
	// UnreadCount is based on all retained notification history on server side,
	// not only on this paged Items slice.
	UnreadCount int   `json:"unread_count"`
	ReadCursor  int64 `json:"read_cursor"`
	LastID      int64 `json:"last_id"`
}

type EventsReadInfo

type EventsReadInfo struct {
	Acknowledged bool  `json:"acknowledged"`
	ReadCursor   int64 `json:"read_cursor"`
	UnreadCount  int   `json:"unread_count"`
}

type ExtensionsReloadInfo

type ExtensionsReloadInfo struct {
	Reloaded         bool  `json:"reloaded"`
	Version          int64 `json:"version,omitempty"`
	Skills           int   `json:"skills,omitempty"`
	Plugins          int   `json:"plugins,omitempty"`
	MCPCount         int   `json:"mcp_count,omitempty"`
	GatewayRefreshed bool  `json:"gateway_refreshed,omitempty"`
	GatewayAgents    int   `json:"gateway_agents,omitempty"`
}

type GatewayReportChannels

type GatewayReportChannels struct {
	GeneratedAt    string                            `json:"generated_at"`
	ArchiveEnabled bool                              `json:"archive_enabled"`
	Count          int                               `json:"count"`
	Messages       map[string][]ChannelReportMessage `json:"messages"`
}

type GatewayReportRuns

type GatewayReportRuns struct {
	GeneratedAt    string     `json:"generated_at"`
	ArchiveEnabled bool       `json:"archive_enabled"`
	Count          int        `json:"count"`
	Runs           []AgentRun `json:"runs"`
}

type GatewayReportSummary

type GatewayReportSummary struct {
	GeneratedAt      string         `json:"generated_at"`
	SummaryEnabled   bool           `json:"summary_enabled"`
	ArchiveEnabled   bool           `json:"archive_enabled"`
	RunsTotal        int            `json:"runs_total"`
	RunsActive       int            `json:"runs_active"`
	RunsByStatus     map[string]int `json:"runs_by_status"`
	ChannelsTotal    int            `json:"channels_total"`
	MessagesTotal    int            `json:"messages_total"`
	MessagesBySource map[string]int `json:"messages_by_source"`
}

type GatewayStatus

type GatewayStatus struct {
	Enabled                    bool   `json:"enabled"`
	Version                    int64  `json:"version"`
	RunsTotal                  int    `json:"runs_total"`
	RunsActive                 int    `json:"runs_active"`
	AgentsCount                int    `json:"agents_count"`
	AgentsWatchEnabled         bool   `json:"agents_watch_enabled"`
	AgentsReloadVersion        int64  `json:"agents_reload_version"`
	ChannelsLocalEnabled       bool   `json:"channels_local_enabled"`
	ChannelsWebhookEnabled     bool   `json:"channels_webhook_enabled"`
	ChannelsTelegramEnabled    bool   `json:"channels_telegram_enabled"`
	PersistenceEnabled         bool   `json:"persistence_enabled"`
	RunsPersistenceEnabled     bool   `json:"runs_persistence_enabled"`
	ChannelsPersistenceEnabled bool   `json:"channels_persistence_enabled"`
	RestoreOnStartup           bool   `json:"restore_on_startup"`
	PersistenceDir             string `json:"persistence_dir,omitempty"`
	RunsRestored               int    `json:"runs_restored"`
	ChannelsRestored           int    `json:"channels_restored"`
	LastPersistAt              string `json:"last_persist_at,omitempty"`
	LastRestoreAt              string `json:"last_restore_at,omitempty"`
	LastRestoreError           string `json:"last_restore_error,omitempty"`
	AgentsLastReloadAt         string `json:"agents_last_reload_at,omitempty"`
}

type HealthInfo

type HealthInfo struct {
	OK        bool   `json:"ok"`
	Component string `json:"component,omitempty"`
	Time      string `json:"time,omitempty"`
}

type HeartbeatInfo

type HeartbeatInfo struct {
	Response     string `json:"response"`
	Skipped      bool   `json:"skipped"`
	SkipReason   string `json:"skip_reason,omitempty"`
	Acknowledged bool   `json:"acknowledged"`
	Logged       bool   `json:"logged"`
}

type MCPServerInfo

type MCPServerInfo struct {
	Name      string `json:"name"`
	Command   string `json:"command,omitempty"`
	URL       string `json:"url,omitempty"`
	Transport string `json:"transport,omitempty"`
	Source    string `json:"source,omitempty"`
	AuthMode  string `json:"auth_mode,omitempty"`
	Connected bool   `json:"connected"`
	ToolCount int    `json:"tool_count"`
	Error     string `json:"error,omitempty"`
}

type MCPToolInfo

type MCPToolInfo struct {
	Server      string `json:"server"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

type ModelsInfo

type ModelsInfo struct {
	Provider     string   `json:"provider"`
	CurrentModel string   `json:"current_model"`
	Source       string   `json:"source"`
	Stale        bool     `json:"stale"`
	FetchedAt    string   `json:"fetched_at,omitempty"`
	ExpiresAt    string   `json:"expires_at,omitempty"`
	Models       []string `json:"models"`
	Warning      string   `json:"warning,omitempty"`
}

type NotificationMessage

type NotificationMessage struct {
	ID        int64  `json:"id,omitempty"`
	Type      string `json:"type"`
	Category  string `json:"category"`
	Severity  string `json:"severity"`
	Title     string `json:"title"`
	Message   string `json:"message"`
	Timestamp string `json:"timestamp"`
	JobID     string `json:"job_id,omitempty"`
	SessionID string `json:"session_id,omitempty"`
	OpenPath  string `json:"open_path,omitempty"`
}

type OpsStatus

type OpsStatus struct {
	Timestamp       string  `json:"timestamp"`
	DiskTotalBytes  uint64  `json:"disk_total_bytes"`
	DiskFreeBytes   uint64  `json:"disk_free_bytes"`
	DiskUsedPercent float64 `json:"disk_used_percent"`
	ProcessCount    int     `json:"process_count"`
}

type PluginDef

type PluginDef struct {
	SchemaVersion         int            `json:"schema_version,omitempty"`
	ID                    string         `json:"id"`
	Name                  string         `json:"name,omitempty"`
	Version               string         `json:"version,omitempty"`
	Description           string         `json:"description,omitempty"`
	Source                string         `json:"source,omitempty"`
	RootDir               string         `json:"root_dir,omitempty"`
	DefaultProjectProfile string         `json:"default_project_profile,omitempty"`
	SupportedOS           []string       `json:"supported_os,omitempty"`
	SupportedArch         []string       `json:"supported_arch,omitempty"`
	Requires              PluginRequires `json:"requires,omitempty"`
	Policies              PluginPolicies `json:"policies,omitempty"`
}

type PluginPolicies added in v0.11.0

type PluginPolicies struct {
	ToolsAllow []string `json:"tools_allow,omitempty"`
	ToolsDeny  []string `json:"tools_deny,omitempty"`
}

type PluginRequires added in v0.11.0

type PluginRequires struct {
	Bins []string `json:"bins,omitempty"`
	Env  []string `json:"env,omitempty"`
}

type Project

type Project struct {
	ID                 string   `json:"id"`
	Name               string   `json:"name"`
	Type               string   `json:"type"`
	Status             string   `json:"status"`
	GitRepo            string   `json:"git_repo,omitempty"`
	CreatedAt          string   `json:"created_at,omitempty"`
	UpdatedAt          string   `json:"updated_at,omitempty"`
	Objective          string   `json:"objective,omitempty"`
	ToolsAllow         []string `json:"tools_allow,omitempty"`
	ToolsAllowGroups   []string `json:"tools_allow_groups,omitempty"`
	ToolsAllowPatterns []string `json:"tools_allow_patterns,omitempty"`
	ToolsDeny          []string `json:"tools_deny,omitempty"`
	ToolsRiskMax       string   `json:"tools_risk_max,omitempty"`
	SkillsAllow        []string `json:"skills_allow,omitempty"`
	MCPServers         []string `json:"mcp_servers,omitempty"`
	SecretsRefs        []string `json:"secrets_refs,omitempty"`
	Body               string   `json:"body,omitempty"`
	Path               string   `json:"path,omitempty"`
}

type ProjectActivity added in v0.5.1

type ProjectActivity struct {
	ID        string            `json:"id"`
	ProjectID string            `json:"project_id"`
	TaskID    string            `json:"task_id,omitempty"`
	Source    string            `json:"source"`
	Agent     string            `json:"agent,omitempty"`
	Kind      string            `json:"kind"`
	Status    string            `json:"status,omitempty"`
	Message   string            `json:"message,omitempty"`
	Timestamp string            `json:"timestamp"`
	Meta      map[string]string `json:"meta,omitempty"`
}

type ProjectActivityList added in v0.5.1

type ProjectActivityList struct {
	Count int               `json:"count"`
	Items []ProjectActivity `json:"items"`
}

type ProjectAutopilotRun added in v0.5.1

type ProjectAutopilotRun struct {
	ProjectID   string `json:"project_id"`
	RunID       string `json:"run_id"`
	Status      string `json:"status"`
	Message     string `json:"message,omitempty"`
	Iterations  int    `json:"iterations"`
	StartedAt   string `json:"started_at,omitempty"`
	UpdatedAt   string `json:"updated_at,omitempty"`
	FinishedAt  string `json:"finished_at,omitempty"`
	Phase       string `json:"phase,omitempty"`
	PhaseStatus string `json:"phase_status,omitempty"`
	NextAction  string `json:"next_action,omitempty"`
	Summary     string `json:"summary,omitempty"`
}

type ProjectBoard added in v0.5.1

type ProjectBoard struct {
	ProjectID string             `json:"project_id"`
	UpdatedAt string             `json:"updated_at,omitempty"`
	Columns   []string           `json:"columns"`
	Tasks     []ProjectBoardTask `json:"tasks,omitempty"`
	Path      string             `json:"path,omitempty"`
}

type ProjectBoardTask added in v0.5.1

type ProjectBoardTask struct {
	ID               string `json:"id"`
	Title            string `json:"title"`
	Status           string `json:"status"`
	Assignee         string `json:"assignee,omitempty"`
	Role             string `json:"role,omitempty"`
	WorkerKind       string `json:"worker_kind,omitempty"`
	Issue            string `json:"issue,omitempty"`
	Branch           string `json:"branch,omitempty"`
	PR               string `json:"pr,omitempty"`
	ReviewApprovedBy string `json:"review_approved_by,omitempty"`
	ReviewRequired   bool   `json:"review_required,omitempty"`
	TestCommand      string `json:"test_command,omitempty"`
	BuildCommand     string `json:"build_command,omitempty"`
}

type ProjectCreateRequest

type ProjectCreateRequest struct {
	Name         string `json:"name"`
	Type         string `json:"type,omitempty"`
	GitRepo      string `json:"git_repo,omitempty"`
	Objective    string `json:"objective,omitempty"`
	Instructions string `json:"instructions,omitempty"`
	CloneRepo    bool   `json:"clone_repo,omitempty"`
}

type ProjectDispatchReport added in v0.5.1

type ProjectDispatchReport struct {
	ProjectID string           `json:"project_id"`
	Runs      []ProjectTaskRun `json:"runs"`
}

type ProjectPhaseSnapshot added in v0.12.0

type ProjectPhaseSnapshot struct {
	ProjectID  string `json:"project_id"`
	Name       string `json:"name"`
	Status     string `json:"status"`
	NextAction string `json:"next_action,omitempty"`
	Summary    string `json:"summary,omitempty"`
	Message    string `json:"message,omitempty"`
	RunStatus  string `json:"run_status,omitempty"`
	UpdatedAt  string `json:"updated_at,omitempty"`
}

type ProjectTaskRun added in v0.5.1

type ProjectTaskRun struct {
	ID         string `json:"id"`
	TaskID     string `json:"task_id"`
	Agent      string `json:"agent,omitempty"`
	WorkerKind string `json:"worker_kind,omitempty"`
	Status     string `json:"status"`
	Response   string `json:"response,omitempty"`
	Error      string `json:"error,omitempty"`
}

type ProjectUpdateRequest

type ProjectUpdateRequest struct {
	Name               *string  `json:"name,omitempty"`
	Type               *string  `json:"type,omitempty"`
	Status             *string  `json:"status,omitempty"`
	GitRepo            *string  `json:"git_repo,omitempty"`
	Objective          *string  `json:"objective,omitempty"`
	Instructions       *string  `json:"instructions,omitempty"`
	ToolsAllow         []string `json:"tools_allow,omitempty"`
	ToolsAllowGroups   []string `json:"tools_allow_groups,omitempty"`
	ToolsAllowPatterns []string `json:"tools_allow_patterns,omitempty"`
	ToolsDeny          []string `json:"tools_deny,omitempty"`
	ToolsRiskMax       *string  `json:"tools_risk_max,omitempty"`
	SkillsAllow        []string `json:"skills_allow,omitempty"`
	MCPServers         []string `json:"mcp_servers,omitempty"`
	SecretsRefs        []string `json:"secrets_refs,omitempty"`
}

type ProviderInfo

type ProviderInfo struct {
	ID                 string `json:"id"`
	SupportsLiveModels bool   `json:"supports_live_models"`
}

type ProvidersInfo

type ProvidersInfo struct {
	CurrentProvider string         `json:"current_provider"`
	CurrentModel    string         `json:"current_model"`
	AuthMode        string         `json:"auth_mode"`
	Providers       []ProviderInfo `json:"providers"`
}

type ScheduleCreateRequest

type ScheduleCreateRequest struct {
	Natural   string `json:"natural"`
	Title     string `json:"title,omitempty"`
	Prompt    string `json:"prompt,omitempty"`
	Schedule  string `json:"schedule,omitempty"`
	ProjectID string `json:"project_id,omitempty"`
	Timezone  string `json:"timezone,omitempty"`
}

type ScheduleItem

type ScheduleItem struct {
	ID        string `json:"id"`
	Title     string `json:"title"`
	Prompt    string `json:"prompt,omitempty"`
	Natural   string `json:"natural,omitempty"`
	Schedule  string `json:"schedule"`
	Status    string `json:"status"`
	ProjectID string `json:"project_id,omitempty"`
	CronJobID string `json:"cron_job_id,omitempty"`
	Timezone  string `json:"timezone,omitempty"`
	CreatedAt string `json:"created_at,omitempty"`
	UpdatedAt string `json:"updated_at,omitempty"`
}

type ScheduleUpdateRequest

type ScheduleUpdateRequest struct {
	Title     *string `json:"title,omitempty"`
	Prompt    *string `json:"prompt,omitempty"`
	Schedule  *string `json:"schedule,omitempty"`
	Status    *string `json:"status,omitempty"`
	ProjectID *string `json:"project_id,omitempty"`
	Timezone  *string `json:"timezone,omitempty"`
}

type SessionMessage

type SessionMessage struct {
	Role      string `json:"role"`
	Content   string `json:"content"`
	Timestamp string `json:"timestamp,omitempty"`
}

type SessionSummary

type SessionSummary struct {
	ID        string `json:"id"`
	Title     string `json:"title"`
	ProjectID string `json:"project_id,omitempty"`
	CreatedAt string `json:"created_at,omitempty"`
	UpdatedAt string `json:"updated_at,omitempty"`
}

type SkillDef

type SkillDef struct {
	Name          string `json:"name"`
	Description   string `json:"description,omitempty"`
	UserInvocable bool   `json:"user_invocable"`
	Source        string `json:"source,omitempty"`
	RuntimePath   string `json:"runtime_path,omitempty"`
}

type SpawnRequest

type SpawnRequest struct {
	SessionID string `json:"session_id,omitempty"`
	ProjectID string `json:"project_id,omitempty"`
	Title     string `json:"title,omitempty"`
	Message   string `json:"message"`
	Agent     string `json:"agent,omitempty"`
}

SpawnRequest is the API payload for POST /v1/agent/runs. CLI parsing types (for example, spawnCommand) stay in internal/tarsclient.

type StatusInfo

type StatusInfo struct {
	WorkspaceDir  string `json:"workspace_dir"`
	SessionCount  int    `json:"session_count"`
	MainSessionID string `json:"main_session_id,omitempty"`
	AuthRole      string `json:"auth_role,omitempty"`
}

type TelegramPairingAllowed

type TelegramPairingAllowed struct {
	UserID     int64  `json:"user_id"`
	ChatID     string `json:"chat_id"`
	Username   string `json:"username,omitempty"`
	ApprovedAt string `json:"approved_at"`
}

type TelegramPairingPending

type TelegramPairingPending struct {
	Code      string `json:"code"`
	UserID    int64  `json:"user_id"`
	ChatID    string `json:"chat_id"`
	Username  string `json:"username,omitempty"`
	CreatedAt string `json:"created_at"`
	ExpiresAt string `json:"expires_at"`
}

type TelegramPairingsInfo

type TelegramPairingsInfo struct {
	DMPolicy       string                   `json:"dm_policy"`
	PollingEnabled bool                     `json:"polling_enabled"`
	Pending        []TelegramPairingPending `json:"pending"`
	Allowed        []TelegramPairingAllowed `json:"allowed"`
}

type UsageLimitStatus

type UsageLimitStatus struct {
	Exceeded bool    `json:"exceeded"`
	Mode     string  `json:"mode"`
	Period   string  `json:"period,omitempty"`
	SpentUSD float64 `json:"spent_usd,omitempty"`
	LimitUSD float64 `json:"limit_usd,omitempty"`
}

type UsageLimits

type UsageLimits struct {
	DailyUSD   float64 `json:"daily_usd"`
	WeeklyUSD  float64 `json:"weekly_usd"`
	MonthlyUSD float64 `json:"monthly_usd"`
	Mode       string  `json:"mode"`
}

type UsageSummary

type UsageSummary struct {
	Period          string            `json:"period"`
	GroupBy         string            `json:"group_by"`
	TotalCalls      int               `json:"total_calls"`
	TotalCostUSD    float64           `json:"total_cost_usd"`
	TotalInput      int               `json:"total_input_tokens"`
	TotalOutput     int               `json:"total_output_tokens"`
	TotalCached     int               `json:"total_cached_tokens"`
	TotalCacheRead  int               `json:"total_cache_read_tokens"`
	TotalCacheWrite int               `json:"total_cache_write_tokens"`
	Rows            []UsageSummaryRow `json:"rows"`
}

type UsageSummaryRow

type UsageSummaryRow struct {
	Key              string  `json:"key"`
	Calls            int     `json:"calls"`
	CostUSD          float64 `json:"cost_usd"`
	InputTokens      int     `json:"input_tokens"`
	OutputTokens     int     `json:"output_tokens"`
	CachedTokens     int     `json:"cached_tokens"`
	CacheReadTokens  int     `json:"cache_read_tokens"`
	CacheWriteTokens int     `json:"cache_write_tokens"`
}

type VaultStatusInfo

type VaultStatusInfo struct {
	Enabled        bool   `json:"enabled"`
	Ready          bool   `json:"ready,omitempty"`
	AuthMode       string `json:"auth_mode,omitempty"`
	Addr           string `json:"addr,omitempty"`
	Namespace      string `json:"namespace,omitempty"`
	AllowlistCount int    `json:"allowlist_count,omitempty"`
	LastError      string `json:"last_error,omitempty"`
}

type WhoamiInfo

type WhoamiInfo struct {
	Authenticated bool   `json:"authenticated"`
	AuthRole      string `json:"auth_role,omitempty"`
	IsAdmin       bool   `json:"is_admin,omitempty"`
	AuthMode      string `json:"auth_mode,omitempty"`
}

Jump to

Keyboard shortcuts

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