Documentation
¶
Overview ¶
Copyright 2026 Teradata
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Client
- func (c *Client) AddMCPServer(ctx context.Context, req *loomv1.AddMCPServerRequest) (*loomv1.AddMCPServerResponse, error)
- func (c *Client) AnswerClarificationQuestion(ctx context.Context, sessionID, questionID, answer, agentID string) error
- func (c *Client) AnswerClarificationQuestionWithRetry(ctx context.Context, sessionID, questionID, answer, agentID string, ...) error
- func (c *Client) Close() error
- func (c *Client) CreatePattern(ctx context.Context, req *loomv1.CreatePatternRequest) (*loomv1.CreatePatternResponse, error)
- func (c *Client) CreateSession(ctx context.Context, name string, agentID string) (*loomv1.Session, error)
- func (c *Client) DeleteArtifact(ctx context.Context, id string, hardDelete bool) error
- func (c *Client) DeleteMCPServer(ctx context.Context, req *loomv1.DeleteMCPServerRequest) (*loomv1.DeleteMCPServerResponse, error)
- func (c *Client) DeleteSession(ctx context.Context, sessionID string) error
- func (c *Client) DeleteSharedMemory(ctx context.Context, req *loomv1.DeleteSharedMemoryRequest) (*loomv1.DeleteSharedMemoryResponse, error)
- func (c *Client) GetArtifact(ctx context.Context, id, name string) (*loomv1.Artifact, error)
- func (c *Client) GetArtifactContent(ctx context.Context, id, encoding string, maxSizeMB int64) ([]byte, string, error)
- func (c *Client) GetArtifactStats(ctx context.Context) (*loomv1.GetArtifactStatsResponse, error)
- func (c *Client) GetConversationHistory(ctx context.Context, sessionID string) ([]*loomv1.Message, error)
- func (c *Client) GetHealth(ctx context.Context) (*loomv1.HealthStatus, error)
- func (c *Client) GetMCPServer(ctx context.Context, req *loomv1.GetMCPServerRequest) (*loomv1.MCPServerInfo, error)
- func (c *Client) GetSession(ctx context.Context, sessionID string) (*loomv1.Session, error)
- func (c *Client) GetSharedMemory(ctx context.Context, req *loomv1.GetSharedMemoryRequest) (*loomv1.GetSharedMemoryResponse, error)
- func (c *Client) GetSharedMemoryStats(ctx context.Context, req *loomv1.GetSharedMemoryStatsRequest) (*loomv1.SharedMemoryStats, error)
- func (c *Client) HealthCheckMCPServers(ctx context.Context, req *loomv1.HealthCheckMCPServersRequest) (*loomv1.HealthCheckMCPServersResponse, error)
- func (c *Client) ListAgents(ctx context.Context) ([]*loomv1.AgentInfo, error)
- func (c *Client) ListArtifacts(ctx context.Context, source, contentType string, tags []string, ...) ([]*loomv1.Artifact, int32, error)
- func (c *Client) ListAvailableModels(ctx context.Context) ([]*loomv1.ModelInfo, error)
- func (c *Client) ListMCPServerTools(ctx context.Context, serverName string) ([]*loomv1.ToolDefinition, error)
- func (c *Client) ListMCPServers(ctx context.Context, req *loomv1.ListMCPServersRequest) (*loomv1.ListMCPServersResponse, error)
- func (c *Client) ListSessions(ctx context.Context, limit, offset int32) ([]*loomv1.Session, error)
- func (c *Client) ListSharedMemoryKeys(ctx context.Context, req *loomv1.ListSharedMemoryKeysRequest) (*loomv1.ListSharedMemoryKeysResponse, error)
- func (c *Client) ListTools(ctx context.Context) ([]*loomv1.ToolDefinition, error)
- func (c *Client) ListToolsByBackend(ctx context.Context, backend string) ([]*loomv1.ToolDefinition, error)
- func (c *Client) Publish(ctx context.Context, req *loomv1.PublishRequest) (*loomv1.PublishResponse, error)
- func (c *Client) PutSharedMemory(ctx context.Context, req *loomv1.PutSharedMemoryRequest) (*loomv1.PutSharedMemoryResponse, error)
- func (c *Client) RequestToolPermission(ctx context.Context, req *loomv1.ToolPermissionRequest) (*loomv1.ToolPermissionResponse, error)
- func (c *Client) RestartMCPServer(ctx context.Context, req *loomv1.RestartMCPServerRequest) (*loomv1.MCPServerInfo, error)
- func (c *Client) SearchArtifacts(ctx context.Context, query string, limit int32) ([]*loomv1.Artifact, error)
- func (c *Client) SendAndReceive(ctx context.Context, req *loomv1.SendAndReceiveRequest) (*loomv1.SendAndReceiveResponse, error)
- func (c *Client) SendAsync(ctx context.Context, req *loomv1.SendAsyncRequest) (*loomv1.SendAsyncResponse, error)
- func (c *Client) ServerAddr() string
- func (c *Client) StreamPatternUpdates(ctx context.Context, agentID, category string, ...) error
- func (c *Client) StreamWeave(ctx context.Context, query string, sessionID string, agentID string, ...) error
- func (c *Client) Subscribe(ctx context.Context, req *loomv1.SubscribeRequest, ...) error
- func (c *Client) SubscribeToSession(ctx context.Context, sessionID string, agentID string, ...) error
- func (c *Client) SwitchModel(ctx context.Context, sessionID, provider, model string) (*loomv1.SwitchModelResponse, error)
- func (c *Client) TestMCPServerConnection(ctx context.Context, req *loomv1.TestMCPServerConnectionRequest) (*loomv1.TestMCPServerConnectionResponse, error)
- func (c *Client) UpdateMCPServer(ctx context.Context, req *loomv1.UpdateMCPServerRequest) (*loomv1.MCPServerInfo, error)
- func (c *Client) UploadArtifact(ctx context.Context, name string, content []byte, ...) (*loomv1.Artifact, error)
- func (c *Client) UploadArtifactFromFile(ctx context.Context, filePath, purpose string, tags []string) (*loomv1.Artifact, error)
- func (c *Client) WatchSharedMemory(ctx context.Context, req *loomv1.WatchSharedMemoryRequest) (loomv1.LoomService_WatchSharedMemoryClient, error)
- func (c *Client) Weave(ctx context.Context, query string, sessionID string, agentID string) (*loomv1.WeaveResponse, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the gRPC Loom client with TUI-friendly methods.
func (*Client) AddMCPServer ¶
func (c *Client) AddMCPServer(ctx context.Context, req *loomv1.AddMCPServerRequest) (*loomv1.AddMCPServerResponse, error)
AddMCPServer adds a new MCP server configuration.
func (*Client) AnswerClarificationQuestion ¶
func (c *Client) AnswerClarificationQuestion(ctx context.Context, sessionID, questionID, answer, agentID string) error
AnswerClarificationQuestion provides an answer to a clarification question asked by an agent. This is used by the TUI to respond to EventQuestionAsked progress events.
func (*Client) AnswerClarificationQuestionWithRetry ¶
func (c *Client) AnswerClarificationQuestionWithRetry(ctx context.Context, sessionID, questionID, answer, agentID string, maxRetries int) error
AnswerClarificationQuestionWithRetry sends an answer to a clarification question with retry logic. Retries up to maxRetries times with exponential backoff on transient failures. Useful for handling network issues and temporary server unavailability.
func (*Client) CreatePattern ¶
func (c *Client) CreatePattern(ctx context.Context, req *loomv1.CreatePatternRequest) (*loomv1.CreatePatternResponse, error)
CreatePattern creates a new pattern at runtime for an agent.
func (*Client) CreateSession ¶
func (c *Client) CreateSession(ctx context.Context, name string, agentID string) (*loomv1.Session, error)
CreateSession creates a new session.
func (*Client) DeleteArtifact ¶
DeleteArtifact deletes an artifact (soft or hard delete).
func (*Client) DeleteMCPServer ¶
func (c *Client) DeleteMCPServer(ctx context.Context, req *loomv1.DeleteMCPServerRequest) (*loomv1.DeleteMCPServerResponse, error)
DeleteMCPServer removes an MCP server.
func (*Client) DeleteSession ¶
DeleteSession deletes a session.
func (*Client) DeleteSharedMemory ¶
func (c *Client) DeleteSharedMemory(ctx context.Context, req *loomv1.DeleteSharedMemoryRequest) (*loomv1.DeleteSharedMemoryResponse, error)
DeleteSharedMemory removes a value from shared memory.
func (*Client) GetArtifact ¶
GetArtifact retrieves artifact metadata by ID or name.
func (*Client) GetArtifactContent ¶
func (c *Client) GetArtifactContent(ctx context.Context, id, encoding string, maxSizeMB int64) ([]byte, string, error)
GetArtifactContent reads artifact file content. The encoding parameter can be "text" or "base64" (auto-detected if empty). maxSizeMB limits the size of content that can be read (default: 10MB).
func (*Client) GetArtifactStats ¶
GetArtifactStats retrieves storage statistics.
func (*Client) GetConversationHistory ¶
func (c *Client) GetConversationHistory(ctx context.Context, sessionID string) ([]*loomv1.Message, error)
GetConversationHistory retrieves conversation history for a session.
func (*Client) GetMCPServer ¶
func (c *Client) GetMCPServer(ctx context.Context, req *loomv1.GetMCPServerRequest) (*loomv1.MCPServerInfo, error)
GetMCPServer retrieves a specific MCP server.
func (*Client) GetSession ¶
GetSession retrieves a session.
func (*Client) GetSharedMemory ¶
func (c *Client) GetSharedMemory(ctx context.Context, req *loomv1.GetSharedMemoryRequest) (*loomv1.GetSharedMemoryResponse, error)
GetSharedMemory retrieves a value from shared memory.
func (*Client) GetSharedMemoryStats ¶
func (c *Client) GetSharedMemoryStats(ctx context.Context, req *loomv1.GetSharedMemoryStatsRequest) (*loomv1.SharedMemoryStats, error)
GetSharedMemoryStats retrieves statistics for a namespace.
func (*Client) HealthCheckMCPServers ¶
func (c *Client) HealthCheckMCPServers(ctx context.Context, req *loomv1.HealthCheckMCPServersRequest) (*loomv1.HealthCheckMCPServersResponse, error)
HealthCheckMCPServers checks health of all MCP servers.
func (*Client) ListAgents ¶
ListAgents lists all available agents from the server.
func (*Client) ListArtifacts ¶
func (c *Client) ListArtifacts(ctx context.Context, source, contentType string, tags []string, limit, offset int32, includeDeleted bool) ([]*loomv1.Artifact, int32, error)
ListArtifacts lists artifacts with optional filtering.
func (*Client) ListAvailableModels ¶
ListAvailableModels lists all available LLM models/providers.
func (*Client) ListMCPServerTools ¶
func (c *Client) ListMCPServerTools(ctx context.Context, serverName string) ([]*loomv1.ToolDefinition, error)
ListMCPServerTools lists tools from a specific MCP server. This queries the MCP server directly through the manager, not the agent's tool registry.
func (*Client) ListMCPServers ¶
func (c *Client) ListMCPServers(ctx context.Context, req *loomv1.ListMCPServersRequest) (*loomv1.ListMCPServersResponse, error)
ListMCPServers lists all configured MCP servers.
func (*Client) ListSessions ¶
ListSessions lists all sessions.
func (*Client) ListSharedMemoryKeys ¶
func (c *Client) ListSharedMemoryKeys(ctx context.Context, req *loomv1.ListSharedMemoryKeysRequest) (*loomv1.ListSharedMemoryKeysResponse, error)
ListSharedMemoryKeys lists keys matching a pattern in a namespace.
func (*Client) ListToolsByBackend ¶
func (c *Client) ListToolsByBackend(ctx context.Context, backend string) ([]*loomv1.ToolDefinition, error)
ListToolsByBackend lists tools filtered by backend/server name.
func (*Client) Publish ¶
func (c *Client) Publish(ctx context.Context, req *loomv1.PublishRequest) (*loomv1.PublishResponse, error)
Publish publishes a message to a topic on the broadcast bus.
func (*Client) PutSharedMemory ¶
func (c *Client) PutSharedMemory(ctx context.Context, req *loomv1.PutSharedMemoryRequest) (*loomv1.PutSharedMemoryResponse, error)
PutSharedMemory writes or updates a value in shared memory.
func (*Client) RequestToolPermission ¶
func (c *Client) RequestToolPermission(ctx context.Context, req *loomv1.ToolPermissionRequest) (*loomv1.ToolPermissionResponse, error)
RequestToolPermission requests user permission to execute a tool.
func (*Client) RestartMCPServer ¶
func (c *Client) RestartMCPServer(ctx context.Context, req *loomv1.RestartMCPServerRequest) (*loomv1.MCPServerInfo, error)
RestartMCPServer restarts a running MCP server.
func (*Client) SearchArtifacts ¶
func (c *Client) SearchArtifacts(ctx context.Context, query string, limit int32) ([]*loomv1.Artifact, error)
SearchArtifacts performs full-text search on artifacts.
func (*Client) SendAndReceive ¶
func (c *Client) SendAndReceive(ctx context.Context, req *loomv1.SendAndReceiveRequest) (*loomv1.SendAndReceiveResponse, error)
SendAndReceive sends a message and waits for response (RPC-style).
func (*Client) SendAsync ¶
func (c *Client) SendAsync(ctx context.Context, req *loomv1.SendAsyncRequest) (*loomv1.SendAsyncResponse, error)
SendAsync sends a message asynchronously (fire-and-forget).
func (*Client) ServerAddr ¶
ServerAddr returns the server address.
func (*Client) StreamPatternUpdates ¶
func (c *Client) StreamPatternUpdates(ctx context.Context, agentID, category string, eventFn func(*loomv1.PatternUpdateEvent)) error
StreamPatternUpdates streams pattern update events in real-time. The eventFn is called for each pattern update event (create, modify, delete). This call blocks until the context is cancelled or an error occurs.
func (*Client) StreamWeave ¶
func (c *Client) StreamWeave(ctx context.Context, query string, sessionID string, agentID string, progressFn func(*loomv1.WeaveProgress)) error
StreamWeave sends a query and streams the response. The progressFn is called for each progress update.
func (*Client) Subscribe ¶
func (c *Client) Subscribe(ctx context.Context, req *loomv1.SubscribeRequest, msgFn func(*loomv1.BusMessage)) error
Subscribe subscribes to messages on a topic pattern and streams them.
func (*Client) SubscribeToSession ¶
func (c *Client) SubscribeToSession(ctx context.Context, sessionID string, agentID string, updateFn func(*loomv1.SessionUpdate)) error
SubscribeToSession subscribes to real-time updates for a session. Returns a stream that receives updates when new messages arrive. The updateFn is called for each session update.
func (*Client) SwitchModel ¶
func (c *Client) SwitchModel(ctx context.Context, sessionID, provider, model string) (*loomv1.SwitchModelResponse, error)
SwitchModel switches the LLM model/provider for a session.
func (*Client) TestMCPServerConnection ¶
func (c *Client) TestMCPServerConnection(ctx context.Context, req *loomv1.TestMCPServerConnectionRequest) (*loomv1.TestMCPServerConnectionResponse, error)
TestMCPServerConnection tests an MCP server connection without persisting.
func (*Client) UpdateMCPServer ¶
func (c *Client) UpdateMCPServer(ctx context.Context, req *loomv1.UpdateMCPServerRequest) (*loomv1.MCPServerInfo, error)
UpdateMCPServer updates an existing MCP server configuration.
func (*Client) UploadArtifact ¶
func (c *Client) UploadArtifact(ctx context.Context, name string, content []byte, source, sourceAgentID, purpose string, tags []string) (*loomv1.Artifact, error)
UploadArtifact uploads a file to artifacts storage. Returns the created artifact metadata.
func (*Client) UploadArtifactFromFile ¶
func (c *Client) UploadArtifactFromFile(ctx context.Context, filePath, purpose string, tags []string) (*loomv1.Artifact, error)
UploadArtifactFromFile reads a file and uploads it to artifacts storage. This is a convenience method that wraps UploadArtifact.
func (*Client) WatchSharedMemory ¶
func (c *Client) WatchSharedMemory(ctx context.Context, req *loomv1.WatchSharedMemoryRequest) (loomv1.LoomService_WatchSharedMemoryClient, error)
WatchSharedMemory watches for changes to keys and streams updates.
type Config ¶
type Config struct {
ServerAddr string // Default: localhost:9090
Timeout time.Duration // Default: 30s
// TLS configuration
TLSEnabled bool // Enable TLS connection
TLSInsecure bool // Skip TLS certificate verification (for self-signed certs)
TLSCAFile string // Path to CA certificate file
TLSServerName string // Override TLS server name (for testing)
}
Config holds client configuration.