server

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 67 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgenticEvent added in v0.2.0

type AgenticEvent struct {
	Type      string `json:"type"`                // "content", "tool_call", "tool_result", "tool_confirm", "done", "error"
	Content   string `json:"content,omitempty"`   // for "content" events
	ToolName  string `json:"tool_name,omitempty"` // for "tool_call", "tool_result", and "tool_confirm"
	ToolID    string `json:"tool_id,omitempty"`   // for "tool_call", "tool_result", and "tool_confirm"
	Result    string `json:"result,omitempty"`    // for "tool_result"
	Error     string `json:"error,omitempty"`     // for "error"
	Arguments string `json:"arguments,omitempty"` // for "tool_confirm": JSON-encoded tool arguments
}

AgenticEvent represents an event emitted by the agentic loop.

type ChatCompletionChoice

type ChatCompletionChoice struct {
	Index        int                   `json:"index"`
	Message      ChatCompletionMessage `json:"message"`
	FinishReason string                `json:"finish_reason"`
}

type ChatCompletionChunk

type ChatCompletionChunk struct {
	ID      string               `json:"id"`
	Object  string               `json:"object"` // "chat.completion.chunk"
	Model   string               `json:"model"`
	Choices []ChunkChoice        `json:"choices"`
	Usage   *ChatCompletionUsage `json:"usage,omitempty"`
}

ChatCompletionChunk is the OpenAI-compatible streaming chunk response.

type ChatCompletionMessage

type ChatCompletionMessage struct {
	Role             string           `json:"role"`
	Content          *string          `json:"content"`
	ReasoningContent *string          `json:"reasoning_content,omitempty"`
	ToolCalls        []OpenAIToolCall `json:"tool_calls,omitempty"`
}

type ChatCompletionRequest

type ChatCompletionRequest struct {
	Model         string          `json:"model"`
	Messages      []OpenAIMessage `json:"messages"`
	Tools         []OpenAITool    `json:"tools,omitempty"`
	Stream        bool            `json:"stream,omitempty"`
	StreamOptions *StreamOptions  `json:"stream_options,omitempty"`

	// Generation parameters
	MaxTokens           *int            `json:"max_tokens,omitempty"`
	MaxCompletionTokens *int            `json:"max_completion_tokens,omitempty"`
	Temperature         *float64        `json:"temperature,omitempty"`
	TopP                *float64        `json:"top_p,omitempty"`
	Stop                json.RawMessage `json:"stop,omitempty"` // string or []string
	Seed                *int            `json:"seed,omitempty"`
	ResponseFormat      map[string]any  `json:"response_format,omitempty"`

	// Reasoning / thinking parameters
	ReasoningEffort string       `json:"reasoning_effort,omitempty"` // "low", "medium", "high"
	Thinking        *ThinkingReq `json:"thinking,omitempty"`

	// Web search (OpenAI search models)
	WebSearchOptions map[string]any `json:"web_search_options,omitempty"`
}

ChatCompletionRequest is the OpenAI-compatible request body.

type ChatCompletionResponse

type ChatCompletionResponse struct {
	ID      string                 `json:"id"`
	Object  string                 `json:"object"`
	Model   string                 `json:"model"`
	Choices []ChatCompletionChoice `json:"choices"`
	Usage   ChatCompletionUsage    `json:"usage"`
}

ChatCompletionResponse is the OpenAI-compatible response body.

type ChatCompletionUsage

type ChatCompletionUsage struct {
	PromptTokens     int `json:"prompt_tokens"`
	CompletionTokens int `json:"completion_tokens"`
	TotalTokens      int `json:"total_tokens"`
}

type ChunkChoice

type ChunkChoice struct {
	Index        int        `json:"index"`
	Delta        ChunkDelta `json:"delta"`
	FinishReason *string    `json:"finish_reason"`
}

ChunkChoice represents a single choice in a streaming chunk.

type ChunkDelta

type ChunkDelta struct {
	Role             string           `json:"role,omitempty"`
	Content          any              `json:"content,omitempty"`
	ReasoningContent any              `json:"reasoning_content,omitempty"`
	ToolCalls        []OpenAIToolCall `json:"tool_calls,omitempty"`
}

ChunkDelta represents the incremental content in a streaming chunk.

type IntegrationAgent added in v0.2.1

type IntegrationAgent struct {
	Name   string              `json:"name"`
	Config service.AgentConfig `json:"config"`
}

IntegrationAgent is an agent definition inside a pack.

type IntegrationComponents added in v0.2.1

type IntegrationComponents struct {
	Skills       []IntegrationSkill       `json:"skills,omitempty"`
	MCPSets      []IntegrationMCPSet      `json:"mcp_sets,omitempty"`
	Agents       []IntegrationAgent       `json:"agents,omitempty"`
	Organization *IntegrationOrganization `json:"organization,omitempty"`
}

IntegrationComponents holds all installable entities in a pack.

type IntegrationMCPSet added in v0.2.1

type IntegrationMCPSet struct {
	Name        string                  `json:"name"`
	Description string                  `json:"description"`
	Category    string                  `json:"category"`
	Tags        []string                `json:"tags,omitempty"`
	Config      service.MCPServerConfig `json:"config"`
	Servers     []string                `json:"servers,omitempty"`
	URLs        []string                `json:"urls,omitempty"`
}

IntegrationMCPSet is an MCP set definition inside a pack.

type IntegrationOrganization added in v0.2.1

type IntegrationOrganization struct {
	Name          string                    `json:"name"`
	Description   string                    `json:"description"`
	Relationships []IntegrationRelationship `json:"relationships,omitempty"`
}

IntegrationOrganization is an org definition inside a pack.

type IntegrationPack added in v0.2.1

type IntegrationPack struct {
	Slug        string                `json:"slug"`
	Name        string                `json:"name"`
	Description string                `json:"description"`
	Category    string                `json:"category"`
	Icon        string                `json:"icon,omitempty"`
	Author      string                `json:"author,omitempty"`
	Version     string                `json:"version"`
	ReadOnly    bool                  `json:"read_only"`            // true for embedded and git packs
	Source      string                `json:"source"`               // "embedded", "user", "git"
	SourceURL   string                `json:"source_url,omitempty"` // Git repo URL
	SourceID    string                `json:"source_id,omitempty"`  // Pack source DB ID
	Variables   []RequiredVariable    `json:"variables,omitempty"`
	Components  IntegrationComponents `json:"components"`
}

IntegrationPack is a folder-based bundle of skills, MCP sets, agents, and optionally an organization — all installed together.

type IntegrationRelationship added in v0.2.1

type IntegrationRelationship struct {
	AgentName       string `json:"agent_name"`
	Role            string `json:"role,omitempty"`
	Title           string `json:"title,omitempty"`
	ParentAgentName string `json:"parent_agent_name,omitempty"`
	IsHead          bool   `json:"is_head,omitempty"`
}

IntegrationRelationship maps agent names to org roles.

type IntegrationSkill added in v0.2.1

type IntegrationSkill struct {
	Name         string         `json:"name"`
	Description  string         `json:"description"`
	Category     string         `json:"category"`
	Tags         []string       `json:"tags,omitempty"`
	SystemPrompt string         `json:"system_prompt"`
	Tools        []service.Tool `json:"tools,omitempty"`
}

IntegrationSkill is a skill definition inside a pack.

type MCPTemplate added in v0.2.0

type MCPTemplate struct {
	Slug        string                `json:"slug"`
	Name        string                `json:"name"`
	Description string                `json:"description"`
	Category    string                `json:"category"`
	Tags        []string              `json:"tags"`
	MCPServer   MCPTemplateServerData `json:"mcp_server"`
}

MCPTemplate is a predefined MCP configuration that ships with AT.

type MCPTemplateServerData added in v0.2.0

type MCPTemplateServerData struct {
	Name        string                  `json:"name"`
	Description string                  `json:"description"`
	Config      service.MCPServerConfig `json:"config"`
}

MCPTemplateServerData holds the MCP server payload to be installed.

type MarketplaceSkill added in v0.2.0

type MarketplaceSkill struct {
	Source      string   `json:"source"`
	Slug        string   `json:"slug"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Author      string   `json:"author"`
	Downloads   int      `json:"downloads"`
	License     string   `json:"license"`
	Tags        []string `json:"tags"`
	URL         string   `json:"url"`
}

MarketplaceSkill is the normalized skill entry returned by marketplace search.

type ModelData

type ModelData struct {
	ID      string `json:"id"`
	Object  string `json:"object"`
	OwnedBy string `json:"owned_by"`
}

type ModelsResponse

type ModelsResponse struct {
	Object string      `json:"object"`
	Data   []ModelData `json:"data"`
}

type OpenAIFunction

type OpenAIFunction struct {
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Parameters  map[string]any `json:"parameters,omitempty"`
}

type OpenAIFunctionCall

type OpenAIFunctionCall struct {
	Name      string `json:"name"`
	Arguments string `json:"arguments"`
}

type OpenAIMessage

type OpenAIMessage struct {
	Role       string           `json:"role"`
	Content    json.RawMessage  `json:"content"` // string or array
	ToolCalls  []OpenAIToolCall `json:"tool_calls,omitempty"`
	ToolCallID string           `json:"tool_call_id,omitempty"`
	Name       string           `json:"name,omitempty"`
}

type OpenAITool

type OpenAITool struct {
	Type     string         `json:"type"`
	Function OpenAIFunction `json:"function"`
}

type OpenAIToolCall

type OpenAIToolCall struct {
	Index    *int               `json:"index,omitempty"`
	ID       string             `json:"id"`
	Type     string             `json:"type"`
	Function OpenAIFunctionCall `json:"function"`
	// ThoughtSignature is a Gemini-specific extension: an opaque token that
	// preserves the model's reasoning state across function-calling turns.
	// Clients must echo it back on assistant messages so the gateway can
	// restore it when rebuilding the Gemini request.
	ThoughtSignature string `json:"thought_signature,omitempty"`
}

type PackInstallRequest added in v0.2.1

type PackInstallRequest struct {
	Skills       bool     `json:"skills"`
	MCPSets      bool     `json:"mcp_sets"`
	Agents       []string `json:"agents,omitempty"` // agent names to install, empty = all
	Organization bool     `json:"organization"`
}

PackInstallRequest specifies which components to install.

type PackInstallResult added in v0.2.1

type PackInstallResult struct {
	SkillsCreated  int    `json:"skills_created"`
	MCPSetsCreated int    `json:"mcp_sets_created"`
	AgentsCreated  int    `json:"agents_created"`
	OrganizationID string `json:"organization_id,omitempty"`
}

PackInstallResult reports what was installed.

type ProviderFactory

type ProviderFactory func(cfg config.LLMConfig) (service.LLMProvider, error)

ProviderFactory is a function that creates an LLMProvider from an LLMConfig. This is injected from main.go so the server can hot-reload providers.

type ProviderInfo

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

ProviderInfo holds a provider instance along with its metadata.

func NewProviderInfo

func NewProviderInfo(provider service.LLMProvider, cfg config.LLMConfig) ProviderInfo

NewProviderInfo creates a ProviderInfo from a provider and its config.

type RequiredVariable added in v0.2.0

type RequiredVariable struct {
	Key         string `json:"key"`
	Description string `json:"description"`
	Secret      bool   `json:"secret"`
}

RequiredVariable describes a variable the skill needs at runtime.

type Server

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

func New

func New(ctx context.Context, cfg config.Server, gatewayCfg config.Gateway, botsCfg config.Bots, providers map[string]ProviderInfo, store service.Storer, storeType string, factory ProviderFactory, cl *cluster.Cluster, version string) (*Server, error)

New creates a new server instance.

func (*Server) AccumulateUsageAPI added in v0.2.0

func (s *Server) AccumulateUsageAPI(w http.ResponseWriter, r *http.Request)

AccumulateUsageAPI handles POST /api/v1/agents/{id}/runtime-state/accumulate.

func (*Server) AddAgentToOrganizationAPI added in v0.2.0

func (s *Server) AddAgentToOrganizationAPI(w http.ResponseWriter, r *http.Request)

AddAgentToOrganizationAPI handles POST /api/v1/organizations/{id}/agents.

func (*Server) AddAgentToPackAPI added in v0.2.1

func (s *Server) AddAgentToPackAPI(w http.ResponseWriter, r *http.Request)

AddAgentToPackAPI handles POST /api/v1/integration-packs/{slug}/agents.

func (*Server) AddLabelToTaskAPI added in v0.2.0

func (s *Server) AddLabelToTaskAPI(w http.ResponseWriter, r *http.Request)

AddLabelToTaskAPI handles POST /api/v1/tasks/{id}/labels/{label_id}.

func (*Server) AddMCPSetToPackAPI added in v0.2.1

func (s *Server) AddMCPSetToPackAPI(w http.ResponseWriter, r *http.Request)

AddMCPSetToPackAPI handles POST /api/v1/integration-packs/{slug}/mcp-sets.

func (*Server) AddSkillToPackAPI added in v0.2.1

func (s *Server) AddSkillToPackAPI(w http.ResponseWriter, r *http.Request)

AddSkillToPackAPI handles POST /api/v1/integration-packs/{slug}/skills. Accepts markdown or JSON body. Writes a .md file to the pack's skills/ dir.

func (*Server) AdminChatCompletions added in v0.2.0

func (s *Server) AdminChatCompletions(w http.ResponseWriter, r *http.Request)

AdminChatCompletions handles POST /api/v1/chat/completions. This is the admin-side chat endpoint used by the workflow editor's AI panel. Unlike the gateway endpoint, it does not require Bearer token auth — it is protected by ForwardAuth (if configured), same as all other admin routes.

func (*Server) BuiltinToolCallAPI added in v0.2.0

func (s *Server) BuiltinToolCallAPI(w http.ResponseWriter, r *http.Request)

BuiltinToolCallAPI handles POST /api/v1/mcp/call-builtin-tool. Dispatches to the appropriate built-in tool executor by name.

func (*Server) BuiltinToolListAPI added in v0.2.0

func (s *Server) BuiltinToolListAPI(w http.ResponseWriter, r *http.Request)

BuiltinToolListAPI handles GET /api/v1/mcp/builtin-tools. Returns the static list of server-side built-in tool definitions.

func (*Server) CallMCPSetToolAPI added in v0.2.0

func (s *Server) CallMCPSetToolAPI(w http.ResponseWriter, r *http.Request)

CallMCPSetToolAPI handles POST /api/v1/mcp/sets/{name}/call-tool. Executes a tool on an MCP Set and returns the result. Used by the Chat UI to call MCP Set tools (especially upstream tools like MiniMax that require server-side stdio processes).

func (*Server) CancelRunAPI added in v0.2.0

func (s *Server) CancelRunAPI(w http.ResponseWriter, r *http.Request)

CancelRunAPI handles POST /api/v1/runs/:run_id/cancel.

func (*Server) CancelTaskDelegationAPI added in v0.2.1

func (s *Server) CancelTaskDelegationAPI(w http.ResponseWriter, r *http.Request)

CancelTaskDelegationAPI handles POST /api/v1/tasks/{id}/cancel. Sends a cancel signal to the delegation goroutine if one is running.

func (*Server) ChatCompletions

func (s *Server) ChatCompletions(w http.ResponseWriter, r *http.Request)

ChatCompletions handles POST /gateway/v1/chat/completions. It accepts an OpenAI-compatible request, routes it to the correct backend provider based on the model prefix (e.g., "anthropic/claude-haiku-4-5"), and returns an OpenAI-compatible response.

func (*Server) CheckoutTaskAPI added in v0.2.0

func (s *Server) CheckoutTaskAPI(w http.ResponseWriter, r *http.Request)

CheckoutTaskAPI handles POST /api/v1/tasks/{id}/checkout.

func (*Server) ClaudeAuthCallbackAPI added in v0.2.0

func (s *Server) ClaudeAuthCallbackAPI(w http.ResponseWriter, r *http.Request)

ClaudeAuthCallbackAPI handles POST /api/v1/providers/claude-auth/callback. Exchanges the pasted authorization code for OAuth tokens.

func (*Server) ClaudeAuthStartAPI added in v0.2.0

func (s *Server) ClaudeAuthStartAPI(w http.ResponseWriter, r *http.Request)

ClaudeAuthStartAPI handles POST /api/v1/providers/claude-auth. Initiates the Claude OAuth flow by generating a PKCE challenge and auth URL.

func (*Server) ClaudeAuthSyncAPI added in v0.2.0

func (s *Server) ClaudeAuthSyncAPI(w http.ResponseWriter, r *http.Request)

ClaudeAuthSyncAPI handles POST /api/v1/providers/claude-auth/sync. Auto-extracts OAuth tokens from Claude Code CLI credentials on the server (macOS Keychain or ~/.claude/.credentials.json).

func (*Server) ClaudeAuthTokenAPI added in v0.2.0

func (s *Server) ClaudeAuthTokenAPI(w http.ResponseWriter, r *http.Request)

ClaudeAuthTokenAPI handles POST /api/v1/providers/claude-auth/token. Accepts pre-extracted OAuth tokens directly (no PKCE/code exchange needed). Users can extract tokens from Claude Code CLI credentials and paste them here.

func (*Server) ConfirmToolCallAPI added in v0.2.0

func (s *Server) ConfirmToolCallAPI(w http.ResponseWriter, r *http.Request)

ConfirmToolCallAPI handles POST /api/v1/chat/sessions/{id}/confirm. It receives the user's approval or rejection for a pending tool call.

func (*Server) CreateAPITokenAPI

func (s *Server) CreateAPITokenAPI(w http.ResponseWriter, r *http.Request)

CreateAPITokenAPI handles POST /api/v1/api-tokens. Returns the full token exactly once.

func (*Server) CreateAgentAPI added in v0.2.0

func (s *Server) CreateAgentAPI(w http.ResponseWriter, r *http.Request)

CreateAgentAPI handles POST /api/v1/agents.

func (*Server) CreateApprovalAPI added in v0.2.0

func (s *Server) CreateApprovalAPI(w http.ResponseWriter, r *http.Request)

CreateApprovalAPI handles POST /api/v1/approvals.

func (*Server) CreateBotConfigAPI added in v0.2.0

func (s *Server) CreateBotConfigAPI(w http.ResponseWriter, r *http.Request)

CreateBotConfigAPI handles POST /api/v1/bots.

func (*Server) CreateChatSessionAPI added in v0.2.0

func (s *Server) CreateChatSessionAPI(w http.ResponseWriter, r *http.Request)

CreateChatSessionAPI handles POST /api/v1/chat/sessions.

func (*Server) CreateCommentAPI added in v0.2.0

func (s *Server) CreateCommentAPI(w http.ResponseWriter, r *http.Request)

CreateCommentAPI handles POST /api/v1/tasks/{id}/comments.

func (*Server) CreateConnectionAPI added in v0.2.1

func (s *Server) CreateConnectionAPI(w http.ResponseWriter, r *http.Request)

CreateConnectionAPI handles POST /api/v1/connections. Use this to pre-register credentials (client_id / client_secret) before starting an OAuth flow, or to store a static API key for token-based skills.

func (*Server) CreateGoalAPI added in v0.2.0

func (s *Server) CreateGoalAPI(w http.ResponseWriter, r *http.Request)

CreateGoalAPI handles POST /api/v1/goals.

func (*Server) CreateGuideAPI added in v0.2.1

func (s *Server) CreateGuideAPI(w http.ResponseWriter, r *http.Request)

CreateGuideAPI handles POST /api/v1/guides.

func (*Server) CreateHeartbeatRunAPI added in v0.2.0

func (s *Server) CreateHeartbeatRunAPI(w http.ResponseWriter, r *http.Request)

CreateHeartbeatRunAPI handles POST /api/v1/agents/{id}/runs.

func (*Server) CreateLabelAPI added in v0.2.0

func (s *Server) CreateLabelAPI(w http.ResponseWriter, r *http.Request)

CreateLabelAPI handles POST /api/v1/labels.

func (*Server) CreateMCPServerAPI added in v0.2.0

func (s *Server) CreateMCPServerAPI(w http.ResponseWriter, r *http.Request)

CreateMCPServerAPI handles POST /api/v1/mcp/servers.

func (*Server) CreateMCPSetAPI added in v0.2.0

func (s *Server) CreateMCPSetAPI(w http.ResponseWriter, r *http.Request)

CreateMCPSetAPI handles POST /api/v1/mcp/sets.

func (*Server) CreateMarketplaceSourceAPI added in v0.2.0

func (s *Server) CreateMarketplaceSourceAPI(w http.ResponseWriter, r *http.Request)

func (*Server) CreateNodeConfigAPI added in v0.2.0

func (s *Server) CreateNodeConfigAPI(w http.ResponseWriter, r *http.Request)

CreateNodeConfigAPI handles POST /api/v1/node-configs.

func (*Server) CreateOrganizationAPI added in v0.2.0

func (s *Server) CreateOrganizationAPI(w http.ResponseWriter, r *http.Request)

CreateOrganizationAPI handles POST /api/v1/organizations.

func (*Server) CreatePackAPI added in v0.2.1

func (s *Server) CreatePackAPI(w http.ResponseWriter, r *http.Request)

CreatePackAPI handles POST /api/v1/integration-packs. Creates a new user pack folder with pack.json.

func (*Server) CreatePackSourceAPI added in v0.2.1

func (s *Server) CreatePackSourceAPI(w http.ResponseWriter, r *http.Request)

CreatePackSourceAPI handles POST /api/v1/pack-sources. Registers a Git repo and triggers an initial clone.

func (*Server) CreateProjectAPI added in v0.2.0

func (s *Server) CreateProjectAPI(w http.ResponseWriter, r *http.Request)

CreateProjectAPI handles POST /api/v1/projects.

func (*Server) CreateProviderAPI

func (s *Server) CreateProviderAPI(w http.ResponseWriter, r *http.Request)

CreateProviderAPI handles POST /api/v1/providers.

func (*Server) CreateRAGCollectionAPI added in v0.2.0

func (s *Server) CreateRAGCollectionAPI(w http.ResponseWriter, r *http.Request)

CreateRAGCollectionAPI handles POST /api/v1/rag/collections.

func (*Server) CreateRAGTriggerAPI added in v0.2.0

func (s *Server) CreateRAGTriggerAPI(w http.ResponseWriter, r *http.Request)

CreateRAGTriggerAPI handles POST /api/v1/rag/collections/{id}/triggers. Creates a trigger with target_type=rag_sync and target_id=collection ID.

func (*Server) CreateSkillAPI added in v0.2.0

func (s *Server) CreateSkillAPI(w http.ResponseWriter, r *http.Request)

CreateSkillAPI handles POST /api/v1/skills.

func (*Server) CreateTaskAPI added in v0.2.0

func (s *Server) CreateTaskAPI(w http.ResponseWriter, r *http.Request)

CreateTaskAPI handles POST /api/v1/tasks.

func (*Server) CreateTaskChatAPI added in v0.2.0

func (s *Server) CreateTaskChatAPI(w http.ResponseWriter, r *http.Request)

CreateTaskChatAPI handles POST /api/v1/tasks/{id}/chat. Creates (or returns existing) a chat session linked to a task, enabling interactive communication with the agent assigned to the task. If the task has saved conversation state from a previous delegation run, the messages are imported into the chat session.

func (*Server) CreateTriggerAPI added in v0.2.0

func (s *Server) CreateTriggerAPI(w http.ResponseWriter, r *http.Request)

CreateTriggerAPI handles POST /api/v1/workflows/:wf_id/triggers.

func (*Server) CreateTriggerGenericAPI added in v0.2.0

func (s *Server) CreateTriggerGenericAPI(w http.ResponseWriter, r *http.Request)

CreateTriggerGenericAPI handles POST /api/v1/triggers. Creates a trigger for any target type (workflow, rag_sync, etc.).

func (*Server) CreateVariableAPI added in v0.2.0

func (s *Server) CreateVariableAPI(w http.ResponseWriter, r *http.Request)

CreateVariableAPI handles POST /api/v1/variables.

func (*Server) CreateWakeupRequestAPI added in v0.2.0

func (s *Server) CreateWakeupRequestAPI(w http.ResponseWriter, r *http.Request)

CreateWakeupRequestAPI handles POST /api/v1/agents/{id}/wakeup.

func (*Server) CreateWorkflowAPI added in v0.2.0

func (s *Server) CreateWorkflowAPI(w http.ResponseWriter, r *http.Request)

CreateWorkflowAPI handles POST /api/v1/workflows.

func (*Server) DeleteAPITokenAPI

func (s *Server) DeleteAPITokenAPI(w http.ResponseWriter, r *http.Request)

DeleteAPITokenAPI handles DELETE /api/v1/api-tokens/:id.

func (*Server) DeleteAgentAPI added in v0.2.0

func (s *Server) DeleteAgentAPI(w http.ResponseWriter, r *http.Request)

DeleteAgentAPI handles DELETE /api/v1/agents/:id.

func (*Server) DeleteAgentMemoryAPI added in v0.2.0

func (s *Server) DeleteAgentMemoryAPI(w http.ResponseWriter, r *http.Request)

DeleteAgentMemoryAPI handles DELETE /api/v1/agent-memories/{id}.

func (*Server) DeleteAgentTaskSessionAPI added in v0.2.0

func (s *Server) DeleteAgentTaskSessionAPI(w http.ResponseWriter, r *http.Request)

DeleteAgentTaskSessionAPI handles DELETE /api/v1/agents/{id}/task-sessions/{task_key}.

func (*Server) DeleteBotConfigAPI added in v0.2.0

func (s *Server) DeleteBotConfigAPI(w http.ResponseWriter, r *http.Request)

DeleteBotConfigAPI handles DELETE /api/v1/bots/{id}.

func (*Server) DeleteChatMessagesAPI added in v0.2.0

func (s *Server) DeleteChatMessagesAPI(w http.ResponseWriter, r *http.Request)

DeleteChatMessagesAPI handles DELETE /api/v1/chat/sessions/{id}/messages.

func (*Server) DeleteChatSessionAPI added in v0.2.0

func (s *Server) DeleteChatSessionAPI(w http.ResponseWriter, r *http.Request)

DeleteChatSessionAPI handles DELETE /api/v1/chat/sessions/{id}.

func (*Server) DeleteCommentAPI added in v0.2.0

func (s *Server) DeleteCommentAPI(w http.ResponseWriter, r *http.Request)

DeleteCommentAPI handles DELETE /api/v1/comments/{id}.

func (*Server) DeleteConnectionAPI added in v0.2.1

func (s *Server) DeleteConnectionAPI(w http.ResponseWriter, r *http.Request)

DeleteConnectionAPI handles DELETE /api/v1/connections/{id}[?force=true]. By default, returns 409 Conflict with the list of agents that reference the connection. With ?force=true, the connection is deleted and all references are stripped from affected agent configs.

func (*Server) DeleteGoalAPI added in v0.2.0

func (s *Server) DeleteGoalAPI(w http.ResponseWriter, r *http.Request)

DeleteGoalAPI handles DELETE /api/v1/goals/{id}.

func (*Server) DeleteGuideAPI added in v0.2.1

func (s *Server) DeleteGuideAPI(w http.ResponseWriter, r *http.Request)

DeleteGuideAPI handles DELETE /api/v1/guides/{id}.

func (*Server) DeleteLabelAPI added in v0.2.0

func (s *Server) DeleteLabelAPI(w http.ResponseWriter, r *http.Request)

DeleteLabelAPI handles DELETE /api/v1/labels/{id}.

func (*Server) DeleteMCPServerAPI added in v0.2.0

func (s *Server) DeleteMCPServerAPI(w http.ResponseWriter, r *http.Request)

DeleteMCPServerAPI handles DELETE /api/v1/mcp/servers/{id}.

func (*Server) DeleteMCPSetAPI added in v0.2.0

func (s *Server) DeleteMCPSetAPI(w http.ResponseWriter, r *http.Request)

DeleteMCPSetAPI handles DELETE /api/v1/mcp/sets/{id}.

func (*Server) DeleteMarketplaceSourceAPI added in v0.2.0

func (s *Server) DeleteMarketplaceSourceAPI(w http.ResponseWriter, r *http.Request)

func (*Server) DeleteNodeConfigAPI added in v0.2.0

func (s *Server) DeleteNodeConfigAPI(w http.ResponseWriter, r *http.Request)

DeleteNodeConfigAPI handles DELETE /api/v1/node-configs/:id.

func (*Server) DeleteOrganizationAPI added in v0.2.0

func (s *Server) DeleteOrganizationAPI(w http.ResponseWriter, r *http.Request)

DeleteOrganizationAPI handles DELETE /api/v1/organizations/{id}.

func (*Server) DeletePackAPI added in v0.2.1

func (s *Server) DeletePackAPI(w http.ResponseWriter, r *http.Request)

DeletePackAPI handles DELETE /api/v1/integration-packs/{slug}.

func (*Server) DeletePackSourceAPI added in v0.2.1

func (s *Server) DeletePackSourceAPI(w http.ResponseWriter, r *http.Request)

DeletePackSourceAPI handles DELETE /api/v1/pack-sources/{id}.

func (*Server) DeleteProjectAPI added in v0.2.0

func (s *Server) DeleteProjectAPI(w http.ResponseWriter, r *http.Request)

DeleteProjectAPI handles DELETE /api/v1/projects/{id}.

func (*Server) DeleteProviderAPI

func (s *Server) DeleteProviderAPI(w http.ResponseWriter, r *http.Request)

DeleteProviderAPI handles DELETE /api/v1/providers/:key.

func (*Server) DeleteRAGCollectionAPI added in v0.2.0

func (s *Server) DeleteRAGCollectionAPI(w http.ResponseWriter, r *http.Request)

DeleteRAGCollectionAPI handles DELETE /api/v1/rag/collections/{id}.

func (*Server) DeleteRAGPageAPI added in v0.2.0

func (s *Server) DeleteRAGPageAPI(w http.ResponseWriter, r *http.Request)

DeleteRAGPageAPI handles DELETE /api/v1/rag/pages/{id}. Also deletes the corresponding chunks from the vector store.

func (*Server) DeleteSkillAPI added in v0.2.0

func (s *Server) DeleteSkillAPI(w http.ResponseWriter, r *http.Request)

DeleteSkillAPI handles DELETE /api/v1/skills/:id.

func (*Server) DeleteTaskAPI added in v0.2.0

func (s *Server) DeleteTaskAPI(w http.ResponseWriter, r *http.Request)

DeleteTaskAPI handles DELETE /api/v1/tasks/{id}.

func (*Server) DeleteTriggerAPI added in v0.2.0

func (s *Server) DeleteTriggerAPI(w http.ResponseWriter, r *http.Request)

DeleteTriggerAPI handles DELETE /api/v1/triggers/:id.

func (*Server) DeleteUserPreferenceAPI added in v0.2.0

func (s *Server) DeleteUserPreferenceAPI(w http.ResponseWriter, r *http.Request)

DeleteUserPreferenceAPI handles DELETE /api/v1/user-preferences/{user_id}/{key}

func (*Server) DeleteVariableAPI added in v0.2.0

func (s *Server) DeleteVariableAPI(w http.ResponseWriter, r *http.Request)

DeleteVariableAPI handles DELETE /api/v1/variables/:id.

func (*Server) DeleteWorkflowAPI added in v0.2.0

func (s *Server) DeleteWorkflowAPI(w http.ResponseWriter, r *http.Request)

DeleteWorkflowAPI handles DELETE /api/v1/workflows/:id.

func (*Server) DeviceAuthAPI

func (s *Server) DeviceAuthAPI(w http.ResponseWriter, r *http.Request)

DeviceAuthAPI handles POST /api/v1/providers/device-auth. Initiates the GitHub OAuth device flow for a Copilot provider.

func (*Server) DeviceAuthStatusAPI

func (s *Server) DeviceAuthStatusAPI(w http.ResponseWriter, r *http.Request)

DeviceAuthStatusAPI handles GET /api/v1/providers/device-auth-status?key=xxx. Returns the current status of the device authorization flow.

func (*Server) DiscoverEmbeddingModelsAPI added in v0.2.0

func (s *Server) DiscoverEmbeddingModelsAPI(w http.ResponseWriter, r *http.Request)

DiscoverEmbeddingModelsAPI handles POST /api/v1/rag/discover-embedding-models. It looks up the given provider's config and calls the upstream model listing API, returning only embedding-capable models.

func (*Server) DiscoverModelsAPI

func (s *Server) DiscoverModelsAPI(w http.ResponseWriter, r *http.Request)

DiscoverModelsAPI handles POST /api/v1/providers/discover-models. It uses the provided config (type, api_key, base_url, extra_headers, proxy) to call the upstream provider's model listing API and returns available model IDs.

func (*Server) ExportAgentAPI added in v0.2.1

func (s *Server) ExportAgentAPI(w http.ResponseWriter, r *http.Request)

ExportAgentAPI handles GET /api/v1/agents/{id}/export. Returns the agent as a downloadable markdown file.

func (*Server) ExportAgentJSONAPI added in v0.2.1

func (s *Server) ExportAgentJSONAPI(w http.ResponseWriter, r *http.Request)

ExportAgentJSONAPI handles GET /api/v1/agents/{id}/export-json. Returns the agent config as JSON (no ID/timestamps).

func (*Server) ExportMCPServerAPI added in v0.2.1

func (s *Server) ExportMCPServerAPI(w http.ResponseWriter, r *http.Request)

ExportMCPServerAPI handles GET /api/v1/mcp/servers/{id}/export.

func (*Server) ExportMCPSetAPI added in v0.2.1

func (s *Server) ExportMCPSetAPI(w http.ResponseWriter, r *http.Request)

ExportMCPSetAPI handles GET /api/v1/mcp/sets/{id}/export.

func (*Server) ExportOrganizationBundleAPI added in v0.2.1

func (s *Server) ExportOrganizationBundleAPI(w http.ResponseWriter, r *http.Request)

ExportOrganizationBundleAPI handles GET /api/v1/organizations/{id}/export. Resolves all dependencies and returns a ZIP bundle.

func (*Server) ExportSkillAPI added in v0.2.0

func (s *Server) ExportSkillAPI(w http.ResponseWriter, r *http.Request)

ExportSkillAPI handles GET /api/v1/skills/:id/export.

func (*Server) ExportSkillMDAPI added in v0.2.1

func (s *Server) ExportSkillMDAPI(w http.ResponseWriter, r *http.Request)

ExportSkillMDAPI handles GET /api/v1/skills/{id}/export-md. Returns the skill as a downloadable SKILL.md file with tools in the body.

func (*Server) FileBrowseAPI added in v0.2.0

func (s *Server) FileBrowseAPI(w http.ResponseWriter, r *http.Request)

FileBrowseAPI lists the contents of a directory. GET /api/v1/files/browse?path=/tmp

func (*Server) FileDeleteAPI added in v0.2.0

func (s *Server) FileDeleteAPI(w http.ResponseWriter, r *http.Request)

FileDeleteAPI deletes a file or empty directory. DELETE /api/v1/files?path=/tmp/video.mp4

func (*Server) FileServeAPI added in v0.2.0

func (s *Server) FileServeAPI(w http.ResponseWriter, r *http.Request)

FileServeAPI serves a file for viewing/downloading. GET /api/v1/files/serve?path=/tmp/video.mp4

func (*Server) GatewayMCPHandler added in v0.2.0

func (s *Server) GatewayMCPHandler(w http.ResponseWriter, r *http.Request)

GatewayMCPHandler handles MCP protocol requests at /gateway/v1/mcp/{name}. Each named endpoint can expose RAG tools, custom HTTP tools, or both. Auth uses the same Bearer token mechanism as the gateway chat completions endpoint.

func (*Server) GatewayMCPSSEHandler added in v0.2.0

func (s *Server) GatewayMCPSSEHandler(w http.ResponseWriter, r *http.Request)

GatewayMCPSSEHandler handles GET requests to MCP endpoints using the SSE transport. It opens a Server-Sent Events stream, sends the POST endpoint URL, then keeps alive. MCP clients that use SSE transport (e.g. OpenCode) connect via GET first.

func (*Server) GetActiveRunAPI added in v0.2.0

func (s *Server) GetActiveRunAPI(w http.ResponseWriter, r *http.Request)

GetActiveRunAPI handles GET /api/v1/agents/{id}/active-run.

func (*Server) GetAgentAPI added in v0.2.0

func (s *Server) GetAgentAPI(w http.ResponseWriter, r *http.Request)

GetAgentAPI handles GET /api/v1/agents/:id.

func (*Server) GetAgentBudgetAPI added in v0.2.0

func (s *Server) GetAgentBudgetAPI(w http.ResponseWriter, r *http.Request)

GetAgentBudgetAPI handles GET /api/v1/agents/{id}/budget.

func (*Server) GetAgentConfigRevisionAPI added in v0.2.0

func (s *Server) GetAgentConfigRevisionAPI(w http.ResponseWriter, r *http.Request)

GetAgentConfigRevisionAPI handles GET /api/v1/agent-config-revisions/{id}.

func (*Server) GetAgentMemoryAPI added in v0.2.0

func (s *Server) GetAgentMemoryAPI(w http.ResponseWriter, r *http.Request)

GetAgentMemoryAPI handles GET /api/v1/agent-memories/{id}.

func (*Server) GetAgentMemoryMessagesAPI added in v0.2.0

func (s *Server) GetAgentMemoryMessagesAPI(w http.ResponseWriter, r *http.Request)

GetAgentMemoryMessagesAPI handles GET /api/v1/agent-memories/{id}/messages.

func (*Server) GetAgentRuntimeStateAPI added in v0.2.0

func (s *Server) GetAgentRuntimeStateAPI(w http.ResponseWriter, r *http.Request)

GetAgentRuntimeStateAPI handles GET /api/v1/agents/{id}/runtime-state.

func (*Server) GetAgentSpendAPI added in v0.2.0

func (s *Server) GetAgentSpendAPI(w http.ResponseWriter, r *http.Request)

GetAgentSpendAPI handles GET /api/v1/agents/{id}/spend.

func (*Server) GetAgentTaskSessionAPI added in v0.2.0

func (s *Server) GetAgentTaskSessionAPI(w http.ResponseWriter, r *http.Request)

GetAgentTaskSessionAPI handles GET /api/v1/agents/{id}/task-sessions/{task_key}.

func (*Server) GetAgentUsageAPI added in v0.2.0

func (s *Server) GetAgentUsageAPI(w http.ResponseWriter, r *http.Request)

GetAgentUsageAPI handles GET /api/v1/agents/{id}/usage.

func (*Server) GetApprovalAPI added in v0.2.0

func (s *Server) GetApprovalAPI(w http.ResponseWriter, r *http.Request)

GetApprovalAPI handles GET /api/v1/approvals/{id}.

func (*Server) GetAuditTrailAPI added in v0.2.0

func (s *Server) GetAuditTrailAPI(w http.ResponseWriter, r *http.Request)

GetAuditTrailAPI handles GET /api/v1/audit/{resource_type}/{resource_id}.

func (*Server) GetBotConfigAPI added in v0.2.0

func (s *Server) GetBotConfigAPI(w http.ResponseWriter, r *http.Request)

GetBotConfigAPI handles GET /api/v1/bots/{id}.

func (*Server) GetBotStatusAPI added in v0.2.1

func (s *Server) GetBotStatusAPI(w http.ResponseWriter, r *http.Request)

GetBotStatusAPI handles GET /api/v1/bots/{id}/status.

func (*Server) GetChatSessionAPI added in v0.2.0

func (s *Server) GetChatSessionAPI(w http.ResponseWriter, r *http.Request)

GetChatSessionAPI handles GET /api/v1/chat/sessions/{id}.

func (*Server) GetCommentAPI added in v0.2.0

func (s *Server) GetCommentAPI(w http.ResponseWriter, r *http.Request)

GetCommentAPI handles GET /api/v1/comments/{id}.

func (*Server) GetConnectionAPI added in v0.2.1

func (s *Server) GetConnectionAPI(w http.ResponseWriter, r *http.Request)

GetConnectionAPI handles GET /api/v1/connections/{id}[?reveal=true].

func (*Server) GetCostByAgentAPI added in v0.2.0

func (s *Server) GetCostByAgentAPI(w http.ResponseWriter, r *http.Request)

GetCostByAgentAPI handles GET /api/v1/agents/{id}/cost.

func (*Server) GetCostByBillingCodeAPI added in v0.2.0

func (s *Server) GetCostByBillingCodeAPI(w http.ResponseWriter, r *http.Request)

GetCostByBillingCodeAPI handles GET /api/v1/cost-events/by-billing-code?code=xxx.

func (*Server) GetCostByGoalAPI added in v0.2.0

func (s *Server) GetCostByGoalAPI(w http.ResponseWriter, r *http.Request)

GetCostByGoalAPI handles GET /api/v1/goals/{id}/cost.

func (*Server) GetCostByProjectAPI added in v0.2.0

func (s *Server) GetCostByProjectAPI(w http.ResponseWriter, r *http.Request)

GetCostByProjectAPI handles GET /api/v1/projects/{id}/cost.

func (*Server) GetGoalAPI added in v0.2.0

func (s *Server) GetGoalAPI(w http.ResponseWriter, r *http.Request)

GetGoalAPI handles GET /api/v1/goals/{id}.

func (*Server) GetGoalAncestryAPI added in v0.2.0

func (s *Server) GetGoalAncestryAPI(w http.ResponseWriter, r *http.Request)

GetGoalAncestryAPI handles GET /api/v1/goals/{id}/ancestry.

func (*Server) GetGuideAPI added in v0.2.1

func (s *Server) GetGuideAPI(w http.ResponseWriter, r *http.Request)

GetGuideAPI handles GET /api/v1/guides/{id}.

func (*Server) GetHeartbeatAPI added in v0.2.0

func (s *Server) GetHeartbeatAPI(w http.ResponseWriter, r *http.Request)

GetHeartbeatAPI handles GET /api/v1/agents/{id}/heartbeat-status.

func (*Server) GetHeartbeatRunAPI added in v0.2.0

func (s *Server) GetHeartbeatRunAPI(w http.ResponseWriter, r *http.Request)

GetHeartbeatRunAPI handles GET /api/v1/heartbeat-runs/{id}.

func (*Server) GetIntegrationPackAPI added in v0.2.1

func (s *Server) GetIntegrationPackAPI(w http.ResponseWriter, r *http.Request)

GetIntegrationPackAPI handles GET /api/v1/integration-packs/{slug}.

func (*Server) GetLabelAPI added in v0.2.0

func (s *Server) GetLabelAPI(w http.ResponseWriter, r *http.Request)

GetLabelAPI handles GET /api/v1/labels/{id}.

func (*Server) GetLatestAgentConfigRevisionAPI added in v0.2.0

func (s *Server) GetLatestAgentConfigRevisionAPI(w http.ResponseWriter, r *http.Request)

GetLatestAgentConfigRevisionAPI handles GET /api/v1/agents/{id}/config-revisions/latest.

func (*Server) GetMCPServerAPI added in v0.2.0

func (s *Server) GetMCPServerAPI(w http.ResponseWriter, r *http.Request)

GetMCPServerAPI handles GET /api/v1/mcp/servers/{id}.

func (*Server) GetMCPSetAPI added in v0.2.0

func (s *Server) GetMCPSetAPI(w http.ResponseWriter, r *http.Request)

GetMCPSetAPI handles GET /api/v1/mcp/sets/{id}.

func (*Server) GetMCPTemplateAPI added in v0.2.0

func (s *Server) GetMCPTemplateAPI(w http.ResponseWriter, r *http.Request)

GetMCPTemplateAPI handles GET /api/v1/mcp-templates/{slug}.

func (*Server) GetNodeConfigAPI added in v0.2.0

func (s *Server) GetNodeConfigAPI(w http.ResponseWriter, r *http.Request)

GetNodeConfigAPI handles GET /api/v1/node-configs/:id. Returns full data including sensitive fields (for editing).

func (*Server) GetOrganizationAPI added in v0.2.0

func (s *Server) GetOrganizationAPI(w http.ResponseWriter, r *http.Request)

GetOrganizationAPI handles GET /api/v1/organizations/{id}.

func (*Server) GetProjectAPI added in v0.2.0

func (s *Server) GetProjectAPI(w http.ResponseWriter, r *http.Request)

GetProjectAPI handles GET /api/v1/projects/{id}.

func (*Server) GetProviderAPI

func (s *Server) GetProviderAPI(w http.ResponseWriter, r *http.Request)

GetProviderAPI handles GET /api/v1/providers/:key.

func (*Server) GetRAGCollectionAPI added in v0.2.0

func (s *Server) GetRAGCollectionAPI(w http.ResponseWriter, r *http.Request)

GetRAGCollectionAPI handles GET /api/v1/rag/collections/{id}.

func (*Server) GetRAGPageAPI added in v0.2.0

func (s *Server) GetRAGPageAPI(w http.ResponseWriter, r *http.Request)

GetRAGPageAPI handles GET /api/v1/rag/pages/{id}.

func (*Server) GetSkillAPI added in v0.2.0

func (s *Server) GetSkillAPI(w http.ResponseWriter, r *http.Request)

GetSkillAPI handles GET /api/v1/skills/:id.

func (*Server) GetSkillTemplateAPI added in v0.2.0

func (s *Server) GetSkillTemplateAPI(w http.ResponseWriter, r *http.Request)

GetSkillTemplateAPI handles GET /api/v1/skill-templates/{slug}.

func (*Server) GetTaskAPI added in v0.2.0

func (s *Server) GetTaskAPI(w http.ResponseWriter, r *http.Request)

GetTaskAPI handles GET /api/v1/tasks/{id}.

func (*Server) GetTokenUsageAPI added in v0.2.0

func (s *Server) GetTokenUsageAPI(w http.ResponseWriter, r *http.Request)

GetTokenUsageAPI handles GET /api/v1/api-tokens/:id/usage.

func (*Server) GetTriggerAPI added in v0.2.0

func (s *Server) GetTriggerAPI(w http.ResponseWriter, r *http.Request)

GetTriggerAPI handles GET /api/v1/triggers/:id.

func (*Server) GetUsageBudgetsAPI added in v0.2.1

func (s *Server) GetUsageBudgetsAPI(w http.ResponseWriter, r *http.Request)

GetUsageBudgetsAPI handles GET /api/v1/usage/budgets. Returns all configured agent budgets with their utilization percent computed.

func (*Server) GetUsageGroupedAPI added in v0.2.1

func (s *Server) GetUsageGroupedAPI(w http.ResponseWriter, r *http.Request)

GetUsageGroupedAPI handles GET /api/v1/usage/grouped?group_by=provider&....

func (*Server) GetUsageSummaryAPI added in v0.2.1

func (s *Server) GetUsageSummaryAPI(w http.ResponseWriter, r *http.Request)

GetUsageSummaryAPI handles GET /api/v1/usage/summary.

func (*Server) GetUsageTimeSeriesAPI added in v0.2.1

func (s *Server) GetUsageTimeSeriesAPI(w http.ResponseWriter, r *http.Request)

GetUsageTimeSeriesAPI handles GET /api/v1/usage/timeseries?bucket=day&....

func (*Server) GetUserPreferenceAPI added in v0.2.0

func (s *Server) GetUserPreferenceAPI(w http.ResponseWriter, r *http.Request)

GetUserPreferenceAPI handles GET /api/v1/user-preferences/{user_id}/{key}

func (*Server) GetVariableAPI added in v0.2.0

func (s *Server) GetVariableAPI(w http.ResponseWriter, r *http.Request)

GetVariableAPI handles GET /api/v1/variables/:id. The value is returned in full (not redacted) for single-variable retrieval.

func (*Server) GetWakeupRequestAPI added in v0.2.0

func (s *Server) GetWakeupRequestAPI(w http.ResponseWriter, r *http.Request)

GetWakeupRequestAPI handles GET /api/v1/wakeup-requests/{id}.

func (*Server) GetWorkflowAPI added in v0.2.0

func (s *Server) GetWorkflowAPI(w http.ResponseWriter, r *http.Request)

GetWorkflowAPI handles GET /api/v1/workflows/:id.

func (*Server) GetWorkflowVersionAPI added in v0.2.0

func (s *Server) GetWorkflowVersionAPI(w http.ResponseWriter, r *http.Request)

GetWorkflowVersionAPI handles GET /api/v1/workflows/:id/versions/:version.

func (*Server) ImportAgentAPI added in v0.2.1

func (s *Server) ImportAgentAPI(w http.ResponseWriter, r *http.Request)

ImportAgentAPI handles POST /api/v1/agents/import. Accepts markdown content (agent .md) in the request body.

func (*Server) ImportConnectionsFromVariablesAPI added in v0.2.1

func (s *Server) ImportConnectionsFromVariablesAPI(w http.ResponseWriter, r *http.Request)

ImportConnectionsFromVariablesAPI handles POST /api/v1/connections/import-from-variables. Scans the global variables table for known OAuth provider key triples (e.g. youtube_client_id + youtube_client_secret + youtube_refresh_token) and creates a Connection row named "Imported (<provider>)" for each complete set. The original variables are left in place as a fallback; the new connection simply takes priority when an agent is bound to it.

func (*Server) ImportMCPServerAPI added in v0.2.1

func (s *Server) ImportMCPServerAPI(w http.ResponseWriter, r *http.Request)

ImportMCPServerAPI handles POST /api/v1/mcp/servers/import.

func (*Server) ImportMCPSetAPI added in v0.2.1

func (s *Server) ImportMCPSetAPI(w http.ResponseWriter, r *http.Request)

ImportMCPSetAPI handles POST /api/v1/mcp/sets/import.

func (*Server) ImportOrganizationBundleAPI added in v0.2.1

func (s *Server) ImportOrganizationBundleAPI(w http.ResponseWriter, r *http.Request)

ImportOrganizationBundleAPI handles POST /api/v1/organizations/import. Accepts a multipart form with:

  • file: the ZIP bundle
  • actions: JSON object with per-entity conflict resolution decisions

func (*Server) ImportRAGFromURLAPI added in v0.2.0

func (s *Server) ImportRAGFromURLAPI(w http.ResponseWriter, r *http.Request)

ImportRAGFromURLAPI handles POST /api/v1/rag/collections/{id}/import/url. Fetches content from a URL and ingests it into the collection.

func (*Server) ImportSkillAPI added in v0.2.0

func (s *Server) ImportSkillAPI(w http.ResponseWriter, r *http.Request)

ImportSkillAPI handles POST /api/v1/skills/import.

func (*Server) ImportSkillFromURLAPI added in v0.2.0

func (s *Server) ImportSkillFromURLAPI(w http.ResponseWriter, r *http.Request)

ImportSkillFromURLAPI handles POST /api/v1/skills/import-url. Auto-detects JSON and SKILL.md formats.

func (*Server) ImportSkillMDAPI added in v0.2.0

func (s *Server) ImportSkillMDAPI(w http.ResponseWriter, r *http.Request)

ImportSkillMDAPI handles POST /api/v1/skills/import-skillmd. Parses raw SKILL.md content and creates a skill.

func (*Server) InfoAPI

func (s *Server) InfoAPI(w http.ResponseWriter, r *http.Request)

InfoAPI handles GET /api/v1/info. Returns gateway status: registered providers, model counts, store type.

func (*Server) InstallIntegrationPackAPI added in v0.2.1

func (s *Server) InstallIntegrationPackAPI(w http.ResponseWriter, r *http.Request)

InstallIntegrationPackAPI handles POST /api/v1/integration-packs/{slug}/install.

func (*Server) InstallMCPTemplateAPI added in v0.2.0

func (s *Server) InstallMCPTemplateAPI(w http.ResponseWriter, r *http.Request)

InstallMCPTemplateAPI handles POST /api/v1/mcp-templates/{slug}/install. Templates are installed as MCPSets (internal MCPs), not as external MCP Servers.

func (*Server) InstallSkillTemplateAPI added in v0.2.0

func (s *Server) InstallSkillTemplateAPI(w http.ResponseWriter, r *http.Request)

InstallSkillTemplateAPI handles POST /api/v1/skill-templates/{slug}/install.

func (*Server) IntakeTaskAPI added in v0.2.0

func (s *Server) IntakeTaskAPI(w http.ResponseWriter, r *http.Request)

IntakeTaskAPI handles POST /api/v1/organizations/{id}/tasks. Creates a task assigned to the org's head agent and returns 202 Accepted. After task creation, fires runOrgDelegation in a background goroutine.

func (*Server) InternalMCPHandler added in v0.2.0

func (s *Server) InternalMCPHandler(w http.ResponseWriter, r *http.Request)

InternalMCPHandler handles MCP protocol requests at /internal/v1/mcp/{name}. It serves tools from an MCP Set's own Config (RAG/HTTP/External/Skills/Builtins). This endpoint has NO authentication — it is only reachable internally by agents and is not exposed under /gateway/ so external clients cannot access it.

func (*Server) ListAPITokensAPI

func (s *Server) ListAPITokensAPI(w http.ResponseWriter, r *http.Request)

ListAPITokensAPI handles GET /api/v1/api-tokens.

func (*Server) ListActiveDelegationsAPI added in v0.2.1

func (s *Server) ListActiveDelegationsAPI(w http.ResponseWriter, _ *http.Request)

ListActiveDelegationsAPI handles GET /api/v1/active-delegations.

func (*Server) ListActiveRunsAPI added in v0.2.0

func (s *Server) ListActiveRunsAPI(w http.ResponseWriter, r *http.Request)

ListActiveRunsAPI handles GET /api/v1/runs.

func (*Server) ListAgentConfigRevisionsAPI added in v0.2.0

func (s *Server) ListAgentConfigRevisionsAPI(w http.ResponseWriter, r *http.Request)

ListAgentConfigRevisionsAPI handles GET /api/v1/agents/{id}/config-revisions.

func (*Server) ListAgentTaskSessionsAPI added in v0.2.0

func (s *Server) ListAgentTaskSessionsAPI(w http.ResponseWriter, r *http.Request)

ListAgentTaskSessionsAPI handles GET /api/v1/agents/{id}/task-sessions.

func (*Server) ListAgentsAPI added in v0.2.0

func (s *Server) ListAgentsAPI(w http.ResponseWriter, r *http.Request)

ListAgentsAPI handles GET /api/v1/agents.

func (*Server) ListAllTriggersAPI added in v0.2.0

func (s *Server) ListAllTriggersAPI(w http.ResponseWriter, r *http.Request)

ListAllTriggersAPI handles GET /api/v1/triggers. Supports optional ?type=http or ?type=cron query parameter to filter by trigger type.

func (*Server) ListApprovalsAPI added in v0.2.0

func (s *Server) ListApprovalsAPI(w http.ResponseWriter, r *http.Request)

ListApprovalsAPI handles GET /api/v1/approvals.

func (*Server) ListAuditEntriesAPI added in v0.2.0

func (s *Server) ListAuditEntriesAPI(w http.ResponseWriter, r *http.Request)

ListAuditEntriesAPI handles GET /api/v1/audit.

func (*Server) ListBotConfigsAPI added in v0.2.0

func (s *Server) ListBotConfigsAPI(w http.ResponseWriter, r *http.Request)

ListBotConfigsAPI handles GET /api/v1/bots.

func (*Server) ListChatMessagesAPI added in v0.2.0

func (s *Server) ListChatMessagesAPI(w http.ResponseWriter, r *http.Request)

ListChatMessagesAPI handles GET /api/v1/chat/sessions/{id}/messages.

func (*Server) ListChatSessionsAPI added in v0.2.0

func (s *Server) ListChatSessionsAPI(w http.ResponseWriter, r *http.Request)

ListChatSessionsAPI handles GET /api/v1/chat/sessions.

func (*Server) ListCommentsByTaskAPI added in v0.2.0

func (s *Server) ListCommentsByTaskAPI(w http.ResponseWriter, r *http.Request)

ListCommentsByTaskAPI handles GET /api/v1/tasks/{id}/comments.

func (*Server) ListConnectionsAPI added in v0.2.1

func (s *Server) ListConnectionsAPI(w http.ResponseWriter, r *http.Request)

ListConnectionsAPI handles GET /api/v1/connections[?provider=youtube]. Secrets are always redacted in list responses.

func (*Server) ListCostEventsAPI added in v0.2.0

func (s *Server) ListCostEventsAPI(w http.ResponseWriter, r *http.Request)

ListCostEventsAPI handles GET /api/v1/cost-events.

func (*Server) ListGoalChildrenAPI added in v0.2.0

func (s *Server) ListGoalChildrenAPI(w http.ResponseWriter, r *http.Request)

ListGoalChildrenAPI handles GET /api/v1/goals/{id}/children.

func (*Server) ListGoalsAPI added in v0.2.0

func (s *Server) ListGoalsAPI(w http.ResponseWriter, r *http.Request)

ListGoalsAPI handles GET /api/v1/goals.

func (*Server) ListGuidesAPI added in v0.2.1

func (s *Server) ListGuidesAPI(w http.ResponseWriter, r *http.Request)

ListGuidesAPI handles GET /api/v1/guides.

func (*Server) ListHeartbeatRunsAPI added in v0.2.0

func (s *Server) ListHeartbeatRunsAPI(w http.ResponseWriter, r *http.Request)

ListHeartbeatRunsAPI handles GET /api/v1/agents/{id}/runs.

func (*Server) ListHeartbeatsAPI added in v0.2.0

func (s *Server) ListHeartbeatsAPI(w http.ResponseWriter, r *http.Request)

ListHeartbeatsAPI handles GET /api/v1/heartbeats.

func (*Server) ListIntegrationPacksAPI added in v0.2.1

func (s *Server) ListIntegrationPacksAPI(w http.ResponseWriter, r *http.Request)

ListIntegrationPacksAPI handles GET /api/v1/integration-packs.

func (*Server) ListLabelsAPI added in v0.2.0

func (s *Server) ListLabelsAPI(w http.ResponseWriter, r *http.Request)

ListLabelsAPI handles GET /api/v1/labels?org_id=xxx.

func (*Server) ListLabelsForTaskAPI added in v0.2.0

func (s *Server) ListLabelsForTaskAPI(w http.ResponseWriter, r *http.Request)

ListLabelsForTaskAPI handles GET /api/v1/tasks/{id}/labels.

func (*Server) ListMCPServersAPI added in v0.2.0

func (s *Server) ListMCPServersAPI(w http.ResponseWriter, r *http.Request)

ListMCPServersAPI handles GET /api/v1/mcp/servers.

func (*Server) ListMCPSetToolsAPI added in v0.2.0

func (s *Server) ListMCPSetToolsAPI(w http.ResponseWriter, r *http.Request)

ListMCPSetToolsAPI handles GET /api/v1/mcp/sets/{name}/tools. Returns the list of tools available in an MCP Set (skills, builtins, upstreams, RAG, HTTP). Used by the Chat UI to discover tools when the user selects an MCP Set.

func (*Server) ListMCPSetsAPI added in v0.2.0

func (s *Server) ListMCPSetsAPI(w http.ResponseWriter, r *http.Request)

ListMCPSetsAPI handles GET /api/v1/mcp/sets.

func (*Server) ListMCPTemplatesAPI added in v0.2.0

func (s *Server) ListMCPTemplatesAPI(w http.ResponseWriter, r *http.Request)

ListMCPTemplatesAPI handles GET /api/v1/mcp-templates.

func (*Server) ListMarketplaceSourcesAPI added in v0.2.0

func (s *Server) ListMarketplaceSourcesAPI(w http.ResponseWriter, r *http.Request)

func (*Server) ListModelPricingAPI added in v0.2.0

func (s *Server) ListModelPricingAPI(w http.ResponseWriter, r *http.Request)

ListModelPricingAPI handles GET /api/v1/model-pricing.

func (*Server) ListModels

func (s *Server) ListModels(w http.ResponseWriter, r *http.Request)

ListModels handles GET /gateway/v1/models. It returns all configured provider/model combinations in OpenAI format. If a provider has a models list, each model is advertised. Otherwise, only the default model is shown. When authenticated via a DB token with restrictions, models are filtered.

func (*Server) ListNodeConfigsAPI added in v0.2.0

func (s *Server) ListNodeConfigsAPI(w http.ResponseWriter, r *http.Request)

ListNodeConfigsAPI handles GET /api/v1/node-configs. Supports optional ?type=email query parameter for filtered listing. Sensitive fields (like password) are redacted in list responses.

func (*Server) ListOrgMemoriesAPI added in v0.2.0

func (s *Server) ListOrgMemoriesAPI(w http.ResponseWriter, r *http.Request)

ListOrgMemoriesAPI handles GET /api/v1/organizations/{id}/memories. Optional query param: ?agent_id=... to filter by agent.

func (*Server) ListOrganizationAgentsAPI added in v0.2.0

func (s *Server) ListOrganizationAgentsAPI(w http.ResponseWriter, r *http.Request)

ListOrganizationAgentsAPI handles GET /api/v1/organizations/{id}/agents.

func (*Server) ListOrganizationsAPI added in v0.2.0

func (s *Server) ListOrganizationsAPI(w http.ResponseWriter, r *http.Request)

ListOrganizationsAPI handles GET /api/v1/organizations.

func (*Server) ListPackSourcesAPI added in v0.2.1

func (s *Server) ListPackSourcesAPI(w http.ResponseWriter, r *http.Request)

ListPackSourcesAPI handles GET /api/v1/pack-sources.

func (*Server) ListPendingApprovalsAPI added in v0.2.0

func (s *Server) ListPendingApprovalsAPI(w http.ResponseWriter, r *http.Request)

ListPendingApprovalsAPI handles GET /api/v1/approvals/pending.

func (*Server) ListPendingWakeupRequestsAPI added in v0.2.0

func (s *Server) ListPendingWakeupRequestsAPI(w http.ResponseWriter, r *http.Request)

ListPendingWakeupRequestsAPI handles GET /api/v1/agents/{id}/wakeup-requests.

func (*Server) ListProjectsAPI added in v0.2.0

func (s *Server) ListProjectsAPI(w http.ResponseWriter, r *http.Request)

ListProjectsAPI handles GET /api/v1/projects.

func (*Server) ListProjectsByGoalAPI added in v0.2.0

func (s *Server) ListProjectsByGoalAPI(w http.ResponseWriter, r *http.Request)

ListProjectsByGoalAPI handles GET /api/v1/goals/{id}/projects.

func (*Server) ListProjectsByOrganizationAPI added in v0.2.0

func (s *Server) ListProjectsByOrganizationAPI(w http.ResponseWriter, r *http.Request)

ListProjectsByOrganizationAPI handles GET /api/v1/organizations/{id}/projects.

func (*Server) ListProvidersAPI

func (s *Server) ListProvidersAPI(w http.ResponseWriter, r *http.Request)

ListProvidersAPI handles GET /api/v1/providers.

func (*Server) ListRAGCollectionsAPI added in v0.2.0

func (s *Server) ListRAGCollectionsAPI(w http.ResponseWriter, r *http.Request)

ListRAGCollectionsAPI handles GET /api/v1/rag/collections.

func (*Server) ListRAGPagesAPI added in v0.2.0

func (s *Server) ListRAGPagesAPI(w http.ResponseWriter, r *http.Request)

ListRAGPagesAPI handles GET /api/v1/rag/collections/{id}/pages.

func (*Server) ListRAGTriggersAPI added in v0.2.0

func (s *Server) ListRAGTriggersAPI(w http.ResponseWriter, r *http.Request)

ListRAGTriggersAPI handles GET /api/v1/rag/collections/{id}/triggers. Returns all triggers whose target_type is "rag_sync" and target_id matches the collection.

func (*Server) ListSkillTemplatesAPI added in v0.2.0

func (s *Server) ListSkillTemplatesAPI(w http.ResponseWriter, r *http.Request)

ListSkillTemplatesAPI handles GET /api/v1/skill-templates.

func (*Server) ListSkillsAPI added in v0.2.0

func (s *Server) ListSkillsAPI(w http.ResponseWriter, r *http.Request)

ListSkillsAPI handles GET /api/v1/skills.

func (*Server) ListTasksAPI added in v0.2.0

func (s *Server) ListTasksAPI(w http.ResponseWriter, r *http.Request)

ListTasksAPI handles GET /api/v1/tasks.

func (*Server) ListTasksByAgentAPI added in v0.2.0

func (s *Server) ListTasksByAgentAPI(w http.ResponseWriter, r *http.Request)

ListTasksByAgentAPI handles GET /api/v1/agents/{id}/tasks.

func (*Server) ListTasksForLabelAPI added in v0.2.0

func (s *Server) ListTasksForLabelAPI(w http.ResponseWriter, r *http.Request)

ListTasksForLabelAPI handles GET /api/v1/labels/{id}/tasks.

func (*Server) ListTriggersAPI added in v0.2.0

func (s *Server) ListTriggersAPI(w http.ResponseWriter, r *http.Request)

ListTriggersAPI handles GET /api/v1/workflows/:wf_id/triggers.

func (*Server) ListUserPreferencesAPI added in v0.2.0

func (s *Server) ListUserPreferencesAPI(w http.ResponseWriter, r *http.Request)

ListUserPreferencesAPI handles GET /api/v1/user-preferences?user_id=...

func (*Server) ListVariablesAPI added in v0.2.0

func (s *Server) ListVariablesAPI(w http.ResponseWriter, r *http.Request)

ListVariablesAPI handles GET /api/v1/variables. Secret variable values are redacted; non-secret values are shown inline.

func (*Server) ListWorkflowNodeTypesAPI added in v0.2.0

func (s *Server) ListWorkflowNodeTypesAPI(w http.ResponseWriter, r *http.Request)

ListWorkflowNodeTypesAPI handles GET /api/v1/workflow-node-types. Returns metadata for all registered node types including port schemas, categories, and display hints. Used by the frontend to render handles, validate connections, and populate the node palette.

func (*Server) ListWorkflowVersionsAPI added in v0.2.0

func (s *Server) ListWorkflowVersionsAPI(w http.ResponseWriter, r *http.Request)

ListWorkflowVersionsAPI handles GET /api/v1/workflows/:id/versions.

func (*Server) ListWorkflowsAPI added in v0.2.0

func (s *Server) ListWorkflowsAPI(w http.ResponseWriter, r *http.Request)

ListWorkflowsAPI handles GET /api/v1/workflows.

func (*Server) MCPCallToolAPI added in v0.2.0

func (s *Server) MCPCallToolAPI(w http.ResponseWriter, r *http.Request)

MCPCallToolAPI handles POST /api/v1/mcp/call-tool. It connects to the specified MCP server and invokes the named tool.

func (*Server) MCPListToolsAPI added in v0.2.0

func (s *Server) MCPListToolsAPI(w http.ResponseWriter, r *http.Request)

MCPListToolsAPI handles POST /api/v1/mcp/list-tools. It connects to each provided MCP server URL, discovers available tools, and returns the merged tool list.

func (*Server) MarkWakeupDispatchedAPI added in v0.2.0

func (s *Server) MarkWakeupDispatchedAPI(w http.ResponseWriter, r *http.Request)

MarkWakeupDispatchedAPI handles POST /api/v1/wakeup-requests/{id}/dispatch.

func (*Server) MarketplaceImportAPI added in v0.2.0

func (s *Server) MarketplaceImportAPI(w http.ResponseWriter, r *http.Request)

func (*Server) MarketplacePreviewAPI added in v0.2.0

func (s *Server) MarketplacePreviewAPI(w http.ResponseWriter, r *http.Request)

func (*Server) MarketplaceSearchAPI added in v0.2.0

func (s *Server) MarketplaceSearchAPI(w http.ResponseWriter, r *http.Request)

func (*Server) MarketplaceTopAPI added in v0.2.0

func (s *Server) MarketplaceTopAPI(w http.ResponseWriter, r *http.Request)

func (*Server) OAuthCallbackAPI added in v0.2.0

func (s *Server) OAuthCallbackAPI(w http.ResponseWriter, r *http.Request)

OAuthCallbackAPI handles the redirect from the OAuth2 provider. State encoding (see parseOAuthState):

  • "provider" — global refresh token
  • "provider::user_id" — per-chat-user refresh token
  • "provider::conn::<connection_id>" — write to a named connection row

func (*Server) OAuthCodeDisplayAPI added in v0.2.0

func (s *Server) OAuthCodeDisplayAPI(w http.ResponseWriter, r *http.Request)

OAuthCodeDisplayAPI is a redirect target that shows the authorization code to the user. GET /api/v1/oauth/code-display?code=...&state=... This page displays the code so the user can copy it back to the AT Connections page.

func (*Server) OAuthConnectionsAPI added in v0.2.0

func (s *Server) OAuthConnectionsAPI(w http.ResponseWriter, r *http.Request)

OAuthConnectionsAPI returns the status of all known external service connections. GET /api/v1/oauth/connections

func (*Server) OAuthDisconnectAPI added in v0.2.0

func (s *Server) OAuthDisconnectAPI(w http.ResponseWriter, r *http.Request)

OAuthDisconnectAPI removes the refresh token for an OAuth provider. DELETE /api/v1/oauth/connections/{provider}

func (*Server) OAuthExchangeAPI added in v0.2.0

func (s *Server) OAuthExchangeAPI(w http.ResponseWriter, r *http.Request)

OAuthExchangeAPI exchanges a manually-pasted authorization code for tokens. POST /api/v1/oauth/exchange {provider, code, redirect_uri, connection_id?} When connection_id is set, the refresh token is stored on the connection row and that connection's client_id/client_secret are used for the exchange.

func (*Server) OAuthManualAuthURLAPI added in v0.2.0

func (s *Server) OAuthManualAuthURLAPI(w http.ResponseWriter, r *http.Request)

OAuthManualAuthURLAPI returns an auth URL using a special redirect URI that shows the code. GET /api/v1/oauth/manual-url?provider=youtube This is for cases where the standard redirect URI doesn't work (localhost issues, etc.) The redirect goes to AT's own /api/v1/oauth/code-display page which shows the code to copy.

func (*Server) OAuthStartAPI added in v0.2.0

func (s *Server) OAuthStartAPI(w http.ResponseWriter, r *http.Request)

OAuthStartAPI returns the OAuth2 authorization URL for a provider. GET /api/v1/oauth/start?provider=google&scopes=gmail.readonly,calendar&user_id=discord::12345 GET /api/v1/oauth/start?provider=youtube&connection_id=conn_01HV

State encoding:

  • "provider" — global refresh token (legacy)
  • "provider::user_id" — per-chat-user refresh token (legacy)
  • "provider::conn::<connection_id>" — write to a named connection row

When connection_id is provided, the connection's own client_id/client_secret are used (and the resulting refresh token is stored on the connection row). Otherwise the legacy flow reads the client_id from the global variables table.

func (*Server) PreviewImportAgentAPI added in v0.2.1

func (s *Server) PreviewImportAgentAPI(w http.ResponseWriter, r *http.Request)

PreviewImportAgentAPI handles POST /api/v1/agents/import/preview. Parses the markdown without persisting, returns the parsed agent config.

func (*Server) PreviewImportBundleAPI added in v0.2.1

func (s *Server) PreviewImportBundleAPI(w http.ResponseWriter, r *http.Request)

PreviewImportBundleAPI handles POST /api/v1/organizations/import/preview. Parses the ZIP bundle and detects conflicts without persisting anything.

func (*Server) PreviewImportMCPServerAPI added in v0.2.1

func (s *Server) PreviewImportMCPServerAPI(w http.ResponseWriter, r *http.Request)

PreviewImportMCPServerAPI handles POST /api/v1/mcp/servers/import/preview.

func (*Server) PreviewImportMCPSetAPI added in v0.2.1

func (s *Server) PreviewImportMCPSetAPI(w http.ResponseWriter, r *http.Request)

PreviewImportMCPSetAPI handles POST /api/v1/mcp/sets/import/preview.

func (*Server) PreviewImportURLAPI added in v0.2.0

func (s *Server) PreviewImportURLAPI(w http.ResponseWriter, r *http.Request)

PreviewImportURLAPI handles POST /api/v1/skills/import-url/preview. Fetches and parses a skill URL without persisting.

func (*Server) ProcessTaskAPI added in v0.2.0

func (s *Server) ProcessTaskAPI(w http.ResponseWriter, r *http.Request)

ProcessTaskAPI handles POST /api/v1/tasks/{id}/process. Triggers org delegation on an existing task that has an organization_id. The task must belong to an organization with a head agent configured. Accepts an optional JSON body with a "message" field to add a comment before processing. Returns 202 Accepted and runs delegation in a background goroutine.

func (*Server) PromoteDeferredWakeupAPI added in v0.2.0

func (s *Server) PromoteDeferredWakeupAPI(w http.ResponseWriter, r *http.Request)

PromoteDeferredWakeupAPI handles POST /api/v1/agents/{id}/wakeup-requests/promote.

func (*Server) ProxyRequest added in v0.2.0

func (s *Server) ProxyRequest(w http.ResponseWriter, r *http.Request)

ProxyRequest handles generic requests to provider endpoints. Path: /gateway/proxy/{provider}/*

func (*Server) RAGToolCallAPI added in v0.2.0

func (s *Server) RAGToolCallAPI(w http.ResponseWriter, r *http.Request)

RAGToolCallAPI handles POST /api/v1/mcp/call-rag-tool. Dispatches to the appropriate RAG tool executor by name.

func (*Server) RAGToolListAPI added in v0.2.0

func (s *Server) RAGToolListAPI(w http.ResponseWriter, r *http.Request)

RAGToolListAPI handles GET /api/v1/mcp/rag-tools. Returns the list of available RAG tool definitions.

func (*Server) RecordCostEventAPI added in v0.2.0

func (s *Server) RecordCostEventAPI(w http.ResponseWriter, r *http.Request)

RecordCostEventAPI handles POST /api/v1/cost-events.

func (*Server) RecordHeartbeatAPI added in v0.2.0

func (s *Server) RecordHeartbeatAPI(w http.ResponseWriter, r *http.Request)

RecordHeartbeatAPI handles POST /api/v1/agents/{id}/heartbeat.

func (*Server) ReleaseTaskAPI added in v0.2.0

func (s *Server) ReleaseTaskAPI(w http.ResponseWriter, r *http.Request)

ReleaseTaskAPI handles POST /api/v1/tasks/{id}/release.

func (*Server) RemoveAgentFromOrganizationAPI added in v0.2.0

func (s *Server) RemoveAgentFromOrganizationAPI(w http.ResponseWriter, r *http.Request)

RemoveAgentFromOrganizationAPI handles DELETE /api/v1/organizations/{id}/agents/{agent_id}.

func (*Server) RemoveFromPackAPI added in v0.2.1

func (s *Server) RemoveFromPackAPI(w http.ResponseWriter, r *http.Request)

RemoveFromPackAPI handles DELETE /api/v1/integration-packs/{slug}/{type}/{name}.

func (*Server) RemoveLabelFromTaskAPI added in v0.2.0

func (s *Server) RemoveLabelFromTaskAPI(w http.ResponseWriter, r *http.Request)

RemoveLabelFromTaskAPI handles DELETE /api/v1/tasks/{id}/labels/{label_id}.

func (*Server) ResetTokenUsageAPI added in v0.2.0

func (s *Server) ResetTokenUsageAPI(w http.ResponseWriter, r *http.Request)

ResetTokenUsageAPI handles POST /api/v1/api-tokens/:id/usage/reset.

func (*Server) RotateKeyAPI added in v0.1.3

func (s *Server) RotateKeyAPI(w http.ResponseWriter, r *http.Request)

RotateKeyAPI handles POST /api/v1/settings/rotate-key. It re-encrypts all provider credentials with a new key. When clustering is enabled, it acquires a distributed lock and broadcasts the new key to all peers after the DB transaction commits.

func (*Server) RunAgenticLoop added in v0.2.0

func (s *Server) RunAgenticLoop(ctx context.Context, sessionID, content string, onEvent func(AgenticEvent)) error

RunAgenticLoop runs the agentic loop for a chat session, calling onEvent for each event. This is the core loop shared by the HTTP SSE handler and bot adapters.

func (*Server) RunWorkflowAPI added in v0.2.0

func (s *Server) RunWorkflowAPI(w http.ResponseWriter, r *http.Request)

RunWorkflowAPI handles POST /api/v1/workflows/run/:id. By default the workflow is executed asynchronously and the response returns a run_id that can be used to cancel the run. Pass ?sync=true to run synchronously: the request blocks until the workflow completes and the response includes the collected outputs.

func (*Server) RunWorkflowStreamAPI added in v0.2.0

func (s *Server) RunWorkflowStreamAPI(w http.ResponseWriter, r *http.Request)

RunWorkflowStreamAPI handles POST /api/v1/workflows/run-stream/{id}. It executes a workflow and streams per-node events via SSE.

SSE event format:

data: {"node_id":"n1","node_type":"llm_call","event_type":"started"}
data: {"node_id":"n1","node_type":"llm_call","event_type":"completed","data":{...},"duration_ms":1234}
data: {"event_type":"done","data":{...}}
data: {"event_type":"error","error":"..."}

func (*Server) SearchOrgMemoriesAPI added in v0.2.0

func (s *Server) SearchOrgMemoriesAPI(w http.ResponseWriter, r *http.Request)

SearchOrgMemoriesAPI handles POST /api/v1/organizations/{id}/memories/search.

func (*Server) SearchRAGAPI added in v0.2.0

func (s *Server) SearchRAGAPI(w http.ResponseWriter, r *http.Request)

SearchRAGAPI handles POST /api/v1/rag/search.

func (*Server) SendChatMessageAPI added in v0.2.0

func (s *Server) SendChatMessageAPI(w http.ResponseWriter, r *http.Request)

SendChatMessageAPI handles POST /api/v1/chat/sessions/{id}/messages. It runs an agentic loop server-side and streams the response via SSE.

func (*Server) SetActiveVersionAPI added in v0.2.0

func (s *Server) SetActiveVersionAPI(w http.ResponseWriter, r *http.Request)

SetActiveVersionAPI handles PUT /api/v1/workflows/:id/active-version.

func (*Server) SetAgentBudgetAPI added in v0.2.0

func (s *Server) SetAgentBudgetAPI(w http.ResponseWriter, r *http.Request)

SetAgentBudgetAPI handles PUT /api/v1/agents/{id}/budget.

func (*Server) SetModelPricingAPI added in v0.2.0

func (s *Server) SetModelPricingAPI(w http.ResponseWriter, r *http.Request)

SetModelPricingAPI handles POST /api/v1/model-pricing.

func (*Server) SetUserPreferenceAPI added in v0.2.0

func (s *Server) SetUserPreferenceAPI(w http.ResponseWriter, r *http.Request)

SetUserPreferenceAPI handles PUT /api/v1/user-preferences

func (*Server) SkillCallToolAPI added in v0.2.0

func (s *Server) SkillCallToolAPI(w http.ResponseWriter, r *http.Request)

SkillCallToolAPI handles POST /api/v1/mcp/call-skill-tool. It looks up a skill by name, finds the requested tool within it, and executes its handler with the provided arguments.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

func (*Server) StartBotAPI added in v0.2.1

func (s *Server) StartBotAPI(w http.ResponseWriter, r *http.Request)

StartBotAPI handles POST /api/v1/bots/{id}/start.

func (*Server) StopBotAPI added in v0.2.1

func (s *Server) StopBotAPI(w http.ResponseWriter, r *http.Request)

StopBotAPI handles POST /api/v1/bots/{id}/stop.

func (*Server) SyncPackSourceAPI added in v0.2.1

func (s *Server) SyncPackSourceAPI(w http.ResponseWriter, r *http.Request)

SyncPackSourceAPI handles POST /api/v1/pack-sources/{id}/sync.

func (*Server) SyncRAGCollectionAPI added in v0.2.0

func (s *Server) SyncRAGCollectionAPI(w http.ResponseWriter, r *http.Request)

SyncRAGCollectionAPI handles POST /api/v1/rag/collections/{id}/sync. Triggers a git-based sync for a RAG collection that has a git source configured. The sync runs asynchronously and returns immediately with status "syncing". Pass ?sync=true to block until the sync completes.

func (*Server) TestEmbeddingAPI added in v0.2.0

func (s *Server) TestEmbeddingAPI(w http.ResponseWriter, r *http.Request)

TestEmbeddingAPI handles POST /api/v1/rag/test-embedding. It creates a temporary embedder from the provided config and sends a single test embedding request to validate the configuration works.

func (*Server) TestHandlerAPI added in v0.2.0

func (s *Server) TestHandlerAPI(w http.ResponseWriter, r *http.Request)

TestHandlerAPI handles POST /api/v1/skills/test-handler. It executes a tool handler (JS or bash) server-side with sample arguments and returns the result. Used by the Skill Builder AI panel to test handlers.

func (*Server) TranscribeAudioAPI added in v0.2.0

func (s *Server) TranscribeAudioAPI(w http.ResponseWriter, r *http.Request)

TranscribeAudioAPI handles POST /api/v1/audio/transcribe Accepts multipart audio file upload, transcribes using configured method.

func (*Server) UpdateAPITokenAPI

func (s *Server) UpdateAPITokenAPI(w http.ResponseWriter, r *http.Request)

UpdateAPITokenAPI handles PUT /api/v1/api-tokens/:id.

func (*Server) UpdateAgentAPI added in v0.2.0

func (s *Server) UpdateAgentAPI(w http.ResponseWriter, r *http.Request)

UpdateAgentAPI handles PUT /api/v1/agents/:id.

func (*Server) UpdateApprovalAPI added in v0.2.0

func (s *Server) UpdateApprovalAPI(w http.ResponseWriter, r *http.Request)

UpdateApprovalAPI handles PUT /api/v1/approvals/{id}.

func (*Server) UpdateBotConfigAPI added in v0.2.0

func (s *Server) UpdateBotConfigAPI(w http.ResponseWriter, r *http.Request)

UpdateBotConfigAPI handles PUT /api/v1/bots/{id}.

func (*Server) UpdateChatSessionAPI added in v0.2.0

func (s *Server) UpdateChatSessionAPI(w http.ResponseWriter, r *http.Request)

UpdateChatSessionAPI handles PUT /api/v1/chat/sessions/{id}.

func (*Server) UpdateCommentAPI added in v0.2.0

func (s *Server) UpdateCommentAPI(w http.ResponseWriter, r *http.Request)

UpdateCommentAPI handles PUT /api/v1/comments/{id}.

func (*Server) UpdateConnectionAPI added in v0.2.1

func (s *Server) UpdateConnectionAPI(w http.ResponseWriter, r *http.Request)

UpdateConnectionAPI handles PUT /api/v1/connections/{id}. Only fields explicitly set in the request are written; secret fields with empty values are preserved (so callers can rename/re-label without having to re-supply the refresh token).

func (*Server) UpdateGoalAPI added in v0.2.0

func (s *Server) UpdateGoalAPI(w http.ResponseWriter, r *http.Request)

UpdateGoalAPI handles PUT /api/v1/goals/{id}.

func (*Server) UpdateGuideAPI added in v0.2.1

func (s *Server) UpdateGuideAPI(w http.ResponseWriter, r *http.Request)

UpdateGuideAPI handles PUT /api/v1/guides/{id}.

func (*Server) UpdateHeartbeatRunAPI added in v0.2.0

func (s *Server) UpdateHeartbeatRunAPI(w http.ResponseWriter, r *http.Request)

UpdateHeartbeatRunAPI handles PUT /api/v1/heartbeat-runs/{id}.

func (*Server) UpdateLabelAPI added in v0.2.0

func (s *Server) UpdateLabelAPI(w http.ResponseWriter, r *http.Request)

UpdateLabelAPI handles PUT /api/v1/labels/{id}.

func (*Server) UpdateMCPServerAPI added in v0.2.0

func (s *Server) UpdateMCPServerAPI(w http.ResponseWriter, r *http.Request)

UpdateMCPServerAPI handles PUT /api/v1/mcp/servers/{id}.

func (*Server) UpdateMCPSetAPI added in v0.2.0

func (s *Server) UpdateMCPSetAPI(w http.ResponseWriter, r *http.Request)

UpdateMCPSetAPI handles PUT /api/v1/mcp/sets/{id}.

func (*Server) UpdateMarketplaceSourceAPI added in v0.2.0

func (s *Server) UpdateMarketplaceSourceAPI(w http.ResponseWriter, r *http.Request)

func (*Server) UpdateNodeConfigAPI added in v0.2.0

func (s *Server) UpdateNodeConfigAPI(w http.ResponseWriter, r *http.Request)

UpdateNodeConfigAPI handles PUT /api/v1/node-configs/:id.

func (*Server) UpdateOrganizationAPI added in v0.2.0

func (s *Server) UpdateOrganizationAPI(w http.ResponseWriter, r *http.Request)

UpdateOrganizationAPI handles PUT /api/v1/organizations/{id}.

func (*Server) UpdateOrganizationAgentAPI added in v0.2.0

func (s *Server) UpdateOrganizationAgentAPI(w http.ResponseWriter, r *http.Request)

UpdateOrganizationAgentAPI handles PUT /api/v1/organizations/{id}/agents/{agent_id}.

func (*Server) UpdateProjectAPI added in v0.2.0

func (s *Server) UpdateProjectAPI(w http.ResponseWriter, r *http.Request)

UpdateProjectAPI handles PUT /api/v1/projects/{id}.

func (*Server) UpdateProviderAPI

func (s *Server) UpdateProviderAPI(w http.ResponseWriter, r *http.Request)

UpdateProviderAPI handles PUT /api/v1/providers/:key.

func (*Server) UpdateRAGCollectionAPI added in v0.2.0

func (s *Server) UpdateRAGCollectionAPI(w http.ResponseWriter, r *http.Request)

UpdateRAGCollectionAPI handles PUT /api/v1/rag/collections/{id}.

func (*Server) UpdateSkillAPI added in v0.2.0

func (s *Server) UpdateSkillAPI(w http.ResponseWriter, r *http.Request)

UpdateSkillAPI handles PUT /api/v1/skills/:id.

func (*Server) UpdateTaskAPI added in v0.2.0

func (s *Server) UpdateTaskAPI(w http.ResponseWriter, r *http.Request)

UpdateTaskAPI handles PUT /api/v1/tasks/{id}. It performs a true partial update: only fields present in the JSON body are changed; omitted fields keep their existing values.

func (*Server) UpdateTriggerAPI added in v0.2.0

func (s *Server) UpdateTriggerAPI(w http.ResponseWriter, r *http.Request)

UpdateTriggerAPI handles PUT /api/v1/triggers/:id.

func (*Server) UpdateVariableAPI added in v0.2.0

func (s *Server) UpdateVariableAPI(w http.ResponseWriter, r *http.Request)

UpdateVariableAPI handles PUT /api/v1/variables/:id.

func (*Server) UpdateWorkflowAPI added in v0.2.0

func (s *Server) UpdateWorkflowAPI(w http.ResponseWriter, r *http.Request)

UpdateWorkflowAPI handles PUT /api/v1/workflows/:id.

func (*Server) UploadRAGDocumentAPI added in v0.2.0

func (s *Server) UploadRAGDocumentAPI(w http.ResponseWriter, r *http.Request)

UploadRAGDocumentAPI handles POST /api/v1/rag/collections/{id}/documents. Accepts multipart/form-data with a "file" field, or raw body with Content-Type and X-Source-Filename headers.

func (*Server) UpsertAgentRuntimeStateAPI added in v0.2.0

func (s *Server) UpsertAgentRuntimeStateAPI(w http.ResponseWriter, r *http.Request)

UpsertAgentRuntimeStateAPI handles PUT /api/v1/agents/{id}/runtime-state.

func (*Server) UpsertAgentTaskSessionAPI added in v0.2.0

func (s *Server) UpsertAgentTaskSessionAPI(w http.ResponseWriter, r *http.Request)

UpsertAgentTaskSessionAPI handles PUT /api/v1/agents/{id}/task-sessions/{task_key}.

func (*Server) WebhookAPI added in v0.2.0

func (s *Server) WebhookAPI(w http.ResponseWriter, r *http.Request)

WebhookAPI handles POST /webhooks/:trigger_id_or_alias. It looks up the HTTP trigger by ID or alias, verifies it is enabled, enforces authentication for non-public triggers, loads the associated workflow, and starts execution. By default runs asynchronously (202). Pass ?sync=true to block until the workflow completes and return outputs.

type SkillTemplate added in v0.2.0

type SkillTemplate struct {
	Slug              string             `json:"slug"`
	Name              string             `json:"name"`
	Description       string             `json:"description"`
	Category          string             `json:"category"`
	Tags              []string           `json:"tags"`
	RequiredVariables []RequiredVariable `json:"required_variables"`
	OAuth             string             `json:"oauth,omitempty"` // OAuth provider name (e.g. "google") — signals frontend to show connect flow
	Skill             SkillTemplateData  `json:"skill"`
}

SkillTemplate is a predefined skill that ships with AT.

type SkillTemplateData added in v0.2.0

type SkillTemplateData struct {
	Name         string         `json:"name"`
	Description  string         `json:"description"`
	SystemPrompt string         `json:"system_prompt"`
	Tools        []service.Tool `json:"tools"`
}

SkillTemplateData holds the skill payload to be installed.

type StreamOptions added in v0.2.0

type StreamOptions struct {
	IncludeUsage bool `json:"include_usage"`
}

StreamOptions controls optional streaming behaviour.

type TaskDoneCallback added in v0.2.0

type TaskDoneCallback func(identifier, status, result string)

TaskDoneCallback is called when a bot-created task finishes (success or failure).

type TaskWithSubtasks added in v0.2.0

type TaskWithSubtasks struct {
	service.Task
	SubTasks []TaskWithSubtasks `json:"sub_tasks,omitempty"`
}

TaskWithSubtasks wraps a Task with its child sub-tasks for tree retrieval.

type ThinkingReq added in v0.2.0

type ThinkingReq struct {
	Type         string `json:"type"`
	BudgetTokens int    `json:"budget_tokens,omitempty"`
}

ThinkingReq is the client-facing thinking configuration.

Jump to

Keyboard shortcuts

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