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.
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.
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.
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.
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.
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 ¶
- Constants
- func ContainsUIIntent(msg string) bool
- func ConvertMessage(m *agent.Message) *loomv1.Message
- func ConvertSession(s *agent.Session) *loomv1.Session
- func ConvertTool(t shuttle.Tool) *loomv1.ToolDefinition
- func GenerateSessionID() string
- func UIAppTools(compiler AppCompiler, provider AppProvider) []shuttle.Tool
- func UserIDStreamInterceptor(cfg UserIDConfig) grpc.StreamServerInterceptor
- func UserIDUnaryInterceptor(cfg UserIDConfig) grpc.UnaryServerInterceptor
- func ValidateProviders(ctx context.Context, agents map[string]*agent.Agent) error
- type AdminServer
- func (s *AdminServer) CountSessionsByUser(ctx context.Context, req *loomv1.CountSessionsByUserRequest) (*loomv1.CountSessionsByUserResponse, error)
- func (s *AdminServer) GetSystemStats(ctx context.Context, req *loomv1.GetSystemStatsRequest) (*loomv1.GetSystemStatsResponse, error)
- func (s *AdminServer) ListAllSessions(ctx context.Context, req *loomv1.ListAllSessionsRequest) (*loomv1.ListAllSessionsResponse, error)
- type AppCompiler
- type AppHTMLProvider
- type AppProvider
- type BusMessage
- type CORSConfig
- type HTTPServer
- type JudgeServer
- func (s *JudgeServer) EvaluateWithJudges(ctx context.Context, req *loomv1.EvaluateRequest) (*loomv1.EvaluateResponse, error)
- func (s *JudgeServer) EvaluateWithJudgesStream(req *loomv1.EvaluateRequest, ...) error
- func (s *JudgeServer) GetJudgeConfig(id string) (*loomv1.JudgeConfig, error)
- func (s *JudgeServer) GetJudgeHistory(_ context.Context, _ *loomv1.GetJudgeHistoryRequest) (*loomv1.GetJudgeHistoryResponse, error)
- func (s *JudgeServer) RegisterJudge(ctx context.Context, req *loomv1.RegisterJudgeRequest) (*loomv1.RegisterJudgeResponse, error)
- func (s *JudgeServer) SetProviderPool(pool map[string]agent.LLMProvider, defaultP agent.LLMProvider)
- type LearningService
- func (s *LearningService) AnalyzePatternEffectiveness(ctx context.Context, req *loomv1.AnalyzePatternEffectivenessRequest) (*loomv1.PatternAnalysisResponse, error)
- func (s *LearningService) ApplyImprovement(ctx context.Context, req *loomv1.ApplyImprovementRequest) (*loomv1.ApplyImprovementResponse, error)
- func (s *LearningService) GenerateImprovements(ctx context.Context, req *loomv1.GenerateImprovementsRequest) (*loomv1.ImprovementsResponse, error)
- func (s *LearningService) GetImprovementHistory(ctx context.Context, req *loomv1.GetImprovementHistoryRequest) (*loomv1.ImprovementHistoryResponse, error)
- func (s *LearningService) RollbackImprovement(ctx context.Context, req *loomv1.RollbackImprovementRequest) (*loomv1.RollbackImprovementResponse, error)
- func (s *LearningService) StreamPatternMetrics(req *loomv1.StreamPatternMetricsRequest, ...) error
- type MultiAgentServer
- func (s *MultiAgentServer) ABTest(req *loomv1.ABTestRequest, stream loomv1.LoomService_ABTestServer) error
- func (s *MultiAgentServer) AddAgent(id string, ag *agent.Agent)
- func (s *MultiAgentServer) AddMCPServer(ctx context.Context, req *loomv1.AddMCPServerRequest) (*loomv1.AddMCPServerResponse, error)
- func (s *MultiAgentServer) AnswerClarificationQuestion(ctx context.Context, req *loomv1.AnswerClarificationRequest) (*loomv1.AnswerClarificationResponse, error)
- func (s *MultiAgentServer) ConfigureCommunication(bus *communication.MessageBus, queue *communication.MessageQueue, ...) error
- func (s *MultiAgentServer) ConfigureLegacyCommunication(refStore communication.ReferenceStore, policy *communication.PolicyManager) error
- func (s *MultiAgentServer) ConfigureScheduler(sched *scheduler.Scheduler)
- func (s *MultiAgentServer) ConfigureSharedMemory(config *storage.Config) error
- func (s *MultiAgentServer) ConfigureTLS(manager *tls.Manager, config *loomv1.ServerConfig)
- func (s *MultiAgentServer) CreateAgentFromConfig(ctx context.Context, req *loomv1.CreateAgentRequest) (*loomv1.AgentInfo, error)
- func (s *MultiAgentServer) CreatePattern(ctx context.Context, req *loomv1.CreatePatternRequest) (*loomv1.CreatePatternResponse, error)
- func (s *MultiAgentServer) CreateSession(ctx context.Context, req *loomv1.CreateSessionRequest) (*loomv1.Session, error)
- func (s *MultiAgentServer) CreateUIApp(ctx context.Context, req *loomv1.CreateUIAppRequest) (*loomv1.CreateUIAppResponse, error)
- func (s *MultiAgentServer) DeleteAgent(ctx context.Context, req *loomv1.DeleteAgentRequest) (*loomv1.DeleteAgentResponse, error)
- func (s *MultiAgentServer) DeleteArtifact(ctx context.Context, req *loomv1.DeleteArtifactRequest) (*loomv1.DeleteArtifactResponse, error)
- func (s *MultiAgentServer) DeleteMCPServer(ctx context.Context, req *loomv1.DeleteMCPServerRequest) (*loomv1.DeleteMCPServerResponse, error)
- func (s *MultiAgentServer) DeleteScheduledWorkflow(ctx context.Context, req *loomv1.DeleteScheduledWorkflowRequest) (*emptypb.Empty, error)
- func (s *MultiAgentServer) DeleteSession(ctx context.Context, req *loomv1.DeleteSessionRequest) (*loomv1.DeleteSessionResponse, error)
- func (s *MultiAgentServer) DeleteSharedMemory(ctx context.Context, req *loomv1.DeleteSharedMemoryRequest) (*loomv1.DeleteSharedMemoryResponse, error)
- func (s *MultiAgentServer) DeleteUIApp(ctx context.Context, req *loomv1.DeleteUIAppRequest) (*loomv1.DeleteUIAppResponse, error)
- func (s *MultiAgentServer) DespawnSubAgent(ctx context.Context, req *builtin.DespawnSubAgentRequest) (*builtin.DespawnSubAgentResponse, error)
- func (s *MultiAgentServer) ExecuteWorkflow(ctx context.Context, req *loomv1.ExecuteWorkflowRequest) (*loomv1.ExecuteWorkflowResponse, error)
- func (s *MultiAgentServer) GetAgent(ctx context.Context, req *loomv1.GetAgentRequest) (*loomv1.AgentInfo, error)
- func (s *MultiAgentServer) GetAgentIDs() []string
- func (s *MultiAgentServer) GetArtifact(ctx context.Context, req *loomv1.GetArtifactRequest) (*loomv1.GetArtifactResponse, error)
- func (s *MultiAgentServer) GetArtifactContent(ctx context.Context, req *loomv1.GetArtifactContentRequest) (*loomv1.GetArtifactContentResponse, error)
- func (s *MultiAgentServer) GetArtifactStats(ctx context.Context, req *loomv1.GetArtifactStatsRequest) (*loomv1.GetArtifactStatsResponse, error)
- func (s *MultiAgentServer) GetCommunicationComponents() (*communication.MessageBus, *communication.MessageQueue, ...)
- func (s *MultiAgentServer) GetCommunicationPolicy() *communication.PolicyManager
- func (s *MultiAgentServer) GetConversationHistory(ctx context.Context, req *loomv1.GetConversationHistoryRequest) (*loomv1.ConversationHistory, error)
- func (s *MultiAgentServer) GetHealth(ctx context.Context, req *loomv1.GetHealthRequest) (*loomv1.HealthStatus, error)
- func (s *MultiAgentServer) GetMCPServer(ctx context.Context, req *loomv1.GetMCPServerRequest) (*loomv1.MCPServerInfo, error)
- func (s *MultiAgentServer) GetPattern(ctx context.Context, req *loomv1.GetPatternRequest) (*loomv1.Pattern, error)
- func (s *MultiAgentServer) GetPendingPermissions() map[string]*pendingPermission
- func (s *MultiAgentServer) GetReferenceStore() communication.ReferenceStore
- func (s *MultiAgentServer) GetScheduleHistory(ctx context.Context, req *loomv1.GetScheduleHistoryRequest) (*loomv1.GetScheduleHistoryResponse, error)
- func (s *MultiAgentServer) GetScheduledWorkflow(ctx context.Context, req *loomv1.GetScheduledWorkflowRequest) (*loomv1.ScheduledWorkflow, error)
- func (s *MultiAgentServer) GetServerConfig(ctx context.Context, req *loomv1.GetServerConfigRequest) (*loomv1.ServerConfig, error)
- func (s *MultiAgentServer) GetSession(ctx context.Context, req *loomv1.GetSessionRequest) (*loomv1.Session, error)
- func (s *MultiAgentServer) GetSharedMemory(ctx context.Context, req *loomv1.GetSharedMemoryRequest) (*loomv1.GetSharedMemoryResponse, error)
- func (s *MultiAgentServer) GetSharedMemoryStats(ctx context.Context, req *loomv1.GetSharedMemoryStatsRequest) (*loomv1.SharedMemoryStats, error)
- func (s *MultiAgentServer) GetStorageStatus(ctx context.Context, _ *loomv1.GetStorageStatusRequest) (*loomv1.GetStorageStatusResponse, error)
- func (s *MultiAgentServer) GetTLSStatus(ctx context.Context, req *loomv1.GetTLSStatusRequest) (*loomv1.TLSStatus, error)
- func (s *MultiAgentServer) GetTrace(ctx context.Context, req *loomv1.GetTraceRequest) (*loomv1.Trace, error)
- func (s *MultiAgentServer) GetUIApp(ctx context.Context, req *loomv1.GetUIAppRequest) (*loomv1.GetUIAppResponse, error)
- func (s *MultiAgentServer) GetWorkflowExecution(ctx context.Context, req *loomv1.GetWorkflowExecutionRequest) (*loomv1.WorkflowExecution, error)
- func (s *MultiAgentServer) GrantToolPermission(permID string, granted bool, message string, remember bool) error
- func (s *MultiAgentServer) HealthCheckMCPServers(ctx context.Context, req *loomv1.HealthCheckMCPServersRequest) (*loomv1.HealthCheckMCPServersResponse, error)
- func (s *MultiAgentServer) ListAgents(ctx context.Context, req *loomv1.ListAgentsRequest) (*loomv1.ListAgentsResponse, error)
- func (s *MultiAgentServer) ListArtifacts(ctx context.Context, req *loomv1.ListArtifactsRequest) (*loomv1.ListArtifactsResponse, error)
- func (s *MultiAgentServer) ListAvailableModels(ctx context.Context, req *loomv1.ListAvailableModelsRequest) (*loomv1.ListAvailableModelsResponse, error)
- func (s *MultiAgentServer) ListComponentTypes(ctx context.Context, req *loomv1.ListComponentTypesRequest) (*loomv1.ListComponentTypesResponse, error)
- func (s *MultiAgentServer) ListMCPServerTools(ctx context.Context, req *loomv1.ListMCPServerToolsRequest) (*loomv1.ListMCPServerToolsResponse, error)
- func (s *MultiAgentServer) ListMCPServers(ctx context.Context, req *loomv1.ListMCPServersRequest) (*loomv1.ListMCPServersResponse, error)
- func (s *MultiAgentServer) ListPatterns(ctx context.Context, req *loomv1.ListPatternsRequest) (*loomv1.ListPatternsResponse, error)
- func (s *MultiAgentServer) ListProviders(ctx context.Context, req *loomv1.ListProvidersRequest) (*loomv1.ListProvidersResponse, error)
- func (s *MultiAgentServer) ListScheduledWorkflows(ctx context.Context, req *loomv1.ListScheduledWorkflowsRequest) (*loomv1.ListScheduledWorkflowsResponse, error)
- func (s *MultiAgentServer) ListSessions(ctx context.Context, req *loomv1.ListSessionsRequest) (*loomv1.ListSessionsResponse, error)
- func (s *MultiAgentServer) ListSharedMemoryKeys(ctx context.Context, req *loomv1.ListSharedMemoryKeysRequest) (*loomv1.ListSharedMemoryKeysResponse, error)
- func (s *MultiAgentServer) ListTools(ctx context.Context, req *loomv1.ListToolsRequest) (*loomv1.ListToolsResponse, error)
- func (s *MultiAgentServer) ListUIApps(ctx context.Context, req *loomv1.ListUIAppsRequest) (*loomv1.ListUIAppsResponse, error)
- func (s *MultiAgentServer) ListWorkflowExecutions(ctx context.Context, req *loomv1.ListWorkflowExecutionsRequest) (*loomv1.ListWorkflowExecutionsResponse, error)
- func (s *MultiAgentServer) LoadPatterns(ctx context.Context, req *loomv1.LoadPatternsRequest) (*loomv1.LoadPatternsResponse, error)
- func (s *MultiAgentServer) PauseSchedule(ctx context.Context, req *loomv1.PauseScheduleRequest) (*emptypb.Empty, error)
- func (s *MultiAgentServer) Publish(ctx context.Context, req *loomv1.PublishRequest) (*loomv1.PublishResponse, error)
- func (s *MultiAgentServer) PutSharedMemory(ctx context.Context, req *loomv1.PutSharedMemoryRequest) (*loomv1.PutSharedMemoryResponse, error)
- func (s *MultiAgentServer) RecordTraceSpan(span *observability.Span)
- func (s *MultiAgentServer) RegisterServerProgressListener(agentName string, logger *zap.Logger)
- func (s *MultiAgentServer) RegisterTool(ctx context.Context, req *loomv1.RegisterToolRequest) (*loomv1.RegisterToolResponse, error)
- func (s *MultiAgentServer) ReloadAgent(ctx context.Context, req *loomv1.ReloadAgentRequest) (*loomv1.AgentInfo, error)
- func (s *MultiAgentServer) RemoveAgent(id string) error
- func (s *MultiAgentServer) RenewCertificate(ctx context.Context, req *loomv1.RenewCertificateRequest) (*loomv1.RenewCertificateResponse, error)
- func (s *MultiAgentServer) RequestToolPermission(ctx context.Context, req *loomv1.ToolPermissionRequest) (*loomv1.ToolPermissionResponse, error)
- func (s *MultiAgentServer) RestartMCPServer(ctx context.Context, req *loomv1.RestartMCPServerRequest) (*loomv1.MCPServerInfo, error)
- func (s *MultiAgentServer) ResumeSchedule(ctx context.Context, req *loomv1.ResumeScheduleRequest) (*emptypb.Empty, error)
- func (s *MultiAgentServer) RunMigration(ctx context.Context, req *loomv1.RunMigrationRequest) (*loomv1.RunMigrationResponse, error)
- func (s *MultiAgentServer) ScheduleWorkflow(ctx context.Context, req *loomv1.ScheduleWorkflowRequest) (*loomv1.ScheduleWorkflowResponse, error)
- func (s *MultiAgentServer) SearchArtifacts(ctx context.Context, req *loomv1.SearchArtifactsRequest) (*loomv1.SearchArtifactsResponse, error)
- func (s *MultiAgentServer) SendAndReceive(ctx context.Context, req *loomv1.SendAndReceiveRequest) (*loomv1.SendAndReceiveResponse, error)
- func (s *MultiAgentServer) SendAsync(ctx context.Context, req *loomv1.SendAsyncRequest) (*loomv1.SendAsyncResponse, error)
- func (s *MultiAgentServer) SetAgentRegistry(registry *agent.Registry)
- func (s *MultiAgentServer) SetAppCompiler(c AppCompiler)
- func (s *MultiAgentServer) SetAppProvider(p AppProvider)
- func (s *MultiAgentServer) SetArtifactStore(store artifacts.ArtifactStore)
- func (s *MultiAgentServer) SetClarificationConfig(channelSendTimeoutMs int)
- func (s *MultiAgentServer) SetEvalStore(store *evals.Store)
- func (s *MultiAgentServer) SetJudgeServer(js *JudgeServer)
- func (s *MultiAgentServer) SetLLMConcurrencyLimit(limit int)
- func (s *MultiAgentServer) SetLogger(logger *zap.Logger)
- func (s *MultiAgentServer) SetMCPManager(mgr *manager.Manager, configPath string, logger *zap.Logger)
- func (s *MultiAgentServer) SetPatternTracker(tracker *learning.PatternEffectivenessTracker)
- func (s *MultiAgentServer) SetProgressMultiplexer(agentID string, pm *metaagent.ProgressMultiplexer)
- func (s *MultiAgentServer) SetProviderFactory(f *factory.ProviderFactory)
- func (s *MultiAgentServer) SetProviderPool(pool map[string]agent.LLMProvider, active string)
- func (s *MultiAgentServer) SetServerConfig(config *loomv1.ServerConfig)
- func (s *MultiAgentServer) SetStorageBackend(sb backend.StorageBackend)
- func (s *MultiAgentServer) SetStorageBackendType(backendType loomv1.StorageBackendType)
- func (s *MultiAgentServer) SetToolRegistry(registry *toolregistry.Registry)
- func (s *MultiAgentServer) SetTraceStore(maxAge time.Duration)
- func (s *MultiAgentServer) SetTracer(tracer observability.Tracer)
- func (s *MultiAgentServer) SharedMemoryStore() *storage.SharedMemoryStore
- func (s *MultiAgentServer) Shutdown(ctx context.Context) error
- func (s *MultiAgentServer) SpawnSubAgent(ctx context.Context, req *builtin.SpawnSubAgentRequest) (*builtin.SpawnSubAgentResponse, error)
- func (s *MultiAgentServer) StartAgent(ctx context.Context, req *loomv1.StartAgentRequest) (*loomv1.AgentInfo, error)
- func (s *MultiAgentServer) StartHotReload(ctx context.Context, logger *zap.Logger) error
- func (s *MultiAgentServer) StartMessageQueueMonitor(ctx context.Context)
- func (s *MultiAgentServer) StopAgent(ctx context.Context, req *loomv1.StopAgentRequest) (*loomv1.AgentInfo, error)
- func (s *MultiAgentServer) StopHotReload() error
- func (s *MultiAgentServer) StreamPatternUpdates(req *loomv1.StreamPatternUpdatesRequest, ...) error
- func (s *MultiAgentServer) StreamWeave(req *loomv1.WeaveRequest, stream loomv1.LoomService_StreamWeaveServer) error
- func (s *MultiAgentServer) StreamWorkflow(req *loomv1.ExecuteWorkflowRequest, ...) error
- func (s *MultiAgentServer) Subscribe(req *loomv1.SubscribeRequest, stream loomv1.LoomService_SubscribeServer) error
- func (s *MultiAgentServer) SubscribeToSession(req *loomv1.SubscribeToSessionRequest, ...) error
- func (s *MultiAgentServer) SwitchModel(ctx context.Context, req *loomv1.SwitchModelRequest) (*loomv1.SwitchModelResponse, error)
- func (s *MultiAgentServer) TestMCPServerConnection(ctx context.Context, req *loomv1.TestMCPServerConnectionRequest) (*loomv1.TestMCPServerConnectionResponse, error)
- func (s *MultiAgentServer) TriggerScheduledWorkflow(ctx context.Context, req *loomv1.TriggerScheduledWorkflowRequest) (*loomv1.ExecuteWorkflowResponse, error)
- func (s *MultiAgentServer) UpdateAgent(id string, ag *agent.Agent) error
- func (s *MultiAgentServer) UpdateMCPServer(ctx context.Context, req *loomv1.UpdateMCPServerRequest) (*loomv1.MCPServerInfo, error)
- func (s *MultiAgentServer) UpdateScheduledWorkflow(ctx context.Context, req *loomv1.UpdateScheduledWorkflowRequest) (*loomv1.ScheduleWorkflowResponse, error)
- func (s *MultiAgentServer) UpdateUIApp(ctx context.Context, req *loomv1.UpdateUIAppRequest) (*loomv1.UpdateUIAppResponse, error)
- func (s *MultiAgentServer) UploadArtifact(ctx context.Context, req *loomv1.UploadArtifactRequest) (*loomv1.UploadArtifactResponse, error)
- func (s *MultiAgentServer) WatchSharedMemory(req *loomv1.WatchSharedMemoryRequest, ...) error
- func (s *MultiAgentServer) Weave(ctx context.Context, req *loomv1.WeaveRequest) (*loomv1.WeaveResponse, error)
- type PatternEventBroadcaster
- func (b *PatternEventBroadcaster) Broadcast(event *loomv1.PatternUpdateEvent)
- func (b *PatternEventBroadcaster) BroadcastPatternCreated(agentID, patternName, category, filePath string)
- func (b *PatternEventBroadcaster) BroadcastPatternDeleted(agentID, patternName, category string)
- func (b *PatternEventBroadcaster) BroadcastPatternModified(agentID, patternName, category, filePath string)
- func (b *PatternEventBroadcaster) BroadcastPatternValidationFailed(agentID, patternName, errorMsg string)
- func (b *PatternEventBroadcaster) Close()
- func (b *PatternEventBroadcaster) Subscribe() chan *loomv1.PatternUpdateEvent
- func (b *PatternEventBroadcaster) Unsubscribe(ch chan *loomv1.PatternUpdateEvent)
- type PubSubEvent
- type Server
- func (s *Server) ABTest(req *loomv1.ABTestRequest, stream loomv1.LoomService_ABTestServer) error
- func (s *Server) CreateSession(ctx context.Context, req *loomv1.CreateSessionRequest) (*loomv1.Session, error)
- func (s *Server) DeleteSession(ctx context.Context, req *loomv1.DeleteSessionRequest) (*loomv1.DeleteSessionResponse, error)
- func (s *Server) GetConversationHistory(ctx context.Context, req *loomv1.GetConversationHistoryRequest) (*loomv1.ConversationHistory, error)
- func (s *Server) GetHealth(ctx context.Context, req *loomv1.GetHealthRequest) (*loomv1.HealthStatus, error)
- func (s *Server) GetPattern(ctx context.Context, req *loomv1.GetPatternRequest) (*loomv1.Pattern, error)
- func (s *Server) GetProviderPool() map[string]agent.LLMProvider
- func (s *Server) GetSession(ctx context.Context, req *loomv1.GetSessionRequest) (*loomv1.Session, error)
- func (s *Server) GetTrace(ctx context.Context, req *loomv1.GetTraceRequest) (*loomv1.Trace, error)
- func (s *Server) ListAvailableModels(ctx context.Context, req *loomv1.ListAvailableModelsRequest) (*loomv1.ListAvailableModelsResponse, error)
- func (s *Server) ListAvailableModelsLegacy(ctx context.Context, req *loomv1.ListAvailableModelsRequest) (*loomv1.ListAvailableModelsResponse, error)
- func (s *Server) ListPatterns(ctx context.Context, req *loomv1.ListPatternsRequest) (*loomv1.ListPatternsResponse, error)
- func (s *Server) ListProviders(_ context.Context, _ *loomv1.ListProvidersRequest) (*loomv1.ListProvidersResponse, error)
- func (s *Server) ListSessions(ctx context.Context, req *loomv1.ListSessionsRequest) (*loomv1.ListSessionsResponse, error)
- func (s *Server) ListTools(ctx context.Context, req *loomv1.ListToolsRequest) (*loomv1.ListToolsResponse, error)
- func (s *Server) LoadPatterns(ctx context.Context, req *loomv1.LoadPatternsRequest) (*loomv1.LoadPatternsResponse, error)
- func (s *Server) RegisterTool(ctx context.Context, req *loomv1.RegisterToolRequest) (*loomv1.RegisterToolResponse, error)
- func (s *Server) RequestToolPermission(ctx context.Context, req *loomv1.ToolPermissionRequest) (*loomv1.ToolPermissionResponse, error)
- func (s *Server) SetActiveProviderName(name string)
- func (s *Server) SetEvalStore(store *evals.Store)
- func (s *Server) SetJudgeServer(js *JudgeServer)
- func (s *Server) SetProviderFactory(f *factory.ProviderFactory)
- func (s *Server) SetProviderPool(pool map[string]agent.LLMProvider, active string)
- func (s *Server) StreamWeave(req *loomv1.WeaveRequest, stream loomv1.LoomService_StreamWeaveServer) error
- func (s *Server) SwitchModel(ctx context.Context, req *loomv1.SwitchModelRequest) (*loomv1.SwitchModelResponse, error)
- func (s *Server) Weave(ctx context.Context, req *loomv1.WeaveRequest) (*loomv1.WeaveResponse, error)
- type UserIDConfig
- type WorkflowExecution
- type WorkflowStatus
- type WorkflowStore
- func (s *WorkflowStore) Count() int
- func (s *WorkflowStore) Delete(executionID string) error
- func (s *WorkflowStore) Get(executionID string) (*WorkflowExecution, error)
- func (s *WorkflowStore) List(status WorkflowStatus) []*WorkflowExecution
- func (s *WorkflowStore) Store(exec *WorkflowExecution)
- func (s *WorkflowStore) StoreResult(executionID string, result *loomv1.WorkflowResult) error
- func (s *WorkflowStore) UpdateStatus(executionID string, status WorkflowStatus, errorMsg string) error
Constants ¶
const (
// DefaultProgressBufferSize is the default buffer size for progress event channels
DefaultProgressBufferSize = 10
)
const (
// UserIDHeader is the gRPC metadata key for the user ID.
UserIDHeader = "x-user-id"
)
Variables ¶
This section is empty.
Functions ¶
func ContainsUIIntent ¶ added in v1.2.0
ContainsUIIntent reports whether msg suggests the user wants a UI visualization. Case-insensitive keyword scan — fast and deterministic, no LLM cost.
func ConvertMessage ¶
ConvertMessage converts an agent.Message to proto format.
func ConvertSession ¶
ConvertSession converts an agent.Session to proto format.
func ConvertTool ¶
func ConvertTool(t shuttle.Tool) *loomv1.ToolDefinition
ConvertTool converts a shuttle.Tool to proto format with rich metadata. Attempts to load metadata from YAML files; falls back to basic info if not found. Logs warnings if metadata loading fails but continues with basic tool definition.
func GenerateSessionID ¶
func GenerateSessionID() string
GenerateSessionID generates a new session ID.
func UIAppTools ¶ added in v1.2.0
func UIAppTools(compiler AppCompiler, provider AppProvider) []shuttle.Tool
UIAppTools returns shuttle.Tool implementations that allow server-side agents to create, update, list, and delete MCP UI apps. These tools are registered lazily — only when ContainsUIIntent signals that the user wants a visualization.
func UserIDStreamInterceptor ¶ added in v1.2.0
func UserIDStreamInterceptor(cfg UserIDConfig) grpc.StreamServerInterceptor
UserIDStreamInterceptor extracts X-User-ID from gRPC metadata and injects into context for streaming RPCs.
func UserIDUnaryInterceptor ¶ added in v1.2.0
func UserIDUnaryInterceptor(cfg UserIDConfig) grpc.UnaryServerInterceptor
UserIDUnaryInterceptor extracts X-User-ID from gRPC metadata and injects into context via ContextWithUserID. Returns codes.Unauthenticated if missing and RequireUserID is true.
func ValidateProviders ¶ added in v1.2.0
ValidateProviders performs a preflight health check on all configured LLM providers. It deduplicates providers across agents (many agents often share one provider) and runs all checks concurrently, so startup time is bounded by the slowest provider rather than O(agents × latency).
Called during server startup to ensure all providers are reachable before serving requests. Returns an error if any provider fails the health check.
Types ¶
type AdminServer ¶ added in v1.2.0
type AdminServer struct {
loomv1.UnimplementedAdminServiceServer
// contains filtered or unexported fields
}
AdminServer implements the AdminService gRPC service. It wraps an AdminStorage backend to expose admin operations via gRPC. Access is optionally gated by a token passed in the "x-admin-token" gRPC metadata header.
func NewAdminServer ¶ added in v1.2.0
func NewAdminServer(store agent.AdminStorage, adminToken string) *AdminServer
NewAdminServer creates a new admin gRPC server. If adminToken is non-empty, every RPC will require the caller to supply a matching "x-admin-token" metadata header. An empty adminToken disables the check. Returns nil if no admin storage is configured (graceful degradation).
func (*AdminServer) CountSessionsByUser ¶ added in v1.2.0
func (s *AdminServer) CountSessionsByUser(ctx context.Context, req *loomv1.CountSessionsByUserRequest) (*loomv1.CountSessionsByUserResponse, error)
CountSessionsByUser returns session counts grouped by user.
func (*AdminServer) GetSystemStats ¶ added in v1.2.0
func (s *AdminServer) GetSystemStats(ctx context.Context, req *loomv1.GetSystemStatsRequest) (*loomv1.GetSystemStatsResponse, error)
GetSystemStats returns aggregate system statistics across all users.
func (*AdminServer) ListAllSessions ¶ added in v1.2.0
func (s *AdminServer) ListAllSessions(ctx context.Context, req *loomv1.ListAllSessionsRequest) (*loomv1.ListAllSessionsResponse, error)
ListAllSessions lists sessions across all users (bypasses RLS).
type AppCompiler ¶ added in v1.2.0
type AppCompiler interface {
Compile(spec *loomv1.UIAppSpec) ([]byte, error)
Validate(spec *loomv1.UIAppSpec) error
ListComponentTypes() []*loomv1.ComponentType
}
AppCompiler compiles UIAppSpec to HTML. Separated from AppProvider to keep the registry focused on storage and the compiler focused on validation/rendering.
type AppHTMLProvider ¶ added in v1.2.0
AppHTMLProvider provides HTML content for UI apps. Used by the HTTP server to serve apps in the browser.
type AppProvider ¶ added in v1.2.0
type AppProvider interface {
ListAppInfo() []apps.AppInfo
GetAppHTML(name string) ([]byte, *apps.AppInfo, error)
CreateApp(name, displayName, description string, html []byte, overwrite bool) (*apps.AppInfo, bool, error)
UpdateApp(name, displayName, description string, html []byte) (*apps.AppInfo, error)
DeleteApp(name string) error
}
AppProvider provides UI app information to the gRPC server. Implemented by UIResourceRegistry to avoid tight coupling between the server package and the apps package internals.
type BusMessage ¶ added in v1.1.0
type BusMessage struct {
// contains filtered or unexported fields
}
BusMessage wraps a bus message with its topic for processing
type CORSConfig ¶ added in v1.0.2
type CORSConfig struct {
Enabled bool
AllowedOrigins []string
AllowedMethods []string
AllowedHeaders []string
ExposedHeaders []string
AllowCredentials bool
MaxAge int
}
CORSConfig holds CORS configuration
func DefaultCORSConfig ¶ added in v1.0.2
func DefaultCORSConfig() CORSConfig
DefaultCORSConfig returns a permissive CORS configuration
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer wraps gRPC server with HTTP/REST+SSE endpoints
func NewHTTPServer ¶
func NewHTTPServer(grpcServer *MultiAgentServer, httpAddr, grpcAddr string, logger *zap.Logger) *HTTPServer
NewHTTPServer creates an HTTP server that proxies to gRPC
func NewHTTPServerWithCORS ¶ added in v1.0.2
func NewHTTPServerWithCORS(grpcServer *MultiAgentServer, httpAddr, grpcAddr string, logger *zap.Logger, corsConfig CORSConfig) *HTTPServer
NewHTTPServerWithCORS creates an HTTP server with custom CORS configuration
func (*HTTPServer) SetAppHTMLProvider ¶ added in v1.2.0
func (h *HTTPServer) SetAppHTMLProvider(p AppHTMLProvider)
SetAppHTMLProvider sets the provider used to serve UI apps over HTTP. Must be called before Start(); not safe for concurrent use.
type JudgeServer ¶ added in v1.2.0
type JudgeServer struct {
loomv1.UnimplementedJudgeServiceServer
// contains filtered or unexported fields
}
JudgeServer implements loomv1.JudgeServiceServer. It stores judge configurations in memory and executes evaluations via judges.LLMJudge (no hawk build tag required).
func NewJudgeServer ¶ added in v1.2.0
func NewJudgeServer(tracer observability.Tracer, logger *zap.Logger) *JudgeServer
NewJudgeServer creates a new JudgeServer with the given tracer and logger.
func (*JudgeServer) EvaluateWithJudges ¶ added in v1.2.0
func (s *JudgeServer) EvaluateWithJudges(ctx context.Context, req *loomv1.EvaluateRequest) (*loomv1.EvaluateResponse, error)
EvaluateWithJudges runs named judges against the provided context and returns aggregated results.
func (*JudgeServer) EvaluateWithJudgesStream ¶ added in v1.2.0
func (s *JudgeServer) EvaluateWithJudgesStream(req *loomv1.EvaluateRequest, stream loomv1.JudgeService_EvaluateWithJudgesStreamServer) error
EvaluateWithJudgesStream runs judges with streaming progress events.
func (*JudgeServer) GetJudgeConfig ¶ added in v1.2.0
func (s *JudgeServer) GetJudgeConfig(id string) (*loomv1.JudgeConfig, error)
GetJudgeConfig returns the judge config for the given ID. Used by Server to resolve req.JudgeId in ABTest.
func (*JudgeServer) GetJudgeHistory ¶ added in v1.2.0
func (s *JudgeServer) GetJudgeHistory(_ context.Context, _ *loomv1.GetJudgeHistoryRequest) (*loomv1.GetJudgeHistoryResponse, error)
GetJudgeHistory returns empty history (no persistence in this implementation).
func (*JudgeServer) RegisterJudge ¶ added in v1.2.0
func (s *JudgeServer) RegisterJudge(ctx context.Context, req *loomv1.RegisterJudgeRequest) (*loomv1.RegisterJudgeResponse, error)
RegisterJudge stores a judge configuration.
func (*JudgeServer) SetProviderPool ¶ added in v1.2.0
func (s *JudgeServer) SetProviderPool(pool map[string]agent.LLMProvider, defaultP agent.LLMProvider)
SetProviderPool configures the provider pool and default fallback provider.
type LearningService ¶
type LearningService struct {
loomv1.UnimplementedLearningAgentServiceServer
// contains filtered or unexported fields
}
LearningService implements the LearningAgentService gRPC interface. It wraps the LearningAgent and provides gRPC service endpoints.
func NewLearningService ¶
func NewLearningService(agent *learning.LearningAgent) *LearningService
NewLearningService creates a new LearningService gRPC wrapper
func (*LearningService) AnalyzePatternEffectiveness ¶
func (s *LearningService) AnalyzePatternEffectiveness( ctx context.Context, req *loomv1.AnalyzePatternEffectivenessRequest, ) (*loomv1.PatternAnalysisResponse, error)
AnalyzePatternEffectiveness analyzes pattern performance over a time window
func (*LearningService) ApplyImprovement ¶
func (s *LearningService) ApplyImprovement( ctx context.Context, req *loomv1.ApplyImprovementRequest, ) (*loomv1.ApplyImprovementResponse, error)
ApplyImprovement applies an improvement proposal
func (*LearningService) GenerateImprovements ¶
func (s *LearningService) GenerateImprovements( ctx context.Context, req *loomv1.GenerateImprovementsRequest, ) (*loomv1.ImprovementsResponse, error)
GenerateImprovements generates improvement proposals based on analysis
func (*LearningService) GetImprovementHistory ¶
func (s *LearningService) GetImprovementHistory( ctx context.Context, req *loomv1.GetImprovementHistoryRequest, ) (*loomv1.ImprovementHistoryResponse, error)
GetImprovementHistory retrieves improvement history
func (*LearningService) RollbackImprovement ¶
func (s *LearningService) RollbackImprovement( ctx context.Context, req *loomv1.RollbackImprovementRequest, ) (*loomv1.RollbackImprovementResponse, error)
RollbackImprovement rolls back a previously applied improvement
func (*LearningService) StreamPatternMetrics ¶
func (s *LearningService) StreamPatternMetrics( req *loomv1.StreamPatternMetricsRequest, stream loomv1.LearningAgentService_StreamPatternMetricsServer, ) error
StreamPatternMetrics streams real-time pattern metrics 🚨 CRITICAL: This implements the streaming RPC using MessageBus
type MultiAgentServer ¶
type MultiAgentServer struct {
loomv1.UnimplementedLoomServiceServer
// contains filtered or unexported fields
}
MultiAgentServer implements the LoomService gRPC server with support for multiple agents. It routes requests to the appropriate agent based on agent_id in the request.
func NewMultiAgentServer ¶
func NewMultiAgentServer(agents map[string]*agent.Agent, store agent.SessionStorage) *MultiAgentServer
NewMultiAgentServer creates a new multi-agent LoomService server.
func (*MultiAgentServer) ABTest ¶ added in v1.2.0
func (s *MultiAgentServer) ABTest(req *loomv1.ABTestRequest, stream loomv1.LoomService_ABTestServer) error
ABTest runs an A/B test across multiple named providers. Delegates to the internal single-agent Server so the implementation is shared.
func (*MultiAgentServer) AddAgent ¶
func (s *MultiAgentServer) AddAgent(id string, ag *agent.Agent)
AddAgent adds a new agent to the server at runtime
func (*MultiAgentServer) AddMCPServer ¶
func (s *MultiAgentServer) AddMCPServer(ctx context.Context, req *loomv1.AddMCPServerRequest) (*loomv1.AddMCPServerResponse, error)
AddMCPServer adds a new MCP server configuration.
func (*MultiAgentServer) AnswerClarificationQuestion ¶
func (s *MultiAgentServer) AnswerClarificationQuestion(ctx context.Context, req *loomv1.AnswerClarificationRequest) (*loomv1.AnswerClarificationResponse, error)
AnswerClarificationQuestion provides an answer to a clarification question asked by an agent.
func (*MultiAgentServer) ConfigureCommunication ¶
func (s *MultiAgentServer) ConfigureCommunication( bus *communication.MessageBus, queue *communication.MessageQueue, sharedMem *communication.SharedMemoryStore, refStore communication.ReferenceStore, policy *communication.PolicyManager, logger *zap.Logger, ) error
ConfigureCommunication initializes the tri-modal communication system for all agents. This should be called after NewMultiAgentServer() but before starting the server.
The three communication modes: 1. MessageBus - Broadcast/pub-sub for topic-based multicast 2. MessageQueue - Point-to-point async messaging with queuing 3. SharedMemoryStore - Zero-copy data sharing with namespaces
func (*MultiAgentServer) ConfigureLegacyCommunication ¶
func (s *MultiAgentServer) ConfigureLegacyCommunication(refStore communication.ReferenceStore, policy *communication.PolicyManager) error
ConfigureLegacyCommunication initializes basic inter-agent communication with reference store and policy. Deprecated: Use ConfigureCommunication() from communication_handlers.go for tri-modal communication.
func (*MultiAgentServer) ConfigureScheduler ¶
func (s *MultiAgentServer) ConfigureScheduler(sched *scheduler.Scheduler)
ConfigureScheduler injects the workflow scheduler for cron-based execution. This should be called after NewMultiAgentServer() to enable schedule management RPCs.
func (*MultiAgentServer) ConfigureSharedMemory ¶
func (s *MultiAgentServer) ConfigureSharedMemory(config *storage.Config) error
ConfigureSharedMemory initializes shared memory for all agents with the given configuration. This should be called after NewMultiAgentServer() but before starting the server. All agents will share the same memory store, enabling efficient data passing between them.
func (*MultiAgentServer) ConfigureTLS ¶
func (s *MultiAgentServer) ConfigureTLS(manager *tls.Manager, config *loomv1.ServerConfig)
ConfigureTLS sets the TLS manager and merges TLS config into the server configuration. This should be called after SetServerConfig() if TLS is enabled.
func (*MultiAgentServer) CreateAgentFromConfig ¶ added in v1.2.0
func (s *MultiAgentServer) CreateAgentFromConfig(ctx context.Context, req *loomv1.CreateAgentRequest) (*loomv1.AgentInfo, error)
CreateAgentFromConfig creates a new agent from the provided configuration or config file path.
func (*MultiAgentServer) CreatePattern ¶
func (s *MultiAgentServer) CreatePattern(ctx context.Context, req *loomv1.CreatePatternRequest) (*loomv1.CreatePatternResponse, error)
CreatePattern creates a new pattern at runtime for a specific agent.
func (*MultiAgentServer) CreateSession ¶
func (s *MultiAgentServer) CreateSession(ctx context.Context, req *loomv1.CreateSessionRequest) (*loomv1.Session, error)
CreateSession creates a new conversation session for an agent.
func (*MultiAgentServer) CreateUIApp ¶ added in v1.2.0
func (s *MultiAgentServer) CreateUIApp(ctx context.Context, req *loomv1.CreateUIAppRequest) (*loomv1.CreateUIAppResponse, error)
CreateUIApp creates a dynamic UI app from a declarative spec.
func (*MultiAgentServer) DeleteAgent ¶ added in v1.2.0
func (s *MultiAgentServer) DeleteAgent(ctx context.Context, req *loomv1.DeleteAgentRequest) (*loomv1.DeleteAgentResponse, error)
DeleteAgent removes an agent from the server. If force is false and the agent is running, returns FailedPrecondition. If force is true, the agent is stopped first then deleted.
func (*MultiAgentServer) DeleteArtifact ¶
func (s *MultiAgentServer) DeleteArtifact(ctx context.Context, req *loomv1.DeleteArtifactRequest) (*loomv1.DeleteArtifactResponse, error)
DeleteArtifact deletes an artifact (soft or hard delete).
func (*MultiAgentServer) DeleteMCPServer ¶
func (s *MultiAgentServer) DeleteMCPServer(ctx context.Context, req *loomv1.DeleteMCPServerRequest) (*loomv1.DeleteMCPServerResponse, error)
DeleteMCPServer removes an MCP server.
func (*MultiAgentServer) DeleteScheduledWorkflow ¶
func (s *MultiAgentServer) DeleteScheduledWorkflow(ctx context.Context, req *loomv1.DeleteScheduledWorkflowRequest) (*emptypb.Empty, error)
DeleteScheduledWorkflow deletes a scheduled workflow. YAML-sourced schedules cannot be deleted via RPC - they must be removed by deleting the YAML file.
func (*MultiAgentServer) DeleteSession ¶
func (s *MultiAgentServer) DeleteSession(ctx context.Context, req *loomv1.DeleteSessionRequest) (*loomv1.DeleteSessionResponse, error)
DeleteSession deletes a session.
func (*MultiAgentServer) DeleteSharedMemory ¶
func (s *MultiAgentServer) DeleteSharedMemory(ctx context.Context, req *loomv1.DeleteSharedMemoryRequest) (*loomv1.DeleteSharedMemoryResponse, error)
DeleteSharedMemory removes a value from shared memory.
func (*MultiAgentServer) DeleteUIApp ¶ added in v1.2.0
func (s *MultiAgentServer) DeleteUIApp(ctx context.Context, req *loomv1.DeleteUIAppRequest) (*loomv1.DeleteUIAppResponse, error)
DeleteUIApp deletes a dynamic UI app.
func (*MultiAgentServer) DespawnSubAgent ¶ added in v1.1.0
func (s *MultiAgentServer) DespawnSubAgent(ctx context.Context, req *builtin.DespawnSubAgentRequest) (*builtin.DespawnSubAgentResponse, error)
DespawnSubAgent terminates a spawned sub-agent. This implements the builtin.DespawnHandler interface.
func (*MultiAgentServer) ExecuteWorkflow ¶
func (s *MultiAgentServer) ExecuteWorkflow(ctx context.Context, req *loomv1.ExecuteWorkflowRequest) (*loomv1.ExecuteWorkflowResponse, error)
ExecuteWorkflow executes a workflow pattern loaded from YAML or programmatically defined. This RPC enables automatic execution of multi-agent workflows.
func (*MultiAgentServer) GetAgent ¶ added in v1.2.0
func (s *MultiAgentServer) GetAgent(ctx context.Context, req *loomv1.GetAgentRequest) (*loomv1.AgentInfo, error)
GetAgent retrieves information about a specific agent.
func (*MultiAgentServer) GetAgentIDs ¶
func (s *MultiAgentServer) GetAgentIDs() []string
GetAgentIDs returns available agent IDs (internal helper)
func (*MultiAgentServer) GetArtifact ¶
func (s *MultiAgentServer) GetArtifact(ctx context.Context, req *loomv1.GetArtifactRequest) (*loomv1.GetArtifactResponse, error)
GetArtifact retrieves artifact metadata.
func (*MultiAgentServer) GetArtifactContent ¶
func (s *MultiAgentServer) GetArtifactContent(ctx context.Context, req *loomv1.GetArtifactContentRequest) (*loomv1.GetArtifactContentResponse, error)
GetArtifactContent reads artifact file content.
func (*MultiAgentServer) GetArtifactStats ¶
func (s *MultiAgentServer) GetArtifactStats(ctx context.Context, req *loomv1.GetArtifactStatsRequest) (*loomv1.GetArtifactStatsResponse, error)
GetArtifactStats retrieves storage statistics.
func (*MultiAgentServer) GetCommunicationComponents ¶
func (s *MultiAgentServer) GetCommunicationComponents() ( *communication.MessageBus, *communication.MessageQueue, *communication.SharedMemoryStore, )
GetCommunicationComponents returns the communication system components (for testing/inspection).
func (*MultiAgentServer) GetCommunicationPolicy ¶
func (s *MultiAgentServer) GetCommunicationPolicy() *communication.PolicyManager
GetCommunicationPolicy returns the communication policy (for testing/inspection).
func (*MultiAgentServer) GetConversationHistory ¶
func (s *MultiAgentServer) GetConversationHistory(ctx context.Context, req *loomv1.GetConversationHistoryRequest) (*loomv1.ConversationHistory, error)
GetConversationHistory retrieves conversation history.
func (*MultiAgentServer) GetHealth ¶
func (s *MultiAgentServer) GetHealth(ctx context.Context, req *loomv1.GetHealthRequest) (*loomv1.HealthStatus, error)
GetHealth performs a health check by pinging each unique LLM provider. Providers are deduplicated across agents (many agents share the same provider) and checked concurrently, so latency is O(slowest_provider) not O(agents × latency). Returns per-provider status in the components map.
func (*MultiAgentServer) GetMCPServer ¶
func (s *MultiAgentServer) GetMCPServer(ctx context.Context, req *loomv1.GetMCPServerRequest) (*loomv1.MCPServerInfo, error)
GetMCPServer retrieves a specific MCP server.
func (*MultiAgentServer) GetPattern ¶ added in v1.2.0
func (s *MultiAgentServer) GetPattern(ctx context.Context, req *loomv1.GetPatternRequest) (*loomv1.Pattern, error)
GetPattern retrieves a specific pattern by exact name match. Searches across all agents' pattern libraries.
func (*MultiAgentServer) GetPendingPermissions ¶ added in v1.2.0
func (s *MultiAgentServer) GetPendingPermissions() map[string]*pendingPermission
GetPendingPermissions returns all pending permission requests. Useful for UI layers that need to display pending permission requests.
func (*MultiAgentServer) GetReferenceStore ¶
func (s *MultiAgentServer) GetReferenceStore() communication.ReferenceStore
GetReferenceStore returns the reference store (for testing/inspection).
func (*MultiAgentServer) GetScheduleHistory ¶
func (s *MultiAgentServer) GetScheduleHistory(ctx context.Context, req *loomv1.GetScheduleHistoryRequest) (*loomv1.GetScheduleHistoryResponse, error)
GetScheduleHistory returns execution history for a schedule. Includes the last N executions with their status, timing, and error information.
func (*MultiAgentServer) GetScheduledWorkflow ¶
func (s *MultiAgentServer) GetScheduledWorkflow(ctx context.Context, req *loomv1.GetScheduledWorkflowRequest) (*loomv1.ScheduledWorkflow, error)
GetScheduledWorkflow retrieves a scheduled workflow by ID.
func (*MultiAgentServer) GetServerConfig ¶
func (s *MultiAgentServer) GetServerConfig(ctx context.Context, req *loomv1.GetServerConfigRequest) (*loomv1.ServerConfig, error)
GetServerConfig returns the current server configuration.
func (*MultiAgentServer) GetSession ¶
func (s *MultiAgentServer) GetSession(ctx context.Context, req *loomv1.GetSessionRequest) (*loomv1.Session, error)
GetSession retrieves session details.
func (*MultiAgentServer) GetSharedMemory ¶
func (s *MultiAgentServer) GetSharedMemory(ctx context.Context, req *loomv1.GetSharedMemoryRequest) (*loomv1.GetSharedMemoryResponse, error)
GetSharedMemory retrieves a value from shared memory.
func (*MultiAgentServer) GetSharedMemoryStats ¶
func (s *MultiAgentServer) GetSharedMemoryStats(ctx context.Context, req *loomv1.GetSharedMemoryStatsRequest) (*loomv1.SharedMemoryStats, error)
GetSharedMemoryStats retrieves statistics for a namespace.
func (*MultiAgentServer) GetStorageStatus ¶ added in v1.2.0
func (s *MultiAgentServer) GetStorageStatus(ctx context.Context, _ *loomv1.GetStorageStatusRequest) (*loomv1.GetStorageStatusResponse, error)
GetStorageStatus returns the health status of the storage backend.
func (*MultiAgentServer) GetTLSStatus ¶
func (s *MultiAgentServer) GetTLSStatus(ctx context.Context, req *loomv1.GetTLSStatusRequest) (*loomv1.TLSStatus, error)
GetTLSStatus returns the current TLS/certificate status.
func (*MultiAgentServer) GetTrace ¶ added in v1.2.0
func (s *MultiAgentServer) GetTrace(ctx context.Context, req *loomv1.GetTraceRequest) (*loomv1.Trace, error)
GetTrace retrieves a trace by ID from the server's local trace store. The observability.Tracer interface does not support trace retrieval, so the server maintains its own trace store. If no trace store is initialized, it returns FailedPrecondition. If the trace is not found, it returns NotFound.
func (*MultiAgentServer) GetUIApp ¶ added in v1.2.0
func (s *MultiAgentServer) GetUIApp(ctx context.Context, req *loomv1.GetUIAppRequest) (*loomv1.GetUIAppResponse, error)
GetUIApp retrieves a specific UI app by short name, returning its metadata and HTML content.
func (*MultiAgentServer) GetWorkflowExecution ¶ added in v1.1.0
func (s *MultiAgentServer) GetWorkflowExecution(ctx context.Context, req *loomv1.GetWorkflowExecutionRequest) (*loomv1.WorkflowExecution, error)
GetWorkflowExecution retrieves a specific workflow execution by ID. Returns NotFound if the execution doesn't exist.
func (*MultiAgentServer) GrantToolPermission ¶ added in v1.2.0
func (s *MultiAgentServer) GrantToolPermission(permID string, granted bool, message string, remember bool) error
GrantToolPermission provides an answer to a pending tool permission request. This is the counterpart to RequestToolPermission, called by the UI layer when the user makes a decision. It follows the same pattern as AnswerClarificationQuestion.
func (*MultiAgentServer) HealthCheckMCPServers ¶
func (s *MultiAgentServer) HealthCheckMCPServers(ctx context.Context, req *loomv1.HealthCheckMCPServersRequest) (*loomv1.HealthCheckMCPServersResponse, error)
HealthCheckMCPServers checks health of all MCP servers.
func (*MultiAgentServer) ListAgents ¶
func (s *MultiAgentServer) ListAgents(ctx context.Context, req *loomv1.ListAgentsRequest) (*loomv1.ListAgentsResponse, error)
ListAgents implements the gRPC ListAgents RPC method
func (*MultiAgentServer) ListArtifacts ¶
func (s *MultiAgentServer) ListArtifacts(ctx context.Context, req *loomv1.ListArtifactsRequest) (*loomv1.ListArtifactsResponse, error)
ListArtifacts lists artifacts with optional filtering.
func (*MultiAgentServer) ListAvailableModels ¶
func (s *MultiAgentServer) ListAvailableModels(ctx context.Context, req *loomv1.ListAvailableModelsRequest) (*loomv1.ListAvailableModelsResponse, error)
ListAvailableModels lists all LLM models available to this server instance. Uses the provider factory to dynamically determine which models are actually available based on configured credentials and environment variables.
func (*MultiAgentServer) ListComponentTypes ¶ added in v1.2.0
func (s *MultiAgentServer) ListComponentTypes(ctx context.Context, req *loomv1.ListComponentTypesRequest) (*loomv1.ListComponentTypesResponse, error)
ListComponentTypes returns the catalog of available component types for building dynamic apps.
func (*MultiAgentServer) ListMCPServerTools ¶
func (s *MultiAgentServer) ListMCPServerTools(ctx context.Context, req *loomv1.ListMCPServerToolsRequest) (*loomv1.ListMCPServerToolsResponse, error)
ListMCPServerTools lists all tools from a specific MCP server. This queries the MCP server directly through the manager, not the agent's tool registry.
func (*MultiAgentServer) ListMCPServers ¶
func (s *MultiAgentServer) ListMCPServers(ctx context.Context, req *loomv1.ListMCPServersRequest) (*loomv1.ListMCPServersResponse, error)
ListMCPServers lists all configured MCP servers.
func (*MultiAgentServer) ListPatterns ¶ added in v1.2.0
func (s *MultiAgentServer) ListPatterns(ctx context.Context, req *loomv1.ListPatternsRequest) (*loomv1.ListPatternsResponse, error)
ListPatterns retrieves available patterns with optional filtering by domain, category, or search query. Iterates through all agents' pattern libraries and aggregates results.
func (*MultiAgentServer) ListProviders ¶ added in v1.2.0
func (s *MultiAgentServer) ListProviders(ctx context.Context, req *loomv1.ListProvidersRequest) (*loomv1.ListProvidersResponse, error)
ListProviders lists named providers in the pool configured via SetProviderPool.
func (*MultiAgentServer) ListScheduledWorkflows ¶
func (s *MultiAgentServer) ListScheduledWorkflows(ctx context.Context, req *loomv1.ListScheduledWorkflowsRequest) (*loomv1.ListScheduledWorkflowsResponse, error)
ListScheduledWorkflows lists all scheduled workflows. Can optionally filter to only enabled schedules.
func (*MultiAgentServer) ListSessions ¶
func (s *MultiAgentServer) ListSessions(ctx context.Context, req *loomv1.ListSessionsRequest) (*loomv1.ListSessionsResponse, error)
ListSessions lists all sessions across all agents.
func (*MultiAgentServer) ListSharedMemoryKeys ¶
func (s *MultiAgentServer) ListSharedMemoryKeys(ctx context.Context, req *loomv1.ListSharedMemoryKeysRequest) (*loomv1.ListSharedMemoryKeysResponse, error)
ListSharedMemoryKeys lists all keys matching a pattern in a namespace.
func (*MultiAgentServer) ListTools ¶
func (s *MultiAgentServer) ListTools(ctx context.Context, req *loomv1.ListToolsRequest) (*loomv1.ListToolsResponse, error)
ListTools lists all registered tools from the default agent. If req.Backend is specified, only tools for that backend are returned.
func (*MultiAgentServer) ListUIApps ¶ added in v1.2.0
func (s *MultiAgentServer) ListUIApps(ctx context.Context, req *loomv1.ListUIAppsRequest) (*loomv1.ListUIAppsResponse, error)
ListUIApps lists all available UI apps registered with the app provider.
func (*MultiAgentServer) ListWorkflowExecutions ¶ added in v1.1.0
func (s *MultiAgentServer) ListWorkflowExecutions(ctx context.Context, req *loomv1.ListWorkflowExecutionsRequest) (*loomv1.ListWorkflowExecutionsResponse, error)
ListWorkflowExecutions lists workflow executions with optional filtering. Supports filtering by status and pattern type.
func (*MultiAgentServer) LoadPatterns ¶ added in v1.2.0
func (s *MultiAgentServer) LoadPatterns(ctx context.Context, req *loomv1.LoadPatternsRequest) (*loomv1.LoadPatternsResponse, error)
LoadPatterns loads pattern definitions from a directory for one or all agents. If agent_id is specified, loads patterns for that agent only. If source is provided without agent_id, loads for all agents. If force_reload is true, clears the pattern cache before loading.
func (*MultiAgentServer) PauseSchedule ¶
func (s *MultiAgentServer) PauseSchedule(ctx context.Context, req *loomv1.PauseScheduleRequest) (*emptypb.Empty, error)
PauseSchedule pauses a schedule without deleting it. The schedule will remain in the database but will not execute until resumed.
func (*MultiAgentServer) Publish ¶
func (s *MultiAgentServer) Publish(ctx context.Context, req *loomv1.PublishRequest) (*loomv1.PublishResponse, error)
Publish publishes a message to a topic on the broadcast bus. All subscribers to the topic will receive the message.
func (*MultiAgentServer) PutSharedMemory ¶
func (s *MultiAgentServer) PutSharedMemory(ctx context.Context, req *loomv1.PutSharedMemoryRequest) (*loomv1.PutSharedMemoryResponse, error)
PutSharedMemory writes or updates a value in shared memory.
func (*MultiAgentServer) RecordTraceSpan ¶ added in v1.2.0
func (s *MultiAgentServer) RecordTraceSpan(span *observability.Span)
RecordTraceSpan records a completed span in the server's local trace store. Call this after ending a span to make it available via the GetTrace RPC.
func (*MultiAgentServer) RegisterServerProgressListener ¶
func (s *MultiAgentServer) RegisterServerProgressListener(agentName string, logger *zap.Logger)
RegisterServerProgressListener creates and registers a progress listener for the server. This listener tracks pending clarification questions for TUI/RPC answer routing.
func (*MultiAgentServer) RegisterTool ¶ added in v1.2.0
func (s *MultiAgentServer) RegisterTool(ctx context.Context, req *loomv1.RegisterToolRequest) (*loomv1.RegisterToolResponse, error)
RegisterTool registers a tool definition with the server's tool registry. The tool becomes available for discovery via SearchTools and can be used by agents.
func (*MultiAgentServer) ReloadAgent ¶ added in v1.2.0
func (s *MultiAgentServer) ReloadAgent(ctx context.Context, req *loomv1.ReloadAgentRequest) (*loomv1.AgentInfo, error)
ReloadAgent hot-reloads an agent's configuration. If reload_from_file is true, the agent's config is re-read from disk. If config is provided, it replaces the current configuration.
func (*MultiAgentServer) RemoveAgent ¶
func (s *MultiAgentServer) RemoveAgent(id string) error
RemoveAgent removes an agent from the server
func (*MultiAgentServer) RenewCertificate ¶
func (s *MultiAgentServer) RenewCertificate(ctx context.Context, req *loomv1.RenewCertificateRequest) (*loomv1.RenewCertificateResponse, error)
RenewCertificate manually triggers certificate renewal.
func (*MultiAgentServer) RequestToolPermission ¶ added in v1.2.0
func (s *MultiAgentServer) RequestToolPermission(ctx context.Context, req *loomv1.ToolPermissionRequest) (*loomv1.ToolPermissionResponse, error)
RequestToolPermission requests user permission before executing a tool. It creates a pending permission request and waits for a response on a channel, following the same pattern as AnswerClarificationQuestion for HITL workflows.
If no answering mechanism responds within the timeout, the request times out with granted=false, timed_out=true.
func (*MultiAgentServer) RestartMCPServer ¶
func (s *MultiAgentServer) RestartMCPServer(ctx context.Context, req *loomv1.RestartMCPServerRequest) (*loomv1.MCPServerInfo, error)
RestartMCPServer restarts a running MCP server.
func (*MultiAgentServer) ResumeSchedule ¶
func (s *MultiAgentServer) ResumeSchedule(ctx context.Context, req *loomv1.ResumeScheduleRequest) (*emptypb.Empty, error)
ResumeSchedule resumes a paused schedule. The schedule will start executing again according to its cron expression.
func (*MultiAgentServer) RunMigration ¶ added in v1.2.0
func (s *MultiAgentServer) RunMigration(ctx context.Context, req *loomv1.RunMigrationRequest) (*loomv1.RunMigrationResponse, error)
RunMigration runs database migrations on the storage backend.
func (*MultiAgentServer) ScheduleWorkflow ¶
func (s *MultiAgentServer) ScheduleWorkflow(ctx context.Context, req *loomv1.ScheduleWorkflowRequest) (*loomv1.ScheduleWorkflowResponse, error)
ScheduleWorkflow creates a new scheduled workflow via RPC. The schedule will be persisted in SQLite and executed automatically by the cron engine.
func (*MultiAgentServer) SearchArtifacts ¶
func (s *MultiAgentServer) SearchArtifacts(ctx context.Context, req *loomv1.SearchArtifactsRequest) (*loomv1.SearchArtifactsResponse, error)
SearchArtifacts performs full-text search on artifacts.
func (*MultiAgentServer) SendAndReceive ¶
func (s *MultiAgentServer) SendAndReceive(ctx context.Context, req *loomv1.SendAndReceiveRequest) (*loomv1.SendAndReceiveResponse, error)
SendAndReceive sends a request message and waits for a response (RPC-style). This implements synchronous request-response communication via the message queue.
func (*MultiAgentServer) SendAsync ¶
func (s *MultiAgentServer) SendAsync(ctx context.Context, req *loomv1.SendAsyncRequest) (*loomv1.SendAsyncResponse, error)
SendAsync sends a fire-and-forget message to another agent via the message queue. If the destination agent is offline, the message is queued for later delivery.
func (*MultiAgentServer) SetAgentRegistry ¶
func (s *MultiAgentServer) SetAgentRegistry(registry *agent.Registry)
SetAgentRegistry injects the agent registry for workflow execution. This should be called after NewMultiAgentServer() to enable ExecuteWorkflow RPC.
func (*MultiAgentServer) SetAppCompiler ¶ added in v1.2.0
func (s *MultiAgentServer) SetAppCompiler(c AppCompiler)
SetAppCompiler sets the compiler for CreateUIApp/UpdateUIApp RPCs.
func (*MultiAgentServer) SetAppProvider ¶ added in v1.2.0
func (s *MultiAgentServer) SetAppProvider(p AppProvider)
SetAppProvider sets the app provider for ListUIApps/GetUIApp RPCs.
func (*MultiAgentServer) SetArtifactStore ¶
func (s *MultiAgentServer) SetArtifactStore(store artifacts.ArtifactStore)
SetArtifactStore sets the artifact store for file management. This should be called after NewMultiAgentServer() to enable artifact operations.
func (*MultiAgentServer) SetClarificationConfig ¶
func (s *MultiAgentServer) SetClarificationConfig(channelSendTimeoutMs int)
SetClarificationConfig sets the clarification question timeout configuration.
func (*MultiAgentServer) SetEvalStore ¶ added in v1.2.0
func (s *MultiAgentServer) SetEvalStore(store *evals.Store)
SetEvalStore configures the evaluation store for persisting ABTest results. It propagates the store to the internal delegate server used for ABTest.
func (*MultiAgentServer) SetJudgeServer ¶ added in v1.2.0
func (s *MultiAgentServer) SetJudgeServer(js *JudgeServer)
SetJudgeServer wires the JudgeServer for ABTest judge_id resolution. It propagates the judge server to singleServer if it has already been initialized.
func (*MultiAgentServer) SetLLMConcurrencyLimit ¶
func (s *MultiAgentServer) SetLLMConcurrencyLimit(limit int)
SetLLMConcurrencyLimit configures the maximum number of concurrent LLM calls. This prevents rate limiting by serializing or limiting parallel LLM API calls.
limit = 1: Fully serialized (safest for strict rate limits) limit = 2-5: Some parallelism while staying under quota limit > 5: Higher throughput, higher risk of rate limiting
This should be called after NewMultiAgentServer() but before spawning workflow sub-agents.
func (*MultiAgentServer) SetLogger ¶
func (s *MultiAgentServer) SetLogger(logger *zap.Logger)
SetLogger injects the logger for server operations. This should be called after NewMultiAgentServer() to enable logging.
func (*MultiAgentServer) SetMCPManager ¶
func (s *MultiAgentServer) SetMCPManager(mgr *manager.Manager, configPath string, logger *zap.Logger)
SetMCPManager injects the MCP manager for runtime management. This should be called after NewMultiAgentServer() to enable MCP server management.
func (*MultiAgentServer) SetPatternTracker ¶ added in v1.2.0
func (s *MultiAgentServer) SetPatternTracker(tracker *learning.PatternEffectivenessTracker)
SetPatternTracker sets the pattern effectiveness tracker on the server. All existing and future agents (via AddAgent) will have their orchestrators wired to record metrics automatically.
func (*MultiAgentServer) SetProgressMultiplexer ¶
func (s *MultiAgentServer) SetProgressMultiplexer(agentID string, pm *metaagent.ProgressMultiplexer)
SetProgressMultiplexer sets the progress multiplexer for an agent. This enables multi-turn conversations and progress event broadcasting.
func (*MultiAgentServer) SetProviderFactory ¶
func (s *MultiAgentServer) SetProviderFactory(f *factory.ProviderFactory)
SetProviderFactory sets the LLM provider factory for dynamic model switching.
func (*MultiAgentServer) SetProviderPool ¶ added in v1.2.0
func (s *MultiAgentServer) SetProviderPool(pool map[string]agent.LLMProvider, active string)
SetProviderPool configures the named provider pool used by ListProviders and ABTest RPCs. It builds an internal *Server wrapping the default agent so that both RPCs can delegate to the same implementation used by the single-agent Server.
func (*MultiAgentServer) SetServerConfig ¶ added in v1.2.0
func (s *MultiAgentServer) SetServerConfig(config *loomv1.ServerConfig)
SetServerConfig sets the server configuration (network, metadata, etc.). This should be called after NewMultiAgentServer() to populate GetServerConfig responses.
func (*MultiAgentServer) SetStorageBackend ¶ added in v1.2.0
func (s *MultiAgentServer) SetStorageBackend(sb backend.StorageBackend)
SetStorageBackend sets the storage backend for health checks and migration RPCs.
func (*MultiAgentServer) SetStorageBackendType ¶ added in v1.2.0
func (s *MultiAgentServer) SetStorageBackendType(backendType loomv1.StorageBackendType)
SetStorageBackendType sets the storage backend type for health status reporting.
func (*MultiAgentServer) SetToolRegistry ¶
func (s *MultiAgentServer) SetToolRegistry(registry *toolregistry.Registry)
SetToolRegistry injects the tool registry for dynamic tool discovery. This should be called after NewMultiAgentServer() to enable tool_search indexing of MCP tools.
func (*MultiAgentServer) SetTraceStore ¶ added in v1.2.0
func (s *MultiAgentServer) SetTraceStore(maxAge time.Duration)
SetTraceStore initializes the server's local trace store for GetTrace RPC support. This should be called after NewMultiAgentServer() to enable trace retrieval.
func (*MultiAgentServer) SetTracer ¶ added in v1.1.0
func (s *MultiAgentServer) SetTracer(tracer observability.Tracer)
SetTracer injects an observability tracer for workflow and agent tracing. This should be called after NewMultiAgentServer() to enable observability. Also ensures traceStoreLocal is initialized so GetTrace RPC works.
func (*MultiAgentServer) SharedMemoryStore ¶
func (s *MultiAgentServer) SharedMemoryStore() *storage.SharedMemoryStore
GetSharedMemory returns the shared memory store (for testing/inspection).
func (*MultiAgentServer) Shutdown ¶
func (s *MultiAgentServer) Shutdown(ctx context.Context) error
Shutdown gracefully shuts down the server, closing all pending question channels. This should be called during server shutdown to notify waiting agents that no more answers will be received.
func (*MultiAgentServer) SpawnSubAgent ¶ added in v1.1.0
func (s *MultiAgentServer) SpawnSubAgent(ctx context.Context, req *builtin.SpawnSubAgentRequest) (*builtin.SpawnSubAgentResponse, error)
SpawnSubAgent spawns a new agent as a child of the current session. This implements the builtin.SpawnHandler interface.
func (*MultiAgentServer) StartAgent ¶ added in v1.2.0
func (s *MultiAgentServer) StartAgent(ctx context.Context, req *loomv1.StartAgentRequest) (*loomv1.AgentInfo, error)
StartAgent starts a stopped agent, making it available for requests.
func (*MultiAgentServer) StartHotReload ¶
StartHotReload initializes hot-reload watchers for all agents with pattern directories. Hot-reload events are automatically broadcast to clients via StreamPatternUpdates.
func (*MultiAgentServer) StartMessageQueueMonitor ¶
func (s *MultiAgentServer) StartMessageQueueMonitor(ctx context.Context)
StartMessageQueueMonitor starts a background goroutine that monitors the message queue and notifies workflow sub-agents when they have pending messages (event-driven, not polling).
func (*MultiAgentServer) StopAgent ¶ added in v1.2.0
func (s *MultiAgentServer) StopAgent(ctx context.Context, req *loomv1.StopAgentRequest) (*loomv1.AgentInfo, error)
StopAgent stops a running agent. The agent remains registered but will not process requests.
func (*MultiAgentServer) StopHotReload ¶
func (s *MultiAgentServer) StopHotReload() error
StopHotReload stops all hot-reload watchers. Should be called during server shutdown.
func (*MultiAgentServer) StreamPatternUpdates ¶
func (s *MultiAgentServer) StreamPatternUpdates(req *loomv1.StreamPatternUpdatesRequest, stream loomv1.LoomService_StreamPatternUpdatesServer) error
StreamPatternUpdates streams pattern update events to clients in real-time. Used by TUI and other clients to show live pattern changes without polling.
func (*MultiAgentServer) StreamWeave ¶
func (s *MultiAgentServer) StreamWeave(req *loomv1.WeaveRequest, stream loomv1.LoomService_StreamWeaveServer) error
StreamWeave streams agent execution progress.
func (*MultiAgentServer) StreamWorkflow ¶
func (s *MultiAgentServer) StreamWorkflow(req *loomv1.ExecuteWorkflowRequest, stream loomv1.LoomService_StreamWorkflowServer) error
StreamWorkflow executes a workflow and streams progress updates to the client. This provides real-time feedback during long-running multi-agent workflows.
func (*MultiAgentServer) Subscribe ¶
func (s *MultiAgentServer) Subscribe(req *loomv1.SubscribeRequest, stream loomv1.LoomService_SubscribeServer) error
Subscribe creates a subscription to a topic and streams messages back to the client. The stream will remain open until the client closes it or an error occurs.
func (*MultiAgentServer) SubscribeToSession ¶
func (s *MultiAgentServer) SubscribeToSession(req *loomv1.SubscribeToSessionRequest, stream loomv1.LoomService_SubscribeToSessionServer) error
SubscribeToSession subscribes to real-time updates for a session. Streams updates when new messages arrive in the session conversation. This allows clients to receive asynchronous responses from workflow coordinators and sub-agents without polling.
func (*MultiAgentServer) SwitchModel ¶
func (s *MultiAgentServer) SwitchModel(ctx context.Context, req *loomv1.SwitchModelRequest) (*loomv1.SwitchModelResponse, error)
SwitchModel switches the LLM provider/model for a specific agent. The agent is identified by agent_id in the request.
func (*MultiAgentServer) TestMCPServerConnection ¶
func (s *MultiAgentServer) TestMCPServerConnection(ctx context.Context, req *loomv1.TestMCPServerConnectionRequest) (*loomv1.TestMCPServerConnectionResponse, error)
TestMCPServerConnection tests an MCP server configuration without persisting it. This allows users to validate their configuration before saving.
func (*MultiAgentServer) TriggerScheduledWorkflow ¶
func (s *MultiAgentServer) TriggerScheduledWorkflow(ctx context.Context, req *loomv1.TriggerScheduledWorkflowRequest) (*loomv1.ExecuteWorkflowResponse, error)
TriggerScheduledWorkflow manually triggers a scheduled workflow immediately. This bypasses the cron schedule and executes the workflow right away.
func (*MultiAgentServer) UpdateAgent ¶
func (s *MultiAgentServer) UpdateAgent(id string, ag *agent.Agent) error
UpdateAgent replaces an existing agent with a new instance (for hot-reload). The new agent will inherit shared memory and communication configuration if set.
func (*MultiAgentServer) UpdateMCPServer ¶
func (s *MultiAgentServer) UpdateMCPServer(ctx context.Context, req *loomv1.UpdateMCPServerRequest) (*loomv1.MCPServerInfo, error)
UpdateMCPServer updates an existing MCP server configuration.
func (*MultiAgentServer) UpdateScheduledWorkflow ¶
func (s *MultiAgentServer) UpdateScheduledWorkflow(ctx context.Context, req *loomv1.UpdateScheduledWorkflowRequest) (*loomv1.ScheduleWorkflowResponse, error)
UpdateScheduledWorkflow updates an existing scheduled workflow. YAML-sourced schedules cannot be updated via RPC - they must be modified by editing the YAML file.
func (*MultiAgentServer) UpdateUIApp ¶ added in v1.2.0
func (s *MultiAgentServer) UpdateUIApp(ctx context.Context, req *loomv1.UpdateUIAppRequest) (*loomv1.UpdateUIAppResponse, error)
UpdateUIApp updates an existing dynamic app's spec.
func (*MultiAgentServer) UploadArtifact ¶
func (s *MultiAgentServer) UploadArtifact(ctx context.Context, req *loomv1.UploadArtifactRequest) (*loomv1.UploadArtifactResponse, error)
UploadArtifact uploads a file to artifacts storage.
func (*MultiAgentServer) WatchSharedMemory ¶
func (s *MultiAgentServer) WatchSharedMemory(req *loomv1.WatchSharedMemoryRequest, stream loomv1.LoomService_WatchSharedMemoryServer) error
WatchSharedMemory watches for changes to keys in a namespace and streams updates.
func (*MultiAgentServer) Weave ¶
func (s *MultiAgentServer) Weave(ctx context.Context, req *loomv1.WeaveRequest) (*loomv1.WeaveResponse, error)
Weave executes a user query using the specified agent.
type PatternEventBroadcaster ¶
type PatternEventBroadcaster struct {
// contains filtered or unexported fields
}
PatternEventBroadcaster broadcasts pattern update events to multiple subscribers. Thread-safe for concurrent subscribe/unsubscribe/broadcast operations.
func NewPatternEventBroadcaster ¶
func NewPatternEventBroadcaster() *PatternEventBroadcaster
NewPatternEventBroadcaster creates a new pattern event broadcaster.
func (*PatternEventBroadcaster) Broadcast ¶
func (b *PatternEventBroadcaster) Broadcast(event *loomv1.PatternUpdateEvent)
Broadcast sends an event to all subscribers. Non-blocking: if a subscriber's channel is full, the event is dropped for that subscriber.
func (*PatternEventBroadcaster) BroadcastPatternCreated ¶
func (b *PatternEventBroadcaster) BroadcastPatternCreated(agentID, patternName, category, filePath string)
BroadcastPatternCreated broadcasts a pattern creation event.
func (*PatternEventBroadcaster) BroadcastPatternDeleted ¶
func (b *PatternEventBroadcaster) BroadcastPatternDeleted(agentID, patternName, category string)
BroadcastPatternDeleted broadcasts a pattern deletion event.
func (*PatternEventBroadcaster) BroadcastPatternModified ¶
func (b *PatternEventBroadcaster) BroadcastPatternModified(agentID, patternName, category, filePath string)
BroadcastPatternModified broadcasts a pattern modification event.
func (*PatternEventBroadcaster) BroadcastPatternValidationFailed ¶
func (b *PatternEventBroadcaster) BroadcastPatternValidationFailed(agentID, patternName, errorMsg string)
BroadcastPatternValidationFailed broadcasts a pattern validation failure event.
func (*PatternEventBroadcaster) Close ¶
func (b *PatternEventBroadcaster) Close()
Close closes all subscriber channels.
func (*PatternEventBroadcaster) Subscribe ¶
func (b *PatternEventBroadcaster) Subscribe() chan *loomv1.PatternUpdateEvent
Subscribe registers a new subscriber and returns a channel for receiving events. The channel buffer size is 100 to handle bursts of events. Caller must call Unsubscribe() to clean up.
func (*PatternEventBroadcaster) Unsubscribe ¶
func (b *PatternEventBroadcaster) Unsubscribe(ch chan *loomv1.PatternUpdateEvent)
Unsubscribe removes a subscriber and closes their channel.
type PubSubEvent ¶ added in v1.1.0
type PubSubEvent struct {
Type string // "agent_message"
Topic string // Topic name
FromAgent string // Agent ID that sent the message
ToAgents int // Number of agents that received the message
Content string // Message content
Timestamp time.Time // When the message was published
}
PubSubEvent represents a pub/sub message event for SSE streaming
type Server ¶
type Server struct {
loomv1.UnimplementedLoomServiceServer
// contains filtered or unexported fields
}
Server implements the LoomService gRPC server.
func NewServer ¶
func NewServer(ag *agent.Agent, store agent.SessionStorage) *Server
NewServer creates a new LoomService server.
func (*Server) ABTest ¶ added in v1.2.0
func (s *Server) ABTest(req *loomv1.ABTestRequest, stream loomv1.LoomService_ABTestServer) error
ABTest runs an A/B test across multiple named providers.
func (*Server) CreateSession ¶
func (s *Server) CreateSession(ctx context.Context, req *loomv1.CreateSessionRequest) (*loomv1.Session, error)
CreateSession creates a new conversation session.
func (*Server) DeleteSession ¶
func (s *Server) DeleteSession(ctx context.Context, req *loomv1.DeleteSessionRequest) (*loomv1.DeleteSessionResponse, error)
DeleteSession deletes a session.
func (*Server) GetConversationHistory ¶
func (s *Server) GetConversationHistory(ctx context.Context, req *loomv1.GetConversationHistoryRequest) (*loomv1.ConversationHistory, error)
GetConversationHistory retrieves conversation history.
func (*Server) GetHealth ¶
func (s *Server) GetHealth(ctx context.Context, req *loomv1.GetHealthRequest) (*loomv1.HealthStatus, error)
GetHealth performs a health check by pinging each configured LLM provider. Returns per-component status in the components map with keys like "llm.agent", "llm.judge", etc. Overall status is "healthy" if all pass, "degraded" if some fail, "unhealthy" if all fail.
func (*Server) GetPattern ¶
func (s *Server) GetPattern(ctx context.Context, req *loomv1.GetPatternRequest) (*loomv1.Pattern, error)
GetPattern retrieves a specific pattern.
func (*Server) GetProviderPool ¶ added in v1.2.0
func (s *Server) GetProviderPool() map[string]agent.LLMProvider
GetProviderPool returns the server's named provider pool (may be nil).
func (*Server) GetSession ¶
func (s *Server) GetSession(ctx context.Context, req *loomv1.GetSessionRequest) (*loomv1.Session, error)
GetSession retrieves session details.
func (*Server) ListAvailableModels ¶
func (s *Server) ListAvailableModels(ctx context.Context, req *loomv1.ListAvailableModelsRequest) (*loomv1.ListAvailableModelsResponse, error)
ListAvailableModels lists all available LLM models/providers.
func (*Server) ListAvailableModelsLegacy ¶
func (s *Server) ListAvailableModelsLegacy(ctx context.Context, req *loomv1.ListAvailableModelsRequest) (*loomv1.ListAvailableModelsResponse, error)
ListAvailableModelsLegacy is the old static implementation (deprecated).
func (*Server) ListPatterns ¶
func (s *Server) ListPatterns(ctx context.Context, req *loomv1.ListPatternsRequest) (*loomv1.ListPatternsResponse, error)
ListPatterns lists available patterns.
func (*Server) ListProviders ¶ added in v1.2.0
func (s *Server) ListProviders(_ context.Context, _ *loomv1.ListProvidersRequest) (*loomv1.ListProvidersResponse, error)
ListProviders lists named providers in the pool.
func (*Server) ListSessions ¶
func (s *Server) ListSessions(ctx context.Context, req *loomv1.ListSessionsRequest) (*loomv1.ListSessionsResponse, error)
ListSessions lists all sessions.
func (*Server) ListTools ¶
func (s *Server) ListTools(ctx context.Context, req *loomv1.ListToolsRequest) (*loomv1.ListToolsResponse, error)
ListTools lists all registered tools. If req.Backend is specified, only tools for that backend are returned.
func (*Server) LoadPatterns ¶
func (s *Server) LoadPatterns(ctx context.Context, req *loomv1.LoadPatternsRequest) (*loomv1.LoadPatternsResponse, error)
LoadPatterns loads pattern definitions.
func (*Server) RegisterTool ¶
func (s *Server) RegisterTool(ctx context.Context, req *loomv1.RegisterToolRequest) (*loomv1.RegisterToolResponse, error)
RegisterTool dynamically registers a new tool.
func (*Server) RequestToolPermission ¶
func (s *Server) RequestToolPermission(ctx context.Context, req *loomv1.ToolPermissionRequest) (*loomv1.ToolPermissionResponse, error)
RequestToolPermission requests user permission to execute a tool.
func (*Server) SetActiveProviderName ¶ added in v1.2.0
SetActiveProviderName updates the tracked active provider name.
func (*Server) SetEvalStore ¶ added in v1.2.0
SetEvalStore configures the evaluation store for persisting ABTest results.
func (*Server) SetJudgeServer ¶ added in v1.2.0
func (s *Server) SetJudgeServer(js *JudgeServer)
SetJudgeServer wires an in-memory JudgeServer so that ABTest can resolve req.JudgeId.
func (*Server) SetProviderFactory ¶
func (s *Server) SetProviderFactory(f *factory.ProviderFactory)
SetProviderFactory sets the LLM provider factory for dynamic model switching.
func (*Server) SetProviderPool ¶ added in v1.2.0
func (s *Server) SetProviderPool(pool map[string]agent.LLMProvider, active string)
SetProviderPool configures the server's named provider pool.
func (*Server) StreamWeave ¶
func (s *Server) StreamWeave(req *loomv1.WeaveRequest, stream loomv1.LoomService_StreamWeaveServer) error
StreamWeave streams agent execution progress.
func (*Server) SwitchModel ¶
func (s *Server) SwitchModel(ctx context.Context, req *loomv1.SwitchModelRequest) (*loomv1.SwitchModelResponse, error)
SwitchModel switches the LLM model/provider for a session.
func (*Server) Weave ¶
func (s *Server) Weave(ctx context.Context, req *loomv1.WeaveRequest) (*loomv1.WeaveResponse, error)
Weave executes a user query using the agent.
type UserIDConfig ¶ added in v1.2.0
type UserIDConfig struct {
// RequireUserID when true returns Unauthenticated if X-User-ID is missing.
RequireUserID bool
// DefaultUserID is used when RequireUserID is false and no header is present.
// Falls back to "default-user" if empty.
DefaultUserID string
// Logger is used for audit logging of user ID extraction. If nil, a no-op
// logger is used.
Logger *zap.Logger
}
UserIDConfig controls the behavior of the user ID interceptors.
type WorkflowExecution ¶
type WorkflowExecution struct {
ExecutionID string
Pattern *loomv1.WorkflowPattern
Result *loomv1.WorkflowResult
StartTime time.Time
EndTime time.Time
Status WorkflowStatus
Error string // Error message if failed
}
WorkflowExecution represents a single workflow execution with its metadata and results.
type WorkflowStatus ¶
type WorkflowStatus string
WorkflowStatus represents the execution state.
const ( WorkflowStatusRunning WorkflowStatus = "running" WorkflowStatusCompleted WorkflowStatus = "completed" WorkflowStatusFailed WorkflowStatus = "failed" WorkflowStatusCanceled WorkflowStatus = "canceled" )
type WorkflowStore ¶
type WorkflowStore struct {
// contains filtered or unexported fields
}
WorkflowStore persists workflow execution history in memory. In production, this could be backed by a database.
func NewWorkflowStore ¶
func NewWorkflowStore() *WorkflowStore
NewWorkflowStore creates a new workflow execution store.
func (*WorkflowStore) Count ¶
func (s *WorkflowStore) Count() int
Count returns the total number of workflow executions.
func (*WorkflowStore) Delete ¶
func (s *WorkflowStore) Delete(executionID string) error
Delete removes a workflow execution from the store.
func (*WorkflowStore) Get ¶
func (s *WorkflowStore) Get(executionID string) (*WorkflowExecution, error)
Get retrieves a workflow execution by ID.
func (*WorkflowStore) List ¶
func (s *WorkflowStore) List(status WorkflowStatus) []*WorkflowExecution
List returns all workflow executions, optionally filtered by status.
func (*WorkflowStore) Store ¶
func (s *WorkflowStore) Store(exec *WorkflowExecution)
Store persists a workflow execution record.
func (*WorkflowStore) StoreResult ¶
func (s *WorkflowStore) StoreResult(executionID string, result *loomv1.WorkflowResult) error
StoreResult updates the result of a completed workflow execution.
func (*WorkflowStore) UpdateStatus ¶
func (s *WorkflowStore) UpdateStatus(executionID string, status WorkflowStatus, errorMsg string) error
UpdateStatus updates the status of a workflow execution.