Documentation
¶
Index ¶
- Constants
- func ConsoleURL(baseURL string) (string, error)
- func ResolveURL(baseURL, rawPath string) (string, error)
- func ScanSSELines(r io.Reader, onData func([]byte) error) error
- type APIError
- type AgentDescriptor
- type AgentRun
- type AgentRuntimeReportChannels
- type AgentRuntimeReportRuns
- type AgentRuntimeReportSummary
- type AgentRuntimeStatus
- type Approval
- type ChannelReportMessage
- type ChatEvent
- type ChatRequest
- type ChatResult
- type CleanupApplyResult
- type CleanupCandidate
- type CleanupPlan
- type Client
- func (c *Client) AgentRuntimeReload(ctx context.Context) (AgentRuntimeStatus, error)
- func (c *Client) AgentRuntimeReportChannels(ctx context.Context, limit int) (AgentRuntimeReportChannels, error)
- func (c *Client) AgentRuntimeReportRuns(ctx context.Context, limit int) (AgentRuntimeReportRuns, error)
- func (c *Client) AgentRuntimeReportSummary(ctx context.Context) (AgentRuntimeReportSummary, error)
- func (c *Client) AgentRuntimeRestart(ctx context.Context) (AgentRuntimeStatus, error)
- func (c *Client) AgentRuntimeStatus(ctx context.Context) (AgentRuntimeStatus, error)
- func (c *Client) ApplyCleanup(ctx context.Context, approvalID string) (CleanupApplyResult, error)
- func (c *Client) ApproveCleanup(ctx context.Context, approvalID string) error
- func (c *Client) ApproveTelegramPairing(ctx context.Context, code string) (TelegramPairingAllowed, error)
- func (c *Client) CancelRun(ctx context.Context, runID string) (AgentRun, error)
- func (c *Client) Compact(ctx context.Context, sessionID string) (CompactInfo, error)
- func (c *Client) CompactWithOptions(ctx context.Context, req CompactRequest) (CompactInfo, error)
- func (c *Client) CreateCleanupPlan(ctx context.Context) (CleanupPlan, error)
- func (c *Client) CreateCronJob(ctx context.Context, schedule, prompt string) (CronJob, error)
- func (c *Client) CreateSession(ctx context.Context, title string) (SessionSummary, error)
- func (c *Client) DeleteCronJob(ctx context.Context, jobID string) error
- func (c *Client) Do(ctx context.Context, method, path string, body any, out any) error
- func (c *Client) ExportSession(ctx context.Context, sessionID string) (string, error)
- func (c *Client) GetCronJob(ctx context.Context, jobID string) (CronJob, error)
- func (c *Client) GetEventHistory(ctx context.Context, limit int) (EventsHistoryInfo, error)
- func (c *Client) GetHistory(ctx context.Context, sessionID string) ([]SessionMessage, error)
- func (c *Client) GetRun(ctx context.Context, runID string) (AgentRun, error)
- func (c *Client) GetUsageLimits(ctx context.Context) (UsageLimits, error)
- func (c *Client) GetUsageSignals(ctx context.Context, period string) (UsageSignalSummary, error)
- func (c *Client) GetUsageSummary(ctx context.Context, period string, groupBy string) (UsageSummary, UsageLimits, UsageLimitStatus, error)
- func (c *Client) Healthz(ctx context.Context) (HealthInfo, error)
- func (c *Client) ListAgents(ctx context.Context) ([]AgentDescriptor, error)
- func (c *Client) ListApprovals(ctx context.Context) ([]Approval, error)
- func (c *Client) ListCronJobs(ctx context.Context) ([]CronJob, error)
- func (c *Client) ListCronRuns(ctx context.Context, jobID string, limit int) ([]CronRunRecord, error)
- func (c *Client) ListMCPServers(ctx context.Context) ([]MCPServerInfo, error)
- func (c *Client) ListMCPTools(ctx context.Context) ([]MCPToolInfo, error)
- func (c *Client) ListPlugins(ctx context.Context) ([]PluginDef, error)
- func (c *Client) ListRuns(ctx context.Context, limit int) ([]AgentRun, error)
- func (c *Client) ListSessions(ctx context.Context) ([]SessionSummary, error)
- func (c *Client) ListSkills(ctx context.Context) ([]SkillDef, error)
- func (c *Client) MarkEventsRead(ctx context.Context, lastID int64) (EventsReadInfo, error)
- func (c *Client) Models(ctx context.Context) (ModelsInfo, error)
- func (c *Client) OpsStatus(ctx context.Context) (OpsStatus, error)
- func (c *Client) Providers(ctx context.Context) (ProvidersInfo, error)
- func (c *Client) PulseRunOnce(ctx context.Context) (PulseInfo, error)
- func (c *Client) RejectCleanup(ctx context.Context, approvalID string) error
- func (c *Client) ReloadExtensions(ctx context.Context) (ExtensionsReloadInfo, error)
- func (c *Client) RunCronJob(ctx context.Context, jobID string) (string, error)
- func (c *Client) SearchSessions(ctx context.Context, keyword string) ([]SessionSummary, error)
- func (c *Client) SpawnRun(ctx context.Context, req SpawnRequest) (AgentRun, error)
- func (c *Client) Status(ctx context.Context) (StatusInfo, error)
- func (c *Client) StreamChat(ctx context.Context, req ChatRequest, onStatus func(ChatEvent), ...) (ChatResult, error)
- func (c *Client) StreamEvents(ctx context.Context, onEvent func(NotificationMessage), onError func(error))
- func (c *Client) StreamSSE(ctx context.Context, method, path string, body any, onData func([]byte) error) error
- func (c *Client) TelegramPairings(ctx context.Context) (TelegramPairingsInfo, error)
- func (c *Client) UpdateCronJobEnabled(ctx context.Context, jobID string, enabled bool) (CronJob, error)
- func (c *Client) UpdateUsageLimits(ctx context.Context, req UsageLimits) (UsageLimits, error)
- func (c *Client) Whoami(ctx context.Context) (WhoamiInfo, error)
- type CompactInfo
- type CompactRequest
- type Config
- type CronJob
- type CronRunRecord
- type EventsHistoryInfo
- type EventsReadInfo
- type ExtensionsReloadInfo
- type HealthInfo
- type MCPServerInfo
- type MCPToolInfo
- type ModelsInfo
- type NotificationMessage
- type OpsStatus
- type PluginDef
- type PluginPolicies
- type PluginRequires
- type ProviderInfo
- type ProvidersInfo
- type PulseInfo
- type SessionMessage
- type SessionSummary
- type SkillDef
- type SpawnRequest
- type StatusInfo
- type TelegramPairingAllowed
- type TelegramPairingPending
- type TelegramPairingsInfo
- type UsageLimitStatus
- type UsageLimits
- type UsageSignalRow
- type UsageSignalSummary
- type UsageSummary
- type UsageSummaryRow
- type WhoamiInfo
Constants ¶
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 ConsoleURL ¶ added in v0.31.75
func ResolveURL ¶ added in v0.31.75
ResolveURL appends rawPath to baseURL while preserving proxy base paths. Base query and fragment values are discarded; rawPath may provide its own.
Types ¶
type APIError ¶
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"`
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 AgentRuntimeReportChannels ¶ added in v0.31.5
type AgentRuntimeReportChannels struct {
GeneratedAt string `json:"generated_at"`
ArchiveEnabled bool `json:"archive_enabled"`
Count int `json:"count"`
Messages map[string][]ChannelReportMessage `json:"messages"`
}
type AgentRuntimeReportRuns ¶ added in v0.31.5
type AgentRuntimeReportSummary ¶ added in v0.31.5
type AgentRuntimeReportSummary 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 AgentRuntimeStatus ¶ added in v0.31.5
type AgentRuntimeStatus 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 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 ChannelReportMessage ¶
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 ChatResult ¶
type CleanupApplyResult ¶
type CleanupCandidate ¶
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 (*Client) AgentRuntimeReload ¶ added in v0.31.5
func (c *Client) AgentRuntimeReload(ctx context.Context) (AgentRuntimeStatus, error)
func (*Client) AgentRuntimeReportChannels ¶ added in v0.31.5
func (*Client) AgentRuntimeReportRuns ¶ added in v0.31.5
func (*Client) AgentRuntimeReportSummary ¶ added in v0.31.5
func (c *Client) AgentRuntimeReportSummary(ctx context.Context) (AgentRuntimeReportSummary, error)
func (*Client) AgentRuntimeRestart ¶ added in v0.31.5
func (c *Client) AgentRuntimeRestart(ctx context.Context) (AgentRuntimeStatus, error)
func (*Client) AgentRuntimeStatus ¶ added in v0.31.5
func (c *Client) AgentRuntimeStatus(ctx context.Context) (AgentRuntimeStatus, error)
func (*Client) ApplyCleanup ¶
func (*Client) ApproveCleanup ¶
func (*Client) ApproveTelegramPairing ¶
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 (*Client) CreateSession ¶
func (*Client) DeleteCronJob ¶
func (*Client) ExportSession ¶
func (*Client) GetCronJob ¶
func (*Client) GetEventHistory ¶
func (*Client) GetHistory ¶
func (*Client) GetUsageLimits ¶
func (c *Client) GetUsageLimits(ctx context.Context) (UsageLimits, error)
func (*Client) GetUsageSignals ¶ added in v0.31.6
func (*Client) GetUsageSummary ¶
func (c *Client) GetUsageSummary(ctx context.Context, period string, groupBy string) (UsageSummary, UsageLimits, UsageLimitStatus, error)
func (*Client) ListAgents ¶
func (c *Client) ListAgents(ctx context.Context) ([]AgentDescriptor, error)
func (*Client) ListApprovals ¶
func (*Client) ListCronRuns ¶
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) ListSessions ¶
func (c *Client) ListSessions(ctx context.Context) ([]SessionSummary, error)
func (*Client) MarkEventsRead ¶
func (*Client) PulseRunOnce ¶ added in v0.25.0
PulseRunOnce triggers a single pulse watchdog tick on the server and returns the resulting tick outcome. Replaces the previous HeartbeatRunOnce call — heartbeat has been removed.
func (*Client) RejectCleanup ¶
func (*Client) ReloadExtensions ¶
func (c *Client) ReloadExtensions(ctx context.Context) (ExtensionsReloadInfo, error)
func (*Client) RunCronJob ¶
func (*Client) SearchSessions ¶
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) TelegramPairings ¶
func (c *Client) TelegramPairings(ctx context.Context) (TelegramPairingsInfo, error)
func (*Client) UpdateCronJobEnabled ¶
func (*Client) UpdateUsageLimits ¶
func (c *Client) UpdateUsageLimits(ctx context.Context, req UsageLimits) (UsageLimits, error)
type CompactInfo ¶
type CompactInfo struct {
Message string `json:"message"`
}
type CompactRequest ¶ added in v0.10.2
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"`
SessionID string `json:"session_id,omitempty"`
SessionTarget string `json:"session_target,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 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 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"`
AgentRuntimeRefreshed bool `json:"agentruntime_refreshed,omitempty"`
AgentRuntimeAgents int `json:"agentruntime_agents,omitempty"`
}
type HealthInfo ¶
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 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 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 PluginRequires ¶ added in v0.11.0
type ProviderInfo ¶
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 PulseInfo ¶ added in v0.25.0
type PulseInfo struct {
Skipped bool `json:"skipped,omitempty"`
SkipReason string `json:"skip_reason,omitempty"`
DeciderInvoked bool `json:"decider_invoked,omitempty"`
NotifyDelivered bool `json:"notify_delivered,omitempty"`
AutofixAttempt string `json:"autofix_attempt,omitempty"`
AutofixOK bool `json:"autofix_ok,omitempty"`
Err string `json:"err,omitempty"`
}
PulseInfo summarizes the result of a pulse tick triggered via the /v1/pulse/run-once endpoint. Fields mirror the server-side pulse.TickOutcome with JSON field names aligned to that struct.
type SessionMessage ¶
type SessionSummary ¶
type SpawnRequest ¶
type SpawnRequest struct {
SessionID string `json:"session_id,omitempty"`
Title string `json:"title,omitempty"`
Message string `json:"message"`
Agent string `json:"agent,omitempty"`
}
SpawnRequest is the API payload for POST /v1/agentruntime/runs. CLI parsing types (for example, spawnCommand) stay in internal/tarsclient.
type StatusInfo ¶
type TelegramPairingAllowed ¶
type TelegramPairingPending ¶
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 UsageLimits ¶
type UsageSignalRow ¶ added in v0.31.6
type UsageSignalSummary ¶ added in v0.31.6
type UsageSignalSummary struct {
Period string `json:"period"`
TotalCount int `json:"total_count"`
Rows []UsageSignalRow `json:"rows"`
}
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"`
}