Documentation
¶
Index ¶
- Constants
- type AddConnectionRequest
- type AddMCPServerRequest
- type AgentConfig
- type ClientEmitter
- func (e *ClientEmitter) Close()
- func (e *ClientEmitter) DetachProcess(processID string)
- func (e *ClientEmitter) EmitInputResponse(requestID, response string)
- func (e *ClientEmitter) EmitInputResponseFailed(requestID string, err error)
- func (e *ClientEmitter) EmitOpsProgress(requestID string, progressType events.OpsProgressType, data events.OpsProgress)
- func (e *ClientEmitter) EmitOpsResponse(requestID string, result events.OpsResult)
- func (e *ClientEmitter) EmitOpsResponseFailed(requestID string, err error)
- type ConfigResponse
- type ConnectionOperationResponse
- type ConnectionsResponse
- type CreateSessionRequest
- type CreateSessionResponse
- type CreateTodoRequest
- type CreateTodoResponse
- type DeleteTodoResponse
- type DetachProcessResponse
- type EventWaiter
- type InputResponseRequest
- type InputResponseResponse
- type KillProcessResponse
- type ListProcessesResponse
- type MCPOperationResponse
- type MCPServerInfo
- type MCPServersResponse
- type NewSessionQueryRequest
- type OAuthInitiateResponse
- type OpsProgressBatchRequest
- type OpsProgressBatchResponse
- type OpsProgressRequest
- type OpsResponseRequest
- type OpsResponseResponse
- type ProcessResponse
- type QueryType
- type SSEScanner
- type SessionApplyChangesResponse
- type SessionClearResponse
- type SessionDeleteResponse
- type SessionInfoResponse
- type SessionListResponse
- type SessionModelsResponse
- type SessionPersonasResponse
- type SessionProposedChangesResponse
- type SessionQuery
- type SessionQueryCancelResponse
- type SessionQueryResponse
- type SessionQueryState
- type SessionQueryTypeRequest
- type SessionQueryTypeResponse
- type SetSessionRootDirRequest
- type SetSessionRootDirResponse
- type ShellCmd
- type StreamAction
- type StreamResult
- type TimClient
- func (c *TimClient) AddConnection(name, command string, args []string, description string) (*MCPOperationResponse, error)
- func (c *TimClient) AddConnectionWithConfig(serverConfig config.ConnectionConfig) (*MCPOperationResponse, error)
- func (c *TimClient) AddRemoteConnection(name, url string, description string) (*MCPOperationResponse, error)
- func (c *TimClient) AddRemoteConnectionWithConfig(serverConfig config.ConnectionConfig) (*MCPOperationResponse, error)
- func (c *TimClient) AddTodo(title, description, priority string) (*CreateTodoResponse, error)
- func (c *TimClient) ApplyProposedChanges() error
- func (c *TimClient) CallFuncAndWaitForEvent(fn func() error, eventType events.EventType, filter events.EventFilter, ...) (*events.Event, error)
- func (c *TimClient) CancelQuery(queryID string) error
- func (c *TimClient) ClearSession() error
- func (c *TimClient) CreateSession(name, rootDir string) error
- func (c *TimClient) DeleteSession(sessionID string) (*SessionDeleteResponse, error)
- func (c *TimClient) DetachProcess(processID string) (*DetachProcessResponse, error)
- func (c *TimClient) DetermineQueryType(query string) (*SessionQueryTypeResponse, error)
- func (c *TimClient) DisableConnection(name string) (*MCPOperationResponse, error)
- func (c *TimClient) EnableConnection(name string) (*MCPOperationResponse, error)
- func (c *TimClient) GetConfig() (*ConfigResponse, error)
- func (c *TimClient) GetConnections() (*MCPServersResponse, error)
- func (c *TimClient) GetModels() ([]llm.ModelID, error)
- func (c *TimClient) GetPersonas() ([]config.PersonaConfig, error)
- func (c *TimClient) GetProcess(processID string) (*ProcessResponse, error)
- func (c *TimClient) GetProcesses() (*ListProcessesResponse, error)
- func (c *TimClient) GetProposedChanges() (map[string]string, error)
- func (c *TimClient) GetSessionInfo(sessionID string) (*SessionInfoResponse, error)
- func (c *TimClient) InitiateOAuth(integration string) (*OAuthInitiateResponse, error)
- func (c *TimClient) IsValidModel(model llm.ModelID) bool
- func (c *TimClient) IsValidPersona(persona string) bool
- func (c *TimClient) KillProcess(processID string) (*KillProcessResponse, error)
- func (c *TimClient) ListSessions() (*SessionListResponse, error)
- func (c *TimClient) ListTodos() (*TodoListResponse, error)
- func (c *TimClient) RemoveConnection(name string) (*MCPOperationResponse, error)
- func (c *TimClient) RemoveTodo(id string) (*DeleteTodoResponse, error)
- func (c *TimClient) SendInput(requestID, response string) error
- func (c *TimClient) SendOpsProgress(batch []OpsProgressRequest) error
- func (c *TimClient) SendOpsResponse(requestID string, result events.OpsResult) error
- func (c *TimClient) SendOpsResponseError(requestID string, error string) error
- func (c *TimClient) SessionID() string
- func (c *TimClient) SetClientType(clientType string)
- func (c *TimClient) SetRootDir(rootDir string) error
- func (c *TimClient) SetSessionID(sessionID string)
- func (c *TimClient) StoreOAuthTokens(integration, accessToken, refreshToken string, expiresAt int64, ...) error
- func (c *TimClient) StreamEvents(ctx context.Context, eventChan chan<- *events.Event) error
- func (c *TimClient) SubmitQuery(query string, agentConfig AgentConfig) (*SessionQuery, error)
- func (c *TimClient) UpdateConfig(req UpdateConfigRequest) (*UpdateConfigResponse, error)
- func (c *TimClient) UpdateTodo(id string, req UpdateTodoRequest) (*UpdateTodoResponse, error)
- func (c *TimClient) UpdateTodoDescription(id, description string) (*UpdateTodoResponse, error)
- func (c *TimClient) UpdateTodoPriority(id, priority string) (*UpdateTodoResponse, error)
- func (c *TimClient) UpdateTodoStatus(id, status string) (*UpdateTodoResponse, error)
- func (c *TimClient) UpdateTodoTitle(id, title string) (*UpdateTodoResponse, error)
- type TodoItem
- type TodoListResponse
- type UpdateConfigRequest
- type UpdateConfigResponse
- type UpdateTodoRequest
- type UpdateTodoResponse
Constants ¶
const ( // Set to 5 minutes to allow for long running queries or slow MCP connections DefaultTimeout = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddConnectionRequest ¶
type AddConnectionRequest struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Command string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
Remote bool `json:"remote,omitempty"`
URL string `json:"url,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
OAuth *config.OAuthConfig `json:"oauth,omitempty"`
}
type AddMCPServerRequest ¶
type AddMCPServerRequest = AddConnectionRequest
AddMCPServerRequest is an alias for backwards compatibility
type AgentConfig ¶
type AgentConfig struct {
ModelID *llm.ModelID `json:"model,omitempty"`
AgentMode *llm.AgentMode `json:"mode,omitempty"`
PersonaType *string `json:"type,omitempty"`
Thinking *bool `json:"thinking,omitempty"`
InterleavedThinking *bool `json:"interleaved_thinking,omitempty"`
SystemPrompt *string `json:"system_prompt,omitempty"`
Tools []llm.ToolID `json:"tools,omitempty"`
ToolChoice llm.ToolChoiceType `json:"tool_choice,omitempty"`
ParallelToolUse *bool `json:"parallel_tool_use,omitempty"`
Yolo bool `json:"yolo,omitempty"`
NoClarify bool `json:"no_clarify,omitempty"`
NoTimeout bool `json:"no_timeout,omitempty"`
Debug bool `json:"debug,omitempty"`
}
type ClientEmitter ¶
type ClientEmitter struct {
Client *TimClient
// contains filtered or unexported fields
}
ClientEmitter adapts the client for terminal emitter interface
func NewClientEmitter ¶
func NewClientEmitter(client *TimClient) *ClientEmitter
func (*ClientEmitter) Close ¶
func (e *ClientEmitter) Close()
func (*ClientEmitter) DetachProcess ¶
func (e *ClientEmitter) DetachProcess(processID string)
func (*ClientEmitter) EmitInputResponse ¶
func (e *ClientEmitter) EmitInputResponse(requestID, response string)
func (*ClientEmitter) EmitInputResponseFailed ¶
func (e *ClientEmitter) EmitInputResponseFailed(requestID string, err error)
func (*ClientEmitter) EmitOpsProgress ¶
func (e *ClientEmitter) EmitOpsProgress(requestID string, progressType events.OpsProgressType, data events.OpsProgress)
func (*ClientEmitter) EmitOpsResponse ¶
func (e *ClientEmitter) EmitOpsResponse(requestID string, result events.OpsResult)
func (*ClientEmitter) EmitOpsResponseFailed ¶
func (e *ClientEmitter) EmitOpsResponseFailed(requestID string, err error)
type ConfigResponse ¶
type ConfigResponse struct {
HasAnthropicAPIKey bool `json:"has_anthropic_api_key"`
HasOpenAIAPIKey bool `json:"has_openai_api_key"`
HasGeminiAPIKey bool `json:"has_gemini_api_key"`
HasXaiAPIKey bool `json:"has_xai_api_key"`
AnthropicAPIBaseURL string `json:"anthropic_api_base_url,omitempty"`
OpenAIAPIBaseURL string `json:"openai_api_base_url,omitempty"`
XaiAPIBaseURL string `json:"xai_api_base_url,omitempty"`
DefaultModelID string `json:"default_model,omitempty"`
DefaultMode llm.AgentMode `json:"default_mode,omitempty"`
DefaultShell string `json:"default_shell,omitempty"`
ConflictingApps []string `json:"conflicting_apps,omitempty"`
AmbiguousCommands []string `json:"ambiguous_commands,omitempty"`
}
type ConnectionsResponse ¶
type ConnectionsResponse struct {
Servers []MCPServerInfo `json:"servers"`
Count int `json:"count"`
}
type CreateSessionRequest ¶
type CreateSessionResponse ¶
type CreateSessionResponse struct {
SessionID string `json:"session_id"`
}
type CreateTodoRequest ¶
type CreateTodoRequest struct {
Title string `json:"title"`
Description string `json:"description,omitempty"`
Priority string `json:"priority,omitempty"`
}
RESTful Todo types
type CreateTodoResponse ¶
type DeleteTodoResponse ¶
type DetachProcessResponse ¶
type DetachProcessResponse struct {
Success bool `json:"success"`
}
type EventWaiter ¶
type InputResponseRequest ¶
type InputResponseResponse ¶
type InputResponseResponse struct {
Success bool `json:"success"`
}
type KillProcessResponse ¶
type KillProcessResponse struct {
Success bool `json:"success"`
}
type ListProcessesResponse ¶
type ListProcessesResponse struct {
Processes []ProcessResponse `json:"processes"`
Count int `json:"count"`
}
type MCPOperationResponse ¶
type MCPOperationResponse = ConnectionOperationResponse
MCPOperationResponse is an alias for backwards compatibility
type MCPServerInfo ¶
type MCPServerInfo struct {
Index int `json:"index"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Command string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
Env []string `json:"env,omitempty"`
Remote bool `json:"remote"`
URL string `json:"url,omitempty"`
Enabled bool `json:"enabled"`
Connected bool `json:"connected"`
EnabledStatus string `json:"enabledStatus"`
ConnectionStatus string `json:"connectionStatus"`
}
type MCPServersResponse ¶
type MCPServersResponse = ConnectionsResponse
MCPServersResponse is an alias for backwards compatibility
type NewSessionQueryRequest ¶
type NewSessionQueryRequest struct {
Query string `json:"query"`
AgentConfig AgentConfig `json:"agent,omitempty"`
}
type OAuthInitiateResponse ¶
type OAuthInitiateResponse struct {
AuthURL string `json:"auth_url"`
State string `json:"state"`
Message string `json:"message"`
}
OAuthInitiateResponse represents the response from initiating OAuth
type OpsProgressBatchRequest ¶
type OpsProgressBatchRequest struct {
Progress []OpsProgressRequest `json:"progress"`
}
type OpsProgressBatchResponse ¶
type OpsProgressBatchResponse struct {
Success bool `json:"success"`
}
type OpsProgressRequest ¶
type OpsProgressRequest struct {
RequestID string `json:"request_id"`
Type events.OpsProgressType `json:"type"`
Data events.OpsProgress `json:"data"`
}
type OpsResponseRequest ¶
type OpsResponseResponse ¶
type OpsResponseResponse struct {
Success bool `json:"success"`
}
type ProcessResponse ¶
type ProcessResponse struct {
ProcessID string `json:"process_id"`
Index int `json:"index"`
Command string `json:"command"`
Status string `json:"status"`
StartTime timeutil.ISOTime `json:"start_time"`
Duration int64 `json:"duration,omitempty"`
ExitCode *int `json:"exit_code,omitempty"`
WorkDir string `json:"work_dir"`
Stdout []string `json:"stdout,omitempty"`
Stderr []string `json:"stderr,omitempty"`
}
type SSEScanner ¶
type SSEScanner struct {
// contains filtered or unexported fields
}
func NewSSEScanner ¶
func NewSSEScanner(r io.Reader) *SSEScanner
func (*SSEScanner) Err ¶
func (s *SSEScanner) Err() error
func (*SSEScanner) Event ¶
func (s *SSEScanner) Event() *events.Event
func (*SSEScanner) Scan ¶
func (s *SSEScanner) Scan() bool
type SessionApplyChangesResponse ¶
type SessionApplyChangesResponse struct {
Success bool `json:"success"`
}
type SessionClearResponse ¶
type SessionClearResponse struct {
Success bool `json:"success"`
}
type SessionDeleteResponse ¶
type SessionDeleteResponse struct {
Success bool `json:"success"`
}
type SessionInfoResponse ¶
type SessionListResponse ¶
type SessionListResponse struct {
Sessions []SessionInfoResponse `json:"sessions"`
}
type SessionModelsResponse ¶
type SessionPersonasResponse ¶
type SessionPersonasResponse struct {
Personas []config.PersonaConfig `json:"personas"`
}
type SessionQuery ¶
type SessionQuery struct {
ID string `json:"id"`
State SessionQueryState `json:"state"`
Query string `json:"query"`
AgentConfig AgentConfig `json:"agent,omitempty"`
Error string `json:"error,omitempty"`
CreatedAt timeutil.ISOTime `json:"created_at"`
StartedAt timeutil.ISOTime `json:"started_at,omitempty"`
Duration int64 `json:"duration,omitempty"`
Result string `json:"result,omitempty"`
}
type SessionQueryCancelResponse ¶
type SessionQueryCancelResponse struct {
Success bool `json:"success"`
}
type SessionQueryResponse ¶
type SessionQueryResponse struct {
SessionQuery
}
type SessionQueryState ¶
type SessionQueryState string
const ( SessionQueryStateQueued SessionQueryState = "queued" SessionQueryStateProcessing SessionQueryState = "processing" SessionQueryStateCompleted SessionQueryState = "completed" SessionQueryStateFailed SessionQueryState = "failed" SessionQueryStateCancelled SessionQueryState = "cancelled" )
type SessionQueryTypeRequest ¶
type SessionQueryTypeRequest struct {
Query string `json:"query"`
}
type SetSessionRootDirRequest ¶
type SetSessionRootDirRequest struct {
RootDir string `json:"root_dir"`
}
type SetSessionRootDirResponse ¶
type SetSessionRootDirResponse struct {
Success bool `json:"success"`
}
type ShellCmd ¶
type ShellCmd struct {
Command string `json:"command"` // The command name (e.g., "git")
Args []string `json:"args"` // Command arguments (e.g., ["status", "-s"])
EnvVars map[string]string `json:"env_vars"` // Environment variable assignments (e.g., {"FOO": "bar"})
}
ShellCmd represents a parsed shell command with all its components
type StreamResult ¶
type StreamResult struct {
Action StreamAction
NewSessionID string
Error error
}
type TimClient ¶
type TimClient struct {
ServerAddress string
SessionName string
RootDir string
// contains filtered or unexported fields
}
func NewTimClient ¶
func (*TimClient) AddConnection ¶
func (*TimClient) AddConnectionWithConfig ¶
func (c *TimClient) AddConnectionWithConfig(serverConfig config.ConnectionConfig) (*MCPOperationResponse, error)
func (*TimClient) AddRemoteConnection ¶
func (c *TimClient) AddRemoteConnection(name, url string, description string) (*MCPOperationResponse, error)
func (*TimClient) AddRemoteConnectionWithConfig ¶
func (c *TimClient) AddRemoteConnectionWithConfig(serverConfig config.ConnectionConfig) (*MCPOperationResponse, error)
func (*TimClient) AddTodo ¶
func (c *TimClient) AddTodo(title, description, priority string) (*CreateTodoResponse, error)
func (*TimClient) ApplyProposedChanges ¶
func (*TimClient) CallFuncAndWaitForEvent ¶
func (*TimClient) CancelQuery ¶
func (*TimClient) ClearSession ¶
func (*TimClient) CreateSession ¶
func (*TimClient) DeleteSession ¶
func (c *TimClient) DeleteSession(sessionID string) (*SessionDeleteResponse, error)
func (*TimClient) DetachProcess ¶
func (c *TimClient) DetachProcess(processID string) (*DetachProcessResponse, error)
func (*TimClient) DetermineQueryType ¶
func (c *TimClient) DetermineQueryType(query string) (*SessionQueryTypeResponse, error)
func (*TimClient) DisableConnection ¶
func (c *TimClient) DisableConnection(name string) (*MCPOperationResponse, error)
func (*TimClient) EnableConnection ¶
func (c *TimClient) EnableConnection(name string) (*MCPOperationResponse, error)
func (*TimClient) GetConfig ¶
func (c *TimClient) GetConfig() (*ConfigResponse, error)
func (*TimClient) GetConnections ¶
func (c *TimClient) GetConnections() (*MCPServersResponse, error)
func (*TimClient) GetPersonas ¶
func (c *TimClient) GetPersonas() ([]config.PersonaConfig, error)
func (*TimClient) GetProcess ¶
func (c *TimClient) GetProcess(processID string) (*ProcessResponse, error)
func (*TimClient) GetProcesses ¶
func (c *TimClient) GetProcesses() (*ListProcessesResponse, error)
func (*TimClient) GetProposedChanges ¶
func (*TimClient) GetSessionInfo ¶
func (c *TimClient) GetSessionInfo(sessionID string) (*SessionInfoResponse, error)
func (*TimClient) InitiateOAuth ¶
func (c *TimClient) InitiateOAuth(integration string) (*OAuthInitiateResponse, error)
InitiateOAuth initiates OAuth flow for a supported integration
func (*TimClient) IsValidPersona ¶
func (*TimClient) KillProcess ¶
func (c *TimClient) KillProcess(processID string) (*KillProcessResponse, error)
func (*TimClient) ListSessions ¶
func (c *TimClient) ListSessions() (*SessionListResponse, error)
func (*TimClient) ListTodos ¶
func (c *TimClient) ListTodos() (*TodoListResponse, error)
Todo methods
func (*TimClient) RemoveConnection ¶
func (c *TimClient) RemoveConnection(name string) (*MCPOperationResponse, error)
func (*TimClient) RemoveTodo ¶
func (c *TimClient) RemoveTodo(id string) (*DeleteTodoResponse, error)
RemoveTodo deletes a todo using RESTful DELETE endpoint
func (*TimClient) SendOpsProgress ¶
func (c *TimClient) SendOpsProgress(batch []OpsProgressRequest) error
func (*TimClient) SendOpsResponse ¶
func (*TimClient) SendOpsResponseError ¶
func (*TimClient) SetClientType ¶
SetClientType sets the client type for analytics tracking
func (*TimClient) SetRootDir ¶
func (*TimClient) SetSessionID ¶
func (*TimClient) StoreOAuthTokens ¶
func (c *TimClient) StoreOAuthTokens(integration, accessToken, refreshToken string, expiresAt int64, clientID, clientSecret string) error
StoreOAuthTokens stores OAuth tokens for a direct integration
func (*TimClient) StreamEvents ¶
func (*TimClient) SubmitQuery ¶
func (c *TimClient) SubmitQuery(query string, agentConfig AgentConfig) (*SessionQuery, error)
func (*TimClient) UpdateConfig ¶
func (c *TimClient) UpdateConfig(req UpdateConfigRequest) (*UpdateConfigResponse, error)
func (*TimClient) UpdateTodo ¶
func (c *TimClient) UpdateTodo(id string, req UpdateTodoRequest) (*UpdateTodoResponse, error)
UpdateTodo updates a todo using RESTful PUT endpoint
func (*TimClient) UpdateTodoDescription ¶
func (c *TimClient) UpdateTodoDescription(id, description string) (*UpdateTodoResponse, error)
UpdateTodoDescription updates only the description of a todo
func (*TimClient) UpdateTodoPriority ¶
func (c *TimClient) UpdateTodoPriority(id, priority string) (*UpdateTodoResponse, error)
UpdateTodoPriority updates only the priority of a todo
func (*TimClient) UpdateTodoStatus ¶
func (c *TimClient) UpdateTodoStatus(id, status string) (*UpdateTodoResponse, error)
UpdateTodoStatus updates only the status of a todo
func (*TimClient) UpdateTodoTitle ¶
func (c *TimClient) UpdateTodoTitle(id, title string) (*UpdateTodoResponse, error)
UpdateTodoTitle updates only the title of a todo
type TodoItem ¶
type TodoItem struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Status session.TodoStatus `json:"status"`
Priority session.TodoPriority `json:"priority"`
CreatedAt timeutil.ISOTime `json:"created_at"`
UpdatedAt timeutil.ISOTime `json:"updated_at"`
}
Todo types
type TodoListResponse ¶
type UpdateConfigRequest ¶
type UpdateConfigRequest struct {
AnthropicAPIKey *string `json:"anthropic_api_key,omitempty"`
OpenAIAPIKey *string `json:"openai_api_key,omitempty"`
GeminiAPIKey *string `json:"gemini_api_key,omitempty"`
XaiAPIKey *string `json:"xai_api_key,omitempty"`
AnthropicAPIBaseURL *string `json:"anthropic_api_base_url,omitempty"`
OpenAIAPIBaseURL *string `json:"openai_api_base_url,omitempty"`
XaiAPIBaseURL *string `json:"xai_api_base_url,omitempty"`
DefaultModelID *string `json:"default_model,omitempty"`
DefaultMode *llm.AgentMode `json:"default_mode,omitempty"`
DefaultShell *string `json:"default_shell,omitempty"`
ConflictingApps *[]string `json:"conflicting_apps,omitempty"`
AmbiguousCommands *[]string `json:"ambiguous_commands,omitempty"`
}
type UpdateConfigResponse ¶
type UpdateConfigResponse struct {
Success bool `json:"success"`
}